Search code examples
uimaruta

uima ruta Score Condition


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.


Solution

  • 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.