Skip to content

Commit

Permalink
adapt metrics per class
Browse files Browse the repository at this point in the history
  • Loading branch information
hummus-love authored Apr 9, 2024
1 parent c362702 commit f7f110e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions moralization/transformers_model_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import frontmatter
from huggingface_hub import HfApi
import shutil
from sklearn.metrics import classification_report


IGNORED_LABEL = -100
Expand Down Expand Up @@ -319,9 +318,7 @@ 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
),
"per class": all_metrics,
}

def _set_id2label(self) -> None:
Expand Down

0 comments on commit f7f110e

Please sign in to comment.