fasttext

Process finished with exit code -1073740791 (0xC0000409) pycharm error

送分小仙女□ 提交于 2019-12-17 09:57:26
问题 I am trying to use fastText with PyCharm. Whenever I run below code: import fastText model=fastText.train_unsupervised("data_parsed.txt") model.save_model("model") The process exits with this error: Process finished with exit code -1073740791 (0xC0000409) What causes this error and what can be done to avoid it? 回答1: Are you using a windows system? 0xC0000409 means stack buffer overflow as seen in this windows help link. Below is some advice that is taken from this link to solve similar type

Fast Text unsupervised model loss with Python API

拥有回忆 提交于 2019-12-13 03:46:09
问题 Is there any way to get the model loss for the unsupervised training of models using Fast Text with the python API? At the moment I am doing the training using the C++ model and loading it using the Python API. For e.g., I first run the following code to tweak hyper parameters ./fasttext skipgram \ -input /data/cleaned.txt \ -output /models/cleaned-model \ -epoch 12000 \ -minCount 2 \ -ws 3 The command-line interface gives an estimate of the loss like so: Progress: 100.0% words/sec/thread:

Registering and downloading a fastText .bin model fails with Azure Machine Learning Service

◇◆丶佛笑我妖孽 提交于 2019-12-11 19:13:18
问题 I have a simple RegisterModel.py script that uses the Azure ML Service SDK to register a fastText .bin model. This completes successfully and I can see the model in the Azure Portal UI (I cannot see what model files are in it). I then want to download the model (DownloadModel.py) and use it (for testing purposes), however it throws an error on the model.download method ( tarfile.ReadError: file could not be opened successfully ) and makes a 0 byte rjtestmodel8.tar.gz file. I then use the

Using subword information in OOV token from fasttext in word embedding layer (keras/tensorflow)

我们两清 提交于 2019-12-11 10:57:35
问题 I have my own Fasttext model and trained with it a keras classification model with a word embedding layer. But, I wonder how I can make use of the subword information of my model for OOV words? Since the word embedding layer operated via indices to look up word vectors and OOV words have no index. Even if a OOV token has a index how would I assign it the proper word vector to this OOV on the fly for an already trained model? Thanks in advance! 来源: https://stackoverflow.com/questions/56043487

Gensim most_similar() with Fasttext word vectors return useless/meaningless words

此生再无相见时 提交于 2019-12-11 04:49:10
问题 I'm using Gensim with Fasttext Word vectors for return similar words. This is my code: import gensim model = gensim.models.KeyedVectors.load_word2vec_format('cc.it.300.vec') words = model.most_similar(positive=['sole'],topn=10) print(words) This will return: [('sole.', 0.6860659122467041), ('sole.Ma', 0.6750558614730835), ('sole.Il', 0.6727924942970276), ('sole.E', 0.6680260896682739), ('sole.A', 0.6419174075126648), ('sole.È', 0.6401025652885437), ('splende', 0.6336565613746643), ('sole.La',

How to convert gensim Word2Vec model to FastText model?

非 Y 不嫁゛ 提交于 2019-12-07 17:52:10
问题 I have a Word2Vec model which was trained on a huge corpus. While using this model for Neural network application I came across quite a few "Out of Vocabulary" words. Now I need to find word embeddings for these "Out of Vocabulary" words. So I did some googling and found that Facebook has recently released a FastText library for this. Now my question is how can I convert my existing word2vec model or Keyedvectors to FastText model? 回答1: FastText is able to create vectors for subword fragments

FastText using pre-trained word vector for text classification

≡放荡痞女 提交于 2019-12-06 22:16:33
问题 I am working on a text classification problem, that is, given some text, I need to assign to it certain given labels. I have tried using fast-text library by Facebook, which has two utilities of interest to me: A) Word Vectors with pre-trained models B) Text Classification utilities However, it seems that these are completely independent tools as I have been unable to find any tutorials that merge these two utilities. What I want is to be able to classify some text, by taking advantage of the

【NLP】【八】基于keras与imdb影评数据集做情感分类

烈酒焚心 提交于 2019-12-06 21:36:28
【一】本文内容综述 1. keras使用流程分析(模型搭建、模型保存、模型加载、模型使用、训练过程可视化、模型可视化等) 2. 利用keras做文本数据预处理 【二】环境准备 1. 数据集下载:http://ai.stanford.edu/~amaas/data/sentiment/ 2.安装Graphviz ,keras进行模型可视化时,会用到该组件: https://graphviz.gitlab.io/_pages/Download/Download_windows.html 【三】数据预处理 将imdb压缩包解压后,进行数据预处理。 1. 将每条影评中的部分词去掉 2. 将影评与label对应起来 3. 将影评映射为int id,同时将每条影评的长度固定,好作为定长输入数据 # -*- coding:utf-8 -*- import keras import os import numpy as np import re from keras.preprocessing import text from keras.preprocessing import sequence from keras.utils import plot_model import matplotlib.pyplot as plt Reg = re.compile(r'[A-Za-z]*')

precision and recall in fastText?

故事扮演 提交于 2019-12-06 06:39:20
问题 I implement the fastText for text classification, link https://github.com/facebookresearch/fastText/blob/master/tutorials/supervised-learning.md I was wondering what's the precision@1, or P@5 means? I did a binary classification, but I tested different number, I don't understand results: haos-mbp:fastText hao$ ./fasttext test trainmodel.bin train.valid 2 N 312 P@2 0.5 R@2 1 Number of examples: 312 haos-mbp:fastText hao$ ./fasttext test trainmodel.bin train.valid 1 N 312 P@1 0.712 R@1 0.712

How to convert gensim Word2Vec model to FastText model?

[亡魂溺海] 提交于 2019-12-06 02:57:43
I have a Word2Vec model which was trained on a huge corpus. While using this model for Neural network application I came across quite a few "Out of Vocabulary" words. Now I need to find word embeddings for these "Out of Vocabulary" words. So I did some googling and found that Facebook has recently released a FastText library for this. Now my question is how can I convert my existing word2vec model or Keyedvectors to FastText model? FastText is able to create vectors for subword fragments by including those fragments in the initial training, from the original corpus. Then, when encountering an