Sentiment Analysis and Implementation in Film Eval
Sentiment Analysis and Implementation in Film Eval
DOI: 10.54254/2755-2721/33/20230274
Fangbing Zhou
School of Computer Science, South China Normal University, Guangzhou, 510631,
China
Abstract: This study explores the use of the dmsc_v2 dataset, which is a rich collection of over
2 million ratings and commentary data from over 700,000 users on 28 films, to train the BERT
model for sentiment analysis. This expansive dataset, drawn from the popular Chinese movie-
rating website, Douban, has been meticulously curated for this research. In the context of the
methodology, it is comprehensive and involves multiple stages. Initially, data preprocessing is
conducted to refine and format the dataset suitably for model training. Subsequently, the BERT
model is trained using the prepared data. Following the training process, the model's performance
is critically evaluated to validate its efficacy and accuracy. The resulting model is adept at
performing sentiment classification on comments pertaining to films across various social media
platforms such as Weibo, Xiaohongshu, and more. This is particularly beneficial as it enables a
nuanced analysis of user opinions and trending topics, offering invaluable insights for businesses,
movie producers, or marketers. The findings of this study demonstrate that the BERT sentiment
analysis model, developed with the dmsc_v2 dataset, exhibits impressive performance and has
expansive potential for application within the sphere of social media commentary analysis. The
successful development and validation of this model underscore its potential to transform the
way sentiment analysis is conducted, especially in the context of entertainment and social media
discussions.
1. Introduction
Users across the globe are increasingly voicing their thoughts, emotions, and perspectives on numerous
social media platforms. The comments and user-generated content found on these platforms are
brimming with emotional information that holds significant value for understanding user attitudes,
market trends, and social public opinion. Consequently, sentiment analysis has emerged as a crucial
field of study. Sentiment analysis, initially proposed by Nasukawa and colleagues in 2002 [1], has
garnered considerable interest in research circles. The discipline is focused on the automatic
identification and classification of emotional information within text, with the intention of facilitating a
deeper understanding and analysis of emotional tendencies and states within large-scale text data. Its
applications extend to social media monitoring, public opinion analysis, brand management, market
research, and other areas.
© 2023 The Authors. This is an open access article distributed under the terms of the Creative Commons Attribution License 4.0
(https://creativecommons.org/licenses/by/4.0/).
224
Proceedings of the 2023 International Conference on Machine Learning and Automation
DOI: 10.54254/2755-2721/33/20230274
Presently, sentiment analysis methodologies can be broadly categorized into three core approaches:
those that rely on emotion dictionaries, machine learning-based ones, and those built on deep learning
techniques. Of these, the deep learning approach has seen a significant surge in popularity. The emotion
dictionary method necessitates the creation of a sentiment dictionary [2], which is then utilized for
sentiment calculation. Conversely, machine learning-based methods [3-6] involve manual feature
extraction initially, followed by the sentiment classification of microblog texts using machine learning
algorithms.
The approach founded on deep learning [7-9], like its machine learning counterpart, involves initial
manual feature extraction. However, instead of employing traditional machine learning algorithms,
sentiment classification of microblog texts is executed using deep learning techniques.
The attention mechanism [10] has been incorporated into various natural language processing (NLP)
tasks by numerous researchers. This was aimed at resolving the issue of deep learning models
overlooking the significant role of key words when extracting semantic information, thus making it
challenging to consider all text information. Vanswani and others proposed the Transformer model in
2017, which leverages the Self-Attention mechanism to comprehensively take into account the role of
each word in the overall context. The BERT model (Bidirectional Encoder Representations from
Transformers), which is predicated on the Transformer model, was introduced by Devlin and others in
2018 [11]. Since then, there has been an increase in studies investigating sentiment analysis methods
based on this model [12].
2. Related works
This study first classifies the datasets of reviews of movies by the rating of movies that rated by the
users from Douban. In this study, the dmsc_v2 data set was selected as the training data, and the BERT
model was used for sentiment analysis research. Through this research, this study explores how to
effectively conduct sentiment analysis on social media comments about movies. This will provide new
methods and insights for sentiment analysis of social media comments, which will help to deeply
understand user attitudes and market trends.
225
Proceedings of the 2023 International Conference on Machine Learning and Automation
DOI: 10.54254/2755-2721/33/20230274
Table 2. (continued).
4 Chronicles of the Ghostly Tribe 九层妖塔
5 CUG King of Heroes 大圣归来
6 Forever Young 栀子花开
The second portion of the data collection focuses on accumulating comments pertaining to various
movies from Weibo [15] and Xiaohongshu [16]. Weibo operates as a microblogging platform, where
users can readily post or retrieve news online. This is facilitated through diverse media such as text,
images, and short videos. Owing to its ease and speed, Weibo has garnered a vast user base, cementing
its position as one of the key channels through which the public, notably Chinese netizens, share online
comments, express opinions, and communicate demands. Meanwhile, the primary feature of
Xiaohongshu centers on "notes", where users document and share personal experiences spanning life,
shopping, travel, and beauty. It provides an avenue for users to recount their life, travel, shopping, and
other experiences, serving as a reference for others. Gaining increasing popularity among the public,
Xiaohongshu has become a platform where many engage in movie discussions.
Therefore, a model trained on movie reviews will be employed to scrutinize reviews posted on Weibo
and Xiaohongshu. This will allow for a prediction of movie reputation and facilitate an analysis of the
unique attributes of movie reviews across different platforms.
2.2. BERT
BERT, as proposed by Devlin et al. from Google in 2018, is a language model constructed upon a
bidirectional Transformer architecture. This model leverages three input vectors: the word vector, the
segment vector, and the position vector. The word vector serves as an encoding of the current word, the
segment vector provides an encoding of the word's position within the sentence, and the position vector
pertains to the positional encoding of the current word. The encoding of sentence position is denoted by
special tokens, with CLS marking the beginning and ESP indicating the end.
BERT has exhibited high performance in numerous tasks within the field of Natural Language
Processing (NLP), including emotion classification and question answering systems. Sentiment analysis
utilizing the BERT model [17-19] is considered a downstream task of BERT. In general, it is crucial to
utilize the pre-trained BERT model to generate a vector representation of the text, followed by
implementing the relevant classification algorithm for sentiment analysis. Given that this research
targets Chinese movie reviews on platforms such as Weibo and Xiaohongshu, the bert-base-chinese
model is employed for training. This model is a pre-trained iteration, trained on Transformers, based on
a Chinese corpus.
226
Proceedings of the 2023 International Conference on Machine Learning and Automation
DOI: 10.54254/2755-2721/33/20230274
3. Methodology
This study selected the dmsc_v2 dataset as the training data, and used the BERT-Base-Chinese model
for sentiment analysis research. Through this research, we explore how to effectively conduct sentiment
analysis on social media comments about movies, and evaluate the application performance of the model
on different domains and platforms. As shown in Figure 1.
227
Proceedings of the 2023 International Conference on Machine Learning and Automation
DOI: 10.54254/2755-2721/33/20230274
determined through a process of empirical and experimental tuning to ensure optimal performance
during the training phase.
4. Experiment results
4.2.1. Model training process. After setting the parameters of the BERT-Base-Chinese model, the
experiment carried out 5 rounds of training, and the effect of each round of training is shown in the
Table 4.
228
Proceedings of the 2023 International Conference on Machine Learning and Automation
DOI: 10.54254/2755-2721/33/20230274
4.2.2. Model evaluation. During the evaluation of the sentiment classification task on the test set, we
assess several performance metrics to gauge the model's effectiveness. The accuracy rate is determined
by calculating the ratio of correctly classified samples to the total number of samples, as shown in Eq.
(5). The F1 value is a comprehensive metric that takes both precision and recall into account, as shown
in Eqs. (6), (7), and (8), respectively.
Comparing the results of the BERT model with the trained bert-base-chinese model, we can ascertain
the model's performance and determine how it fares in sentiment classification. As shown in Table 5.
True prediction
Accuracy = True prediction+False prediction (5)
True positive prediction
Precision = (6)
True and false positive prediction
True positive prediction
Recall = (7)
True positive prediction+False negative prediction
2∗Precision∗Recall
F1 − score = (8)
Precision+Recall
229
Proceedings of the 2023 International Conference on Machine Learning and Automation
DOI: 10.54254/2755-2721/33/20230274
Movie comment of
0.954 0.956 0.957 0.954
BERT-base-Chinese
4.3.1. Data collection. When conducting Weibo and Xiaohongshu review analysis, we collected related
movie review datasets. Movie list is shown in table 6. Through API or crawler technology, a large
number of Weibo and Xiaohongshu posts containing movie reviews were obtained.
4.3.2. Sentiment analysis and prediction. Using the trained BERT-Base-Chinese model, we perform
sentiment analysis and prediction on movie reviews on Weibo and Xiaohongshu. The result of
experiment is shown in table 7. Categorize reviews as positive or negative based on the sentiment bias
predicted by the model. And get the final praise rate, and compare it with the Douban score. The
definition of praise rate is the percentage of the number of positive comments, and the formula is shown
in Eq.
𝑝𝑜𝑠𝑖𝑡𝑖𝑣𝑒 𝑐𝑜𝑚𝑚𝑒𝑛𝑡𝑠
𝑟𝑎𝑡𝑒 = 𝑛𝑒𝑔𝑎𝑡𝑖𝑣𝑒 𝑐𝑜𝑚𝑚𝑒𝑛𝑡𝑠+𝑝𝑜𝑠𝑖𝑡𝑖𝑣𝑒 𝑐𝑜𝑚𝑚𝑒𝑛𝑡𝑠
(9)
4.3.3. Word-of-mouth prediction and analysis. By performing sentiment analysis on reviews, we can
predict the word-of-mouth of a movie on Weibo and Xiaohongshu. By counting the ratio of positive and
negative reviews, it is possible to infer the popularity of a movie on social media platforms. In addition,
we will also analyze the length of comments, the distribution of emotional tendencies, common
keywords and phrases, etc., to reveal the differences in the characteristics of film reviews and user
discussion methods on Weibo and Xiaohongshu.
This research uses crawlers to obtain the content of different movie reviews in each social media,
and then uses these reviews to draw the word cloud map of each movie review on each platform. The
word cloud map is shown in Table 8. Through these word cloud maps, we can see the characteristics of
different movies, as well as the characteristics of movie reviews on different platforms, and observe the
emotional distribution on different social media platforms.
Table 6. Social media and collecting movie list.
230
Proceedings of the 2023 International Conference on Machine Learning and Automation
DOI: 10.54254/2755-2721/33/20230274
5. Conclusion
Based on experimental findings and thorough discussions, it can be concluded that BERT-Base-Chinese,
when trained with the dmsc_v2 dataset, proves proficient in analyzing movie reviews. Through
sentiment analysis of reviews from Weibo and Xiaohongshu, word-of-mouth predictions for movies can
be made, and characteristics of movie reviews from different platforms can be discerned. These findings
have significant implications for market research and promotional strategies within the film industry.
Despite the extensive collection of movie review data in the dmsc_v2 dataset, an expansion of this
dataset could enhance the model's generalization capabilities. More data from Douban or diverse movie
reviews from other credible sources could be harvested to enrich the training set. The experiment
employed a set of default hyperparameters for training, but varying these settings could influence model
performance. Hyperparameters could be systematically fine-tuned, using methods such as grid search
or random search, to identify an optimal model configuration. Beyond the singular application of a
BERT-Base-Chinese model, model ensemble techniques could be explored - be it through vote casting
or average prediction results, or through the integration of various pre-trained models or multiple
iterations of model training. With model ensembles, the performance and robustness of sentiment
analysis tasks could be significantly improved. It's important to note, however, that the dmsc_v2 dataset
is sourced from the Douban website, and as such, potential data biases may exist. Given the dataset's
limited source, the reviews and ratings could be more reflective of specific movie types or user groups,
consequently influencing the model's generalization capacity. Additionally, sentiment analysis
confronts the challenge of emotional expression diversity. Users may employ metaphors, irony, or other
literary rhetorical devices in their comments, making sentiment analysis a complex task. Therefore,
capturing and interpreting these complex emotional expressions accurately might present a challenge to
models.
Table 8. Word cloud map of movies from Weibo and Xiaohongshu.
Weibo Xiaohongshu
Godspeed
231
Proceedings of the 2023 International Conference on Machine Learning and Automation
DOI: 10.54254/2755-2721/33/20230274
Table 8. (continued).
The Wandering Earth
Guardians of the
Galaxy 3
References
[1] Nasukawa, T., & Yi, J. (2003). Sentiment analysis: Capturing favorability using natural language
processing. In Proceedings of the 2nd international conference on Knowledge capture (pp. 70-
77). Sanibel Island, FL, USA: ACM.
[2] Pang, B., & Lee, L. (2008). Opinion mining and sentiment analysis. Foundations and Trends® in
Information Retrieval, 2(1–2), 1-135.
[3] Zou, H., Tang, X., Xie, B., & Liu, B. (2015). Sentiment classification using machine learning
techniques with syntax features. In 2015 International Conference on Computational Science
and Computational Intelligence (CSCI) (pp. 175-179). Las Vegas, NV, USA: IEEE.
[4] Ye, Q., Zhang, Z., & Law, R. (2009). Sentiment classification of online reviews to travel
destinations by supervised machine learning approaches. Expert Systems with Applications,
36(3), 6527-6535.
[5] Ni, X., Xue, G.-R., Ling, X., Yu, Y., & Yang, Q. (2007). Exploring in the weblog space by
detecting informative and affective articles. In Proceedings of the 16th international
conference on World Wide Web (pp. 281-290). Banff, Alberta, Canada: ACM.
[6] Yang, C., Lin, K. H.-Y., & Chen, H.-H. (2007). Emotion classification using web blog corpora.
In IEEE/WIC/ACM International Conference on Web Intelligence (WI’07) (pp. 275-278).
Frmont, CA, USA: IEEE.
[7] Basiri, M. E., Nemati, S., Abdar, M., Cambria, E., & Acharya, U. R. (2021). ABCDM: An
attention-based bidirectional CNN-RNN deep model for sentiment analysis. Future Generation
Computer Systems, 115, 279-294.
[8] Wang, P. et al. (2018). Concept and attention-based CNN for question retrieval in multi-view
learning. ACM Transactions on Intelligent Systems and Technology, 9(4), 1-24.
[9] Weissenbacher, D., Sarker, A., Paul, M. J., & Gonzalez-Hernandez, G. (2018). Overview of the
Third Social Media Mining for Health (SMM4H) Shared Tasks at EMNLP 2018. In
Proceedings of the 2018 EMNLP Workshop SMM4H: The 3rd Social Media Mining for
Health Applications Workshop & Shared Task (pp. 13-16). Brussels, Belgium: Association
for Computational Linguistics.
[10] Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., ... & Polosukhin, I.
(2017). Attention is all you need. Advances in neural information processing systems, 30.
[11] Devlin, J., Chang, M.-W., Lee, K., & Toutanova, K. (2019). BERT: Pre-training of deep
bidirectional transformers for language understanding.
[12] Gao, J. (2021). Chinese sentiment classification model based on pre-trained BERT. In 2021 2nd
International Conference on Computers, Information Processing and Advanced Education (pp.
1296-1300). Ottawa, ON, Canada: ACM.
232
Proceedings of the 2023 International Conference on Machine Learning and Automation
DOI: 10.54254/2755-2721/33/20230274
[13] Shao, Y., & Wang, L. (2022). GPSAttack: A unified glyphs, phonetics and semantics multi-modal
attack against Chinese text classification models. In 2022 International Joint Conference on
Neural Networks (IJCNN) (pp. 1-8). Padua, Italy: IEEE.
[14] Yang, X., Yang, L., Bi, R., & Lin, H. (2019). A comprehensive verification of transformer in text
classification. In Chinese Computational Linguistics (pp. 207-218). Cham: Springer
International Publishing.
[15] Ravi, K., & Ravi, V. (2015). A survey on opinion mining and sentiment analysis: Tasks,
approaches and applications. Knowledge-Based Systems, 89, 14-46.
[16] Pemarathna, R. (2019). Impact of Xiaohongshu on its user base and society: A review, 2(11).
[17] Hoang, M., Bihorac, O. A., & Rouces, J. Aspect-based sentiment analysis using BERT.
[18] Liu, Y. et al. (2019). RoBERTa: A robustly optimized BERT pretraining approach.
[19] Zhao, L., Li, L., Zheng, X., & Zhang, J. (2021). A BERT based sentiment analysis and key entity
detection approach for online financial texts. In 2021 IEEE 24th International Conference on
Computer Supported Cooperative Work in Design (CSCWD) (pp. 1233-1238). Dalian, China:
IEEE.
[20] Zheng, J., Wang, J., Ren, Y., & Yang, Z. (2020). Chinese sentiment analysis of online education
and internet buzzwords based on BERT. Journal of Physics: Conference Series, 1631(1),
012034.
[21] Li, H., Ma, Y., Ma, Z., & Zhu, H. (2021). Weibo text sentiment analysis based on BERT and deep
learning. Applied Sciences, 11(22), 10774.
[22] Li, Z., Zhou, L., Yang, X., Jia, H., Li, W., & Zhang, J. (2023). User sentiment analysis of COVID-
19 via adversarial training based on the BERT-FGM-BiGRU model. Systems, 11(3), 129.
233