1 Stanford Parser简介与安装
Stanford Parser顾名思义是由斯坦福大学自然语言小组开发的开源句法分析器,是基于概率统计句法分析的一个Java实现。该句法分析器目前提供了5个中文文法的实现。他的优点在于:
既是一个高度优化的概率上下文无关文法和词汇化依存分析器,又是一个词汇化上下文无关文法分析器;
以权威的并州树库作为分析器的训练数据,支持多语言。目前已经支持英文,中文,德文,意大利文,阿拉伯文等;
提供了多样化的分析输出形式,出句法分析树外,还支持分词和词性标注、短语结构、依存关系等输出;
内置了分词,词性标注,基于自定义树库的分析器训练等辅助工作。
支持多平台,并封装了多种常用语言的接口,例如:java,python,php,ruby等。
本介绍是基于Stanford Parser的Python接口。由于该句法分析器底层是由java实现,因此使用时需要确保安装JDK。当前,最新的Stanford Parser版本为3.9.1,对JDK的要求是1.8以上。网上JDK的安装教程有很多,可以搜索查看,需要注意的是要配置JAVA_