如何使用Stanford NLP解析器获取依赖关系树 [英] how to get a dependency tree with Stanford NLP parser

查看:724
本文介绍了如何使用Stanford NLP解析器获取依赖关系树的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何获取依赖关系树,如下图所示.我可以将依赖关系获取为纯文本格式,还可以借助dependencysee工具获得依赖关系图.但是,以词为节点,以边缘为依存关系的依存树呢?非常感谢!

How can I get the dependency tree as Figure below. I can get the dependency relation as pure text, and also the dependency graph with the help of dependencysee tool. But how about the dependency tree which has words as nodes and dependency as edges. Thanks very much!

推荐答案

这些图是使用 GraphViz 生成的.开源图形绘图包,最初来自AT& T Research.您可以在edu.stanford.nlp.trees.semgraph.SemanticGraph中找到方法toDotFormat(),该方法会将SemanticGraph转换为dot输入语言格式,可以由dot/GraphViz呈现.目前,尚没有提供此功能的命令行工具,但是使用该方法非常简单.

These graphs are produced using GraphViz, an open source graph drawing package, originally from AT&T Research. You can find a method toDotFormat() in edu.stanford.nlp.trees.semgraph.SemanticGraph that will convert a SemanticGraph into dot input language format which can be rendered by dot/GraphViz. At present, there isn't a command-line tool that provides this functionality, but it's pretty straightforward using that method.

这篇关于如何使用Stanford NLP解析器获取依赖关系树的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆