From 3fffd5180848813760783f540a74132922488194 Mon Sep 17 00:00:00 2001 From: mehrad Date: Thu, 21 Jul 2022 18:08:41 -0700 Subject: [PATCH] Scale sc_* metrics by 100 --- genienlp/metrics.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/genienlp/metrics.py b/genienlp/metrics.py index 14e580ee..18cc4348 100644 --- a/genienlp/metrics.py +++ b/genienlp/metrics.py @@ -95,7 +95,7 @@ def computeSequenceClassificationPrecision(outputs, targets, tasks): outputs = [label2id[output] for output in outputs] targets = [label2id[target] for target in targets] precision_metric = load_metric('precision') - return precision_metric.compute(references=targets, predictions=outputs)['precision'] + return precision_metric.compute(references=targets, predictions=outputs)['precision'] * 100 def computeSequenceClassificationRecall(outputs, targets, tasks): @@ -104,7 +104,7 @@ def computeSequenceClassificationRecall(outputs, targets, tasks): outputs = [label2id[output] for output in outputs] targets = [label2id[target] for target in targets] recall_metric = load_metric('recall') - return recall_metric.compute(references=targets, predictions=outputs)['recall'] + return recall_metric.compute(references=targets, predictions=outputs)['recall'] * 100 def computeSequenceClassificationF1(outputs, targets, tasks): @@ -113,7 +113,7 @@ def computeSequenceClassificationF1(outputs, targets, tasks): outputs = [label2id[output] for output in outputs] targets = [label2id[target] for target in targets] f1_metric = load_metric('f1') - return f1_metric.compute(references=targets, predictions=outputs)['f1'] + return f1_metric.compute(references=targets, predictions=outputs)['f1'] * 100 def computeF1(outputs, targets):