fasttext

ModuleNotFoundError: No module named 'fasttext'

左心房为你撑大大i 提交于 2020-07-20 10:35:03
问题 I have tried installing fasttext through conda using two channels: conda install -c conda-forge fasttext and conda install -c conda-forge/label/cf201901 fasttext as per (https://anaconda.org/conda-forge/fasttext). I am using the following command to import: import fasttext However, the import fails with the error: ModuleNotFoundError Traceback (most recent call last) in ----> 1 import fasttext ModuleNotFoundError: No module named 'fasttext' However, tried to import it in an older fashion

Difference between max length of word ngrams and size of context window

若如初见. 提交于 2020-06-13 08:47:45
问题 In the description of the fasttext library for python https://github.com/facebookresearch/fastText/tree/master/python for training a supervised model there are different arguments, where among others are stated as: ws : size of the context window wordNgrams : max length of word ngram. If I understand it right, both of them are responsible for taking into account the surrounding words of the word, but what is the clear difference between them? 回答1: First, we use the train_unsupervised API to

Sentiment analysis and fasttext: import error

牧云@^-^@ 提交于 2020-06-01 07:40:48
问题 I want to run some sentiment analysis using FastText . However, I have always got errors during the declaration of libraries and no example and tutorial within the web seems to be able to fix this. I have tried to follow the steps described here: https://github.com/facebookresearch/fastText/tree/master/python#installation but since the beginning, i.e. since import fasttext from fasttext import train_unsupervised I have been getting the following error: ----------------------------------------

Installing pyfasttext on windows

 ̄綄美尐妖づ 提交于 2020-05-01 04:35:43
问题 I tried to install pyfasttext on windows 10 under python 3.6 as explained here. I have g++ from mingw, clang LLVM 7.0.1 and put both of them on environment variable. I set USE_CYSIGNALS=0 because I'm on windows. But when I run the command: python setup.py install I got the following error: File "setup.py", line 66, in build_extensions if 'clang' in self.compiler.compiler[0]: AttributeError: 'MSVCCompiler' object has no attribute 'compiler' Can anyone help me on this, I want to be able to use

Installing pyfasttext on windows

拟墨画扇 提交于 2020-05-01 04:32:19
问题 I tried to install pyfasttext on windows 10 under python 3.6 as explained here. I have g++ from mingw, clang LLVM 7.0.1 and put both of them on environment variable. I set USE_CYSIGNALS=0 because I'm on windows. But when I run the command: python setup.py install I got the following error: File "setup.py", line 66, in build_extensions if 'clang' in self.compiler.compiler[0]: AttributeError: 'MSVCCompiler' object has no attribute 'compiler' Can anyone help me on this, I want to be able to use

Loading Gensim FastText Model with Callbacks Fails

半腔热情 提交于 2020-04-30 11:21:09
问题 After creating a FastText model using Gensim, I want to load it but am running into errors seemingly related to callbacks. The code used to create the model is TRAIN_EPOCHS = 30 WINDOW = 5 MIN_COUNT = 50 DIMS = 256 vocab_model = gensim.models.FastText(sentences=model_input, size=DIMS, window=WINDOW, iter=TRAIN_EPOCHS, workers=6, min_count=MIN_COUNT, callbacks=[EpochSaver("./ftchkpts/")]) vocab_model.save('ft_256_min_50_model_30eps') and the callback EpochSaver is defined as from gensim.models

Loading Gensim FastText Model with Callbacks Fails

£可爱£侵袭症+ 提交于 2020-04-30 11:19:59
问题 After creating a FastText model using Gensim, I want to load it but am running into errors seemingly related to callbacks. The code used to create the model is TRAIN_EPOCHS = 30 WINDOW = 5 MIN_COUNT = 50 DIMS = 256 vocab_model = gensim.models.FastText(sentences=model_input, size=DIMS, window=WINDOW, iter=TRAIN_EPOCHS, workers=6, min_count=MIN_COUNT, callbacks=[EpochSaver("./ftchkpts/")]) vocab_model.save('ft_256_min_50_model_30eps') and the callback EpochSaver is defined as from gensim.models

Loading Gensim FastText Model with Callbacks Fails

大憨熊 提交于 2020-04-30 11:18:59
问题 After creating a FastText model using Gensim, I want to load it but am running into errors seemingly related to callbacks. The code used to create the model is TRAIN_EPOCHS = 30 WINDOW = 5 MIN_COUNT = 50 DIMS = 256 vocab_model = gensim.models.FastText(sentences=model_input, size=DIMS, window=WINDOW, iter=TRAIN_EPOCHS, workers=6, min_count=MIN_COUNT, callbacks=[EpochSaver("./ftchkpts/")]) vocab_model.save('ft_256_min_50_model_30eps') and the callback EpochSaver is defined as from gensim.models

Faxttext 快速文本分类

馋奶兔 提交于 2020-04-28 05:09:32
Fasttext 文本分类模型 只讲关键,不讲具体训练、loss的设计技巧。 1. 词嵌入模型 ​ NLP的首要问题就是寻求恰当的文本表示方法。因为,良好的文本表示形式,是后续进一步处理的基础。传统的机器学习方法使用 词袋模型,把每个词都做为独立的特征。然而这种方式,丢弃了词语之间的相关信息,往往限制了模型的泛化能力,而且模型输入数据具有上百万的维度,难以处理。因此,另一种词表征方式 "词嵌入" 应运而生。 ​ 词嵌入背后的直觉很简单,自然文本中,同时出现的单词在语义上有联系,那么我们可以用某个模型来学习这些联系,这样训练好后,就可以拿出隐含层,作为词的一种表示(降维,embedding),词向量。训练好的词向量的几何性质与词语的语义性质存在着对应关系,比如聚类性质,语义类似的向量之间的距离总是较小,因而这些词会倾向于聚成一类。例如,距离狗(dog)最近的词向量是猫(cat)、鼠(mouse)等等,这些词都代表了动物。聚类性在几何上对应为向量间的距离。 2. 词嵌入的训练方式 ​ word2vec ( CBOW , skip-gram ) 和 Glove 模型是无监督训练词向量的热门方式,后面 word2vec 的作者去了Facebook之后又在 CBOW 的基础上,提出了 fasttext 文本分类模型,利用标签的监督信息,训练词向量。 2.1 无监督训练方法-CBOW

windows+python3.6下安装fasttext+fasttext在win上的使用+gensim(fasttext)

偶尔善良 提交于 2020-04-25 16:01:36
转自: windows+python3.6下安装fasttext+fasttext在win上的使用+gensim(fasttext) 真是坑了好久,faxttext对win并不是很友好,所以遇到了很多坑,记录下来,以供大家少走弯路。 法1:刚开始直接用pip install fasttext,最后一直报下面这个错误 “error:Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools”,然后我按着链接去找,已经没有了,最后只好在网上其他博客找到链接, 根据 stackoverflow上的帮助 下载 Visual Studio Community 2017 安装,然而。。。。。 上面是别人的方法:先去安装vs2017+fasttext安装包,别人的步骤(https://blog.csdn.net/m0_37870649/article/details/80935307) 一、 点击下载 source code(zip) 文件 二、解压后在该文件下打开 cmd, 输入 pip setup.py install 上面这种方法我试了,然后