I am trying to write an application from extracting entities from a text and want to use GATE jar files. For which I have installed the GATE tool and have imported jar files, but it is giving errors. I can't understand from where to download more jar files and how to run the first simple program with this.
Asked
Active
Viewed 283 times
1
-
Better not to paste code as image – Batanichek Feb 20 '16 at 07:23
-
Not all jars are visible in the Libraries folder. Also it would be better to put errors as text. Not all are familiar with Netbeans IDE. – ashingel Feb 20 '16 at 20:09
2 Answers
1
Please make sure that you added gate.jar from YOUR_GATE_HOME/bin folder.

ashingel
- 494
- 3
- 11
-
Now I need to write a simple program to extract entities from text. – Rahim Ullah Rudbari Feb 21 '16 at 05:52
0
From your screenshot I can assume that you used an example provided by GitHub. This example looks good, except one part (from my point of view of course). I would suggest to replace output piece with the next more readable code:
String text = "Steve works for Apple Inc in California.";
Document gateDocument = Factory.newDocument(text);
corpus.add(gateDocument);
// tell the ANNIE application about the corpus and run it
annie.setCorpus(corpus);
annie.execute();
List<Annotation> personAnnotations = gateDocument.getAnnotations().get(ANNIEConstants.PERSON_ANNOTATION_TYPE).inDocumentOrder();
for (Annotation personAnnotation : personAnnotations) {
System.out.println("Entity Text: " + gate.Utils.stringFor(gateDocument, personAnnotation) + " Features: " + personAnnotation.getFeatures());
}
Similar things could be done for Location, Organisation and other Entity types defined in GATE. Also do not forget to release resources with Factory.deleteResource().

ashingel
- 494
- 3
- 11