Polling Latent Opinions: A Method for Computational Sociolinguistics Using Transformer Language Models

Philip Feldman, Aaron Dant, James R. Foulds, Shemei Pan
4/15/2022
cs.CLcs.CY
transformer-attention

Official code: pgfeldman/KeywordExplorer (9 stars, Python, MIT, last commit 2023-12-11).

Abstract

Text analysis of social media for sentiment, topic analysis, and other analysis depends initially on the selection of keywords and phrases that will be used to create the research corpora. However, keywords that researchers choose may occur infrequently, leading to errors that arise from using small samples.

Show full abstract

In this paper, we use the capacity for memorization, interpolation, and extrapolation of Transformer Language Models such as the GPT series to learn the linguistic behaviors of a subgroup within larger corpora of Yelp reviews. We then use prompt-based queries to generate synthetic text that can be analyzed to produce insights into specific opinions held by the populations that the models were trained on. Once learned, more specific sentiment queries can be made of the model with high levels of accuracy when compared to traditional keyword searches. We show that even in cases where a specific keyphrase is limited or not present at all in the training corpora, the GPT is able to accurately generate large volumes of text that have the correct sentiment.

View on arXivView PDF

Code Implementations(1)

MIT

Collection of Python desktop (tkinter) apps that lets you interact with LLMs in a variety of ways

92PythonMar 1, 20222 years agoMIT
gpt-2gpt-3mariadbopenai-apipython3+2 more

Similar Papers

Cite this paper

@article{feldman2022polling,
  title  = {Polling Latent Opinions: A Method for Computational Sociolinguistics Using Transformer Language Models},
  author = {Philip Feldman and Aaron Dant and James R. Foulds and Shemei Pan},
  year   = {2022},
  eprint = {2204.07483},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2204.07483}
}

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

Discussion