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