Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed FastTextKeyedVectors handling in add_vector #3389

Merged
merged 1 commit into from
Dec 12, 2022

Conversation

globba
Copy link
Contributor

@globba globba commented Sep 29, 2022

Fixes issue #3388

Since Gensim 4.0,'key' in FastTextKeyedVectors always returns True by design.
This resulted in vectors not being added when performing FastTextKeyedVectors.add_vectors() due to the way that in_vocab_mask was being created.
The proper way to check if a key already exists is with 'key' in FastTextKeyedVectors.key_to_index.

Since Gensim 4.0, 'key' in FastTextKeyedVectors always returns True by design.
The proper way to check if a key already exists is with 'key' in FastTextKeyedVectors.key_to_index.
@piskvorky piskvorky added this to the Next release milestone Sep 29, 2022
@mpenkov mpenkov added the bug Issue described a bug label Oct 16, 2022
@mpenkov mpenkov requested a review from gojomo October 16, 2022 03:59
@piskvorky
Copy link
Owner

@gojomo please review so we can merge.

@mpenkov
Copy link
Collaborator

mpenkov commented Dec 6, 2022

@gojomo Ping

@mpenkov mpenkov changed the title Fixed issue when using add_vector with FastTextKeyedVectors Fixed FastTextKeyedVectors handling in add_vector Dec 7, 2022
@gojomo
Copy link
Collaborator

gojomo commented Dec 9, 2022

Looks good to me!

@mpenkov
Copy link
Collaborator

mpenkov commented Dec 12, 2022

Thank you @globba !!

@mpenkov mpenkov merged commit 50a9e6b into piskvorky:develop Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue described a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants