This problem can be traditionally formulated as a text classification task and solved by annotating the data and building a supervised learning system.
rare classes might render annotation even more difficult and expensive.