6153b5f46390b1112c333647102ca0c715e0a062,finetune/util/metrics.py,,micro_f1,#Any#Any#Any#,148
Before Change
FN += len(counts["false_negatives"])
TP += len(counts["correct"])
FP += len(counts["false_positives"])
recall = TP/float(FN + TP)
precision = TP / float(FP + TP)
try:
f1 = 2 * (recall * precision) / (recall + precision)
except ZeroDivisionError:
return 0.0
return f1
def sequence_labeling_token_precision(true, predicted):
Token level precision
After Change
FN += len(counts["false_negatives"])
TP += len(counts["correct"])
FP += len(counts["false_positives"])
recall = calc_recall(TP, FN)
precision = calc_precision(TP, FP)
return calc_f1(recall, precision)
def per_class_f1(true, predicted, span_type="token"):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 8
Instances
Project Name: IndicoDataSolutions/finetune
Commit Name: 6153b5f46390b1112c333647102ca0c715e0a062
Time: 2020-04-14
Author: jerry.genser@indico.io
File Name: finetune/util/metrics.py
Class Name:
Method Name: micro_f1
Project Name: williamFalcon/pytorch-lightning
Commit Name: c8f605e47dcefe192f3a9b477f3e56b437615e34
Time: 2021-01-18
Author: tadej.svetina@gmail.com
File Name: pytorch_lightning/metrics/classification/precision_recall.py
Class Name: Precision
Method Name: compute
Project Name: williamFalcon/pytorch-lightning
Commit Name: c8f605e47dcefe192f3a9b477f3e56b437615e34
Time: 2021-01-18
Author: tadej.svetina@gmail.com
File Name: pytorch_lightning/metrics/classification/precision_recall.py
Class Name: Recall
Method Name: compute