stanfordcorenlp和stanfordnlp什么关系不太清楚。stanfordnlp更名为Stanza ,https://github.com/stanfordnlp/stanfordnlp有说明。
stanfordcorenlp的一句话也没具体说明两者关系:
Stanford CoreNLP integrates many of Stanford’s NLP tools, including the part-of-speech (POS) tagger, the named entity recognizer (NER), the parser, the coreference resolution system, sentiment analysis, bootstrapped pattern learning, and the open information extraction tools
stanfordcorenlp官网:https://stanfordnlp.github.io/CoreNLP/index.html
步骤
第一步:pip install stanfordcorenlp
第二步:官网下载下面两文件,其他版本看3
安装部署下载下图1和2两个文件,2是1的一个中文处理jar组件,下载后放进1解压的文件夹里面就可以了,没有2只能处理英文。安装部署另外一个说明,版本要一致,好在版本号一致不容易混乱。版本更新有些地方更改,这点要注意了不要混用不同版本。
测试
from stanfordcorenlp import StanfordCoreNLP
nlp=StanfordCoreNLP(r"E:\Root\stanford\stanford-corenlp-full-2018-10-05",quiet=True,lang='zh')
# sentence='Guangdong University of Foreign Studies is located in Guangzhou.'
s2="请马上告诉我,我将第一时间进行修改.而且服务端的代码很解耦,修改为另外一种任务的服务也是很简单的,例如文本分类,我将会不就提供这一功能,也欢迎愿意分享的童鞋分享模型或者代码"
b=nlp.word_tokenize(s2)
print(b)