feat: add summary (No.7) consensus and grounded generation trials
요약 성능지표(No.7, ROUGE 65점) 실험 일습을 커밋한다. - app/engine/summary_consensus.py: 후보 5개 생성 후 합의 선택(select_consensus). 문자/어절 2-gram 가중 합의로 고르며, 유효 후보가 없으면 valid=False 를 낸다. - app/engine/summary_grounded.py: 근거 추출 후 압축하는 2단계 생성. - summarizer.py: 추출 전략 3종(textrank/coverage/lead). coverage 는 MMR 로 중복 문장을 눌러 문서 전체를 넓게 담는다. 기본값은 textrank 로 유지한다. 스크립트는 생성·평가·검증을 분리했다. verify_* 는 API 호출 없이 저장된 산출물만 재계산하는 독립 검증기라 지표를 공용 함수로 합치지 않는다. 합치면 검증이 성립하지 않는다. tune_summarizer 는 사람 검수 참조(build_summary_annotation_packet -> export_summary_annotations)를 입력으로 받아 선택과 최종 보고를 분리한다. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
d980f34388
commit
8ae52b0a82
18 files changed
+1281
-3
No files matched your search
@@ -66,6 +66,18 @@ def test_emphasis_prioritizes_requested_topic():
|
||||
assert result.emphasis == ["김밥"]
|
||||
|
||||
|
||||
def test_coverage_strategy_preserves_source_order_and_respects_cap():
|
||||
result = extractive_summary(_DOC, ratio=0.5, max_sentences=3, strategy="coverage")
|
||||
assert result.selected_indices == sorted(result.selected_indices)
|
||||
assert result.num_sentences_out == 3
|
||||
|
||||
|
||||
def test_unknown_extractive_strategy_is_rejected():
|
||||
import pytest
|
||||
with pytest.raises(ValueError):
|
||||
extractive_summary(_DOC, strategy="oracle")
|
||||
|
||||
|
||||
def test_empty_and_short():
|
||||
assert extractive_summary("").final == ""
|
||||
one = extractive_summary("한 문장만 있다.")
|
||||
|
||||
Reference in new issue
Block a user