3

I am trying to extract Email's annotation sets using ANNIE. Email is a default annotation type provided by ANNIE. I am using the following code:-

AnnotationSet defaultAnnotSet = doc.getAnnotations();
AnnotationSet curAnnSet;
curAnnSet = defaultAnnotSet.get("Email");

Here, i am getting the blank curAnnSet, don't know why

dedek
  • 7,981
  • 3
  • 38
  • 68
Anuj Jain
  • 245
  • 1
  • 2
  • 5
  • 4
    Does the `Document` you're looking at definitely contain any `Email` annotations? Try processing the same document with the same application in the GATE Developer GUI and check what annotations are found. – Ian Roberts Nov 16 '15 at 11:46
  • @IanRoberts Yes there is no Email annotation provided by ANNIE – Identity1 Dec 14 '15 at 13:49

1 Answers1

0

Well this might be a little late but I don't think ANNIE provides an annotation "Email". I remember an annotation "Address". You will need to create a JAPE rule as below to extract its kind.

({Address.kind=email}):email
-->
:email.Email= {rule = "Email"}

or

Extract the annotations like this:

if(defaultAnnotSet.get("Address").getFeatures().get("kind").toString().equals("email"))
{ 
//create new features
features.put("rule", "Email");

// create new annotation                                   
outputAS.add(defaultAnnotSet.firstNode(), defaultAnnotSet.lastNode(), "Email", features);

    }
Identity1
  • 1,139
  • 16
  • 33