Skip to content

feat: 归因结果增加领先幅度与接近判定 - #39

Open
mvanhorn wants to merge 1 commit into
xqy2006:mainfrom
mvanhorn:feat/attribution-verdict
Open

mvanhorn wants to merge 1 commit into
xqy2006:mainfrom
mvanhorn:feat/attribution-verdict

Conversation

@mvanhorn

@mvanhorn mvanhorn commented Oct 23, 2026 •

Copy link
Copy Markdown

做什么

归因接口和测试页在原有闭集排序之外,增加领先幅度(首位概率减去次位概率)和三档判定:

  • 明确领先:首位 ≥ 70%,且与次位相差 ≥ 25 个百分点
  • 候选接近:未达到上面的幅度,但首位仍高于 45%,且与次位相差 ≥ 8 个百分点
  • 不宜单独点名:首位低于 45%,或与次位相差不足 8 个百分点

「不宜单独点名」时同时列出接近候选,而不是只强调一个模型名。家族概率使用同一套规则。prediction / probability 字段保持不变。

需求

怎么用

  1. 按原流程做手动测试或 API 自动测试。
  2. 结果区顶部的判定条会说明领先幅度、次位和接近候选。
  3. POST /api/analyze 新增 verdict、margin、runner_up、contenders、family_verdict 等字段。

验证

python3 -m unittest tests.test_attribution -v
node --test tests/attribution-core.test.mjs

Demo

demo

首位概率不高或与次位差距较小时,页面同时列出接近候选,而不是只强调一个模型名。

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant