예제 #1
0
파일: wsp.py 프로젝트: harrhunt/WSP
 def wsp_similarity(cls, start: WSP, end: WSP):
     total_vector = np.zeros(shape=(300, ), dtype=np.float32)
     for word in start.onyms:
         if Word2Vec.contains(word):
             total_vector = np.add(Word2Vec.vector(word), total_vector)
     Word2Vec.add_vector(start.name, total_vector)
     return Word2Vec.similarity(start.name, end.word)
예제 #2
0
파일: wsp.py 프로젝트: harrhunt/WSP
 def distance(cls, start: str, end: str):
     return Word2Vec.similarity(start, end)