Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 440cd5812b | |||
| 55dcfc1b3e | |||
| 4a8032665f | |||
| 6536c7fa9d | |||
| 2cd02453ec | |||
| 140e49342c |
@@ -86,7 +86,8 @@ COVERAGE_TARGET = float(os.environ.get("IR_COVERAGE_TARGET", "0.95"))
|
|||||||
ENSEMBLE_TEMPERATURES = [
|
ENSEMBLE_TEMPERATURES = [
|
||||||
float(os.environ.get("IR_ENSEMBLE_T1", "0.0")),
|
float(os.environ.get("IR_ENSEMBLE_T1", "0.0")),
|
||||||
float(os.environ.get("IR_ENSEMBLE_T2", "0.3")),
|
float(os.environ.get("IR_ENSEMBLE_T2", "0.3")),
|
||||||
float(os.environ.get("IR_ENSEMBLE_T3", "0.7")),
|
float(os.environ.get("IR_ENSEMBLE_T3", "0.5")),
|
||||||
|
float(os.environ.get("IR_ENSEMBLE_T4", "0.7")),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -186,6 +186,8 @@
|
|||||||
|
|
||||||
8. **开关关闭状态**:开关关闭时所有限制失效,这也必须作为一条规则输出(path: ["...", "开关关闭", "无限制"])。
|
8. **开关关闭状态**:开关关闭时所有限制失效,这也必须作为一条规则输出(path: ["...", "开关关闭", "无限制"])。
|
||||||
|
|
||||||
|
9. **功能完整性要求(重要)**:上下文包中的每个表格行、每条文字描述、每个逻辑树路径都必须被至少一条规则覆盖。仔细检查上下文包,确保不遗漏任何数据来源。如果上下文包中有表格,每条表格行至少生成一条对应规则。
|
||||||
|
|
||||||
{format_feedback}
|
{format_feedback}
|
||||||
|
|
||||||
## 输出格式
|
## 输出格式
|
||||||
|
|||||||
@@ -880,9 +880,9 @@ def run_ensemble_semantic_index(doc: dict) -> dict:
|
|||||||
if v:
|
if v:
|
||||||
print(f" {k}: {len(v)} 个问题")
|
print(f" {k}: {len(v)} 个问题")
|
||||||
|
|
||||||
# Feedback retry: re-run with coverage feedback (up to 2 retries, quality-gated)
|
# Feedback retry: re-run with coverage feedback (up to 3 retries, quality-gated)
|
||||||
retry_count = 0
|
retry_count = 0
|
||||||
while retry_count < 2:
|
while retry_count < 3:
|
||||||
feedback = _build_coverage_feedback(gaps)
|
feedback = _build_coverage_feedback(gaps)
|
||||||
if not feedback:
|
if not feedback:
|
||||||
break
|
break
|
||||||
@@ -906,13 +906,16 @@ def run_ensemble_semantic_index(doc: dict) -> dict:
|
|||||||
if src.get("section"):
|
if src.get("section"):
|
||||||
retry_sections.add(src["section"])
|
retry_sections.add(src["section"])
|
||||||
print(f" 重试新增 sections: {sorted(retry_sections)}", flush=True)
|
print(f" 重试新增 sections: {sorted(retry_sections)}", flush=True)
|
||||||
# Quality gate: only include retry if it improves coverage
|
# Quality gate: include retry if it adds new sections or doesn't regress coverage
|
||||||
trial_indices = semantic_indices + [retry_result]
|
trial_indices = semantic_indices + [retry_result]
|
||||||
trial_merged = ensemble_merge(trial_indices)
|
trial_merged = ensemble_merge(trial_indices)
|
||||||
trial_passed, trial_gaps = _quick_validate(trial_merged, doc, all_paths)
|
trial_passed, trial_gaps = _quick_validate(trial_merged, doc, all_paths)
|
||||||
trial_warnings = len(trial_gaps.get("coverage_warnings", []))
|
trial_warnings = len(trial_gaps.get("coverage_warnings", []))
|
||||||
trial_missing = len(trial_gaps.get("missing_table_rows", []))
|
trial_missing = len(trial_gaps.get("missing_table_rows", []))
|
||||||
if trial_warnings < pre_warnings or trial_missing < pre_missing_rows:
|
improved = trial_warnings < pre_warnings or trial_missing < pre_missing_rows
|
||||||
|
no_regression = trial_warnings <= pre_warnings and trial_missing <= pre_missing_rows
|
||||||
|
has_new_sections = len(retry_sections) > 0
|
||||||
|
if improved or (no_regression and has_new_sections):
|
||||||
semantic_indices.append(retry_result)
|
semantic_indices.append(retry_result)
|
||||||
merged = trial_merged
|
merged = trial_merged
|
||||||
passed, gaps = trial_passed, trial_gaps
|
passed, gaps = trial_passed, trial_gaps
|
||||||
|
|||||||
@@ -83,8 +83,8 @@ def test_output_dir_structure():
|
|||||||
|
|
||||||
|
|
||||||
def test_ensemble_temperatures_count():
|
def test_ensemble_temperatures_count():
|
||||||
"""Should have exactly 3 ensemble temperatures."""
|
"""Should have exactly 4 ensemble temperatures."""
|
||||||
assert len(config.ENSEMBLE_TEMPERATURES) == 3
|
assert len(config.ENSEMBLE_TEMPERATURES) == 4
|
||||||
|
|
||||||
|
|
||||||
def test_max_tokens_is_int():
|
def test_max_tokens_is_int():
|
||||||
|
|||||||
Reference in New Issue
Block a user