-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbertscore_eval_main.py
More file actions
50 lines (38 loc) · 1.69 KB
/
bertscore_eval_main.py
File metadata and controls
50 lines (38 loc) · 1.69 KB
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
44
45
46
47
48
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import sys
import os
# 프로젝트 루트를 Python 경로에 추가
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from pipelines.bertscore_eval_pipeline import BERTScoreEvalPipeline
def main():
parser = argparse.ArgumentParser(description="BERTScore 평가 실행")
parser.add_argument("--qa_ids", nargs="+", help="평가할 QA ID 목록 (예: 1 2 3)")
parser.add_argument("--all", action="store_true", help="모든 QA 파일 평가")
args = parser.parse_args()
# BERTScore 평가 pipeline 초기화
pipeline = BERTScoreEvalPipeline()
try:
if args.all:
# 모든 QA 파일 평가
print("모든 QA 파일에 대해 BERTScore 평가를 시작합니다...")
results = pipeline.run_evaluation()
elif args.qa_ids:
# 특정 QA ID들만 평가
print(f"QA ID {args.qa_ids}에 대해 BERTScore 평가를 시작합니다...")
results = pipeline.run_evaluation(args.qa_ids)
else:
# 기본적으로 모든 QA 파일 평가
print("모든 QA 파일에 대해 BERTScore 평가를 시작합니다...")
results = pipeline.run_evaluation()
if results:
print(f"\n평가 완료! 총 {len(results)}개의 QA 파일이 평가되었습니다.")
print("결과는 data/qa/eval/ 디렉토리에 저장되었습니다.")
else:
print("평가할 QA 파일을 찾을 수 없습니다.")
except Exception as e:
print(f"평가 실행 중 오류 발생: {e}")
sys.exit(1)
if __name__ == "__main__":
main()