TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

My approach to guessing a gender from a first name.

13 pointsby Stromgrenalmost 12 years ago
Hi! A short time ago, i decided to try and build an API that would try to guess the gender of a first name. I thought this might be useful for segmenting user lists for campaigning, analytics or similar. My first approach was to use a dataset of approved names from a few European countries. This was in the believe that most countries had lists like this (Which they don't) and i planned to add them as i went along. I got wiser and the first feedback i got also told me that the API should be able to do probabilistic guesses and if possible, also offer some sort of localization filter to achieve more accurate guesses. I decided to take an approach of using large, growing datasets of user profiles from social networks. Each entry containing a first name, a gender, a country_id and language_id. At last, i exposed this datamodel through http://genderize.io It responds in JSON. Simple example: http://api.genderize.io?name=robin I am now looking to get some feedback on my new approach. What do you think of this way of doing guesses. What do you think of the API? Any feedback is welcome. The API is completely free by the way.

6 comments

lutuspalmost 12 years ago
&gt; A short time ago, i decided to try and build an API that would try to guess the gender of a first name.<p>Obviously you need to run a test that uses a list of real people&#x27;s names and genders to measure the method&#x27;s accuracy. But remember the following points:<p>* People might resent any effort to pin down their gender in a commercial or advertising context.<p>* The negative outcome for a gender misidentification may be much greater than the positive outcome for a correct one.<p>* Gender-neutral names are becoming increasingly fashionable among well-educated parents, i.e. people who have money.<p>On that basis and in my opinion, unless you can get above 90% accuracy, it&#x27;s not worth doing.<p>Some popular gender-neutral names:<p><a href="http://www.babynames1000.com/gender-neutral/" rel="nofollow">http:&#x2F;&#x2F;www.babynames1000.com&#x2F;gender-neutral&#x2F;</a><p><a href="http://thestir.cafemom.com/pregnancy/157282/25_best_genderneutral_baby_names" rel="nofollow">http:&#x2F;&#x2F;thestir.cafemom.com&#x2F;pregnancy&#x2F;157282&#x2F;25_best_genderne...</a><p><a href="http://en.wikipedia.org/wiki/Unisex_name#English" rel="nofollow">http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Unisex_name#English</a><p>A quote: &quot;Unisex names have been enjoying a decent amount of popularity in English speaking countries in the past several decades.&quot;
评论 #6223084 未加载
dictumalmost 12 years ago
To anyone who is interested in implementing this in a product: don&#x27;t.<p>To be fair: do it if you must. But <i>don&#x27;t let the user see the gender field as it changes</i>. If someone has a name that&#x27;s associated with the opposite gender (or they believe themselves to be of another gender), seeing the change to that gender in the gender field will make them sad, annoyed, or irritated. At best, they will chuckle at the failed attempt to predict their gender.<p>This is one of those things that, when they work as intended, users don&#x27;t notice it and it doesn&#x27;t improve their experience that much, but when it fails, they notice and the annoyance hurts your image.
dalkealmost 12 years ago
I see that you are missing various Swedish names, like Gudrun. I don&#x27;t know if you can get the full list of names, but you can get the list of names which were given to at least 10 girls in the last decade or so at:<p><a href="http://www.scb.se/Pages/TableAndChart____31028.aspx" rel="nofollow">http:&#x2F;&#x2F;www.scb.se&#x2F;Pages&#x2F;TableAndChart____31028.aspx</a><p>and for boys at:<p><a href="http://www.scb.se/Pages/TableAndChart____31036.aspx" rel="nofollow">http:&#x2F;&#x2F;www.scb.se&#x2F;Pages&#x2F;TableAndChart____31036.aspx</a><p>You can also go to <a href="http://www.scb.se/Pages/NameSearch.aspx?id=259432" rel="nofollow">http:&#x2F;&#x2F;www.scb.se&#x2F;Pages&#x2F;NameSearch.aspx?id=259432</a> and do a search for name. For example, there are 990 people in Sweden with Strömgren as a last name.<p>It seems that &quot;Gudrun&quot; isn&#x27;t that popular these days as fewer than 10 girls get that name. A different set of names is available from <a href="http://en.wiktionary.org/wiki/Category:Swedish_given_names" rel="nofollow">http:&#x2F;&#x2F;en.wiktionary.org&#x2F;wiki&#x2F;Category:Swedish_given_names</a> .<p>I don&#x27;t have need for this data and I can&#x27;t comment about the effectiveness of the API.<p>You can get top-1000 US names for a given year by going to <a href="http://www.ssa.gov/OACT/babynames/#ht=1" rel="nofollow">http:&#x2F;&#x2F;www.ssa.gov&#x2F;OACT&#x2F;babynames&#x2F;#ht=1</a> , selecting a year, change &quot;Popularity&quot; to &quot;Top 1000&quot; and submitting the form. (For example, your search doesn&#x27;t have &#x27;Lowell&#x27;, which was #172 in the US in 1940.)<p>Good luck!
评论 #6219309 未加载
Asparagirlalmost 12 years ago
Hey, nice job! I do a lot of work (both professionally and as a volunteer) coding stuff for genealogical and historical non-profit organizations, and I could totally see an API like this being useful to us. Do you accept donations of name data sets from the 19th century Austro-Hungarian Empire? :-)<p>Also, I would love to learn more about how the service actually works on the back-end.
评论 #6220025 未加载
dscbalmost 12 years ago
Now this is interesting, I entered in my name (Dillon) which is gender-neutral and it returned:<p>{&quot;name&quot;:&quot;dillon&quot;,&quot;gender&quot;:&quot;male&quot;,&quot;probability&quot;:&quot;1.00&quot;,&quot;count&quot;:1}<p>I&#x27;m interested is how its decided there was a 100% probability that I&#x27;m male (It was correct though).
评论 #6220209 未加载
评论 #6219530 未加载
rtcomsalmost 12 years ago
I searched <a href="http://api.genderize.io/?name=batman" rel="nofollow">http:&#x2F;&#x2F;api.genderize.io&#x2F;?name=batman</a><p>and received {&quot;name&quot;:&quot;batman&quot;,&quot;gender&quot;:null}