| 1 |
--- |
| 2 |
id: english-vectors |
| 3 |
title: English word vectors |
| 4 |
--- |
| 5 |
|
| 6 |
This page gathers several pre-trained word vectors trained using fastText. |
| 7 |
|
| 8 |
### Download pre-trained word vectors |
| 9 |
|
| 10 |
Pre-trained word vectors learned on different sources can be downloaded below: |
| 11 |
|
| 12 |
1. [wiki-news-300d-1M.vec.zip](https://dl.fbaipublicfiles.com/fasttext/vectors-english/wiki-news-300d-1M.vec.zip): 1 million word vectors trained on Wikipedia 2017, UMBC webbase corpus and statmt.org news dataset (16B tokens). |
| 13 |
2. [wiki-news-300d-1M-subword.vec.zip](https://dl.fbaipublicfiles.com/fasttext/vectors-english/wiki-news-300d-1M-subword.vec.zip): 1 million word vectors trained with subword infomation on Wikipedia 2017, UMBC webbase corpus and statmt.org news dataset (16B tokens). |
| 14 |
3. [crawl-300d-2M.vec.zip](https://dl.fbaipublicfiles.com/fasttext/vectors-english/crawl-300d-2M.vec.zip): 2 million word vectors trained on Common Crawl (600B tokens). |
| 15 |
4. [crawl-300d-2M-subword.zip](https://dl.fbaipublicfiles.com/fasttext/vectors-english/crawl-300d-2M-subword.zip): 2 million word vectors trained with subword information on Common Crawl (600B tokens). |
| 16 |
|
| 17 |
### Format |
| 18 |
|
| 19 |
The first line of the file contains the number of words in the vocabulary and the size of the vectors. |
| 20 |
Each line contains a word followed by its vectors, like in the default fastText text format. |
| 21 |
Each value is space separated. Words are ordered by descending frequency. |
| 22 |
These text models can easily be loaded in Python using the following code: |
| 23 |
```python |
| 24 |
import io |
| 25 |
|
| 26 |
def load_vectors(fname): |
| 27 |
fin = io.open(fname, 'r', encoding='utf-8', newline='\n', errors='ignore') |
| 28 |
n, d = map(int, fin.readline().split()) |
| 29 |
data = {} |
| 30 |
for line in fin: |
| 31 |
tokens = line.rstrip().split(' ') |
| 32 |
data[tokens[0]] = map(float, tokens[1:]) |
| 33 |
return data |
| 34 |
``` |
| 35 |
|
| 36 |
### License |
| 37 |
|
| 38 |
These word vectors are distributed under the [*Creative Commons Attribution-Share-Alike License 3.0*](https://creativecommons.org/licenses/by-sa/3.0/). |
| 39 |
|
| 40 |
### References |
| 41 |
|
| 42 |
If you use these word vectors, please cite the following paper: |
| 43 |
|
| 44 |
T. Mikolov, E. Grave, P. Bojanowski, C. Puhrsch, A. Joulin. [*Advances in Pre-Training Distributed Word Representations*](https://arxiv.org/abs/1712.09405) |
| 45 |
|
| 46 |
```markup |
| 47 |
@inproceedings{mikolov2018advances, |
| 48 |
title={Advances in Pre-Training Distributed Word Representations}, |
| 49 |
author={Mikolov, Tomas and Grave, Edouard and Bojanowski, Piotr and Puhrsch, Christian and Joulin, Armand}, |
| 50 |
booktitle={Proceedings of the International Conference on Language Resources and Evaluation (LREC 2018)}, |
| 51 |
year={2018} |
| 52 |
} |
| 53 |
``` |