Skip to content

Commit

Permalink
Merge pull request #149 from ssciwr/Lars
Browse files Browse the repository at this point in the history
Add classification report per class to compute_metrics
  • Loading branch information
hummus-love authored Apr 9, 2024
2 parents dc30dbc + 9ae052f commit c362702
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions moralization/transformers_model_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import frontmatter
from huggingface_hub import HfApi
import shutil
from sklearn.metrics import classification_report


IGNORED_LABEL = -100
Expand Down Expand Up @@ -318,6 +319,9 @@ def compute_metrics(self, eval_preds: tuple) -> Dict:
"recall": all_metrics["overall_recall"],
"f1": all_metrics["overall_f1"],
"accuracy": all_metrics["overall_accuracy"],
"classification report": classification_report(
y_true=true_labels, y_pred=true_predictions
),
}

def _set_id2label(self) -> None:
Expand Down

0 comments on commit c362702

Please sign in to comment.