Ted Pedersen > WordNet-SenseRelate-AllWords > wsd-experiments.pl

Download:
WordNet-SenseRelate-AllWords-0.19.tar.gz

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Source  

NAME ^

wsd-experiments.pl - driver for running wsd experiments

SYNOPSIS ^

wsd-experiments.pl {--type=MEASURE | --sense1 | --random} --basename=outputfile {--semcor DIR | --file FILE [FILE ...]} [--config=FILE] [--window=INT] [stoplist=FILE] [--contextScore NUM] [--pairScore NUM] [--forcepos][--nocompoundify][--usemono][--score][--backoff] | {--help | --version}

EXAMPLE ^

wsd-experiments.pl --type='WordNet::Similarity::lesk' --basename='test-output' --file=br-a01 --window=2

DESCRIPTION ^

This script is used for running wsd experiments with different parameters. Given the similarity measure and the input file/directory, the key file is created by calling semcor-reformat.pl. The key file is then sorted on columns using scorer2-sort.pl

SemCor sense tagged files are reformatted for use by wsd.pl using semcor-reformat.pl Then wsd.pl is called to disambiguate the text. The disambiguated text is reformatted using scorer2-format.pl. The answer file is created by sorting this text on columns.

Finally, the answer file is scored against the key file using allwords-scorer2.pl script which is modeled after the scorer2 C program (http://www.senseval.org/senseval3/scoring).

Note that allwords-scorer2.pl doesn't need the key and answer files to be sorted. However, the scorer2 C program needs the input to be sorted. So the files are sorted in case you want to use scorer2 C program to compare the results.

OPTIONS ^

N.B., the = sign between the option name and the option parameter is optional.

--type=MEAURE

The relatedness measure to be used. The default is WordNet::Similarity::lesk.

--sense1

WordNet sense 1 disambiguation guesses that the correct sense for each word is the first sense in WordNet because the senses of words in WordNet are ranked according to frequency. The first sense is more likely than the second, the second is more likely than the third, etc.

wsd-experiments.pl --sense1 --basename='test-output' --file=br-a01

If you are using this option, don't use --type option or --random option.

--random

Random selects one of the possible senses of the target word randomly.

wsd-experiments.pl --random --basename='test-output' --file=br-a01

If you are using this option, don't use --type option or --sense1 option.

--basename=outputfile

The basename for the output files. wsd-experiments.pl creats a number of output files, the key file, the answer file, the result file etc.

For example for the following command,

wsd-experiments.pl --type='WordNet::Similarity::lesk' --basename='test-output' --file=br-a01

since the basename is test-output, it will create test-output.key, test-output.out and test-output.tr where test-output.key is the key file, test-output.out is the answer file and test-output.tr is the trace file.

The final output is also displayed on standard output.

--semcor=semcor-dir

The location of the SemCor directory. This directory will contain several sub-directories, including 'brown1' and 'brown2'. Do not specify these sub-directories. Only specify the directory name that contains them. For example, if /home/user/semcor3.0 contains the brown1 and brown2 directories, you would only specify /home/user/semcor3.0 as the value of this option. Do not use this option at the same time as the --file option.

wsd-experiments.pl --type='WordNet::Similarity::lesk' --basename='test-output' --semcor=/home/user/semcor3.0

--file=FILE

One or more semcor-formatted files to process. This can be used instead of the previous option to only specify a few Semcor files or to specify Senseval files. When this option is used, multiple files can be specified on the command line. For example

wsd-experiments.pl --type='WordNet::Similarity::lesk' --basename='test-output' --file br-a01 br-a02 br-k18 br-m02 br-r05

Do not attempt to use this option when using the previous option.

--config=FILE

The name of a configuration file for the specified relatedness measure.

--stoplist=FILE

A file containing regular expressions (as understood by Perl), surrounded by by slashes (e.g. /\d+/ removes any word containing a digit [0-9]). Any word in the text to be disambiguated that matches one of the regular expressions in the file is removed. Each regular expression must be on its own line, and any trailing whitespace is ignored.

Care must be taken when crafting a stoplist. For example, it is tempting to use /a/ to remove the word 'a', but that expression would result in all words containing the lowercase letter a to be removed. A better alternative would be /\ba\b/.

--window=INTEGER

Defines the size of the window of context. The default is 4. A window size of N means that there will be a total of N words in the context window, including the target word. If N is a (positive) even number, then there will be one more word on the left side of the target word than on the right.

For example, if the window size is 4, then there will be two words on the left side of the target word and one on the right. If the window is 5, then there will be two words on each side of the target word.

The minimum window size is 2. A smaller window would mean that there were no context words in the window.

--contextScore=REAL

If no sense of the target word achieves this minimum score, then no winner will be projected (e.g., it is assumed that there is no best sense or that none of the senses are sufficiently related to the surrounding context). The default is zero.

--pairScore=REAL

The minimum pairwise score between a sense of the target word and the best sense of a context word that will be used in computing the overall score for that sense of the target word. Setting this to be greater than zero (but not too large) will reduce noise. The default is zero.

--forcepos

Turn part of speech coercion on. POS coercion attempts to force other words in the context window to be of the same part of speech as the target word. If the text is POS tagged, the POS tags will be ignored. POS coercion may be useful when using a measure of semantic similarity that only works with noun-noun and verb-verb pairs.

--nocompoundify

Disable compoundifying. By default compoundifying is enabled. Using this option will disable it.

--usemono

If this flag is on the only available sense is assignsed to the monosemy words. By default this flag is off.

--backoff

Use the most frequent sense if the measure can't assign sense because no relatedness is found with the surrounding words. This happens for path based measures and Info content based measures.

--score

Score only specific instances. Valid options are

--score poly score only polysemes instances --score s1nc score only the instances where the most frequent sense is not correct --score n score only the instances having n number of sense

AUTHORS ^

 Jason Michelizz

 Varada Kolhatkar, University of Minnesota, Duluth
 kolha002 at d.umn.edu

 Ted Pedersen, University of Minnesota, Duluth
 tpederse at d.umn.edu

This document last modified by : $Id: wsd-experiments.pl,v 1.17 2009/05/19 21:59:24 kvarada Exp $

SEE ALSO ^

 L<semcor-reformat.pl> L<scorer2-format.pl> L<scorer2-sort.pl> 

COPYRIGHT AND LICENSE ^

Copyright (c) 2009, Varada Kolhatkar, Ted Pedersen, Jason Michelizzi

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.

Note: a copy of the GNU Free Documentation License is available on the web at http://www.gnu.org/copyleft/fdl.html and is included in this distribution as FDL.txt.

syntax highlighting: