Giter Site home page Giter Site logo

snknitin / optical-character-recognition-from-images-using-crf Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 6.0 556 KB

Exploring an approach that bridges computer vision and natural language processing by jointly modeling the labels of sequences of noisy character images that form complete words. This is a natural problem for chain-structured CRFs

Jupyter Notebook 100.00%
optical-character-recognition crf noisy-character-images feature-vector character-image

optical-character-recognition-from-images-using-crf's Issues

Differences of function node_potentials and feature_potentials

I have read your code in OCR-CRF.ipynb. It's cool to implement yourself in Python. But I have some confusions.

It seems that the function "node_potentials" calculates the potential following the equation correctly. But why you use the function "feature_potentials" later instead of node_potentials for calculating psi, belief, grad, etc. But "feature_potentials" neglects the label yi ?

Could you give me some advice or explanations about that ? Thanks.

What is the meaning of the size of the "belief" array?

Thank you for providing your code.
I am new to CRF and I did not quite understand what does the size of variable "belief" mean. In your function "beliefs(word,feature_params,transition_params)", it is commented that the function returns a numpy array (which is "belief") of size (w-1) x k x k. For example, if the testing work has 4 characters, then the "belief" array is 31010. However, I am not clear what is the physical meaning of an element in the array. For example, does belief[0][2][4] means the probability of the 0th character is labelled "4" and its following character is labelled "2"?
Thank you in advance~

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.