The problem is in confusing movie_reviews
and reviews
movie_review
is defined by importing from nltk.corpus
and has a method words
.
reviews
is a variable to which you have assigned a string. And the string does not have a method words
, as you were told by the error message.