Suppose I'm given a list of name pairs:

    [ 'John', 'Smith'],
    [ 'Alex', 'Gordon'],

I wish to know (or be given reasonable certainty) which column is the surname, and which is the first name, assuming that all columns are consistent, and each name pair consists of exactly one first name and one surname.

An obvious challenge would be checking name pairs where both names can be used as first names, e.g. ['Graham', 'Tyler'].

Is this model something that is reasonable to achieve?


You can apply a simpler strategy here that will likely lead to better results than a neural network. Luckily we have census data for most countries. For example you can use US census data.

We can find the commonality of the two names in the array using their search function. Then we can say that the name with the higher rank is the first name. For example we can see that for the name ['John', 'Smith'], John has a rank of 27 for the most recent year whereas Smith is not listed. So we can assume that John is the first name and Smith is the last name.

This technique is a very old school means of prediction, we already have the distribution of the data through polls. So we can use it directly, we do not need to train a model to learn the underlining distribution (this would be very difficult with something like names which is has a lot of noise).

If you have additional data for each person like a date of birth or a gender then you will get better results through this prior information. This is similar to what you would achieve when applying Naive Bayes algorithm, however in this instance once again the distribution has already been determined.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.