facebookresearch / InferSent

InferSent sentence embeddings
Other
2.28k stars 471 forks source link

Usage on Google Collab #140

Closed hussainwali74 closed 3 years ago

hussainwali74 commented 4 years ago

am trying to import this package in a jupyternotebook, code to import InferSent \# curl -Lo GloVe/glove.840B.300d.zip http://nlp.stanford.edu/data/glove.840B.300d.zip \# unzip GloVe/glove.840B.300d.zip -d GloVe/ \# %mkdir fastText \# curl -Lo fastText/crawl-300d-2M.vec.zip https://dl.fbaipublicfiles.com/fasttext/vectors-english/crawl-300d-2M.vec.zip \# unzip fastText/crawl-300d-2M.vec.zip -d fastText/ \# %mkdir encoder curl -Lo 'encoder/infersent1.pkl https://dl.fbaipublicfiles.com/infersent/infersent1.pkl' \# curl -Lo encoder/infersent2.pkl https://dl.fbaipublicfiles.com/infersent/infersent2.pkl

Error I get upon running the file File "", line 1 curl -Lo 'encoder/infersent1.pkl https://dl.fbaipublicfiles.com/infersent/infersent1.pkl' ^ SyntaxError: invalid syntax

Ved2000 commented 4 years ago

curl is a linux command , you have to add !(exclaimation mark ) in front of every linux command for it to work on Collab,probably would be same for Jupyter.Hope this helps.

vishxl commented 3 years ago

For InferSent1: !curl -Lo encoder/infersent1.pkl https://dl.fbaipublicfiles.com/infersent/infersent1.pkl For InferSent2: !curl -Lo encoder/infersent2.pkl https://dl.fbaipublicfiles.com/infersent/infersent2.pkl