【发布时间】:2017-04-05 03:37:04
【问题描述】:
我想我需要 edu.stanford.nlp 包中的 Semgrex。对于这项任务,我需要从 edu.stanford.nlp.trees.Tree 构造 Tree 并像
一样处理该树import edu.stanford.nlp.semgraph.semgrex.SemgrexMatcher;
import edu.stanford.nlp.trees.Tree;
import edu.stanford.nlp.semgraph.SemanticGraphFactory;
public class SemgrexDemo {
public static void main(String[] args) {
Tree someHowBuiltTree;//idnt know how to construct Tree from conll
SemanticGraph graph = SemanticGraphFactory.generateUncollapsedDependencies(someHowBuiltTree);
SemgrexPattern semgrex = SemgrexPattern.compile("{}=A <<nsubj {}=B");
SemgrexMatcher matcher = semgrex.matcher(graph);
}
}
其实我需要一些关于如何从 conll 中构造树的建议。
【问题讨论】:
标签: nlp stanford-nlp syntaxnet