Skip to content
EntityQ29124045· pop 5· linked from 136 articles

fastText is a library for learning of word embeddings and text classification created by Facebook's AI Research (FAIR) lab. The model allows one to create an unsupervised learning or supervised learning algorithm for obtaining vector representations for words. Facebook makes available pretrained models for 294 languages. Several papers describe the techniques used by fastText. The GitHub repository was archived on March 19, 2024.

Source code

fastText fastText is a library for efficient learning of word representations and sentence classification. 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 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. 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 : One of the oldest distributions we successfully built and tested the CLI under is Debian jessie. One of the oldest distributions we successfully built and tested the Python bindings under is Debian jessie. 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. 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). This will create the fasttext binary and also all relevant libraries (shared, static, PIC). This library has two main use cases: word representation learning and text classification. These were described in the two papers 1 and 2. where data.txt is a training file containing UTF-8 encoded text. By default the word vectors will take into account character n-grams from 3 to 6 characters. At the end of optimization the program will save two files: model.bin and model.vec . model.vec is a text file containing the word vectors, one per line. model.bin is a binary file containing the parameters of the model along with the dictionary and all hyper parameters. The binary file can be used later to compute word vectors or to restart the optimization. The previously trained model can be used to compute word vectors for out-of-vocabulary words. Provided you have a text file queries.txt containing words for which you want to compute vectors, use the following command: This will output word vectors to the standard output, one vector per line. This can also be used with pipes: will compile the code, download data, compute word vectors and evaluate them on the rare words similarity dataset RW [Thang et al. 2013]. This library can also be used to train supervised text classifiers, for instance for sentiment analysis. In order to train a text classifier using the method described in 2, use: where train.txt is a text file containing a training sentence per line along with the labels. By default, we assume that labels are words that are prefixed by the string label . This will output two files: model.bin and model.vec . Once the model was trained, you can evaluate it by computing the precision and recall at k (P@k and R@k) on a test set using: where test.txt contains a piece of text to classify per line. Doing so will print to the standard output the k most likely labels for each line. The argument k is optional, and equal to 1 by default. See classification-example.sh for an example use case. In order to reproduce results from the paper 2, run classification-results.sh , this will download all the datasets and reproduce the results from Table 1. This assumes that the text.txt file contains the paragr

Excerpt from the source-code README · 13,610 chars · not written by Vinony

Wikidata facts

Official website
research.fb.com/fasttext
Show 4 more facts
publication date
2016-07-21
title
fastText
source code repository URL
github.com/facebookresearch/fastText
software version identifier
0.9.2
Sources (4)

via Wikidata · CC0

~1 min read

Article

3 sections
Contents
  • See also
  • References
  • External links

fastText is a library for learning of word embeddings and text classification created by Facebook's AI Research (FAIR) lab. The model allows one to create an unsupervised learning or supervised learning algorithm for obtaining vector representations for words. Facebook makes available pretrained models for 294 languages. Several papers describe the techniques used by fastText. The GitHub repository was archived on March 19, 2024.

== See also == Word2vec GloVe Neural network (machine learning) Natural language processing

Available in 5 languages

via Wikidata sitelinks · CC0

Connections

Categories