###### Abstract  
This paper proposes a new robust model for text classification on the Stanford Sentiment Treebank v2 (SST-2) dataset in terms of model accuracy. We developed a Recurrent Neural Network Bert based (RNN_Bert_based) model designed to improve classification accuracy on the SST-2 dataset. This dataset consists of movie review sentences, each labeled with either positive or negative sentiment, making it a binary classification task. Recurrent Neural Networks (RNNs) are effective for text classification because they capture the sequential nature of language, which is crucial for understanding context and meaning. Bert excels in text classification by providing bidirectional context, generating contextual embeddings, and leveraging pre-training on large corpora. This allows [PERSON] to capture nuanced meanings and relationships within the text effectively. Combining Bert with RNNs can be highly effective for text classification. Bert's bidirectional context and rich embeddings provide a deep understanding of the text, while RNNs capture sequential patterns and long-range dependencies. Together, they leverage the strengths of both architectures, leading to improved performance on complex classification tasks. Next, we also developed an integration of the Bert model and a K-Nearest Neighbor based (KNN_Bert_based) method as a comparative scheme for our proposed work. Based on the results of experimentation, our proposed model outperforms traditional text classification models as well as existing models in terms of accuracy. RNN_[PERSON]_based; KNN_Bert_based; Bert; RNN; SST-2 dataset +
Footnote †: journal: Medical  
NLP tasks. Researchers have embarked on an extensive exploration of Bert's efficacy in sentiment analysis, with a particular focus on benchmark datasets such as the Stanford Sentiment Treebank (SST) [3; 4; 5]. Unlike binary sentiment classification tasks that dichotomize sentiments into positive and negative labels, fine-grained sentiment classification presents a more nuanced challenge by delineating sentiments across five distinct classes: very negative, negative, neutral, positive, and very positive. The objective is to not only discern whether a text expresses sentiment but also to precisely gauge the intensity or degree of that sentiment [6]. Several studies have shown that pre-trained [PERSON] models, followed by fine-tuning, provide robust performance in sentiment analysis tasks. These models outperform other popular approaches without requiring complex architectures [3; 4]. In addition, transfer learning can leverage pre-trained language models, which have proven effective in NLP, similar to its success in computer vision [1]. Bert-based models improve the accuracy and effectiveness of sentiment analysis, especially when it comes to fine-grained sentiment classification. Researchers continue to explore variations and optimizations, leading to further advances in the field [7; 8; 9]. [PERSON]'s model is regarded as one of the most sophisticated approaches to text representation. In contrast to traditional models, which consider only one direction, [PERSON] captures the context of a word in a sentence by considering both the words preceding and following it [10]. This bidirectional nature enables [PERSON] to generate more sophisticated and precise representations of text, which is essential for tasks such as text classification. A Bayesian network is a probabilistic graphical model that represents a set of variables and their conditional dependencies through a directed acyclic graph. In the context of text classification, Bayesian networks can be employed to model uncertainty and dependencies between disparate features extracted from textual data. This approach offers a structured means of integrating prior knowledge and addressing intricate relationships [11; 12; 13]. A significant advancement in text classification methodologies was achieved by effectively combining deep contextual understanding, focused attention, and efficient feature extraction.