Questions tagged [fasttext]
fastText is a library for efficient learning of word representations and sentence classification.
448
questions
-2
votes
0
answers
9
views
Fasttext not installing
not able to pip install fasttext This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure × Encountered error while trying to install package. ╰─&...
0
votes
1
answer
22
views
NLP how to get vectors of phrases/documents
I want to know how to generate vectors using NLP, if I'm not mistaken it should be done by sum or average of all words. However, it is not clear to me how the following sentences will generate ...
1
vote
1
answer
30
views
Awk Script for fastText vectors - Error: "unexpected character 0xe2" when there's no such character
I ran the following Awk script to get fastText vectors on my Ubuntu 22.04.2 LTS (Jammy Jellyfish).
However, I always get the same error code: awk: lines 5 and 13: unexpected character 0xe2
The Awk ...
0
votes
0
answers
18
views
No properties such as wordNgram is retrievable from fastText model object: `AttributeError: '_FastText' object has no attribute 'wordNgrams'`
As an official documentation says, properties of a fastText's model object, such as wordNgrams, can be retrieved by attaching the property name to the model object name, e.g. model.wordNgrams. However,...
0
votes
1
answer
24
views
Loading a pretrained fastText model with Gensim
I'm trying to load a pretrained German fastText model (source: https://dl.fbaipublicfiles.com/fasttext/vectors-crawl/cc.de.300.bin.gz) with Gensim. My intention is to fine-tune it using my own dataset....
0
votes
0
answers
20
views
How can you get the word out of a vector using fasttext?
I'm using fasttext for word embeding as part of a transformer network, I supposed that if there is a function to get the vector of a word(get_word_vector()), there is a function to get the word out of ...
0
votes
1
answer
21
views
FastText difference between saving directly and saving after build_vocab and training with epochs
I've been building FastText model and saving as following:
model = FastText(#some parameters)
model.build_vocab(corpus_strings)
model.train(corpus_iterable=corpus_strings, total_examples=len(...
0
votes
1
answer
22
views
Meaning of get_input_matrix and get_output_matrix in FastText Python API
I was playing with the FT Api and found out 2 methods, namely get_input_matrix and get_output_matrix. I am wondering what are the purposes of these? Are there any chance that those 2 are the weight ...
0
votes
2
answers
49
views
How does gensim calculate sentence embeddings when using a pretrained fasttext model?
According to this answer, sentence similarity for FastText is calculated with one of two ways (depending if the embeddings are created superviser or unsupervised)
The mean of the normalized word ...
0
votes
1
answer
20
views
Evaluate FastText embeddings
I want to evaluate my FastText model (trained on my own corpus).
For semantic meaning I understand that we can use a dataset containing several pairs of two words which have been scored by humans, and ...
0
votes
0
answers
21
views
FastText Unsupervised Training only detects small number of Chinese words
I'm using FastText to unsupervised train the model (the data.train file is a text file that contains 50,000 lines/1.7 million Chinese characters):
import fasttext
model = fasttext.train_unsupervised(...
0
votes
0
answers
12
views
How would you implement some of the measures for class imbalance treatment into fasttext? For example Weighted Cross entropy? Or focal loss?
How much is this implementation demanding? Are there any open resources to it? I would like to make some modification on the objective function or to create some methods for loss function that would ...
0
votes
1
answer
36
views
crawl-300d-2M-subword.zip corrupted or cannot be downloaded
I am trying to use this fasttext model crawl-300d-2M-subword.zip from the official page onI my Windows machine, but the download fails by the last few Kb.
I managed to successfully download the zip ...
1
vote
0
answers
41
views
Cannot run a python package in amazon sagemaker, but can run it in amazon terminal?
I am trying to use https://github.com/amzn/pecos in amazon sagemaker. I follow the readme of pecos to install it using amazon terminal. Then one can see the package is installed from terminal:
...
0
votes
0
answers
137
views
Problem in installing fasttext in M1 Mac - python 3.8
Tried the following command for installing fasttext
conda install -c "conda-forge/label/cf202003" fasttext
Collecting package metadata (current_repodata.json): done
Solving environment: ...
0
votes
1
answer
77
views
FastText Error! ValueError: (file-name) cannot be opened for training
I Have installed fasttext module in Python and loaded the model [ 'cc.en.300.bin'].
I already made the data frame format according to the fasttext. and then generating the files
train.to_csv(" ...
0
votes
1
answer
30
views
Error loading vectors in fasttext/torchtext
I get the following error:
urllib.error.HTTPError: HTTP Error 403: Forbidden
When running this:
class FastText(Vectors):
url_base = 'https://s3-us-west-1.amazonaws.com/fasttext-vectors/wiki.{}....
0
votes
1
answer
106
views
Encountered a problem while installing [ FastText ] library on MacOS
I have been trying to install the "FastText" library on macOS but I keep encountering a Runtime error.
System - MacOS: 13.0.1 (22A400)
Python Version: 3.10
IDE: Pycharm
I tried installing it ...
1
vote
2
answers
248
views
Language detection for short string in a user content generated context
I have some question about the detection of short string. I need to detect the language of text sent in a chat, and I am faced with 2 problems:
the lenght of the message
the errors that may be in it ...
-1
votes
1
answer
74
views
Subword vector in fastText?
I can't figure out what a subword input vector is. I read in the newspaper that the subword is hashed, the subword is the hash code, hash code is a number, not a vector
Ex: Input vector of word eating ...
0
votes
0
answers
170
views
How to measure the accuracy of cosine similarity
I'm doing an NLP project that use cosine similarity between n-documents, and i build 2 model. The first model is using TF-IDF & cosine_sim and the second model is using FastText & cosine_sim.
...
0
votes
1
answer
68
views
fasttext - some word vectors returns 0
I am a new entry to R and fastText.
I read on fastText website that you should be able to retrieve words vectors for names like "New York" by typing "New_York" but it's not working ...
2
votes
1
answer
41
views
Language names of Languages supported by Fasttext
I am trying to find out the names of languages supported by Fasttext's LID tool, given these language codes listed here:
af als am an ar arz as ast av az azb ba bar bcl be bg bh bn bo bpy br bs bxr ca ...
0
votes
1
answer
98
views
Why isn't my Gensim fastText model continuing to train on a new corpus?
I am trying to continue training a fastText model with Gensim, using my own corpus of text.
I've followed along with the documentation here:
https://radimrehurek.com/gensim/models/fasttext.html
And I ...
0
votes
1
answer
180
views
why every word vector has dimension 300?
why every word has 300 dimension vector in spaCy, Gensim and fasttext? I did't understand what the dimension is, and why is it used for? what that 300 dimension means? and why every word or a sentense ...
0
votes
1
answer
22
views
model.test output is not (nbr of samples, precision, recall)
I am new to Fasttext I am using python-wheel(v0.9.2) module with python3.10
I trained a text classification model
when I run a
model.test("datasets\dataset1.txt")
I except an output like:
(...
0
votes
0
answers
13
views
pip install fasttext gives fatal error on Linux [duplicate]
I am trying to install fasttext using pip in my virtual environment on a Linux machine. Following is the error traceback I get on running pip install fasttext:
Building wheels for collected packages: ...
0
votes
1
answer
740
views
Cannot install fastText because gcc 7.3.1 does not support C++11 on Amazon Linux
I need to install a system that uses fastText onto an Amazon Linux machine.
As practice, I have been trying to build fastText from source inside an Amazon Linux 2 docker image. I noticed gcc wasn't ...
0
votes
1
answer
268
views
Unable to load fasttext-wiki-news-subswords-300
Starting with the gensim api:
import gensim.downloader as api
api.load('fasttext-wiki-news-subwords-300')
I get the error:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/user.name/...
0
votes
1
answer
71
views
Facebook fasttext bin model preprocessing
I have downloaded a .bin FastText model,and load it as follows:
ft = fasttext.load_model('/content/drive/MyDrive/dataset/cc.en.300.bin')
how can i make preprocessing and normalization on cc.en.300....
0
votes
0
answers
30
views
Use a word embedding model instead of OneHot
I'm doing the pre-processing of a dataset composed of numerical and text values. And I'd like some suggestions on how to deal with textual data in the most efficient way. My issue is that my text data ...
1
vote
1
answer
284
views
Is there a way to pickle a fasttext model/object?
I just trained my fasttext model and I am trying to pin it using pins https://pypi.org/project/pins/ and vetiver https://pypi.org/project/vetiver/ for version control.
However, for that to happen I ...
0
votes
0
answers
125
views
How to load a trained BlazingText model
I have trained a text classification model using blazingText on AWS sagemaker, I can load the trained model and deploy an inference endpoint
model = bt_model.deploy(initial_instance_count=1, ...
0
votes
0
answers
324
views
Doc2Vec (Or Word2Vec) In Catalyst C#: How Do I get it to give results? (FastText)
I'm trying to replicate results from Gensim in C# to compare results and see if we need to bother trying to get Python to work within our broader C# context. I have been programming in C# for about a ...
0
votes
0
answers
75
views
FastText Vector to Numpy Array
I have used FastText to train sarcasm.txt file. The Text file looks like below (I have use Tokenization so it looks like this)
__label__1 [ ' beijing ' , ' fire ' , ' department ' , ' extinguishe ' , '...
0
votes
0
answers
45
views
Fastest supervized Tutorial: Precision Very Low
Hi I am running the same tutorial on the supervised module of fastest in the tutorial
https://fasttext.cc/docs/en/supervised-tutorial.html
In the tutorial we get the below results:
model = fasttext....
0
votes
1
answer
536
views
Reduce fastText memory usage for big models
I trained a machine learning sentence classification model that uses, among other features, also the vectors obtained from a pretrained fastText model (like these) which is 7Gb. I use the pretrained ...
0
votes
1
answer
137
views
FastText: Can't see the representation of words that starts with @ or @
I am working in an NLP project using FastText. I have some texts which contains words like @.poisonjamak, @aminagabread, @iamquak123 and I want to see their FastText representation. I want to mention ...
0
votes
1
answer
217
views
fasttext pre trained models
Does anyone know how often are the pre trained fasttext models available here https://fasttext.cc/docs/en/pretrained-vectors.html being updated with fresh common crawl or wikipedia data? or how old ...
0
votes
0
answers
60
views
Terminal crashes when launching a French spell correcting python script based on fasttext
Background
Trying to run the python script for French spelling correction based on fasttext (from the tutorial here) from the command line.
What I have done
downloaded the fasttext models (bin and ...
1
vote
1
answer
175
views
Out of memory exception with FastText model
This is API I am using: https://radimrehurek.com/gensim/models/fasttext.html
How I create model:
model = FastText(vector_size=300, max_vocab_size=100_000, window=5, min_count=20)
How I load ...
0
votes
1
answer
2k
views
Building wheels for collected packages: fasttext not working
When I do pip install fasttext, it first tells me I need c++ build tools, I went and downloaded them and now I get this error which I am unable to solve.
I have updated pip and also using python 3.10....
0
votes
1
answer
454
views
Creating a pairwise similarity matrix of a list of words using Gensim Fasttext in python
I have a list of words, and I need to create a pairwise similarity matrix using the Fasttext word embedding. This is what I am currently doing:
from gensim.models import fasttext as ft
from sklearn....
0
votes
1
answer
156
views
Printing Classification Report in FastText Text Classification output
I want to print classification report and F1 score by using sklearn.metrics library but it needs the predicted labels. Fasttext gives only the output in fig2, so I wonder is there any easy way to get ...
0
votes
0
answers
31
views
Is there a way to make the Fasttext Wikipedia Model for English Less Spelling Dependent?
I'm trying to do a comparison between the English and Mandarin Wikipedia vectors trained using Fasttext, but I'm encountering the issue that the English Vectors seems to give me a lot of orthographic ...
1
vote
1
answer
97
views
How to make fasttext's get_sentence_vector vector larger?
I have trained in unsupervised way fasttext model and now I am using get_sentence_vector() function to get vectors of sentences. But it outputs vectors with length 100. How could I make those vectors ...
0
votes
1
answer
609
views
fasttext train_supervised model: get top predicted labels
I have used fasttext train_supervised utility to train a classification model according to their webpage https://fasttext.cc/docs/en/supervised-tutorial.html .
model = fasttext.train_supervised(input=...
0
votes
1
answer
224
views
How to work with a range of n-grams on Facebook FastText?
I am trying to train a text classifier with FastText. It has a bunch of options along with a facility to train from the command line. One of the options is wordNgrams.
In my particular dataset, I ...
0
votes
1
answer
116
views
fasttext: why do aligned vectors contain only one value per word?
I was taking a look at the Fasttext aligned vectors of some languages and was surprised to find that each vectors consisted of one value only. I was expecting a Matrix witch multidimensional vectors ...
0
votes
1
answer
122
views
Imbalanced multiclass classification using company names
I have this classification scenario below in which Im getting a very low F1, precision, recall and other metrics.
Target is multiclass (about ~200 classes) which is highly imbalanced
I only use ...