Sub topic 1
Defining the Annotation Task
Text annotation is the process of adding structured labels to raw text. An annotation task must specify what annotators label, which labels they may choose, and how they make difficult decisions. A vague task produces inconsistent data, even when annotators are careful.
Prerequisites
This chapter assumes that you know basic Python, including lists, dictionaries, and functions. You should also know the difference between common NLP tasks such as text classification and named entity recognition. Basic probability is useful because later chapters compare agreement proportions.
Start with the unit of annotation
The unit of annotation is the piece of text that receives a decision. It might be:
- A complete document, such as a support ticket.
- A sentence, such as one sentence from a news article.
- A token, such as one word.
- A span, which is a selected character range in text.
- A pair of texts, such as a question and a candidate answer.
The unit determines the structure of the dataset. For document classification, one row might contain a document and one label. For named entity recognition, one document can contain several labeled spans.
Define the unit precisely. For example, “classify customer messages” leaves open whether a message containing several issues receives one label or several labels. A clearer definition is: “Assign every message one primary intent from the following list.”
Define the decision and label schema
The annotation decision describes what the annotator must determine. The label schema is the complete set of allowed labels and their meanings.
A good schema has:
- A label name that is easy to distinguish from other names.
- A short definition.
- Positive examples.
- Boundary examples that are easy to confuse.
- Rules for cases that do not fit.
- An explicit policy for missing, unclear, or multiple answers.
Suppose you classify product reviews by sentiment:
| Label | Meaning | Example |
|---|---|---|
| positive | The writer expresses a favorable opinion | “The battery lasts all day.” |
| negative | The writer expresses an unfavorable opinion | “The screen broke quickly.” |
| neutral | The text gives information without a clear opinion | “The phone has a six-inch screen.” |
Decide how to handle mixed sentiment before annotation begins. For example, “The camera is excellent, but the battery is poor” could receive a mixed label, or the task could require the annotator to select the main sentiment. Both choices can be valid, but they create different datasets.
Specify the output format
State exactly what annotators must return. For a classification task, the output might be one label. For a span task, it should include the start position, end position, and entity type. Also define whether labels are case-sensitive, whether overlapping spans are allowed, and how annotators record uncertainty.
Separate annotation from interpretation. Annotators should apply the written task definition, not guess what a model might need later.
Check the task before scaling
Test the draft task on a small sample. Ask annotators to label the same items independently, then inspect disagreements. Frequent disagreements often reveal overlapping labels, missing edge-case rules, or an unsuitable unit of annotation. Revise the schema and guidelines before collecting the full dataset.
Exercise
You need to label news articles as about sports, politics, or business. An article can discuss more than one topic. What task decision should you make before annotation starts?
Show answer
Decide whether each article receives one primary topic or can receive multiple topic labels. Document how annotators choose the primary topic or how they assign multiple labels.