1
我需要找出两个输入词之间的语义相似性/相关性。下面的话是相似的或现实世界相关: -两个“词”之间的语义相似性/相关性的Java API
- genuineness, genuine, genuinely, valid, reality, fact, really
- painter, painting, paint
以下是我的代码剪断,我从here
ILexicalDatabase db = new NictWordNet();
RelatednessCalculator lin = new Lin(db);
RelatednessCalculator wup = new WuPalmer(db);
RelatednessCalculator path = new Path(db);
String w1 = "truth";
String w2 = "genuine";
System.out.println(lin.calcRelatednessOfWords(w1, w2));
System.out.println(wup.calcRelatednessOfWords(w1, w2));
System.out.println(path.calcRelatednessOfWords(w1, w2));
了我使用WS4J API(ws4j1.0.1.jar)与Java 1.7在Eclipse 3.4中。我得到以下结果是没有意义的,或者可能是我的看法是错误的。
如果我的做法是错误的,请让我知道如果我要工作了词与词之间的相似性,那么我应该使用什么其他的API。
@ jaykio77:如果它对你有帮助,你能接受这个答案吗? - 我目前正在挖掘一些额外的声望点。非常感谢。 – errantlinguist 2016-04-13 18:06:54