Sentence-Level Topic Modeling with Lexical and Contextual Evidence
Organizations: Universit´e Cˆote d’Azur, CNRS, I3S, Inria · Universit´e Cˆote d’Azur, CNRS, LJAD, Inria
Abstract
Topic modeling faces a fundamental granularity dilemma: probabilistic topic models assign topics at the word level, whereas transformer-based methods operate at the document level. The latter overlooks that real-world documents typically cover multiple topics, whereas the former relies on individual words, which rarely provide sufficient context to identify them. We introduce SentenceETM, a neural topic model that assigns a topic to each sentence by jointly using lexical and contextual evidence. Each topic is described both by a distribution over the vocabulary, defined through word embeddings, and by a Gaussian over sentence embeddings concentrated on a topic-specific low-dimensional subspace. The topic of a sentence generates both its words and its embedding and is marginalized exactly, so that its posterior combines the two sources of evidence. Document proportions are inferred with amortized variational inference, while the Gaussian parameters are re-estimated in closed form. Experiments show that SentenceETM consistently improves sentence-level topic assignment over state-of-the-art approaches, and a case study of a presidential debate shows how sentence-level topics reveal how candidates handle the same subjects.
Figures & tables
Appendix figures & tables13 assets
Supplementary material from the paper’s appendix.
Appendix
| Run | Seed | Topics | |
|---|---|---|---|
| 2 | 0 | 6142 | entertainment, politics |
| 2 | 1 | 6142 | business, entertainment |
| 2 | 2 | 6142 | politics, tech |
| 3 | 0 | 6142 | entertainment, politics, tech |
| 3 | 1 | 6142 | business, entertainment, tech |
| 3 | 2 | 6142 | entertainment, sport, tech |
| Run | Seed | Topics | |
|---|---|---|---|
| 2 | 0 | 6142 | rec.motorcycles, sci.crypt |
| 2 | 1 | 6142 | misc.forsale, sci.crypt |
| 2 | 2 | 6142 | alt.atheism, rec.autos |
| 3 | 0 | 6142 | rec.autos, sci.crypt, talk.religion.misc |
| 3 | 1 | 6142 | alt.atheism, comp.sys.mac.hardware, rec.autos |
| 3 | 2 | 6142 | rec.motorcycles, soc.religion.christian, talk.politics.mideast |
| Run | Seed | Topics | |
|---|---|---|---|
| 2 | 0 | 6142 | Mathematics; Music |
| 2 | 1 | 6142 | Language and literature; Music |
| 2 | 2 | 6142 | Agriculture, food, and drink; Language and literature |
| 3 | 0 | 6142 | Language and literature; Music; Warfare |
| 3 | 1 | 6142 | Agriculture, food, and drink; Engineering and technology; Language and literature |
| 3 | 2 | 6142 | Language and literature; Social sciences and society; Video games |
| Sentence-level | Document-level | |||||||
| Dataset | SentenceETM | SentenceLDA | senLDA | SenClu | BERTopic | ETM | LDA | |
| BBC News | 2 | 281 | 1946 | 86 | 1.6 | 1.6 | 4.3 | 26 |
| 3 | 328 | 1391 | 87 | 1.9 | 1.6 | 4.4 | 23 | |
| 5 | 410 | 1815 | 88 | 2.3 | 1.7 | 4.6 | 24 | |
| Avg. | 340 | 1717 | 87 | 1.9 | 1.6 | 4.4 | 25 | |
| 20 Newsgroups | 2 | 210 | 1913 | 81 | 1.2 | 1.5 | 4.0 | 22 |
| ARI | AMI | ||||||
|---|---|---|---|---|---|---|---|
| Model | |||||||
| mpnet | SentenceETM | 0.76 0.04 | 0.69 0.03 | 0.63 0.01 | 0.67 0.04 | 0.62 0.03 | 0.61 0.01 |
| SentenceLDA | 0.52 0.12 | 0.58 0.03 | 0.54 0.07 | 0.50 0.08 | 0.54 0.02 | 0.52 0.05 | |
| senLDA | 0.52 0.08 | 0.43 0.11 | 0.46 0.07 | 0.45 0.06 | 0.39 0.10 | 0.45 0.05 | |
| SenClu | 0.26 0.22 | 0.25 0.12 | 0.23 0.04 | 0.25 0.20 | 0.26 0.11 | 0.26 0.04 | |
| BERTopic | 0.00 0.00 | 0.01 0.02 | 0.08 0.01 | 0.00 0.00 | 0.01 0.01 | 0.11 0.01 | |
| ARI | AMI | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Model | |||||||||
| mpnet | SentenceETM | 0.56 0.05 | 0.46 0.03 | 0.35 0.04 | 0.27 0.02 | 0.48 0.03 | 0.44 0.02 | 0.41 0.05 | 0.37 0.04 |
| SentenceLDA | 0.16 0.04 | 0.23 0.02 | 0.30 0.07 | 0.25 0.03 | 0.26 0.03 | 0.37 0.01 | 0.39 0.05 | 0.33 0.03 | |
| senLDA | 0.22 0.13 | 0.30 0.02 | 0.21 0.03 | 0.17 0.05 | 0.18 0.08 | 0.26 0.01 | 0.22 0.03 | 0.21 0.05 | |
| SenClu | 0.36 0.19 | 0.35 0.07 | 0.28 0.03 | 0.23 0.04 | 0.32 0.16 | 0.33 0.06 | 0.33 0.03 | 0.31 0.05 | |
| BERTopic | 0.00 0.00 | 0.02 0.03 | 0.09 0.02 | 0.06 0.08 | 0.00 0.00 | 0.03 0.03 | 0.12 0.02 | 0.10 0.10 | |
| ARI | AMI | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Model | |||||||||
| mpnet | SentenceETM | 0.69 0.13 | 0.57 0.08 | 0.45 0.15 | 0.47 0.04 | 0.61 0.15 | 0.55 0.09 | 0.47 0.15 | 0.55 0.02 |
| SentenceLDA | 0.44 0.11 | 0.41 0.07 | 0.38 0.15 | 0.45 0.05 | 0.45 0.09 | 0.48 0.09 | 0.42 0.15 | 0.50 0.04 | |
| senLDA | 0.53 0.19 | 0.47 0.08 | 0.31 0.09 | 0.29 0.04 | 0.46 0.18 | 0.43 0.08 | 0.34 0.09 | 0.38 0.03 | |
| SenClu | 0.37 0.32 | 0.40 0.16 | 0.22 0.15 | 0.27 0.04 | 0.34 0.28 | 0.38 0.15 | 0.23 0.15 | 0.34 0.03 | |
| BERTopic | 0.00 0.00 | 0.00 0.00 | 0.04 0.02 | 0.11 0.05 | 0.00 0.00 | 0.00 0.00 | 0.08 0.01 | 0.18 0.03 | |
| True Predicted | Sentence |
|---|---|
| BBC News | |
| Entertainment Sport | There were no specific details on the injuries . |
| Business Tech | It will do so at a presentation in New York on 26 January . |
| Business Politics | “I will give up my role as soon as the board of directors asks me to do so,” he said . |
| Business Politics | In both cases, the justification has been national security, amid allegations that the Turkish firms are too close to Israel . |
| Business Politics | “First and foremost this is a human tragedy.” |
| Topic | Label | Top words |
|---|---|---|
| 0 | Lockdowns | shut, close, country, open, allow, state, democrats, destroy, wrong, throw |
| 1 | Accusations | man, plan, lie, fraud, office, name, liar, run, wait, acknowledge |
| 2 | Mail-in voting | ballot, vote, count, send, poll, mail, solicit, state, open, director |
| 3 | Electric cars | car, cheap, expensive, electric, safe, cost, standard, automobile, tiny, least |
| 4 | Conversational | guess, wrong, hit, honest, suppose, hey, excuse, surprised, feel, plenty |
| 5 | Achievements | job, win, top, thank, proud, testify, set, every, happy, administration |
Topic Modeling
Topic modeling discovers recurring themes and document-topic structure in text, helping organize, compare, and track large collections.
See all 58 papers