fabianvf / python-rake

MIT License
130 stars 35 forks source link

Filter results by word/phrase category #41

Closed geoffrey-eisenbarth closed 6 years ago

geoffrey-eisenbarth commented 6 years ago

Love the package! I was wondering if there is a way to return only results that fit one of NLTK's "Parts of Speech"? I'd love to contribute, but sadly my knowledge regarding the inner workings of NLTK is a bit lacking (at the moment!).

As an example, I'm hoping to use some NLTK/RAKE type package to automatically assign keywords to blog posts. After running a few test scenarios using the current package, I find that some of the higher-ranked keywords returned by python-rake are, say, adjectives, adverbs, etc., where I'm really hoping for nouns, noun phrases, possibly even proper nouns.

I feel like this feature would benefit anyone using the package, but I could be wrong. Thoughts?

jkterry1 commented 6 years ago

This seems beyond the scope of the intent of this project to me. That being said, it seems fairly trivial to do on your own. You'd just take the list of words produced by rake, tag them with NLTK, and remove the ones with a tag you don't want to keep.

geoffrey-eisenbarth commented 6 years ago

Understandable, thanks for the tip!