0
给出了构成词的括号表示法,是否有办法将它转换为其依赖树?NLP将括号表示法转换为依赖关系树
[S [NP [Proper-Noun John]][VP [Verb saw][NP [Proper-Noun Mary]][PP [Preposition with][NP [Determiner a][Noun telescope]]]]]
到
nsubj(saw-2, John-1)
root(ROOT-0, saw-2)
dobj(saw-2, Mary-3)
case(telescope-6, with-4)
det(telescope-6, a-5)
nmod(saw-2, telescope-6)
那么为了获得SVO三元组,你需要依赖分析?或者只能从上述输出中提取此信息? – arjun
不,从类似于上面的组成分析树中提取依赖关系。查看edu.stanford.nlp.trees.EnglishGrammaticalStructure和edu.stanford.nlp.trees.EnglishGrammaticalRelations中的Stanford解析器代码。 EnglishGrammaticalRelations显示了用于查找像nsubj这样的关系的树形模式。你可以看到,这是非常英语/ PTB的具体和有很多启发式。 – aab