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

Add test case for allowed_chars option, better error handling for alphabet-model mismatch #126

Merged
merged 5 commits into from
Oct 3, 2024

Conversation

robertknight
Copy link
Owner

Add a test case for the allowed_chars option that was added in #119. In the process it was necessary to:

  • Refactor the existing recognition test to make adding new cases easier
  • Make recognition tests set a custom alphabet that matches the fake recognition model
  • Improve the error handling when the custom alphabet does not match the recognition model

The recognition test uses a fake model with only 64 columns in the output.
Modify the alphabet accordingly.
…el output

If a custom alphabet is specified with a size that does not match the model
output shape, make recognition fail with an error that is easy to understand.
This situation means that the wrong alphabet has been used, which means that the
recognition outputs might either be completely wrong or have "?" chars
substituted for out-of-bounds character indices.
The inputs don't have to be one-hot vectors.
@robertknight robertknight merged commit 02564f4 into main Oct 3, 2024
2 checks passed
@robertknight robertknight deleted the allowed-chars-test branch October 3, 2024 07:19
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.

1 participant