def compute_metrics(self, pred):
    labels = pred.label_ids
    preds = pred.predictions.argmax((- 1))
    (precision, recall, f1, _) = precision_recall_fscore_support(labels, preds, average='weighted')
    full_report = classification_report(labels, preds, output_dict=True)
    acc = accuracy_score(labels, preds)
    return {'accuracy': acc, 'f1': f1, 'precision': precision, 'recall': recall, 'full_report': full_report}
def compute_metrics(self, pred):
    labels = pred.label_ids
    preds = pred.predictions.argmax((- 1))
    (precision, recall, f1, _) = precision_recall_fscore_support(labels, preds, average='weighted')
    full_report = classification_report(labels, preds, output_dict=True)
    acc = accuracy_score(labels, preds)
    return {'accuracy': acc, 'f1': f1, 'precision': precision, 'recall': recall, 'full_report': full_report}