Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
DAN
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Automatic Text Recognition
DAN
Merge requests
!467
Fix case with empty GT
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Fix case with empty GT
fix-metric-computation
into
main
Overview
3
Commits
3
Pipelines
0
Changes
1
All threads resolved!
Hide all comments
Merged
Solene Tarride
requested to merge
fix-metric-computation
into
main
5 months ago
Overview
3
Commits
3
Pipelines
0
Changes
1
All threads resolved!
Hide all comments
Expand
Closes
#309 (closed)
0
0
Merge request reports
Viewing commit
d4c2a754
Prev
Next
Show latest version
1 file
+
2
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
d4c2a754
Fix case with empty GT
· d4c2a754
Solene Tarride
authored
5 months ago
dan/ocr/manager/metrics.py
+
2
−
0
Options
@@ -206,6 +206,8 @@ class MetricManager:
metrics
[
"
nb_
"
+
keyword
+
suffix
]
=
list
(
map
(
len
,
split_gt
))
metrics
[
keyword
+
"
_error_rate
"
+
suffix
]
=
[
round
(
float
(
edit_dist
/
gt_len
),
4
)
if
gt_len
!=
0
else
float
(
edit_dist
==
0
)
for
edit_dist
,
gt_len
in
zip
(
metrics
[
"
edit_
"
+
keyword
+
suffix
],
metrics
[
"
nb_
"
+
keyword
+
suffix
],
)
]
case
"
loss
"
|
"
loss_ce
"
:
metrics
[
metric_name
]
=
[
values
[
metric_name
],
Loading