-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevaluate_final_results.py
43 lines (30 loc) · 1.03 KB
/
evaluate_final_results.py
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
36
37
38
39
40
41
42
43
import os, sys
import argparse
from random import randint
from util.util_funcs import load_jsonl, store_jsonl
DIR_PATH = os.path.abspath(os.getcwd())
FEVEROUS_PATH = DIR_PATH + "/FEVEROUS/evaluation"
sys.path.insert(0, FEVEROUS_PATH)
from feverous_scorer import feverous_score, check_predicted_evidence_format
def main():
parser = argparse.ArgumentParser(description="Trains the veracity prediction model")
parser.add_argument(
"--input_path",
default=None,
type=str,
help="Path to the csv file containing the evaluation examples",
)
args = parser.parse_args()
if not args.input_path:
raise RuntimeError("Invalid in file path")
if ".jsonl" not in args.input_path:
raise RuntimeError(
"The train csv path should include the name of the .csv file"
)
data = load_jsonl(args.input_path)
for instance in data:
check_predicted_evidence_format(instance)
score = feverous_score(data)
print(score)
if __name__ == "__main__":
main()