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}
}

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.3.tar.gz (19.2 MB view hashes)

Uploaded Source

Built Distribution

global_gender_predictor-0.0.3-py3-none-any.whl (19.2 MB view hashes)

Uploaded Python 3

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