adno commited on
Commit
dc441d6
·
verified ·
1 Parent(s): 5377f1f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +25 -2
README.md CHANGED
@@ -10,7 +10,9 @@ language:
10
 
11
  # TUBELEX FastText Word Embeddings
12
 
13
- FastText Word Embeddings trained on the TUBELEX YouTube subtitle corpora. We use the 300-dimensional [fastText](https://github.com/facebookresearch/fastText) CBOW model with position weights, 10 negative samples, 10~epochs, character 5-grams (other paramters: default) ([Grave et al., 2018](https://aclanthology.org/L18-1550)).
 
 
14
 
15
  # What is TUBELEX?
16
 
@@ -18,4 +20,25 @@ TUBELEX is a YouTube subtitle corpus currently available for Chinese, English, I
18
 
19
  - TODO: paper link
20
  - [KenLM n-gram models](https://huggingface.co/naist-nlp/tubelex-kenlm)
21
- - [word frequencies and code](https://github.com/naist-nlp/tubelex)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
 
11
  # TUBELEX FastText Word Embeddings
12
 
13
+ FastText Word Embeddings trained on the TUBELEX YouTube subtitle corpora. We use the 300-dimensional [fastText](https://github.com/facebookresearch/fastText) CBOW model with position weights, 10 negative samples, 10 epochs, character 5-grams (other paramters: default) ([Grave et al., 2018](https://aclanthology.org/L18-1550)).
14
+
15
+ We provide both '\*.bin' files (for fastText) and '\*.vec' files that follow the common Word2vec format, and can be used for instance with the `gensim` package.
16
 
17
  # What is TUBELEX?
18
 
 
20
 
21
  - TODO: paper link
22
  - [KenLM n-gram models](https://huggingface.co/naist-nlp/tubelex-kenlm)
23
+ - [word frequencies and code](https://github.com/naist-nlp/tubelex)
24
+
25
+ # Usage
26
+
27
+ To download and use the fastText models in Python, first install dependencies:
28
+
29
+ ```
30
+ pip install huggingface_hub
31
+ pip install fasttext
32
+ ```
33
+
34
+ You can then use e.g. the English (`en`) model in the following way:
35
+
36
+ ```
37
+ import fasttext
38
+ from huggingface_hub import hf_hub_download
39
+
40
+ model_file = hf_hub_download(repo_id='naist-nlp/tubelex-kenlm', filename='tubelex-en.bin')
41
+ model = fasttext.load_model(model_file
42
+
43
+ print(model['koala'])
44
+ ```