wip: phase_z2 evidence 파이프라인 + matching 실험(phase2~26) + 프론트 trace 패널 진행분 스냅샷
- src: phase_z2 composition/mapper/pipeline/placement_planner/retry, ai_fallback(prompts/schema/validate), mdx_text_atoms 신규 - Front: PipelineTracePanel 신규, FramePanel/SlideCanvas/Home/designAgentApi 등 갱신 + 테스트 4종 추가 - templates/phase_z2: catalog(component_expansion_registry, node_slot_mapping 신규), frames, families, slide_base 갱신 - tests/matching: phase2~26 매칭 실험 스크립트·리포트·온톨로지 전체 (미커밋 진행분) - tests: b4_v4 evidence, task5~28.5 시리즈, regression(imp95 baseline) 등 신규 테스트 대량 추가 - docs/reference: MDX 구조 인벤토리, MDX→Frame 구조 계약 문서 - scripts: mdx 계약/parity/coverage/viewport 체크, gitea comment, run sync 유틸 - .gitignore: tmp*.json, chromedriver, .orchestrator, *.pkl, Front_test* 등 임시/스냅샷 제외 미완성 작업의 보존용 스냅샷 커밋 (2026-07-02) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
"""Phase 4 — 1순위만 하나의 표로 (세로: 방법 15, 가로: 유닛 5)"""
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
HERE = Path(__file__).parent
|
||||
|
||||
TARGET_UNITS = [
|
||||
("6", "MDX01-2-details", "팝업+표"),
|
||||
("7", "MDX02-1", "중목차"),
|
||||
("12", "MDX02-2.2-table", "표"),
|
||||
("13", "MDX03-1", "중목차"),
|
||||
("14", "MDX03-2", "중목차(컨테이너)"),
|
||||
]
|
||||
|
||||
METHODS = [
|
||||
"SBERT-원본", "SBERT-축약", "SBERT-청크",
|
||||
"KoSimCSE-원본", "KoSimCSE-축약", "KoSimCSE-청크",
|
||||
"E5-원본", "E5-축약", "E5-청크",
|
||||
"Cross-원본", "Cross-축약", "Cross-청크",
|
||||
"WordAvg-원본", "WordAvg-축약", "WordAvg-청크",
|
||||
]
|
||||
|
||||
md = (HERE / "MATRIX_PHASE4.md").read_text(encoding="utf-8")
|
||||
parts = re.split(r"\n## (\d+)\. ", md)
|
||||
unit_blocks = {parts[i]: parts[i + 1] for i in range(1, len(parts), 2)}
|
||||
|
||||
|
||||
def extract_top1(block_text, method_name):
|
||||
"""1순위 셀 반환. 행 구조: | 방법 | 1순위 | 2순위 | 3순위 |
|
||||
' | '로 쪼개면 cells[0]='| 방법', cells[1]=1순위, cells[2]=2순위 …"""
|
||||
for line in block_text.split("\n"):
|
||||
if line.startswith(f"| {method_name} |"):
|
||||
cells = line.split(" | ")
|
||||
if len(cells) >= 2:
|
||||
return cells[1].strip()
|
||||
return "-"
|
||||
|
||||
|
||||
# 단일 표 구성: 세로=방법, 가로=유닛
|
||||
lines = []
|
||||
lines.append("# Phase 4 — 1순위 통합표 (세로: 방법 15개, 가로: 유닛 5개)")
|
||||
lines.append("")
|
||||
|
||||
# 헤더: 방법 | 유닛1 | 유닛2 | ... | 유닛5
|
||||
header_cells = ["방법"]
|
||||
for num, uid, kind in TARGET_UNITS:
|
||||
header_cells.append(f"{num}. {uid}<br>({kind})")
|
||||
lines.append("| " + " | ".join(header_cells) + " |")
|
||||
lines.append("|" + "|".join(["------"] * len(header_cells)) + "|")
|
||||
|
||||
# 행: 방법별로 5개 유닛의 1순위
|
||||
for m in METHODS:
|
||||
row = [m]
|
||||
for num, _, _ in TARGET_UNITS:
|
||||
block = unit_blocks.get(num, "")
|
||||
top1 = extract_top1(block, m) if block else "-"
|
||||
row.append(top1)
|
||||
lines.append("| " + " | ".join(row) + " |")
|
||||
|
||||
lines.append("")
|
||||
|
||||
out = HERE / "MATRIX_PHASE4_1순위.md"
|
||||
out.write_text("\n".join(lines), encoding="utf-8")
|
||||
print(f"완료: {out}")
|
||||
Reference in New Issue
Block a user