Metadata-Version: 2.4
Name: gendercast
Version: 1.0.1
Summary: Gender prediction tool using LLMs and database methods
Author-email: "Michael S. Yao" <michael.yao@pennmedicine.upenn.edu>
Maintainer-email: "Michael S. Yao" <michael.yao@pennmedicine.upenn.edu>
License: MIT License
        
        Copyright (c) 2025 University of Pennsylvania
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/michael-s-yao/medicine-authorship
Keywords: gender-prediction,gender-guesser
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests
Requires-Dist: tqdm
Requires-Dist: transformers
Requires-Dist: datasets
Requires-Dist: torch
Requires-Dist: genderizer3
Requires-Dist: gender_guesser
Requires-Dist: global_gender_predictor
Requires-Dist: openai
Requires-Dist: accelerate
Requires-Dist: click
Requires-Dist: umap-learn
Requires-Dist: thefuzz
Requires-Dist: statsmodels
Requires-Dist: gender_extractor
Requires-Dist: unidecode
Dynamic: license-file

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

[![LICENSE](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE.md)
[![CONTACT](https://img.shields.io/badge/contact-michael.yao%40pennmedicine.upenn.edu-blue)](mailto:michael.yao@pennmedicine.upenn.edu)

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

```python
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:

```python
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`](./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](mailto:michael.yao@pennmedicine.upenn.edu)

## 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](LICENSE)).
