3

I tried a Script to mark the Journal using Score Condition.

   W{REGEXP("Journal",true)->MARK(ONLY_Journal)};
   W{REGEXP("Retraction|Retracted")->MARK(RETRACT)};
   W{REGEXP("Suppl")->MARK(SUPPLY)}; 
   NUM {->MARK(VOLUMEISSUE,1,6)}LParen NUM  SPECIAL?{REGEXP("-")} NUM? RParen; 

   Reference{CONTAINS(ONLY_Journal)->MARKSCORE(10,JOURNAL_MAYBE)};
   Reference{CONTAINS(JournalVolumeMarker)->MARKSCORE(5,JOURNAL_MAYBE)};    
   Reference{CONTAINS(VOLUMEISSUE)->MARKSCORE(15,JOURNAL_MAYBE)};   
   Reference{CONTAINS(JOURNALNAME)->MARKSCORE(10,JOURNAL_MAYBE)};     
   Reference{CONTAINS(RETRACT)->MARKSCORE(10,JOURNAL_MAYBE)};    
   Reference{CONTAINS(SUPPLY)->MARKSCORE(5,JOURNAL_MAYBE)}; 
   JOURNAL_MAYBE{SCORE(20,55)->MARK(JOURNAL)};

Sample Text

1.Lawrence RA. A review of the medical 342–340 benefits and contraindications to breastfeeding in the United States [Internet] . Arlington (VA): National Center for Education in Maternal and Child Health; 1997 Oct [cited 2000 Apr 24]. p. 40. Available from: www.ncemch.org/pubs/PDFs/Welcometojungle.pdf.

2.Shishido A. Retraction notice: Effect of platinum compounds on murine lymphocyte mitogenesis [Retraction of Alsabti EA, Ghalib ON, Salem MH. In: Jpn J Med Biol 1979 Apr; 32(2):53-65]. Jpn J Med Sci Biol 1980 Aug;33(4):235-237.

3.Leist TP, Zinkernagel RM. Effects of treatment with IL-2 receptor specific monoclonal antibody in mice [letter] [Retraction of Leist TP, Kohler M, Eppler M, Zinkernagel RM. In: J Immunol 1989 Jul 15; 143(2): 628-32]. J Immunol 1990 Apr 1;144(7):2847.

4.Chen, L., James, N., Barker, C., Busam, K., & Marghoob, A. (2013). Desmoplastic melanoma: A review. Journal of the American Academy of Dermatology, 68(5), 825-833. doi: 10.1016/j.jaad.2012.10.041.

But the above script is not working.Can anyone find a solution for it. Thanks in advance.

  • Can you please add more information about the A, B, C (...) annotations, e.g., an example of the documentText with the spans of the annotations? Are these at the exact some position? – Peter Kluegl Apr 20 '16 at 15:02
  • Is there an exception or some error reported? I assume that the "script is not working" mean that no JOURNAL annotation is created? Have you tried running it in the Ruta Workbench in debug mode? The explanation perspective often helps to identify the problem, e.g., which rules matches or failed. – Peter Kluegl Apr 21 '16 at 14:04
  • I tested the rules and they work for me. I will post my reproducible example as an answer. Which Ruta version do you use? – Peter Kluegl Apr 21 '16 at 14:05
  • Ruta version 2.4.0. Actually when i used JOURNAL_MAYBE{SCORE(20,55)->MARK(JOURNAL)};JOURNAL annotation is not created.But for JOURNAL_MAYBE{SCORE(10,55)->MARK(JOURNAL)}; or JOURNAL_MAYBE{SCORE(5,55)->MARK(JOURNAL)}; JOURNAL annotation is created(JOURNAL annotation contains the Reference which has SCORE 10 and 5).That's not mu expected output.I need the Reference which contains the SCORE 20 to 55 – Sugunalakshmi Pagemajik Apr 22 '16 at 04:27
  • Hi Peter I got the output.Thank you for your suggestions.Actually I used Reference{CONTAINS(JournalVolumeMarker),-PARTOF(JOURNAL_MAYBE)->MARKSCORE(5,JOURNAL_MAYBE)}; instead of Reference{CONTAINS(JournalVolumeMarker)->MARKSCORE(5,JOURNAL_MAYBE)};So that's the mistake. – Sugunalakshmi Pagemajik Apr 22 '16 at 08:51

1 Answers1

1

This should work jsut fine, but depends of course on the amount of annotations of the types existence of ONLY_Journal, JournalVolumeMarker, and so on ...

Here's the test script for a simple ruta project:

ENGINE utils.PlainTextAnnotator;
TYPESYSTEM utils.PlainTextTypeSystem;

Document{->EXEC(PlainTextAnnotator, {Paragraph})};

DECLARE Reference, ONLY_Journal, JOURNAL_MAYBE, JournalVolumeMarker, VOLUMEISSUE, JOURNALNAME, RETRACT, SUPPLY;
DECLARE JOURNAL;

Paragraph{-> Reference};
"Jpn J Med Biol" -> JOURNALNAME;
"32\\(2\\)" -> VOLUMEISSUE;

Reference{CONTAINS(ONLY_Journal)->MARKSCORE(10,JOURNAL_MAYBE)};
Reference{CONTAINS(JournalVolumeMarker)->MARKSCORE(5,JOURNAL_MAYBE)};    
Reference{CONTAINS(VOLUMEISSUE)->MARKSCORE(15,JOURNAL_MAYBE)};   
Reference{CONTAINS(JOURNALNAME)->MARKSCORE(10,JOURNAL_MAYBE)};     
Reference{CONTAINS(RETRACT)->MARKSCORE(10,JOURNAL_MAYBE)};    
Reference{CONTAINS(SUPPLY)->MARKSCORE(5,JOURNAL_MAYBE)}; 
JOURNAL_MAYBE{SCORE(20,55)->MARK(JOURNAL)};

... applied sample text, the second reference is annotated with JOURNAL.

DISCLAIMER: I am a develoepr of UIMA Ruta.

Peter Kluegl
  • 3,008
  • 1
  • 11
  • 8