NAME
WordNet::Similarity::Visual::SimilarityInterface
SYNOPSIS
Basic Usage Example
use WordNet::Similarity::Visual::SimilarityInterface;
my $similarity = WordNet::Similarity::Visual::SimilarityInterface->new;
$similarity->initialize;
my ($result,$errors,$traces) = $similarity->compute_similarity($word1,$word2,$measure_index);
DESCRIPTION
This package provides an interface to WordNet::Similarity. It also converts the trace string to the meta-language.
Methods
The following methods are defined in this package:
Public methods
- $obj->new
-
The constructor for WordNet::Similarity::Visual::SimilarityInterface objects.
Return value: the new blessed object
- $obj->initialize
-
To initialize WordNet::Similarity.
Return Value: None
- $obj->compute_similarity
-
Computes the similarity and relatedness scores for two words.
Parameter: Two Words and the Measure Index "hso","lch","lesk","lin","jcn","path","random","res","vector_pairs","wup" The measure index can have any of the following values - 0 for "all measures"
- 1 for "Hirst & St-Onge" - 2 for "Leacock and Chodorow" - 3 for "Adapted Lesk" - 4 for "Lin" - 5 for "Jiang & Conrath" - 6 for "Path Length" - 7 for "Random" - 8 for "Resnik" - 9 for "Vector Pair" - 10 for "Wu and Palmer"
Returns: Reference to Hashes containining
- semantic relatedness/similarity values for all the word senses combination and measures, - errorStrings for the word senses and measure which did not return a similarity value - TraceString for all the measures that had trace output on
- $obj->convert_to_meta
-
Converts the Trace String to Meta-language.
Parameter: The two Word senses, Trace String and the Measure name
Returns: A String, the equivalent metalanguage for the trace string.
Discussion
This module provides an interface to the various WordNet::Similarity measures. It implements functions that take as argument two words then find the similarity scores scores for all the senses of these words. This module also implements the funtion that takes as input a tracestring and converts it to the meta-language.
Meta-language
The first line in the meta language is the measure name. The next two line list all the possible shortest paths between the two concepts. The synsets represent the nodes along these paths, thile the relation names between these synsets represent the edges. If there is more than one shortest path they are also listed. The alternate shortest paths are seperated using the OR operator. The rest of the lines list all the other paths in the hypernym tree. These alternate hypernym trees also use the same system as used in the shortest path. The next line is the maximum depth of the hypertree
path
cat#n#1 is-a feline#n#1 is-a carnivore#n#1
dog#n#1 is-a canine#n#2 is-a carnivore#n#1
carnivore#n#1 is-a placental#n#1 is-a mammal#n#1 is-a vertebrate#n#1 is-a
chordate#n#1 is-a animal#n#1 is-a organism#n#1 is-a living_thing#n#1 is-a
object#n#1 is-a entity#n#1 is-a Root#n#1
Max Depth = 13
Path length = 5
SEE ALSO
WordNet::Similarity WordNet::QueryData
Mailing List: <wn-similarity@yahoogroups.com>
AUTHOR
Saiyam Kohli, University of Minnesota, Duluth kohli003@d.umn.edu
Ted Pedersen, University of Minnesota, Duluth tpederse@d.umn.edu
COPYRIGHT
Copyright (c) 2005-2006, Saiyam Kohli and Ted Pedersen
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to
The Free Software Foundation, Inc.,
59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Note: a copy of the GNU General Public License is available on the web at <http://www.gnu.org/licenses/gpl.txt> and is included in this distribution as GPL.txt.