C1_W2_Assignement Exercise_2 Train your Model using Naive Bayes Vocabulary

Hello all

I created vocabulary using
set([pair[0] for pair in freqs.keys()])
I am sure it is right solution but length of the vocabulary is 9161, but must be 9165. Is there any changes in the dataset?

Yes, that code looks correct. Are you running the notebook locally or on the Coursera platform? I just checked and it works correctly for me on the Coursera platform.

1 Like

I am running the notebook locally. If I launch the code on the Coursera platform then it is working correctly. Maybe some difference in the versions of libraries

Hi @Eugene_2024

Your issue is probably related to nltk versions mismatch. Here is a similar previous thread.