This article aims to explore the sentiment analysis of Transformer comments on Weibo to understand the attitudes and emotional tendencies of social media users regarding the movie The boy and the heron. This paper uses natural language processing technology and sentiment analysis model Transformer to crawl the Weibo comment data set, analyzes the anti-crawling mechanism of Weibo, adds HEADERS and REFERER directly in the code to bypass the inspection, and preprocesses it. Sentiment analysis was conducted on a large number of Weibo comments related to the boy and the heron. The results of the study showed that the vast majority of the comments expressed positive emotional attitudes and held positive and appreciative attitudes towards the boy and the heron. This study reveals that social media users have positive attitudes and emotional identification with the boy and the heron, and the audience really likes the film, which is of great help for the filmmakers to further understand the advantages and disadvantages of the film. Performing Weibo sentiment analysis based on advanced natural language processing technologies such as transformers can not only improve the accuracy and efficiency of sentiment analysis, but also help promote the progress and application of artificial intelligence technology. This is important for the development of more intelligent social media analysis tools and systems.