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

Tesseract fails to recognize % sign in Hungarian language texts #40

Open
Googulator opened this issue Sep 18, 2019 · 8 comments
Open

Tesseract fails to recognize % sign in Hungarian language texts #40

Googulator opened this issue Sep 18, 2019 · 8 comments
Labels

Comments

@Googulator
Copy link

When the language is set to "hun" (Hungarian), Tesseract is unable to recognize the % sign. This sign is very commonly used in Hungarian to represent percentages, the same way as in English. Tesseract instead sees various letters and digits - most commonly "96", sometimes "9", "69", "0", "S", "Z", or even nothing at all.

Even if I feed a generated image containing a % sign in large black type on a pure white background, I still can't get Tesseract to output the % sign, as long as the language is set to Hungarian.

Both the "fast" and "best" models suffer from this problem.

If I instead set the language to English, % sings are recognized without issue.

@stweil
Copy link
Contributor

stweil commented Sep 18, 2019

See hun.unicharset which shows all known characters.

The percent sign was not part of the training data set, so Tesseract simply does not know that character with hun.

This can only be solved by new training, either from scratch or by fine tuning the existing incomplete model (which can add new characters).

An alternative would be using the script/Latin model which supports all western European languages which are based on Latin script.

@Googulator
Copy link
Author

A model "which supports all western Europe languages" is not an option for Hungarian, because of ő and ű, which are not found in any Western European language.

@Shreeshrii
Copy link
Contributor

Have you tried with -l hun+eng?

@stweil
Copy link
Contributor

stweil commented Sep 20, 2019

Latin.unicharset includes both characters, so I suggest to try it. I updated my previous comment.

@stweil stweil added the bug label Sep 20, 2019
@Shreeshrii
Copy link
Contributor

@stweil the more relevant unicharset will be the lstm-unicharset extracted from the script/Latin traineddata file. Latin.unicharset maybe a superset.

@stweil
Copy link
Contributor

stweil commented Sep 23, 2019

You are right, it is not identical, but that one also includes both characters.

@Googulator
Copy link
Author

How do I test Latin.unicharset? Do I need to train a new model?

@stweil
Copy link
Contributor

stweil commented Oct 24, 2019

Just get Latin.traineddata and extract Latin.unicharset using combine_tessdata. Then load Latin.unicharset in your editor and check whether it contains all relevant characters.

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

3 participants