Determine gender from first name

350 views
Skip to first unread message

Demetrio Girardi

unread,
Jan 25, 2012, 3:49:22 AM1/25/12
to django...@googlegroups.com
This is not a django-specific question, but I couldn't find anything
useful on the subject and have no better place to ask.

Let's say I want to put "welcome {{user.first_name}}" on top of my
template. In many languages, "welcome" has to be declined by gender. I
have no use for the user's gender otherwise, so I don't want to ask
for it in the registration process.

How can I go about this? Is there a publicly available database of
first names divided by language and gender? A public web-service that
guesstimates the gender?

Praveen Krishna R

unread,
Jan 25, 2012, 3:59:22 AM1/25/12
to django...@googlegroups.com
I don't know if there are any databases or webservices available for the purpose. But how would you handle the exceptions ?! Like if it does not exist in the db, and common names used across genders ?!


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.




--
Thanks and Regards,
Praveen Krishna R

kenneth gonsalves

unread,
Jan 25, 2012, 4:50:36 AM1/25/12
to django...@googlegroups.com
On Wed, 2012-01-25 at 09:49 +0100, Demetrio Girardi wrote:
> How can I go about this? Is there a publicly available database of
> first names divided by language and gender? A public web-service that
> guesstimates the gender?

not possible in my opinion. There may be some languages where a name
*has* to have gender specific suffix. All the languages I know do not.
Maria, Rama, Krishna, for example are not gender specific.
--
regards
Kenneth Gonsalves

Anoop Thomas Mathew

unread,
Jan 25, 2012, 5:03:28 AM1/25/12
to django...@googlegroups.com
Hi,

If you are looking for a fuzzy solution, you can find it here
https://github.com/sholiday/genderPredictor
This should suit your purpose.
It uses nltk package for predicting, but as Kenneth said, it won't be 100% perfect. You can expect 80-90% success.

Hope this helps.
Thanks,
Anoop


atm
___
Life is short, Live it hard.




walter capio

unread,
Jan 27, 2012, 10:20:04 AM1/27/12
to django...@googlegroups.com
All depends on how many users you have and how accurate you want your data to be. If your language uses specific morphemes for women (usually non-european languages have marked feminine morphemes; male names and pronouns are not marked), then you could write a parser for these names. Yet I doubt your data will be any better than 90% accurate. Don't forget people construct virtual identities and often use loanwords. You could also parse their content (blogs, comments,... *is this legal?) and see which first person pronouns, verbs, etc. they use. If the latter are explicit feminine forms, use a feminine welcome.

So, I would just work around the gender-specific welcome. Replace it somehow. Convince your client it is somehow spooky to directly address the visitor.

Or, even better, add a gender category to your db and register form and convince your client that some day it will prove interesting for data mining purposes.

greetings,
djinja



> Subject: Re: Determine gender from first name
> From: law...@thenilgiris.com
> To: django...@googlegroups.com
> Date: Wed, 25 Jan 2012 15:20:36 +0530

Jonathan Paugh

unread,
Jan 26, 2012, 3:47:28 AM1/26/12
to django...@googlegroups.com
----- Original Message -----

From: Demetrio Girardi

Sent: 01/25/12 03:49 AM

To: django...@googlegroups.com

Subject: Determine gender from first name


 
This is not a django-specific question, but I couldn't find anything 
useful on the subject and have no better place to ask. 

Let's say I want to put "welcome {{user.first_name}}" on top of my 
template. In many languages, "welcome" has to be declined by gender. I 
have no use for the user's gender otherwise, so I don't want to ask 
for it in the registration process. 

How can I go about this? Is there a publicly available database of 
first names divided by language and gender? A public web-service that 
guesstimates the gender? 

-- 
You received this message because you are subscribed to the Google Groups "Django users" group. 
To post to this group, send email to django...@googlegroups.com. 
To unsubscribe from this group, send email to django-users...@googlegroups.com. 
For more options, visit this group at http://groups.google.com/group/django-users?hl=en. 

 

What about the boy named Sue?

In some cultures, guessing "male" might be somewhat acceptable. On the other hand, any guess could be wrong---and offensive. My advice is to ask. Perhaps make it optional, with a default to one or the other; at least if they take offense they can fix it.

Of course, you could reword your translation so as to get around this, but that may be more difficult and awkward than it's worth.

Carsten Agger

unread,
Jan 26, 2012, 9:11:29 AM1/26/12
to django...@googlegroups.com
Den 25-01-2012 09:59, Praveen Krishna R skrev:
> *I don't know if there are any databases or webservices available for

> the purpose. But how would you handle the exceptions ?! Like if it does
> not exist in the db, and common names used across genders ?!*
> *
> *
>

In general this would not be possible.

Kim, e.g., is used as a female name in English and as a male name in
Scandinavian languages.

Robin is used as a female and male name.

Then there's combinations such as Jos� Mar�a and Mar�a Jos�, which
require knowledge of Spanish naming conventions.

Andrea is a male name in Italian.

I think you might go by a list but there'd always be errors.


--
Carsten Agger
Magenta ApS
�bogade 15
8200 �rhus N

Tlf +45 2086 5010
http://www.magenta-aps.dk
cars...@magenta-aps.dk

Casper Strømgren

unread,
Sep 27, 2013, 11:41:48 AM9/27/13
to django...@googlegroups.com
Hey Demetrio

You can use http://genderize.io which is a free API.

A problem with determining a gender from a name is that people can call their children almost anything they'd like. Genderize.io tries to solve this by collecting data from social networks (where people can also call themselves whatever they'd like). Furthermore, it has the ability of filtering results by country or language.

It also provides a certainty factor along with the gender. So you can set a bar of when you want to trust it.
Reply all
Reply to author
Forward
0 new messages