Skip to content
Snippets Groups Projects
Commit 3ebdd14f authored by Manon Blanco's avatar Manon Blanco
Browse files

Improve results display

parent 9ada05d2
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !339. Comments created here will be created in the context of that merge request.
...@@ -110,8 +110,6 @@ def eval(rank, config: dict, nerval_threshold: float, mlflow_logging: bool): ...@@ -110,8 +110,6 @@ def eval(rank, config: dict, nerval_threshold: float, mlflow_logging: bool):
if "ner" not in metric_names: if "ner" not in metric_names:
return return
print()
def inferences_to_parsed_bio(attr: str): def inferences_to_parsed_bio(attr: str):
bio_values = [] bio_values = []
for inference in inferences: for inference in inferences:
...@@ -133,7 +131,7 @@ def eval(rank, config: dict, nerval_threshold: float, mlflow_logging: bool): ...@@ -133,7 +131,7 @@ def eval(rank, config: dict, nerval_threshold: float, mlflow_logging: bool):
continue continue
scores = evaluate(ground_truths, predictions, nerval_threshold) scores = evaluate(ground_truths, predictions, nerval_threshold)
print(set_name) print(f"\n#### {set_name}\n")
print_results(scores) print_results(scores)
......
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
| val | 8.82 | 11.54 | 50.0 | 50.0 | 50.0 | 0.0 | | 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 | | test | 2.78 | 3.33 | 14.29 | 14.29 | 14.29 | 0.0 |
train #### train
| tag | predicted | matched | Precision | Recall | F1 | Support | | tag | predicted | matched | Precision | Recall | F1 | Support |
|:---------:|:---------:|:-------:|:---------:|:------:|:-----:|:-------:| |:---------:|:---------:|:-------:|:---------:|:------:|:-----:|:-------:|
| Surname | 2 | 2 | 1.0 | 1.0 | 1.0 | 2 | | Surname | 2 | 2 | 1.0 | 1.0 | 1.0 | 2 |
...@@ -16,7 +17,9 @@ train ...@@ -16,7 +17,9 @@ train
| Chalumeau | 1 | 1 | 1.0 | 1.0 | 1.0 | 1 | | Chalumeau | 1 | 1 | 1.0 | 1.0 | 1.0 | 1 |
| Batiment | 2 | 2 | 1.0 | 1.0 | 1.0 | 2 | | Batiment | 2 | 2 | 1.0 | 1.0 | 1.0 | 2 |
| All | 15 | 12 | 0.8 | 0.857 | 0.828 | 14 | | All | 15 | 12 | 0.8 | 0.857 | 0.828 | 14 |
val
#### val
| tag | predicted | matched | Precision | Recall | F1 | Support | | tag | predicted | matched | Precision | Recall | F1 | Support |
|:---------:|:---------:|:-------:|:---------:|:------:|:----:|:-------:| |:---------:|:---------:|:-------:|:---------:|:------:|:----:|:-------:|
| Surname | 1 | 0 | 0.0 | 0.0 | 0 | 1 | | Surname | 1 | 0 | 0.0 | 0.0 | 0 | 1 |
...@@ -28,7 +31,9 @@ val ...@@ -28,7 +31,9 @@ val
| Chalumeau | 1 | 1 | 1.0 | 1.0 | 1.0 | 1 | | Chalumeau | 1 | 1 | 1.0 | 1.0 | 1.0 | 1 |
| Batiment | 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 | | All | 8 | 6 | 0.75 | 0.75 | 0.75 | 8 |
test
#### test
| tag | predicted | matched | Precision | Recall | F1 | Support | | tag | predicted | matched | Precision | Recall | F1 | Support |
|:---------:|:---------:|:-------:|:---------:|:------:|:-----:|:-------:| |:---------:|:---------:|:-------:|:---------:|:------:|:-----:|:-------:|
| Surname | 1 | 1 | 1.0 | 1.0 | 1.0 | 1 | | Surname | 1 | 1 | 1.0 | 1.0 | 1.0 | 1 |
......
...@@ -129,7 +129,7 @@ def test_evaluate(capsys, training_res, val_res, test_res, evaluate_config): ...@@ -129,7 +129,7 @@ def test_evaluate(capsys, training_res, val_res, test_res, evaluate_config):
# Check the metrics Markdown table # Check the metrics Markdown table
captured_std = capsys.readouterr() captured_std = capsys.readouterr()
last_printed_lines = captured_std.out.split("\n")[-41:] last_printed_lines = captured_std.out.split("\n")[-46:]
assert ( assert (
"\n".join(last_printed_lines) "\n".join(last_printed_lines)
== Path(FIXTURES / "evaluate" / "metrics_table.md").read_text() == Path(FIXTURES / "evaluate" / "metrics_table.md").read_text()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment