C2_w2 assignment Unit test outdated?

When creating a post, please add:

  • Week 2 assignment

  • Link to the classroom item you are referring to: Part of Speech Tagging | Coursera

  • Description (include relevant info but please do not post solution code or your entire notebook)

The test case for UNQ C1 seem to be outdated, the function itself is pretty straightforward, the next cell output correctly but the 4 tests keep failing in

w2_unittest.test_create_dictionaries(create_dictionaries, training_corpus, vocab)

error

Wrong output length for transition_counts dictionary.
	 Expected: 1421 
	Got: 136781.
Wrong output values for transition_counts dictionary.
	 Expected: {('VBN', 'TO'): 2142, ('CC', 'IN'): 1227, ('VBN', 'JJR'): 66}.
Wrong output length for transition_counts dictionary.
	 Expected: 272 
	Got: 683.
Wrong output values for transition_counts dictionary.
	 Expected: {('VBN', 'TO'): 3, ('CC', 'IN'): 2, ('VBN', 'JJR'): 1}.
 14  Tests passed
 4  Tests failed

I’m pretty confident that the code is correct. Anyone seeing the same issue?

1 Like

Hi @psyquy

Highly unlikely. The probability that your code is incorrect is way higher.
The test indicates that the issue lies intransition_counts. So that would be the best place to look at first.

Cheers

3 Likes

Hi @psyquy

If the assignment deadline has passed, make sure to push the end dates to get the latest version of files. Also, ensure that you double-check your code for any issues. If you can’t find any, you can send your code via Private Message (Click on Profile → Message) so we can find the problem together and faster!

1 Like

shared in private msg

1 Like

yes, i should have trusted the test :), it’s typos in my code.

3 Likes