US-China
- “State offers loan support to foreign buyers of UK goods”
- “UK stocks creep back into favour after years of ‘benign neglect’”
- “US suspends tariffs on UK exports in Airbus-Boeing trade dispute”
7 May 2021
01 — Summary
Every morning, risk analysts at Société Générale hand-build the daily market digest — the briefing top management reads to grasp overnight moves. It means trawling dozens of sources, grouping related stories, picking representatives, and writing headlines. On average it eats three to four hours of senior-analyst time, every single day.
Three concrete gaps the analysts face:
This project built an NLP pipeline that does the grouping automatically. Each headline comes in, gets embedded as numbers, clustered by meaning, and labeled with its key names and topics. The goal: automate the grouping so analysts spend their time on judgment, not janitorial reading.
02 — Key findings
The pipeline presented is able to cluster any number of headlines into a reasonable number of clusters without any pre-training on the data. In our test, it successfully output 10 clearly labelled topics out of 560 headlines.
560 headlines → 10 topics
We worked directly with Société Générale's risk department. The proof-of-concept brought fresh insights to the desk, and they folded several of its methods into their own daily digest.
Adopted in production
Transformer, an attention-based deep learning architecture, lifting clustering accuracy more than four-fold over the older methods.
ARI 0.13 → 0.56 (~4×)
Applying the clustering recursively on the results is like extracting the cream of the crop — turning the noisy output into more focused clusters that actually matter.
61 clusters → 10 clusters
03 — Methodology
The pipeline runs in three stages: Embedding, Clustering, and Keyword Extraction. First we turn every headline into a vector, a string of numbers the software can read; then we group those vectors into clusters by meaning; finally we pull the defining keywords from each cluster.
Of the three stages, the embedding is where most of the difficulty lives — we need to make sure the headline's meaning survives during the conversion into a vector.
We evaluated six models, from the traditional to the state-of-the-art: TF-IDF, averaged Word2Vec, Doc2Vec, NVDM, the Universal Sentence Encoder (USE), and SentenceBERT.
| Algorithm · year | How it works | Outcome |
|---|---|---|
| TF-IDF · 1972 | Counts words, weighting rare ones higher (bag-of-words); no sense of meaning | Tested |
| Word2Vec (avg) · 2013 | Learns a vector per word from its neighbors; averaged across the headline | Tested |
| Doc2Vec · 2014 | Extends Word2Vec to learn one vector for a whole document | Dropped — no pretrained model |
| NVDM · 2016 | A neural autoencoder that compresses text into a topic-like vector | Dropped — few open implementations |
| USE · 2018 | Transformer model, trained across many language tasks for general sentence vectors | Tested |
| SentenceBERT · 2018 | Transformer model, BERT fine-tuned so similar sentences land close together | Chosen |
The Transformer models clearly performed best by a clear margin. As they are able to group headlines by meaning, not shared words — a headline that says only "Biden" or "Beijing" still lands in the US-China cluster, even though neither word is "US-China." The keyword-based methods can't make those links, and dumped close to 80% of articles into one meaningless residual cluster. And among the transformer models, we have chosen BERT as it has performed the best result overall.
| Model | ARI ↑ | Hom. ↑ | Com. ↑ | V ↑ | Sil. ↑ | Adj. Sil. ↑ | Loss ↓ |
|---|---|---|---|---|---|---|---|
| TF-IDF | 0.128 | 0.415 | 0.236 | 0.301 | 0.006 | 0.141 | 391 |
| Word2Vec (avg) | 0.103 | 0.429 | 0.174 | 0.248 | 0.092 | 0.063 | 465 |
| USE | 0.484 | 0.572 | 0.500 | 0.534 | 0.125 | 0.363 | 11 |
| SentenceBERT | 0.559 | 0.656 | 0.583 | 0.617 | 0.099 | 0.347 | 23 |
With every headline now a vector, semantically similar headlines sit close together, and clustering draws the boundaries between topics. We shortlisted three algorithms — Hierarchical Agglomerative Clustering (HAC), DBSCAN, and OPTICS — and judged them on two criteria: whether they work with cosine similarity (so a headline's meaning, not its length, drives the result) and how directly we could set the number of clusters.
Every headline starts as its own cluster; the two nearest clusters merge, step by step, building a tree upward. Cut the tree at a height to decide how many clusters you get.
HAC won on both counts. It takes cosine distance natively, and the number of clusters follows from a single linking threshold. It's also the approach trusted by industry practitioners like Bloomberg.
| Algorithm | Cosine metric? | Set cluster count? | Outcome |
|---|---|---|---|
| HAC | Yes, any pairwise distance | Yes, one threshold | Chosen |
| DBSCAN | Nearest-point only, not cosine-friendly | Only by trial-and-error | Dropped |
| OPTICS | Nearest-point only, not cosine-friendly | Only by trial-and-error | Dropped |
A single clustering pass is thorough but too granular: it splits the day's news into tens of small groups, still not so friendly for analysts. Recursive clustering fixes this by treating those groups as new inputs and clustering them a second time, so the fragments of a story merge back into one. It's the same two-stage design behind Bloomberg's NSTM news engine, and it's what turns a technically correct result into something an analyst can actually skim.
| Stage | Clusters | ARI ↑ | V-measure ↑ |
|---|---|---|---|
| Before recursive clustering | 61 | 0.180 | 0.522 |
| After recursive clustering | 10 | 0.537 | 0.612 |
The final stage tries to understand what each cluster represents, by pulling out the names and topics its headlines mention most — its top named entities and top nouns — so the subject is obvious at a glance.
Named entity extraction runs on spaCy, an open-source
NLP library we chose over its main rival NLTK for its faster, broader
pretrained support; we use its largest English pipeline,
en_core_web_lg.
We extract the named entities found in the headlines and rank them by
frequency to get the top named entities.
Named-entity recognition has a blind spot, though: brand-new terms it has never seen slip through — "dogecoin," absent from any 2020-era model. To cover that, we also pull each cluster's most frequent nouns as a second set of keywords.
04 — Dataset
We evaluated on three datasets: two public NLP benchmarks — 20 Newsgroups and the UCI News Aggregator — for scale and comparability, and a custom dataset we built to mirror the bank's real use case. The custom set is what makes the evaluation meaningful: it's drawn from the financial sources analysts actually read, organised under the topics they track, with a known answer key the clustering can be graded against.
A classic NLP benchmark: newsgroup (forum) posts hand-labelled into 20 topic classes — comp.graphics, rec.sport.baseball, sci.space, talk.politics.guns, soc.religion.christian, and more. Its wide, fine-grained split makes it a hard stress-test for the embeddings.
20 Newsgroups datasetA large dataset of web news headlines labelled into four categories — Business, Technology, Entertainment, Health. Closer to SG's business reading than 20 Newsgroups; we used it for a daily-clustering demo.
UCI News AggregatorThe custom dataset is the one we built specifically for this project, to put the pipeline on the kind of news SG's analysts actually read. We gathered roughly 560 financial headlines from six outlets analysts trust — the Financial Times, Bloomberg, Reuters, the Wall Street Journal, the South China Morning Post and Risk.net, searching each for five themes: Brexit, Cryptocurrency, Electric Vehicles, Hong Kong and US-China relations.
Those five tags were chosen for financial relevance and for deliberate overlap — Hong Kong sits semantically next to US-China, and Tesla links electric vehicles to crypto — so the dataset tests whether the embeddings can tell genuinely confusable topics apart.
We made it deliberately tricky, seeding the messy cases that defeat naive keyword matching:
Article count per outlet in the hand-collected custom dataset.
| Date | Source | Headline |
|---|---|---|
| 2021-01-05 | The Wall Street Journal | Tesla vs. NIO: Battle for the World's Largest EV Market |
| 2021-01-07 | The Wall Street Journal | EV Dreams Power Baidu but May Not Last |
| 2021-01-09 | The Wall Street Journal | NIO, the Chinese Electric-Vehicle Startup, Unveils New ET7 Sedan |
| 2021-01-11 | The Wall Street Journal | Making an Apple EV Is a Poisoned Chalice for Car Companies |
| 2021-01-13 | The Wall Street Journal | New GM Electric-Truck Business Targets Delivery Market |
| 2021-01-14 | The Wall Street Journal | Car-Safety Regulators Urge Tesla to Recall Around 158000 Vehicles |
| 2021-01-15 | The Wall Street Journal | The Leaders in the Race to Build a Better EV Battery |
| 2021-01-18 | The Wall Street Journal | These Companies Want to Charge Your Electric Vehicle as You Drive |
| 2021-01-20 | The Wall Street Journal | How Volkswagen’s $50 Billion Plan to Beat Tesla Short-Circuited |
| 2021-01-20 | The Wall Street Journal | Electric-Truck Maker Rivian Raises $2.65 Billion Ahead of First Vehicle Launch |
| 2021-01-21 | The Wall Street Journal | Buffett-Backed BYD Sells $3.9 Billion of Shares as EV Stocks Electrify |
| 2021-01-22 | The Wall Street Journal | Ford, GM Stocks Rally on Electric-Vehicle Enthusiasm |
| 2021-01-22 | The Wall Street Journal | Amazon Needs Electric Vehicles, Too |
| 2021-01-23 | The Wall Street Journal | EV Surge Sends Cobalt Prices Soaring |
| 2021-01-26 | The Wall Street Journal | Shift to Electric Vehicles Spurs Bid to Make More Batteries in U.S. |
| 2021-01-27 | The Wall Street Journal | Hyundai Surges on Electric-Vehicle Dreams and Logs Big Profits Too |
| 2021-01-28 | The Wall Street Journal | GM to Run a Corporate Super Bowl Ad Touting Electric Vehicles |
| 2021-01-28 | The Wall Street Journal | Ford Adds Made in China Label to the Mustang |
| 2021-01-29 | The Wall Street Journal | GM to Phase Out Gas- and Diesel-Powered Vehicles by 2035 |
| 2021-02-01 | The Wall Street Journal | Never Mind the Next Tesla, What’s the Next Model S? |
| 2021-02-03 | The Wall Street Journal | Electric-Car Buzz Pushes Up Shares in Company With Nothing but Cash |
| 2021-02-04 | The Wall Street Journal | Electric-Vehicle Charging Hub to Park Itself in New York City |
| 2021-02-05 | The Wall Street Journal | Kia Seeks Partners to Build Apple Car in Georgia |
| 2021-02-05 | The Wall Street Journal | Electric Vehicles Make Up More Than a Third of Volvo’s Sales in Europe |
| 2021-02-08 | Financial Times | UK says Hong Kong authorities no longer recognise dual nationality |
| 2021-02-08 | Financial Times | Tesla sends bitcoin to record high with $1.5bn investment |
| 2021-02-08 | Financial Times | Tesla/bitcoin: asset exchange |
| 2021-02-08 | Financial Times | Tesla bets on bitcoin |
| 2021-02-08 | Financial Times | Tesla/bitcoin: asset exchange |
| 2021-02-08 | The Wall Street Journal | Apple’s Electric-Vehicle Talks With Hyundai Break Down |
| 2021-02-08 | Financial Times | ICE to shift EU carbon trading from London to Amsterdam |
| 2021-02-08 | Financial Times | Gove calls for Brussels to be ‘pragmatic’ over Northern Ireland |
| 2021-02-09 | Financial Times | Hong Kong biotech sector booms on buoyant markets and pandemic |
| 2021-02-09 | Financial Times | Hong Kong stock exchange names JPMorgan banker as chief executive |
| 2021-02-09 | Financial Times | BlackRock’s new Asia-Pacific chief sees Hong Kong retaining power |
| 2021-02-09 | Financial Times | Tesla’s bitcoin bet is unlikely to have many corporate copycats |
| 2021-02-09 | Financial Times | Elon Musk’s effect on crypto world shows how irrational markets are |
| 2021-02-09 | Financial Times | A month-old Reddit post appears to make public Tesla’s bitcoin strategy |
| 2021-02-09 | Financial Times | Elon Musk’s effect on crypto world shows how irrational markets are |
| 2021-02-09 | The Wall Street Journal | Tesla Summoned by Chinese Regulators on Quality Issues |
| 2021-02-09 | Financial Times | Numis’s EU move offers hedge against IPOs leaving London |
| 2021-02-09 | Financial Times | UK industrial strategy refresh ditched as ministers set out plan for growth |
| 2021-02-09 | Financial Times | Sweden flies the flag for the free-trade cause in the EU |
| 2021-02-10 | Financial Times | UK stocks creep back into favour after years of ‘benign neglect’ |
| 2021-02-10 | Financial Times | Letter: Hong Kong’s role as a hub for arbitration is growing |
| 2021-02-10 | Financial Times | Tesla’s bitcoin buy undercuts company’s green credentials |
| 2021-02-10 | Financial Times | Tesla and bitcoin: the accounting |
| 2021-02-10 | Financial Times | Tesla’s bitcoin buy undercuts company’s green credentials |
| 2021-02-10 | Financial Times | Post-Brexit bluster strains EU-UK relations |
| 2021-02-10 | Financial Times | Call for UK to rethink £1bn Brexit red tape plan for chemicals |
| 2021-02-10 | Financial Times | Northern Ireland ports to resume checks after security fears |
| 2021-02-10 | Risk.net | If stablecoins are money, they should be backed by reserves |
| 2021-02-10 | Financial Times | Bitcoin and Dogecoin see all-time rises in value |
| 2021-02-10 | Financial Times | Nouriel Roubini: bitcoin is not a hedge against tail risk |
| 2021-02-10 | Financial Times | Nouriel Roubini: bitcoin is not a hedge against tail risk |
| 2021-02-10 | Financial Times | Amsterdam ousts London as Europe’s top share trading hub |
| 2021-02-10 | Financial Times | Labour’s Starmer has no quick fix; Johnson stole his story |
| 2021-02-11 | Financial Times | Biden creates Pentagon task force on China |
| 2021-02-11 | Financial Times | Ark's Cathie Wood dismisses bubble talk and Tesla doubters |
| 2021-02-11 | The Wall Street Journal | Next Stop for Electric-Vehicle SPAC Mania: the Jetsons |
| 2021-02-11 | The Wall Street Journal | Ford, Volkswagen EV Battery Supplier Dealt Setback by Trade Commission |
| 2021-02-11 | Financial Times | Britain’s post-Brexit role as ‘global broker’ |
| 2021-02-11 | Financial Times | Small businesses to be offered grants to cope with Brexit disruption |
| 2021-02-11 | Financial Times | Bailey’s tough talk on EU raises City worries over post-Brexit access |
| 2021-02-11 | Financial Times | Trust deficit is killing a deeply flawed Northern Ireland agreement |
| 2021-02-11 | Financial Times | EU sinks UK hopes of overturning shellfish ban |
| 2021-02-11 | Financial Times | Brussels fires warning shot at UK over N Ireland protocol |
| 2021-02-11 | Financial Times | Fresh blow for London as euro derivatives trading floods out |
| 2021-02-11 | Financial Times | Joe Biden should look to Emmanuel Macron for a European ally |
| 2021-02-11 | Financial Times | Biden reconsiders Trump effort to ban TikTok |
| 2021-02-11 | Financial Times | Bitcoin hits record as US financial giants embrace cryptocurrency |
| 2021-02-11 | Financial Times | Amsterdam punctures City’s post-Brexit hopes |
| 2021-02-11 | Financial Times | Amsterdam as trading hub, Italy’s recovery fund |
| 2021-02-11 | Financial Times | Securities trading/City of London: end of the Golden Age |
| 2021-02-11 | Financial Times | Trade-phobic governments may be jumping at electoral shadows |
| 2021-02-11 | Financial Times | Securities trading/City of London: end of the Golden Age |
| 2021-02-12 | Financial Times | Is the party over for top tech stocks? |
| 2021-02-12 | Financial Times | Elon Musk’s reality distortion field |
| 2021-02-12 | Financial Times | Brussels faces long haul boosting capital markets despite Brexit fillip |
| 2021-02-12 | Financial Times | London’s sway in Europe put to test as rival hubs make trading inroads |
| 2021-02-12 | Financial Times | UK and EU to seek ‘workable solutions’ on Northern Ireland protocol |
| 2021-02-12 | Financial Times | National Grid plans to link offshore UK wind farms direct to continent |
| 2021-02-12 | Financial Times | European IPOs mark best start to year since 2015 with €8bn haul |
| 2021-02-12 | Financial Times | UK suffers biggest drop in economic output in 300 years |
| 2021-02-12 | Financial Times | Letter: Cryptocurrencies are just further rocking the boat |
| 2021-02-12 | Financial Times | This Valentine’s, consider the crypto-flower |
| 2021-02-12 | Financial Times | ‘Digital tulip’ or new asset class? Bitcoin’s bid to go mainstream |
| 2021-02-12 | Financial Times | European IPO boom, Bitcoin price jump, China’s corn spree |
| 2021-02-12 | Financial Times | Covid variants and new advisers curb Boris Johnson’s natural optimism |
| 2021-02-13 | The Wall Street Journal | The New EVs Hitting the Road in 2021 from GM to Tesla |
| 2021-02-13 | The Wall Street Journal | If Tesla Bubble Bursts, Catastrophe Won’t Follow |
| 2021-02-14 | Financial Times | Private equity firms eye UK stock market for cheaper deals |
| 2021-02-14 | Financial Times | Hong Kong plans stricter money laundering checks on Chinese officials |
| 2021-02-14 | The Wall Street Journal | U.S. Expresses ‘Deep Concerns’ Over China Withholding Data From Pandemic Investigators |
| 2021-02-14 | Reuters | Japan's SBI in talks to set up cryptocurrency JV with foreign financial firms |
| 2021-02-14 | Financial Times | The environmental idiocy of Tesla’s bitcoin bet |
| 2021-02-14 | Bloomberg | Tesla Selects Karnataka for Electric Vehicle Plant in India: PTI |
| 2021-02-14 | Financial Times | Brexit woes: small UK distillers struggle to ship gin and whisky to EU |
| 2021-02-14 | Financial Times | London and Brussels plan hotline over Northern Ireland problems |
| 2021-02-14 | Financial Times | Britain does not need a politicised judiciary |
100 of 560 rows from the hand-collected custom dataset.
Download full dataset (CSV)05 — Evaluation
| Metric | What it measures | Range | Good score |
|---|---|---|---|
| Adjusted Rand Index | Overall agreement with the answer key, corrected so a random grouping scores near zero | −1 to 1 | Higher ↑ |
| Homogeneity | Each cluster contains a single topic | 0 to 1 | Higher ↑ |
| Completeness | Every article of a topic stays together in one cluster | 0 to 1 | Higher ↑ |
| V-measure | Harmonic mean of homogeneity and completeness | 0 to 1 | Higher ↑ |
| Contingency matrix | A visual grid of how each topic is spread across the clusters | grid | Visual ✕ |
| Loss | Count of articles that land in a residual catch-all cluster with no clear topic | count | Lower ↓ |
| Metric | What it measures | Range | Good score |
|---|---|---|---|
| Silhouette | How tight each cluster is, and how far apart the clusters sit | −1 to 1 | Higher ↑ |
| Adjusted silhouette | The same idea, rebuilt around cosine similarity to match how the embeddings are compared (Rousseeuw, 1987) | −1 to 1 | Higher ↑ |
06 — Evidence
The custom dataset is the one we built specifically for this project, to put the pipeline on the kind of news SG's analysts actually read. We gathered roughly 560 financial headlines from six outlets analysts trust, the Financial Times, Bloomberg, Reuters, the Wall Street Journal, the South China Morning Post and Risk.net, searching each for five themes: Brexit, Cryptocurrency, Electric Vehicles, Hong Kong and US-China relations.
Each cluster is shown with its six most-mentioned entities. Shared entities are the threads that tie separate themes together.
drag · scroll · entities = top 6 NER per cluster
Each cluster with its Top entities, Source, and Date distribution. Click a card to highlight it across the entity graph.
See full details of each cluster: top named entities extracted, top nouns, and articles.
215 articles over 41 days
How articles are spread over time within each cluster.
560 articles · 58 days
07 — Conclusion
We are grateful for the opportunity to work on this project with the Société Générale Risk Management desk, it gave us the chance to take what we learned in the classroom and apply it to a live problem, bringing real value to real users.
From the implementation of the pipeline, we are pleased to see that our results achieved successful news headline clustering without any dataset-specific training, a meaningful outcome that speaks to the generalisability of the approach. We are glad to have delivered value to the SG team across three areas:
References