In Exercise 2 of the first Code Assignment, I’m facing the following assertion error:
AssertionError Traceback (most recent call last)
<ipython-input-82-321fc1e26750> in <module>
33 print("\033[92mAll tests passed")
34
---> 35 complete_analogy_test(complete_analogy)
<ipython-input-82-321fc1e26750> in complete_analogy_test(target)
29 assert(target('a', 'a_s', 'c', word_to_vec_map) == 'c_s')
30 assert(target('a', 'synonym_of_a', 'c', word_to_vec_map) != 'c'), "Best word cannot be input query"
---> 31 assert(target('a', 'c', 'a', word_to_vec_map) == 'c')
32
33 print("\033[92mAll tests passed")
AssertionError:
which indicates that I’m not getting the correct output for my complete_analogy() function. However, when I check individually for:
complete_analogy('a', 'c', 'a', word_to_vec_map)
I do get ‘c’ as an output. In fact, I tried the line on a separate cell,
assert(complete_analogy('a', 'c', 'a', word_to_vec_map) == 'c')
and it executes without error, so I don’t know why I keep getting the assertion error within the evaluation function.
Do you know what could be happening here?