最近,我使用了NLTK中存在的模块CoreNLPNERTagger。我创建了一个新环境并尝试使用它,但是它不起作用。我收到模块导入错误。从stanford-corenlp-full-2018-02-27目录启动Core NLP服务器。
java -mx4g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer -port 9000 -timeout 15000
错误
ImportError: cannot import name 'CoreNLPNERTagger'
Python 3代码
os.environ["STANFORD_MODELS"] = "./stanford-ner-2014-06-16"
import nltk.tag.stanford as st
from nltk.tag.stanford import CoreNLPNERTagger
tagger = CoreNLPNERTagger()
我可以使用StanfordNERTagger,但是与CoreNLPNERTagger相比它非常慢。