The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

UMLS::Similarity::vector - Perl module for computing semantic relatedness of concepts in the Unified Medical Language System (UMLS) using the method described by Patwardhan and Pedersen (2006).

CITATION

 @inproceedings{PatwardhanP06,
  title={{Using WordNet-based Context Vectors to Estimate 
          the Semantic Relatedness of Concepts}},
  author={Patwardhan, S. and Pedersen, T.},
  booktitle={Proceedings of the EACL 2006 Workshop Making Sense
             of Sense - Bringing Computational Linguistics and 
             Psycholinguistics Together},
  volume={1501},
  pages={1-8},
  year={2006},
  month={April},
  address={Trento, Italy}
 }

SYNOPSIS

  use UMLS::Interface;
  use UMLS::Similarity::vector;

  my $vectormatrix = "samples/vectormatrix";
  my $vectorindex  = "samples/vectorindex";

  my $umls = UMLS::Interface->new(); 
  die "Unable to create UMLS::Interface object.\n" if(!$umls);

  $vectoroptions{"vectormatrix"} = $vectormatrix;
  $vectoroptions{"vectorindex"} = $vectorindex;

  my $vector = UMLS::Similarity::vector->new($umls, \%vectoroptions);
  die "Unable to create measure object.\n" if(!$vector);

  my $cui1 = "C0005767";
  my $cui2 = "C0007634";

  @ts1 = $umls->getTermList($cui1);
  my $term1 = pop @ts1;

  @ts2 = $umls->getTermList($cui2);
  my $term2 = pop @ts2;

  my $value = $vector->getRelatedness($cui1, $cui2);

  print "The similarity between $cui1 ($term1) and $cui2 ($term2) is $value\n";

DESCRIPTION

This module computes the semantic relatedness of two concepts in the UMLS according to a method described by Patwardhan & Pedersen (2006). "Using WordNet Based Context Vectors to Estimate the Semantic Relatedness of Concepts" (Patwardhan and Pedersen) - Appears in the Proceedings of the EACL 2006 Workshop Making Sense of Sense - Bringing Computational Linguistics and Psycholinguistics Together, pp. 1-8, April 4, 2006, Trento, Italy. http://www.d.umn.edu/~tpederse/Pubs/eacl2006-vector.pdf

--indexfile and --matrixfile option. The co-occurrence matrix and index file used in the vector method are prepared by vector-input.pl method. Index file assigns each term of the bigrams a number and also records the vector position and length which starts the term of the co-occrrence matrix. For example, for the following bigrams list which are generated by the text "This is the first line Of a LONG file.":

        9
        LONG<>file<>1 1 1
        Of<>a<>1 1 1
        This<>is<>1 1 1
        a<>LONG<>1 1 1
        file<>.<>1 1 1
        first<>line<>1 1 1
        is<>the<>1 1 1
        line<>Of<>1 1 1
        the<>first<>1 1 1

The index file for the terms show up in the above will be:

        . 1 0
        LONG 2 0 8
        Of 3 8 8
        This 4 16 8
        a 5 24 8
        file 6 32 8
        first 7 40 8
        is 8 48 9
        line 9 57 8
        the 10 65 9

The co-occurrence matrix file will be:

        2: 6 1
        3: 5 1
        4: 8 1
        5: 2 1
        6: 1 1
        7: 9 1
        8: 10 1
        9: 3 1
        10: 7 1

Each index file assigns the term a number and also record the vector start position and length of the vector of the co-occurrence matrix. For example, the first line of the matrix file "2: 6 1" means for the term '2' which is 'LONG', it has a bigram pair with term '6' which is 'file', and the frequency is 1. In the index file, for the term 'LONG', it use '2' to represent 'LONG' and it starts at the '0' position of the file(byte) and the vector has lenghth '8'. The vector-input.pl requires the bigrams are sorted, and you could use count2huge.pl method of Text-NSP to convert the output of count.pl to huge-count.pl.

--defraw option is a flag for the vector measure. The definitions used are 'cleaned'. If the --defraw flag is set they will not be cleaned, and it will leave the definitions in their "raw" form.

--dictfile option is a dictionary file for the vector measure. It contains the 'definitions' of a concept which would be used rather than the definitions from the UMLS.

--stoplist option is a word list file for the vector measure. The words in the file should be removed from the definition. In the stop list file, each word is in the regular expression format. A stop word sample file is under the samples folder which is called toplist-nsp.regex.

--stem option is a flag for the vector measure. If we the --stem flag is set, the words of the definition are stemmed by the the Porter Stemming algorithm.

USAGE

The semantic relatedness modules in this distribution are built as classes that expose the following methods: new() getRelatedness()

TYPICAL USAGE EXAMPLES

To create an object of the vector measure, we would have the following lines of code in the perl program.

   use UMLS::Similarity::vector;
   $measure = UMLS::Similarity::vector->new($interface);

The reference of the initialized object is stored in the scalar variable '$measure'. '$interface' contains an interface object that should have been created earlier in the program (UMLS-Interface).

If the 'new' method is unable to create the object, '$measure' would be undefined.

To find the semantic relatedness of the concept 'blood' (C0005767) and the concept 'cell' (C0007634) using the measure, we would write the following piece of code:

   $relatedness = $measure->getRelatedness('C0005767', 'C0007634');

SEE ALSO

perl(1), UMLS::Interface

perl(1), UMLS::Similarity(3)

CONTACT US

  If you have any trouble installing and using UMLS-Similarity, 
  please contact us via the users mailing list :

      umls-similarity@yahoogroups.com

  You can join this group by going to:

      http://tech.groups.yahoo.com/group/umls-similarity/

  You may also contact us directly if you prefer :

      Bridget T. McInnes: bthomson at cs.umn.edu 

      Ted Pedersen : tpederse at d.umn.edu

AUTHORS

  Bridget T McInnes <bthomson at cs.umn.edu>
  Siddharth Patwardhan <sidd at cs.utah.edu>
  Serguei Pakhomov <pakh0002 at umn.edu>
  Ted Pedersen <tpederse at d.umn.edu>
  Ying Liu <liux0935 at umn.edu> 

COPYRIGHT AND LICENSE

Copyright 2004-2010 by Bridget T McInnes, Siddharth Patwardhan, Serguei Pakhomov, Ying Liu and Ted Pedersen

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.