This is a proprietary system so we have no way of knowing.
In general, you will find a lot of work and potential solutions by searching for text similarity or document similarity. For starters, you could have a look at the work of Islam and Inkpen  on short sentence similarity (it mentions plenty of other references you can widen your search to) or a ...
Check this out. This might be the paper
The paper says:
"we also added the semantically-empty label named GENERAL to our inventory to cover the 135 categories that could not be included in any cluster."
I suggest you read that as though it had said
we also added the label named GENERAL to our inventory to cover the 135 categories that could not be included in any cluster. This label is not ...
You should look into Theory of Automata, Languages and Computation:
These are the theoretical foundations of scanning, parsing and processing text (and furthermore constructing formal languages and grammars).
Components of the theory, are, for example:
Context free grammars
Parsing techniques such as recursive decent, LL or SLR parsing.
I've found a survey on natural-language generation approaches by Albert Gatt, Emiel Krahmer, 2018. According to that, my question is about linguistic realization. And the paper mentions three most common ones:
human-crafted grammar-based systems
If I remember correctly, there may also be rules-based NLG ...