26,508
stars
+-5+-5+-15
4,833
forks
–
watchers
–
prs
–
issues
–
releases
–
discussions

README

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

Snapshot: 2026-11-10T09:35:25Z · Data license Apache-2.0 · JSON