Skip to content

Instantly share code, notes, and snippets.

@piercelamb
Created December 20, 2022 17:56
Show Gist options
  • Save piercelamb/8531abd0dea5bf232045727fb050d272 to your computer and use it in GitHub Desktop.
Save piercelamb/8531abd0dea5bf232045727fb050d272 to your computer and use it in GitHub Desktop.
init_model_stats
def init_model_stats(id2label):
return {
label: {
'total': 0,
'true_positives': 0,
'false_positives': 0,
'false_negatives': 0,
'accuracy': 0.0,
'f1': 0.0
}
for label_id, label in id2label.items()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment