Research
COVID-19 semantic drift
Exploring how the pandemic changed the meaning of words, through Wikipedia
I built a pipeline that processes English Wikipedia from before and during the pandemic, and trained three kinds of word-meaning models to explore how COVID-19 vocabulary changed.
Result
"Lockdown" moved from pro-wrestling words in 2019 to pandemic words by 2021
Role
Solo project (DSA4213)
Period
Aug 2025
Stack
Python, Gensim, NumPy, SciPy, Scikit-Learn, BeautifulSoup, wikitextparser, Matplotlib
In short
Word embedding models learn what a word means from the words that usually appear around it. After training on enough text, words that are used in similar ways end up close to each other, so "flu" sits near "influenza" and "downturn" sits near "recession".
I trained these models on English Wikipedia from January 2019, September 2020 and January 2021, and compared the closest words to "lockdown", "pandemic" and a few others in each year. The biggest change was in "lockdown". In 2019 its closest words were about pro wrestling, and by 2021 they were about the pandemic.
What changed between the years
Closest words, year by year
Pick a method and a word.
Jan 2019
Sep 2020
Jan 2021
Highlightedwords are tied to COVID-19. Bars show similarity from 0 to 1 within each year's model.
"Lockdown"
Before 2020, Wikipedia mostly used "lockdown" as the name of a pro-wrestling event, so its closest words were wrestlers' names (Roode, Lashley, Mysterio) and wrestling terms. By 2021, all five of its closest words were related to the pandemic. The September 2020 model is somewhere in between: "curfew" and "pandemic" appear, but wrestling words are still at the top.
"Pandemic"
In 2019, the words closest to "pandemic" were earlier outbreaks: flu, influenza, epidemic, ebola and zika. In 2020 and 2021, "coronavirus" and "covid" were the top two, and "lockdowns" was added in 2021. "Covid" wasn't common enough in 2019 to be in the vocabulary at all.
Words that didn't change
Some words had the same neighbours in all three years. "Recession" was closest to "downturn" every year, "distrust" to "mistrust", and "vaccine" to "vaccines" and "vaccination". Since these stayed the same, the changes above are less likely to be noise from training three separate models.
What I built
Wikipedia is large and I was working on one machine with 16 GB of memory and no GPU. Most of the work went into a pipeline that processes the data in pieces, without ever loading all of it into memory.
- Download. Stream 48 GB of compressed Wikipedia across the three snapshots, and resume if a download gets interrupted.
- Filter. Read the files one article at a time and keep the ones about health and society, using 340 keywords in 14 groups. This kept 2.7 million of the 17.7 million articles.
- Clean. Remove the markup and split the text into 143.9 million sentences.
- Count. Count which words appear near each other, in batches saved to disk.
- Train. Train three kinds of embedding model for each year.
- Explore. Find a word's closest neighbours, compare them across years, and plot words in two dimensions.
Comparing the three methods
I trained three kinds of model on the same text, since each one learns word meaning in a different way:
- Skip-Gram learns by predicting the words around each word, one sentence at a time.
- PMI with SVD builds a table of which words appear together more often than chance, then compresses it.
- GloVe fits word positions to how often each pair of words appears together across the whole corpus. I implemented this one from scratch.
One way to check a model is to see whether it keeps related words together. I used brain diseases and lung diseases for this, since they form two clearly separate groups.
Where each method places words (2021 models)
Words used in similar ways should sit close together. Colours show which group each word belongs to.
Skip-Gram
Skip-Gram separated brain and lung diseases cleanly. On the pandemic words, health and science terms sit on the left, the economy terms at the top, and the COVID-19 terms with "lockdown" and "quarantine" on the right. Its neighbour lists were also the easiest to interpret, and it distinguished words whose usage changed ("lockdown", "pandemic") from words whose usage didn't ("recession", "vaccine"). The examples earlier on this page all come from Skip-Gram.
PMI with SVD
PMI with SVD also separated the two groups of diseases. However, its similarity scores were all very close to each other. All five of the closest words to "vaccine" scored above 0.996, which makes the order of the list not very meaningful. On the pandemic map, "covid", "vaccine" and "pandemic" are grouped closely together, away from all the other words.
Its neighbours for "covid" were mostly policy terms: "combatting", "preparedness" and "bioterrorism" in 2020, and "resurgence" and "famines" in 2021.
GloVe
GloVe gave the weakest results overall. Its closest words to "covid" were unrelated ("decorating", "directx", "biscuits"), its map mixes brain and lung diseases together, and these unrelated words still had similarity scores above 0.95.
Its lists for "pandemic" were more interesting. The 2019 neighbours were past outbreaks ("flu", "smallpox"). In 2020 they were words about responding to the outbreak ("reactions", "proposals", "responses"), and in 2021 they were words like "postponed", "tested" and "recovered". The sixth-closest word to "pandemic" in 2021 was "suicide", which lines up with the mental-health effects reported during the pandemic. Neither of the other two methods showed anything similar.
GloVe uses word counts from the whole corpus instead of going one sentence at a time, which might help it capture broader themes. Since its other results were unreliable, though, I'd treat these as observations to look into further rather than conclusions.
Summary
Skip-Gram worked best for following how a word's usage changes over time. PMI with SVD grouped words well, but its scores weren't useful for ranking neighbours. GloVe was the least reliable, but it was the only method that picked up a social side of the pandemic.
For the technically minded
The pipeline streams the dumps in 128 KiB chunks with byte-range resume, and parses the bzip2-compressed XML incrementally with ElementTree. It keeps words that appear at least 500 times, which is about 60,000 words per year. Co-occurrences within a 10-word window are weighted by 1/distance and accumulated as sparse matrices in batches of 3 million pairs.
Skip-Gram uses Gensim with 150 dimensions and 5 negative samples. GloVe is implemented in NumPy with AdaGrad and the standard weighting function. PMI is shifted, clipped to positive values and factorised with truncated SVD. Each stage is configured through JSON files. All three corpora follow Zipf's law closely, with exponents of 0.931–0.933 and R² of 0.965–0.966. The code is on GitHub.
Limits
- The model for each year was trained separately, and the models weren't aligned with each other. This page compares neighbour lists side by side, but it doesn't measure how far a word moved.
- Wikipedia is written in an encyclopedic style and changes more slowly than everyday language, so it only shows part of the change.
- The keyword filter decides which articles are included, which can affect what the models learn.
- This was a course assignment for DSA4213, not a peer-reviewed study.