I am working on a project, wherein I take input from the user as free text and try to relate the text to what the user might mean. I have tried Stanford NLP which tokenizes the text into tokens, but I am not able to categorize the input. For example, the user might be greeting someone or sharing some problem he is facing. In case he is sharing some problem I need to categorize the problem as well.

Can someone help me with from where should I start?

  • $\begingroup$ First figure out what all you want to figure out, unless you know what all you want to detect there is no way you could solve this problem as the problem is not defined yet. More formally, you need to know what are your output variables. Any algorithmic problem is defined by its input and output variables. $\endgroup$
    – Ankur
    Jan 12, 2017 at 13:33

1 Answer 1


Have you tried NLTK, what you are looking for is in Chapter 6 of the book. Basically what you need to do is:

  • Tokenize the user input.
  • Extract vector set from the tokenized words.
  • Train your model with some given texts, and same vector sets.

And you can use your model to categorize the document.

One other suggestion, instead of extracting vector sets you can use every word in the input to be evaluated in to some category using a training set of large corpus, which you are sure it contains all the words. And then you multiply probability of each word being on a category to decide where the document belongs.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .