I am exploring with the NLP notebook from chapter 10 of the book.
But fastai gives an error when passed in parameters lang=zh
:
scn = WordTokenizer(lang='zh')
The error message is:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[7], line 1
----> 1 scn = WordTokenizer(lang='zh')
File D:\Program Files\Python310\lib\site-packages\fastai\text\core.py:122, in SpacyTokenizer.__init__(self, lang, special_toks, buf_sz)
120 self.special_toks = ifnone(special_toks, defaults.text_spec_tok)
121 nlp = spacy.blank(lang)
--> 122 for w in self.special_toks: nlp.tokenizer.add_special_case(w, [{ORTH: w}])
123 self.pipe,self.buf_sz = nlp.pipe,buf_sz
AttributeError: 'ChineseTokenizer' object has no attribute 'add_special_case'
Is it because fastai hasn’t added support for Chinese yet?