What's Actually in a WorldRelat Word Cloud?
2026-09-03 · by Jordi Fuster
Open almost any relation page on WorldRelat and, alongside the score, you'll find a word cloud — the handful of words and short phrases that come up most in the coverage of that specific relationship. It looks simple. The method behind it deliberately isn't "just count the words," and here's why that matters.
The naive approach, and why it doesn't work
If you simply counted every word in an article about, say, Morocco and Spain and showed the most frequent ones, you'd get a word cloud dominated by "government," "president," "country," "relations" — words that show up constantly in basically every article about basically any two countries. Technically accurate, completely useless: none of it tells you anything specific about that relationship.
What WorldRelat does instead: a homegrown tf-idf
The fix is a technique called tf-idf — term frequency, inverse document frequency — adapted here into a simple, purpose-built version. The idea has two halves. "Term frequency" is how often a word or short phrase shows up in the text for this specific relationship. "Inverse document frequency" is the opposite measure: how rare that same word is across the coverage of every other relationship on the site. Multiply the two together, and a word only scores highly if it's both common in this particular relationship's text and unusual everywhere else — which is exactly what makes a word cloud actually informative instead of generic.
Under this method, "sanctions," "border," "oil" or "elections" can rise to the top of a specific relation's word cloud, while "government" and "president" — common everywhere — sink toward the bottom, even though the raw count of "government" is almost certainly higher. The word cloud also supports two-word phrases ("economic sanctions", "peace talks"), not just single words, and each relation's own country names are deliberately excluded, since a word cloud for a country doesn't need to keep telling you that country's own name.
It updates, and it doesn't wipe itself out
The word cloud isn't a fixed, one-time snapshot — it reflects whatever the site's most recent data run actually covered. That created a real bug earlier in development: if a given update run didn't manage to re-scrape a particular pair of countries (a temporary failure, a rate limit, whatever the cause), that pair's word cloud used to get wiped out entirely rather than simply left alone. It's since been fixed so that a partial run only ever updates the pairs it actually has fresh data for, and leaves everything else exactly as it was — the word cloud you see should always reflect the last successful read of that relationship, never a blank page caused by an unrelated hiccup elsewhere in the pipeline.
Small detail, but it's the kind of thing that matters more than it looks: a word cloud is only useful if you can trust it's actually current, not a leftover from a run that happened to skip that one pair of countries.