2017-03-27 8 views
2

spacy 파서에게 "사람이 거리를 걷고 있습니다"라고 말하면 '있었음'이 루트이고 걷는 동안 xcompl이 '걷는 것과 같습니다 '문장에있을 것입니다 : "한 남자가 거리를 걷는 것을 좋아합니다". 어떤 잘못입니다.spacy 라이브러리의 Python NLP 종속 파서가 제대로 작동하지 않습니다.

이제 변위가 발생하지 않습니다 (https://demos.explosion.ai/displacy/?text=a%20man%20has%20been%20walking%20in%20the%20street&model=en&cpu=0&cph=0). 변위가 사용하는 모델 버전을 다운로드하는 방법을 아는 사람이 있습니까? 나는 그것을 대단히 감사 할 것이다.

답변

0

예, 이것은 설치된 SPACE 및 변위 사용 모델의 차이 때문일 수 있습니다.

>>> import spacy 
>>> nlp = spacy.load('en') 
>>> parsed = nlp("a man has been walking in the street") 
>>> [(x.text,x.dep_,x.pos) for x in parsed] 
[(u'a', u'det', 88), (u'man', u'nsubj', 90), (u'has', u'aux', 98), (u'been', u'ROOT', 98), (u'walking', u'xcomp', 98), (u'in', u'prep', 83), (u'the', u'det', 88), (u'street', u'pobj', 90)] 
>>> nlp.meta 
{u'lang': u'en', u'name': u'core_web_sm', u'license': u'CC BY-SA 3.0', u'author': u'Explosion AI', u'url': u'https://explosion.ai', u'version': u'1.2.0', u'spacy_version': u'>=1.7.0,<2.0.0', u'email': u'[email protected]', u'description': u'Small English model for spaCy. Includes vocabulary, syntax, entities and word vectors (GloVe).'} 

Displacy 모델은 여기에 나열보다 광범위한 것들 중 하나가 될 수 있습니다

https://github.com/explosion/spacy-models

core_web_sm가 가볍고, displacy는

을 en_core_web_md 사용하고있을 수 있습니다