Skip to content
Advertisement

python nltk — stemming list of sentences/phrases

I have bunch of sentences in a list and I wanted to use nltk library to stem it. I am able to stem one sentence at a time, however I am having issues stemming sentences from a list and joining them back together. Is there a step I am missing? Quite new to nltk library. Thanks!

JavaScript

Advertisement

Answer

You’re passing a list to word_tokenize which you can’t.

The solution is to wrap your logic in another for-loop,

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement