斯坦福依赖关系转换工具 [英] Stanford Dependencies Conversion Tool

查看:214
本文介绍了斯坦福依赖关系转换工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

斯坦福大学依赖关系手册( http://nlp.stanford.edu/software/dependencies_manual. pdf )中提到:或者我们的转换工具可以将其他选区解析器的输出转换为斯坦福依赖关系表示形式."

The Stanford dependencies manual (http://nlp.stanford.edu/software/dependencies_manual.pdf) mentions: "Or our conversion tool can convert the output of other constituency parsers to the Stanford Dependencies representation."

有人知道该工具在哪里可用或如何使用吗?

Does anyone know where is that tool available or how to use it?

Stanford Parser文档( http://nlp.stanford.edu/software/stanford-dependencies.shtml )提到:可以使用解析器包中提供的EnglishGrammaticalStructure类,使用我们的软件对短语结构树获取依赖关系.daccess-ods.un.org daccess-ods.un.org

The Stanford Parser documentation (http://nlp.stanford.edu/software/stanford-dependencies.shtml) mentions: "the dependencies can be obtained using our software [...] on phrase-structure trees using the EnglishGrammaticalStructure class available in the parser package."

我对获取(ccprocessed)类型的依赖项列表以在NLTK中使用感兴趣.我看到有一个构造函数EnglishGrammaticalStructure(Tree t),我想要一些有关如何为其提供NLTK树的指南.

I am interested in obtaining (ccprocessed) typed dependency lists to use in NLTK. I see there is a constructor EnglishGrammaticalStructure(Tree t) and I'd like some guidance on how to provide a NLTK tree to it.

第一个想法:使用nltk.tree.Tree.pprint生成一个字符串,然后使用Java中的Tree.valueOf对其进行解析.有什么建议吗?

First idea: Use nltk.tree.Tree.pprint to produce a string and then parse it using Tree.valueOf from Java. Any suggestion?

相关问题:

  • How do I do dependency parsing in NLTK?
  • Does NLTK have a tool for dependency parsing?

推荐答案

我不确定您是否查看过Stanford Parser的常见问题解答:

I am not sure if you have looked at the Stanford Parser's FAQs:

您可以使用EnglishGrammaticalStructure的主要方法.您可以给它提供-treeFile这样的选项以读取树,例如-collapsed可以输出typedDependenciesCollapsed.例如,此命令(带有适当的路径)会将Penn Treebank文件转换为未折叠的类型依赖项:

You can use the main method of EnglishGrammaticalStructure. You can give it options like -treeFile to read in trees, and, say, -collapsed to output typedDependenciesCollapsed. For example, this command (with appropriate paths) will convert a Penn Treebank file to uncollapsed typed dependencies:

java -cp stanford-parser.jar edu.stanford.nlp.trees.EnglishGrammaticalStructure -treeFile wsj/02/wsj_0201.mrg -basic

[...]

这里的mrg文件是``合并的''(即POS标签和短语结构)宾夕法尼亚州树库表示形式,如果使用适当的语法定义,则可以使NLTK的Tree.pprint发出.但是,我无法对此进行扩展,因为问题描述没有涉及为什么必须对这两个工具进行流水线处理.

The mrg file, here, is a 'merged' (i.e. POS tags and phrase structure) Penn Treebank representation, which you can get NLTK's Tree.pprint to emit, if you use an appropriate grammar definition. However, I cannot expand on this because the question description does not go into why these two tools must be pipelined.

这篇关于斯坦福依赖关系转换工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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