Skip to content

Instantly share code, notes, and snippets.

@andrewclegg
Created September 13, 2016 11:37
Show Gist options
  • Save andrewclegg/029adf8d2310aecf80289766c89d6283 to your computer and use it in GitHub Desktop.
Save andrewclegg/029adf8d2310aecf80289766c89d6283 to your computer and use it in GitHub Desktop.
diff --git a/src/fasttext.cc b/src/fasttext.cc
index 93b7add..a6cc3f4 100644
--- a/src/fasttext.cc
+++ b/src/fasttext.cc
@@ -43,6 +43,11 @@ void FastText::saveVectors() {
getVector(vec, word);
ofs << word << " " << vec << std::endl;
}
+ for (int32_t i = 0; i < dict_->nlabels(); i++) {
+ std::string label = dict_->getLabel(i);
+ getVector(vec, label);
+ ofs << label << " " << vec << std::endl;
+ }
ofs.close();
}
@@ -306,9 +311,9 @@ void FastText::train(std::shared_ptr<Args> args) {
model_ = std::make_shared<Model>(input_, output_, args_, 0);
saveModel();
- if (args_->model != model_name::sup) {
+ //if (args_->model != model_name::sup) {
saveVectors();
- }
+ //}
}
void printUsage() {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment