tokens = self.tokenizer.tokenize(text)

I have the same code as in the walkthrough, yet I'm getting the error in the title.

1 Answer 1


You don't have a "thing" named tokenizer. Review the hints section of the spec:

Odds are you’ll find nltk.tokenize.casual.TweetTokenizer of interest, which can be used to tokenize a tweet (i.e., split it up into a list of words) with code like:

   tokenizer = nltk.tokenize.TweetTokenizer()  
   tokens = tokenizer.tokenize(tweet)
  • why don't you need to add "casual" in the in "tokenizer = nltk.tokenize.TweetTokenizer()" ? Commented Jun 7, 2017 at 13:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .