1

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.

enter image description here

sKhan
  • 9,694
  • 16
  • 55
  • 53

2 Answers2

1

Please make sure that you added gate.jar from YOUR_GATE_HOME/bin folder.

ashingel
  • 494
  • 3
  • 11
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