W ikidata as a Source of Demographic Information (2024)

Abstract: Names carry important information about our identities and demographics such as gender, nationality, ethnicity, etc. We investigate the use of individual’s name, in both Arabic and English, to predict important attributes, namely country, region, gender, and language. We extract data from Wikidata, and normalize it, to build a comprehensive dataset consisting of more than 1 million entities and their normalized attributes. We experiment with a Linear SVM approach, as well as two Transformers approaches consisting of BERT model fine-tuning and Transformers pipeline. Our results indicate that we can predict the gender, language and region using the name only with a confidence over 0.65. The country attribute can be predicted with less accuracy. The Linear SVM approach outperforms the other approaches for all the attributes. The best performing approach was also evaluated on another dataset that consists of 1,500 names from 15 countries (covering different regions) extracted from Twitter, and yields similar results.

## introduction names are an important part of humans' identities. they can act as a representation of a lot of characteristics that an individual can possess @xcite . according to @xcite : "naming is one of the practices that emphasize the mutual relationship that exists between language and culture, wherein culture embodies language, while language expresses culture." this makes human names highly interesting for the potential information they carry. many factors, including the country, language, and dialect of a person, could influence the way a name is written, and the character combinations used within that name @xcite . given the name "jakob", which could be categorized as a western european name, when surveying north american context, another version "jacob" is more frequent and dominant. despite being considered somewhat private and not made public, having access to such data can help in many contexts, including linguistic studies and user demographic research @xcite . in addition, predictions made based on names can relieve users from tedious form filling, and help to better tailor user preferences and provide more precise suggestions for attributes like gender, nationality, preferred language, etc. in this paper, we investigate predicting the country (and region), gender, and language of an individual using one piece of information -their name. we are able to predict this information by training models using publicly available data from wikidata (refer to appendix a for a demo). we also share a comprehensive dataset consisting of more than 1 million entities with their corresponding normalized country, gender, language, and region information foot_0 . this dataset consists of entities from a total of 100 countries covering 17 regions, 48 languages, and 2 genders in both arabic and english. the main contributions of this paper are: (i) we introduce a novel idea of using wikidata to collect demographic information from names. we discuss challenges and details for data curation and normalization in building a comprehensive dataset for entities' names as well as their corresponding country, language, region and gender information; (ii) we perform experiments on both arabic and english names, to demonstrate that our methodology is able to be generalized to more than one language; and lastly, (iii) we benchmark machine learning and bert models on predicting attributes from person names using different evaluation sets. ## related work over the years, researchers have investigated the role names can play in deducing other information, such as gender, country and religion, about individuals. such research requires a large amount of diverse names to be able to explore, which is why a large portion of the research used social media platforms as their primary source of data, namely twitter @xcite @xcite , as well as facebook @xcite and interpals @xcite , while others used governmental and census data to gain access to individuals' information @xcite @xcite . both types of data come with their own sets of limitations, as social media can be noisy and unstructured, while governmental census data does not include a large amount of diversity in terms of nationality, as they tend to report on a national level. tzioumis (2018) focused on names from the united states, by creating a list of approximately 4000 first names and 11000 surnames and tagging them with their corresponding ethnicity through analyzing a combined dataset that consisted of mortgage application data. in addition, @xcite extracted twitter user profiles based in qatar to infer users' country based on features of their profile such as timezone, description, as well as their name. by using gradient boosted tree, introduced by @xcite , @xcite achieved an overall accuracy of 83.8%. @xcite used a list of 1.73 million facebook profiles of individuals based in new york city, and applied a multinomial naive bayes classifier, which led to an accuracy score of 95.2%. however, these investigations are somewhat limited in that they are focused on collecting names from specific countries. as a result, we address this issue by including large number of countries in our exploration, to ensure that there is both diversity and coverage in the results obtained. @xcite built a recurrent neural network that predicts the country of an individual based on their name, by looking at character embeddings. they trained the model using 17,721 names and their corresponding country from the olympics official website. in doing so, @xcite achieved an accuracy score of 51.9%. malmasi (2014) developed their own dataset, the mq names corpus, to investigate names and their gen-der and ethnicity classification. this dataset "contains over 13k names from 5 cultural groups...these include names of arabic, german, iranian and japanese origin. romanized versions of all names are used" @xcite . by employing a linear support vector machine (svm) classifier, character tri-grams achieved the best accuracy scores for both gender and ethnicity classification, which were 90% and 83%, respectively. @xcite investigated the relationship between the first name of an individual and their gender, by extracting twitter users' first names and assigning them a gender through using amazon mechanical turk (amt), which "is a platform developed by amazon for the distribution of short, simple tasks to legions of human workers around the world" @xcite . this led to them creating a dataset of 12,681 name and gender pairs. they found that using an individual's name resulted in a 20% increase in the accuracy of the gender classifier when compared to a standard baseline classifier. although these investigations yielded promising results, the main limitation is that they use relatively small datasets to train and evaluate their approaches. @xcite collected approximately 1 million unique names from social media network in-terpals, with their gender, country and age information. they then created an algorithm that takes the three aforementioned attributes as parameters, and assigns a demographically suitable name by using the data collected from interpals. they opted for a manual evaluation of the names by ethnicallydiverse evaluators, and achieved a score of 85.6%. @xcite focus on south asian names and their relationship with religion. using data collected by the national council of applied economic research, which consisted of approximately 150,000 names, they found that an svm taking into consideration both first and last names evaluated the highest, achieving an f1 score of 82.88%. furthermore, using 89 million user profiles from twitter, @xcite investigated what names infer about religion, gender and ethnicity, by using the profiles' information, paired with census data, to provide reference labels for each investigated attribute. their analysis suggested that using embedding representations for the names yielded better results, when compared to substrings. in addition to some of the limitations mentioned previously, we observed that, collectively, the re-search in the field has been geared towards a subset of the traits explored in this paper: country, gender, language and region. to our knowledge, however, there is no investigation geared towards experimenting with what a name infers about all four attributes. furthermore, although there was some exploration of this topic in diverse regions and/or countries, a large portion of the research used english versions of all names, regardless of origin. as a result, we are inspired by these investigations and take them one step further to investigate names, written in both english and arabic, and what they infer about the country, gender, language and region. ## experiments and results we model the problem as a supervised classification task, and we train a linear supper vector machine (svm) model for each of the attributes investigated. we then compare the linear svm evaluation results to the results of bert, in which we look at two approaches. it is important to note that throughout the whole experiment, only the first name was used as input when training any of the gender classifiers, since any other names do not usually provide any indication of the gender of an individual. for evaluation, we use the precision, recall, and f-1 score as our metrics foot_11 . ## conclusion in this paper we investigated the amount of information we can infer from an individual's name. this includes country, gender, language, and region information. we extracted information from a total of 9,284,039 entities from wikidata, and normalized the data to include information from 100 countries, 48 languages, 18 regions, and 2 genders. after balancing the data, and preprocessing it appropriately, we ended up with a total of 1,096,910 arabic and english entities. using this data, we experimented with an svm-based approach, using a linear-svm, as well as bert-based approaches, and found while bert-based results are very competitive, the svm-based approach yielded the best results and efficiency. the svm approach was also evaluated on an external dataset that consists of 1,500 names from 15 diverse countries extracted from twitter, and yielded similar results, showing that the models are stable and generalizable. we believe that there are many extensions to this work. exploiting more languages on top of arabic and english, which would improve the generalizability of the techniques we experimented with. additional information recorded in wikidata and using it in research can open the doors to different research and applications. furthermore, it is important to note that although a name could be connected with a certain country, that does not necessarily mean that they are ethnically from that country, which is especially true in ethnically diverse countries such as the united states. as a result, studying the ethnicity of a name, paired with the country they are from could be an interesting exploration. other research related to modern migration and refugee communities are all topics that can be explored from such data.