In recent years, environmental emergencies have spread rapidly on the social media, causing public concern. This study takes the “3.21” accident in Xiangshui, Jiangsu as an example, and obtains 46, 265 Weibo comments by using Python program. After data preprocessing, 7740 Weibo comments were obtained. The evolution stage of public opinion about accidents is divided into outbreak period, temporary decline period, recurrence period and recession period by using the changing characteristics of public attention. This study uses the sentiment analysis model and LDA theme extraction model to analyze the emotional analysis and theme extraction of comments in each stage, analyze the emotional tendencies and Theme Evolution in each stage, and analyze the evolution law of public opinion in the “3.21” accident in Xiangshui, Jiangsu. Studies show that public attention decreases rapidly from the outbreak stage to the temporary decline stage, increases slightly in the recurrence stage, and lowest in the recession stage. Public sentiment is susceptible to derivative events throughout the evolution of public opinion. If the derivative events are encouraging events such as rescue and rescue, the proportion of public positive emotions will increase. If the derivative events are negative events such as corruption, the proportion of public negative emotions will increase. The research conclusion provides theoretical support for establishing public opinion response mechanism to environmental emergencies.