I'm new to AI and specifically NLP, I always love to study things as part of a random project I decide to build, right now I'm working on a chat bot and I was looking for an easy way(in terms of code) to extract the main topic/subject from a sentence(in English), the problem is that wherever I search, even if it's a simple code, it combines a full sentence "meaning"(device parts of speech), I don't like to implement something I don't understand so a small step for how to extract only the subject will be really good and can help my bot with some directions, Is there a simple code(don't care what language it written with) to extract, only main topic/s from a sentence(in English)?.

  • $\begingroup$ I think you are looking for a topic model or a summary. These are fairly advanced models, though; I would recommend beginning with something simpler. $\endgroup$
    – Emre
    Commented Mar 29, 2016 at 18:21
  • $\begingroup$ @Emre As I mentioned I'm new to the field, can you suggest any simpler ones? $\endgroup$ Commented Mar 29, 2016 at 18:46
  • $\begingroup$ Totally agree with @Emre. I would also check out Introduction to Statistical Learning. The authors have a MOOC too. lagunita.stanford.edu/courses/HumanitiesandScience/StatLearning/… $\endgroup$
    – dmb
    Commented Mar 29, 2016 at 22:11

1 Answer 1


You could learn about word embeddings. These will provide you a natural path to topic models, and many other NLP tasks. Look up word2vec.

I think it is better not to learn two new subjects (NLP and ML) at once. I would start with ML on its own; take this class perhaps. A good place to start is linear regression, or binary classification.

  • $\begingroup$ Thank you for the direction, I was really needed some guidance. $\endgroup$ Commented Mar 29, 2016 at 19:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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