设置功能 - Uima Ruta

时间:2016-06-20 10:09:23

标签: uima ruta

我正在尝试"通过实例学习"这是在uima ruta文档中给出的。我已经尝试了如何通过将给定的注释存储为特征值来定义和分配就业关系。但是我收到了错误消息。我不清楚这个概念可以解释我详细。

DECLARE Annotation EmplRelation 
(Employee employeeRef, Employer employerRef);
Sentence{CONTAINS(EmploymentIndicator) -> CREATE(EmplRelation,"employeeRef" = Employee, "employerRef" = Employer)};
e1:Employer # EmploymentIndicator # e2:Employee) {-> EmplRelation, EmplRelation.employeeRef=e2, EmplRelation.employerRef=e1};

1 个答案:

答案 0 :(得分:2)

只是假设提到的错误消息可能是:问题中的脚本不完整。 “通过示例学习”部分不包含始终完整的脚本,而是根据先前的示例构建。这个示例的完整且正在运行的脚本可能看起来像(对于像“Peter为Frank工作”这样的输入文本):

DECLARE Employee, Employer, EmploymentIndicator, Sentence;
DECLARE EmplRelation (Employee employeeRef, Employer employerRef);

// create some dummy annotations to work on
"Peter" -> Employee;
"Frank" -> Employer;
"works for" -> EmploymentIndicator;
(# PERIOD){-> Sentence};

// the actual rules
Sentence{CONTAINS(EmploymentIndicator) -> CREATE(EmplRelation,"employeeRef" = Employee, "employerRef" = Employer)};
(e1:Employee # EmploymentIndicator # e2:Employer) {-> EmplRelation, EmplRelation.employeeRef=e1, EmplRelation.employerRef=e2};

请注意,我修改了最后一条规则,以便它适用于最小的例子。

免责声明:我是UIMA Ruta的开发者