{'fraction_non_alphanumeric': 0.02711864406779661, 'fraction_numerical': 0.00903954802259887, 'mean_word_length': 6.383333333333334, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Comparison of BERT and XLNet accuracy with classical methods and algorithms in text classification

The aim of this publication is to compare the accuracy of the Bidirectional Encoder Representations from Transformers (BERT) and Generalized Autoregressive Pretraining for Language Understanding (XLNet) models in text classification with the accuracy of classical machine learning methods and algorithms. Analyzed: Bidirectional Encoder Representations from Transformers (BERT), Generalized Autoregressive Pretraining for Language Understanding (XLNet), Bernoulli Naive Bayes classifier, Gaussian Naive Bayes classifier, Multinomial Naive Bayes classifier, Support Vector Machines. The results show that when classifying 50,000 reviews in English, XLNet ranks with the highest accuracy - 96%, which is nearly 8% more than the best-performing classic classifier Support Vector Machines.