CoreNLP SemanticGraph - search for edges with spec

2019-07-20 14:47发布

I'm using Stanford CoreNLP's dependency parser, and wondering how to make a generic search for SemanticEdge(s) with specific head lemma, dependent lemma, and lexical relationship. For example, if I have an actual dependency like this:

  • dobj(discover-4, insights-6)

How do I search for it using lemmas instead of the literal word and the index? Basically I want to be able to pattern match the parts of the dependency graph using generic rules...

1条回答
贼婆χ
2楼-- · 2019-07-20 15:47

You could do this with semgrex. See http://nlp.stanford.edu/software/tregex.shtml. Though you could also do it manually. Make sure that the nodes are storing lemmas -- see the lemma annotator of CoreNLP (currently available for English, only).

查看更多
登录 后发表回答