Problem : Generate a text output based on input strings which will be combined using a number of rules.

Example :

       Feature1               Feature2                    O/P

Rule 1  Enum_Domain           Priority          /Enum_Domain/Priority

Rule 2 Enum_Domain.EnumData   Name              /Enum_Domain/EnumData/Name

Rule 1  Trunkgroup            Gateway            /Trunkgroup/Gateway

Rule 2  GatewayGrp.Gateway    IP                /GatewayGrp/Gateway/IP

This is a simple programming problem, but is there any machine learning algorithm that can learn these rules and generate the output based on the two inputs.

  • 1
    $\begingroup$ RNN? $\endgroup$
    – Haitao Du
    Oct 11 '17 at 18:09
  • 3
    $\begingroup$ It looks like machine learning would be an overkill since this task can be done using text edition tools like sed. $\endgroup$ Oct 12 '17 at 7:59
  • $\begingroup$ Yeah.. absolutely. Just want to know how it can be done, $\endgroup$
    – jumov
    Oct 12 '17 at 9:55

The idea in machine learning is that the algorithm to find out patterns or rules which hasn't been defined. Your example fits to experts systems definition.

But, yes you can use machine learning to generate text out put.

This is a magazine article but it fits the bill:


  • $\begingroup$ This article mentions Random Forests. How can we implement this and get a text output ? $\endgroup$
    – jumov
    Oct 12 '17 at 11:03

As an example, RNN with encoder-decoder archs. are used in these cases. But it does not necessarily take text input. You need to convert your text to numeric, and an embedding layer learns cont. vector representations of the converted text. So yes, several ML models can achieve this particular goal, but I believe none of them processes raw text input. Data always needs to be converted to numeric before fed to any ML model.

The below article explains converting to numeric in the case of Neural Nets. with embedding layer:



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.