-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_nli_eval.py
More file actions
35 lines (30 loc) · 897 Bytes
/
run_nli_eval.py
File metadata and controls
35 lines (30 loc) · 897 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from src.eval.flow import run_nli_inference
import argparse
import pandas as pd
import datetime
results = []
nli_dataset = {
"name": "climate-fever",
"data_dir": "./dataset/climate-fever/fever_test.csv",
"premise_column": "claim",
"hypothesis_column": "evidence",
"label_column": "evidence_label",
"label_encode_dict": {
"NOT_ENOUGH_INFO": None,
"SUPPORTS": 0,
"REFUTES": 1,
}
}
result = run_nli_inference(
nli_dataset['data_dir'],
nli_dataset['premise_column'],
nli_dataset['hypothesis_column'],
nli_dataset['label_column'],
nli_dataset['label_encode_dict'],
)
results.append(result)
df_result = pd.DataFrame(results)
df_result.to_csv(f"./logs/experiment_logs_nli_{datetime.datetime.now().strftime('%Y-%m-%d %H.%M')}.csv")
# term 1 : plan b random (reversed 0 and 1)
# term 2 : plan b no random
# term 3 : plan c random