Skip to content
AI360Xpert

Semantic Role Labeling

Semantic role labeling identifies the predicate in a sentence and its arguments, answering "who did what to whom, where, and when?".

Semantic role labeling parses 'The agent sold the house yesterday' into [ARG0: The agent] [V: sold] [ARG1: the house] [ARGM-TMP: yesterday].
Semantic role labeling parses 'The agent sold the house yesterday' into [ARG0: The agent] [V: sold] [ARG1: the house] [ARGM-TMP: yesterday].

Why Does This Exist?

Semantic role labeling (SRL) identifies the predicate in a sentence and its arguments, answering "who did what to whom, where, and when?". Standard syntax trees tell you which words modify which other words, but they don't tell you what those relationships actually mean in the real world. If you say "The window was broken by John" and "John broke the window", the syntax trees are completely different (passive vs. active voice), but the underlying event is identical: John is the breaker, the window is the thing broken.

Without semantic roles, downstream applications like question answering or information extraction have to learn the equivalence of active and passive voice, or dative shift ("gave her the book" vs "gave the book to her"), purely from examples. SRL provides a standardized, shallow semantic representation that normalizes these syntactic variations. It isolates the core event and explicitly tags the participants, making it much easier for a system to extract structured facts from unstructured text.

Think of It Like This

A police incident report

Imagine you are a police officer filling out an incident report form. The form has specific blanks: "Perpetrator", "Action", "Victim", "Time", and "Location".

When witnesses describe the event, one might say: "A man stole a car last night at the mall." Another might say: "Last night, the car was stolen by a man at the mall."

No matter how the witnesses phrase their sentences, your job is to extract the exact same information and put it into the same blanks on the form:

  • Action (Predicate): Stole
  • Perpetrator (Agent/ARG0): A man
  • Victim (Patient/ARG1): a car
  • Time (ARGM-TMP): Last night
  • Location (ARGM-LOC): at the mall

Semantic role labeling is the automated process of taking raw sentences and filling out these standardized "forms" for every verb or event in the text.

How It Actually Works

SRL is traditionally framed as a pipeline of several distinct classification tasks, though modern neural architectures often perform these jointly. The goal is to map spans of text to a predefined set of semantic roles, typically defined by ontologies like PropBank or FrameNet. PropBank, the most common standard, uses numerical arguments (ARG0, ARG1, etc.) whose exact meaning depends on the specific verb, but generally follow a pattern: ARG0 is usually the agent/doer, ARG1 is the patient/undergoer.

1. Predicate Identification

The first step is simply finding the events in the sentence. This usually means identifying the verbs (and sometimes eventive nouns like "the destruction of the city"). A sentence can have multiple predicates, and the SRL process is repeated independently for each one. In "The dog barked and chased the cat", both "barked" and "chased" are predicates that will have their own distinct argument structures.

2. Argument Identification

Once a predicate is fixed, the system looks at all other spans of text (often constituents from a syntax tree) and makes a binary decision: is this span an argument for the current predicate, or is it unrelated? This prunes the search space, discarding words that don't participate in the event.

3. Argument Classification

For the spans identified as arguments, the system assigns a specific semantic role label.

  • Core Arguments: ARG0 (typically the Agent), ARG1 (typically the Patient/Theme), ARG2 (Instrument, Benefactive, Attribute), up to ARG5.
  • Modifier Arguments (Adjuncts): These describe the context of the event and apply across different verbs. Common ones include ARGM-TMP (Temporal: when?), ARGM-LOC (Locative: where?), ARGM-MNR (Manner: how?), and ARGM-NEG (Negation).

4. Joint Inference

Finally, because the classifications are made somewhat independently, the system might produce conflicting labels (like assigning two different spans as ARG0 for a verb that only takes one agent). Joint inference applies structural constraints (e.g., arguments cannot overlap, core roles typically appear only once per predicate) to find the globally optimal, valid assignment of roles.

Code

Here is a simplified example using the allennlp library, which provides a pre-trained neural SRL model. The model takes a sentence and outputs the extracted verbs and their arguments in a structured format.

# Note: This is pseudocode representing the output of a typical SRL model APIfrom typing import Dict, List, Any
def run_srl(sentence: str) -> List[Dict[str, Any]]:    # Mocking the output of a standard SRL model for the sentence:    # "Yesterday, the company reported its earnings."    return [        {            "verb": "reported",            "description": "[ARGM-TMP: Yesterday] , [ARG0: the company] [V: reported] [ARG1: its earnings] .",            "tags": ["B-ARGM-TMP", "O", "B-ARG0", "I-ARG0", "B-V", "B-ARG1", "I-ARG1", "O"]        }    ]
results = run_srl("Yesterday, the company reported its earnings.")
for result in results:    print(f"Predicate: {result['verb']}")    # -> Predicate: reported        print(f"Structure: {result['description']}")    # -> Structure: [ARGM-TMP: Yesterday] , [ARG0: the company] [V: reported] [ARG1: its earnings] .

The output shows exactly how the model partitions the sentence into the core action ([V: reported]), the entity doing the reporting ([ARG0: the company]), the thing being reported ([ARG1: its earnings]), and the temporal context ([ARGM-TMP: Yesterday]).

Watch Out For

Assuming ARG0 is always the subject

It is tempting to map ARG0 directly to the grammatical subject of the sentence, but this falls apart immediately with passive voice. In "The cake was eaten by Mary", the grammatical subject is "The cake", but Mary is the agent (ARG0), and the cake is the patient (ARG1).

Furthermore, some verbs map arguments differently. For example, verbs of psychological state like "fear" vs "frighten" map the experiencer to ARG0 in one case ("I fear dogs") and ARG1 in the other ("Dogs frighten me"). Always rely on the predicate's specific definition in the semantic ontology (like PropBank) rather than surface syntax.

Multiple predicates in one sentence

A single sentence with multiple verbs will yield multiple, overlapping role structures. In "She promised to call him", "She" is ARG0 for the verb "promised", but "She" is also implicitly ARG0 for the verb "call", even though it appears earlier in the sentence.

When building downstream applications, you must process the argument structure for each predicate independently. If you only look at the roles for the main verb, you will miss the semantic relationships associated with all subordinate clauses and infinitives.

The Quick Version

  • Semantic role labeling extracts the "who, what, where, when, and how" from a sentence by identifying predicates and their arguments.
  • It provides a shallow semantic representation that normalizes syntactic differences, mapping active and passive voice to the same underlying event structure.
  • The process involves finding the predicate (usually a verb), identifying the text spans that serve as its arguments, and classifying those spans into specific roles (like ARG0, ARG1, ARGM-TMP).
  • Common ontologies like PropBank define these roles, where core arguments (ARG0-5) are verb-specific, and modifier arguments (ARGM-*) describe general context.
  • A single sentence can contain multiple predicates, each with its own independent set of semantic roles and arguments.