Skip to main content

Package to compute AnthroScore, a computational linguistic measure of anthropomorphism in text

Project description

AnthroScore

This repository contains code to compute AnthroScore. AnthroScore is introduced in the following paper, which is accepted to EACL 2024:

AnthroScore: A Computational Linguistic Measure of Anthropomorphism

Myra Cheng, Kristina Gligoric, Tiziano Piccardi, Dan Jurafsky (Stanford University)

Abstract:

Anthropomorphism, or the attribution of human-like characteristics to non-human entities, has shaped conversations about the impacts and possibilities of technology. We present ANTHROSCORE, an automatic metric of implicit anthropomorphism in language. We use a masked language model to quantify how non-human entities are implicitly framed as human by the surrounding context. We show that ANTHROSCORE corresponds with human judgments of anthropomorphism and dimensions of anthropomorphism described in social science literature. Motivated by concerns of misleading anthropomorphism in computer science discourse, we use ANTHROSCORE to analyze 15 years of research papers and downstream news articles. In research papers, we find that anthropomorphism has steadily increased over time, and that papers related to natural language processing (NLP) and language models have the most anthropomorphism. Within NLP papers, temporal increases in anthropomorphism are correlated with key neural advancements. Building upon concerns of scientific misinformation in mass media, we identify higher levels of anthropomorphism in news headlines compared to the research papers they cite. Since ANTHROSCORE is lexicon-free, it can be directly applied to a wide range of text sources.

Setup

  1. Download the repository, either
  • via pip: pip install anthroscore-eacl or
  • via Github: git clone https://github.com/myracheng/anthroscore.git; cd anthroscore; pip install .
  1. Install the spaCy model: python -m spacy download en_core_web_sm (The specific model used is https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.7.1/en_core_web_sm-3.7.1-py3-none-any.whl#sha256=86cc141f63942d4b2c5fcee06630fd6f904788d2f0ab005cce45aadb8fb73889)

Example Usage

To obtain AnthroScores for the terms "model" and "system" in abstracts from examples/acl_50.csv (a subset of ACL Anthology papers)

python get_anthroscore.py --input_file example/acl_50.csv \
    --text_column_name abstract --entities system model \
    --output_file example/results.csv --text_id_name acl_id

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

anthroscore-eacl-0.0.2.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

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

anthroscore_eacl-0.0.2-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file anthroscore-eacl-0.0.2.tar.gz.

File metadata

  • Download URL: anthroscore-eacl-0.0.2.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for anthroscore-eacl-0.0.2.tar.gz
Algorithm Hash digest
SHA256 23db9d8efa2756d4c76d2d19c49996eaa3fdb5e0c451c6c1ee4fd18113af1046
MD5 c8d64d78ca19154e6e9addc1144759e4
BLAKE2b-256 84643e98a3ad4d21dc30120797f59ab58c3849c87a9b4c345ac022df614113b8

See more details on using hashes here.

File details

Details for the file anthroscore_eacl-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for anthroscore_eacl-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7321fea6eabc7a8e261d5549305a7a8f9c1647061637d8ce5be9414e346ddf99
MD5 72f9470d1526c71a3aa5a698f5afbe68
BLAKE2b-256 cdb2fb19b56312995e894e7ae57f4f0a8703303779def69de4a2f929afd58e23

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