Skip to content

Commit d41a307

Browse files
committed
Changed the distance function to actually return the distance between two words rather than their similarity (1 - distance).
1 parent f685ed6 commit d41a307

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

glove/glove.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def _distance(self, word1_vec, word2_vec):
232232
/ np.linalg.norm(word1_vec)
233233
/ np.linalg.norm(word2_vec))
234234

235-
return dst
235+
return 1 - dst
236236

237237
def distance(self, word1, word2):
238238
"""

0 commit comments

Comments
 (0)