OSError: [E050] Can’t find model ‘en’. It doesn’t seem to be a shortcut link, a Python package or a valid path to a data directory.
去Git下载:en_core_web_sm
然后pip install刚刚的包
import spacy
print(spacy.load('en_core_web_sm'))
from torchtext.legacy.data import Field, NestedField, LabelField
# from torchtext import data
CHAR_NESTING = Field(tokenize=list, lower=True)
char_field = NestedField(CHAR_NESTING, tokenize='spacy', fix_length=tcfig.pad_size, tokenizer_language='en_core_web_sm')
word_field = Field(tokenize='spacy', lower=True, include_lengths=True, fix_length=tcfig.pad_size, tokenizer_language='en_core_web_sm')
label_field = LabelField(dtype=torch.long)
https://blog.csdn.net/qq_42363032/article/details/126929995?spm=1001.2014.3001.5501