public class WSD
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static boolean |
debug |
static int |
gap |
static int |
threshold |
Constructor and Description |
---|
WSD() |
Modifier and Type | Method and Description |
---|---|
static java.util.Map<java.lang.String,java.lang.Integer> |
collectSUMOFromFile(java.lang.String filename)
Extract SUMO terms from a file assuming one sentence per line
|
static void |
collectSUMOFromSICK()
Extract SUMO terms from the SICK data set
http://clic.cimec.unitn.it/composes/sick.html
|
static java.util.Map<java.lang.String,java.lang.Integer> |
collectSUMOFromString(java.lang.String lineStr)
Extract SUMO terms from a file assuming one sentence per line
|
static java.util.ArrayList<java.lang.String> |
collectSUMOFromWords(java.lang.String sentence)
Collect all the SUMO terms that are found in the sentence.
|
static java.util.ArrayList<java.lang.String> |
collectWordSenses(java.lang.String text)
Collect all the synsets that represent the best guess at
meanings for all the words in a text given a larger linguistic
context.
|
static java.lang.String |
findWordSenseInContext(java.lang.String word,
java.util.List<java.lang.String> words)
Return the best guess at the synset for the given word in the
context of the sentence.
|
static java.lang.String |
findWordSenseInContextWithPos(java.lang.String word,
java.util.List<java.lang.String> words,
int pos,
boolean lemma)
Return the best guess at the synset for the given word in the
context of the sentence with the given POS.
|
static java.util.TreeSet<AVPair> |
findWordSensePOS(java.lang.String word,
java.util.List<java.lang.String> words,
int POS)
Return a list of scored guesses at the synset for the given word in the
context of the sentence.
|
static java.lang.String |
getBestDefaultSense(java.lang.String word)
Get the POS-prefixed synset that represents the best guess at
meaning for a word.
|
static java.lang.String |
getBestDefaultSense(java.lang.String word,
int pos)
Get the POS-prefixed synset that represents the best guess at
meaning for a word with a given part of speech.
|
static java.lang.String |
getBestDefaultSUMO(java.lang.String word)
Get the SUMO term that represents the best guess at
meaning for a word.
|
static java.lang.String |
getBestDefaultSUMOsense(java.lang.String word,
int pos)
Get the SUMO term that represents the best guess at
meaning for a word.
|
static void |
interactive() |
static void |
main(java.lang.String[] args)
A main method, used only for testing.
|
static boolean |
polysemous(java.lang.String word) |
static boolean |
polysemous(java.lang.String word,
int pos) |
static java.util.ArrayList<java.util.ArrayList<java.lang.String>> |
readFileIntoArray(java.lang.String filename) |
static java.util.ArrayList<java.util.ArrayList<java.lang.String>> |
readSick()
Read the SICK data set
http://clic.cimec.unitn.it/composes/sick.html
|
static void |
testSentenceWSD()
A method used only for testing.
|
static void |
testSentenceWSD2()
A method used only for testing.
|
static void |
testWordWSD()
A method used only for testing.
|
public static int threshold
public static int gap
public static boolean debug
public static java.util.ArrayList<java.lang.String> collectSUMOFromWords(java.lang.String sentence)
public static boolean polysemous(java.lang.String word)
public static boolean polysemous(java.lang.String word, int pos)
public static java.util.ArrayList<java.lang.String> collectWordSenses(java.lang.String text)
public static java.lang.String findWordSenseInContext(java.lang.String word, java.util.List<java.lang.String> words)
public static java.lang.String findWordSenseInContextWithPos(java.lang.String word, java.util.List<java.lang.String> words, int pos, boolean lemma)
word
- - word to disambiguatewords
- - words in contextpos
- - part of speech of @wordpublic static java.util.TreeSet<AVPair> findWordSensePOS(java.lang.String word, java.util.List<java.lang.String> words, int POS)
public static java.lang.String getBestDefaultSUMOsense(java.lang.String word, int pos)
public static java.lang.String getBestDefaultSUMO(java.lang.String word)
public static java.lang.String getBestDefaultSense(java.lang.String word)
public static java.lang.String getBestDefaultSense(java.lang.String word, int pos)
public static java.util.ArrayList<java.util.ArrayList<java.lang.String>> readSick()
public static void collectSUMOFromSICK()
public static java.util.ArrayList<java.util.ArrayList<java.lang.String>> readFileIntoArray(java.lang.String filename)
public static java.util.Map<java.lang.String,java.lang.Integer> collectSUMOFromFile(java.lang.String filename)
public static java.util.Map<java.lang.String,java.lang.Integer> collectSUMOFromString(java.lang.String lineStr)
public static void testWordWSD()
public static void testSentenceWSD()
public static void testSentenceWSD2()
public static void interactive()
public static void main(java.lang.String[] args)