Skip to content

Commit

Permalink
add glue results in side
Browse files Browse the repository at this point in the history
  • Loading branch information
t-jingweiyi committed Aug 30, 2023
1 parent 25affbb commit eedbdc8
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/side/glue_results.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import argparse
import os
import re
import numpy as np
import json
import jsonlines
import random
import evaluate
from pathlib import Path
from datasets import load_dataset
from collections import defaultdict

Expand Down Expand Up @@ -227,11 +230,18 @@ def rte_get_pred(pred):
)

eval_metric = metric.compute()
for key in list(metric.keys()):
for key in list(eval_metric.keys()):
eval_metric[f"{key}_{task_name}"] = eval_metric[key]
del eval_metric[key]

eval_metrics.update(eval_metric)

average = []
for key in ["matthews_correlation_cola", "accuracy_sst2", "f1_mrpc", "spearmanr_stsb", "f1_qqp", "accuracy_mnli", "accuracy_qnli", "accuracy_wnli"]:
average.append(eval_metrics[key])

average = np.mean(average)
eval_metrics["average"] = average

print(len(labels), eval_metrics)

Expand Down

0 comments on commit eedbdc8

Please sign in to comment.