A simple python package to detect gender by Persian first name. (With more than 19K names).
Project description
Persian Gender Detection
A simple python package to detect gender by Persian first name. (With more than 19K names)
for this package i use this repo if you are use NPM that's great choice.
Installation
Install with PIP:
$ pip install persian-gender-detection
Example
from persian_gender_detection import get_gender
# Detect gender
get_gender(' عــــلی ') # MALE
get_gender('نرگـــ😉ــس') # FEMALE
get_gender('حســ😎ــن') # MALE
get_gender('۱۲۳۹۹۳محمدعلی123') # MALE
get_gender('۱۲۳مهناز۱۲۳') # FEMALE
get_gender('فاطمه زهرا') # UNKNOWN
get_gender('فاطمه زهرا',
find_nearest_name=True) # (FEMALE, 'فاطمه')
get_gender('محمدنیسنممدیتیس',
find_nearest_name=True) # ('MALE', 'محمد')
Changelog
1.2.1
- Fixed issues in two-part names and added find_nearst_name flag to find and return the nearest name.
1.1.0
- Increasing the dataset of names from 6k to 19k
- convert names dataset from JSON to Python dictionary
- If a name does not exist in the dataset, it finds the gender in two-part names using the first part.
1.0.5
- First version with 6k name dataset
Issues
Feel free to submit issues and enhancement requests.
Contributing
Please feel free to contribute names database with your kindly pull requests.
License
Licensed under MIT License
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
persian-gender-detection-1.2.1.tar.gz
(140.2 kB
view hashes)
Built Distribution
Close
Hashes for persian-gender-detection-1.2.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4865dc5a0964379f49ccc3758ff4982df8587ed14790fa7eb901d0de9787b53 |
|
MD5 | ca015e9bf3b326de20481e24fa586277 |
|
BLAKE2b-256 | 74f2552c961fff067288c145b3f6a12be6cba31fa200702bbacb1c37df12bacf |
Close
Hashes for persian_gender_detection-1.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45beb42e2d1152068faabe9c33482def34faa69b817ccf67f3c4467d86ce29f1 |
|
MD5 | ba68861749dc340c28a68cbdf733533e |
|
BLAKE2b-256 | 42870cae9880c5af0266c5433c69da5528a2ed014ce23a48e560ad922714c526 |