Package nzilbb.ag

Implementation of an Annotation Graph API for linguistic annotations.

Annotation Graphs are a data structure conceived by Steven Bird and Mark Liberman

The structure is designed to be a tool-independent way of representing annotated linguistic data, and essentially defines an Annotation Graph as a directed acyclic graph where:

  • nodes are 'anchors' that represent a point in time (in seconds) or a point in a text (in characters) (although the time/character offset label is optional), and
  • edges are 'annotations' which have a 'label' (the content of the annotation) and a 'type' (the kind of annotation, analogous with an 'tier' or 'layer')

This particular implementation, which is used for LaBB-CAT, developed by the NZILBB, includes extra features that allow tier hierarchies and parent/child constraints to be defined. More details on extra features are available in http://dx.doi.org/10.1016/j.csl.2017.01.004

An annotation graph represented by the Graph class, and is a collection of Annotations (edges) joined by Anchors (nodes) which may or may not have temporal/character offsets. Superimposed over this temporally anchored graph is another heirarchical graph, where annotations are nodes and edges are child-to-parent links.

An example of a heirarchical annotation graph

In addition to containing the nodes/edges, this class inherits from Annotation so that it can:

  • be the root node of the annotation hierarchy - i.e. be the parent of annotations at the top of the layer hierarchy
  • have start/end anchors

In addition to this, the graph also has:

It is recommended that other graph attributes are represented as annotations that 'tag' the whole graph, and that speakers/participants are also represented as such annotations, on a "participant" layer, which is the parent of a "turn" layer which defines speaker turns.

The Graph class can also represent graph fragments (sub-graphs). If this is a whole graph, Graph.getGraph() == this, but if it's a fragment, then Graph.getGraph() != this. The Graph.isFragment() convenience method captures this principle. The annotations in a graph fragment have the fragment object (not the whole-graph object) set as their Graph.getGraph().

Author:
Robert Fromont robert.fromont@canterbury.ac.nz