sapCy简介
作者:明天依舊可好
郵箱:ke.zb@qq.com
一、spaCy簡介
spaCy 是一個是具有工業(yè)級強度的Python NLP工具包,完成了NLP領(lǐng)域的很多任務比如詞性標注,命名實體識別,依存句法分析,歸一化,停用詞等等,支持Unix/Linux,macOS/os X和Windows操作系統(tǒng),可以通過pip,conda方式安裝。
二、spaCy安裝
通過pip安裝spaCy:
pip install spaCy三、語言模型
1.支持的語言:
| en_core_web_sm | English | Vocabulary, syntax, entities |
| en_core_web_md | English | Vocabulary, syntax, entities, vectors |
| en_core_web_lg | English | Vocabulary, syntax, entities, vectors |
| en_vectors_web_lg | English | Word vectors |
| de_core_news_sm | German | Vocabulary, syntax, entities |
| es_core_news_sm | Spanish | Vocabulary, syntax, entities |
| es_core_news_md | Spanish | Vocabulary, syntax, entities, vectors |
| pt_core_news_sm | Portuguese | Vocabulary, syntax, entities |
| fr_core_news_sm | French | Vocabulary, syntax, entities |
| fr_core_news_md | French | Vocabulary, syntax, entities, vectors |
| it_core_news_sm | Italian | Vocabulary, syntax, entities |
| nl_core_news_sm | Dutch | Vocabulary, syntax, entities |
| xx_ent_wiki_sm | Multi-language | Named entities |
2.語言模型的安裝:
這個安裝比較費勁(速度挺慢的),有時候還需要翻墻(速度或許會快一些)。
pip install en_core_web_lg3.語言模型的使用
import spacynlp = spacy.load('en_core_web_lg') #加載模型doc = nlp(u'This is a sentence.')總結(jié)
- 上一篇: python3-matplotlib库简
- 下一篇: TfidfVectorizer(stop