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 KeyError regarding deeppavlov/vocabs/typos #1698

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Water-Ty
Copy link

This is a fix to issue #1697.
In Issue #1697, this person talks about a KeyError when trying to use the configs.spelling_correction.brillmoore_wikitypos_en model, raising a KeyError when trying to get rid of the keys ⟬ and ⟭, which does not exist. I have tested, and the error wasn't raised (The model was downloaded and libraries were installed). I loaded the model normally, and output was clean and normal.


from deeppavlov import configs, build_model

model = build_model(configs.spelling_correction.brillmoore_wikitypos_en,)
output = model(["Where is navada"])
print(output)

OUTPUT:
['where is nevada']

@kuraga
Copy link

kuraga commented Jan 3, 2025

- alphabet = {c for w in words for c in w}
- if '⟬' in alphabet:
-     alphabet.remove('⟬')
- if '⟭' in alphabet:
-     alphabet.remove('⟭')
+ alphabet = {c for w in words for c in w if c not in ('(', ')')}

?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants