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

Error regarding configs.spelling_correction.brillmoore_wikitypos_en #1697

Open
Water-Ty opened this issue Dec 25, 2024 · 0 comments
Open

Error regarding configs.spelling_correction.brillmoore_wikitypos_en #1697

Water-Ty opened this issue Dec 25, 2024 · 0 comments
Labels

Comments

@Water-Ty
Copy link

Water-Ty commented Dec 25, 2024

DeepPavlov version:
VERSION: 1.7.0
Python version:
PYTHON VERSION: 3.9
Operating system (ubuntu linux, windows, ...):
OPERATING SYSTEM: MAC OS
Issue:
When loading the model configs.spelling_correction.brillmoore_wikitypos_en, a KeyError appears.

Content or a name of a configuration file:
I believe the issue is in DeepPavLov/deeppavlov/vocabs/typos.py

Command that led to error:
RUNNING THE FILE (python main.py AND python3 main.py)

Error (including full traceback):

2024-12-25 16:14:36.275 ERROR in 'deeppavlov.core.common.params'['params'] at line 108: Exception in <class 'deeppavlov.vocabs.typos.Wiki100KDictionary'>
Traceback (most recent call last):
  File "_______.venv/lib/python3.9/site-packages/deeppavlov/core/common/params.py", line 102, in from_params
    component = obj(**dict(config_params, **kwargs))
  File ________.venv/lib/python3.9/site-packages/deeppavlov/vocabs/typos.py", line 146, in __init__
    super().__init__(data_dir, *args, **kwargs)
  File "_____________.venv/lib/python3.9/site-packages/deeppavlov/vocabs/typos.py", line 65, in __init__
    alphabet.remove('⟬')
KeyError: '⟬'
Traceback (most recent call last):
  File "________________/main.py", line 3, in <module>
    model = build_model(configs.spelling_correction.brillmoore_wikitypos_en,)
  File "____________.venv/lib/python3.9/site-packages/deeppavlov/core/commands/infer.py", line 55, in build_model
    component = from_params(component_config, mode=mode)
  File "______________.venv/lib/python3.9/site-packages/deeppavlov/core/common/params.py", line 96, in from_params
    config_params = {k: _init_param(v, mode) for k, v in config_params.items()}
  File "_________________ProjectHelix/.venv/lib/python3.9/site-packages/deeppavlov/core/common/params.py", line 96, in <dictcomp>
    config_params = {k: _init_param(v, mode) for k, v in config_params.items()}
  File "_________________u.venv/lib/python3.9/site-packages/deeppavlov/core/common/params.py", line 52, in _init_param
    param = from_params(param, mode=mode)
  File "/_____________/.venv/lib/python3.9/site-packages/deeppavlov/core/common/params.py", line 102, in from_params
    component = obj(**dict(config_params, **kwargs))
  File "______________/.venv/lib/python3.9/site-packages/deeppavlov/vocabs/typos.py", line 146, in __init__
    super().__init__(data_dir, *args, **kwargs)
  File "/________________________________lib/python3.9/site-packages/deeppavlov/vocabs/typos.py", line 65, in __init__
    alphabet.remove('⟬')
KeyError: '⟬'

When loading the model configs.spelling_correction.brillmoore_wikitypos_en, a KeyError occurs in the DeepPavlov library due to an attempt to remove a character '⟬' from the alphabet. This happens during the initialization of the Wiki100KDictionary component in the file deeppavlov/vocabs/typos.py. This can be easily solved with an if-else statement.

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

No branches or pull requests

1 participant