Skip to content

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