Undirected Graphical Model for the optical character word recognition task