BASC0005 Quantitative Methods 2: Data Science and Visualisation
Ollie Ballinger
Outline
Case Study: The Grammar of Police Shootings
Natural Language Processing
Analysing Text
The Curious Grammar of Police Shootings
Civilian shoots Civilian
On February 10, 2014, around 6:10 p.m., the victim was in the parking lot in the 13640 block of Burbank Boulevard, to the rear, when he was confronted by the suspect. The suspect produced a semi-automatic handgun and fired numerous times striking the victim in the torso.
When the officers arrived they were confronted by a Hispanic male armed with a sword. The officers attempted to take the suspect into custody by using a taser but it was ineffective. The suspect then ran towards the officers still armed with the sword and an officer-involved-shooting occurred.
This paper studies the language used in television news broadcasts to describe police killings in the United States from 2013-19
Data on: 6,000 police killings, 8,000 non-police homicides, 200,000 stories, and 470,000 sentences that describe the killings.
Four dimensions of potential obfuscation relative to an active sentence in which a police officer is the subject
(‘police officer killed man’)
Main Findings
The media is significantly more likely to use several language structures - e.g., passive voice, nominalization, intransitive verbs - that obfuscate responsibility for police killings compared to civilian homicides
There is some obfuscation in 35.6% of stories about police killings, compared to 28.8% for civilian homicides
News broadcasts are especially likely to use obfuscatory language structures when the decedent was unarmed or when body camera video is available.
Survey participants (n=2,402) are less likely to hold a police officer morally responsible for a killing and to demand penalties after reading a story that uses obfuscatory language.
Words used in similar contexts get similar numbers. Language models learn a vector like this for every token during pretraining.
Step 2: Post-training
Fine-tuning: imitate example conversations written by people
RLHF: people rank answers; a reward model learns their taste; the LLM chases high scores
the reward model is a text classifier — like sentiment analysis (later today)
Constitutional AI (Anthropic): the model critiques itself against written principles
Why this matters for you
Bias: a model trained on text learns its framing
if news writes “officer-involved shooting”, so will the model
Hallucination: trained to be plausible, not true
Whose text? Consent, copyright, English dominance
Next: how does a model represent meaning? → Embeddings (Week 9)
Generated by our Exxon bigram model:
“our most active research and work program yielded billion to lower cycle approach and there’s insufficient supply bill oil is really key metrics…”
Fluent-ish. Confident. Meaningless.
Bias in LLMs: same CV, different letter
Wan et al. (2023) asked ChatGPT for reference letters for matched men and women
Kelly: “a respected and well-liked member”
Joseph: “a natural leader and role model”
Measured with today’s tools: spaCy, sentiment classifiers, odds ratios, t-tests
Men’s letters: more agentic language (t = 10.5, p < 10⁻²⁵) and more positive
The model reproduces the bias in the letters people wrote
Odds that trait words appear in letters for men vs women (ChatGPT, 120 letters). Source: Wan et al. 2023, Findings of EMNLP, Table 2.
Analytical Approaches
Types of Text Analysis
The Statistical Features of the Text
Word frequency
Word proximity
Topic modelling
Language Processing
Entity extraction (Named Entity Recognition)
Semantic analysis
Sentiment analysis
Word Frequency
Sentiment Analysis
Sentiment analysis or opinion mining is the computational study of people’s opinions, sentiments, emotions, appraisals, and attitudes towards entities such as products, services, organizations, individuals, issues, events, topics, and their attributes
Uses ‘weighted’ dictionaries of words to assess how ‘positive’ or ‘negative’ a text might be
One of the fastest-growing areas of NLP research
But, beware the black box
Social Media Data
Tumasjan et. al., ‘Predicting Elections with Twitter: What 140 Characters Reveal about Political Sentiment’
Social Media Data