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
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.
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~