WordTokenizer Error

Hi,

I’m getting errors when I called the following code. I look in the forums but there isn’t a clear answer. Can someone point me to the right direction? I’m pretty new with this.

Thanks!

spacy = WordTokenizer()

nlp = spacy.blank(lang, disable=["parser", "tagger", "ner"])

TypeError: blank() got an unexpected keyword argument ‘disable’

For those who have the same issue, you have to install spacy version 2.2.4.

As an update to this thread (on May 4, 2021) Fastai library version 2.3.1 supports Spacy version 3.0.* See https://github.com/fastai/fastai/issues/3338

The TypeError: blank() got an unexpected keyword argument ‘disable’ issue is resolved without downgrading Spacy.

1 Like

in case using space version 2.2.4 still doesn’t work, let try version 2.3.5. From my experiences, I just got the same issue when I started learning NLP by Fastai Courses on Youtube. I used Google Colab to do exercises from these courses. I just pasted everything from the Jupyter guidelines to my notebook but it didn’t run as well. It took me a lot of time to make it run in Google Colab. This issue relates to spacy version. But there’s something strange that I could not explain. If I use GPU runtime environment, I need spacy 2.3.5 version, otherwise, I had to change spacy to 2.2.4 version. I hope that my answer could help someone who are in the same situation. Make sure that you are using fastai version 1 when starting to follow this course.