2

我正在尝试 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};
4

1 回答 1

3

假设提到的错误消息可能是什么:问题中的脚本不完整。“通过示例学习”部分并不总是包含完整的脚本,而是建立在前面的示例之上。此示例的完整且正在运行的脚本可能如下所示(对于“彼得为弗兰克工作”之类的输入文本):

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 的开发人员

于 2016-07-07T08:44:09.420 回答