DLS5, W2, A1 Can't compile student's code

Hello everyone!

Got following error on submission
Exercise 4
Cell #5. Can’t compile the student’s code. Error: TypeError(“‘int’ object is not subscriptable”,)

I suspect this error concerns to function call equalize(pair, bias_axis, word_to_vec_map).


What is in cell # 5?

Exercise 4 - equalize

Implement the equalize() function below.

Use the equations above to get the final equalized version of the pair of words. Good luck!


def equalize(pair, bias_axis, word_to_vec_map):
    Debias gender specific words by following the equalize method described in the figure above.
    pair -- pair of strings of gender specific words to debias, e.g. ("actress", "actor") 
    bias_axis -- numpy-array of shape (50,), vector corresponding to the bias axis, e.g. gender
    word_to_vec_map -- dictionary mapping words to their corresponding vectors
    e_1 -- word vector corresponding to the first word
    e_2 -- word vector corresponding to the second word

Additionally word_to_vec_map (dictionary) is only variable that I use with subscription op.
Probably, it is called with int instead dictionary.

Send me your code of equalize function in a private message. Click my name and message.

I just checked the assignment notebook. Cell # 5 has the complete_analogy, not the equalize code. Also, equalize is the ungraded part so it is not checked by the grader.

Please check the code of complete_analogy function.

I inserted a cell with tests just before complete_analogy function, so I break the rule

  1. You have not added any extra code cell(s) in the assignment.

If you need, here is the guide on how to get a fresh copy of your assignment.