Skip to main content

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

global_gender_predictor-0.0.4.tar.gz (19.2 MB view details)

Uploaded Source

Built Distribution

global_gender_predictor-0.0.4-py3-none-any.whl (19.2 MB view details)

Uploaded Python 3

File details

Details for the file global_gender_predictor-0.0.4.tar.gz.

File metadata

File hashes

Hashes for global_gender_predictor-0.0.4.tar.gz
Algorithm Hash digest
SHA256 26d5ed7c38b8daf57c1348b1cf427099e7b485eea414bc505dcd15fa257e4c5c
MD5 dd490e5d561265a731b4fc3ea1ace34c
BLAKE2b-256 5e6b05d17db97e51b1cae273e086177f7cff73d6675653da1a3902f758d46540

See more details on using hashes here.

File details

Details for the file global_gender_predictor-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for global_gender_predictor-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 43cff578bc8e52920e712e3def921b428cb3e82d9d41df2c30ded46cf57b6083
MD5 9255b601bc82f6f97090baceb0b804a9
BLAKE2b-256 515dcace0bf1b09dc4533f40fb7dafb9630e0bf2db7d724fc3751e22f3913653

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page