I have been searching for examples of using Apache UIMA in a java program. Are there examples on how to use the example Annotators in a Java program ?
Examples for using Apache UIMA in a java program
If you want to use UIMA directly into Java code, you might want to have a look at uimafit, because it eases the use of UIMA from within Java. Here is a quick example to use the example Annotator (source)
public class RoomNumberAnnotatorPipeline {
public static void main(String[] args) throws UIMAException {
String text = "The meeting was moved from Yorktown 01-144 to Hawthorne 1S-W33.";
TypeSystemDescription tsd = createTypeSystemDescription(
"org.uimafit.examples.tutorial.type.RoomNumber");
JCas jCas = createJCas(tsd);
jCas.setDocumentText(text);
AnalysisEngine analysisEngine = createPrimitive(RoomNumberAnnotator.class, tsd);
analysisEngine.process(jCas);
for (RoomNumber roomNumber : select(jCas, RoomNumber.class)) {
System.out.println(roomNumber.getCoveredText() + "\tbuilding = "
+ roomNumber.getBuilding());
}
}
}
a little late, but one shortcoming is uimafit doesn't support pear packages. –
Brucie
@Brucie try with groups.google.com/forum/?fromgroups=#!topic/uimafit-users/… –
Jez
Yes there are examples provided in UIMA SDK. You need to read developers guide here how to view the source in Eclipse.UIMA Tutorial and Dev Guide. Look at section 1.1.3 and Chapter 3.
© 2022 - 2024 — McMap. All rights reserved.