Jape规则,用于提取两个注释之间的文本

时间:2019-04-11 13:27:32

标签: gate information-extraction

我试图通过为同一注释创建jape语法规则来提取两个带注释的术语之间的文本。我指的是“ https://gate.ac.uk/wiki/jape-repository/annotations.html#section-2”。此文档具有相同功能,但无法做到。

Phase: DATA
Input: Token 
Options: control = appelt


Rule: GuessProduct1
Priority: 4
(
({Token.string == "abc"}):left
({{Token.string == "xyz"}):right
)
-->
{
  Node start = ((AnnotationSet) bindings.get("left")).lastNode();
  Node end   = ((AnnotationSet) bindings.get("right")).firstNode();

FeatureMap features = Factory.newFeatureMap();
 features.put("rule", "GuessProduct1");

  outputAS.add(start, end,"Product", features);                                                               
}

0 个答案:

没有答案