-
Notifications
You must be signed in to change notification settings - Fork 14
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
node-fasttext classification results doesn't match the original binary #16
Comments
The official library has a lot update. Which version of fastext do you use? So please provide some info about parameters you used? |
Fasttext binary built from latest source available facebookresearch/fastText@25d0bb0 and python library is of version - 0.8.3 as seen at https://pypi.org/project/fasttext/#history regarding parameters, here is the data: |
in fasttext python module def check(entry):
if entry.find('\n') != -1:
raise ValueError(
"predict processes one line at a time (remove \'\\n\')"
)
entry += "\n"
return entry every query sentence end up with \n std::vector<PredictResult> arr;
std::vector<int32_t> words, labels;
std::istringstream in(sentence);
dict_->getLine(in, words, labels);
if (words.empty())
{
return arr;
}
Vector hidden(args_->dim);
Vector output(dict_->nlabels());
std::vector<std::pair<real, int32_t>> modelPredictions;
model_->predict(words, k, 0.0001, modelPredictions, hidden, output); not auto add \n |
@lzpfmh Thank you for the investigation! |
Hi, I have tried using node-fasttext library in a project. To identify the best model parameters, I have relied on the official fasttext binary. When I use the same parameters with the node-fasttext library, I'm getting weird results. So unfortunately, I decided to use the python version of fasttext instead and it worked fine. Can you check if the node library is using the correct version of fasttext or if there any other reason causing this issue. I actually would like to use a node library in my future projects.
I would like to add a suggestion- it will be great if you consider the case of model training, model reloading and prediction multiple times with the same fasttext instance instead of new object creation for training - which currently leads to memory explosion.
The text was updated successfully, but these errors were encountered: