Skip to content

Commit

Permalink
Merge pull request #3 from bio-ontology-research-group/reality-patch-3-1
Browse files Browse the repository at this point in the history
fix inconsistent tabs and spaces
  • Loading branch information
leechuck authored Apr 30, 2018
2 parents c22c398 + c90d89f commit 62c78c9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions runWord2Vec.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ def __init__(self, dirname):
self.dirname = dirname

def __iter__(self):
for line in open('AllAxioms.lst'):
yield line.split()
for line in open('AllAxioms.lst'):
yield line.split()

sentences =gensim.models.word2vec.LineSentence('AllAxioms.lst') # a memory-friendly iterator
ssmodel =gensim.models.Word2Vec(sentences,min_count=0, size=200, window=10, sg=1, negative=4, iter=5)
Expand All @@ -16,9 +16,9 @@ def __iter__(self):
word_vectors=ssmodel.wv
file= open ('VecResults.lst', 'w')
with open('AllClasses.lst') as f:
for line in f:
GO_class=line.rstrip()
if GO_class in word_vectors.vocab:
GOvectors[GO_class]=ssmodel[GO_class];
file.write (str(GO_class) + ' '+ str(GOvectors[GO_class]) +'\n')
for line in f:
GO_class=line.rstrip()
if GO_class in word_vectors.vocab:
GOvectors[GO_class]=ssmodel[GO_class];
file.write (str(GO_class) + ' '+ str(GOvectors[GO_class]) +'\n')
file.close()

0 comments on commit 62c78c9

Please sign in to comment.