simongray / datalinguist

Stanford CoreNLP in idiomatic Clojure.
GNU General Public License v3.0
114 stars 5 forks source link

Annotation hierarchy observability #3

Closed simongray closed 3 years ago

simongray commented 3 years ago

CoreNLP annotations do have a de facto hierarchy, e.g. a dependency graph is always a child of a sentence, but in principle annotations can appear as a children of any other annotations. Consequently, there is really no delimited annotation tree to illustrate, nor is there an obvious built-in way to infer whether a certain annotation supports a specific annotation as its child.

Explore various ways this could be enhanced. Maybe there is some role for metadata?

simongray commented 3 years ago

One quality-of-life feature could be to upgrade (annotation ann x) calls so that results are polymorphic on a limited set of common annotation types, e.g. documents and sentences. This would ideally replace awkward constructions like

(-> example sentences first dependency-graph)

with

(-> example dependency-graph)

where dependency-graph simply maps to the sentences in the document.