facebookresearch /fastText
Library for fast text representation and classification.
★ 26,507⑂ 4,838👁 2⑃ 268● 1,077▤ 4
-2
Daily
-6
Weekly
-16
Monthly
26,507
stars
4,838
forks
2
watchers
268
prs
1,077
issues
4
releases
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
ForTop issues
#276Advice on using in web server26 comments · 2017-07-15#1052Pip install of version 0.9.2 fails22 comments · 2020-04-28#548how to install it on Windows computer pls21 comments · 2018-06-17#386Install with Python error21 comments · 2017-12-15#330Updating the model (online-learning)19 comments · 2017-10-10#888Core dumped when using autotune16 comments · 2019-08-27#1034model cannot be opened for loading14 comments · 2020-03-26#1196RuntimeError: Unsupported compiler -- at least C++11 support is needed12 comments · 2021-04-29
Latest release
v0.9.2 v0.9.2 2020-04-28We are happy to announce the release of version 0.9.2. WebAssembly -------------- We are excited to release fastText bindings for WebAssembly. Classification tasks are widely used in web applications and we believe giving access to the complete fastText API from the browser will notably help our community to build nice tools. See our documentation to learn more. Autotune: automatic hyperparameter optimization -------------------------------------------- Finding the best hyperparameters is crucial for building efficient models. However, searching the best hyperparameters manually is d