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.
- 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.
- 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.