Similarities in Wordnet in Java: JAWS, JWNL, or Java WN :: similarities?

I need to use Wordnet in a Java application. I want:

  • search synsets

  • find similarities / connections between synsets

My application uses RDF graphics, and I know there are SPARQL endpoints with Wordnet, but I think it's better to have a local copy of the dataset, since it is not too big.

I found the following jars:

What do you recommend for my application?

Is it possible to use the Perl library from a Java application through some bindings?

Thanks! Mulone

+7
source share
3 answers

I use JAWS for regular wordnet materials because it is easy to use. However, for indicators of similarity, I use the library located here . You will also need to download this folder containing pre-processed WordNet and corpus data for it to work. You can use the code like this if you put this folder in another folder called "lib" in the project folder:

JWS ws = new JWS("./lib", "3.0"); Resnik res = ws.getResnik(); TreeMap<String, Double> scores1 = res.res(word1, word2, partOfSpeech); for(Entry<String, Double> e: scores1.entrySet()) System.out.println(e.getKey() + "\t" + e.getValue()); System.out.println("\nhighest score\t=\t" + res.max(word1, word2, partOfSpeech) + "\n\n\n"); 

This will print something like the following, showing an assessment of the similarity between each possible combination of synsets, represented by words that need to be compared:

 hobby#n#1,gardening#n#1 2.6043996588901104 hobby#n#2,gardening#n#1 -0.0 hobby#n#3,gardening#n#1 -0.0 highest score = 2.6043996588901104 

There are also methods that allow you to specify the meaning of both / both words: res(String word1, int senseNum1, String word2, partOfSpeech) , etc. Unfortunately, the source documentation is not a JavaDoc, so you will need to manually check it. The source can be downloaded here .

Available Algorithms:

 JWSRandom(ws.getDictionary(), true, 16.0);//random number for baseline Resnik res = ws.getResnik(); LeacockAndChodorowlch = ws.getLeacockAndChodorow(); AdaptedLesk adLesk = ws.getAdaptedLesk(); AdaptedLeskTanimoto alt = ws.getAdaptedLeskTanimoto(); AdaptedLeskTanimotoNoHyponyms altnh = ws.getAdaptedLeskTanimotoNoHyponyms(); HirstAndStOnge hso = ws.getHirstAndStOnge(); JiangAndConrath jcn = ws.getJiangAndConrath(); Lin lin = ws.getLin(); WuAndPalmer wup = ws.getWuAndPalmer(); 

In addition, this requires the jar file for the MIT JWI

+12
source

JAWS has a function for finding similar wordForms. Here are the details:

public AdjectiveSynset [] getSimilar () throws a WordNetException and here is a link you can check: http://lyle.smu.edu/~tspell/jaws/doc/edu/smu/tspell/wordnet/AdjectiveSynset.html this link contains details which you can use.

+1
source

I'm not sure whether JAWS or JWNL provide methods for calculating the similarities between the syntaxes, but I tried to search for synsets as well as for JAWS. In particular, simple:

  // Specifying the Database Directory System.setProperty("wordnet.database.dir", "C:/WordNet/2.1/dict/"); 

It was easier for me to understand than the JWNL file_properties.xml requirement.

0
source

All Articles