Semantic Role Labeling: Who Did What to Whom
Module: Natural Language Processing | Difficulty: Advanced
What You'll Learn
- 1Recover predicate-argument structure with PropBank labels and FrameNet frames
- 2Compare BIO tagging and span-based formulations of the SRL task
- 3Compute labeled argument F1 under exact span matching
- 4Decode non-overlapping arguments with a greedy or constrained search
Semantic role labeling identifies what role each constituent plays relative to a verb: who did it, to whom, where, when, and how. It is shallow semantics, one step above syntax and one step below full interpretation, and it converts a sentence into structured records.
Resources and Labels
PropBank annotates verbs with numbered arguments: ARG0 is typically the agent, ARG1 the patient or theme, and ARGM tags carry modifiers such as location, time, and manner. FrameNet instead groups verbs by the frame they evoke and labels frame elements such as buyer, seller, and goods for a commerce frame. VerbAtlas bridges the two with 466 unified frames.
Annotating one sentence means choosing a label for many positions, and the annotation is dense: English sentences average about 2.8 predicates, while roughly 70 percent of sentences have three or fewer predicates and no more than five labeled arguments each.
| Resource | Coverage | Labels | Typical size |
|---|---|---|---|
| PropBank English | verbs | numbered ARG and ARGM | about 113K verbs in OntoNotes |
| FrameNet | lexical units | frame elements | about 1,200 frames |
| VerbAtlas | 466 frames | unified frame elements | cross-lingual inventory |
| CoNLL-2012 English | OntoNotes newswire and web | CoNLL shared task | about 94,269 sentences |
Formulations
The classic formulation tags each token with a BIO label conditioned on the predicate, then decodes with a linear chain model:
Transition scores forbid illegal sequences such as ARG0 beginning after INSIDE, which is the main advantage of the tagging view. Span models avoid the restriction by scoring candidate intervals directly:
where pools the span representation and encodes distance to the predicate. The cost is combinatorial: a sentence of tokens contains spans before pruning.
Predicate sense is a separate decision that conditions everything downstream, since the same verb evokes different frames:
where is the set of framesets of verb and the surrounding sentence disambiguates among them.
Results and Error Sources
On CoNLL-2012 English, graph-based and span-based neural systems cluster tightly: Ouchi et al. (2018) reported 86.2 F1, Shi and Lin (2019) reported 86.5 with a dependency-based BERT model, and Conia and Navigli (2020) reported 87.3 with a joint global model. Pushing a span formulation over DeBERTa reaches about 87.5, so the remaining errors are concentrated in long arguments, nominal predicates, and implicit roles rather than in the general tagging machinery.
Worked Code
SENT = "The manager approved the budget yesterday .".split()
def tokens(sent):
return [w.strip(".,") for w in sent if w.strip(".,")]
def bio_to_spans(tags):
spans, start, label = [], None, None
for i, tag in enumerate(tags):
if tag.startswith("B-"):
if start is not None:
spans.append((start, i - 1, label))
start, label = i, tag[2:]
elif tag.startswith("I-") and (start is None or label != tag[2:]):
start, label = i, tag[2:]
elif tag == "O" and start is not None:
spans.append((start, i - 1, label))
start, label = None, None
if start is not None:
spans.append((start, len(tags) - 1, label))
return spans
tags = ["B-ARG0", "I-ARG0", "B-V", "B-ARG1", "I-ARG1", "B-ARGM-TMP", "O"]
for start, end, label in bio_to_spans(tags):
print(f"{label:10s} {start}-{end} {' '.join(tokens(SENT)[start:end + 1])}")
print("tokens:", tokens(SENT))
The second program implements the span-scoring view: enumerate candidate intervals, score them with features that favour proximity to the predicate, and select a non-overlapping set.
SENT = "The manager approved the budget yesterday".split()
PREDICATE = SENT.index("approved")
STOP = {"the", "a", "of", "in", "to", "and", "was", "is"}
def span_score(i, j, p):
words = [w.lower() for w in SENT[i:j + 1]]
dist = abs((i + j) / 2 - p)
inside = 1.0 if i <= p <= j else 0.0
stop_span = -2.0 if all(w in STOP for w in words) else 0.0
return 1.5 * inside - 0.5 * dist - 0.15 * (j - i) + stop_span
def enumerate_spans(words, max_len=5):
n = len(words)
for i in range(n):
for j in range(i, min(n, i + max_len)):
yield i, j
def select_arguments(words, p, max_args=3):
ranked = sorted(
((span_score(i, j, p), i, j) for i, j in enumerate_spans(words)),
reverse=True,
)
chosen = []
for score, i, j in ranked:
if i <= p <= j:
continue
if len(chosen) >= max_args:
break
if any(not (j < a or i > b) for _, a, b in chosen):
continue
chosen.append((round(score, 3), i, j))
return chosen
for score, i, j in select_arguments(SENT, PREDICATE):
print(f"score={score:5.2f} span={i}-{j} {' '.join(SENT[i:j + 1])}")
print("candidates:", sum(1 for _ in enumerate_spans(SENT)))
Real-World Applications
- Information extraction: SRL converts sentences into subject-verb-object records that feed relation extraction and event schemas.
- Question answering: answer candidates are often ARG0 or ARG1 spans of the question predicate.
- Summarization: role structure highlights who acted and what changed, which guides sentence fusion.
- Machine translation: predicate-argument structure provides a language-neutral intermediate for reordering.
đĄPrune before you score
Common Mistakes
Evaluating arguments without the predicate in the key
Fix: Key predictions by predicate index, role, and span, as CoNLL scoring does
Ignoring span boundary errors
Fix: Report boundary-only F1 alongside labeled F1 to separate segmentation from classification
Training one model over all predicates
Fix: Condition on the predicate or its sense, since roles depend on the frame
Best Practices
- Report labeled and boundary F1 separately
- Handle nominal predicates explicitly, since they dominate the residual errors
- Use a joint global model when arguments of one predicate interact
Key Takeaways
- PropBank labels arguments as ARG0, ARG1, and ARGM modifiers; FrameNet labels frame elements
- BIO tagging forbids illegal label sequences while span models allow any interval
- CoNLL-2012 English holds about 94,269 sentences for the shared task
- Current models cluster between 86.2 and 87.5 F1, so errors are now concentrated in hard cases
Frequently Asked Questions
What is the difference between SRL and dependency parsing?
Dependencies connect words with a single labeled arc per relation, while SRL links constituents to a predicate with numbered roles that are consistent across verbs. The same noun phrase may be ARG0 for one verb and ARG1 for another.
Why does exact span matching make the task hard?
Because one extra token flips a correct prediction into both a false positive and a false negative. That is why labeled F1 is always accompanied by boundary analysis in published tables.
Do models generalize to unseen verbs?
Partially. Frame-level inventories such as VerbAtlas and FrameNet let a model share statistics across verbs that evoke the same frame, which improves results on low-frequency predicates.
Interview Questions
Q1: How do you decode arguments so they do not overlap?
Score spans then run constrained selection, such as greedy non-overlapping pick or an ILP over spans
Q2: Which errors remain after BERT-era SRL?
Long multi-token arguments, nominal predicates, and implicit or null arguments
Q3: Why does predicate sense matter?
The same verb evokes different frames, and the frame determines which roles are licensed