Abstract:With the continuous advancement of natural language processing technologies, sentiment analysis has found extensive applications across various fields, such as social media monitoring, customer service, and market research. However, existing methods often adopt a flat classification strategy when dealing with fine-grained sentiment classification tasks, failing to fully consider the hierarchical relationships inherent in emotions, which consequently limits the accuracy of classification. To address this issue, this paper proposes a fine-grained text sentiment classification method based on a hierarchical approach. By categorizing fine-grained labels with the same underlying emotional meaning into the same coarse-grained category, a hierarchical emotional label system is constructed, thereby enhancing the model's ability to understand emotional structures. In terms of model design, outputs from different Transformer layers of the RoBERTa model are utilized to extract both low-level and high-level semantic features, supporting the training of coarse-grained and fine-grained classifiers. In the hierarchical classification strategy based on multi-task learning, the coarse-grained classification task assists the fine-grained classification task, thereby improving accuracy and generalization. In the hierarchical classification strategy from coarse to fine, the coarse classification and fine classification tasks are carried out in parallel. Each fine classifier independently computes the loss, and then combines the prior information of the coarse classifier to optimize the information selection, achieving a gradual refinement of sentiment recognition. Finally, by setting a probability threshold, the advantages of both strategies are combined to further improve classification performance. Experimental results show that on the GoEmotions and Empathetic Dialogues datasets, both strategies outperform the baseline model in terms of F1 score and accuracy. In addition, the final fusion technique brought further performance improvements, with accuracies reaching 64.6% and 59.4%, outperforming existing methods.