Skip to content

Commit

Permalink
modify phrasegrams
Browse files Browse the repository at this point in the history
  • Loading branch information
jenishah committed Oct 3, 2018
1 parent b3d7ba6 commit 4a96eab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gensim/models/phrases.py
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ def __init__(self, phrases_model):
for bigram, score in phrases_model.export_phrases(corpus, self.delimiter, as_tuples=True):
if bigram in self.phrasegrams:
logger.info('Phraser repeat %s', bigram)
self.phrasegrams[bigram] = (phrases_model.vocab[self.delimiter.join(bigram)], score)
self.phrasegrams[bigram] = score
count += 1
if not count % 50000:
logger.info('Phraser added %i phrasegrams', count)
Expand Down Expand Up @@ -815,7 +815,7 @@ def score_item(self, worda, wordb, components, scorer):
"""
try:
return self.phrasegrams[tuple(components)][1]
return self.phrasegrams[tuple(components)]
except KeyError:
return -1

Expand Down

0 comments on commit 4a96eab

Please sign in to comment.