A Package to Predict the Gender of a Person based on their Name (Suited for Indian Names)
Project description
GenderPred-IN
GenderPred-IN is a Python package that predicts the gender of a person based on their name. It is specifically suited for Indian names.
Getting Started
Installation
You can install the package using pip (easy-peasy way):
pip install genderpred_in
or you can use github to install (harder way):
- Clone the repository:
git clone https://github.com/DhrvM/GenderPred-India.git
cd GenderPred-India
- Install the package:
pip install .
- Verify the installation:
pip list
Usage
Import Package
from genderpred_in import classify_name, get_name, get_first_name, get_male_probability, get_female_probability, get_gender
Here is an example of how to use the package:
# Classify the name "Rohit"
result = classify_name("Rohit")
# Retrieve and print the results
full_name = get_name(result)
first_name = get_first_name(result)
male_prob = get_male_probability(result)
female_prob = get_female_probability(result)
gender = get_gender(result)
print(f"Full Name: {full_name}")
print(f"First Name: {first_name}")
print(f"Male Probability: {male_prob}")
print(f"Female Probability: {female_prob}")
print(f"Gender: {gender}")
Example Output:
Full Name: Rohit
First Name: ROHIT
Male Probability: 0.9916077852249146
Female Probability: 0.008392222225666046
Gender: male
Functions
-
classify_name(full_name)
: Classifies the given full name and returns a dictionary with the name, first name, gender, and probabilities. -
get_name(result)
: Retrieves the full name from the classification result. -
get_first_name(result)
: Retrieves the first name from the classification result. -
get_male_probability(result)
: Retrieves the male probability from the classification result. -
get_female_probability(result)
: Retrieves the female probability from the classification result. -
get_gender(result)
: Retrieves the predicted gender from the classification result. (Output: male, female, unknown)
Versions
Version 1.0.1
Uses LSTM model with a tokenized First-Name to Generate Predictions of Gender.
Built With
-
TensorFlow - The machine learning framework used
-
Keras - High-level neural networks API
-
NumPy - Used for numerical computing
-
Pandas - Data manipulation and analysis
Authors
Dhruv Malpani - Initial Work
License
This project is licensed under the MIT License - see the LICENSE.md file for details.
Acknowledgments
Your article helped me create the initial model using Logistic Regression and n-grams. (article)
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
Built Distribution
Hashes for genderpred_in-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30b70db1907339e5a39e578ee2c81dcb44236703335a923171e91528d32a0707 |
|
MD5 | 7e0bb4399126ec442e0458b566935f55 |
|
BLAKE2b-256 | 9a78dd4d989a5d9b1d3027544c50e37cd74e0695f5c2c025ed2c62aadf32e9e5 |