Evaluation and Optimization of Sentiment Analysis Accuracy Based on Different Models

Jinyang Ni · 2025

The popularity of the internet has led to an explosion of users and consequent comment data on social media platforms such as X, once known as twitter. By analyzing the textual sentiment of such a large amount of public data, it is possible to count people's attitudes toward an event or a product. Such a visual survey can be useful for further monitoring of trends in public opinion or for updating products in accordance with the prevailing opinion. This study is dedicated to comparing the performance of different machine learning models in the setting of a shared dataset. The tweets of corresponding keywords are collected through open-source application programming interface (API) tools to form a shared dataset for this research. The dataset is used to train the Naive Bayes (NB), Artificial Neural Network (ANN) and Logistic Regression (LR) models respectively and the results of the model training are visualized through a confusion matrix. The model performance is then assessed by comparing the values of accuracy, precision, recall, and F1-score. It has been demonstrated that the LR model is better at dealing with the type of classification problem of sentiment analysis, which provides a referenceable suggestion for future directions.

Read the paper · More papers on PaperTik