首页 > 解决方案 > 在 UIMA RUTA 中应用 COUNT 条件时出现问题

问题描述

我使用 COUNT Condition 来查找注释中的标点符号的数量。但是我没有收到预期的输出。

             DECLARE Sentence(INT pmcount);
             "Conflicts of interest"->Sentence;

             DECLARE SentenceLastToken;
                     Sentence{-PARTOF(SentenceLastToken)->MARKLAST(SentenceLastToken)};
             INT Pmcount=0; 

             Sentence->{ANY+?{->SHIFT(Sentence,1,1,true)} SentenceLastToken{PARTOF(PM)};};
             Sentence{COUNT(PM,Pmcount)->Sentence.pmcount=Pmcount};

样本输入:

 Conflicts of interest.

预期输出:

  Conflicts of interest
       pmcount:0

接收输出:

  Conflicts of interest
       pmcount:1

只有在 Annotation 值之后有任何 PM 时,我才会面临这个问题。

标签: uimaruta

解决方案


推荐阅读