Inter-Annotator Agreement › Worked Example

Michael BrenndoerferMarch 8, 20265 min read
Language AI HandbookAll chapters
Part 55 of 67Human and Model Evaluation
Chapter 424Inter-Annotator Agreement › Worked Example
Reading section 6 of 11 · Worked Example · 5 minSection 6 of 11 · 5 min

Section 6 of 11 · 5 min read

Inter-Annotator Agreement › Worked ExampleSection view · Sections in this chapter6 / 11 ↓
Reading tools Definitions, links & notes

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

Notes & comments

Let's calculate all three metrics on a concrete example. Suppose three annotators (A, B, C) label 10 sentences for sentiment: Positive (P), Neutral (N), or Negative (G).

Sentiment annotations for 10 items by three annotators.
ItemABC
1PPP
2PPN
3NNN
4PPP
5NPN
6GGG
7PNP
8NNN
9PPP
10GPG

Six items (1, 3, 4, 6, 8, 9) are unanimously agreed upon. The four disagreement items (2, 5, 7, 10) each have a 2-1 split, with different categories causing trouble in each case.

Cohen's Kappa (A vs B)

First, construct the agreement matrix between A and B:

Agreement matrix between annotators A and B.
B:PB:NB:G
A:P410
A:N120
A:G101

Observed agreement:

Po=4+2+110=0.7\begin{aligned} P_o &= \frac{4 + 2 + 1}{10} \\ &= 0.7 \end{aligned}

Row marginals for A: pP+=0.5p_{P+} = 0.5, pN+=0.3p_{N+} = 0.3, pG+=0.2p_{G+} = 0.2 Column marginals for B: p+P=0.6p_{+P} = 0.6, p+N=0.3p_{+N} = 0.3, p+G=0.1p_{+G} = 0.1

Expected agreement:

Pe=(0.5×0.6)+(0.3×0.3)+(0.2×0.1)=0.30+0.09+0.02=0.41\begin{aligned} P_e &= (0.5 \times 0.6) + (0.3 \times 0.3) + (0.2 \times 0.1) \\ &= 0.30 + 0.09 + 0.02 \\ &= 0.41 \end{aligned}

Cohen's kappa:

κ=0.7−0.411−0.41=0.290.59≈0.492\begin{aligned} \kappa &= \frac{0.7 - 0.41}{1 - 0.41} \\ &= \frac{0.29}{0.59} \\ &\approx 0.492 \end{aligned}

This falls in the "moderate" range. Notice that A uses "Negative" 20% of the time while B uses it only 10% of the time. This rater-level difference in base rates is exactly what Cohen's kappa captures through separate marginals.

Fleiss' Kappa (All Three)

For Fleiss' kappa, we calculate PiP_i for each item:

  • Item 1 (P,P,P):
P1=13(2)(32−3)=66=1.0\begin{aligned} P_1 &= \frac{1}{3(2)}(3^2 - 3) \\ &= \frac{6}{6} \\ &= 1.0 \end{aligned}
  • Item 2 (P,P,N):
P2=16(22+12+0−3)=36=0.333\begin{aligned} P_2 &= \frac{1}{6}(2^2 + 1^2 + 0 - 3) \\ &= \frac{3}{6} \\ &= 0.333 \end{aligned}
  • Item 3 (N,N,N): 1.01.0

  • Item 4 (P,P,P): 1.01.0

  • Item 5 (N,P,N):

P5=16(12+22−3)=26=0.333\begin{aligned} P_5 &= \frac{1}{6}(1^2 + 2^2 - 3) \\ &= \frac{2}{6} \\ &= 0.333 \end{aligned}
  • Item 6 (G,G,G): 1.01.0

  • Item 7 (P,N,P):

P7=16(22+12−3)=0.333\begin{aligned} P_7 &= \frac{1}{6}(2^2 + 1^2 - 3) \\ &= 0.333 \end{aligned}
  • Item 8 (N,N,N): 1.01.0

  • Item 9 (P,P,P): 1.01.0

  • Item 10 (G,P,G):

P10=16(12+22−3)=0.333\begin{aligned} P_{10} &= \frac{1}{6}(1^2 + 2^2 - 3) \\ &= 0.333 \end{aligned}

Mean observed agreement:

Po=110(1+0.333+1+1+0.333+1+0.333+1+1+0.333)=7.33210=0.733\begin{aligned} P_o &= \frac{1}{10}(1 + 0.333 + 1 + 1 + 0.333 + 1 + 0.333 + 1 + 1 + 0.333) \\ &= \frac{7.332}{10} \\ &= 0.733 \end{aligned}

Category proportions (total assignments = 10 items ×\times 3 raters = 30):

  • PP=15/30=0.5P_P = 15/30 = 0.5
  • PN=10/30=0.333P_N = 10/30 = 0.333
  • PG=5/30=0.167P_G = 5/30 = 0.167

Expected agreement:

Pe=0.52+0.3332+0.1672=0.25+0.111+0.028=0.389\begin{aligned} P_e &= 0.5^2 + 0.333^2 + 0.167^2 \\ &= 0.25 + 0.111 + 0.028 \\ &= 0.389 \end{aligned}

Fleiss' kappa:

κF=0.733−0.3891−0.389=0.3440.611≈0.563\begin{aligned} \kappa_F &= \frac{0.733 - 0.389}{1 - 0.389} \\ &= \frac{0.344}{0.611} \\ &\approx 0.563 \end{aligned}

Krippendorff's Alpha

For nominal data with 3 raters per item, we build the coincidence matrix. Each item contributes ordered pairs of ratings, one per ordered pair of raters.

Item 5: A(N), B(P), C(N). Ordered pairs: (A,B):N(A,B):N-PP, (A,C):N(A,C):N-NN, (B,A):P(B,A):P-NN, (B,C):P(B,C):P-NN, (C,A):N(C,A):N-NN, (C,B):N(C,B):N-PP. This contributes oNP+=2o_{NP} += 2, oPN+=2o_{PN} += 2, oNN+=2o_{NN} += 2.

Counting all contributions:

  • oPPo_{PP}: Items 1(6), 2(2), 4(6), 7(2), 9(6) =22= 22
  • oNNo_{NN}: Items 3(6), 5(2), 8(6) =14= 14
  • oGGo_{GG}: Items 6(6), 10(2) =8= 8
  • oPN=oNPo_{PN} = o_{NP}: Items 2(2), 5(2), 7(2) =6= 6 each
  • oPG=oGPo_{PG} = o_{GP}: Item 10(2) =2= 2 each
  • oNG=oGNo_{NG} = o_{GN}: None =0= 0

Total: 22+14+8+6+6+2+2=6022 + 14 + 8 + 6 + 6 + 2 + 2 = 60 (which matches 10×3×2=6010 \times 3 \times 2 = 60 ordered pairs).

Observed disagreement:

Do=oPN+oNP+oPG+oGP60=6+6+2+260=1660=0.267\begin{aligned} D_o &= \frac{o_{PN} + o_{NP} + o_{PG} + o_{GP}}{60} \\ &= \frac{6 + 6 + 2 + 2}{60} \\ &= \frac{16}{60} \\ &= 0.267 \end{aligned}

Expected disagreement:

De=1−(PP2+PN2+PG2)=1−(0.52+0.3332+0.1672)=1−0.389=0.611\begin{aligned} D_e &= 1 - (P_P^2 + P_N^2 + P_G^2) \\ &= 1 - (0.5^2 + 0.333^2 + 0.167^2) \\ &= 1 - 0.389 \\ &= 0.611 \end{aligned}

Alpha:

α=1−0.2670.611=1−0.437=0.563\begin{aligned} \alpha &= 1 - \frac{0.267}{0.611} \\ &= 1 - 0.437 \\ &= 0.563 \end{aligned}

For this case with complete data and nominal categories, Fleiss' kappa and Krippendorff's alpha give the same value (0.563), as theory predicts. Cohen's kappa between specific rater pairs varies. The A vs B pair showed κ=0.492\kappa = 0.492; A vs C and B vs C would produce different values because each pair has different marginal distributions.

Comments

Add to the conversation

A question, a correction, or an example from your own work.

No comments yet. Be the first to share your thoughts!

Newsletter

Stay up to date

Get new articles, book updates, and notes on AI and technology.

Unsubscribe at any time. Privacy policy