Algorithms to tame text data