我正在尝试使用ANNIE提取电子邮件的注释集。电子邮件是ANNIE提供的默认注释类型。 我使用以下代码: -
AnnotationSet defaultAnnotSet = doc.getAnnotations();
AnnotationSet curAnnSet;
curAnnSet = defaultAnnotSet.get("Email");
在这里,我得到空白的curAnnSet,不知道为什么
答案 0 :(得分:0)
这可能有点晚了,但我不认为ANNIE提供了注释“电子邮件”。我记得一个注释“地址”。您需要创建一个JAPE
规则,如下所示,以提取其类型。
({Address.kind=email}):email
-->
:email.Email= {rule = "Email"}
或
提取这样的注释:
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);
}