Score 适合解决什么问题?
当答案落在一组有顺序的等级上时,可以使用 Score,例如问题严重程度、技能熟练度或贡献程度。你先描述各档含义,模型再返回沿这条量表的评分。
Choice 适合从没有高低顺序的选项中选择;Noul 适合判断一个条件是否成立。Score 回答的是“程度如何”,而不只是“是否成立”。
如何编写一个 Score 请求?
state 放事实和上下文;model 选择模型;questions 放需要回答的问题。每道评分题设置 type: score,用 instructions 说明评什么,用 criteria 描述可能的等级。
示例中,猴子 Naruto 按下摄影师 Slater 留下的相机快门,拍出自拍。摄影师随后处理、挑选并出版照片。两道问题分别评价双方对同一张照片的贡献。
instructions 中反引号里的 subject、human 和 creative_work 指向 state 的字段。subject_contribution 等问题名称只是结果标识,不参与模型判断,因此问题本身必须写完整。
完整请求示例
向下方地址发送 POST 请求;请求头使用 Authorization: Bearer <API_KEY> 和 Content-Type: application/json。密钥应保存在服务端。这里仅展示请求,不执行调用;再次请求不保证得到与截图相同的结果。
https://api.typesafe.ai/v1/systemone{
"state": {
"scenario": "Naruto is a Celebes crested macaque living in the Tangkoko nature reserve in North Sulawesi, Indonesia. David Slater, a wildlife photographer shooting macaques in the reserve, leaves his camera unattended, and Naruto repeatedly activates the shutter, producing hundreds of images, including a remarkably sharp, grinning self-portrait reminiscent of a human selfie. Slater later processes and publishes the best photographs in a book that names him as the copyright owner. The book states that Naruto took the photographs, with captions like, 'Surely a sign of self-awareness?' Another caption reads, 'Naruto the macaque smiles at itself while pressing the shutter button on a camera.'",
"subject": "Naruto",
"human": "Slater",
"creative_work": "the grinning self-portrait"
},
"model": "jev-latest",
"questions": {
"subject_contribution": {
"type": "score",
"instructions": "How much did `subject` contribute to `creative_work`?",
"criteria": [
"None",
"Minorly",
"Moderately",
"Majorly",
"Completely"
]
},
"human_contribution": {
"type": "score",
"instructions": "How much did `human` contribute to `creative_work`?",
"criteria": [
"None",
"Minorly",
"Moderately",
"Majorly",
"Completely"
]
}
}
}如何定义评分标准?
criteria 按从低到高的顺序排列,至少包含两个等级。数组索引从 0 开始,因此示例的五档 None、Minorly、Moderately、Majorly、Completely 对应 0~4 分。
实际使用时,先限定评价范围,再用具体行为描述每档。例如明确是否包含设备准备、构图、按快门和后期处理。每道题尽量只评价一个维度,并用已知样例检查等级是否容易区分。
如何读取返回结果?
answers 按问题名称返回结果。score 是概率加权后的分值;legend 将等级索引映射回描述;probabilities 给出各档概率,总和为 1;confidence 概括判断的确定程度。
score = Σ(i × pᵢ),其中 i 是从 0 开始的等级索引,pᵢ 是该档概率。因此分数可以落在两个整数之间。
同一个分数可能来自不同分布:所有概率都落在 2 档,或一半在 0 档、一半在 4 档,平均值都是 2。要结合概率分布理解结果。
score = Σ(i × pᵢ)confidence 应该怎么理解?
confidence 是根据完整概率分布计算的 0~1 统计量。它概括分布的确定程度,与评分高低是两个维度:低分也可以有高置信度。
它不等于最高档位的概率,也不能直接解释为答案的正确率。已核对的官方文档没有给出精确计算公式;即使 confidence 为 1,也不保证判断正确。
猴子自拍案例的结果如何计算?
截图中,猴子的概率主要集中在“主要贡献”和“完全贡献”,摄影师主要落在“少量贡献”。先看完整分布,再看它们汇总成的分数。
按下方显示的整数百分比计算,猴子得到 3.52,摄影师得到 1.20;截图分数为 3.51 和 1.18。微小差异可能来自显示时的舍入,缺少原始响应无法确认具体原因。
猴子的置信度是 59%,摄影师是 68%。较高的贡献评分并不意味着较高的置信度。
猴子 Naruto
置信度 59%
摄影师 Slater
置信度 68%
| 分值 | 贡献程度 | 猴子 Naruto | 摄影师 Slater |
|---|---|---|---|
| 0 | 没有贡献 | 0% | 10% |
| 1 | 少量贡献 | 0% | 69% |
| 2 | 中等贡献 | 3% | 13% |
| 3 | 主要贡献 | 42% | 7% |
| 4 | 完全贡献 | 55% | 1% |
以上为案例截图记录,不是本页实时运行的模型结果。概率仅显示整数百分比。
Naruto2 × 0.03 + 3 × 0.42 + 4 × 0.55 = 3.52
Slater1 × 0.69 + 2 × 0.13 + 3 × 0.07 + 4 × 0.01 = 1.20
有哪些常见误读?
两道题是独立评分,没有要求双方分配同一个总额。因此分数不需要合计为 4;3.51 ÷ 4 只是归一化评分,不代表猴子实际贡献了 87.75%。
贡献程度也不等于创作意图或版权归属。猴子直接触发拍摄、摄影师提供设备和后续处理,可以帮助理解分数差异,但这是结合故事作出的解读,截图没有返回模型的解释。
把判断用于实际流程前,先明确贡献的含义,使用已知结果校验标准,并同时读取 score、probabilities 和 confidence。
