UTHealth-CCB / clamp-support

Clinical Language Annotation Modeling and Processing toolkit
http://clamp.uth.edu/
16 stars 2 forks source link

CLAMP can not run the Ruta Rules for predicting the relationships #27

Open ghost opened 5 years ago

ghost commented 5 years ago

I am trying to implement relationship Ruta rules the same as in this video (https://www.youtube.com/watch?time_continue=1105&v=8PYvzswOXog). However, I can not get the results of any relationships. I did perfectly follow everything in his demo.

Any help is appreciated.

`BLOCK (ForEach) Sentence{}{
ClampNameEntityUIMA { FEATURE ( "semanticTag", "test")} BaseToken??{REGEXP("grade")} ClampNameEntityUIMA { FEATURE ( "semanticTag", "Date" ) -> CREATE( ClampRelationUIMA, "entFrom"=3, "entTo"=1), SETFEATURE("semanticTag", "testdate")};
}

BLOCK (ForEach) Sentence{}{ ClampNameEntityUIMA { FEATURE ( "semanticTag", "test")} BaseToken??{REGEXP("[grade\s]*")} ClampNameEntityUIMA { FEATURE ( "semanticTag", "value" ) -> CREATE( ClampRelationUIMA, "entFrom"=3, "entTo"=1), SETFEATURE("semanticTag", "testvalue")}; }`

jingqihit commented 5 years ago

Hi, The rules sometimes are tricky to write/debug. One suggestion here is that you can test each 'condition' separately and then add them together one by one. Something like this:

BLOCK (ForEach) Sentence{}{ ClampNameEntityUIMA { FEATURE ( "semanticTag", "test") -> SETFEATURE("semanticTag", "testdate")}; } // make sure the first part is runnable;

BLOCK (ForEach) Sentence{}{ BaseToken{REGEXP("grade") -> CREATE( ClampNameEntityUIMA, "semanticTag", "testdate")}; } // make sure the second part is runnable;

Then BLOCK (ForEach) Sentence{}{ ClampNameEntityUIMA { FEATURE ( "semanticTag", "test") } BaseToken{REGEXP("grade") -> CREATE( ClampNameEntityUIMA, "semanticTag", "testdate")}; } // make sure the first + second parts are runnable;

Then extend to the third part.