In week01 seminar code in the get_phrase_embedding function there's a requirement to return all zeros if no words are recognized in the phrase.
However, it's not checked in following asserts and may backfire only in the find_nearest function during the dot product operation with a non-intuitive "dimensions don't match" error.
I'd suggest to add an additional assert to check for the corner case requirement and save students' time.
In week01 seminar code in the
get_phrase_embedding
function there's a requirement to return all zeros if no words are recognized in the phrase.However, it's not checked in following asserts and may backfire only in the
find_nearest
function during the dot product operation with a non-intuitive "dimensions don't match" error.I'd suggest to add an additional assert to check for the corner case requirement and save students' time.