python - 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")
解决方案
如果你想用 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
如果您有任何其他问题,请告诉我。
推荐阅读
- json - 如何将动态命名的记录与 Dhall 中的静态记录合并?
- docker - 如何使用自己的 Dockerfile 搭建 Ray 集群?
- python - Matplotlib 中的文本位置具有绝对 x 坐标,但不是 y
- python - 关于字典的Python问题(调试)
- html - 如何在不被计算的情况下观看 youtube 视频?
- ruby - 无法为 docker ruby alpine 安装 openssl-dev
- c - 使用 fgets() 随机出现分段错误,仅发生在 linux 服务器上,而不是我自己的发行版
- python - Python Regex:如果包含某些字符串,则不匹配
- awk - 使用 awk 打印字段是否以特定字符串开头
- spring-boot - 为什么 Intellij 在 Spring Boot Starter 项目中无法识别 Gradle?