Skip to content

gupta07ayush/GenderGame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GenderGame

Program can guess the gender of given the given name based on the country id.

gender

Country names and their id

IN India
GB United Kingdom

It is recommended to check the count of the response when using localization. If the count is very low or gender is null, you can fallback to a request with no localization.

All services follow ISO 3166-1 alpha-2 for country codes. Check our data to see a list of all supported countries.

USE CASES

What other people are using gender prediction for:-

People use gender classification for a lot things. Here you'll find a selected list of articles and projects that use Genderize.io, Agify.io or Nationalize.io to determine the gender, age and nationality of names.

How we analysed 70 million comments on the Guardian website

In this report, The Guardian analyses 70 million comments posted on their website. It provides quantitative evidence for online abuse and trolling. The result in short: Out of the 10 most abused writers, 8 were women. The two men were black.

Read article
The Atlantic by Ed Yong

When Will the Gender Gap in Science Disappear?

Read article
The Washington Post by Philip Bump

Here’s how Hillary Clinton knows that 61 percent of her donors were women

Read article

python 3.x pip install requests

#requests 2.28.2 This library will be used for making requests to the API Requests allows you to send HTTP/1.1 requests extremely easily. There’s no need to manually add query strings to your URLs, or to form-encode your PUT & POST data — but nowadays, just use the json method! Requests is one of the most downloaded Python packages today, pulling in around 30M downloads / week— according to GitHub, Requests is currently depended upon by 1,000,000+ repositories. You may certainly put your trust in this code.

#The url that we will be using will take this format: https://api.genderize.io?name={YOUR_NAME}

#The genderize.io website provides a playground where you can test the API. #The API is free for up to 1000 names/day.

The request will render a response like the following:

{ "name": "YOUR_NAME", "gender": "male", "probability": 0.99, "count": 165452 }

The probability indicates the certainty of the assigned gender. Basically the ratio of male to females. The count represents the number of data rows examined in order to calculate the response.

#Batch usage Checking the gender of multiple names in a request You can infer the gender of up to 10 names at a time. To do so, send an array of names as the "name" parameter.

https://api.genderize.io/?name[]=peter&name[]=lois&name[]=stevie

#Localization Classifying genders in the scope of a specific country Naming conventions can rely heavily on demographics. Therefore, the API accepts an optional "country_id" parameter, for when you have that information. In a lot of cases, this will make the guess more correct.

https://api.genderize.io?name=peter&country_id=US

#Responses & Errors How to understand your gender checking All responses wil be in "content-type: application/json; charset=utf-8".

Here's a list of the errors the API can respond with. Some of them will only apply if you're using an API key.

401 - Unautherized

{ "error": "Invalid API key" } 402 - Payment Required

{ "error": "Subscription is not active" } 422 - Unprocessable Entity

{ "error": "Missing 'name' parameter" } 422 - Unprocessable Entity

{ "error": "Invalid 'name' parameter" } 429 - Too Many Requests

{ "error": "Request limit reached" } 429 - Too Many Requests

{ "error": "Request limit too low to process request" }