我在這裏使用的工具進行語義相似,語義相似的結果解釋
我得到下面的結果,但不能正確interprete他們:
apple#n#1,banana#n#1 0.04809463683080774
apple#n#1,banana#n#2 0.13293629283742603
apple#n#2,banana#n#1 0.0
apple#n#2,banana#n#2 0.0
這裏是代碼:
URL url = new URL ("file" , null , "dictionary/3.0/dict");
IDictionary dict = new Dictionary (url) ;
dict.open() ;
// look up first sense of the word " dog "
IIndexWord idxWord = dict . getIndexWord ("dog" , POS.NOUN) ;
IWordID wordID = idxWord . getWordIDs() . get (0) ; // 1 st meaning
List <IWordID> wordIDs = idxWord.getWordIDs();
JWS ws= new JWS ("dictionary", "3.0");
TreeMap <String,Double> scores1 = ws.getJiangAndConrath().jcn("apple", "banana", "n");
for (String s:scores1.keySet())
System.out.println(s+"\t"+scores1.get(s));