From names in multiple languages to genders.
Project description
Name2Gender
From names in multiple languages to genders.
Installation
- From PyPi
pip install -U name2gender
or
uv add -U name2gender
- From Github
pip install git+https://github.com/vortezwohl/Name2Gender.git
Quick Start
-
Import SDKs
from name2gender import Name2Gender, Gender
-
Gender recognition based on names
n2g = Name2Gender() names = ['吴子豪', '吴彦祖', '梅艳芳', '张曼玉', 'Donald Trump', 'Ivanka Trump', 'Justin Bieber', 'The Weeknd', 'Luigi Nicholas Mangione', 'Elizabeth II', 'Henry VIII'] for name in names: _gender, _prob = n2g(name, return_probability=True) print(name, 'is', _gender, 'with a probability of', f'{_prob * 100:.2f}%')
stdout:
吴子豪 is Gender.Male with a probability of 99.71% 吴彦祖 is Gender.Male with a probability of 100.00% 梅艳芳 is Gender.Female with a probability of 99.99% 张曼玉 is Gender.Female with a probability of 99.92% Donald Trump is Gender.Male with a probability of 99.90% Ivanka Trump is Gender.Female with a probability of 99.66% Justin Bieber is Gender.Male with a probability of 100.00% The Weeknd is Gender.Male with a probability of 97.66% Luigi Nicholas Mangione is Gender.Male with a probability of 99.27% Elizabeth II is Gender.Female with a probability of 99.71% Henry VIII is Gender.Male with a probability of 99.90%
Use Name2Gender with CLI
-
Install model
n2g install name2gender-smallstdout:
Successfully installed model "name2gender-small". -
Predict genders
n2g predict LadyGagastdout:
"LadyGaga" is FEMALE with an probability of 99.64%. -
Uninstall model
n2g uninstall name2gender-smallstdout:
Model "name2gender-small" is uninstalled.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
name2gender-0.0.5a0.tar.gz
(16.3 kB
view details)
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 name2gender-0.0.5a0.tar.gz.
File metadata
- Download URL: name2gender-0.0.5a0.tar.gz
- Upload date:
- Size: 16.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65ab2b53d18fd0f2a775cb177c2f9740a553c321331f32738b18b4b1d210cad5
|
|
| MD5 |
162712b63ad5635783dde8d5a4946220
|
|
| BLAKE2b-256 |
5721f24eb695ea1a4dd2e01cfe274adb8535e0afbe63c1a0837f24d44f3dd670
|
File details
Details for the file name2gender-0.0.5a0-py3-none-any.whl.
File metadata
- Download URL: name2gender-0.0.5a0-py3-none-any.whl
- Upload date:
- Size: 17.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b25d0d257aa59955989ec0ef8a91f6d556875b5754a87cf2987046bc458c665
|
|
| MD5 |
5cccad6db05662fcdd8c0ab8e179e526
|
|
| BLAKE2b-256 |
23229b689d5be091592f1aaab4cd54511bba339e24e9100d02a3394e18ba388d
|