我使用FastText生成单词嵌入。我从下载了预先训练过的模型,模型有300个维,但是我想要100个维,所以我使用了减少模型命令,但是我得到了一个错误。import gensimgensim.models.fasttext.utils.reduce_model(model, 100)
我得到了AttributeError: mod
比如:can't pickle fasttext_pybind.fasttext objects。objects<fasttext.FastText._FastText object at 0x7f86e2b682e8>" so, using "fasttext.FastText._FastText" as the class of it
SyncMa
我在我的python库中使用了快速文本模型(来自官方的fasttext库)。为了运行我的u-test,我需要一个尽可能轻的模型(fasttext.FastText._FastText对象),这样我就可以在我的存储库中对其进行版本控制。我尝试创建了一个包含5行"fake.txt“和几个单词的假文本数据集,并调用 model = fasttext.train_unsupervised("./fake.txt")
fasttext.util.reduce
这是代码:from pathlib import Path
fasttext_model = base_path / "\lib\site-packages\fasttext\FastText.py in load_model(path)
439 """Load a model given a filepathAnaconda3\envs\project-r