## 9 Conclusions  
In our study, we present the results of the experimental comparison of selected statistical models and neural networks for the document classification task. Both the quality of text representations, measured as classification accuracy, and the average time required to train the model and its inference, were compared. From the experiments, it can be seen that simple statistical models generate quite good numerical representations of the text and require much less time to train and infer the model. Models based on deep neural networks, such as HAN, HWAN and Longformer, generate representations of good quality, \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Algorithm** & **Pros** & **Cons** & **Score** & **Rank** \\ \hline BoW & works with noisy data & lack of semantic features & 409.30 & 7 \\  & & sparse representation & & \\ \hline TFIDF & words with noisy data & lack of semantic features & 413.92 & 4 \\  & takes into account frequent words & sparse representation & & \\ \hline LSA & works for a small number of classes & reducing dimension results in a & 366.33 & 8 \\  & dense representation & loss of information & & \\ \hline LDA & works for a small number of classes & rare words disrupt representations & 319.76 & 10 \\  & dense representation & & & \\ \hline P-SIF & takes into account topic of the words & out-of-vocabulary words & 350.38 & 9 \\  & dense representation & averaging degenerates representations & & \\  & & limited text length & & \\  & & computationally intensive & & \\ \hline Doc2 Vec-DM & mapping context of words & out-of-vocabulary words & 407.64 & 6 \\  & dense representation & computationally intensive & & \\ \hline Doc2 Vec-DBoW & mapping context of words & out-of-vocabulary words & 419.96 & 3 \\  & dense representation & computationally intensive & & \\ \hline HAN & selecting relevant words in context & out-of-vocabulary words & 424.53 & 2 \\  & dense representation & limited text length & & \\  & & computationally intensive & & \\ \hline Longformer & selecting relevant words in context & limited text length & 412.63 & 5 \\  & dense representation & computationally intensive & & \\ \hline HWAN & selecting relevant words in context & out-of-vocabulary words & **426.86** & 1 \\  & dense representation & limited text length & & \\  & additional statistic features & computationally intensive & & \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Pros and cons of presented methods. Score is calculated as the sum of the accuracy for all datasets. sometimes better than statistical approaches, but require significantly more computational resources and longer training and processing time. The proposed method (HWAN), based on improving the hierarchical attention networks, achieved the same or better results compared to the baseline statistical methods for four out of the five training datasets. The study shows that the usage of statistical features calculated based on a larger text corpus allows us to improve the quality of generated text representations without increasing the network size. The attention-based models presented in this article improve the performance of the baseline methods on three out of the five training sets, even reaching 100% accuracy, as the results for the BBCSport dataset show. These models allow an explanation about which passages in the texts prompted a certain classification decision, by reading which words received a high attention value. However, due to the large computational resource requirements and long training time, they have a low ratio of representation quality to training time. Despite the enormous possibilities offered by language models based on layers of attention and transformer architectures in particular, for some tasks, such as document classification, statistical models are still a good choice. Data curation, Software, Writing--original draft, Project Administration, Validation, Writing--review and editing, Investigation A.W.