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 8–Nov 15 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/15/2026, 6:01:32 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

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.