yandexdataschool / nlp_course

YSDA course in Natural Language Processing
https://lena-voita.github.io/nlp_course.html
MIT License
9.83k stars 2.61k forks source link

fix: Added additional assert on week01 seminar to meet all get_phrase_embedding requirements #138

Closed bogdansalyp closed 2 months ago

bogdansalyp commented 11 months ago

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.

review-notebook-app[bot] commented 11 months ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB