fastText
  • Docs
  • Resources
  • Blog
  • GitHub

›Introduction

Introduction

  • Get started
  • Cheatsheet
  • List of options

Tutorials

  • Text classification
  • Word representations

Help

  • Automatic hyperparameter optimization
  • Python module
  • WebAssembly module
  • FAQ
  • API
  • References

Get started

What is fastText?

fastText is a library for efficient learning of word representations and sentence classification.

Requirements

fastText builds on modern Mac OS and Linux distributions. Since it uses C++11 features, it requires a compiler with good C++11 support. These include :

  • (gcc-4.6.3 or newer) or (clang-3.3 or newer)

Compilation is carried out using a Makefile, so you will need to have a working make. For the word-similarity evaluation script you will need:

  • python 2.6 or newer
  • numpy & scipy

Building fastText as a command line tool

In order to build fastText, use the following:

$ git clone https://github.com/facebookresearch/fastText.git
$ cd fastText
$ 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 python module

In order to build fasttext module for python, use the following:

$ git clone https://github.com/facebookresearch/fastText.git
$ cd fastText
$ sudo pip install .
$ # or :
$ sudo python setup.py install

Then verify the installation went well :

$ python
Python 2.7.15 |(default, May  1 2018, 18:37:05)
Type "help", "copyright", "credits" or "license" for more information.
>>> import fasttext
>>>

If you don't see any error message, the installation was successful.

Cheatsheet →
fastText
Support
Getting StartedTutorialsFAQsAPI
Community
Facebook GroupStack OverflowGoogle Group
More
BlogGitHubStar
Facebook Open Source
Copyright © 2022 Facebook Inc.