diff --git a/dan/ocr/evaluate.py b/dan/ocr/evaluate.py index e101832a23d5b05adef35f7a64591b41eca5e639..f8f1fc743803967384f217b2c8f7f35e48525ca0 100644 --- a/dan/ocr/evaluate.py +++ b/dan/ocr/evaluate.py @@ -97,7 +97,7 @@ def print_worst_predictions(all_inferences: Dict[str, List[Inference]]): inference.prediction, ) alignment_str = f'{alignment["query_aligned"]}\n{alignment["matched_aligned"]}\n{alignment["target_aligned"]}' - table.add_row([inference.image, inference.wer, alignment_str]) + table.add_row([inference.image, round(inference.wer * 100, 2), alignment_str]) print(f"\n#### {NB_WORST_PREDICTIONS} worst prediction(s)\n") print(table) diff --git a/tests/data/evaluate/metrics_table.md b/tests/data/evaluate/metrics_table.md index 8e56233112829dc40590ad1e99235491831e099b..27bf53ad329cbd0441b030695b322728ce62b3f0 100644 --- a/tests/data/evaluate/metrics_table.md +++ b/tests/data/evaluate/metrics_table.md @@ -50,17 +50,17 @@ #### 5 worst prediction(s) -| Image name | WER | Alignment between ground truth - prediction | -|:----------------------------------------:|:------:|:---------------------------------------------------------:| -| 2c242f5c-e979-43c4-b6f2-a6d4815b651d.png | 0.5 | ⓈA â’»Charles â’·11 â“P â’¸C â“€F â“„A â“…14331 | -| | | |.||||||||||||||||||||||||.||||.|| | -| | | Ⓢd â’»Charles â’·11 â“P â’¸C â“€F â“„d â“…14 31 | -| 0dfe8bcd-ed0b-453e-bf19-cc697012296e.png | 0.2667 | ⓈTemplié â’»Marcelle â’·93 â“J â“€ch â“„E dachyle------- | -| | | ||||||||||||||||||||||||.|||||||||||.||.------- | -| | | ⓈTemplié â’»Marcelle â’·93 â“S â“€ch â“„E dactylo â“…18376 | -| ffdec445-7f14-4f5f-be44-68d0844d0df1.png | 0.1429 | ⓈNaudin â’»Marie â’·53 â“S â’¸V â“€Belle mère | -| | | |||||||||||||||||||||||.|||||||||||| | -| | | ⓈNaudin â’»Marie â’·53 â“S â’¸v â“€Belle mère | -| 0a56e8b3-95cd-4fa5-a17b-5b0ff9e6ea84.png | 0.125 | ⓈBellisson â’»Georges â’·91 â“P â’¸M â“€Ch â“„Plombier â“…-------12241 | -| | | |||||||||||||||||||||||||||||||||||||||||||||-------||||| | -| | | ⓈBellisson â’»Georges â’·91 â“P â’¸M â“€Ch â“„Plombier â“…Patron?12241 | +| Image name | WER | Alignment between ground truth - prediction | +|:----------------------------------------:|:-----:|:---------------------------------------------------------:| +| 2c242f5c-e979-43c4-b6f2-a6d4815b651d.png | 50.0 | ⓈA â’»Charles â’·11 â“P â’¸C â“€F â“„A â“…14331 | +| | | |.||||||||||||||||||||||||.||||.|| | +| | | Ⓢd â’»Charles â’·11 â“P â’¸C â“€F â“„d â“…14 31 | +| 0dfe8bcd-ed0b-453e-bf19-cc697012296e.png | 26.67 | ⓈTemplié â’»Marcelle â’·93 â“J â“€ch â“„E dachyle------- | +| | | ||||||||||||||||||||||||.|||||||||||.||.------- | +| | | ⓈTemplié â’»Marcelle â’·93 â“S â“€ch â“„E dactylo â“…18376 | +| ffdec445-7f14-4f5f-be44-68d0844d0df1.png | 14.29 | ⓈNaudin â’»Marie â’·53 â“S â’¸V â“€Belle mère | +| | | |||||||||||||||||||||||.|||||||||||| | +| | | ⓈNaudin â’»Marie â’·53 â“S â’¸v â“€Belle mère | +| 0a56e8b3-95cd-4fa5-a17b-5b0ff9e6ea84.png | 12.5 | ⓈBellisson â’»Georges â’·91 â“P â’¸M â“€Ch â“„Plombier â“…-------12241 | +| | | |||||||||||||||||||||||||||||||||||||||||||||-------||||| | +| | | ⓈBellisson â’»Georges â’·91 â“P â’¸M â“€Ch â“„Plombier â“…Patron?12241 |