Grading error, reversed index-value - missing 10% score

Hi,
I tried to report this using the error reporting tool, but it’s broken and does not allow selecting which step is failing so I’m posting this here.

Correct me if I’m wrong, but when grading, the index and value is listed in reverse order which shows up as an error. I don’t know how this could switched around as it appears to be the way Python outputs this content.
See below:

Failed test case: incorrect label_word_index when using labels: ['tech', 'tech', 'entertainment', 'sport', 'business'].
Expected:
{'tech': 1, 'entertainment': 2, 'sport': 3, 'business': 4},
but got:
{1: 'tech', 2: 'entertainment', 3: 'sport', 4: 'business'}.

Ohh dear,
just realized, there is another attribute called word_index which returns the correct result :slight_smile:

Still the report error still needs fixing.

Hello @Edward_Hiscoke ,

Welcome to the Community!

Have you been able to resolve the failed Test case error?
If not, you can dm me your notebook.I will check why it’s getting reversed.

With regards,
Nilosree Sengupta

Sorry for not getting back to you. Yes it’s reolved

Hello @Edward_Hiscoke ,

That’s alright!
Good to note that you could solve it on your own.

With regards,
Nilosree Sengupta