From 96d140615794ee421525226527799a410261e1f2 Mon Sep 17 00:00:00 2001 From: Canming Huang Date: Tue, 15 Jun 2021 18:40:05 -0400 Subject: [PATCH 1/2] Fix a bug when upgrading phraser from gensim 3.x to 4.0 --- gensim/models/phrases.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gensim/models/phrases.py b/gensim/models/phrases.py index d07b75adc6..c95682fa5e 100644 --- a/gensim/models/phrases.py +++ b/gensim/models/phrases.py @@ -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: From 7fad316a492dffc4e1e63aecbbe716deb5ae05d7 Mon Sep 17 00:00:00 2001 From: Michael Penkov Date: Wed, 16 Jun 2021 09:11:07 +0900 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 143f669e96..423ce2b389 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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