Skip to content
This repository was archived by the owner on Apr 4, 2021. It is now read-only.

Commit 7f3ac6f

Browse files
committed
Update infersent readme
1 parent 545358f commit 7f3ac6f

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

infersent/README.md

+13-5
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,21 @@ curl -Lo GloVe/glove.840B.300d.zip http://nlp.stanford.edu/data/glove.840B.300d.
1919
unzip GloVe/glove.840B.300d.zip -d GloVe/
2020
```
2121

22-
## Use our sentence encoder
23-
We provide a simple interface to encode English sentences. **See [**demo.ipynb**](https://github.com/facebookresearch/InferSent/blob/master/demo.ipynb)
24-
for a practical example.** Get started with the following steps:
22+
## Download sentence encoder
2523

26-
*0.0) Download our InferSent models (V1 trained with GloVe, V2 trained with fastText)[147MB]:*
24+
### InferSent models trained with GloVe[147MB]:
2725
```bash
2826
mkdir encoder
2927
curl -Lo encoder/infersent1.pkl https://dl.fbaipublicfiles.com/infersent/infersent1.pkl
3028
```
31-
Note that infersent1 is trained with GloVe (which have been trained on text preprocessed with the PTB tokenizer) and infersent2 is trained with fastText (which have been trained on text preprocessed with the MOSES tokenizer). The latter also removes the padding of zeros with max-pooling which was inconvenient when embedding sentences outside of their batches.
29+
30+
## Download necessary libraries
31+
Run the following code below in the terminal to download the libraries:
32+
- `pip3 install --user numpy`
33+
- `pip3 install --user torch`
34+
- `pip3 install --user nltk`
35+
36+
After installing all required packages, we will also need to download and format the sentence encoder & pre-trained model.
37+
38+
## Run the program
39+
- To run the Infersent approach, call the `main.py` file inside the `/infersent` directory after set up steps have been completed with `python3 main.py`.

0 commit comments

Comments
 (0)