首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >斯坦福nndep获得解析树

斯坦福nndep获得解析树
EN

Stack Overflow用户
提问于 2015-07-13 10:20:06
回答 1查看 149关注 0票数 0

使用斯坦福大学CoreNLP,我试图使用神经网络依赖分析器解析文本。它运行得非常快(这就是为什么我想使用这个而不是LexicalizedParser),并且产生高质量的依赖关系。我也对检索解析树(佩恩树风格)也感兴趣。因此,在给定GrammaticalStructure时,我将获取它的根(使用root()),然后尝试使用toOneLineString()方法打印出来。但是,root()返回树的根节点,其中包含一个空/空子列表。我在说明书或常见问题中找不到任何东西。

代码语言:javascript
复制
 GrammaticalStructure gs = parser.predict(tagged);

  // Print typed dependencies
  System.err.println(gs);

  // get the tree and print it out in the parenthesised form
  TreeGraphNode tree = gs.root();
  System.err.println(tree.toOneLineString());

这方面的产出如下:

代码语言:javascript
复制
  ROOT-0{CharacterOffsetBeginAnnotation=-1, CharacterOffsetEndAnnotation=-1, PartOfSpeechAnnotation=null, TextAnnotation=ROOT}Typed Dependencies: 
  [nsubj(tell-5, I-1), aux(tell-5, can-2), advmod(always-4, almost-3), advmod(tell-5, always-4), root(ROOT-0, tell-5), advmod(use-8, when-6), nsubj(use-8, movies-7), advcl(tell-5, use-8), amod(dinosaurs-10, fake-9), dobj(use-8, dinosaurs-10), punct(tell-5, .-11)]
  ROOT-0

怎样才能得到解析树呢?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-07-14 11:05:16

我想我可以使用斯坦福大学提供的Shift减少选区解析器。它非常快,结果是可比较的。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31380759

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档