Predict gender using first name using data from World Gender Name Dictionary 2.0.
Project description
# Global Gender Predictor
Predict gender using first name using data from World Gender Name Dictionary 2.0.
The dataset contains 4,148,966 unique names. The predictor is case-insensitive and predicts Male
, Female
, or Unknown
(i.e. unisex or not found in data)
Install using pip:
pip install global_gender_predictor
Usage
from global_gender_predictor import GlobalGenderPredictor
predictor = GlobalGenderPredictor()
predictor.predict_gender('John')
'Male'
predictor.predict_gender('Jane')
'Female'
predictor.predict_gender('attract.ai')
'Unknown'
The dataset contains probabilities for each name:
{'name': 'taylor', 'gender_prob': {'F': 0.699, 'M': 0.301}}
.
Change the probability threshold for unisex names:
predictor.predict_gender('taylor',threshold=0.5)
'Female'
predictor.predict_gender('taylor',threshold=0.8)
'Unknown'
Citation
World Gender Name Dictionary (WGND 2.0)
@data{DVN/MSEGSJ_2021,
author = {Raffo, Julio},
publisher = {Harvard Dataverse},
title = {{WGND 2.0}},
UNF = {UNF:6:5rI3h1mXzd6zkVhHurelLw==},
year = {2021},
version = {DRAFT VERSION},
doi = {10.7910/DVN/MSEGSJ},
url = {https://doi.org/10.7910/DVN/MSEGSJ}
}
deployment
rm dist/*
python3 -m build
twine upload dist/*
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
Built Distribution
File details
Details for the file global_gender_predictor-0.0.4.tar.gz
.
File metadata
- Download URL: global_gender_predictor-0.0.4.tar.gz
- Upload date:
- Size: 19.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26d5ed7c38b8daf57c1348b1cf427099e7b485eea414bc505dcd15fa257e4c5c |
|
MD5 | dd490e5d561265a731b4fc3ea1ace34c |
|
BLAKE2b-256 | 5e6b05d17db97e51b1cae273e086177f7cff73d6675653da1a3902f758d46540 |
File details
Details for the file global_gender_predictor-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: global_gender_predictor-0.0.4-py3-none-any.whl
- Upload date:
- Size: 19.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43cff578bc8e52920e712e3def921b428cb3e82d9d41df2c30ded46cf57b6083 |
|
MD5 | 9255b601bc82f6f97090baceb0b804a9 |
|
BLAKE2b-256 | 515dcace0bf1b09dc4533f40fb7dafb9630e0bf2db7d724fc3751e22f3913653 |