fastText
Library for efficient text classification and word representation by Meta.
About
fastText comes from Meta Research and handles two jobs with unusual efficiency: learning word representations and classifying text. Its word vectors incorporate character n-gram information, so embeddings can be built for out-of-vocabulary words by composing subword units, and pretrained vectors are published for 157 languages trained on Wikipedia and Common Crawl. The supervised classifier trains on billions of words in minutes on ordinary CPUs and performs competitively with deep learning approaches on tasks like sentiment analysis and language identification, while built-in quantization shrinks trained models to a fraction of their size for deployment on constrained devices. The core is implemented in C++11 with a command-line tool and official Python bindings. Released under the MIT license, fastText remains a common choice for practitioners who need a fast, dependable baseline for text classification, language detection, or multilingual embeddings without GPU infrastructure.
Should you use fastText?
Pick it when
Pick fastText when you need a text classifier or language identifier that trains in minutes on ordinary CPUs, such as tagging millions of support tickets or filtering a web crawl, or want subword vectors in 157 languages.
Look elsewhere when
Skip it if you need an actively maintained dependency: Meta archived the GitHub repo in March 2024. With only a few labeled examples per class, SetFit is built for that case, and context-heavy tasks favor transformer models.
Alternatives to fastText
- SetFit
Reaches usable accuracy from as few as eight labeled examples per class, but needs a transformer encoder and more compute per prediction.
- Lingua
More accurate on single words and short phrases, Apache 2.0 and still maintained, but 75 languages against the 176 in fastText's language ID model, and no classifier.
- Gensim
Trains Word2Vec, FastText-style and Doc2Vec vectors in Python while streaming corpora larger than RAM, but has no supervised classifier.
- scikit-learn
Linear models on TF-IDF give a similar fast CPU baseline with a maintained, familiar API, though without pretrained multilingual vectors.
Reviews (0)
Leave a Review
No reviews yet. Be the first to review!
Details
- Category
- Natural Language Processing
- Price
- Free
- Platform
- Local/Desktop
- Difficulty
- Easy (2/5)
- License
- MIT
- Added
- Apr 3, 2026