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
Built Distribution
Close
Hashes for global_gender_predictor-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37423e8a54bc204f216b0244307dd3995b41094322777e8b6b6421b43f3bfe48 |
|
MD5 | 43a3d2a6a7a9f8efb6bec27fb2d90ff7 |
|
BLAKE2b-256 | 198967d52b31866770b69fd8696076739fee39f77e49e577f6cd669a7a7571f3 |
Close
Hashes for global_gender_predictor-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43eb8bff4a201851399bf18a51ed0ca798fb129cf7b2d0ef6b4c3120b77ddb99 |
|
MD5 | 6f22ff0f13bef9d0bc2f91deadfcf24e |
|
BLAKE2b-256 | c6aeca95943a786c2dea321c0745924a0e83dc4bb5ce8e170f8b0f1bcf7b3a89 |