Cell #13. Can't compile the student's code. Error: KeyError('never',)

Hello,
Please assist with this issue. All tests are passed but I get 0/100. Other post suggest double-checking avg initialisation, but I see no error there. Could it be some other issue? Tried restarting kernel with no luck

Thanks

Please do not post your code on the Forum. That breaks the course Honor Code.

Sorry about that, deleted now. Any suggestions on the issue?

I recommend you:

  1. Look at your code in the sentences_to_indices() function.
  2. Look at your model() function, and see if you are calling sentence_to_avg() correctly.

When you get a key error, it means somewhere you’re using a specific word from the notebook, which makes the grader break (because it uses a different set of data).

1 Like

Thanks, your recommendations solved my issue.
While reading other threads I convinced myself that the issue was with the averaging function. Didn’t even notice that silly line of code in the other cell.

Thanks again for prompt reply :slight_smile: