News text is abundant but unstructured, and models cannot consume it directly. Our task is to turn it into a signal for early warning — numbers that are consistent across countries, comparable through time, and available every month.
The text topics do this in two steps. We reduce every article in the EconAI news corpus to the themes it is made of, then aggregate those themes into two monthly series for each country: how much is being written about it, and what that writing is about. The result is a country-month panel that runs from Jan 1989 to the present and has a value for every country in every month. These series feed several EconAI research projects, including forecasting of armed-conflict and de-democratization events.
At a glance
The fifteen topics, and the words the model considers most characteristic of each, in rank order as at the snapshot date. The labels are ours since the model produces only the words.
| Topic | Label | Most characteristic words |
|---|---|---|
| 0 | International Politics | peace, UN, sanctions, conflict, ceasefire, nuclear, warn, negotiation |
| 1 | Diplomacy | cooperation, summit, tie, discuss, strengthen, bilateral, EU, affair |
| 2 | Military | defence, drone, missile, air, strike, defense, weapon, troop |
| 3 | Energy Politics | energy, project, oil, water, gas, supply, climate, plant |
| 4 | Business | growth, product, industry, consumer, export, sale, key, forecast |
| 5 | Judiciary and Abuses | court, arrest, charge, crime, investigation, prison, legal, criminal |
| 6 | Economics | tariff, bank, economy, billion, rate, tax, fund, cost |
| 7 | Health and Emergency | health, child, school, student, university, patient, education, medical |
| 8 | Financial Markets | percent, stock, yen, index, share, investor, rise, fall |
| 9 | Technology | global, AI, technology, digital, platform, solution, industry, investment |
| 10 | Politics and Democracy | election, opposition, vote, parliament, protest, democratic, online, house |
| 11 | Armed Conflict | army, strike, militant, hama, civilian, operation, taliban, province |
| 12 | Competition and Sports | game, team, cup, match, player, test, ball, score |
| 13 | Civilian Life | family, feel, life, young, woman, story, turn, old |
| 14 | Crisis and Accidents | flight, air, airport, resident, cause, travel, emergency, near |
What a topic is
A topic is a collection of words found to occur together frequently. More precisely, a topic is a weighting of the entire vocabulary: every one of our terms carries a number saying how likely it is to appear when that topic is being written about. For the vast majority of terms that number is essentially zero. The handful carrying real weight are what the topic is about, and they are what the table above shows.
As an illustration, one topic might place its weight on troop, offensive, ceasefire and front line, while another places it on bond, investor, yield and index. A term can carry weight in more than one topic: strike could belong to both industrial disputes and to air strikes, and the model settles which is meant in a given article from the company the word keeps.
An article, in turn, is not written from a single topic. The model asks the reverse question: which blend of the fifteen topics best explains the words this article actually contains? The answer is the article’s topic shares i.e. fifteen numbers that sum to one.
These are the two directions, and together they are the whole model: a topic is a recipe over words, and an article is a recipe over topics. Both are learned at the same time, from the words alone. The method is entirely unsupervised: nobody hand-labels an article, and nobody tells the model what the topics ought to be.
Two things follow. Every article carries a share of all fifteen topics, so what we measure is a composition, the balance of themes, rather than a count of articles per category. And because the model only ever produces word lists, the labels in the table above are ours, written by reading those lists. They are a convenience for the reader; the word lists are the real definition.
Finally, average those article shares over every article written about a country in a given month — weighting long articles more heavily than short ones — and you arrive at the statement this document exists to support: “xx% of the news written about country X in month Y was on topic Z.” Note that this is a share of the text written about a country, not a share of the articles.
We fix the number of topics at 15. The algorithm is the gensim implementation of LDA, and the settings we pass to it are listed in Appendix A.
How it works, end to end
Four steps take an article and turn it into a monthly number for a country. Each has its own section below, in this order.
| Step | Goes in | Comes out |
|---|---|---|
| 1. Preprocessing | An article’s title, snippet and body | The article as a tally of vocabulary terms — a bag of words |
| 2. Topic model (LDA) | Every article in the corpus, as a bag of words | The 15 topics — a word list each — and, for every article, its 15 topic shares |
| 3. Country-month | Article topic shares, and which country each article is about | Two raw monthly series per country: how much was written, and what it was about |
| 4. Stocks | Those two raw series | The same two series, gap-free and carrying a fading memory of recent coverage |
From articles to words
Before the model sees an article, the text is reduced to a list of terms. This step does a lot of quiet work, and the choices in it shape every topic above.
We take an article’s title, snippet and body together and process them as one piece of text:
-
Tidy the characters. Non-breaking spaces, curly quotes and long dashes are converted to their plain equivalents, runs of whitespace are collapsed, and web addresses, email addresses and bare domain names are removed.
-
Split the words on whitespace, stripping possessives and any punctuation around the edges of each word.
-
Reduce each word to its dictionary form. Describes, described and describing all become describe, so they are counted as one term rather than three. We use the spaCy English lemmatiser for this.
-
Remove words that carry no thematic signal. This is the heaviest intervention in the whole pipeline; roughly 12,000 terms across thirteen curated lists, deleted before the model sees a word of the article. They fall into four groups:
- Filler: Ordinary English function words (and, however, beyond), spelled-out numbers, lone letters, courtesy titles (Mr., Dr.) and calendar words (year, Jan, Feb).
- Geography: countries, including historical names such as Ceylon; nationalities (Iraqi, Ukrainians); regions (Asia, South America); and every populated place above 100,000 people, with its alternative spellings.
- People: First and family names, and named public figures (Nixon, Maduro).
- The machinery of news: The wire services and outlets themselves (Agence France Presse, Xinhua, Kyodo), and words describing medium rather than the story (edition, radio).
- The last two groups matter as much as the first. Place names are removed because we separately allocate countries to an article via Named Entity Recognition (see our corpus page for more details), and leaving them in would produce topics that simply rediscover geography. Names and outlets are removed for the same reason; if included, the model would learn topics organised around who is famous and which agency filed the copy. The full breakdown is in Appendix B.
-
Drop anything with a digit in it, and anything with no letters. Dates, figures and stray punctuation are not terms.
-
Keep acronyms in capitals. All-capital runs of up to four letters are preserved as written, and dotted or hyphenated forms have their punctuation removed. For example U.N. becomes UN and N.A.T.O becomes NATO.
The order matters: phrases are removed before single words, and both before the digit and punctuation filter. That is what stops a phrase being half-deleted.
How the lists are applied. Matching is not a plain word-by-word lookup. Around 660 entries are phrases (e.g. Rio de Janeiro, South America) and are removed as whole spans, with the longest match winning. Most entries are case-sensitive, so Trump the person is removed while trump the verb survives, and Nice the city is not confused with nice; ordinary filler is matched regardless of case. Case-insensitive matching is done on the dictionary form, so the single stopword describe also catches describes and described, while case-sensitive entries are matched as written since reducing Trump to trump would defeat the point.
Phrases, not just words. Meaning often lives in word pairs, for example central bank is not central plus bank. So after the steps above we also form every adjacent two-word (bigram) and three-word (trigram) combination, and treat those as terms in their own right alongside the single words (unigram).
Building the vocabulary. Finally we filter on extremes: a term must appear in at least 1,000 articles and in no more than 10% of them. This leaves a vocabulary of roughly 240,000 terms. The vocabulary is rebuilt once a year over the full history.
An article is then represented as a simple tally of how many times each vocabulary term appears in it. Order and grammar are discarded; this is what is meant by a bag of words. Articles left with fewer than five vocabulary terms are dropped.
How the model is built, and why it has vintages
A vintage is one monthly state of the topic model, labelled by the last month of news it has read. The 201002 vintage is what the model believed having seen news only up to February 2010 — and under it, every article in the corpus, back to 1989, carries a set of topic shares.
We keep one vintage for every month. That is the central design choice of this pipeline; the rest of this section is how they are made, and why there are so many.
The burn-in fit. We first fit a model from scratch on 35 years of news, 1989-01 to 2009-12. The length is deliberate, for two reasons.
The first is statistical. LDA infers topics from which words co-occur, and a topic is only sharply identified once the model has seen its vocabulary used across a great many different contexts. Fitted on a short window, topics come out unstable, sensitive to the random seed, and liable to organise themselves around whatever happened to dominate the news in that particular window. A model fitted on 2008 and 2009 alone would hand back a set of topics shaped by the financial crisis. A long window also spans several eras of news language, which matters because the model has to score articles from every one of them.
The second is that this is the only fit that ever happens. Every later month merely nudges the model, so the topics that come out of the burn-in are, in substance, the topics carried by every vintage that follows it. Nothing downstream would correct a poorly identified starting point, so the starting point is given all the history we have.
Monthly updates. From 2010-01 we move forward one month at a time. Each month we load the previous month’s model and call gensim’s LdaMulticore.update() on that month’s articles alone. The model is never restarted and never refitted — it is nudged. This is online variational Bayes: the word weights defining each topic are revised in the light of the new documents.
Re-scoring the whole archive. After each update we take the resulting model and infer topic shares for every article we hold, back to 1989 — not only the new ones.
1989-01 … 2009-12 ────fit────► M(fit)
│
▼
+ 2010-01 ──update()──► M(201001) ──score every article──► vintage 201001
+ 2010-02 ──update()──► M(201002) ──score every article──► vintage 201002
+ 2010-03 ──update()──► M(201003) ──score every article──► vintage 201003
⋮ ⋮ ⋮
Each update() reads one month of news and leaves the topics slightly changed.
Each score re-runs inference over the whole corpus, 1989 to the present.
Why re-score everything, every month? Because update() changes the model. The change is small, but it is real: the words defining topic 3 in 201002 are not quite the words defining topic 3 in 201003. If we scored only the new articles and appended them to the ones we had, a country’s topic-3 series would be a patchwork of articles scored under hundreds of slightly different models. Re-inference removes that. Within a single vintage every article, 1989 onward, has been scored by exactly the same model. This ensures the series is internally consistent over its whole length. That consistency is what re-scoring the entire archive every month buys, and it is by far the most expensive step in the pipeline.
Why keep every vintage? Because forecasting models are tested by walking forward through history. Stand at a month, predict what comes next, step on, repeat. The test is only honest if everything the model sees at each step was available at that step.
Take the step at 2015-06. The forecast may use every article published up to that month (~40 years of them) and nothing published after. Vintage 201506 is exactly that: all articles from 1989 to 2015-06, scored by a model that has itself read news only up to 2015-06. Step forward and you switch to 201507, which adds one more month of articles and one more update() to the topics.
The second half of that is the part that is easy to miss. Taking the latest vintage and dropping the rows after 2015-06 is not the same thing: the topics in 202512 were learned from news through 2025, so even a 1995 article scored under it carries traces of what the press would go on to write. The vintage has to be the one that existed at the time, not the current one trimmed back to it.
Descriptive work wants the opposite — the latest vintage, so the whole history is read by one consistent and best-informed set of topics. A single article therefore has many topic vectors, one per vintage, and they differ. Fix the one that matches your question, and stay in it.
Once a year we start again. The burn-in fit is re-run from scratch annually, along with the vocabulary, and the whole history of vintages is rebuilt. Each such annual re-fit is a new generation of the topics — the generation field that indexes the published data (see Accessing the data). Starting over keeps the topics from drifting too far from contemporary language, at a price: the topics are re-estimated, so topic 3 in one generation is not topic 3 in the next.
From articles to countries
The model works on articles. Our research needs country-months. Bridging the two takes two decisions.
Which country an article belongs to. We use the corpus’s canonical country assignment, the same rule that feeds the ConflictForecast and Institutional Disruption models which considers where in the article a country is named, and applies source-specific rules, rather than counting every passing mention. That rule is described in more detail at our corpus page. A single article can contribute to many countries.
How to combine the articles. Within a country-month we average the article topic shares, weighting each article by its length in tokens, so a 2,000-word investigation counts for more than a 200-word wire brief.
Writing for the set of articles assigned to country in month , for article ‘s share on topic , and for its token count, the total volume of text is
and the topic composition is
where and .
The terms are a smoothing device. Without them, a country-month resting on a single short article would simply inherit that article’s own topic shares. One report on a plane crash would make the country’s entire month 90% one topic, a number that looks exactly like the same 90% computed from five thousand articles. Adding to each topic and to the denominator is equivalent to mixing in 50 tokens of perfectly neutral text, spread evenly across the topics (our prior).
Table — what smoothing does to a 90% share. The same raw share, in country-months of different size.
| Tokens in the country-month | A raw 90% share becomes |
|---|---|
| 1,000,000 | 90.0% |
| 1,000 | 86.0% |
| 200 | 73.3% |
| 50 | 48.3% |
| 20 | 30.5% |
The correction bites hardest exactly where the evidence is thinnest, and fades to nothing where it is thick. The neutral value it pulls towards is , and the shares still sum to one exactly.
This gives us two raw monthly series per country: , the volume, and , the composition.
From months to stocks
Countries do not always appear in the international news every month. This means the raw monthly series are noisy and full of holes, and a series like that cannot be fed to a model.
So we stop treating a month as a standalone observation and treat it as a flow. What matters at month is not just what was written in that month alone, but also what has been written lately, with recent coverage counting for more than old coverage. That quantity is a stock: the present value of the entire past flow, each earlier month discounted according to how long ago it was. The discount is a constant per month.
The token stock. Writing for the tokens country received in month as the flow, then the stock (present value) at month is defined as:
The current month’s coverage enters at full weight, the previous month’s at , the one before at , and so on. Equivalently, computed one step at a time,
The topic stock. The same idea applied to the topic shares with one addition. A month should count in proportion to how much was written in it, so that a quiet month does not move the picture as much as a loud one. Each month’s composition is therefore weighted by that month’s token flow:
The numerator is the present value of the flow of tokens attributed to topic ; the denominator is the token stock. The ratio is therefore a discounted, volume-weighted average of the country’s past compositions. Again there is a one-step form:
Because it is a weighted average of quantities that each sum to one, also sums to one across the fifteen topics in every month. It remains a composition, directly comparable across countries and across time.
Filling the gaps. The recursion runs over a complete monthly calendar for every country, from 1989 to the vintage date, not over the months that happen to have news. This matters more than it looks. If we ran it only over months with articles, a country silent for six months would have its stock multiplied by once instead of . This means quiet countries would decay more slowly than busy ones, purely as an artefact. On the full calendar, a month with no news is a flow of zero and the discount always tracks elapsed time. Countries enter the calendar when they come into existence, for example South Sudan’s series begins in 2011, not 1989.
Before a country’s first ever article there is no coverage to average, and is set to the neutral value for every topic. After that the recursion takes over. The result is a complete, gap-free monthly series for every country, which is what makes these usable as model inputs.
Figure — raw share against the stock, for one country. The share of a country’s news on a single topic, month by month. The thin dashed line is the raw monthly share; the thick line is the stock.

The thin line is the raw monthly share. It jumps around from month to month, and much of that movement is small-sample noise, since a thin month may rest on only a handful of articles. The thick line is the stock — the smoothed version we actually use. It irons out those swings while still turning decisively when the country’s coverage genuinely changes theme.
The stock forms a better input to a machine-learning model for three reasons.
- Signal over noise: much of the raw month-to-month movement is noise, not genuine changes in the news landscape; the stock strips it out and leaves the movement that reflects real change.
- No gaps: a model needs a value every month, and the stock is defined even in months when a country is absent from the news and the raw share does not exist at all.
- Memory: news attention does not reset at the end of each month, so a feature that carries a decaying trace of recent coverage both matches how news actually behaves and hands the model a more stable, lower-variance input than a single-month snapshot.
Accessing the data
The stock series are published through the EconAI API, one row per country–month. Each row is indexed by two version dimensions — the annual re-fit (generation) and the vintage (as_of_yyyymm) — so a query fixes one re-fit and one vintage and receives the complete monthly series for every country under it (see How the model is built for what these are, and Caveats for how to choose them). The variables below are shared by every combination. For the complete and current list of fields, and how to query, please refer to the API documentation.
Table — country–month schema, shared across every (re-fit × vintage).
| Variable | Description | Data type | Allowed values |
|---|---|---|---|
generation | The annual re-fit that produced the topics. Series from different re-fits are not comparable. | integer | four-digit year (e.g. 2026) |
as_of_yyyymm | The vintage — the last month of news the model had read when this row was scored. | integer | YYYYMM |
iso3 | Country the news coverage is attributed to. | string | ISO 3166-1 alpha-3 |
period | The month the observation describes. | integer | YYYYMM, from 198901 up to the vintage |
stock_tokens | Accumulated, decaying volume of text written about the country — the token stock. | float | ≥ 0 |
stock_topic_0 … stock_topic_14 | Accumulated, decaying share of the country’s coverage on each of the fifteen topics — the composition stock. The fifteen values sum to 1. | float | [0, 1] |
Each stock_topic_k corresponds to topic k in At a glance. That numbering is tied to the re-fit: topic 3 under one generation is not topic 3 under the next, so read the topic table for the same generation you are querying. A row is uniquely identified by (generation, as_of_yyyymm, iso3, period).
Caveats and intended use
- Topics are statistical, not curated. They are clusters of co-occurring words, not categories designed by subject-matter experts. Most are readily interpretable; some mix themes that happen to share vocabulary. The word lists, not the labels, are the definition.
- Mention-based, not event-based. A country’s series reflects what the press writes about it. That is a strong signal for what is happening, but it is not a record of events, and coverage is uneven across the world — see the discussion of coverage bias at our corpus page.
- No sentiment. Nothing here measures the tone of coverage, only its volume and its thematic composition.
- Choose the vintage to match your question. For forecasting or backtesting, use the vintage that was live at each date, so the series never sees the future; for describing the past, use the latest vintage, which reads the whole history through one consistent set of topics. Either way, stay within a single annual re-fit (
generation) — the topics are re-estimated each year, so series from different generations are not comparable. - The stock’s memory is a modelling choice. was not estimated; it encodes an assumption that news attention has a memory of a few months.
Appendix A - Settings
| Setting | Value |
|---|---|
| Topic model | latent Dirichlet allocation (gensim LdaMulticore) |
| Number of topics | 15 |
| Burn-in fit window | 1989-01 to 2009-12 |
| Update cadence | monthly |
| Model snapshots | 192 monthly vintages from 201001 |
| Vocabulary | 239,531 terms (38,178 single words, 177,848 two-word phrases, 23,505 three-word phrases) |
| Vocabulary thresholds | a term must appear in at least 1,000 articles and in no more than 10% of them |
| Minimum article length | 5 vocabulary terms |
| Lemmatiser | spaCy en_core_web_sm |
| Smoothing prior | 50 tokens, spread evenly over the 15 topics |
| Stock decay | 0.8 per month |
| Unit of analysis | country-month |
| Panel start | 198901 |
| Snapshot vintage | 202512 |
Appendix B — What we remove before modelling
The lists of terms stripped from every article before the model sees it, described in From articles to words. Counts are as at the snapshot date; the lists are curated by hand and reviewed as the corpus grows, except for cities, which is rebuilt each year from Natural Earth populated places above 100,000 people.
| List | Terms | Of which phrases | Examples |
|---|---|---|---|
names | 7,479 | 3 | Alvin, Bea, Smith, Ann-Marie |
cities | 3,353 | 538 | Cork, Montreal, San Salvador |
spacy | 319 | 0 | whatever, to, also |
countries | 296 | 94 | Bulgaria, Côte d’Ivoire, United States of America |
nationalities | 236 | 8 | Australians, Ecuadorian, Senegalese |
custom | 104 | 0 | published-time, source, edition |
people | 75 | 0 | Barack, Bolsonaro, Merkel |
time | 57 | 0 | week, Jan, utc |
letters | 47 | 0 | X, d, K |
sources | 33 | 19 | Agence France Presse, Kyodo, Xinhua |
regions | 32 | 2 | Asia, European, South America |
numbers | 19 | 0 | eighteen, thirty, ninth |
titles | 9 | 0 | Mr., Dr., Mrs |
| Total | 12,059 | 664 |
The examples are illustrations chosen by hand, not the most frequent or most important entries in each list. The phrases column counts entries made of more than one word, which are matched and removed as whole spans rather than word by word. Most lists are matched case-sensitively — that is what keeps Trump the person distinct from trump the verb. All-caps variants of each entry are generated too, because a substantial number of articles carry all-capital titles.
Glossary
| Term | Meaning |
|---|---|
| Token | A single term in our vocabulary. This can be one word, or a two- or three-word phrase. |
| Bag of words | An article reduced to a tally of how often each vocabulary term appears, discarding word order. |
| Lemma | The dictionary form of a word (described → describe). |
| Stopword | A term removed before modelling because it carries no thematic signal. Includes filler words, place and personal names, and the names of news outlets. |
| Vocabulary | The full set of terms the model knows. Terms outside it are ignored. |
| Topic | A cluster of words that tend to occur together, discovered by the model rather than defined in advance. |
| LDA | Latent Dirichlet allocation. The statistical method that finds the topics and each article’s mixture of them. |
| Topic share | The proportion of an article, or of a country-month, attributed to one topic. Shares sum to one. |
| Composition | The full set of topic shares for a country-month — the balance of themes in its coverage. |
| Vintage | One monthly state of the model, labelled by the last month of news it has read. |
| Generation | One annual re-fit of the model. The topics are re-estimated from scratch each generation, so they are not comparable across generations. |
| Period | The publication month of the news being described. |
| Smoothing prior | Mixing in a small amount of neutral text so that thinly-covered country-months are not given false confidence. |
| Stock | A running total that adds new coverage and lets old coverage fade geometrically. |
| Decay | The fraction of a stock carried into the next month; here 0.8. |
| ISO3 | A three-letter country code from the ISO 3166-1 standard (e.g. DEU for Germany). |