bnriiitb / infer-gender

Infer gender from the Indian first name or full name

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Infer Gender


Infers gender from the indian first name or full name.

Installation


Using pip

PyPi Version

You can install using the pip package manager by running

pip install infer-gender

Alternatively, you could install the latest version directly from Github:

pip install https://github.com/bnriiitb/infer-gender/infer-gender/archive/master.zip

Using conda

You can install using the conda package manager by running

conda install -c conda-forge infer-gender

From source

Download the source code by cloning the repository or by pressing 'Download ZIP' on this page.

Install by navigating to the proper directory and running:

python setup.py install

Usage


from infer_gender import GenderPredictor
gp = GenderPredictor()

sample_names = ['katrina kaif','narendra modi','naga budigam','james bond','samantha']
predicted_genders = gp.predict_gender(sample_names)

for name,pred_gender in zip(sample_names,predicted_genders):
    print('{} --> {}'.format(name,pred_gender))
katrina kaif --> Female
narendra modi --> Male
naga budigam --> Male
james bond --> Male
samantha --> Female

About

Infer gender from the Indian first name or full name

License:MIT License


Languages

Language:Python 97.2%Language:Shell 2.8%