Callback Format

The response object is part of the callback POST request and is permanently stored as part of the task object.

{
  "annotations": [
    {
      "id": "b86c22a3-1f7c-4be2-bb8f-899ee9324c0b",
      "start": 10,
      "end": 17,
      "text": "Alex Wang",
      "label": "person",
    },
    {
      "id": "a76da53e-4ebd-4466-aed7-80db6fb98329",
      "start": 22,
      "end": 31,
      "text": "Transform",
      "label": "conference",
    }
  ],
  "relationships": [
    {
      "id": "ade8e9e9-ef9c-4fc7-9517-62d79a15c1cb",
      "source_ref": "b86c22a3-1f7c-4be2-bb8f-899ee9324c0b",
      "target_ref": "a76da53e-4ebd-4466-aed7-80db6fb98329",
      "name": "speaker_at",
    }
  ]
}

NamedEntityRecognitionResponse

FieldTypeDescription
annotationsobject arrayList of NamedEntityRecogntionAnnotation objects.
relationshipsobject arrayList of NamedEntityRecognitionRelationship objects.

NamedEntityRecognitionAnnotation

FieldTypeDescription
idstringUnique identifier.
startnumberStart index of the text span.
endnumberEnd index of the text span.
textstringText of the text span.
labelstringReferences the name field of a label in the task params.
attributes (optional)objectThe keys of the object reference keys of the attributes object for the corresponding label in the task params.

NamedEntityRecognitionRelationship

In tasks with undirected relationships, the source_ref and target_ref fields are interchangeable. In tasks with links that do not have relationship names, the name field will be left blank.

FieldTypeDescription
idstringUnique identifier.
source_refstringReferences the id of the annotation that is the source of the directed relationship.
target_refstringReferences the id of the annotation that is the target of the directed relationship.
name (optional)stringReferences the name of relationship definitions in the task params.