C3W1_Practice_Assignment build_vocabulary Failed test case: vocab does not contain all words

I got the following error. But the printout from notebook is 9535

Failed test case: vocab does not contain all words.
Expected:
9535,
but got:
9517.

1 Like

hi James can you share a screenshot of the error?

Also check if you are working on an update assignment notebook, there was some changes done to one of the notebooks due to version change with nltk.data.

If you can confirm you are working on the latest version, then I need to see your codes by personal DM.

Thank you for your email. See attached screenshot. The notebook might be a new version, I saw a warning before but I set warning message off.

(attachments)

ok this doesn’t seem related to the nltk.data. please click on my name and then message me screenshot of the codes which gave you this output.

Regards
DP

Attached other 3 screenshots.

(attachments)

image removed as it contained grade function codes and posting codes from assignment is violation of Code of Conduct, if mentor wants to look at your codes they will ask you to personal DM the codes for review.

@jamesmyang

you are not suppose to post grade cell function codes on public post, it is against community guidelines.

@jamesmyang

Your code for the below line is incorrect

If the word is not in vocabulary yet, add it to vocabulary

for this code you were suppose to only take len function of vocab. no indexing or adding any numerical subsequently.

Even I changed to len(vacab), the notebook printed ‘Vocabulary contains 9535 words’, and passed all unit tests. But the grade still says “but got:
9517.”

did you pass the unit test?

hi @jamesmyang

I just the noticed notebook again, this could be due to the process tweet which includes stopwords(it was reported by other learners for other assignments). Let me ping the l.t. of course to check if the metadata needs correction.

@lucas.coutinho

Can you please check this assignment for the process tweet. the vocab size seems to be different than expected, although learner is passing the test.
Regards
DP

Thanks @Deepti_Prasad for flagging this.

I will take a look, probably it is something that I missed when fixing the assignment recently.

I let you all know once it is fixed.

Cheers,
Lucas

3 Likes

I also got “Vocabulary contains 9535 words” in the unit test but failed the graded assignment that stated I only generated 9517 words. Let me know also if the issue is with the assignment and when a fix is available. Thanks.