I was reading some articles on topic classification, in which some algorithm uses snippets of text as input and tries to classify them in topics, and I thought of implementing this technique in my application, where I would receive user reviews, classifying them in topics (such as suggestions, compliments and criticism) and return an appropriate response for that user, all in an automated way.
According to what I read, it is possible to transform text into topics using the bag of words technique (which I have already implemented), but I found nothing related to finding an appropriate answer for that user based on the topic found. Obviously, a standard answer could be returned for each topic, but something more human would make the system less robotic.
So, my question is whether there is any algorithm or technique that does something like this:
inputs = {
"compliment": [
"thank you, it makes our day to hear that",
"we really put a lot of thought into this, thank you for noticing",
"we are happy to hear you feel that way",
"thank you, it is great to hear you feel that way",
],
"suggestion": [
"thank you so much for your idea",
"this suggestion is really interesting",
"we'd love to hear your suggestions",
"what a great idea",
]
}
classifier = // some classifier or algorithm that handles `inputs`
response = classifier.get("compliment")
// `response` contains a combination of the texts passed as input, such as
// "thank you, we really put a lot of thought into this, it is great to hear you feel that way"
// if we call `response` again, it should generate a new combination, based on the input texts
This is only an example, I have dozens of responses for each topic. I had some ideas, but none of them work: choosing responses randomly (but after a while the texts will become repetitive, as there will be more user reviews than input texts) and merging random parts of each text (but it would have the chance of the texts not making sense, like "we are happy thought into this, our day to hear that"). Generating new texts based on the input texts would also be interesting.
Thanks in advance!