yandexdataschool / nlp_course

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

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

Closed bogdansalyp closed 1 month ago

bogdansalyp commented 10 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 10 months ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB