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