Efficient and Flexible Topic Modeling using Pretrained Embeddings and Bag of Sentences

Johannes Schneider
2/6/2023
cs.CLcs.LG

Official code: JohnTailor/BertSenClu (13 stars, MIT, last commit 2023-02-08).

Abstract

Pre-trained language models have led to a new state-of-the-art in many NLP tasks. However, for topic modeling, statistical generative models such as LDA are still prevalent, which do not easily allow incorporating contextual word vectors. They might yield topics that do not align well with human judgment. In this work, we propose a novel topic modeling and inference algorithm. We suggest a bag of sentences (BoS) approach using sentences as the unit of analysis. We leverage pre-trained sentence embeddings by combining generative process models and clustering. We derive a fast inference algorithm based on expectation maximization, hard assignments, and an annealing process. The evaluation shows that our method yields state-of-the art results with relatively little computational demands. Our method is also more flexible compared to prior works leveraging word embeddings, since it provides the possibility to customize topic-document distributions using priors. Code and data is at \url{https://github.com/JohnTailor/BertSenClu}.

View on arXivView PDF

Code Implementations(1)

MIT

Topic Model based on Pretrained Sentence Embeddings (with BERT)

132PythonFeb 6, 20233 years agoMIT

Similar Papers

Cite this paper

@article{schneider2023efficient,
  title  = {Efficient and Flexible Topic Modeling using Pretrained Embeddings and Bag of Sentences},
  author = {Johannes Schneider},
  year   = {2023},
  eprint = {2302.03106},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2302.03106v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2302.03106.svg)](https://codeofpaper.com/paper/2302.03106)

Discussion