EconAI
post

Our text topics

A plain-language guide to the EconAI text topics: what the topics are, how we build them, and how we turn them into country-month measures of the news landscape.

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.

TopicLabelMost characteristic words
0International Politicspeace, UN, sanctions, conflict, ceasefire, nuclear, warn, negotiation
1Diplomacycooperation, summit, tie, discuss, strengthen, bilateral, EU, affair
2Militarydefence, drone, missile, air, strike, defense, weapon, troop
3Energy Politicsenergy, project, oil, water, gas, supply, climate, plant
4Businessgrowth, product, industry, consumer, export, sale, key, forecast
5Judiciary and Abusescourt, arrest, charge, crime, investigation, prison, legal, criminal
6Economicstariff, bank, economy, billion, rate, tax, fund, cost
7Health and Emergencyhealth, child, school, student, university, patient, education, medical
8Financial Marketspercent, stock, yen, index, share, investor, rise, fall
9Technologyglobal, AI, technology, digital, platform, solution, industry, investment
10Politics and Democracyelection, opposition, vote, parliament, protest, democratic, online, house
11Armed Conflictarmy, strike, militant, hama, civilian, operation, taliban, province
12Competition and Sportsgame, team, cup, match, player, test, ball, score
13Civilian Lifefamily, feel, life, young, woman, story, turn, old
14Crisis and Accidentsflight, 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.

StepGoes inComes out
1. PreprocessingAn article’s title, snippet and bodyThe article as a tally of vocabulary terms — a bag of words
2. Topic model (LDA)Every article in the corpus, as a bag of wordsThe 15 topics — a word list each — and, for every article, its 15 topic shares
3. Country-monthArticle topic shares, and which country each article is aboutTwo raw monthly series per country: how much was written, and what it was about
4. StocksThose two raw seriesThe 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:

  1. 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.

  2. Split the words on whitespace, stripping possessives and any punctuation around the edges of each word.

  3. 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.

  4. 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.
  5. Drop anything with a digit in it, and anything with no letters. Dates, figures and stray punctuation are not terms.

  6. 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 AA for the set of articles assigned to country cc in month pp, θa,k\theta_{a,k} for article aa‘s share on topic kk, and waw_a for its token count, the total volume of text is

Tc,p  =  ∑a∈Ac,pwaT_{c,p} \;=\; \sum_{a \in A_{c,p}} w_a

and the topic composition is

θ~k,c,p  =  ∑a∈Ac,pθa,k⋅wa  +  αTc,p  +  Kα\tilde\theta_{k,c,p} \;=\; \frac{\sum_{a \in A_{c,p}} \theta_{a,k}\cdot w_a \;+\; \alpha}{T_{c,p} \;+\; K\alpha}

where K=15K = 15 and α=5015\alpha = \tfrac{50}{15}.

The α\alpha 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 α\alpha to each topic and KαK\alpha 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-monthA raw 90% share becomes
1,000,00090.0%
1,00086.0%
20073.3%
5048.3%
2030.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 1/K=6.7%1/K = 6.7\%, and the shares still sum to one exactly.

This gives us two raw monthly series per country: Tc,pT_{c,p}, the volume, and θ~k,c,p\tilde\theta_{k,c,p}, 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 pp 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 δ=0.8\delta = 0.8 per month.

The token stock. Writing Tc,jT_{c,j} for the tokens country cc received in month jj as the flow, then the stock (present value) at month pp is defined as:

Wc,p  =  ∑j ≤ pδp−j⋅Tc,jW_{c,p} \;=\; \sum_{j \,\le\, p} \delta^{p-j}\cdot T_{c,j}

The current month’s coverage enters at full weight, the previous month’s at 0.80.8, the one before at 0.640.64, and so on. Equivalently, computed one step at a time,

Wc,p  =  Tc,p  +  δ⋅Wc,p−1.W_{c,p} \;=\; T_{c,p} \;+\; \delta\cdot W_{c,p-1}.

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 θ~k,c,j\tilde\theta_{k,c,j} is therefore weighted by that month’s token flow:

Xk,c,p  =  ∑j ≤ pδp−j⋅Tc,j⋅θ~k,c,jWc,pX_{k,c,p} \;=\; \frac{\sum_{j \,\le\, p} \delta^{p-j}\cdot T_{c,j}\cdot \tilde\theta_{k,c,j}}{W_{c,p}}

The numerator is the present value of the flow of tokens attributed to topic kk; 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:

Xk,c,p  =  Tc,p⋅θ~k,c,p  +  δ⋅Wc,p−1⋅Xk,c,p−1Wc,p.X_{k,c,p} \;=\; \frac{T_{c,p}\cdot\tilde\theta_{k,c,p} \;+\; \delta\cdot W_{c,p-1}\cdot X_{k,c,p-1}}{W_{c,p}}.

Because it is a weighted average of quantities that each sum to one, Xk,c,pX_{k,c,p} 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 0.80.8 once instead of 0.860.8^6. 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 Xk,c,pX_{k,c,p} is set to the neutral value 1/K1/K 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.

Line chart for a single country: a thin dashed line for the raw monthly share of news on one topic, and a thick line for the smoothed stock of the same series.

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.

  1. 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.
  2. 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.
  3. 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).

VariableDescriptionData typeAllowed values
generationThe annual re-fit that produced the topics. Series from different re-fits are not comparable.integerfour-digit year (e.g. 2026)
as_of_yyyymmThe vintage — the last month of news the model had read when this row was scored.integerYYYYMM
iso3Country the news coverage is attributed to.stringISO 3166-1 alpha-3
periodThe month the observation describes.integerYYYYMM, from 198901 up to the vintage
stock_tokensAccumulated, decaying volume of text written about the country — the token stock.float≥ 0
stock_topic_0 … stock_topic_14Accumulated, 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. δ=0.8\delta = 0.8 was not estimated; it encodes an assumption that news attention has a memory of a few months.

Appendix A - Settings

SettingValue
Topic modellatent Dirichlet allocation (gensim LdaMulticore)
Number of topics15
Burn-in fit window1989-01 to 2009-12
Update cadencemonthly
Model snapshots192 monthly vintages from 201001
Vocabulary239,531 terms (38,178 single words, 177,848 two-word phrases, 23,505 three-word phrases)
Vocabulary thresholdsa term must appear in at least 1,000 articles and in no more than 10% of them
Minimum article length5 vocabulary terms
LemmatiserspaCy en_core_web_sm
Smoothing prior50 tokens, spread evenly over the 15 topics
Stock decay0.8 per month
Unit of analysiscountry-month
Panel start198901
Snapshot vintage202512

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.

ListTermsOf which phrasesExamples
names7,4793Alvin, Bea, Smith, Ann-Marie
cities3,353538Cork, Montreal, San Salvador
spacy3190whatever, to, also
countries29694Bulgaria, Côte d’Ivoire, United States of America
nationalities2368Australians, Ecuadorian, Senegalese
custom1040published-time, source, edition
people750Barack, Bolsonaro, Merkel
time570week, Jan, utc
letters470X, d, K
sources3319Agence France Presse, Kyodo, Xinhua
regions322Asia, European, South America
numbers190eighteen, thirty, ninth
titles90Mr., Dr., Mrs
Total12,059664

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

TermMeaning
TokenA single term in our vocabulary. This can be one word, or a two- or three-word phrase.
Bag of wordsAn article reduced to a tally of how often each vocabulary term appears, discarding word order.
LemmaThe dictionary form of a word (described → describe).
StopwordA term removed before modelling because it carries no thematic signal. Includes filler words, place and personal names, and the names of news outlets.
VocabularyThe full set of terms the model knows. Terms outside it are ignored.
TopicA cluster of words that tend to occur together, discovered by the model rather than defined in advance.
LDALatent Dirichlet allocation. The statistical method that finds the topics and each article’s mixture of them.
Topic shareThe proportion of an article, or of a country-month, attributed to one topic. Shares sum to one.
CompositionThe full set of topic shares for a country-month — the balance of themes in its coverage.
VintageOne monthly state of the model, labelled by the last month of news it has read.
GenerationOne annual re-fit of the model. The topics are re-estimated from scratch each generation, so they are not comparable across generations.
PeriodThe publication month of the news being described.
Smoothing priorMixing in a small amount of neutral text so that thinly-covered country-months are not given false confidence.
StockA running total that adds new coverage and lets old coverage fade geometrically.
DecayThe fraction of a stock carried into the next month; here 0.8.
ISO3A three-letter country code from the ISO 3166-1 standard (e.g. DEU for Germany).