Closed mkuehn94 closed 3 years ago
you can try "constrained decoding". You will have to implement it yourself, TF does not provide this. The idea is the following: use beam search, which creates a list of text candidates at each iteration step. Limit the allowed text candidates (i.e. all texts with length 10 and all their prefixes), so that beam search is only allowed to follow beams which contain text the way you want it.
You can have a look at word beam search(code + paper), which is a slightly different use-case but which you could use as a starting point for further experiments.
Is it possible to set some constraints to the output of the decoder, for example if I know that all words are excactly 10 characters long. I know this is not an issue with the code but any help would be greatly appreciated, I was looking inside the tensorflow api and ctc paper without any luck