前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >基于stanza实现Python3调用Stanford NLP

基于stanza实现Python3调用Stanford NLP

原创
作者头像
sparkexpert
发布2017-12-27 12:48:42
1.7K0
发布2017-12-27 12:48:42
举报

stanford NLP(源码:https://github.com/stanfordnlp/CoreNLP)是业界非常著名的自然语言处理(NLP)套件之一,提供了面向多种语言的多种自然语言处理任务,具体如下:

Stanford Parser

Stanford POS Tagger

Stanford Named Entity Recognizer

Stanford RegexNER

Stanford Coreference Resolution

Stanford Word Segmenter

Stanford Classifier

Stanford EnglishTokenizer

Stanford TokensRegex

Stanford Temporal Tagger (SUTime)

Stanford Pattern-based Information Extraction and Diagnostics (SPIED)

Stanford Relation Extractor

(1)stanza工程介绍

实现python来调用stanford NLP,是PYTHON程序员进行数据处理经常需要用到的工具,coreNLP本身也提供了官方进行python调用的程序包(https://github.com/stanfordnlp/python-stanford-corenlp),而本文主要是基于stanforfd提供的另外一个开源程序stanza(https://github.com/stanfordnlp/stanza)来实现python调用。

其介绍如下:

Stanza is the Stanford NLP group’s shared repository for Python infrastructure. The goal of Stanza is not to replace your modeling tools of choice, but to offer implementations for common patterns useful for machine learning experiments.

(2)stanza调用的步骤

A:启动coreNLP服务,在下载包中,进行服务的启动

代码语言:javascript
复制
# Run the server using all jars in the current directory (e.g., the CoreNLP home directory)
java -mx4g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer -port 9000 -timeout 15000

主要启动界面如下:

B:在浏览器中输入网址:http://localhost:9000,可以进行测试和查看NLP处理结果。

(3)基于stanza来实现corenlp调用。

这里采用python3来进行源码的重构,去掉一些原始python2.*风格的错误。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • (1)stanza工程介绍
  • (2)stanza调用的步骤
相关产品与服务
NLP 服务
NLP 服务(Natural Language Process,NLP)深度整合了腾讯内部的 NLP 技术,提供多项智能文本处理和文本生成能力,包括词法分析、相似词召回、词相似度、句子相似度、文本润色、句子纠错、文本补全、句子生成等。满足各行业的文本智能需求。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档