From names in multiple languages to gender.
Project description
Name2Gender
From names in multiple languages to gender.
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 an probability of', f'{_prob * 100:.2f}%')
stdout:
吴子豪 is Gender.Male with an probability of 99.71% 吴彦祖 is Gender.Male with an probability of 100.00% 梅艳芳 is Gender.Female with an probability of 99.99% 张曼玉 is Gender.Female with an probability of 99.92% Donald Trump is Gender.Male with an probability of 99.90% Ivanka Trump is Gender.Female with an probability of 99.66% Justin Bieber is Gender.Male with an probability of 100.00% The Weeknd is Gender.Male with an probability of 97.66% Luigi Nicholas Mangione is Gender.Male with an probability of 99.27% Elizabeth II is Gender.Female with an probability of 99.71% Henry VIII is Gender.Male with an probability of 99.90%
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.3a0.tar.gz
(16.1 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.3a0.tar.gz.
File metadata
- Download URL: name2gender-0.0.3a0.tar.gz
- Upload date:
- Size: 16.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e13874cdd484260d1462977211fb1000744a19b8d0cce2950dfe3d6a2a6ecb3
|
|
| MD5 |
9c6aca79ea1e28323fa2a3e002a3fbdf
|
|
| BLAKE2b-256 |
15c5c0b2370549df78262c7069e86e748d639608c3862b2e60ff53e0c8c4f25e
|
File details
Details for the file name2gender-0.0.3a0-py3-none-any.whl.
File metadata
- Download URL: name2gender-0.0.3a0-py3-none-any.whl
- Upload date:
- Size: 17.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf3a27f68255ec3eb05a85dbc8991fdc3cc0ee0e5da44362be48741e71c4741b
|
|
| MD5 |
507d56084e5d7478df0bbe74d186c3fd
|
|
| BLAKE2b-256 |
f8ec6f3c35254737bc6ec2ea76430d58199874caba86e072e7be0fc821a207b7
|