Skip to main content

Gender prediction tool using LLMs and database methods

Project description

Large language model-based evaluation of the impact of gender in medical research

LICENSE CONTACT

Gender disparities in academic medicine have been previously reported, but prior bibliometric studies have been limited by small sample sizes and reliance on manual gender annotation methods. These bottlenecks constrain previous analyses to only a small subset of clinical literature. To assess gender-based differences in authorship trends, research impact, and scholarly output over time in clinical research at scale, we hypothesized that large language models (LLMs) can be an effective tool to facilitate systematic bibliometric analysis of academic research trends. We conducted a retrospective, cross-sectional bibliometric study evaluating manuscripts published between January 2015 and September 2025 across over 1,000 PubMed-indexed academic medical journals. Over 1 million manuscripts, written by more than 10 million authors across 13 medical specialties, were analyzed. To enable this large-scale study, the genders of manuscript authors were annotated using a scalable LLM-based pipeline compatible with consumer-grade hardware.

As a part of this project, we have created the gendercast package, which provides a standardized API to make gender predictions from both LLMs and conventional database-based methods.

Installation and Usage

If you are interested in using the gendercast package, all you need to do is install it using pip:

python -m pip install gendercast

To see what gender prediction methods are natively available with gendercast, you can run

import gendercast
print(gendercast.list_registered_methods())

You can choose any of the listed gender prediction methods to instantiate a gender prediction engine, which can then be used for generating gender predictions:

engine = gendercast.make("meta-llama/Llama-3.1-8B")
assert "female" == engine.predict("Alice")  # Predicts the gender of a single name.
assert ["female", "male"] == engine.predict_batch(["Alice", "Bob"])  # Predicts the gender of a batch of names.

If you are interested in reproducing our research based on the gendercast package, we have provided a Dockerfile that specifies the expected compute environment. You can first build an image and then run a corresponding container using:

docker build -t medicine-authorship:latest .
docker run -it medicine-authorship:latest bash

To reproduce our experimental results, all you need to do is run

bash run.sh

Please refer to the scripts directory for the individual script file implementations.

Contact

Questions and comments are welcome. Suggestions can be submitted through Github issues. Contact information is linked below.

Michael Yao

Citation

If you found our work helpful for your research, please consider citing our paper:

@misc{yaoms2026medanalysis,
  title={Large language model-based evaluation of the impact of gender in medical research},
  author={Yao, Michael S},
  year={2026},
  doi={10.64898/2026.01.06.26343564},
  url={https://www.medrxiv.org/node/1135425.full}
}

License

This repository is MIT licensed (see LICENSE).

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

gendercast-1.0.1.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

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

gendercast-1.0.1-py3-none-any.whl (17.2 kB view details)

Uploaded Python 3

File details

Details for the file gendercast-1.0.1.tar.gz.

File metadata

  • Download URL: gendercast-1.0.1.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for gendercast-1.0.1.tar.gz
Algorithm Hash digest
SHA256 f79f6657e1e127921236f0d52167af17861bd040829d141e24ab6aab91f9d315
MD5 a10adcfd219fa979e02616d6afb6f81c
BLAKE2b-256 b67107866da2a1bbd23a926b008933f5628d5c0444370154771cc40770c175be

See more details on using hashes here.

File details

Details for the file gendercast-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: gendercast-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 17.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for gendercast-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 03d4f11af49f261cf74b8da07bf3ff250d93acd4487a32ba89571bf5e0a30b22
MD5 3203feee0503f8dceeba98ccfd0386dc
BLAKE2b-256 c1d374ffc41142c8350d74d5ef9429fc50554a334b8b66495e790d34a5b031ba

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