Skip to content

Commit

Permalink
Fix a bug when upgrading phraser from gensim 3.x to 4.0 (#3174)
Browse files Browse the repository at this point in the history
* Fix a bug when upgrading phraser from gensim 3.x to 4.0

* Update CHANGELOG.md

Co-authored-by: Michael Penkov <m@penkov.dev>
  • Loading branch information
emgucv and mpenkov authored Jun 16, 2021
1 parent 57b3af3 commit bdcd100
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Changes

* [#3116](https://github.com/RaRe-Technologies/gensim/pull/3116): Fix bug where saved Phrases model did not load its connector_words, by [@aloknayak29](https://github.com/aloknayak29)
* [#3136](https://github.com/RaRe-Technologies/gensim/pull/3136): fix indexing error in word2vec_inner.pyx, by [@bluekura](https://github.com/bluekura)
* [#3174](https://github.com/RaRe-Technologies/gensim/pull/3174): Fix a bug when upgrading phraser from gensim 3.x to 4.0, by [@emgucv](https://github.com/emgucv)

### :+1: Improvements

Expand Down
2 changes: 1 addition & 1 deletion gensim/models/phrases.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ def load(cls, *args, **kwargs):
}
elif isinstance(component, tuple): # 3.8 => 4.0: phrasegram keys are strings, not tuples with bytestrings
model.phrasegrams = {
str(model.delimiter.join(component), encoding='utf8'): score
str(model.delimiter.join(key), encoding='utf8'): val
for key, val in phrasegrams.items()
}
except StopIteration:
Expand Down

0 comments on commit bdcd100

Please sign in to comment.