0
我已經爲需要文本輸入的場景創建了依賴關係圖。如何獲得包含Stanford NLP解析器中「根」修飾符依賴項的邊緣?
SemanticGraph dependencies = sentence.get(CollapsedCCProcessedDependenciesAnnotation.class);
我成功地使用下面的代碼讓「民」修改相關性:
List<SemanticGraphEdge> edgesContainingNumModifierDependency = dependencies.findAllRelns(GrammaticalRelation.valueOf("num"));
不過,我想找到有關「根」的邊緣,因此,以下
List<SemanticGraphEdge> edgesContainingRootModifierDependency = dependencies.findAllRelns(GrammaticalRelation.valueOf("root"));
似乎不起作用。
任何人都可以解釋爲什麼嗎?我如何才能獲得根的邊緣?
謝謝,它工作:) – 2015-02-11 17:42:16