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

Implemented computation of probability matrix #279

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

Conversation

BingqingQu
Copy link

This is intended to be an extension of the --probabilities.
Instead of just printing the probabilities for the recognised characters, --probmat will compute the complete probability matrix.

At each "timestep" the probability for each character is computed.
This can/could be used as input to a language model for example where one would have access to the probabilities of other characters as well.

@zuphilip
Copy link
Collaborator

Is your code complete? It looks that the variables out and timestamp are not used further...

Can you give more information about the output format? I see that the files have always 156 lines with several probalities, but none of these values seem to be equal the ones which are outputed with --probabilities.

@amitdo
Copy link
Contributor

amitdo commented Dec 16, 2017

https://github.com/tmbdev/ocropy/wiki/OCRopus-File-Formats#lattice-files
This format was used in ocropy 0.6.

@zuphilip
Copy link
Collaborator

@amitdo The outputed files look differently. Here is an example:

010001.pm.txt
010001.prob.txt

@amitdo
Copy link
Contributor

amitdo commented Dec 16, 2017

His patch just outputs the raw result of the prediction.

What you see with the current (without this parch) text/prob. options is the 'best' path that translate_back() found for you.

The format in my link is more human readable.
I was not very clear in my previous comment, sorry about that.

@amitdo
Copy link
Contributor

amitdo commented Dec 16, 2017

Related: #25

@amitdo
Copy link
Contributor

amitdo commented Dec 16, 2017

The number of lines (156) is the size of the codec (chars) in the model you use.

@zuphilip
Copy link
Collaborator

Okay, I don't think that this matrix is then enough interesting for an option to ocropus-rpred. One can use ocrolib as a library for such computations. More advanced lattice/alternative calculations could be interesting as outlined in #186.

@zuphilip
Copy link
Collaborator

There is also the --save and --show option for a visual debug info about these matrix.

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

Successfully merging this pull request may close these issues.

None yet

3 participants