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
python3 -m 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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file global_gender_predictor-0.0.5.tar.gz.
File metadata
- Download URL: global_gender_predictor-0.0.5.tar.gz
- Upload date:
- Size: 19.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7bfd38ce1e5f202625c03e7271e981f7a2898f7e44580854f301eaaa66e0cf0
|
|
| MD5 |
8eaa2c9f1f7d58303a15d5d640c2220c
|
|
| BLAKE2b-256 |
7938d18de8c3510f4787c9e30c2fe9da38dfd6e405a4b76c816421d98c0785b5
|
File details
Details for the file global_gender_predictor-0.0.5-py3-none-any.whl.
File metadata
- Download URL: global_gender_predictor-0.0.5-py3-none-any.whl
- Upload date:
- Size: 19.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68bc56cc3b529c34d454833ed59d7f5c7f499cffc3932e4f48779833d0de435f
|
|
| MD5 |
28d482f91e5d4d445a80f90a054bb5c0
|
|
| BLAKE2b-256 |
3c950c319cbb8b2965fe61a4d99eeb4f965ed3db33c0b358d30d2e3b17fdea9a
|