Skip to content
Open
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion flair/models/multitask_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,10 @@ def evaluate( # type: ignore[override]
# Add metrics so they will be available to _publish_eval_result.
for avg_type in ("micro avg", "macro avg"):
for metric_type in ("f1-score", "precision", "recall"):
scores[(task_id, avg_type, metric_type)] = result.classification_report[avg_type][metric_type]
if result.classification_report.get(avg_type) and result.classification_report[avg_type].get(
metric_type
):
scores[(task_id, avg_type, metric_type)] = result.classification_report[avg_type][metric_type]

scores["loss"] = loss.item() / len(batch_split)

Expand Down