githubharald / CTCDecoder

Connectionist Temporal Classification (CTC) decoding algorithms: best path, beam search, lexicon search, prefix search, and token passing. Implemented in Python.
https://towardsdatascience.com/3797e43a86c
MIT License
817 stars 182 forks source link

Best path decoding (negative values of logits) #17

Closed sanakhamekhem closed 4 years ago

sanakhamekhem commented 4 years ago

Hello Sir, I have tested the code below. It is quite interresting. However, the best path search using my own data performs like this example: TARGET : "Le trois Janvier mil neuf cent soixante dix," BEST PATH : "|Je|Je|trois|fanmier|mil|neuf|cont|soitante|dex|.||Je|trois|fanmier|mil|neuf|cont|soitante|dex|.||"

I will be gratefull if you can help me to solve this problem. The logits are generated using a linear layer (tf.layers.dense) Values in logits matrix are like:

4.287187 -32.6091 -12.860022 -18.233511 -12.024508 -32.516006 -31.813993 -12.016912 -11.002839
7.621706 -39.008682 -17.869062 -20.652061 -18.614656 -38.91413 -39.586323 -17.21066 -14.14866
11.9552145 -41.16309 -21.07399 -20.94039 -23.124344 -41.045444 -39.15103 -22.799099 -15.869296
sanakhamekhem commented 4 years ago

I have solved the problem.