-
Notifications
You must be signed in to change notification settings - Fork 100
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
Different results from command line tool #49
Comments
I've been able to reproduce this and have isolated the issue to the trailing newline character. Apparently, this is rooted in FastText itself; however, the problem probably does not arise there because it operates on line-by-line input, whereas the Java API allows for arbitrary (multi-line) strings.
Now without trailing newline:
Running on the command line, using the java package (created with
Again, without trailing newline:
In the Java API, this is also reproducible. With trailing newline:
Without trailing newline:
The results are the same as above with |
This is actually a known issue in FastText, see: |
Based on what @carschno mentioned, I used this to get the right results:
|
The predict-prob method return different results in the java and the native command line tool.
Foe example see the results from test05PredictProba in the JFastTextTest class (or test with your own model).
The java return probability is: 0.500125
The C++ native tool return probability is: 0.500075
Right, this looks like a minor not important, but when test the probs results with large model files, I see huge gap between the return probabilities.
The text was updated successfully, but these errors were encountered: