Topical Language Generation using Transformers

Rohola Zandie, Mohammad H. Mahoor
3/11/2021
cs.CLcs.AI
transformer-attention

Official code: roholazandie/topical_language_generation (17 stars, Python, last commit 2024-08-12).

Abstract

Large-scale transformer-based language models (LMs) demonstrate impressive capabilities in open text generation. However, controlling the generated text's properties such as the topic, style, and sentiment is challenging and often requires significant changes to the model architecture or retraining and fine-tuning the model on new supervised data.

Show full abstract

This paper presents a novel approach for Topical Language Generation (TLG) by combining a pre-trained LM with topic modeling information. We cast the problem using Bayesian probability formulation with topic probabilities as a prior, LM probabilities as the likelihood, and topical language generation probability as the posterior. In learning the model, we derive the topic probability distribution from the user-provided document's natural structure. Furthermore, we extend our model by introducing new parameters and functions to influence the quantity of the topical features presented in the generated text. This feature would allow us to easily control the topical properties of the generated text. Our experimental results demonstrate that our model outperforms the state-of-the-art results on coherency, diversity, and fluency while being faster in decoding.

View on arXivView PDF

Code Implementations(1)

176PythonJan 14, 20202 years ago

Similar Papers

Cite this paper

@article{zandie2021topical,
  title  = {Topical Language Generation using Transformers},
  author = {Rohola Zandie and Mohammad H. Mahoor},
  year   = {2021},
  eprint = {2103.06434},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2103.06434}
}

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/2103.06434.svg)](https://codeofpaper.com/paper/2103.06434)

Discussion