安装 spacy 下载语言库

参考:

https://spacy.io/models/

spacy安装:

pip install spacy

en库安装

在线安装,过程可能较慢

python -m spacy download en

也可离线安装
https://github.com/explosion/spacy-models/releases
选定好需要的包下载到本地

直接pip install文件

pip install /Users/you/en_core_web_md-1.2.0.tar.gz

使用

import spacy
spacy_en = spacy.load('en_core_web_sm')
spacy_de = spacy.load('de_core_news_sm')

text = 'I go to school by bus.'
spacy_en.tokenizer(text)

out: I go to school by bus.
posted @ 2020-08-28 15:20  lduml  阅读(2447)  评论(0编辑  收藏  举报