On this page

A Study on the Identification of Emotional Tendencies in Huang Tingjian’s Poetry Based on Python Text Mining

By: Zhengfan Chen 1
1School of Chinese Classics, Renmin University of China, Beijing, 100000, China

Abstract

Python’s advantages in text mining provide a fast, efficient, and low-cost research path for poetry sentiment analysis. This paper uses Python to design and develop corresponding poetry text sentiment mining software to conduct in-depth sentiment word frequency analysis and visualization of Huang Tingjian’s poetry. Additionally, it combines Latent Dirichlet Allocation (LDA) and Non-Negative Matrix Factorization (NMF) to calculate the relationship between high-frequency words and emotional themes, establishing an emotional theme model. The effectiveness of the theme modeling is measured using word vector theme consistency. The results show that the precision, recall, and F1 scores of the LDA+NMF emotional theme model all exceed 90%, outperforming the six classification models compared in the same period. The model achieved an accuracy rate greater than 0.900 for the classification of three types of poems with different emotional tendencies. The proportion of the three types of emotional tendencies in Huang Tingjian’s poems showed an upward or downward trend in the early, middle, and late periods.