FastText
Programming library
fastText is an open-source library developed by Facebook AI Research (FAIR) for learning word representations and performing text classification. It was publicly released in 2016.
For word representation, fastText incorporates subword information using character n-grams, which enables it to construct representations for words not encountered during training. The library also provides supervised methods designed for efficient text classification.
The GitHub repository was archived on March 19, 2024.
01Word representations
fastText builds on the skip-gram model used in word2vec, but also takes the internal structure of words into account. Instead of learning a representation for each word only as a whole, it represents words using character n-grams. Words that share character sequences can therefore share some of the same learned information.
This use of subword information is particularly useful for rare words and languages with complex word formation, and also allows fastText to construct representations for words that were not seen during training. Facebook AI Research later released pretrained fastText vectors for many languages, including a collection for 157 languages trained on Common Crawl and Wikipedia.
02Text classification
fastText can also be used for supervised text classification. It combines information from the words and word n-grams in a text to predict a class label. The method was designed to be computationally efficient and, in its original evaluation, achieved accuracy comparable to several contemporary deep-learning models while training and making predictions much faster.
Sources and credits
This article is adapted from the Wikipedia article “FastText”, written by its contributors and licensed under CC BY-SA 4.0. Fathomly has changed the layout, removed citation markers, navigation and maintenance notices, and adjusted punctuation. This adapted version is shared under the same license. For references, see the original article.
Fathomly is not affiliated with or endorsed by the Wikimedia Foundation. Spotted a problem? Tell us.