保留正文与补采附件。源页面当前未重新核验;具体限制见交付清单。

Revisit consent button We value your privacy We use cookies to enhance your browsing experience, serve personalised ads or content, and analyse our traffic. By clicking "Accept All", you consent to our use of cookies. Customise Reject All Accept All Customise Consent Preferences We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below. The cookies that are categorised as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... Show more NecessaryAlways Active Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

Functional Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

Analytics Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

Performance Performance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.

Advertisement Advertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.

Uncategorised Other uncategorised cookies are those that are being analysed and have not been classified into a category as yet. No cookies to display. Reject All Save My Preferences Accept All Toggle SearchToggle Mobile Navigation Publish AI, ML & data-science insights to a global community of data professionals. Sign inSubmit an Article LatestEditor's PicksNewsletterShipAI


Write For TDS LinkedInXToggle Search Machine Learning

Topic Modeling Techniques for 2026: Seeded Modeling, LLM Integration, and Data Summaries

Seeded topic modeling, integration with LLMs, and training on summarized data are the fresh parts of the NLP toolkit. Petr Koráb January 14, 202613 min read Source: Image by authors. By : Martin Feldkircher (Vienna School of International Studies), Márton Kardos (Aarhus University, Denmark), and Petr Koráb (Text Mining Stories)

1. Introduction

Topic modelling has recently progressed in two directions. The improved statistical methods stream of Python packages focuses on more robust, efficient, and preprocessing-free models, producing fewer junk topics (e.g., FASTopic). The other relies on the power of generative language models to extract intuitively understandable topics and their descriptions (e.g., TopicGPT [6], LlooM [5]). Thanks to research on statistical methods for modelling text representations from transformers, junk topics are the exception rather than the norm in newer models. Meanwhile, novel, LLM-based approaches are challenging our long-standing views about what a topic model is and what it can do. Human-readable topic names and descriptions are now becoming more and more an expected result of a well-designed topic modelling pipeline. As exciting as these developments are, topic modelling is far from being a solved problem. Neural topic models can be rather unstable and sometimes hard for users to trust because of their black-box nature. LLM-powered methods produce impressive results, but can at times raise questions about trust, due to hallucinations and sensitivity to semantically irrelevant changes in input. This is especially a problem for the banking sector, where (un)certainty is essential. Running large language models is also a huge infrastructural and computational burden, and might end up costing large sums of money even for smaller datasets. Learn this step by step with the interactive Machine Learning roadmap. Our previous tutorial provides a detailed introduction to how LLMs enhance traditional topic modeling by automatically labeling topic names. In this article, we combine current topic modeling methods with targeted LLM assistance. In our view, a combination of recent advances in language modeling and classical machine learning can provide users with the best of both worlds: a pipeline that combines the capabilities of large language models with the computational efficiency, trustworthiness, and stability of probabilistic ML. This article explains three fresh topic-modelling techniques that should be part of the NLP toolkit in 2026. We will figure out:

We illustrate these on the central bank communication speeches corpus from the European Central Bank. This type of text is long, carefully structured, and highly repetitive — exactly the kind of data where standard topic models struggle and where interpretability is essential. By combining seeded topic modelling with LLM-assisted document summarization and analysis, we show how to extract focused, stable, and economically meaningful topics without compromising transparency or scalability.

2. Example Data

We use the press conference communications of the European Central Bank (ECB) as example text data. Since 2002, the ECB’s Governing Council has met on the first Thursday of each month, and its communication of the meeting’s outcome follows the two-step structure ([2]).

_How it works:__First, at 13:45 CET, the ECB releases a brief monetary policy decision (MPD) statement, which contains only limited textual information. Second, at 14:30 CET, the ECB President delivers an introductory statement during a press conference. This carefully prepared document explains the rationale behind policy decisions, outlines the ECB’s assessment of economic conditions, and provides guidance on future policy considerations. The introductory statement typically lasts about 15 minutes and is followed by a 45-minute Q &A session. _ For this article, we use the introductory statements, scraped directly from the ECB website (released with a flexible data licence). The dataset contains 279 statements, and here is what it looks like: Image 1: ECB communication dataset. Source: Image by authors.

3. Seeded Topic Modelling

Traditionally, topic models focus on identifying the most informative topics in a dataset. A naive approach practitioners take is to fit a larger model, then, usually manually, filter out topics irrelevant to their data question.

What if you could condition a topic model to only extract relevant topics to your data question? This is precisely what seeded topic modelling is used for. In some methods, this means selecting a set of keywords that reflect your question. But in the framework we explore in this article, you can specify your interest in free-text using a seed phrase that tells the model what to focus on.

3.1 KeyNMF Model

We will use the cutting-edge contextual KeyNMF topic model([3]). It is, in many aspects, very similar to older topic models, as it formulates topic discovery in terms of matrix factorization. In other words, when using this model, you assume that topics are latent factors , that your documents contain to a lesser or greater extent, which determine and explain the content of those documents. KeyNMF is contextual because, unlike older models, it uses context-sensitive transformer representations of text. To understand how seeded modelling works, we need to gain a basic understanding of the model. The modelling process happens in the following steps:

  1. We encode our documents into dense vectors using a sentence-transformer.
  2. We encode the vocabulary of these documents into the same embedding space.
  3. For each document, we extract the top N keywords by taking the words that have the highest cosine similarity to the document embedding.
  4. Word importance for a given document is then the cosine similarity, pruned at zero. These scores are arranged into a _keyword matrix,_where each row is a document, and columns correspond to words.
  5. The keyword matrix is decomposed into a topic-term matrix and a document-topic matrix using Nonnegative Matrix Factorization.

Image 2: KeyNMF model architecture. Source: Turftopic’s documentation

3.2 Seeded KeyNMF

The general KeyNMF , while perfectly adequate for discovering topics in a corpus, is not the most suitable choice if we need to use the model for a specific question. To make this happen, we first have to specify a seed phrase, a phrase that minimally indicates what we are interested in. For example, when analysing the ECB communication dataset, this could be “Expansion of the Eurozone”. As sentence-transformers can encode this seed phrase, we can use it to retrieve documents that are relevant to our question:

  1. We encode the seed phrase into the same embedding space as our documents and vocabulary.
  2. To make our model more attentive to documents that contain relevant information, we compute a document relevance score by computing cosine similarity to the seed embedding. We prune, again, at zero.
  3. To exaggerate the seed’s importance, one can apply a seed exponent . This involves raising the document relevance scores to the power of this exponent.
  4. We multiply the keyword matrix’s entries by the document relevance.
  5. We then, as before, use NMF to decompose this, now conditioned, keyword matrix.

The advantages of this approach are that it is:

Be careful : some embedding models can be sensitive to phrasing and might retrieve different document-importance scores for the same document with a slightly different seed phrase. To deal with this, we recommend that you use one of the paraphrase models from sentence-transformers , because they have deliberately been trained to be phrasing invariant, and produce high-quality topics with KeyNMF.

3.3 How to use Seeded KeyNMF

KeyNMF and its seeded version are available on PyPI in the Turftopic package, in a scikit-learn-compatible form. To specify what you are interested in, simply initialize the model with a seed phrase: python

from sentence-transformers import SentenceTransformer
from turftopic import KeyNMF

# Encode documents using a sentence-transformer
encoder = SentenceTransformer("paraphrase-mpnet-base-v2")
embeddings = encoder.encode(documents, show_progress_bar=True)

# Initialize KeyNMF with 4 topics and a seed phrase
model = KeyNMF(
 n_components=4,
 encoder=encoder,
 seed_phrase="Expansion of the Eurozone",
 seed_exponent=3.0,
)

# Fit model 
model.fit(corpus)

# Print modelled topics
model.print_topics()

We can see that the model returns topic IDs with typical keywords that are clearly related to the Euro and the Eurozone:
| Topic Id | Highest Ranking |
| --- | --- |
| 0 | gdp, economic, euro, growth, economy, assessment, analysis, macroeconomic, measures, expected |
| 1 | inflation, rates, inflationary, stability, euro, rate, economy, economic, ecb, expectations |
| 2 | euro, fiscal, stability, countries, reforms, question, governing, policy, european, policies |
| 3 | ecb, germany, frankfurt, communicationssonnemannstrasse, 7455media, europa, question, eu, 1344, 2060314 |

4. LLM-assisted Topic Modeling

Finding interpretable topics from a corpus is a difficult task, and it often requires more than just a statistical model that finds patterns in the raw data. LLMs serve topic modelling in two main areas:

In the following text, we will now explore 1) how LLMs improve processing documents for a topic model and 2) how generative models improve understanding and interpreting the model results. Image 4: Topic modelling pipeline extended with LLM components. Source: Turftopic’s docs.

4.1. Document Summarization

One of the Achilles' heels of the sentence transformers we frequently use for topic analysis is their short context length. Encoder models that can read considerably longer contexts have rarely been evaluated for their performance in topic modeling. Therefore, we didn't know whether or how these larger transformer models work in a topic modelling pipeline. Another issue is that they produce higher-dimensional embeddings, which often negatively affect unsupervised machine learning models ([4]). It can either be because Euclidean distances get inflated in higher-dimensional space, or because the number of parameters surges with input dimensionality, making parameter recovery more difficult. We can solve these issues by:

Let’s now summarise the trade-offs of using LLM-generated summaries in topic modelling in the following image. Image 5: Benefits and drawbacks of LLM-assisted document processing in the topic modelling pipeline. Source: image by authors. The recommended strategy for LLM-assisted document preprocessing is a two-step:

  1. Train a topic model with simple preprocessing, or no preprocessing at all.
  2. When you find that topic models have a hard time interpreting your corpus, using LLM-based summarisation can be a good choice if the trade-offs work positively in your specific project.

4.1.1. Document Summarization in Code

Let’s now look at how we can summarize documents using an LLM. In this example, we will use GPT-5-nano, but Turftopic also allows running locally run open LLMs. We recommend using open LLMs locally, if possible, due to lower costs and better data privacy. python

import pandas as pd
from tqdm import tqdm
from turftopic.analyzers import OpenAIAnalyzer, LLMAnalyzer

# Loading the data
data = pd.read_parquet("data/ecb_data.parquet")
content = list(data["content"])

# We write a prompt that will extract the relevant information
# We ask the model to separate information to key points so that 
# they become easier to model

summary_prompt="Summarize the following press conference from 
the European Central Bank into a set of key points separated by 
two newline characters. Reply with the summary only, nothing else. 
\n {document}"

# Formalize a summarized
summarizer = OpenAIAnalyzer("gpt-5-nano", summary_prompt=summary_prompt)
summaries = []

# Summarize dataframe, track code execution 
for document in tqdm(data["content"], desc="Summarising documents..."):
    summary = summarizer.summarize_document(document)
    # We print summaries as we go as a sanity check, to make sure 
    # the prompt works
    print(summary)
    summaries.append(summary)

# Collect summaries into a dataframe
summary_df = pd.DataFrame(
    {
        "id": data["id"],
        "date": data["date"],
        "author": data["author"],
        "title": data["title"],
        "summary": summaries,
    }
)

Next, we will fit a simple KeyNMF model on the key points in these summaries, and let the model discover the number of topics using the Bayesian Information Criterion. This approach works very well in this case, but be careful that automatic topic number detection has its shortcomings. Check out the Topic Model Leaderboard to gain more information on how models perform at detecting the number of topics. python

import numpy as np
import pandas as pd
from sentence_transformers import SentenceTransformer
from turftopic import KeyNMF

# Create corpus from text summaries (not original texts)
corpus = list(summary_df["summary"])

# Collect key points by segmenting at double line breaks
points = []

for doc in corpus:
  _points = doc.split("\n\n")
  doc_points = [p for p in _points if len(p.strip().removeprefix(" - "))]
  points.extend(doc_points)

# Tell KeyNMF to automatically detect the number of topics using BIC
model = KeyNMF("auto", encoder="paraphrase-mpnet-base-v2")
doc_topic = model.fit_transform(points)

# Print topic IDs with top words
model.print_topics()

Here are the KeyNMF results trained on document summaries:
| Topic ID | Highest Ranking |
| --- | --- |
| 0 | inflation, hicp, expectations, expected, wage, energy, prices, price, medium, pressures |
| 1 | ecb, rates, unchanged, kept, key, rate, liquidity, banks, market, exchange |
| 2 | m3, credit, monetary, growth, lending, liquidity, loans, financial, money, m1 |
| 3 | euro, area, economy, banknotes, expected, exchange, currency, countries, convergence, external |
| 4 | reforms, fiscal, growth, structural, consolidation, markets, potential, productivity, market, essential |
| 5 | risks, downside, growth, balanced, outlook, upside, prices, tensions, potential, global |
| 6 | stability, price, medium, pact, remains, risks, expectations, term, upside, fiscal |
| 7 | policy, monetary, rate, fiscal, rates, decisions, transmission, measures, remains, stance |
| 8 | gdp, growth, real, economic, projections, quarter, demand, q2, expected, economy |
| 9 | council, governing, rate, decision, meeting, refinancing, consensus, unanimous, ensure, rates |

4.3. Topic Analysis with LLMs

In a typical topic-analysis pipeline, a user would first train a topic model, then spend time interpreting what the model has discovered, label topics manually, and finally provide a brief description of the types of documents the topic contains. This is time-consuming, especially in corpora with many identified topics. This part can now be done by LLMs that can easily generate human-readable topic names and descriptions. We will use the same Analyzer API from Turftopic to achieve this: python

from turftopic.analyzers import OpenAIAnalyzer

analyzer = OpenAIAnalyzer()
analysis_result = model.analyze_topics(analyzer, use_documents=True)

print(analysis_result.to_df())

We apply the analyzer to the introductory statements issued by the ECB, which accompany each monetary policy decision. These statements are prepared carefully and follow a relatively standard structure. Here are the labelled topic names with their descriptions and top words printed from analysis_result : Image 7: Topic Analysis using GPT-5-nano in Turftopic. Source: image by authors. Next, let’s show the prevalence of the labelled KeyNMF’ topic names over time. It's how intensely these topics were discussed in the ECB press conferences during the last 25 years: python

from datetime import datetime
import plotly.express as px
from scipy.signal import savgol_filter

# create dataframe from labelled topics, 
# combine with timestamp from date column
time_df = pd.DataFrame(
    dict(
        date=timestamps,
        **dict(zip(analysis_result.topic_names, doc_topic.T /
                                                doc_topic.sum(axis=1)))
    )
).set_index("date")

# group dataframe to monthly frequency
time_df = time_df.groupby(by=[time_df.index.month, time_df.index.year]).mean()
time_df.index = [datetime(year=y, month=m, day=1) for m, y in time_df.index]
time_df = time_df.sort_index()

# display dataframe with Plotly

for col in time_df.columns:
    time_df[col] = savgol_filter(time_df[col], 12, 2)
fig = px.line(
    time_df.sort_index(),
    template="plotly_white",
)
fig.show()

Here is the labelled topic model dataframe displayed in yearly frequency: Image 8: Topic Analysis using GPT-5-nano in Turftopic over time. Source: Image by authors. _Model results in context:_The monetary union topic was most prominent in the early 2000s (see [5] for more information). The monetary policy and rate decision topic peaks at the end of the global financial crisis around 2011, a period during which the ECB (some commentators argue mistakenly) raised interest rates. The timing of the inflation and inflation expectations topic also corresponds with economic developments: it rises sharply around 2022, when energy prices pushed inflation into double-digit territory in the euro area for the first time since its creation.

5. Summary

Let's now summarize the key points of the article. The requirements and code for this tutorial are in this repo.

References

[1]Taejin Park, Fernando Perez-Cruz and Hyun Song Shin. 2025. Mapping the space of central bankers' ideas. In: BIS Working Papers, No. 1299, 16 October 2025, 26 pp. [2] Carlo Altavilla, Luca Brugnolini, Refet S. Gürkaynak, Roberto Motto and Giuseppe Ragusa. 2019. Measuring euro area monetary policy. In: Journal of Monetary Economics , Volume 108, pp 162-179. [3] Ross Deans Kristensen-McLachlan, Rebecca M.M. Hicke, Márton Kardos, and Mette Thunø. 2024. Context is Key(NMF):Modelling Topical Information Dynamics in Chinese Diaspora Media . In: CHR 2024: Computational Humanities Research Conference, December 4–6, 2024, Aarhus, Denmark. [4] Márton Kardos, Jan Kostkan, Kenneth Enevoldsen, Arnault-Quentin Vermillet, Kristoffer Nielbo, and Roberta Rocca. 2025. S3 - Semantic Signal Separation. In: Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 633–666, Vienna, Austria. Association for Computational Linguistics. [5] Martin Feldkircher, Petr Koráb and Viktoriya Teliha. 2025. What do central bankers talk about? Evidence from the BIS archive . In: CAMA Working Paper Nr. 35/2025. [6] Michelle S. Lam, Janice Teoh, James A. Landay, Jeffrey Heer, and Michael S. Bernstein. 2024. Concept Induction: Analyzing Unstructured Text with High-Level Concepts Using LLooM. In: Proceedings of the 2024 CHI Conference on Human Factors in Computing Systems (CHI '24). Association for Computing Machinery, New York, NY, USA, Article 766, 1–28. https://doi.org/10.1145/3613904.3642830. [7] Chau Minh Pham, Alexander Hoyle, Simeng Sun, Philip Resnik, and Mohit Iyyer. 2024. TopicGPT: A Prompt-based Topic Modeling Framework. In Proceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers), pages 2956–2984, Mexico City, Mexico. Association for Computational Linguistics.

Register Now to Continue Reading

Unlock Towards Data Science with a Free Account

All articles on Towards Data Science are available to registered users. Create a free account today to access this article and thousands more. Register for freeSign in to your account


Written By

Petr Koráb

See all from Petr Koráb Editor's PicksLlm ApplicationsNLPStatistical ModelingTopic Modelling Share This Article

Towards Data Science is a community publication. Submit your insights to reach our global audience and earn through the TDS Author Payment Program. Write for TDS

Related Articles

The Ultimate Beginner's Guide to Geospatial Raster Data

Everything you need to know about raster files, georeferencing, metadata and Rasterio Python library Mattia Gatti October 13, 202213 min read

Analysis of US Elections from 1976 to 2010 with Pandas

Artificial Intelligence Practice Pandas while providing valuable insights into past elections. Soner Yıldırım October 18, 20205 min read

AI Aids Eyes : a computer vision system to remind operators to wear safety glasses

Artificial Intelligence Here is a demo of the system. When the system detects that a drill is... Chris October 22, 20183 min read

Things I Learned by Participating in GenAI Hackathons Over the Past 6 Months

Artificial Intelligence Sharing my two cents from the building in public journey so far Parul Pandey October 20, 20259 min read

Five Tips for a Successful API

NLP It's now remarkably easy to release to the world a cloud-based application programming interface (API) that provides some software... Robert Dale September 25, 201911 min read

LangGraph 101: Let’s Build A Deep Research Agent

Large Language Models Learn LangGraph fundamentals from Google’s open-source full-stack implementation Shuai Guo August 14, 202527 min read

Counterfactuals for Reinforcement Learning I: "What if... ?"

Introduction to the POMDP framework and counterfactuals Felix Hofstätter December 30, 20218 min read

Understanding What We Lose

Artificial Intelligence How We Tackle Catastrophic Forgetting in LLMs Matt Tengtrakool May 23, 20238 min read

Feature Engineering Techniques for Numerical Variables in Python

Machine Learning Learn the most useful feature engineering techniques to convert numerical values ​​into useful information for your predictive model using... Andrea D'Agostino September 24, 202418 min read

Your home for data science and AI. The world's leading publication for data science, data analytics, data engineering, machine learning, and artificial intelligence professionals. Subscribe to Our NewsletterWrite For TDS•About•Advertise•Privacy Policy•Terms of Use © Insight Media Group, LLC 2026•The New Stack•roadmap.sh•Creator Network

Recommended Articles

Close