HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
facebookresearch
fastText
HTML2016–2025
facebookresearch / fastText · Archived

fastText

Library for fast text representation and classification.

21Distinct people
27Mentions
0Explicit recommenders
26.5KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Library for fast text representation and classification.

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year27 dated mentions

Observed mentions: 2016-08-04 17:09:30 UTC to 2025-05-21 20:30:38 UTC.

02462016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 6 mentions; 1 submissions, 5 comments20162017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 7 mentions; 3 submissions, 4 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 5 mentions; 1 submissions, 4 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 3 mentions; 1 submissions, 2 comments20202021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 3 mentions; 1 submissions, 2 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2025

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC615
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC734
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC514
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC110
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC312
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC000
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC000
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC101
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC312
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC101

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
fastText fastText is a library for efficient learning of word representations and sentence classification. Table of contents Resources Models Supplementary data FAQ Cheatsheet Requirements Building fastText Getting the source code Building fastText using make (preferred) Building fastText using cmake Building fastText for Python Example use cases Word representation learning Obtaining word vectors for out-of-vocabulary words Text classification Full documentation References Enriching Word Vectors with Subword Information Bag of Tricks for Efficient Text Classification FastText.zip: Compressing text classification models Join the fastText community License Resources Models Recent state-of-the-art English word vectors. Word vectors for 157 languages trained on Wikipedia and Crawl. Models for language identification and various supervised tasks. Supplementary data The preprocessed YFCC100M data used in [2]. FAQ You can find answers to frequently asked questions on our website. Cheatsheet We also provide a cheatsheet full of useful one-liners. Requirements We are continuously building and testing our library, CLI and Python bindings under various docker images using circleci. Generally, fastText builds on modern Mac OS and Linux distributions. Since it uses some C++11 features, it requires a compiler with good C++11 support. These include : (g++-4.7.2 or newer) or (clang-3.3 or newer) Compilation is carried out using a Makefile, so you will need to have a working make. If you want to use cmake you need at least version 2.8.9. One of the oldest distributions we successfully built and tested the CLI under is Debian jessie. For the word-similarity evaluation script you will need: Python 2.6 or newer NumPy & SciPy For the python bindings (see the subdirectory python) you will need: Python version 2.7 or >=3.4 NumPy & SciPy pybind11 One of the oldest distributions we successfully built and tested the Python bindings under is Debian jessie. If these requirements make it impossible for you to use fastText, please open an issue and we will try to accommodate you. Building fastText We discuss building the latest stable version of fastText. Getting the source code You can find our latest stable release in the usual place. There is also the master branch that contains all of our most recent work, but comes along with all the usual caveats of an unstable branch. You might want to use this if you are a developer or power-user. Building fastText using make (preferred) $ wget https://github.com/facebookresearch/fastText/archive/v0.9.2.zip $ unzip v0.9.2.zip $ cd fastText-0.9.2 $ make This will produce object files for all the classes as well as the main binary fasttext. If you do not plan on using the default system-wide compiler, update the two macros defined at the beginning of the Makefile (CC and INCLUDES). Building fastText using cmake For now this is not part of a release, so you will need to clone the master branch. $ git clone https://github.com/facebookresearch/fastText.git $ cd fastText $ mkdir build && cd build && cmake .. $ make && make install This will create the fasttext binary and also all relevant libraries (shared, static, PIC). Building fastText for Python For now this is not part of a release, so you will need to clone the master branch. $ git clone https://github.com/facebookresearch/fastText.git $ cd fastText $ pip install . For further information and introduction see python/README.md Example use cases This library has two main use cases: word representation learning and text classification. These were described in the two papers 1 and 2. Word representation learning In order to learn word vectors, as described in 1, do: $ ./fasttext skipgram -input data.txt -output model where data.txt is a training file containing UTF-8 encoded text. By default the word vectors will take into account character n-grams from 3 to 6 characters. At the end of optimization the program will save two files: model.bin and model.vec. model.vec is a text file containing the word vectors, one per line. model.bin is a binary file containing the parameters of the model along with the dictionary and all hyper parameters. The binary file can be used later to compute word vectors or to restart the optimization. Obtaining word vectors for out-of-vocabulary words The previously trained model can be used to compute word vectors for out-of-vocabulary words. Provided you have a text file queries.txt containing words for which you want to compute vectors, use the following command: $ ./fasttext print-word-vectors model.bin < queries.txt This will output word vectors to the standard output, one vector per line. This can also be used with pipes: $ cat queries.txt | ./fasttext print-word-vectors model.bin See the provided scripts for an example. For instance, running: $ ./word-vector-example.sh will compile the code, download data, compute word vectors and evaluate them on the rare words similarity dataset RW [Thang et al. 2013]. Text classification This library can also be used to train supervised text classifiers, for instance for sentiment analysis. In order to train a text classifier using the method described in 2, use: $ ./fasttext supervised -input train.txt -output model where train.txt is a text file containing a training sentence per line along with the labels. By default, we assume that labels are words that are prefixed by the string __label__. This will output two files: model.bin and model.vec. Once the model was trained, you can evaluate it by computing the precision and recall at k (P@k and R@k) on a test set using: $ ./fasttext test model.bin test.txt k The argument k is optional, and is equal to 1 by default. In order to obtain the k most likely labels for a piece of text, use: $ ./fasttext predict model.bin test.txt k or use predict-prob to also get the probability for each label $ ./fasttext predict-prob model.bin test.txt k where test.txt contains a piece of text to
Read the full README on GitHub

What Hacker News says

27 sources
I hate to be "reviewer 2", but: I used to work on what your paper calls "unsupervised transport", that is machine translation between two languages without alignment data. You note that this field has existed since ~2016 and you provide a number of references, but you only dedicate ~4 lines of text to this branch of research. There's no comparison about why your technique is different to this prior work or why the prior algorithms can't be applied to the output of modern LLMs. Naively, I would expect off-the-shelf embedding alignment algorithms (like <https://github.com/artetxem/vecmap> and <https://github.com/facebookresearch/fastText/tree/main/align...>, neither of which are cited or compared against) to work quite well on this problem. So I'm curious if they don't or why they don't. I can imagine there is lots of room for improvemen
Read the rest
ts around implicit regularization in the algorithms. Specifically, these algorithms were designed with word2vec output in mind (typically 300 dimensional vectors with 200000 observations), but your problem has higher dimensional vectors with fewer observations and so would likely require different hyperparameter tuning. IIRC, there's no explicit regularization in these methods, but hyperparameters like stepsize/stepcount can implicitly add L2 regularization, which you probably need for your application. --- PS. I *strongly dislike* your name of vec2vec. You aren't the first/only algorithm for taking vectors as input and getting vectors as output, and you have no right to claim such a general title. --- PPS. I believe there is a minor typo with footnote 1. The note is "Our code is available on GitHub." but it is attached to the sentence "In practice, it is unrealistic to expect that such a database be available."
In Harnessing the Universal Geometry of Embeddings
Was working in NLP from about 2014-2020. At the start, NB was indeed generally the best performing baseline model you could use, and we would train it for every task. However, we came to realise that Facebook's FastText model[1] was almost always the better choice as soon as your training set was more than a few hundred samples. Some advantages: - accuracy generally a few points better than NB - better generalisability due to the word embeddings acting as a bottleneck on expressiveness compared to NB or logistic regression which essentially model all words / bigrams as independent - trained with cross-entropy, meaning that model scores can be used more effectively as a 'confidence' - e.g. for spam if you want to say something like "if prediction score > X, then filter", Naive Bayes is not ideal due to the 'naive' assumption which makes th
Read the rest
e scores very un-calibrated (it tends to give extremely high or low confidence scores, which gets worse with document length). - is completely linear (or at least log-linear like NB), so explainability is super simple. disclaimer: I haven't really thought about NLP for about 3 years so there may be something better than this now [1] https://github.com/facebookresearch/fastText
In Autospam and Naive Bayes
I generally agree with point made in the article that too much NLP research is focused only on English and a small number of other high-resourced languages. To me, this is part of a larger problem with natural language processing's obsession with "state-of-the-art" metrics and general abandonment of broader research in linguistics. The situation for those who, like myself, work in applied linguistics is not actually so dire... At least when working with the languages that have a reasonable amount of training data. Decent enough treebanks exist for lemmatisation, POS-tagging, and dependency parsing for dozens of languages [0]. Fast tools such as spaCy (15 languages) [1] and udpipe (40+ languages) [2] are freely available and work well for most applied tasks. There are even decent word embeddings available trained on various versions of Wik
Read the rest
ipedia [3]. Of course, some of the issue is that these very tasks are biased towards the specific structures of Indo-European languages. However, for getting work done (building sentiment classifiers, document clustering, NER, ect.), currently available tools make it possible to work with a large proportion of the currently available data. There is still a lot of work to be done own regards to computational research on non-English languages, but a lot of the problem right now is recognition of applied work by the top NLP conferences rather than a complete lack of quality work currently being done. [0] https://universaldependencies.org [1] https://spacy.io/models [2] https://ufal.mff.cuni.cz/udpipe/models [3] https://github.com/facebookresearch/fastText/blob/master/doc...
In Do NLP Beyond English
Multiple reasons, but to name a few: - Don't want to deal with vandalism - Hosting static data is dramatically easier than making a public editing interface - You want reference versions of the dataset for papers to refer to so that results are comparable. Sometimes this is used as a justification for not fixing completely broken data, like with Fasttext. https://github.com/facebookresearch/fastText/issues/710 - Building on the previous point, large datasets like this don't play nice with Git. There are lots of "git for data" things but none of them are very mature, and most people don't spend time trying to figure something out.
In Cleaning algorithm finds 20% of errors in major image recognition datasets
Word2Vec and bag-of-words/tf-idf are somewhat obsolete in 2018 for modeling. For classification tasks, fasttext (https://github.com/facebookresearch/fastText) performs better and faster. Fasttext is also available in the popular NLP Python library gensim, with a good demo notebook: https://radimrehurek.com/gensim/models/fasttext.html And of course, if you have a GPU, recurrent neural networks (or other deep learning architectures) are the endgame for the remaining 10% of problems (a good example is SpaCy's DL implementation: https://spacy.io/). Or use those libraries to incorporate fasttext for text encoding, which has worked well in my use cases.
In How to solve most NLP problems: a step-by-step guide

Showing the 15 most recent of 27 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.