Machine Learning, AI, NLP, Programming, Deep Dives.
precision_score, f1_score def compute_metrics(pred): labels = pred.label_ids preds = pred.predictions.argmax(-1) decoded_labels = label_encoder.inverse_transform(labels) decoded_preds = label_encoder.inverse_transform(preds) precision = precision_score(decoded_labels, decoded_preds,