저는 Stanford POS Tagger를 Python으로 사용하려고합니다. Python NLTK pos_tag not returning the correct part-of-speech tagStanford POS Tagger를 가져 오는 방법
다음과 같은 오류 받기 :
이Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "U:\Python35\site-packages\nltk\tag\stanford.py", line 136, in __init__
super(StanfordPOSTagger, self).__init__(*args, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'path_to_model'
내가 변경해야을
home = 'U:/ManWin/My Documents/Research Project'
from nltk.tag.stanford import StanfordPOSTagger as POS_Tag
_path_to_model = home + '/stanford-postagger/models/english-bidirectional-distsim.tagger'
_path_to_jar = home + '/stanford-postagger/stanford-postagger.jar'
st = POS_Tag(path_to_model=_path_to_model, path_to_jar=_path_to_jar)
여기에 대한 대답에서 마지막 줄을 복사 한 적이 있습니까?
보인다. 링크 된 질문에 대한 대답에 따르면, 가져 오기 라인은 다음과 같습니다 :'from nltk.tag.stanford import POSTagger'. 대신 StanordPOSTagger라는 것을 가져오고 있습니다. –