Are there any classifiers that can do hierarchal classification? For example, we may have some text and want to predict it's class in an ontology (which is a tree). As a concrete example, let's say we have some text such as "iphone 7 case" and we want to learn it maps to the path [electronics -> smart-phones & accessories -> cases] in an ontology of products. See imagenet for an example of images with hierarchal label structure).
The common naive solution is to flatten the problem into a multi-class classification problem but this simplification has two issues that a model aware of hierarchy could address:
If a particular class is rare or even missing in the training data than a multi-class classifier does not have enough information to make a good prediction. A hierarchal classifier could utilize related examples that have a common ancestry with the rare class though.
A multi-class classifier's loss function does not give any credit if the predicted class is "almost right" (e.g. most of the path is correct but it may have predicted the child, a parent, or a sibling instead of the correct class). A hierarchal classifier's loss function could give partial credit if the path was mostly correct.
Does anyone know of any models that can do hierarchal classification?