Week 1 – Introduction
2026-11-09
Who are you?
When and where?
Who?
But you will see me again: 2 other classes in S2
Today, the programme is a bit different:
Details to be expanded (TBD with Thomas).
| Session | Instructor | Topic |
|---|---|---|
| 1 | JD | Introduction to text as data and Python |
| 2 | JD | Data collection and web scraping |
| 3 | TR | Natural language processing |
| 4 | TR | Central bank communication |
| 5 | TR | Sentiment analysis |
| 6 | JD & TR | Project presentations |
Learn how to turn unstructured textual data into meaningful quantified metrics
Corpora (plural of corpus): a Latin word often used to describe a collection — a database — of texts, with or without their metadata.
Recent developments have changed this.
New and more data
More feasible to collect the population rather than a sample
New methods and computing power
Allows to train more complex models, and to reduce their cost for researchers (e.g. the advent of LLMs in research)
Two promises of the growing availability of big (textual) data:
1. Empirical
2. Methodological
1. Empirical: big data ≠ rich data
2. Methodological: big ≠ representative
The payoff lies in combining designed and organic data, not in one type alone (Groves, 2011).
This does not mean your approach should be purely deductive, nor that you shouldn’t pivot during the project! See principle 3.
Try to ask yourself these questions
Source: Grimmer et al. (2022, p. 15).
Central bank speeches often summarized by their topic, sentiment, complexity
A broad dictionary-based screening step designed to maximize recall (minimizing false negatives), followed by LLM-based classification to improve precision.
Two questions:
Game 1
From recently published paper titles, can you guess the text data used by the authors?
Game 2
For each type of actor, what text traces can we find that may be useful to researchers?
Game 3
From research questions, find relevant data sources to tap into
Journal of Labor Economics · Vol. 40 · No. S1 · 2022
Artificial Intelligence and Jobs: Evidence from Online Vacancies
Daron Acemoglu
David Autor
Jonathon Hazell
Pascual Restrepo
We study the impact of artificial intelligence (AI) on labor markets using establishment-level data on the near universe of online vacancies in the United States from 2010 onward. There is rapid growth in AI-related vacancies over 2010–18 that is driven by establishments whose workers engage in tasks compatible with AI’s current capabilities. As these AI-exposed establishments adopt AI, they simultaneously reduce hiring in non-AI positions and change the skill requirements of remaining postings. While visible at the establishment level, the aggregate impacts of AI-labor substitution on employment and wage growth in more exposed occupations and industries is currently too small to be detectable.
What text data did they use?
The Quarterly Journal of Economics · Vol. 141 · Issue 1
Ideas Have Consequences: The Impact of Law and Economics on American Justice
Elliott Ash
Daniel L. Chen
Suresh Naidu
This article empirically studies the effects of the early law and economics movement on the U.S. judiciary. We focus on the Manne Economics Institute for Federal Judges, an intensive economics course that trained almost half of federal judges between 1976 and 1999. Using the universe of published opinions in U.S. Circuit Courts and 1 million District Court criminal sentencing decisions, we estimate the within-judge effect of Manne program attendance. Selection into attendance was limited, as the program was popular among judges of all backgrounds, frequently oversubscribed, and admitted participants on a first-come, first-served basis. We find that after attending economics training, participating judges use more economics language in their opinions, rule against regulatory agencies more often, and impose more severe criminal sentences. We argue that economics, as a rigorous social science, was especially effective in persuading judges. JEL codes: D7, K0, Z1.
What text data did they use?
The Quarterly Journal of Economics · Vol. 141 · Issue 1
Enlightenment Ideals and Belief in Progress in the Run‑up to the Industrial Revolution: A Textual Analysis
Ali Almelhem
Murat Iyigun
Austin Kennedy
Jared Rubin
We trace the evolution of the language of science, religion, and political economy in the centuries leading to the British Industrial Revolution. Using textual analysis of 264,443 works printed in England between 1500 and 1900, we test whether British culture manifested a belief in progress associated with science and industry. Our analysis yields three main findings. First, there was a separation in the languages of science and religion beginning in the mid-eighteenth century. Second, volumes using language at the nexus of science and political economy became more progress-oriented during the Enlightenment. Third, volumes using industrial language—especially those at the science-political economy nexus—were more progress-oriented beginning in the eighteenth century. JEL codes: C81, C88, N33, N63, O14, Z11.
What text data did they use?
The Review of Economic Studies · 2026 · doi:10.1093/restud/rdag014
Narratives about the Macroeconomy
Peter Andre · Ingar Haaland · Christopher Roth
Mirko Wiederholt · Johannes Wohlfart
We study narratives about the macroeconomy—the stories people tell to explain macroeconomic phenomena—in the context of a historic surge in inflation. In our empirical analysis, we field surveys with more than 10,000 US households and 100 academic experts, measure economic narratives in open-ended questions, and represent them as Directed Acyclic Graphs. Households’ narratives are strongly heterogeneous, coarser than experts’ narratives, focus more on the supply than demand side, and often feature politically charged explanations. Moreover, narratives shape how households form inflation expectations and interpret new information, which we demonstrate in a series of experiments. Informed by these findings, our theoretical analysis incorporates narratives into an otherwise conventional New Keynesian model and demonstrates their importance for aggregate outcomes through their effect on agents’ expectations.
What text data did they use?
American Economic Review · Vol. 116 · No. 10 · October 2026
Fighting for Growth: Labor Scarcity and Technological Progress during the British Industrial Revolution
Hans-Joachim Voth
Bruno Caprettini
Alex Trew
We establish a link between labor scarcity and the adoption of laborsaving technology in industrializing England. During the Napoleonic Wars, more than 10 percent of the male population served in the armed forces. Where recruitment was heavy, more machines economizing on labor were adopted. Naval recruitment, instrumented by warships’ coastal access, provides exogenous variation in labor scarcity and suggests that the link between labor shortages and adoption is causal. Where mechanical skills were abundant, the impact of labor scarcity on adoption appears to be larger. JEL codes: J24, N13, N43, N63, N73, O14, O31.
What text data did they use?
Companies / producers
Policymakers / regulators
Consumers / workers
Documenting political pressures on a central bank beyond its de jure independence
Differentiating doves vs hawks by characterizing central bankers’ policy preferences
How do markets react to central bank communication?
Do political connections matter in finance?
Save your work in Google Drive: files uploaded to a Colab session are deleted when it stops.
!pip install# Install a library (in a code cell)
!pip install pypdf
# Access your Google Drive
from google.colab import drive
drive.mount("/content/drive")
# Your files are then here
path = "/content/drive/MyDrive/"Comment your code! In code cells, anything after # is ignored (Ctrl + / or ⌘ + / toggles it). Between cells, text cells explain each step. Say why, not only what.
year = 2026 # int
rate = 2.25 # float
bank = "ECB" # str
hawkish = rate > 2 # bool: True
banks = ["ECB", "Fed", "BoE"] # list: ordered, starts at 0
banks[0] # "ECB"
rates = {"ECB": 2.25, "Fed": 4.00} # dict: key → value
rates["Fed"] # 4.0
type(rates) # dictprint() shows a value; type() tells you what it isendfor loops over any collection (lists, dict keys, rows…)def creates reusable functions: you will write many for textimport pandas as pddf.head() # first 5 rows
df.shape # (number of rows, number of columns)
df.columns # column names
df.dtypes # type of each column
df.info() # types + missing values
df.describe() # summary statistics of numeric columnsAlways look at your data before analyzing it: how many documents, which period, which variables, what is missing?
df["company"] # one column (a Series)
df[["company", "date"]] # several columns
df[df["year"] >= 2020] # rows that meet a condition
df[(df["year"] >= 2020) & (df["sector"] == "Banks")]
df.sort_values("date") # sort
df["company"].value_counts() # how many rows per company
df.groupby("year")["n_words"].mean() # average by groupdf["date"] = pd.to_datetime(df["date"]) # text → date
df["year"] = df["date"].dt.year # extract the year
df["n_words"] = df["text"].str.split().str.len() # words per document
df["mentions_ai"] = df["text"].str.contains("artificial intelligence", case=False)
df["mentions_ai"].mean() # share of documents mentioning AI.str gives you string methods on a whole column: lower(), contains(), replace(), len()…Load the earnings calls dataset you will work on for the rest of the year
userdata.get("MY_KEY")Jérôme Deyris & Thomas Rigou | Applied Data Science in Finance | Week 1