I am attempting to use natural language processing to geocode "addresses". The address is the result of a write-in of a survey where the respondent is instructed to give their city, state, and zip code. Using this information, I want to code them to a 7 digit geography (unique to my company) that is meant to represent a pretty granular geography. The respondent does not always follow this format, sometimes they leave values blank, sometimes they give full addresses instead of city, sometimes they give their county etc.

The problem is, while I have a decent size data set of ~300,000 records, I also have 5,000 categories for my variable of interest (as I mentioned I require a very granular geography). So on average each class only has about 60 records, and many of them have only 1 or 2.

So my questions are two-fold.

  1. This is an issue correct? I don't know how I am going to test my algorithm when if I only have 1 data point from a class, if it ends up in the test set it will be clearly wrong and if it is in the training set it will only provide noise.
  1. Are there algorithms (particularly in NLP) that handle this kind of sparsity well? I am currently using FastText, but only because I inherited this project and that was being used prior to my joining. Am open to suggestions.
  • $\begingroup$ May I ask why there is a need for NLP? If your respondents give you their city, state and zip code, can't you just make a simple look-up table to map those information to to your categories? Maybe I did not understand completely how your model works and what your '7 digit geography' is. $\endgroup$ – Tinu Jun 30 '20 at 7:02
  • $\begingroup$ Yes for most cases we use a look up table. It is for the cases where the person has spelling mistakes, or abbreviations etc. People tend to not follow the rules when filling out surveys. But I’ll also add that yes, I am thinking that NLP may not be well suited for even these odd cases that don’t match the lookup table. $\endgroup$ – astel Jun 30 '20 at 8:09
  • $\begingroup$ Are the surveys hand-written or machine-typed? If they're hand-written you could use computer vision to extract the letters (OCR, optical character recognition), then use look-up tables (for abbreviation etc.) to map the so extracted information (or the machine-typed information directly) to your 7 digit geography. Additionally you can use spell checkers (e.g. based on Levenshtein distance) to catch spelling mistakes. $\endgroup$ – Tinu Jun 30 '20 at 8:51
  • $\begingroup$ The responses are both hand written and machine typed. The data capture is not an issue, we have methods for that. The issue is that there is no way we come up with a lookup table that will be able to capture 100% of people responses. If we have 1 million responses, and only 1% aren't able to be captured by the lookup table, then we still have 10000 records we need to code somehow. $\endgroup$ – astel Jun 30 '20 at 17:06

Your Answer

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

Browse other questions tagged or ask your own question.