windows 下 使用stanford parser的方法

stanford-parser-3.3.1.zip lutung.zip,javalutung的mandrill api客户端-一个java mandrill api连接器 立即下载
一、下载stanford Parser

Stanford Parser的下载地址:https://nlp.stanford.edu/software/stanford-parser-full-2017-06-09.zip

下载之后解压就ok了。

二、java的安装和配置
首先下载JDK。下载地址: 点击打开链接。
下载之后安装,配置环境变量。
测试是否配置成功。命令行输入:java -version会出现版本信息。命令行输入:javac 会出现javac的用法信息。
三、使用stanford parser 的GUI
在stanford Parser的解压包里点击运行:lexparser-gui.bat文件。会出现如下的界面:

然后load file,这里选择要解析的文件。作为示例,选择data路径下的testsent.txt。
然后load parser,选择stanford-parser-3.8.0-models.jar如下:
这里边有很多训练好的模型可供选择,这里我们选择edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz 


然后点击Parse,就会出现如下的结果:

四、python在nltk中使用stanford Parser
代码如下:
#!/usr/bin/env python
# _*_ coding:utf-8 _*_
from nltk.parse import stanford
import os

#添加stanford环境变量,此处需要手动修改,jar包地址为绝对地址。
os.environ["STANFORD_PARSER"] = "E:\software\pythonPacket\stanford-parser-full-2017-06-09\stanford-parser.jar"
os.environ["STANFORD_MODELS"] = "E:\software\pythonPacket\stanford-parser-full-2017-06-09\stanford-parser-3.8.0-models.jar"

#为JAVAHOME添加环境变量
java_path = "C:/Program Files/Java/jdk-9.0.1/bin/java.exe"
os.environ['JAVAHOME'] = java_path

parser = stanford.StanfordParser(model_path="edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz")
t = parser.raw_parse_sents(("the quick brown fox jumps over the lazy dog","the quick grey wolf jumps over the lazy fox"))

for item in t:
    print item.next()

结果如下:


参考:http://blog.csdn.net/qq_19670461/article/details/42681551

stanford parser About A natural language parser is a program that works out the grammatical structure of sentences, for instance, which groups of words go together (as "phrases") and which words are the subject or object of a verb. Probabilistic parsers use knowledge of language gained from hand-parsed sentences to try to produce the most likely analysis of new sentences. These statistical parsers still make some mistakes, but commonly work rather well. Their development was one of the biggest breakthroughs in natural language processing in the 1990s. You can try out our parser online. This package is a Java implementation of probabilistic natural language parsers, both highly optimized PCFG and lexicalized dependency parsers, and a lexicalized PCFG parser. The original version of this parser was mainly written by Dan Klein, with support code and linguistic grammar development by Christopher Manning. Extensive additional work (internationalization and language-specific modeling, flexible input/output, grammar compaction, lattice parsing, k-best parsing, typed dependencies output, user support, etc.) has been done by Roger Levy, Christopher Manning, Teg Grenager, Galen Andrew, Marie-Catherine de Marneffe, Bill MacCartney, Anna Rafferty, Spence Green, Huihsin Tseng, Pi-Chuan Chang, Wolfgang Maier, and Jenny Finkel. The lexicalized probabilistic parser implements a factored product model, with separate PCFG phrase structure and lexical dependency experts, whose preferences are combined by efficient exact inference, using an A* algorithm. Or the software can be used simply as an accurate unlexicalized stochastic context-free grammar parser. Either of these yields a good performance statistical parsing system. A GUI is provided for viewing the phrase structure tree output of the parser. As well as providing an English parser, the parser can be and has been adapted to work with other languages. A Chinese parser based on the Chinese Treebank, a German parser based on the Negra corpus and Arabic parsers based on the Penn Arabic Treebank are also included. The parser has also been used for other languages, such as Italian, Bulgarian, and Portuguese. The parser provides Stanford Dependencies output as well as phrase structure trees. Typed dependencies are otherwise known grammatical relations. This style of output is available only for English and Chinese. For more details, please refer to the Stanford Dependencies webpage. The current version of the parser requires Java 6 (JDK1.6) or later. (You can also download an old version of the parser, version 1.4, which runs under JDK 1.4, or version 2.0 which runs under JDK 1.5, but those distributions are no longer supported.) The parser also requires a reasonable amount of memory (at least 100MB to run as a PCFG parser on sentences up to 40 words in length; typically around 500MB of memory to be able to parse similarly long typical-of-newswire sentences using the factored model). The parser is available for download, licensed under the GNU General Public License (v2 or later). Source is included. The package includes components for command-line invocation, a Java parsing GUI, and a Java API. The parser code is dual licensed (in a similar manner to MySQL, etc.). Open source licensing is under the full GPL, which allows many free uses. For distributors of proprietary software, commercial licensing with a ready-to-sign agreement is available. If you don't need a commercial license, but would like to support maintenance of these tools, we welcome gift funding. The download is a 54 MB zipped file (mainly consisting of included grammar data files). If you unpack the zip file, you should have everything needed. Simple scripts are included to invoke the parser on a Unix or Windows system. For another system, you merely need to similarly configure the classpath. 立即下载

相关推荐

StanfordPaRser

StanfordPaRser

斯坦福的parser学习--

安装包下载链接: 斯坦福parser官方下载地址: https://nlp.stanford.edu/software/lex-parser.html#Download 从官网下载stanford-parser-full-2016-10-31.zip文件,网址是http://nlp.stanford.edu/software/stanford-parser-full-2016-10-31.z...

weixin_34236497的博客 158

Stanford parser

Stanford parser 句法分析器及可视化.如何使用。首先你的电脑需要安装jdk。

Stanford Parser句法分析器

Stanford Parser句法分析器使用教程 最近在寻找一些开源的语法分析软件,找到了stanford parser语句分析器。 安装过程如下: 首先下载源码,地址为:https://nlp.stanford.edu/software/lex-parser.shtml 选择最新版本下载,点击Download Stanford parser version 3.9.2部分进行下载: 下载之后为...

weixin_44627802的博客 3706

stanford-parser-3.6.0-models.jar

stanford-parser-3.6.0-models.jar

Ubuntu 22.04 搭建 PX4 飞控系统完全指南:从仿真到硬件试飞

定义消息文件protobufuint64 timestamp # 时间戳float32 temperature # 温度float32 humidity # 湿度生成代码:bashPX4 在 Ubuntu 22.04 的搭建涉及环境配置、编译仿真、硬件连接等多环节,核心是理解 PX4 1.14 的新特性(uXRCE-DDS、动态控制分配)。通过本文指南,开发者可快速构建稳定的 PX4 开发环境,为无人机应用开发奠定基础。

zqmgx13291的博客 3057

中文句法分析_句法分析StanfordParser+依存句法分析pyhanlp

使用stanfordparser实现中文句法分析,nltk生成句法分析树 以及pyhanlp实现依存句法分析

敷衍zgf的博客 1613

全新YOLOv11一文弄懂 | YOLOv11网络结构解读 、yolov11.yaml配置文件详细解读与说明、模型训练参数详细解析 | 通俗易懂!入门必看系列!

本文全面介绍了YOLOv11目标检测算法,包含网络结构解析、yaml配置文件详解及训练教程。YOLOv11通过改进的C3k2f模块、SPPF和C2PSA注意力机制等创新设计,在COCO数据集上实现了比YOLOv8更优的性能。文章详细解读了yolov11.yaml配置文件的参数设置、主干网络(backbone)和头部网络(head)结构,并提供了完整的训练代码示例和参数说明。训练部分涵盖了模型选择、参数设置及优化技巧,包括epochs、batch size、学习率等关键参数的调整建议。最后总结了YOLOv11

Ai缝合怪、助力小伙伴高效发论文 3万+

Windows下StanfordParser的使用

Stanford NLP提供了一系列自然语言分析工具,它们是: 分词:StanfordTokenizer、StanfordSegmenter 词性标注: StanfordPOSTagger 命名实体识别: StanfordNERTagger 句法分析: StanfordParser 依存句法分析: StanfordDependencyParser, StanfordNeuralDepen...

qq_41618091的博客 2592

Untiy之如何实现AI+MR (Pico4u 相机推流MR画面给Server做实时AI图像识别)

本文介绍了基于Pico4U企业版开发AI+MR应用的实现方案。文章详细说明了硬件准备步骤,包括购买企业版设备、申请相机权限和注册管理平台。重点讲解了Unity开发中获取摄像头画面的两种技术方案:通过Overlay直接渲染到Android Surface,或使用API获取图像数据转换为Texture。提供了完整的代码示例和权限配置说明,并揭示了底层通过JNI调用Android原生API的技术原理。该方案适用于带电操作等实习场景,可提升安全性和学习趣味性。

TxNet 1360

# YOLOv11-seg改进系列 | 引入CVPR MetaFormer的C3k2_PoolingFormerCGLU模块,池化Token混合+CGLU门控MLP

本文引入 CVPR 2022 论文(MetaFormer/PoolFormer)提出的 MetaFormer 元架构设计,以Pooling Token 混合器 + ConvolutionalGLU(CGLU)MLP构成,将其封装为,用于替换 YOLOv11-seg 的 C3k2 块。对比维度C3k2(基线)C3k2_PoolingFormerCGLU(本文)参数量(n scale)2.46M≈2.49M9.6≈9.69.7(+1.0%)架构范式单阶段卷积MetaFormer 双阶段。

qq_44224801的博客 855

NLP6:stanford Parser中文分词

使用stanford Parser进行中文分词、命名实体识别与句法分析。学习使用stanford Parser工具包,通过可视化界面和API调用两种方式进行中文信息处理。

定期分享我的发现和想法,感谢你的陪伴和支持 4925

CANoe之I/O功能采集电压

在进入ECU自动化测试中,有时会用到采集ECU电压,CANoe除了可以仿真、监听CAN、ETH、LIN等网络报文外,部分设备(如VN5650、VN1630等)上还有一个I/O口,这个I/O口就可以用来满足我们自动化测试中采集电压的需求。CANoe上的I/O功能用处还是特别大,比如网络管理测试、相关诊断都会用到。

测试领域技术分享 4852

stanford parser 中文 出错 UnicodeDecodeError

win7+python3.4+nltk调用stanford parser对中文进行语法解析。有些句子成功解析,有些句子会报错,报错如下:UnicodeDecodeError: 'utf-8' codec can't decode bytes in position 96-97: invalid continuation byte解决方法:parser = StanfordParser(model_...

xxzhix的博客 438

未连接互联网的银河麒麟v10安装g++,各种报错,如何处理?

🏆本文收录于《全栈Bug调优(实战版)》专栏,主要记录项目实战过程中所遇到的Bug或因后果及提供真实有效的解决方案,希望能够助你一臂之力,帮你早日登顶实现财富自由🚀;同时,欢迎大家关注&&收藏&&订阅!持续更新中,up!up!up!! 备注:部分问题/疑难杂症搜集于互联网。

**My Coding Family** 1810

手把手带你实现DAF-Net:零代码基础入门红外与可见光图像融合(从理论到实战)

本文介绍了红外与可见光图像融合技术及DAF-Net网络的应用。红外图像能捕捉热源但缺乏细节,可见光图像纹理丰富但在低光环境下表现不佳。DAF-Net采用双分支特征提取和动态注意力融合架构,能智能分配特征权重实现优势互补。文章详细讲解了环境配置、数据集准备(如TNO数据集)和预处理方法,并提供了DAF-Net的核心代码实现,包括特征提取、注意力融合和图像重建模块。通过该技术可在安防、自动驾驶等领域获得更优质的融合图像,提升视觉感知能力。

m0_71589036的博客 240

Stanford Parser学习入门(2)-命令行运行

在Stanford parser目录中已经定义了一部分命令行工具以及图形界面,本文将介绍如何在windows使用这些工具进行语法分析,Linux下也有shell可以使用。 关于如何搭建环境请参考上一篇文章:Standford Parser学习入门(1)-Eclipse中配置 在解压目录中,打开命令窗口,运行lexparser.bat,会得到如下结果,即为命令行方式运行结果。 ...

weixin_30767835的博客 212

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

Python 调用 Stanford Parser 两种方法

Python 调用 Stanford Parser 的方法 Jython 调用 Stanford Parser 的方法 Python java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory解决办法

huludan的专栏 1万+

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

【已解决】win10环境下基于nltk搭建stanford parser环境,进行中文依存句法分析

在win10环境下基于nltk搭建stanford parser环境,并进行中文依存句法分析。

诺顿500的博客 2711

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

NLP之Stanford Parser using NLTK

NLP Stanford Parser NLTK Constituency Parser Dependency Parser

毛球饲养员 3994

Windows下使用NLTK Stanford

nltk工具包中有一个用于自然语言句法分析的文件夹parse(地址C:\Python27\Lib\site-packages\nltk\parse\stanford.py)。其中stanford.py就是我们要用的stanford parser的源文件,这里面有parse...

城南花开的专栏 699

windows python调用Stanford nlp tools经验

使用nltk中的自带的类来调用Stanford nlp tools一直报错,具体原因是版本的原因,nltk需要3.0版本,并且nltk3.0只支持os/linux和windowX86。 接下来将Stanford开发的第三方工具包调用Stanford parser! 首先,需要下载 StanfordParser,下载3.6.0 还需要安装第三方工具包Stanford-parser-pytho

qfzxhy的博客 1611

Stanford CoreNLP 贡献指南:双许可模型、四种接受路径与开发流程实战

本篇技术指南基于仓库根目录下的 [CONTRIBUTING.md](https://link.gitcode.com/i/8bc5e5b13f0730ae318215e223d8c6b4),完整解读 Stanford CoreNLP 的贡献规则:包括项目为何采用"GPL 开源 + Stanford 商业授权"的双许可模型、外部贡献被官方接受的四种具体方式,以及面向开发者的分支、编码、测试等硬性要求

gitblog_00893的博客 787

python自然语言处理--安装JDK和Stanford Parser

1. 安装JDK和设置JAVA_HOME 在windows系统上安装JDK和设置JAVA_HOME的步骤如下: 下载JDK,点这里,选择相应的JDK,并单击"Download" 安装JDK 将JDK安装在您的计算机上,例如: C:\Program Files\Java\jdk1.6.0_02 下,如果需要,也可以安装在其他位置 安装完成后,设置JAVA_HOME 右键点击“我的电脑”,然后选择“属性” 在“高级”选项卡上,选择“环境变量”,然后编辑JAVA_HOME,增加JDK所在位置(例如:

Amy9_Miss的博客 791
上一篇: c++中的智能指针
下一篇: MySQL的内部联结,外部联结(左联结,右联结),自然联结
PinkFriday
博客等级 码龄10年 22粉丝 30原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址