70 likes | 205 Views
UIMA Overview. Fall 2005 OOPD John Anthony. UIMA Conceptual Overview. Steps to develop an Annotator. Define the CAS types the annotator will use Generate the Java classes for these types (automatic via JCasGen). Write the actual annotator java code
E N D
UIMA Overview Fall 2005 OOPD John Anthony
Steps to develop an Annotator • Define the CAS types the annotator will use • Generate the Java classes for these types (automatic via JCasGen). • Write the actual annotator java code • Create the Analysis Engine (AE) descriptor • Test the Annotator.
Define the Types • Create a Type Feature Descriptor. An XML file that defines the types.Eclipse includes the Component Descriptor Editor plug-in that will help create this file. • Types are analogous to classes and features are analogous to attributes. • You can create custom types or inherit from predefined types (the root is TOP).
Create the Java classes for Types • If using Eclipse, JCasGen is automatically executed each time you save the type feature descriptor. • You can also run the tool outside of Eclipse by executing the jcasgen.bat located in the bin directory of UIMA.
Develop Annotator Code JTextAnnotator JTextAnnotator_ImplBase Initialize() Process() Destroy() Must have default constructor so framework can instantiate it YouAnnotator process(….)
process(…) Process takes two parms: • JCas contains the document to be analyzed and the analysis results (accessed via the indexes). • Ignore ResultSpecification for now… Two important methods: aJCas.getdocumentText(); //returns the text of the document myAnnocation.addToIndexes(); //adds the annotation to the CAS index