-
Notifications
You must be signed in to change notification settings - Fork 902
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
Handing errors #77
Labels
Milestone
Comments
Oops, I forgot I opened #65 already! Will keep this issue in lieu of that one, but will note here that another scenario is trying to use a model before it is loaded! |
Closed
dariusk
added a commit
to dariusk/ml5
that referenced
this issue
Mar 2, 2018
In issue ml5js#77 it's noted that Word2Vec throws an unhelpful error message when you ask for the average of 2 words where one word isn't in the dictionary. This can be traced to a less-than-helpful error message thrown by `sum()`, which is called by `average()`. This commit changes `sum()` to throw a "not found" `Error` object that lists the words that were not found. This object propagates up to the `average()` function.
Merged
Amazing work, thank you @cvalenzuela! |
joeyklee
pushed a commit
that referenced
this issue
Jun 2, 2019
In issue #77 it's noted that Word2Vec throws an unhelpful error message when you ask for the average of 2 words where one word isn't in the dictionary. This can be traced to a less-than-helpful error message thrown by `sum()`, which is called by `average()`. This commit changes `sum()` to throw a "not found" `Error` object that lists the words that were not found. This object propagates up to the `average()` function.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks also to @dariusk I'm writing this issue to open a discussion about error handling. We should develop a plan and style guide for handling errors. At a minimum we should have custom console.logs to give users information about errors, but we should likely use some sort of
try
,catch
,throw
magic.A good example scenario as demonstrated by @dariusk is the following:
Right now the error produced is a lot of
NDArray
garble and we should alert the user thataskdjfkjalksdjf
is not a word in the word2vec dictionary.The text was updated successfully, but these errors were encountered: