How to classify a sentence based on a few templates?

161 views Asked by At

I have a question about how chatbot platforms such as api.ai and wit.ai work. You only provide them with a few templates for each intent/class and then their system is able to classify the new user queries to one of those classes. I am trying to do the same and have tested algorithms such as SVM, logistic regression, naive bayes and a few other ones. For the feature extraction part I have tried most of the features that people usually use such as n-grams, vector representation, bow etc. What would be the best algorithm(s) in such case when there is a few templates per class?

Thanks Amir :)

1

There are 1 answers

0
taleodor On

You can't really do any good classification based on few examples. The way established platforms may do that is by looking for similar intents, examples, etc, which are already provided by other clients or creators of the system and then trying to extrapolate.

So the point is that they have some prior data already and they base the classification outcome on that prior.

What you could do though -- is to mine any open sources you can find for examples similar to yours. And then you can try to train your classifier on that. However, in any case it is worth having some reasonable set of training data first.