| 1 |
--- |
| 2 |
id: support |
| 3 |
title: Get started |
| 4 |
--- |
| 5 |
|
| 6 |
## What is fastText? |
| 7 |
|
| 8 |
fastText is a library for efficient learning of word representations and sentence classification. |
| 9 |
|
| 10 |
## Requirements |
| 11 |
|
| 12 |
fastText builds on modern Mac OS and Linux distributions. |
| 13 |
Since it uses C++11 features, it requires a compiler with good C++11 support. |
| 14 |
These include : |
| 15 |
|
| 16 |
* (gcc-4.6.3 or newer) or (clang-3.3 or newer) |
| 17 |
|
| 18 |
Compilation is carried out using a Makefile, so you will need to have a working **make**. |
| 19 |
For the word-similarity evaluation script you will need: |
| 20 |
|
| 21 |
* python 2.6 or newer |
| 22 |
* numpy & scipy |
| 23 |
|
| 24 |
## Building fastText as a command line tool |
| 25 |
|
| 26 |
In order to build `fastText`, use the following: |
| 27 |
|
| 28 |
```bash |
| 29 |
$ git clone https://github.com/facebookresearch/fastText.git |
| 30 |
$ cd fastText |
| 31 |
$ make |
| 32 |
``` |
| 33 |
|
| 34 |
This will produce object files for all the classes as well as the main binary `fasttext`. |
| 35 |
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). |
| 36 |
|
| 37 |
|
| 38 |
## Building `fasttext` python module |
| 39 |
|
| 40 |
In order to build `fasttext` module for python, use the following: |
| 41 |
|
| 42 |
```bash |
| 43 |
$ git clone https://github.com/facebookresearch/fastText.git |
| 44 |
$ cd fastText |
| 45 |
$ sudo pip install . |
| 46 |
$ # or : |
| 47 |
$ sudo python setup.py install |
| 48 |
``` |
| 49 |
|
| 50 |
Then verify the installation went well : |
| 51 |
```bash |
| 52 |
$ python |
| 53 |
Python 2.7.15 |(default, May 1 2018, 18:37:05) |
| 54 |
Type "help", "copyright", "credits" or "license" for more information. |
| 55 |
>>> import fasttext |
| 56 |
>>> |
| 57 |
``` |
| 58 |
If you don't see any error message, the installation was successful. |