VIVEK PATEL
VIVEK PATEL

Reputation: 33

How to get started with spacy library and its module in Google Colab?

I'm facing problem with Spacy module to load in colab GPU notebook.

!python -m spacy download en_trf_xlnetbasecased_lg

This command works for anaconda notebook to download, but how to download in Google Colab and load module?

Upvotes: 0

Views: 9332

Answers (2)

VIVEK PATEL
VIVEK PATEL

Reputation: 33

Thanks for the support. Finally i got the solution for this question.

Following are the steps:

1) !pip install https://github.com/explosion/spacy-models/releases/download/en_trf_xlnetbasecased_lg-2.2.0/en_trf_xlnetbasecased_lg-2.2.0.tar.gz

2) It will ask to restart runtime. Do that.

3) import spacy import spacy_transformers

nlp = spacy.load('en_trf_xlnetbasecased_lg') print("Done")

Regards.

Upvotes: 2

CrazyElf
CrazyElf

Reputation: 765

Update Spacy before loading module, it's a known bug of Spacy version in Colab.

!pip install --upgrade spacy

(Found it here https://github.com/explosion/spacy-transformers/issues/83)

Upvotes: 1

Related Questions