Skip to contentScholarGate
LibraryBookshelfDeskReview StudioAssistant
Sign in
On this page
IntuitionHow it worksWhen to use itStrengths & limitationsCommon pitfallsApplicationsFrequently asked🔒 Read the full methodSourcesRelated methods
Cite this pageSpotted an issue on this page? Report or suggest a fix →
Home›Deep learning›FastText
Machine learning

FastText

FastText: Subword-Level Word Embeddings and Efficient Text Classification · Also known as: fastText, fast text, subword embedding, character n-gram embedding, bag of tricks text classification

FastText is a word embedding and text classification framework developed by Facebook AI Research (Joulin, Bojanowski, Grave, and Mikolov, 2016–2017) that represents each word as the sum of its character n-gram vectors, allowing it to construct meaningful representations for unseen and morphologically rich words and to perform near state-of-the-art text classification orders of magnitude faster than deep neural network alternatives.

ScholarGate
  1. Machine learning
  2. v1
  3. 3 Sources
  4. PUBLISHED
Cite this page →
Tools & resources
Download slides
Learn & explore

Read the full method

Members only

Sign in with a free account to read this section.

Sign in

Method map

The neighbourhood of related methods — select a node to explore.

FastText
Naive BayesWord2VecSelf-supervised Word2Vec

When to use it

FastText is appropriate when you need efficient word representations that generalise to morphologically rich languages or domains with many rare and unseen words, and when training speed is a constraint. For text classification it excels on medium-to-large corpora (tens of thousands of examples or more) with moderate to high numbers of categories. It suits sentiment analysis, language identification, topic labelling, and multi-label tagging. Assumptions: input is tokenised text; the embedding dimension and n-gram range are treated as hyperparameters. For very short texts or extremely small datasets, simpler bag-of-words baselines may perform equally well with less overhead. When contextual representations are critical — e.g., disambiguating polysemous words — consider Transformer-based models such as BERT.

Strengths & limitations

Strengths
  • Handles out-of-vocabulary words naturally by composing subword fragment vectors, making it robust for morphologically rich languages (Finnish, Turkish, Arabic, etc.).
  • Training is extremely fast: millions of words per second on a standard CPU, enabling iteration on large corpora without GPU infrastructure.
  • Text classification accuracy is competitive with deep convolutional networks at a fraction of the computational cost.
  • Pre-trained vectors are publicly available for 157 languages, enabling immediate transfer without local training.
  • The linear classifier is easy to inspect and its decision boundary is transparent compared to deep architectures.
Limitations
  • Word representations are context-free: a word receives the same vector regardless of its meaning in a given sentence, unlike contextual models such as BERT or GPT.
  • The mean-pooling document representation loses word order and syntactic structure, which can hurt performance on tasks requiring compositional understanding.
  • Character n-gram vocabulary can become very large for morphologically rich languages, increasing memory footprint.
  • Performance on very small datasets (fewer than a few hundred documents) may not surpass simple tf-idf plus logistic regression baselines.
  • The model is less suited to tasks requiring fine-grained contextual disambiguation, such as named entity recognition or coreference resolution.

Frequently asked

How does FastText differ from Word2Vec?

Word2Vec assigns one vector per whole-word token and cannot represent words absent from training. FastText decomposes every word into character n-grams and sums their vectors, so it produces an embedding for any word — including misspellings and neologisms — by composing fragment representations. This makes FastText substantially more robust on morphologically rich languages and noisy text.

Should I use FastText or BERT for my NLP task?

FastText is preferable when training speed, low memory, and out-of-vocabulary robustness are priorities, or when GPU resources are unavailable. BERT and Transformer-based models are preferable when the task requires contextual word-sense disambiguation, when fine-grained linguistic structure matters, or when a pre-trained model can be fine-tuned on a moderately sized labelled dataset and inference latency is acceptable.

What n-gram range should I use?

The original papers use character n-grams of length 3–6 for word embeddings and character n-grams up to length 2 (word bigrams) for text classification. For agglutinative languages with long morphemes, extending the maximum to 6 or 7 can improve coverage. In practice, it is best to treat the minimum and maximum n-gram lengths as hyperparameters and tune them on a held-out validation set.

Can FastText handle multiple languages in one model?

Yes. Because the model operates at the character n-gram level, a single model trained on multilingual text can share subword representations across languages that use the same script. Facebook has released aligned multilingual FastText vectors covering 157 languages trained on Wikipedia, which can be used for cross-lingual transfer learning.

Sources

  1. Joulin, A., Grave, E., Bojanowski, P. & Mikolov, T. (2017). Bag of Tricks for Efficient Text Classification. In Proceedings of EACL 2017, Short Papers, pp. 427–431. ACL. DOI: 10.18653/v1/e17-2068 ↗
  2. Bojanowski, P., Grave, E., Joulin, A. & Mikolov, T. (2017). Enriching Word Vectors with Subword Information. Transactions of the Association for Computational Linguistics, 5, 135–146. DOI: 10.1162/tacl_a_00051 ↗
  3. Goldberg, Y. (2017). Neural Network Methods for Natural Language Processing. Morgan & Claypool Publishers. ISBN: 978-1-62705-298-6

How to cite this page

ScholarGate. (2026, June 3). FastText: Subword-Level Word Embeddings and Efficient Text Classification. ScholarGate. https://scholargate.app/en/deep-learning/fasttext

Related methods

Naive BayesWord2Vec

Which method?

Set this method beside its closest kin and read them side by side — the library lays the books on the table; the choice is yours.

  • Naive BayesMachine learning↔ compare
  • Word2VecText mining↔ compare
Compare side by side →

Referenced by

Self-supervised Word2Vec

Similar methods

Transfer Learning with Word2VecMultilingual Doc2VecSelf-supervised Word2VecSemi-supervised Word2VecMultilingual Multilayer PerceptronMultilingual Convolutional Neural NetworkMultilingual RoBERTa-based ClassificationFine-Tuned Word2Vec

Related reference concepts

Neural Language Models and Word EmbeddingsText ClassificationText Classification and Sentiment AnalysisComputational LinguisticsLanguage ModelingPart-of-Speech Tagging and Sequence Labeling

Spotted an issue on this page? Report or suggest a fix →

ScholarGate — FastText (FastText: Subword-Level Word Embeddings and Efficient Text Classification). Retrieved 2026-07-21 from https://scholargate.app/en/deep-learning/fasttext · Dataset: https://doi.org/10.5281/zenodo.20539026
Quick facts
Originator
Joulin, A.; Bojanowski, P.; Grave, E.; Mikolov, T. (Facebook AI Research)
Year
2016
Type
Subword embedding model and linear text classifier
Task
Word representation & text classification
HandlesOOV
Yes
MinTokens
1
Related methods
Naive BayesWord2Vec
ScholarGate

A content-first reference library for research methods — what each one is, how it works, and where it comes from.

Open data (CC-BY)

Explore

  • Library
  • Search the library…
  • Browse by field
  • Fields
  • Journey
  • Compare
  • Which method?

Reference

  • Subjects
  • Atlas
  • Glossary
  • Methodology
  • Philosophy

Your tools

  • Bookshelf
  • Desk
  • Chat

Company

  • About
  • Pricing
  • Contact
  • Suggest a method

Entries are compiled from published sources for reference. Verifying the accuracy and suitability of any information for your own use remains your responsibility.

© 2026 ScholarGate · A research-method reference library
  • Privacy
  • Cookies
  • Terms
  • Delete account