I am trying to load a trained fasttext model using gensim. The model has been trained on some data. Earlier, I have used model.save()
with a extension of .bin
to use it later. After the training process and saving the model using model.save
in .bin
format, generates 3 files respectively. They are:
1) .bin
2) bin.trainable vectors_ngrams_lockf
3) bin.wv.vectors_ngrams
Now I am unable to load the trained binary file (.bin).
But I don't understand why I am getting a error named:
raise NotImplementedError("Supervised fastText models are not supported") NotImplementedError: Supervised fastText models are not supported
After going through many blogs, peoples have suggested that gensim
does not supports supervised training. It's fine. My question is how can I be able to load the trained binary model. Shall I need to train the model differently.
Any help is appreciated.
What I have tried after the training process:
import logging
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
from gensim.models import FastText, fasttext
model = FastText.load_fasttext_format('m1.bin')
print(model)
如果模型中保存gensim
的原生.save()
方法,你会与加载.load()
-未load_fasttext_format()
它仅用于保存在由Facebook的原FastText C ++代码中使用RAW格式的机型。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.