Sub topic 3
Writing annotation guidelines
Prerequisites
This chapter assumes you have defined your annotation task and a label schema, as covered in the two previous chapters. It also assumes you can read basic Python. Later chapters measure agreement with kappa. Here you write the document that determines whether that agreement is high or low.
Why guidelines decide agreement
Annotation guidelines are the written contract between the people who design the task and the people who label. Two annotators who read the same schema can still disagree if the schema leaves room for interpretation. Each of them then fills the gap with personal judgment.
When agreement is low, the usual cause is an underspecified guideline, not careless annotators. Treat guidelines as a testable artifact. You draft them, test them in a pilot round, and revise them using the disagreements you find.
Parts of a guideline document
A usable guideline has the same sections each time. The table lists them and what goes wrong when one is missing.
| Section | Contents | Typical failure if missing |
|---|---|---|
| Purpose | What the data will be used for and who the final users are | Annotators guess the intent and apply different standards |
| Unit of annotation | What gets one label: a sentence, a review, a span | Some annotators label whole reviews, others label sentences |
| Label definitions | One definition per label, with inclusion and exclusion rules | Labels overlap and annotators choose differently |
| Examples | Clear cases, borderline cases and counterexamples | Rules are read abstractly and applied inconsistently |
| Tie-break rules | What to do when two labels both fit | Annotators resolve conflicts in personal ways |
| Escape labels | How to mark unclear, off-topic or broken items | Annotators force a label onto items that do not fit |
| Tool instructions | How to use the interface, save work and flag problems | Format errors that look like disagreements |
Writing label definitions
A definition should let an annotator decide, not just understand. Give each label four parts: a one-sentence definition, what it includes, what it excludes, and at least two examples.
Take a three-label sentiment task with the labels pos, neg and neu. A weak definition says "pos means the text is positive." A stronger one reads:
pos: the author expresses approval, satisfaction or enjoyment of the product itself.- Include: praise, recommendations, and "worth the price."
- Exclude: praise for shipping or customer service when the product is criticized. Those cases follow the tie-break rule below.
- Example: "Battery lasts all week, love it." Label
pos. - Example: "Works as described." Label
neu, because it states a fact without approval.
Write definitions in terms of what the text says, not what the annotator feels. "The author states approval" is observable. "The text seems nice" is not.
Ordering decisions
When a task has many labels, a fixed order of questions removes much of the ambiguity. The annotator answers the questions in sequence and stops at the first match. This also makes disagreements easier to trace, because you can see which question the annotators answered differently.
Examples and edge cases
Examples teach more than rules do, so choose them with care. Include three kinds:
- Clear cases that show the typical instance of each label.
- Borderline cases with the correct label and the reason for it.
- Contrastive pairs, which are two near-identical texts with different labels. For example, "I expected better" and "Better than I expected" differ in one word and in sentiment.
Collect edge cases from the data, not from imagination. Typical ones for text tasks include sarcasm, quoted speech ("My wife said it was terrible, but I like it"), questions, mixed opinions, emojis with no words, and texts in another language. If you decide a case, write it down. An undocumented decision becomes a disagreement the next time it appears.
Escape labels and their cost
Give annotators a way to say that an item does not fit. Common choices are unclear, other and skip. Without them, annotators pick a label at random, which adds noise that looks like real data.
Escape labels have a cost. If one is easy to use, annotators will use it to avoid hard decisions. Track how often each annotator uses it. Treat a high rate as a signal about the guidelines or the annotator, and decide in advance how escape-labeled items are handled when you compute agreement and build gold labels.
Checking labels against the schema
Many apparent disagreements are format errors: a typo in a label, a missing field, or a guideline version that was never recorded. A small validator catches these before you measure anything. Storing the guideline version with each label also lets you tell later which rules an annotator followed.
SCHEMA = {
"labels": {"pos", "neg", "neu", "unclear"},
"guideline_version": "1.1",
}
def validate(record):
"""Return a list of problems found in one annotation record."""
problems = []
if record.get("label") not in SCHEMA["labels"]:
problems.append(f"unknown label: {record.get('label')!r}")
if record.get("guideline_version") != SCHEMA["guideline_version"]:
problems.append(
f"guideline version {record.get('guideline_version')!r}, "
f"expected {SCHEMA['guideline_version']!r}"
)
if not record.get("annotator"):
problems.append("missing annotator id")
return problems
records = [
{"item": 1, "annotator": "a1", "label": "pos", "guideline_version": "1.1"},
{"item": 2, "annotator": "a2", "label": "positive", "guideline_version": "1.1"},
{"item": 3, "annotator": "", "label": "neu", "guideline_version": "1.0"},
]
for r in records:
print(r["item"], validate(r))Running this reports item 2 for the unknown label positive. It reports item 3 for the old guideline version and the missing annotator id.
Versioning and revising guidelines
Guidelines will change after the pilot round, so plan for that. Follow these practices:
- Number every version and keep a changelog that says what changed and why.
- Record the version on every label, as the validator above does.
- Decide, for each change, whether it affects labels already collected. A clarification of an edge case may require relabeling only the items that match it. A change to a label's meaning requires relabeling everything.
- Do not change guidelines silently during the main annotation. Gather questions from annotators, decide them in one place, and distribute the new version to everyone at once.
Common errors
- Too long. A 40-page document is not read. Put the core rules on the first page and move the details into an appendix of cases.
- Rules without examples. Annotators interpret the abstract rule in different ways.
- Examples copied from the evaluation items. The annotators then match the examples instead of applying the rules, which inflates agreement.
- Contradictions. A definition says one thing and an example shows another. Check each example against the rules before release.
- Guidelines that encode the designer's opinion. If the task is subjective, say so and describe whose judgment is wanted, such as the typical reader or a domain expert.
Exercise
Exercise
In a pilot round, two annotators often disagree on reviews such as "The phone is great, but support never answered me." Name two changes to the guidelines that would reduce this disagreement, and explain how you would check that they worked.
Show answer
First, add a tie-break rule that says the label depends on the author's stance toward the product itself, with criticism of support not counted, or that says mixed reviews are decided by the stronger overall stance and labeled neu when equal. Second, add this review and two or three similar ones as borderline examples with the correct label and the reason. Check the change by running a new pilot round on fresh items, not the examples. Then compare observed agreement and kappa with the earlier round, and look at whether the mixed-review items still dominate the disagreements. Record the new guideline version on the new labels.