referencing issue with rule that has multiple elements matching the same annotation type

StackOverflow https://stackoverflow.com/questions/20983243

  •  25-09-2022
  •  | 
  •  

문제

This little problem has kept me up for a couple of nights now.

I have the following UIMA Ruta script:

(Action.type=="info_req"{->CREATE(CompAction,"type"=Action.type)}
Preposition? Article? ServiceItem{->FILL(CompAction,"target"=ServiceItem, "num_targets"=1),SHIFT(CompAction,1,4)}
(Preposition? Article? ServiceItem)?{
    ->FILL(CompAction, "target2"=ServiceItem, "num_targets"=2, "selection"="OR") })
    {->SHIFT(CompAction,1,1)}
    ;

It is supposed to match the following sentence:

I want information about the card about the gold credit card

  • Annotation Action matches "I want information"
  • Annotation Preposition matches "about"
  • Annotation Article matches "the"
  • Annotation ServiceItem matches "card" and "gold credit card"

The desired result should be a CompAction Annotation with the following features:

  • Feature target: (type ServiceItem) card
  • Feature target2: (type ServiceItem) gold credit card

Unfortunately, the result I get is:

  • Feature target: (type ServiceItem) card
  • Feature target2: (type ServiceItem) card

i.e. I get the same ServiceItem twice, which seems to be a referencing problem, unless I am doing something very wrong.

도움이 되었습니까?

해결책

For UIMA Ruta 2.1.0: The FILL action considers the complete rule match for the values of the features and, thus, the second FILL action also selects the first suitable annotation. A solution for this problem could be to use different types (subtypes) for the different ServiceItem annotations in order to distinguish them.

For UIMA Ruta 2.2.0: The functionality is implemented and is already available in the current trunk. The rule should do as desired.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top