c3Week3 fit_vectorizer gives AttributeError: 'NoneType' object has no attribute 'vocabulary_size

When creating a post, please add:

  • Week # must be added in the tags option of the post.
  • Link to the classroom item you are referring to:
  • Description (include relevant info but please do not post solution code or your entire notebook):
  • I completed the fit_vectorizer function using standardize to lower and strip puncuation and then adapted it to the dataset. But when I apply the vocabulary_size method I get an attribute error:
    " AttributeError: ‘NoneType’ object has no attribute 'vocabulary_size"

please post screenshot of the error without posting any grade cell codes. Also confirm if your query is from week 3 or week 2

the fit vectorizer required one to instantiate tokenizer class using TextVectorization function and use the standardize as well as assign MAX_LEN(max length) to the output sequence length, to make sure when the vectorizer was adapt to fit the sentences, the desired vocabulary size is selected.

Thanks. I figured it out.

1 Like