rsommerfeld / trocr

Powerful handwritten text recognition. A simple-to-use, unofficial implementation of the paper "TrOCR: Transformer-based Optical Character Recognition with Pre-trained Models".
MIT License
176 stars 27 forks source link

Beam Search #4

Closed jonas-da closed 1 year ago

jonas-da commented 2 years ago

Hi,

thanks for the great and simple repo! Is the generation of the predict a greedy or a beam Search approach? If you know how to implement an beam search generation, then I would be very happy if you could help me out!

Cheers, Jonas

rsommerfeld commented 2 years ago

Hi, I'm glad you enjoy using the repo! According to the original TrOCR paper, the Decoder already uses beam search to generate the output, see https://arxiv.org/pdf/2109.10282.pdf