As a high-risk industry, coal mining enterprises have a complex record of violations.In order to efficiently, accurately and intelligently retrieve and manage an enterprise's illegal record and reduce the occurrence of illegal behaviors.A database of 13, 935 violations in a mine in recent three years is taken as a sample.The illegal actions are divided into 3 categories and 23 subcategories.And based on the computer text classification technology, the illegal text data classifier is built.Its process includes text preprocessing of Jieba word segmentation, vector space model construction, feature value selection of TF-IDF model, and similarity calculation process.Finally, a visual classification statistics and presentation system was constructed in Python environment, and the classified statistics were carried out.The results showed that the proportion of illegal operation is 64 %, which is the highest among all illegal behavior, followed by illegal action, and illegal command accounted for the smallest proportion.At the same time, the key subcategories of high frequency, medium frequency and low frequency were analyzed to provide quantitative support for accident prevention.