当前位置:   article > 正文

spacy 英文模型下载_spacy 英文模型

spacy模型下载

import spacy

nlp = spacy.load('en') #加载英文模型

doc = nlp(u"it's word tokenize test for spacy")

print(doc)

for d in doc:

print(d)

test_doc = nlp(u"you are best. it is lemmatize test for spacy. I love these books")

for t in test_doc:

print(t , t.lemma_ , t.lemma) #词干化

for t in test_doc:

print(t , t.pos_ , t.pos) #词性标注

test_doc = nlp(u"Rami Eid is studying at Stony Brook University in New York")

for ent in test_doc.ents:

print(ent, ent.label_, ent.label) #命名实体

输出:

it's word tokenize test for spacy it 's word tokenize test for spacy you -PRON- 757862 are be 536 best good 673 . . 453 it -PRON- 757862 is be 536 lemmatize lemmatize 776982 test test 1877 for for 531 spacy spacy 776981 . . 453 I -PRON- 757862 love love 949 these these 742 books book 1300 you PRON 93 are VERB 98 best ADJ 82 . PUNCT 95 it PRON 93 is VERB 98 lemmatize ADJ 82 test NOUN 90 for ADP 83 spacy NOUN 90 . PUNCT 95 I PRON 93 love VERB 98 these DET 88 books NOUN 90 Rami Eid PERSON 377 Stony Brook University ORG 380

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/正经夜光杯/article/detail/818660
推荐阅读
相关标签
  

闽ICP备14008679号