April 15th, 2013, 12:52 PM
Algorithm to Detect Gender(m/f) from Name
Actually I am developing an application in which I want a feature by which the application can detect whether any name is male or female name.
I did Google search on this, but could not find any algorithm/code by which I can do it.
So finally I found a website which is doing the same thing pretty good.
So I was thinking to use their API in my application. But Actually I am looking for an algorithm that can be used to do the same.
But before that just wanted to how they are detecting the gender from name?? Is it really possible to do it algorithmically??If yes please suggest some docs/links.
Thanks in Advance,
April 15th, 2013, 01:14 PM
It's not. Consider names like "Jamie" or "Alex".
But you can build up a giant database of names+genders and look up names in there.
April 15th, 2013, 05:07 PM
No, of course it is not possible - not from the name alone. The only viable method (and the means by which the website you referenced no doubt does it), is by look-up. You need a large database or list of all boys names and all girls names, and you simply look up the name.
The only real "algorithm" to be applied is perhaps one for efficient search. The difficult part is perhaps how to obtain a suitable database or name list. Be aware also that some names are applicable to both genders and may even be a girls name in one language or culture, but a boys in another.
Even then, there is nothing stopping fans of Johnny Cash for example from naming their boy "Sue", so all you can say about any name is that it is "traditionally" or "predominantly" applied to one gender or another.
Also in modern culture many "invented" given names occur, named for example after Cities (e.g. "Brooklyn") or cars (e.g. Mercedes), and whether such names apply to a boy or a girl is entirely the decision of the parent - there's no algorithm for that! :rolleyes:
What were you expecting!? Perhaps if you add the ASCII character codes for each letter of the name, odd numbers are girls and even numbers are boys. ;)
April 15th, 2013, 06:24 PM
Nope, all names are odd.
+/@(a.&i.)&>@;:'Fred Suzy Samantha Beth Lisa Bradley Nick'
385 443 813 387 393 707 389
Comments on this post
Last edited by b49P23TIvg; April 15th, 2013 at 06:30 PM.
[/code] are essential for python code and Makefiles!
April 16th, 2013, 06:32 PM
The best I can think of is choosing the gender of the "closest" name you can find in your lookup. Perhaps adding phonetic or audio data for each name and asking for phonetic/audio input could be an approach, and allow you to either find the exact name and its gender (if it isn't gender neutral like a car or a city) or to pick the gender of the nearest match.
Though there are names of opposite genders which "rhyme":
Bonnie (F), Donnie (M), Ronnie (M), Connie (F)
so even that wouldn't really work. All I can really say is good luck. :cheers: