Skip to main content

A Python package for automated detection of Linguistic Intergroup Bias (LIB) in text data using sentence-level sentiment and word-level abstraction analysis. Designed for research on language bias in news media and social discourse. Implements the general procedures described in: Collins, K. A., & Boyd, R. L. (2025). Automating the detection of linguistic intergroup bias through computerized language analysis. Journal of Language and Social Psychology. https://doi.org/10.1177/0261927X251318887

Project description

autoLIB

Automated Linguistic Intergroup Bias Detection in Text

autoLIB is a Python package for detecting linguistic intergroup bias (LIB) in natural language text. It combines rule-based abstraction coding (via the Linguistic Category Model) with sentence-level sentiment analysis to produce interpretable metrics of language bias. The package is designed to support social psychology, media studies, and computational linguistics research.


✨ Features

  • 📄 Sentence-level valence classification using VADER or Stanza sentiment models.
  • 🔤 Word-level abstraction scoring based on the Linguistic Category Model (LCM).
  • 🧠 Bias index computation: compares abstraction in desirable vs. undesirable descriptions.
  • 🔍 Keyword-driven sentence filtering to isolate relevant parts of text.
  • 📊 Outputs sentence-level results and overall summary statistics.
  • 🧪 Designed with transparency, replicability, and academic applications in mind.

📦 Installation

The simplest way to install this package is via the pypi build:

pip install autoLIB

📄 Citation

APA 7 Format:

Collins, K. A., & Boyd, R. L. (2025). Automating the detection of linguistic intergroup bias through computerized language analysis. Journal of Language and Social Psychology, 0261927X251318887. https://doi.org/10.1177/0261927X251318887

Bibtex


@article{collins_automating_2025,
	title = {Automating the detection of linguistic intergroup bias through computerized language analysis},
	issn = {0261-927X},
	url = {https://doi.org/10.1177/0261927X251318887},
	doi = {10.1177/0261927X251318887},
	abstract = {Linguistic bias is the differential use of abstraction, or other linguistic mechanisms, for the same behavior by members of different groups. Abstraction is defined by the Linguistic Category Model (LCM), which defines a continuum of words from concrete to abstract. Linguistic Intergroup Bias (LIB) characterizes the tendency for people to use abstract words for undesirable outgroup and desirable ingroup behavior and concrete words for desirable outgroup and undesirable ingroup behavior. Thus, by examining abstraction in a text, we can understand the implicit attitudes of the author. Yet, research is currently stifled by the time-consuming and resource-intensive method of manual coding. In this study, we aim to develop an automated method to code for LIB. We compiled various techniques, including forms of sentence tokenization, sentiment analysis, and abstraction coding. All methods provided scores that were a good approximation of manually coded scores, which is promising and suggests that more complex methods for LIB coding may be unnecessary. We recommend automated approaches using CoreNLP sentiment analysis and LCM Dictionary abstraction coding.},
	language = {EN},
	urldate = {2025-03-13},
	journal = {Journal of Language and Social Psychology},
	author = {Collins, Katherine A. and Boyd, Ryan L.},
	month = feb,
	year = {2025},
	note = {Publisher: SAGE Publications Inc},
	pages = {0261927X251318887},
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

autolib_psych-0.8.0.tar.gz (30.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

autolib_psych-0.8.0-py3-none-any.whl (27.8 kB view details)

Uploaded Python 3

File details

Details for the file autolib_psych-0.8.0.tar.gz.

File metadata

  • Download URL: autolib_psych-0.8.0.tar.gz
  • Upload date:
  • Size: 30.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.5

File hashes

Hashes for autolib_psych-0.8.0.tar.gz
Algorithm Hash digest
SHA256 e6d1e0d3f5d2fe442badb17bba184f7d1097585c1c70eed57a0534ce2a5eba0d
MD5 408add8276e7bbe894635607566e5956
BLAKE2b-256 2d3bf1daaf7119c921138a651f0ecea784c6d93b01b77aeb4201bda77151517c

See more details on using hashes here.

File details

Details for the file autolib_psych-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: autolib_psych-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 27.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.5

File hashes

Hashes for autolib_psych-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7cf92ec055c71f7d5970f77536ff16e257a6eeab74dacfd1da1417d1ef03576e
MD5 bbba2310eb8698d4781e6f7073700a08
BLAKE2b-256 71f336361709d0521301b22da263423dc2bfa64bfcc382a20c4e257ac83f8104

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page