Sub topic 6
Observed Agreement and Why It Is Not Enough
Prerequisites: You should know basic Python, lists, functions, proportions, and common NLP tasks such as text classification and named entity recognition. This chapter assumes that two annotators label the same fixed set of items with the same categorical labels.
Observed agreement is the proportion of items on which annotators assign the same label. It is also called percent agreement.
For example, suppose two annotators label 10 text snippets as positive, negative, or neutral. If they choose the same label for 8 snippets, their observed agreement is:
P_o = \frac{8}{10} = 0.80The annotators agree on 80% of the items.
Computing observed agreement
Represent each annotator's labels as a list. The labels must be in the same order, so position 0 in one list refers to the same item as position 0 in the other list.
ann1 = ["pos", "pos", "neg", "neg", "pos",
"neu", "neg", "pos", "neu", "neg"]
ann2 = ["pos", "neg", "neg", "neg", "pos",
"neu", "neg", "pos", "pos", "neg"]
matches = [x == y for x, y in zip(ann1, ann2)]
observed_agreement = sum(matches) / len(matches)
print(observed_agreement)The output is:
0.8A confusion table gives more detail than one percentage. Its rows represent annotator 1's labels, and its columns represent annotator 2's labels.
| Annotator 1 / Annotator 2 | pos | neu | neg |
|---|---|---|---|
| pos | 3 | 1 | 1 |
| neu | 0 | 1 | 0 |
| neg | 0 | 0 | 4 |
The diagonal contains agreements. The off-diagonal cells contain disagreements. Here, the main disagreement is that annotator 1 used pos while annotator 2 used neg or pos while annotator 2 used neu.
Why the percentage is not enough
Observed agreement does not consider how often each annotator uses each label. Two annotators can agree often simply because one label is very common.
Imagine a dataset in which 98 of 100 messages are not spam. If both annotators always choose not_spam, they agree on 98% of the items. Yet their labels provide no evidence that they can recognize spam. The high percentage mostly reflects the prevalence of the common label.
The reverse problem can also occur. Annotators may have similar label preferences but disagree on particular items. Their observed agreement can look reasonable while hiding systematic differences in how they apply the guidelines.
Chance-corrected measures address this issue by comparing observed agreement with an estimate of agreement expected from the annotators' label frequencies.
The usual workflow is:
Before computing a chance-corrected score, check that the items are aligned, labels are valid, and every disagreement has been retained. Removing difficult items after seeing the labels can inflate the result.
Exercise
Two annotators agree on 45 of 50 items. What is their observed agreement, and why should you also inspect label frequencies?
Show answer
The observed agreement is 45 / 50 = 0.90, or 90%. Label frequencies matter because the agreement may be high partly because both annotators often choose a common label. A chance-corrected measure can show whether the agreement exceeds that expected from their label usage.