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
Commits
3ebdd14f
Commit
3ebdd14f
authored
1 year ago
by
Manon Blanco
Browse files
Options
Downloads
Patches
Plain Diff
Improve results display
parent
9ada05d2
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dan/ocr/evaluate.py
+1
-3
1 addition, 3 deletions
dan/ocr/evaluate.py
tests/data/evaluate/metrics_table.md
+8
-3
8 additions, 3 deletions
tests/data/evaluate/metrics_table.md
tests/test_evaluate.py
+1
-1
1 addition, 1 deletion
tests/test_evaluate.py
with
10 additions
and
7 deletions
dan/ocr/evaluate.py
+
1
−
3
View file @
3ebdd14f
...
...
@@ -110,8 +110,6 @@ def eval(rank, config: dict, nerval_threshold: float, mlflow_logging: bool):
if
"
ner
"
not
in
metric_names
:
return
print
()
def
inferences_to_parsed_bio
(
attr
:
str
):
bio_values
=
[]
for
inference
in
inferences
:
...
...
@@ -133,7 +131,7 @@ def eval(rank, config: dict, nerval_threshold: float, mlflow_logging: bool):
continue
scores
=
evaluate
(
ground_truths
,
predictions
,
nerval_threshold
)
print
(
set_name
)
print
(
f
"
\n
####
{
set_name
}
\n
"
)
print_results
(
scores
)
...
...
This diff is collapsed.
Click to expand it.
tests/data/evaluate/metrics_table.md
+
8
−
3
View file @
3ebdd14f
...
...
@@ -4,7 +4,8 @@
| val | 8.82 | 11.54 | 50.0 | 50.0 | 50.0 | 0.0 |
| test | 2.78 | 3.33 | 14.29 | 14.29 | 14.29 | 0.0 |
train
#### train
| tag | predicted | matched | Precision | Recall | F1 | Support |
|:---------:|:---------:|:-------:|:---------:|:------:|:-----:|:-------:|
| Surname | 2 | 2 | 1.0 | 1.0 | 1.0 | 2 |
...
...
@@ -16,7 +17,9 @@ train
| Chalumeau | 1 | 1 | 1.0 | 1.0 | 1.0 | 1 |
| Batiment | 2 | 2 | 1.0 | 1.0 | 1.0 | 2 |
| All | 15 | 12 | 0.8 | 0.857 | 0.828 | 14 |
val
#### val
| tag | predicted | matched | Precision | Recall | F1 | Support |
|:---------:|:---------:|:-------:|:---------:|:------:|:----:|:-------:|
| Surname | 1 | 0 | 0.0 | 0.0 | 0 | 1 |
...
...
@@ -28,7 +31,9 @@ val
| Chalumeau | 1 | 1 | 1.0 | 1.0 | 1.0 | 1 |
| Batiment | 1 | 1 | 1.0 | 1.0 | 1.0 | 1 |
| All | 8 | 6 | 0.75 | 0.75 | 0.75 | 8 |
test
#### test
| tag | predicted | matched | Precision | Recall | F1 | Support |
|:---------:|:---------:|:-------:|:---------:|:------:|:-----:|:-------:|
| Surname | 1 | 1 | 1.0 | 1.0 | 1.0 | 1 |
...
...
This diff is collapsed.
Click to expand it.
tests/test_evaluate.py
+
1
−
1
View file @
3ebdd14f
...
...
@@ -129,7 +129,7 @@ def test_evaluate(capsys, training_res, val_res, test_res, evaluate_config):
# Check the metrics Markdown table
captured_std
=
capsys
.
readouterr
()
last_printed_lines
=
captured_std
.
out
.
split
(
"
\n
"
)[
-
4
1
:]
last_printed_lines
=
captured_std
.
out
.
split
(
"
\n
"
)[
-
4
6
:]
assert
(
"
\n
"
.
join
(
last_printed_lines
)
==
Path
(
FIXTURES
/
"
evaluate
"
/
"
metrics_table.md
"
).
read_text
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment