SIG: Speaker Identification in Literature via Prompt-Based Generation

Zhenlin Su, Liyan Xu, Jin Xu, Jiangnan Li, Mingdu Huangfu

TL;DR

The paper introduces SIG (Speaker Identification via Generation), a novel prompt-based generative approach for identifying who spoke a given quotation in literary texts. By framing speaker identification as an open-world "classification-by-generation" task, SIG bypasses the error propagation common in traditional pipeline methods and significantly outperforms existing baselines and zero-shot ChatGPT, particularly on challenging implicit and anaphoric quotations.

What Problem Does This Paper Address?

Determining "who said what" in a novel sounds simple for humans, but it is notoriously difficult for machines. The challenge lies in non-explicit quotations, which fall into two categories:

  • Anaphoric: The speaker is referred to only by a pronoun (e.g., She said: "Rather he than I!").
  • Implicit: There is no attribution or speaker mention in the immediate surrounding text at all, requiring a deep, global understanding of the dialogue flow.

Traditional approaches rely on complex pipelines involving Named Entity Recognition (NER) and coreference resolution. However, errors in early stages cascade down, ruining the final speaker assignment. Other methods try to extract the speaker's name directly as a text span from the context, which completely fails for implicit quotes where the speaker's name isn't even on the page. Furthermore, handling "cross-domain" scenarios—where the model must identify characters in a completely unseen novel—remains a major hurdle.

Methods

Instead of extracting spans or running brittle pipelines, the authors treat speaker identification as a text-to-text generation task using a pre-trained encoder-decoder model (BART).

Figure 1: Illustration of our proposed approach SIG. Encoder input and decoder output are formatted according to the designed prompt templates described in Section 3.2. During inference, SIG either generates the speaker directly, or determines the speaker based on the highest generation probability of each candidate.

The core mechanics of SIG include:

  1. Prompt Verbalization: The quotation and its surrounding context are wrapped in a natural language template. For example: Left Context + "Quotation" + replied by <mask_speaker>, is listened by <mask_addressee> + Right Context.
  2. Classification by Generation: To avoid the risk of the model hallucinating names or generating ambiguous fragments (like "Mr. Beaver" vs "Mrs. Beaver"), SIG uses a clever scoring mechanism during inference. It feeds each valid candidate speaker name into the decoder template and calculates its average token generation probability. The candidate with the highest score wins.
  3. Auxiliary Task Integration: Because it uses a flexible prompt structure, SIG easily incorporates multi-task learning. The authors found that forcing the model to simultaneously predict the addressee (the listener) significantly sharpens its attention toward relevant character interactions in the text.

Datasets

The authors evaluated SIG on two primary benchmarks:

  • Project Dialogism Novel Corpus (PDNC): The largest dataset for this task, containing 22 English novels and nearly 36,000 annotated quotations. Crucially, about 66% of these quotes are the difficult non-explicit (implicit or anaphoric) types. It is primarily used to test tough cross-domain generalization.
  • WP (World of Plainness): A dataset based on a single Chinese novel, containing 125 characters and 2,596 quotation instances, used to validate in-domain performance.

Key Insights and Ideas

  • The Power of Cloze-style Alignment: Aligning the fine-tuning format with the model's original pre-training objective (filling in a <mask_speaker> token) unlocks the latent narrative reasoning capabilities of Pre-trained Language Models (PLMs).
  • Open-World Flexibility: Because the model scores candidates based on generation probability rather than selecting from a fixed classification layer, it can seamlessly handle new, unseen characters during cross-domain testing.
  • Not All Auxiliary Tasks Help: While training the model to recognize the addressee or character genders boosted speaker identification accuracy, training it to classify which novel the text came from actually degraded performance. This highlights the need for careful auxiliary task selection.

Key Results

SIG achieved state-of-the-art results on both datasets, showing its strongest advantages in the hardest evaluation settings.

Cross-domain evaluation results on the PDNC dataset
  • Cross-Domain Mastery: On the PDNC dataset, SIG achieved a 72% mean accuracy (78% median) across all quotation types, outperforming the previous best pipeline method, BookNLP+ (68%), and zero-shot ChatGPT (71%).
  • Cracking the Hard Cases: For non-explicit quotations, SIG achieved 70% mean accuracy, representing a massive 17% absolute improvement over BookNLP+ (53%).
  • In-Domain Robustness: On the Chinese WP dataset, SIG achieved 86.15% accuracy, outperforming specialized baseline networks by up to 5.2%.

Limitations and Future Work

The primary limitation acknowledged by the authors is computational resource constraints. Due to hardware limitations, they were unable to fine-tune massive open-source Large Language Models (LLMs) and instead relied on the smaller BART architecture. They note that scaling SIG's prompt-based generation framework up to larger parameter LLMs is a promising direction that will likely yield even higher performance gains.

Summary updated

BibTeX
@inproceedings{su2024sig,
  author = {Zhenlin Su and Liyan Xu and Jin Xu and Jiangnan Li and Mingdu Huangfu},
  title = {{SIG: Speaker Identification in Literature via Prompt-Based Generation}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2024},
  url = {https://openreview.net/forum?id=efhK8sjPOy},
}
Figure