③⑩ 단독측정 정본 반영 + 테스트데이터 지표별 명명 + ⑩ 실행기 경로 정리
③⑩ 을 09-10 단독측정으로 교체 (지표별 독립 실행기 negotiation.py, gpt-4o 1종 300건)
③ 5.877 → 5.784% · ⑩ 98.23 → 98.36% (253세션 1,086매칭)
①의 협상 기록 재집계 방식은 aggregate.py 보조 경로로 유지
run-eval.sh ⑩ 경로를 ③ 과 같은 단독측정으로 교체 (M10_REAGG=1 이면 옛 재집계)
eval/10_persona/aggregate.py
- --out 추가 — 시험 실행이 정본 result.json·detail.jsonl 을 덮지 않게
- 세션 대응 키를 기록의 session_id 우선으로 (EVAL-case_id 하드코딩 시
EVAL10-* 기록이 ①의 옛 로그와 잘못 짝지어져 오답을 냈다. ① 기록은 폴백 동작 동일)
testdata 명명 규칙 <지표번호>_data_<이름>, 둘 이상이 쓰면 00_ (공용)
testset_300 → 00_data_testset_300 · product_names → 00_data_product_names
2_total_data → 02_data_total · 7_testset_10272 → 07_data_testset_10272
8_items1000_master → 08_data_items1000_master
생성기·룰(.py)은 번호 없음. 끝난 측정의 기록에는 옛 이름이 남아 있어
testdata/README.md 에 옛↔새 대응표를 둔다
eval/SUMMARY.md 를 정본 수치와 일치시킴
③ 100건 파일럿 실행원본은 저장소 밖 _archive_20260910_실행원본/ 으로 이동
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
cb839e22f9
commit
50016ebd06
41 files changed
+4008
-100
No files matched your search
@@ -1,11 +1,14 @@
|
||||
#!/usr/bin/env python3
|
||||
"""③ 평균 가격 협상률 — ① 측정 로그에서 독립 집계.
|
||||
|
||||
협상률 = (기존 공급가 − 최종 합의가) / 기존 공급가. 협상완료(합의) 건만 평균. 목표 3%.
|
||||
협상률 = (기존 공급가 − 최종 합의가) / 기존 공급가 × 100.
|
||||
협상완료(합의) 건의 **단순 평균**(건별 비율의 평균). 목표 3%.
|
||||
①의 detail_*.jsonl에 건별 reduction_pct가 남아 있어 LLM 재실행 없이 산출한다.
|
||||
|
||||
사용: python aggregate.py --source <① 실행 원본 폴더> (원본은 저장소 밖 NEGO_DOCS/_archive_20260909_실행원본/01_win_rate/ 에 보관)
|
||||
출력: data/reduction_all.csv 건별 원자료 (모델·기존공급가·합의가·협상률)
|
||||
python aggregate.py --source <폴더> --out /tmp/x 정본을 건드리지 않고 그 폴더에 산출
|
||||
출력: (기본 이 스크립트 폴더 — --out 으로 옮길 수 있다)
|
||||
data/reduction_all.csv 건별 원자료 (모델·기존공급가·합의가·협상률)
|
||||
data/reduction_all_meta.json 출처·산식·모델별·분포
|
||||
result.json 건수 + 평균 협상률 + PASS/FAIL
|
||||
"""
|
||||
@@ -18,13 +21,15 @@ from pathlib import Path
|
||||
|
||||
HERE = Path(__file__).parent
|
||||
DEFAULT_SOURCE = HERE.parent / "01_win_rate" / "본측정300_azure_20260901" # 저장소 밖으로 보관 이동 — --source 로 지정한다
|
||||
FORMULA = "협상완료 합의 건의 (기존 공급가 − 최종 합의가) / 기존 공급가 평균"
|
||||
FORMULA = "건별 가격 협상률 = (기존 공급가 − 최종 합의가) ÷ 기존 공급가 × 100, 협상완료 건의 단순 평균"
|
||||
|
||||
|
||||
def main():
|
||||
ap = argparse.ArgumentParser(description=__doc__.split("\n", 1)[0])
|
||||
ap.add_argument("--source", type=Path, default=DEFAULT_SOURCE)
|
||||
ap.add_argument("--target", type=float, default=3.0)
|
||||
ap.add_argument("--out", type=Path, default=HERE,
|
||||
help="산출 위치 (기본: 이 스크립트 폴더 = 정본). 시험 실행은 다른 경로를 준다")
|
||||
args = ap.parse_args()
|
||||
|
||||
files = sorted(args.source.glob("detail_*.jsonl"))
|
||||
@@ -39,7 +44,8 @@ def main():
|
||||
reds = [c["reduction_pct"] for _, c in agreed]
|
||||
avg = round(sum(reds) / len(reds), 3)
|
||||
|
||||
out = HERE / "data"
|
||||
args.out.mkdir(parents=True, exist_ok=True)
|
||||
out = args.out / "data"
|
||||
out.mkdir(exist_ok=True)
|
||||
with open(out / "reduction_all.csv", "w", encoding="utf-8-sig", newline="") as f:
|
||||
w = csv.writer(f)
|
||||
@@ -70,7 +76,7 @@ def main():
|
||||
"verdict": "PASS" if avg >= args.target else "FAIL",
|
||||
"상세": "data/reduction_all_meta.json",
|
||||
}
|
||||
(HERE / "result.json").write_text(
|
||||
(args.out / "result.json").write_text(
|
||||
json.dumps(result, ensure_ascii=False, indent=1), encoding="utf-8")
|
||||
print(json.dumps(result, ensure_ascii=False, indent=1))
|
||||
|
||||
|
||||
Reference in new issue
Block a user