Dependency parsing for quote extraction

Description

Using sentence grammar to find statements with specific structures, such as first-person evaluations of features or negated intentions, and extract them as candidate quotes.

A dependency parser links each word to its grammatical head (subject, object, modifier, negation). This lets a researcher search for structures rather than keywords: sentences where 'I' is the subject of an evaluative verb whose object is a product feature, statements with negated modal verbs ('I wouldn't trust'), or comparisons ('better than'). spaCy's DependencyMatcher implements these patterns. Compared with keyword search, structural matching captures who did what to what and handles negation properly. Rigour comes from testing patterns on annotated samples, measuring precision of extracted quotes, and always presenting extractions as candidates that analysts verify in context.

Attributes

Loss type
Unmigrated
Effort
Days

Steps

  1. Define the statement types you need (e.g. first-person evaluations, negated intentions, comparisons, requests).
  2. Inspect example sentences with displacy to see their dependency structures.
  3. Write DependencyMatcher patterns for each statement type, including negation handling.
  4. Run patterns on 200 or more held-out sentences and measure precision (aim for 0.80 or above) and estimated recall.
  5. Extract matches with speaker, transcript ID and timestamp, and surrounding context of 1-2 sentences.
  6. Have an analyst verify each candidate quote against its context before it enters a report.

Sources

  • spaCy (en_core_web_trf transformer model)
  • spacy-transformers
  • textacy
  • displacy visualisation
  • Tesnière, L. (1959) Éléments de syntaxe structurale
  • Nivre, J. (2008) Algorithms for deterministic incremental dependency parsing. Computational Linguistics
  • Jurafsky, D. & Martin, J. H. Speech and Language Processing, 3rd ed. draft
  • The Inquiry Series, C10 — spaCy — Building NLP Pipelines for Qualitative Research

Also known as

  • Syntactic quote mining
  • Parse-based statement extraction

Categories

  • Analytics & Behaviour
  • Computational & Machine Learning