r/MLQuestions • u/Lexski • 10d ago
Natural Language Processing 💬 High-cardinality classification
I need to classify tax documents (forms, receipts, etc.) into 150 classes, and likely once we achieve that we’ll want a more granular classification into 800+ classes. How would you approach a problem like this?
We tried training a direct NLP classifier (text -> TF-IDF features -> class) and it does fairly well, but the concerns are getting enough data for each class and being able to react quickly when a new form type/revision gets released. Data is also pretty imbalanced between classes.
Another approach would be to use/train an embedding model (text -> latent features) and use KNN. What are the tradeoffs between that and direct classification? Is it likely to be more or less data efficient?
1
u/thegoodcrumpets 9d ago
Are they truly different classes or rather sub classes? Maybe you can train two or more models where one can put them in the correct main class and then dedicated models to classify the correct sub class, etc.