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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: gendercast-1.0.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 371a31fd03f18d04a05ef9a03e17450600a21b6562e6d9a37c81adbcd7815965
MD5 1fac895ffa8381820e8cae8519c4ceda
BLAKE2b-256 010ad6e6ec5a32e8f9e93f786aaf9e1fe82c63ca8658e6dd6a2c8d86f78bcf97

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