-
Notifications
You must be signed in to change notification settings - Fork 903
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Word2vec.nearestFromSet() is always null output #1161
Conversation
Word2vec.nearestFromSet() is giving always null output. Reason: !miniModel.length is always true because miniModel is object and length attribute is undefined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review.
I have resolved the typo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tagging in @bomanimc our ml5 lead here.
I've reviewed this PR and it looks like it shouldn't introduce any breaking changes (it actually should fulfill the expected behavior!). Since minModel
is defined as an object and Object.keys(minModel)
will always return an array []
, the length
property should always exist. And so if there are no elements in the array, then we can successfully null.
Nice one @Mudasar-Makandar !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@all-contributors please add @Mudasar-Makandar for bug code |
I've put up a pull request to add @Mudasar-Makandar! 🎉 |
NOTE @Mudasar-Makandar -- because word2vec has been disabled in ml5, I wanted to merge this PR in anyways just to recognize your efforts. Even though your changes won't be in effect, I still wanted to make sure that you are shown as a contributor for this bug fix. Thanks so much and apologies that this fix did not make it in before word2vec was disabled in ml5. |
Dear ml5 community,
I'm making a Pull Request(PR). Please see the details below.