Public Opinion About COVID-19 on a Microblog Platform in China: Topic Modeling and Multidimensional Sentiment Analysis of Social Media

Background The COVID-19 pandemic raised wide concern from all walks of life globally. Social media platforms became an important channel for information dissemination and an effective medium for public sentiment transmission during the COVID-19 pandemic. Objective Mining and analyzing social media text information can not only reflect the changes in public sentiment characteristics during the COVID-19 pandemic but also help the government understand the trends in public opinion and reasonably control public opinion. Methods First, this study collected microblog comments related to the COVID-19 pandemic as a data set. Second, sentiment analysis was carried out based on the topic modeling method combining latent Dirichlet allocation (LDA) and Bidirectional Encoder Representations from Transformers (BERT). Finally, a machine learning logistic regression (ML-LR) model combined with a sparse matrix was proposed to explore the evolutionary trend in public opinion on social media and verify the high accuracy of the model. Results The experimental results show that, in different stages, the characteristics of public emotion are different, and the overall trend is from negative to positive. Conclusions The proposed method can effectively reflect the characteristics of the different times and space of public opinion. The results provide theoretical support and practical reference in response to public health and safety events.


Introduction
Due to the global influence of COVID-19, it has recently become a research hot spot in many fields [1].Public opinion on social media refers to the public opinion expressed on social media software as the communication platform and social issues as the main topic, including public cognition and attitude [2].Public opinion generated by public security and health emergencies such as infectious diseases spreads rapidly and is of an explosive nature [3].Reasonable control of public opinion played an important role in curbing public panic during the COVID-19 pandemic [4].
In recent years, social media platforms have gradually become the main information dissemination medium for the public [5].The use of social media to measure public attention has also been gradually applied to the research of acute infectious diseases, such as influenza A (H1N1) [6].Ahmad et al [7] demonstrated a correlation between the daily number of COVID-19-related tweets and the daily number of COVID-19 cases and deaths in Iran and Turkey.Public knowledge was limited due to a lack of information about, inexperience with, and poor awareness of the nature of the virus.Text-based data on social media platforms contain rich information about public opinion and sentiment [8].As of September 2022, the number of monthly active users of microblogging platforms reached 584 million, with mobile use accounting for 95%, and the number of daily active users reached 253 million.Although social media platforms disseminate information, they also present changes in public emotions [9,10].Text-based data on social media provide accurate geolocations, rich emotional information, and distinct topics; the different topic information within social media text data is an important data source for public opinion research [11].
Most traditional spatiotemporal studies of public opinion use the administrative region as the analysis unit or the coordinates of users' blogs or comments to analyze the geographic density [12].Box-Steffensmeier and Moses [13] explored the level of sentiment and severity of the pandemic in each state in the United States during the COVID-19 pandemic; however, they used only the administrative region as the unit of analysis, and the scope of analysis was limited.Liu et al [14] conducted spatiotemporal analysis of the evolution of public opinion during the COVID-19 pandemic based on microblog data and visualized public sentiment and the number of microblogs in provinces and cities across the country.Although the research scope was expanded to the whole country, the selected spatial units were relatively concentrated and were not able to reflect the differences in public opinion at different scales.The spread of the pandemic has obvious regional differences between cities. Liu and Liu [15] used the GeoSEn geoparser to obtain geographic location information from text data and converted it into coordinates for emotional spatial analysis, but the monitoring location was not accurate, which meant the analytic results deviated from the spatial standard.In particular, the results from administrative units at different levels are quite different, while there is a small number of microblogs with user location coordinates, which leads to further errors in the results.In addition, the propagation of public opinion on social media is regionally correlated.The scope of public concern not only is limited to local areas but also includes information from other adjacent areas, which cannot be effectively mined by traditional public opinion analysis methods [16].
Social media data published by users contain rich geographic information, and many scholars have used social media to simulate and predict real events, such as predicting the spread of influenza, detecting earthquakes, and monitoring air quality.To monitor public opinion, Hu et al [17] proposed a model combining latent Dirichlet allocation (LDA) based on the document generation model and the k-means text classification algorithm based on genetic optimization; this combination can improve the accuracy of the clustering algorithm to monitor public opinion.Specifically, this method can identify and track topics related to public opinion on Twitter as well as mine the public's emotional characteristics in different fields.Zhang et al [18] studied algorithms to monitor a public opinion network, compared and analyzed the advantages and disadvantages of different text classification and emotional tendency algorithms, and discussed future trends in algorithm development to monitor public panic during the COVID-19 pandemic in different geographical locations.Microblogs contain emotional information from social users.Researchers such as Jang et al [19] have analyzed microblog data to determine the spatial and temporal variations in emotions expressed by Twitter users in North America.They also analyzed values given to emotions and the relationships between the influencing factors, which highlighted the study area index and emotional score.In their study, the spatiotemporal variation in the public's attention to the pandemic and emotion were discussed.Storey and O'Leary [20] constructed a global sentiment map of Twitter users and analyzed the spatiotemporal characteristics of urban sentiment by calculating the sentiment information from social media text-based data.The risk of pandemic spread at multiple time nodes was evaluated by converting geographic information from text into coordinates for emotional spatial analysis.Alhashmi et al [21] proposed a sentiment classification network model combining part of a speech attention mechanism and long short-term memory network, which can fully mine the relationship between emotional polarity words and emotional target words of sentences and analyze the correlation between the spatial distribution of online public opinion and high-risk areas of the pandemic through spatiotemporal migration.
This study aimed to mine social media comments on COVID-19 topics and explore their spatiotemporal distribution characteristics.The specific research period was from July 2020 to June 2021.More than 100,000 comments from 12 People's Daily microblogs were obtained through the microblog application programming interface (API) interface, and 2000 samples were screened for feature extraction and sentiment analysis.On this basis, we proposed 3 stages of the pandemic covering the changes in public opinion.Meanwhile, through topic modeling, 12 core topics were identified to map the potential drivers of these changes.The purpose of this study was to help government and public health security departments understand the public's emotions and views on the COVID-19 pandemic, formulate more reasonable pandemic prevention policies, effectively respond to the COVID-19 pandemic, and maintain social stability.
The rest of the paper is structured as follows: The Methods section introduces the research ideas and key algorithms used in this study.The Results section extends the analysis of the experimental results.The Discussion section concludes the paper with contributions, limitations, and directions for future research.

Overview
First, based on the API interface for the Sina microblog, data from COVID-19-related microblog comments from July 1, 2020, to June 1, 2021, which was in the middle of the COVID-19 pandemic, were obtained and preprocessed.Second, we considered the characteristic of low granularity as well as short words in the microblog comments [22].Based on the SnowNLP Chinese sentiment vocabulary ontology, the Dalian University of Technology sentiment classification dictionary [23] is optimized to identify sentiment features, and a multidimensional analysis model of public opinion on social media during the pandemic was constructed from the perspective of spatiotemporal correlation.Third, according to the multiscale division method of public opinion, the term frequency-inverse document frequency (TF-IDF) method was used to explore the semantic features of public opinion.Fourth, according to the difference in public opinion data characteristics, a model combining LDA and Bidirectional Encoder Representations from Transformers (BERT) [24] was used to classify the topics.The number of topics was determined according to minimum perplexity, and the topic weight was established using chi-square test results.Finally, a machine learning logistic regression (ML-LR) sparse matrix fusion model was used to analyze the evolutionary trend in public opinion combined with the monthly pandemic notification information.The technical route and structure of this paper are shown in Figure 1.

Data Extraction
This study collected data for topics related to COVID-19 in the monthly hot topic search of the People's Daily microblogs from July 2020 to June 2021, including the hot topic name, topic search volume, and date of the blog post with the most searched topic, and selected more than 100,000 comments from 12 microblogs.These 12 blogs have a high degree of heat (eg, likes, comments, and retweets), and the blog topics represent the hot events of the corresponding timeline, which can be regarded as a microcosm of the different development stages of the COVID-19 pandemic in China.The specific data from these 12 microblogs are shown in Table 1.Based on the ArcGIS interface of the geocoding package Geocoder, the geographic latitude and longitude of the check-in location coordinate system were then obtained, and the IP address geographic location information of the user was calculated.Through the Requests library of the Python language, the data interface was requested and parsed, and 2000 comments were screened for sentiment analysis.An example of the crawled microblog data is shown in Table 2.

Jilin Province
It is hoped that the test reagents can be distributed to every city in the country, whether developed or backward.The more backward provinces are the bigger the crisis, the news is closed, and the awareness of prevention is weak October 15, 2020 User 1

Guangdong Province
The most frightening thing is that the virus is still in its initial stage, and how it will mutate in the future is uncertain.What if it becomes more deadly January 24, 2021 User 2

Beijing City
We call on the government to strictly control the price of masks and crack down on the bad behavior of price gouging by bad businesses in special periods April 8, 2021 User 3 Sichuan Province With such attention and rapid action and scientific prevention and treatment, the country will be able to effectively control and defeat the COVID-19 pandemic June 17, 2021 User 4

Data Preprocessing
Issues with the crawled text data included missing column values, numerical anomalies, and special symbols, which need to be supplemented and filtered.First, the Jieba word segmentation tool was used to process the text segmentation, and a custom dictionary was established for the high-frequency words and proper nouns related to the pandemic.Second, the Trie tree structure was used for efficient word graph scanning, and a stop word list was established to filter out the noisy data from the text.Third, the text information was converted into vectors (ie, feature engineering transformation).The model can only input numbers (like vectors), not text; therefore, before running the model, any signal needed to be converted into a digital signal (eg, number, vector, matrix, tensor) that can be recognized by the model.The regular word segmentation result was used as the input for the model.The data preprocessing results are shown in Table 3.We should praise the medical staff and scientific researchers who are still struggling in the front line! 2 You don't need to panic, but you do need to be vigilant.If you notice suspicious symptoms, go to the hospital.

3
The specific text data preprocessing process included (1) removing duplicate data, (2) removing useless characters, (3) using Jieba word segmentation, (4) removing stop words, (5) removing low-frequency words, (6) removing any tags such as HTML, and (7) using the decision tree method to supplement the missing column values and integrate the data.

Sentiment Classification
To reflect the characteristics of public opinion, a method based on dictionary and thesaurus matching was used.The Dalian University of Technology sentiment dictionary was used to scan the strings in the dictionary one by one and provide auxiliary annotations for sentiment classification.This method combines the characteristics of the topic and Chinese grammar and expands the original dictionary from the dimensions of "word," "part of speech," "word sense number," "sentiment classification," "intensity," and "polarity." The basic dictionary selected for this paper was the emotional vocabulary library of the Dalian University of Technology, which divides emotions into 7 categories ("anger," "disgust," "fear," "sadness," "surprise," "good," "happy") and 21 subcategories.The initial emotional intensity was set to 5 levels (1, 3, 5, 7, 9), which is more detailed than other dictionaries.To facilitate sentiment calculation by a computer, we divided the polarity of sentiment words into 2 categories: positive (1) and negative (0).The formula for word sentiment is given in Equation 1: where s(w) represents the sentiment value of the term, v(w) is the sentiment intensity of the word, and p(w) denotes the sentiment polarity of the word.4.

Feature Extraction
This study used a topical term extraction method based on the combination of LDA and BERT.First, the review text was segmented into words, and the word vector was generated based on the hybrid pretrained model.The k-means clustering method was then used to cluster the word vectors, and the words with higher word frequencies were selected as representative words in each class.At the same time, other words in the same class were replaced by representative words to reduce the amount of input data.Finally, the biterm topic model (BTM) for short text was used to extract the topics.
The BTM is aimed at the characteristics of short text and extracts more informative topics using co-occurrence patterns of word pairs in the whole corpus.The modeling process of the BTM generates a corpus of word pairs.Model training and model parameter inference are then performed based on the generated corpus.Finally, the topic distribution and word distribution on the corpus are obtained.If we suppose there are M feature words, |B| word pairs, and K topics in the corpus, then the corpus-level topic distribution is denoted by θ, the distribution of topic K is denoted by θ k , and the word distribution is denoted by Ø, as shown in Equation 6.
where z represents a topic extracted, p(z=k) is the probability of occurrence of topic k, and p(z=k) is the probability of occurrence of words under topic k.
Perplexity is widely used to measure the fitting effect of an LDA model.Perplexity is a probabilistic model evaluation metric that evaluates the predictive ability of a trained model on new unseen data.LDA perplexity is the perplexity when the model predicts new unseen text.After understanding the calculation of the statement probability, the perplexity of the statement s=w 1 , w 2 , w 3 , ..., w n can be defined as seen in Equation 7: To calculate the perplexity of LDA, we needed to utilize the generation process of the model.Specifically, we needed to split the text data into training and test sets.The training set was used to build the LDA model, and the test set was used to calculate the perplexity of the model.In the test set, we treated each document as a sequence, taking one word at a time from the sequence and inferring the topic of that word based on the current model.Once the topic of the word was predicted, the model parameters were recalculated.In this process, we needed to calculate the perplexity of the text using the topic of the predicted word and the frequency of all the words.

Sentiment Analysis
The microblog comment text was divided into positive and negative sentiment, and the value represented the probability that the text contained that sentiment.The values ranged from 0 to 1; closer to 1 tended to be positive, and closer to 0 tended to be negative.To improve the accuracy of sentiment prediction, the sentiment classification model needed to be retrained.The main steps are described in the following paragraphs. of each microblog was obtained using the newly trained sentiment analysis model.In the actual judgment, to make the visualization results more intuitive, the value of was lowered by 1.That is, when the return value was in the interval of -1 to 0, the sentiment probability value was negative; when the return value was between 0 and 1, the sentiment probability value was positive.The sentiment score S D was calculated as shown in Equation 8: First, the feature words were inputted, and the sentiment polarity was classified as 1 ("positive") or 0 ("negative").Second, the TF-IDF calculation converted the words in the text into a word frequency matrix, and the matrix element a[i][j] represented the word frequency of j words in type i text.MemoryError was used to control the parameter.The transformer was then used to calculate the TF-IDF weight of each word.The first fit_transform was used to calculate the TF-IDF, and the second fit_transform was used to convert the text into a term frequency matrix to obtain all the words in the bag-of-words model.The TF-IDF matrix was then extracted.The element w[i][j] represented the TF-IDF weight of j word in the i type text, and the data were divided by combining the sparse matrix.Finally, the logistic regression classification method was used to calculate the model benchmark indicators.The binary classification ML-LR model is given in Equations 9 and 10: where w is the weight, b is the bias (b can be 0), and we can expand the weight and input vector a little, as shown in Equation 11: w=(w (1) , w (2) , ..., w (m) , b) T , X=(x (1) , x (2) , ..., x (m) , 1) T (11)

Ethical Considerations
This study did not require ethics approval because all data collected were publicly available.There is no means within this paper or its supporting materials to establish the identification of users and their corresponding tweets.

Analysis of the Change in Public Opinion Based on LDA Topic Modeling
We identified 12 key dates as turning points for mood scores during this period.Figure 2 shows the general trend in the monthly sentiment changes of microblog users during the COVID-19 pandemic.In general, the overall classification results show obvious clustering according to the time series.
In the first stage (July 2020 to October 2020), strong infectious tendencies and unknown virus characteristics exacerbated public panic, and user sentiment ratings were generally low.In the second phase (November 2020 to February 2021), changes in sentiment scores were relatively stable, except for a large decrease in January 2021 and February 2021, possibly due to material shortages and population movement that accelerated virus transmission.In the third phase (March 2021 to June 2021), the proportion of positive emotions gradually increased thanks to the successful development and widespread distribution of vaccines.The data show that the changes in the number of infected people and the effectiveness of pandemic prevention measures were important factors affecting the change in the polarity of public sentiment.
In the face of the pandemic, people's instinctive psychological reaction was panic and anxiety, and these negative emotions were particularly obvious in the first stage.In the second stage, government departments strengthened the control of public opinion on social media.As a result, the public's confidence about fighting the pandemic was significantly enhanced, and the emotional polarity gradually improved.In the third stage, the proportion of positive emotions increased significantly, and negative emotions gradually turned into affirmation and support for antipandemic actions.Figure 3 shows the keywords in the monthly hot topic searches on the microblogs during the COVID-19 pandemic.
The SnowNLP tool was used to calculate the sentiment value, and the text was classified according to the threshold.The LDA model was then used to mine the topics.The hyperparameters of the model were set as α=50/K and γ=0.01.The number of iterations was set at 1000.The number of potential topics was determined as K=12 according to the perplexity.The same weight was given to the topics with a monthly cycle by combining the change in the intensity of the influence of the propagation of the microblog information.
We obtained 12 topics from the feature extraction of microblog topics during the COVID-19 pandemic (see Table 5).Among them, pandemic prevention and people's livelihoods were the focus of public attention.

Pandemic prevention measures T7
Cases, asymptomatic infection, spread risk, medical insurance, living necessities, regional control, nucleic acid testing, health monitoring Medium or high-risk areas T8

Phase 3
Vaccination rate, necessity, population immunity, adverse reactions, antibody, allergy, personal protection, inoculation contraindication Vaccination T9 Source of infection, chain of transmission, close contacts, gathering activity, nucleic acid testing, pandemic prevention awareness, route of transmission, policy control

Variant strain T11
Centralized isolation, medical observation, nucleic acid testing, body temperature, abnormal signs, incubation period, clinical symptoms, movement tracking

Close contact T12
a LDA: latent Dirichlet allocation.
Multimedia Appendix 1 shows the results of topic modeling.In the first stage, the main topics were mainly focused on pandemic prevention and control.In the second stage, in addition to vaccines, food safety became the focus.The core topics of the third stage were COVID-19 vaccination and variants.

ML-LR Public Opinion Sentiment Analysis With a Sparse Matrix
To explore the spatial distribution of public emotions, we subtracted the same types of emotions from provinces and regions in adjacent stages according to regional differences and obtained the spatiotemporal changes in negative emotions, as shown in Figure 4. Taking provincial administrative regions as the basic statistical unit and the 3 evolution stages as fixed time intervals, the natural break point method was used to divide the proportion of negative emotions.
Neighboring provinces had similar emotional characteristics; that is, the spatiotemporal similarity of emotions was high.Moreover, the proportion of negative emotions was related to the severity of the local pandemic, and a high value for negative emotions had a spatial distribution similar to that of areas with a more severe pandemic situation.In addition, provinces with many confirmed cases had a high proportion of negative emotions, while provinces with a small number of confirmed cases had a relatively low proportion of negative emotions.
Combined with China's daily real-time notifications regarding the pandemic, the first stage of the pandemic in China occurred during the outbreak period, with the number of confirmed cases reaching a peak in August 2020 and the confirmed case rate gradually slowing down since then.As can be seen in Figure 5, during the period from July 2020 to January 2021, anger, disgust, fear, sadness, and other negative emotions prevailed.When combined with topic digging, this result shows that people's concerns regarding the COVID-19 pandemic included fear of human-to-human transmission, a domestic outbreak, and imported cases from other countries.
During the second stage (February 2021 to June 2021), the sentiment scores basically showed positive sentiment, indicating that the government adopted effective response policies and that public sentiment tended to stabilize again.Positive emotions such as surprise, good, and happy rapidly increased, indicating that the government invested considerable human and material resources at any cost.Therefore, the public was able to observe the determination and effectiveness of the country's antipandemic efforts.In addition, with the arrival of the inflection point during the third phase of the pandemic, the mass distribution of COVID-19 vaccines increased public confidence that the pandemic could be prevented and controlled and that production, work, and prospects could resume after the pandemic.
To visually present the words occurring at a high frequency for each emotion, we used a word cloud library to generate cloud maps of 70 words for 7 emotions corresponding to positive and negative emotions in the 3 stages, as shown in Table 6.At the same time, high-frequency words were combined with the corresponding current affairs hot spots to explore the differences in and connections of different semantic features in different sentiment classifications.In the initial stage of the pandemic, the words occurring at a high frequency included "hopeless," "danger," "infect," and other words as well as "negative," "rumor," "helpless," and many other words that express emotions.In the face of the sudden COVID-19 pandemic, the public was in an extremely unstable emotional state.
In the second stage of the pandemic, the words occurring at a high frequency included "keep away," "pandemic," and "pathogen."Microblog topics focused on orderly prevention and control measures and a joint fight against the pandemic.The positive sentiment of netizens gradually increased, turning from fear to solidarity and cooperation.
In the third stage of the pandemic, words such as "vaccine," "recovery," "hope," and "sanguine" appeared frequently on the microblog.Most people were full of confidence and believed that China could win the battle against the pandemic, expressing positive feelings of positivity, unity, and hope for the future.

Model Performance Analysis
To verify that the proposed model and method had high accuracy, we calculated accuracy, precision, recall, and the F 1 -score, as shown in Equations 12-15: The words in the text were converted into a word frequency matrix, and the TF-IDF weight of each word was counted.The TF-IDF matrix was then extracted, and its weight was calculated.Finally, the effectiveness of the model was evaluated by extracting parameters (precision, recall, accuracy) from the confusion matrix, as shown in Figure 6.
First, the word frequency matrix was generated using the text-based data after Chinese word segmentation and data cleaning.The CountVectorizer class was called to calculate the word frequency matrix, and the generated matrix was X.Second, the TfidfTransformer class was called to calculate the TF-IDF value of the term frequency matrix X, and the Weight matrix was obtained.The Sklearn machine learning package was then called to perform the classification operation, the fit () function was called to train, and the predicted class labels were assigned to the pre array.Finally, we called the PCA () function of Sklearn to reduce these features to 2 dimensions corresponding to the X and Y axes, from which we could evaluate the algorithm.
Based on the study of the traditional double classification confusion matrix, we divided the confusion matrix into 7 emotions according to the emotional characteristics.Very few data points were misclassified from the matrix by the model.Moreover, the performance of the model in terms of accuracy, recall, and the F 1 -score of the weighted average of the 7 emotions "anger," "disgust," "fear," "sad," "surprise," "good," and "happy" was good, as shown in Table 7.

Principal Findings
This study constructed a multidimensional analysis model of public opinion on social media in China during the COVID-19 pandemic from the perspective of spatiotemporal correlations.We proposed an ML-LR model with a sparse matrix to analyze the evolutionary process of public opinion and interpret the dynamic relationship and multidimensional emotional characteristics of public opinion in different spatiotemporal environments.The results show that, due to the different trends in the pandemic situation and prevention and control efforts in different regions, there were differences in the emotional characteristics of public opinion.The amount of public opinion data at many different levels was similar in the temporal and spatial distributions, and the amount of public opinion data was XSL • FO RenderX positively correlated with the number of new cases.With the rapid spread of the COVID-19 pandemic, the monthly amount of public opinion data increased.As the COVID-19 pandemic was gradually controlled, the amount of monthly public opinion data showed a downward "zigzag" trend.The spatial distribution of the amount of public opinion data was positively correlated with the distribution of COVID-19 spread, and the provinces with more public opinion data were mostly those areas with a more serious COVID-19 situation.This study can provide theoretical support and a practical reference for government and public health safety departments to deal with public health emergencies.

Comparison With Prior Work
In traditional research of public opinion on social media, the topic model method is often combined with a text clustering algorithm [12,23,25], but this approach is limited by the problem of insufficiently labeled data, making it difficult to reflect the changes in public mood.This paper proposes an ML-LR model with a fusion coefficient matrix to overcome these problems.In addition, social media data embedded with geographical location information provides valuable evaluation indicators for the study of public opinion characteristics, but the time span and geographical location range selected by traditional research of public opinion on social media are of limited size or are not representative [4,17].This study captures the dynamic changes in public sentiment characteristics through multidimensional, spatiotemporal analysis of public opinion.

Limitations and Future Work
We will conduct further research regarding 2 aspects in the future.On one hand, when analyzing public sentiment during a pandemic, user comments may come from multiple social media platforms [25,26].Subsequent research will consider adding data from other social media platforms, strive to include a more comprehensive user group, and describe more appropriate regional characteristics of public opinion.On the other hand, considering that the spread of the pandemic has certain geospatial heterogeneity under the joint influence of geographical proximity, transportation network, and pandemic prevention measures, taking provincial administrative regions as geospatial measurement units has certain limitations [27][28][29].
In future research, we will discuss how to obtain a multiscale visual analysis unit of the pandemic and public opinion according to the superposition of the transmission mode of the COVID-19 pandemic and multiscale geographic space.We will also mine the process of propagation during the pandemic from a more granular scale in terms of time and space.

Conclusions
The analytic method of public opinion on social media proposed in this study can effectively reflect the characteristics of public opinion in different regions and different periods of time.It can also provide theoretical support and a practical reference for the analysis of public opinion in major public health events, as well as provide correct guidance for government departments and effective control of the propagation of network public opinion.

Figure 1 .
Figure 1.The system architecture of this study.LDA: latent Dirichlet allocation; ML-LR: machine learning logistic regression; TF-IDF: term frequency-inverse document frequency.
First, we needed to calculate the TF-IDF values of the words in the text to obtain the feature matrix.The TF-IDF value of the feature item w ij was calculated as shown in Equations 2-5: Here, w ij represents the j th word appearing in the microblog text-based data from the i th day.C(w ij ) is the number of occurrences of the term w ij .D is the total number of documents in the daily microblog text-based data |D i | for the number of words in a document D i .denotes the bag-of-words vector of the document D i .The function I(w ij ,D i ) takes the value 1 or 0, where 1 means that the document D i contains the word w ij ; otherwise, it takes the value 0. The part-of-speech and sentiment classification of the words are shown in Table

First
, the training method of the Bayesian model was used to train the sentiment classifier, and the classification method in the Bayesian classification was then used to predict the sentiment classification and test the accuracy of the model.Finally, the newly trained model was saved.The daily microblog text set D={d 1 , d 2 , ..., d m }.The variable m represents the number of microblog crawls per day.The sentiment score

Figure 2 .
Figure 2. Monthly distribution of the sentiment polarity in microblog comments about the COVID-19 pandemic in China from July 2020 to June 2021.

Figure 3 .
Figure 3. Monthly statistics of the keywords in the hot topic searches regarding COVID-19 pandemic behavior in China on microblogs from July 2020 to June 2021.

Figure 5 .Table 6 .
Figure 5. Bubble plot of the temporal trends in 7 sentiments based on microblog comments during the COVID-19 pandemic in China from July 2020 to June 2021.

Figure 6 .
Figure 6.Multiclass confusion matrix for sentiment scoring based on COVID-19 pandemic-related topics in microblog comments in China from July 2020 to June 2021.

Table 1 .
Data information statistics of 12 representative blogs about the COVID-19 pandemic in China from July 2020 to June 2021.

Table 2 .
Sample comment information about the COVID-19 pandemic in China crawled from a microblog platform from July 2020 to June 2021.

Table 3 .
Comparison of a sample of annotated texts about COVID-19 in China before and after data preprocessing from July 2020 to June 2021.

Table 4 .
Part-of-speech and sentiment classification of words in the text of a sample of microblog comments with the topic of COVID-19 pandemic behavior in China from July 2020 to June 2021.

Table 5 .
Topic feature extraction analysis of microblog comments about the COVID-19 pandemic at different stages in China from July 2020 to June 2021.

Table 7 .
Performance analysis of a machine learning logistic regression (ML-LR) language processing model fusing a sparse matrix based on Chinese COVID-19 pandemic topics from July 2020 to June 2021.