有没有人有经验来改编以下(3.6)Python代码以获得法语而非英语的POS标记:
# *** POS tagging *** with CoreNLP
from nltk.tag.stanford import CoreNLPPOSTagger
CoreNLPPOSTagger(url='http://localhost:9000').tag('What is the airspeed of an unladen swallow ?'.split())
类似,对于解析:
# *** Parsing *** with CoreNLP
from nltk.parse.corenlp import CoreNLPParser
stanford_parser = CoreNLPParser()
json_result = stanford_parser.api_call('He is fine')
for sentence in json_result['sentences']:
for token in sentence['tokens']:
print(token)
所有这些代码运行顺利。
感谢您的帮助。
L,