NaturalNode / natural

general natural language facilities for node
MIT License
10.65k stars 859 forks source link

Sentence Information #247

Closed TheColorRed closed 9 years ago

TheColorRed commented 9 years ago

Is it possible to get information about a sentence (or paragraph)?

I would like to be able to get information about a sentence, such as:

I am mostly interested in finding the subject of the sentence/paragraph at the moment, so for example:

What is the best kind of pizza?

The subject here would be Pizza

mbc1990 commented 9 years ago

Natural doesn't have a part of speech tagger, although there might be a way to use WordNet to do that. Regardless, the part of speech tagging algorithms are not very complicated and you could implement one yourself in a few hours.

Your second question is broader and I think you're unlikely to find any out of the box solutions that do everything you want. Look into sentiment analysis and named entity recognition as a starting point. If you can make some assumptions about the syntax of the grammar in your input, you might be able to use a statistical parser to match your sentences' grammatical structure to a pattern and extract the subject that way.

kkoch986 commented 9 years ago

I would gladly help someone with a PR for part of speech tagging, its been on my list for awhile but i dont have as much time to spend building out new features as i would like. The answer from @mbc1990 pretty well sums it up! Also sentiment analysis and n/e are also features we will hopefully support in the future

ghost commented 9 years ago

I would be interested in helping with POS tagging, NP extraction, sentiment analysis and language translation / detection. All these features are pretty standard on NLTK/Textblob in the Python realm. JS can do it as well.