概述
Cohen 的 kappa 是两个评估者对分类标签进行机会校正的统计量;这是一种衡量标准,而不是对标签质量或结构有效性的判断。
深入探讨
Raw percent agreement — simply counting how often two annotators chose the same label — is intuitive but flawed because it doesn't account for the possibility that annotators could agree just by chance, especially when one label dominates the dataset. Cohen's kappa addresses this by computing the difference between observed agreement and expected agreement (the agreement you'd predict from each annotator's individual label frequencies if their choices were independent), then normalizing that difference against the maximum possible improvement over chance. The formula is kappa = (observed agreement − expected agreement) / (1 − expected agreement), producing a value that is 1 for perfect agreement, 0 for agreement no better than chance, and negative when agreement is worse than chance. Commonly cited rough interpretation bands (such as below 0 as poor, 0.01–0.20 as slight, up to 0.81–1.00 as almost perfect) come from a widely used but informal scale, not a universally agreed statistical standard, and different fields apply different thresholds for what counts as "good enough" to trust a labeled dataset. Cohen's kappa applies specifically to exactly two raters; for three or more, Fleiss’ kappa is one common nominal-label alternative, not a pairwise mean. Other designs, including those with missing ratings, may use Krippendorff’s alpha. For labels with a natural order (like a 1-5 rating scale), a weighted kappa variant is preferred because it treats a one-point disagreement as less severe than a four-point disagreement, whereas standard kappa treats all disagreements equally regardless of magnitude. A common misconception is that a high percent agreement always signals a well-defined labeling task; when the label distribution is skewed, percent agreement can look high even when agreement beyond chance is limited, which kappa can help reveal. Krippendorff's alpha is a related and more flexible alternative that handles missing data and more than two raters natively, and is preferred by some researchers for that flexibility.
现实世界的实施
将推文标记为有毒或无毒的两位注释者在 90% 的情况下一致,但由于 85% 的推文是无毒的,kappa 计算显示,超出偶然性的一致性只是中等,而不是出色。
在多类任务上比较三个或更多注释者的团队使用 Fleiss 的 kappa 而不是 Cohen 的 kappa,因为 Cohen 的 kappa 是专门为两个评估者定义的。
具有序数评级(如 1-5 质量等级)的项目使用加权 kappa 变体,因此 1 分的分歧与 4 分的分歧的计数不同。
一家标签供应商报告新任务的 kappa 得分为 0.55,这促使客户要求修改指南并进行重新校准,而不是按原样接受批次。
注释者间协议的未来和 Cohen 的 Kappa
协议报告在抽样、类别平衡、评估者培训、裁决和不确定性方面应该变得更加透明。对于序数、多标签或缺失数据任务,选择其假设符合设计的统计量,而不是拉伸 Cohen 的 kappa。比较人类标签和模型标签并不能证明两者都是正确的。利用分歧来识别不明确的项目或指令,然后将统计数据与专家评审和特定任务的有效性检查相结合;避免将任何单个系数或常规频带视为任何应用中的通用质量阈值。
付诸实践
为什么这很重要
- 成本与预算. 多年来,架构决策决定着性能和运营成本。
- 更清晰的判决. 技术教育帮助团队选择正确的堆栈,而不仅仅是最新的堆栈。
- 质量控制. 更好的工程选择可以减少生产中的可靠性事故。
留意
- 优化一项基准测试可以隐藏更广泛的系统弱点。
- 基础设施和维护成本常常被低估。
- 随着系统变得更加复杂,安全性和可观察性差距可能会扩大。
后续步骤
- 在实施之前定义延迟、质量和成本目标。
- 在实际负载和数据条件下进行基准测试。
- 仪器监控错误、漂移和用户影响。
- 在扩展之前准备回滚和事件响应路径。
不断探索
常见问题
什么是注释者间协议和 Cohen 的 Kappa?
注释者间协议 (IAA) 描述了贴标者根据定义的说明将相同标签应用于相同项目的频率。 Cohen 的 kappa 是两个评估者对分类标签进行机会校正的统计量;这是一种衡量标准,而不是对标签质量或结构有效性的判断。
根据指南,为什么两个标注者之间的原始百分比一致性可能具有误导性?
该指南解释说,原始一致性并不能纠正机会一致性,当一个标签主导数据时,机会一致性可能会夸大表面一致性。
Cohen's Kappa 专门校正了原始百分比一致性未考虑的哪一点?
与原始一致性百分比不同,Kappa 在标准化之前减去预期一致性(根据每个注释者的边缘标签频率计算)。
当涉及两位以上评审者且标签为名义型时,常用的替代统计量是什么?
Fleiss’ kappa 是名义评级的常见多评级者扩展;根据设计,其他系数可能更可取。
何时应使用加权 Kappa 变体而非标准 Kappa?
该指南将加权 kappa 描述为序数尺度的首选,将较小的分歧视为比较大的分歧更不严重。
当观察到的一致性等于根据评审者边际分布估计的机会一致性时,Cohen’s Kappa 的取值是多少?
该指南指出,当一致性不优于机会时,kappa 为 0;当一致性差于机会时,kappa 为 1;当一致性差于机会时,kappa 为负。