Writing an External Annotator - RHIT-XPrize/rhit-xprize-pipeline GitHub Wiki

Perform the same steps necessary for creating a Core Annotator, but instead of extending JCasAnnotator_ImplBase, extend one of the various abstract classes used for communicating with external annotators (such as HttpAnnotator). These abstract classes isolate the communication logic and ensure your Annotator adheres to the communication protocol. Details on what is required for the different abstract Annotators are given below.

In the external language, write or use corresponding code that adheres to whatever communication protocol you’re using. Details on each protocol are given below if you need to implement something not yet created for your language of choice.

Please do not integrate your communication protocol into the same class / structure as your Annotator. Share your work with others and keep everyone from rewriting the same code.

After that, use the interface provided by the language to implement your annotator accordingly. Most if not all of the communication protocols deal with the JSON-ified CAS object, which has the form:

{
  "_context": {
    "_types": {
      "DocumentAnnotation": {
        "_id": "uima.tcas.DocumentAnnotation",
        "_feature_types": {
          "sofa": "_ref"
        }
      },
      "Sofa": {
        "_id": "uima.cas.Sofa",
        "_feature_types": {
          "sofaArray": "_ref"
        }
      },
      "Annotation": {
        "_id": "uima.tcas.Annotation",
        "_feature_types": {
          "sofa": "_ref"
        },
        "_subtypes": [
          "DocumentAnnotation"
        ]
      },
      "AnnotationBase": {
        "_id": "uima.cas.AnnotationBase",
        "_feature_types": {
          "sofa": "_ref"
        },
        "_subtypes": [
          "Annotation"
        ]
      },
      "TOP": {
        "_id": "uima.cas.TOP",
        "_subtypes": [
          "AnnotationBase",
          "Sofa"
        ]
      }
    }
  },
  "_views": {
    "_InitialView": {
      "DocumentAnnotation": [
        {
          "sofa": 1,
          "begin": 0,
          "end": 62,
          "language": "x-unspecified"
        }
      ]
    }
  },
  "_referenced_fss": {
    "1": {
      "_type": "Sofa",
      "sofaNum": 1,
      "sofaID": "_InitialView",
      "mimeType": "text",
      "sofaString": "This is some document text."
    }
  }
}
⚠️ **GitHub.com Fallback** ⚠️