All functions pass (vocab size incorrect) but scoring is 0 / 100. The output from the grader for each marked item is “There was a problem compiling the code from your notebook. Details:
argument 1 must be an iterator”
If refreshing the workspace doesn’t help, please click my name and message your notebook as an attachment.
The function def tokenize_labels(labels):
is wrong.
You are creating a local variable label_tokenizer
and using the global variable tokenizer
for transforming the labels.
This is the difference between expected and actual outputs:
Expected output
Vocabulary of labels looks like this {‘sport’: 1, ‘business’: 2, ‘politics’: 3, ‘tech’: 4, ‘entertainment’: 5}
First ten sequences [[4], [2], [1], [1], [5], [3], [3], [1], [1], [5]]
Actual output
Vocabulary of labels looks like this {‘’: 1, ‘s’: 2, ‘said’: 3, ‘will’: 4, ‘not’: 5, ‘mr’: 6, ‘year’: 7, ‘also’: 8, ‘people’: 9, ‘new’: 10, ‘us’: 11, ‘one’: 12, ‘can’: 13, ‘business’: 14, ‘last’: 15, ‘first’: 16, ‘t’: 17, ‘time’: 18, ‘two’: 19, ‘world’: 20, ‘sport’: 21, ‘government’: 22, ‘now’: 23, ‘uk’: 24, ‘years’: 25, ‘no’: 26, ‘best’: 27, ‘just’: 28, ‘make’: 29, …
First ten sequences [[38], [14], [21], [21], [32], [30], [30], [21], [21], [32]]
@Brendon_Wolff-Piggot Please correct if something is wrong.
To summarize, the problem was with the name of the notebook. Learner submission should match the starter notebook name for the grader to pick the right changes. In this case, the assignment submission should have the name C3W1_Assignment.ipynb
as indicated before confirming the submission.
I did the same mistake. Thanks Balaji!