Cross-lingual Contextualized Topic Models with Zero-shot Learning

Federico Bianchi, Silvia Terragni, Dirk Hovy, Debora Nozza, Elisabetta Fersini

Abstract

Traditional topic models are often restricted to the language they were trained on due to their reliance on language-specific bag-of-words (BoW) representations. This paper introduces ZeroShotTM, a novel neural topic model that overcomes this limitation by utilizing multilingual contextualized embeddings (SBERT). By mapping documents into a shared semantic space, ZeroShotTM can predict topics for languages it has never encountered during training. Experimental results demonstrate that a model trained solely on English can effectively categorize documents in Italian, French, German, and Portuguese with high stability and coherence.

Introduction

Topic modeling is a fundamental task in natural language processing, used to discover latent thematic structures in large document collections. However, classical methods like Latent Dirichlet Allocation (LDA) are "language-locked." They treat words as discrete tokens, meaning "dog" and "cane" are seen as unrelated features. Consequently, standard models cannot generalize across languages without explicit multilingual training or massive parallel corpora.

Building multilingual topic models typically involves two major challenges:

  1. Vocabulary Explosion: Merging multiple languages creates a sparse, high-dimensional feature space that is computationally taxing.
  2. Data Scarcity: Many languages lack the volume of digitized text required to train robust topic models from scratch.

ZeroShotTM addresses these issues by asking whether a model can learn the "gist" of a topic in one language and transfer that understanding to others without requiring translated data during the training phase.

Methodology

ZeroShotTM builds upon the Neural-ProdLDA framework, a Variational Autoencoder (VAE) based topic model. The critical innovation lies in replacing the traditional Bag-of-Words (BoW) input with multilingual contextualized embeddings from pre-trained models like SBERT.

The ZeroShotTM architecture utilizes contextualized embeddings for inference while reconstructing a bag-of-words representation.

The Training Process

The model architecture consists of an encoder and a decoder:

  • Inference (Encoder): Instead of a BoW vector, the encoder takes an SBERT embedding of a document. SBERT maps sentences with similar meanings into the same vector space regardless of language. The encoder maps this embedding to a latent topic distribution.
  • Reconstruction (Decoder): The decoder attempts to reconstruct the original BoW representation (in the training language, e.g., English) from the sampled latent distribution.
  • Zero-shot Capability: During testing, the model can process documents in a new language (e.g., French). Because the French SBERT embedding resides in the same semantic neighborhood as its English equivalent, the model correctly maps it to the corresponding topic.

Experimental Setup

The authors evaluated the model using Wikipedia abstracts from DBpedia across two primary datasets:

  • W1: 20,000 English abstracts used to benchmark single-language performance against baseline models.
  • W2: 100,000 English documents for training, paired with a test set of 300 entities available in English, Italian, French, German, and Portuguese. This setup allowed for testing cross-lingual topic stability—checking if the same entity is assigned the same topic across different languages.

Results

Performance and Coherence

ZeroShotTM maintains competitive performance compared to state-of-the-art monolingual models. On the English-only W1 dataset, it achieved an NPMI coherence score of 0.1632, nearly matching Neural-ProdLDA (0.1658) and vastly outperforming traditional LDA (-0.0246).

Comparison of NPMI coherence scores for different models on the English dataset.

Cross-lingual Stability

The model demonstrated remarkable zero-shot capabilities. When tested on non-English documents, the predicted topics matched the English version's topics over 70% of the time on average (reaching 78% for a 25-topic model). Human evaluations further validated these results, with an average topic quality score of 2.26 out of 3 across all five languages, indicating that the topics were highly relevant to the document content.

Computational Efficiency

The neural architecture is highly efficient. Training on 20,000 documents takes approximately 1.2 seconds per epoch on a standard mobile GPU, making it accessible for researchers without massive compute resources.

Discussion and Future Work

ZeroShotTM proves that BoW representations are not strictly necessary for topic inference; contextual embeddings serve as a powerful substitute that enables cross-lingual transfer. However, some limitations remain. Currently, the "topic descriptors" (the words representing a topic) are generated in the training language. Future work could explore mapping these labels back to the target language's vocabulary. Additionally, the model's performance is tied to the quality of the underlying multilingual embeddings, which may vary for low-resource languages.

Despite these challenges, the ability to "piggyback" on pre-trained semantic spaces opens new avenues for analyzing multilingual corpora without the need for expensive data alignment.

Summary updated

BibTeX
@inproceedings{bianchi2021cross,
  author = {Federico Bianchi and Silvia Terragni and Dirk Hovy and Debora Nozza and Elisabetta Fersini},
  title = {{Cross-lingual Contextualized Topic Models with Zero-shot Learning}},
  booktitle = {EACL},
  year = {2021},
  doi = {10.18653/v1/2021.eacl-main.143},
}
Figure