Skip to content

Commit

Permalink
Updated w2v.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdchoi77 committed Apr 11, 2016
1 parent db348c0 commit f0afdcc
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/distributional_semantics/w2v.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,10 @@ def getSimilarities(wv, v1):
vocab = readVocab(open(VOCAB_FILE))
wv = readWordVectors(open(W2V_FILE), vocab)

'''
print 'king:'
l = getSimilarities(wv, wv['king'])
for (v, w) in l[:K]: print ' ', w, v

print 'king - male + female:'
l = getSimilarities(wv, wv['king'] - wv['male'] + wv['female'])
for (v, w) in l[:K]: print ' ', w, v
'''

l = []

for (w1,v1) in wv.items():
for (w2,v2) in wv.items():
if w1 != w2: l.append((getCosineSimilarity(v1,v2), w1, w2))

0 comments on commit f0afdcc

Please sign in to comment.