首页 > 解决方案 > StanfordCoreNLP 西班牙语模块

问题描述

我正在尝试使用StanfordCoreNLP库中的西班牙语模块,但我不断收到一条消息AttributeError: type object 'StanfordCoreNLP' has no attribute 'Pipeline'。任何想法如何访问西班牙语模块?

from pycorenlp import StanfordCoreNLP

# stanfordnlp.download('es')
nlp = StanfordCoreNLP.Pipeline(lang="es", treebank="es_ancora")

标签: pythonnlpstanford-nlp

解决方案


如果你想用 Python 处理西班牙语,我们有两种选择。

1.) 运行 Stanza 神经管道(这将允许tokenize,mwt,pos,lemma, depparse,ner)。见这里:https ://stanfordnlp.github.io/stanza/installation_usage.html

2.) 使用 Stanza 的客户端访问 CoreNLP 服务器(这也将包括通过parse注释器进行的选区解析)参见此处:https ://stanfordnlp.github.io/stanza/corenlp_client.html

如果您有任何其他问题,请告诉我。


推荐阅读