# Deep Learning-Based Natural Language Processing Methods for Sentiment Analysis in Social Networks

Authors: Yan Li
Journal: Mathematical Problems in Engineering
 (2022)

---

## Abstract

This paper presents an in-depth study of the sentiment of social network communication through a deep learning-based natural language processing approach and designs a corresponding model to be applied in the actual social process. Specifically, the network can dynamically select the most important word in the current state according to the information available and achieve the accurate recognition of the dynamically changing important content in a sentence. Based on this, the semantic understanding of the whole sentence is achieved through a continuous cycle of the process. In addition, considering that the semantic representation of natural language is highly dependent on contextual information, the lack of contextual information will lead to the ambiguity and inaccuracy of semantic representation. In this paper, we study the sentiment analysis algorithms in social networks at two levels, unimodal and multimodal, and construct a text sentiment analysis model and a picture-text multimodal sentiment analysis model in social networks, respectively. By comparing the experiments with the existing models on several datasets, the accuracy of the two models exceeded the benchmark models by 4.45% and 5.2%, respectively, which verified the effectiveness of the two models. The feasibility of applying the optimized convolutional neural network recurrent optimization network to social network sentiment analysis is verified by practically applying the optimized convolutional neural network recurrent optimization network to single task and multitask and comparing other existing deep learning classifiers.


---

## Body

## 1. Introduction

The development of social platforms has led to the generation of a large amount of textual information on the Internet with strong subjective color based on user participation. On the one hand, these text messages have the literal information of the text, and on the other hand, they contain the emotional information of the users. Collecting and studying this emotional information can understand not only the changes in users’ emotions in the process of using Internet products but also their views on certain things or objects. When a user wants to buy a product, through the comments and experience of other users on the Internet, he will be able to judge the purchase of the product through the emotions shown by these users. On the other hand, merchants can judge the user’s emotional tendency in the process of using the product through the information in the user’s comments and get the user’s preferences so that they can improve the product in response to the user’s emotional feedback and thus improve the user’s experience [1]. Therefore, the similarity of user’s attribute information is used as an influencing factor for judging the degree of emotional correlation between social network contents. At the same time, it is also possible to improve users’ shopping experience by responding to the emotional changes in each user’s feedback. For sentiment analysis of text, it is necessary to find the corresponding sentiment phrases from the text and classify each different sentiment to get the correct meaning of the sentence. For example, the cup works well, but the delivery is slow. In this case, the cup as the target has a positive emotional tendency. In the case of “delivery” as the target, the emotional tendency is negative. In this example, the evaluation of product and service aspects is related, and each aspect has a different emotional bias, so it is not only imprecise to determine the emotional tendency of the whole sentence directly. In general, aspect-level-based sentiment classification is more relevant and valuable and therefore has received attention from a wide range of researchers [2].Rumors are defined in different ways in different research fields, and the concept has a long history; usually, we define rumors as statements that are not authenticated or do not correspond to real facts. As one of the rumors, Internet rumors are very special in terms of information dissemination, as they can be accessed by smart devices anytime and anywhere, and can easily spread on major online social platforms, so they are very harmful. In response to the different instructions made by people, computers can complete the corresponding control processing and other operations [3]. Natural language processing enables computers, cell phones, and other electronic devices to have the ability to recognize and understand human language, so that users can control and use electronic devices more easily and quickly, saving operating time and improving work efficiency. Due to its complexity, there are still many technical difficulties that have not been completely solved by researchers and scholars. The main problems include the constant generation of new words, the multiple meanings of Chinese words, and the flexibility of natural language [4]. In the face of the massive amount of data in the Internet world today, data collection, processing, and classification by manual means can no longer meet the needs of users. Text classification technology can not only help people manage huge data in an efficient and orderly way, but also help people dig out the information and laws implied in the data to achieve twice the result with half the effort.First, different types of contextual information can greatly expand the scope of data available. Multimodal content such as images, audio, and video can provide different types of contextual information for the semantic understanding of natural language. In addition, the unique features contained in different types of data can also provide richer knowledge of the natural language. For example, image information can provide rich scene information for natural language understanding, and audio can provide intuitive information about mood, tone, and attitude, which cannot be provided by textual content alone. Then, the probability distribution of the emotional polarity of the content to be predicted is output through data processing. In addition, the natural language habits of humans can provide more convenient and efficient design ideas for natural language processing. For example, when reading an article, humans will first quickly browse the whole text to achieve a grasp of the overall semantics and then dynamically select the most important content to focus on according to the specific needs and actual knowledge acquired, ignore irrelevant parts, and stop reading directly after reaching the goal. Based on such a starting point, this paper aims to conduct an exploratory study on the theory and methods of semantic understanding and representation of natural language using contextual information.


## 2. Related Works

If the number of occurrences of both polarities is the same, a neutral judgment result is returned. One of the most representative approaches of rule-based methods is the sentiment lexicon, and the choice of sentiment words largely determines the performance of the sentiment lexicon [5]. To obtain more reliable and accurate sentiment tendencies in problems such as text sentiment analysis and topic classification, one needs to have a sentiment lexicon that can contain most sentiment words [6]. The lexicon-based approach, which usually predicts the overall sentiment orientation of a text message from words annotated with polarity scores, has been widely adopted in routine text sentiment analysis research because it does not require training data. Sent strength is a well-known lexicon-based algorithm for effective identification of informal text sentiment in social media, which is based on a human-encoded lexicon of words and phrases frequently used in social media [7]. Xue et al. developed a lexicon-based platform called semicircles for Twitter sentiment analysis [8]. The study updates the sentiment polarity and scores of words in training, considering the patterns of words that occur simultaneously in different contexts. One of the most fundamental and critical aspects of text sentiment analysis is to build a high-quality sentiment lexicon, to overcome the problems such as the invariance of sentiment tendencies expressed by words in traditional sentiment lexicons [9]. Alamanda et al. constructed a dynamic sentiment lexicon based on a three-layer neural network structure to effectively improve the classification accuracy of sentiment analysis in social networks [10].Khan et al. proposed an algorithmic model to apply a neural network algorithm to web text classification, and the experimental results showed that the classification algorithm based on the neural network model has higher accuracy than the classification algorithm based on traditional machine learning [11]. The traditional classification mainly uses supervised algorithms for classification, which leads to the error accumulation problem in the classification process. Rani et al. proposed a Chinese semantic feature learning method based on convolutional neural networks [12]. Instead of using natural language processing tools for feature extraction, the method uses deep learning models for automatic learning of semantic relations, which improves the accumulated errors in extracting features and increases the accuracy of text classification. The system understands the linguistic patterns in the similar texts of two languages by analyzing them and dividing the same sentence with the same meaning in both languages into words, which are then matched [13]. Technically speaking, multimodal fusion is the process of combining data collected from different modalities for analysis to predict the type of data. After many repetitions of word division, the system records the words with the highest correspondence probability in both languages, which are synonyms in our usual sense. This method is more efficient and has higher accuracy than traditional model algorithms.The paper mainly aims at removing noise from the dataset and enhancing the modeling of aspectual word-related semantics, firstly proposing the combination of aspectual words with contextual semantic information, and secondly designing an additional gating mechanism to mitigate the effect of noise to obtain a more accurate representation of sentiment cues. The convolution and maximal merging mechanisms aim at capturing the sentiment cue representation associated with key aspects and obtaining the positional invariance of features.


## 3. Deep Learning Natural Language Processing Methods for Social Network Sentiment Analysis

### 3.1. Design of Sentiment Analysis for Social Networks

Sentiment analysis is very important to understand text meaning accurately [14]. The analysis and localization of sentiment phrases can help machines understand the sentiment tendency in sentences. Machine learning algorithms extract the more obvious features of the text, such as whether the speaker’s attitude or opinion is positive, and whether the expresser of the opinion uses some emotional words. Secondly, sentence-level text analysis often needs to consider the sentiment of the words contained in the sentence, which is mainly achieved by three analysis methods: one is to rely on knowledge base analysis, the other is to use the network to conduct analysis, and the third is to start the analysis with a corpus. Generally, in the process of identifying text sentiment, the sentiment database created will contain some sentiment symbols, abbreviations, sentiment words, modifiers, etc., and overcome the shortcomings of both methods at the same time. We define several sentiments in specific experiments and label the sentences with one of the sentiment categories and their intensity values to achieve sentence pairing.Sentence-level sentiment analysis refers to sentiment determination on texts of one or two sentences in length. Such texts are often short, such as refined social networks and movie reviews. When sentiment analysis is performed on such texts, the sentence is usually broken down into words and the keywords that represent the sentence are searched for, and then the sentiment tendency of the main word that represents the sentence is determined, and this tendency replaces the sentiment color of the whole sentence. Word-level sentiment analysis is the most basic sentiment analysis, and words with obvious sentiment color are usually called sentiment words, which are the basis of sentiment analysis [15]. With the development of artificial intelligence, nowadays word-level sentiment analysis generally calculates the relevance of words mainly based on the positivity and negativity of words in the text, and the relevance or characterization of words in the lexicon to calculate the correlation between features.In social media, a user can follow multiple other users, thus forming the following relationship between users, which is like a real-life friend relationship, so the following relationship is a kind of social relationship. The social network posted by users and the emotions expressed by them can be quickly spread along the network formed by the following relationship, resulting in more consistency in the emotions of social network content posted by users with the following relationship. Since the following relationship among users can reflect the relevance of expressed emotions, the existence of the following relationship among users is considered a factor affecting the similarity of social network emotions, as shown in Figure1.Figure 1
Emotional similarity of social networks.In addition, the following relationship between users can be divided into a one-way following relationship and a two-way following relationship according to the way of following. With the development of deep models, increasingly multimodal fusion work adopts an intermediate fusion strategy; that is, the features of different modalities are fused into a single hidden layer, called a shared representation layer. One-way following relationship means that only one of the two users follows the other, and a two-way following relationship indicates that two users follow each other; in this chapter, both one-way following relationship and the two-way following relationship between users are used as influencing factors to calculate emotional similarity. Secondly, the higher similarity between users posting social network texts under the same social network topic indicates the higher similarity of users’ opinions expressed under the topic, which in turn can map the high similarity of expressed emotions, so the similarity between texts is taken as another factor influencing the sentiment similarity.However, it is not enough to represent the semantics of sentences in specific contexts; natural language inference is concerned not only with the semantic expression of sentences but also with the semantic interaction between two sentences [16]. The semantic interaction between sentences helps to obtain mutually valuable information between two sentences. Therefore, based on the accurate representation of the semantics of sentences in a specific context, the sentence attention layer models the interaction information and local relevance between two sentences at a finer granularity.To learn to obtain sentiment features that contain both image features and text information, this paper proposes an image-specific text sentiment feature extraction method. The method consists of three main modules, the first module is to obtain sentence feature representations through the semantic attention layer, the second module is to use CNN networks for image feature extraction, and the third module is to obtain sentence feature representations containing image features by fusing image and text features in the multimodal attention layer; the sentence features of the fused images are input into a classifier for textual opinion sentiment analysis.Therefore, if a method can be found to represent the distribution of factors using a decomposition with fewer variables, the cost of identifying the joint distribution can be greatly reduced, as shown in Figure2. The current more mainstream solution is through some graphs of edges connecting vertices, and academics call this decomposition method a structured model. The words that have completed the tokenization are represented in vector form so that the computer can calculate them. The structured probability model is divided into two kinds directed and undirected, each node corresponds to a random variable, and each edge represents the probability distribution between these two random variables in a direct role.Figure 2
General architecture of social network sentiment analysis for historical behavioral similarity.To verify the influence of the user’s emotional state of historical social network postings on determining the user’s current emotional state, the user’s historical social network postings are retrieved according to the user name, and the emotional features related to emotional expressions are extracted from them.With the development of artificial intelligence, today’s word-level sentiment analysis generally mainly calculates the relevance of words according to the positive and negative nature and relevance of words in the text, or characterizes the words in the thesaurus to calculate the correlation between features. According to the above introduction of social homogeneity, users with similar attribute information tend to express the same opinions and similar emotional tendencies under the same topics, so the similarity of users’ attribute information is used as an influencing factor to determine the degree of emotional relevance among social network contents. Due to the limitation of the selected dataset, only the similarity of users’ geographic location is considered in this chapter when calculating the similarity of users’ attribute information. Since the geographic location information of users has multilevel attributes, only the two-level geographic structure of users’ country and the city is considered to reduce the complexity of the calculation.To predict the sentiment polarity of the input content, it is necessary to first obtain the sentiment polarity annotation of each content and then output the probability distribution of the sentiment polarity of the content to be predicted through data processing [17]. Since the dataset selected in this chapter is not labeled with the sentiment, it is necessary to first label the dataset with sentiment polarity. Secondly, the model proposed in this chapter needs to fuse the features extracted from the remaining two modules with the features of the current social network content to serve as the input to the neural network-based sentiment analysis structure.By fusing different data information from different modules through certain rules, the information can be complemented with each other, which in turn facilitates the model to process the data more comprehensively. The data-level fusion mechanism refers to the fusion of information from the data layer, where multiple data from different sources are fused to provide detailed data processing information for the model analysis. To verify the effectiveness of the social network sentiment analysis model based on the similarity of users’ historical behaviors, experiments are first conducted on real-world datasets, followed by comparisons with the research methods of the benchmark model, and then the results are analyzed for the impact of different feature modules on the model performance.


### 3.2. Design of Natural Language Processing Methods for Deep Learning

Multimodal learning generally involves combining data from various modalities to obtain information representations in different information sources for comprehensive analysis. After the words are one-hot encoded, since only one bit of the word vector obtained after encoding is 1, the vector distance between words is the same, which cannot reflect the correlation between words. One of the important issues in multimodal learning is multimodal fusion. Multimodal fusion is technically the process of combining data collected from different modalities for analysis to predict data categories.Feature layer fusion is the direct fusion of multiple independent feature vectors into a single feature vector utilizing point-sum or dot-product operations, or even just stitching, and finally, the result is derived by a classifier. The advantage is that it can capture the correlation between multimodal features and is easy to implement, and all features can be seen at once.Compared with feature layer fusion, the decision layer can choose the most suitable feature extractor and classifier for each modality according to different features, but it is difficult to integrate all classifiers effectively, and the correlation between modalities is ignored.The training model is validated using a test set to evaluate the strengths and weaknesses of the model algorithms, as shown in Figure3.Figure 3
Natural language processing flowchart.In probability statistics, the probability of a random event is calculated given that other events have already occurred, and this probability is called conditional probability.(1)Py|x=Px,yPx+Py.In equation (1), Py|x denotes the joint probability distribution of the simultaneous occurrence of event x and random event y. And the conditional probability Py|x is only meaningful when Px > 0; i.e., the formula cannot calculate the conditional probability of an event that will never occur given the event. Suppose, now there are three random variables a, b, and c, which can be obtained by using equation (1) twice.(2)Pa,b,c=PaPb|aPc2|b2,Pb,c=Pc2|b2,Pa,b=PaPb|a.In this way, you can understand the advantages and disadvantages of your own products, and then better improve the quality and service of your products. Ordinary users can learn about other people’s evaluations of movies through the comment area of the movie platform. In the research center of natural language processing, we often need to calculate the joint probability distribution of multiple random variables, and the formula for the joint probability distribution ofn random variables can be generalized according to equations (1) and (2).(3)Px1,x2,…,xn=Pxn|xn−1,…,x1Px1,x2,…,xn−1.In the experimental process, it is often necessary to calculatePBi when PBi|A is known. To determine the relationship between the two, the Bayesian formula can be used to calculate.(4)PBi|A=PBiPA|Bi∑i=1nPBiPA|Bi.The probability density of these three variables is now expressed as a chained form of the probability distribution of the two variables [19].(5)Pa,b,c=PaPb|aPc2|b2.However, when the number of words in the test dataset is too large, using unique thermal coding for word vectorization will bring some problems [20]. The sentence feature representation of the fused image is input into the classifier for text sentiment analysis. To solve these problems mentioned above, the word embedding technique based on dense space comes into being, as shown in Figure 4.Figure 4
Statistical information of the experimental dataset.
(a)(b)(c)(d)The laptop dataset is divided into two: the training set with a larger number of samples is mainly used to train the model, and the test set with a smaller number of samples is used to validate the trained model so that the accuracy can be used to determine the variability of the model. The training set contains 994 positive comment texts, 464 negative comment texts, and 128 neutral comment texts. The test set contains 341 positive texts, 169 negative texts, and 870 neutral texts [21].The second dataset, Restaurant, with data from restaurant reviews, is also divided into two parts, i.e., the training set and test set, where the training set has 3697 samples, containing 2164 positive review texts, 637 negative review texts, and 807 neutral review texts. He can make purchase judgments on this product through the emotions shown by these users. The test set consists of 341 positive texts, 169 negative texts, and 870 neutral texts, as shown in Table1.Table 1
Lexical annotation weighting table.
Part of speechWeightsCC0.81CD0.73DT0.71EX0.75FW0.74IN0.64JJ0.8JJR0.7JJS0.8LS0.87MD0.83WRB0.62WDT0.67VBN0.86


## 3.1. Design of Sentiment Analysis for Social Networks

Sentiment analysis is very important to understand text meaning accurately [14]. The analysis and localization of sentiment phrases can help machines understand the sentiment tendency in sentences. Machine learning algorithms extract the more obvious features of the text, such as whether the speaker’s attitude or opinion is positive, and whether the expresser of the opinion uses some emotional words. Secondly, sentence-level text analysis often needs to consider the sentiment of the words contained in the sentence, which is mainly achieved by three analysis methods: one is to rely on knowledge base analysis, the other is to use the network to conduct analysis, and the third is to start the analysis with a corpus. Generally, in the process of identifying text sentiment, the sentiment database created will contain some sentiment symbols, abbreviations, sentiment words, modifiers, etc., and overcome the shortcomings of both methods at the same time. We define several sentiments in specific experiments and label the sentences with one of the sentiment categories and their intensity values to achieve sentence pairing.Sentence-level sentiment analysis refers to sentiment determination on texts of one or two sentences in length. Such texts are often short, such as refined social networks and movie reviews. When sentiment analysis is performed on such texts, the sentence is usually broken down into words and the keywords that represent the sentence are searched for, and then the sentiment tendency of the main word that represents the sentence is determined, and this tendency replaces the sentiment color of the whole sentence. Word-level sentiment analysis is the most basic sentiment analysis, and words with obvious sentiment color are usually called sentiment words, which are the basis of sentiment analysis [15]. With the development of artificial intelligence, nowadays word-level sentiment analysis generally calculates the relevance of words mainly based on the positivity and negativity of words in the text, and the relevance or characterization of words in the lexicon to calculate the correlation between features.In social media, a user can follow multiple other users, thus forming the following relationship between users, which is like a real-life friend relationship, so the following relationship is a kind of social relationship. The social network posted by users and the emotions expressed by them can be quickly spread along the network formed by the following relationship, resulting in more consistency in the emotions of social network content posted by users with the following relationship. Since the following relationship among users can reflect the relevance of expressed emotions, the existence of the following relationship among users is considered a factor affecting the similarity of social network emotions, as shown in Figure1.Figure 1
Emotional similarity of social networks.In addition, the following relationship between users can be divided into a one-way following relationship and a two-way following relationship according to the way of following. With the development of deep models, increasingly multimodal fusion work adopts an intermediate fusion strategy; that is, the features of different modalities are fused into a single hidden layer, called a shared representation layer. One-way following relationship means that only one of the two users follows the other, and a two-way following relationship indicates that two users follow each other; in this chapter, both one-way following relationship and the two-way following relationship between users are used as influencing factors to calculate emotional similarity. Secondly, the higher similarity between users posting social network texts under the same social network topic indicates the higher similarity of users’ opinions expressed under the topic, which in turn can map the high similarity of expressed emotions, so the similarity between texts is taken as another factor influencing the sentiment similarity.However, it is not enough to represent the semantics of sentences in specific contexts; natural language inference is concerned not only with the semantic expression of sentences but also with the semantic interaction between two sentences [16]. The semantic interaction between sentences helps to obtain mutually valuable information between two sentences. Therefore, based on the accurate representation of the semantics of sentences in a specific context, the sentence attention layer models the interaction information and local relevance between two sentences at a finer granularity.To learn to obtain sentiment features that contain both image features and text information, this paper proposes an image-specific text sentiment feature extraction method. The method consists of three main modules, the first module is to obtain sentence feature representations through the semantic attention layer, the second module is to use CNN networks for image feature extraction, and the third module is to obtain sentence feature representations containing image features by fusing image and text features in the multimodal attention layer; the sentence features of the fused images are input into a classifier for textual opinion sentiment analysis.Therefore, if a method can be found to represent the distribution of factors using a decomposition with fewer variables, the cost of identifying the joint distribution can be greatly reduced, as shown in Figure2. The current more mainstream solution is through some graphs of edges connecting vertices, and academics call this decomposition method a structured model. The words that have completed the tokenization are represented in vector form so that the computer can calculate them. The structured probability model is divided into two kinds directed and undirected, each node corresponds to a random variable, and each edge represents the probability distribution between these two random variables in a direct role.Figure 2
General architecture of social network sentiment analysis for historical behavioral similarity.To verify the influence of the user’s emotional state of historical social network postings on determining the user’s current emotional state, the user’s historical social network postings are retrieved according to the user name, and the emotional features related to emotional expressions are extracted from them.With the development of artificial intelligence, today’s word-level sentiment analysis generally mainly calculates the relevance of words according to the positive and negative nature and relevance of words in the text, or characterizes the words in the thesaurus to calculate the correlation between features. According to the above introduction of social homogeneity, users with similar attribute information tend to express the same opinions and similar emotional tendencies under the same topics, so the similarity of users’ attribute information is used as an influencing factor to determine the degree of emotional relevance among social network contents. Due to the limitation of the selected dataset, only the similarity of users’ geographic location is considered in this chapter when calculating the similarity of users’ attribute information. Since the geographic location information of users has multilevel attributes, only the two-level geographic structure of users’ country and the city is considered to reduce the complexity of the calculation.To predict the sentiment polarity of the input content, it is necessary to first obtain the sentiment polarity annotation of each content and then output the probability distribution of the sentiment polarity of the content to be predicted through data processing [17]. Since the dataset selected in this chapter is not labeled with the sentiment, it is necessary to first label the dataset with sentiment polarity. Secondly, the model proposed in this chapter needs to fuse the features extracted from the remaining two modules with the features of the current social network content to serve as the input to the neural network-based sentiment analysis structure.By fusing different data information from different modules through certain rules, the information can be complemented with each other, which in turn facilitates the model to process the data more comprehensively. The data-level fusion mechanism refers to the fusion of information from the data layer, where multiple data from different sources are fused to provide detailed data processing information for the model analysis. To verify the effectiveness of the social network sentiment analysis model based on the similarity of users’ historical behaviors, experiments are first conducted on real-world datasets, followed by comparisons with the research methods of the benchmark model, and then the results are analyzed for the impact of different feature modules on the model performance.


## 3.2. Design of Natural Language Processing Methods for Deep Learning

Multimodal learning generally involves combining data from various modalities to obtain information representations in different information sources for comprehensive analysis. After the words are one-hot encoded, since only one bit of the word vector obtained after encoding is 1, the vector distance between words is the same, which cannot reflect the correlation between words. One of the important issues in multimodal learning is multimodal fusion. Multimodal fusion is technically the process of combining data collected from different modalities for analysis to predict data categories.Feature layer fusion is the direct fusion of multiple independent feature vectors into a single feature vector utilizing point-sum or dot-product operations, or even just stitching, and finally, the result is derived by a classifier. The advantage is that it can capture the correlation between multimodal features and is easy to implement, and all features can be seen at once.Compared with feature layer fusion, the decision layer can choose the most suitable feature extractor and classifier for each modality according to different features, but it is difficult to integrate all classifiers effectively, and the correlation between modalities is ignored.The training model is validated using a test set to evaluate the strengths and weaknesses of the model algorithms, as shown in Figure3.Figure 3
Natural language processing flowchart.In probability statistics, the probability of a random event is calculated given that other events have already occurred, and this probability is called conditional probability.(1)Py|x=Px,yPx+Py.In equation (1), Py|x denotes the joint probability distribution of the simultaneous occurrence of event x and random event y. And the conditional probability Py|x is only meaningful when Px > 0; i.e., the formula cannot calculate the conditional probability of an event that will never occur given the event. Suppose, now there are three random variables a, b, and c, which can be obtained by using equation (1) twice.(2)Pa,b,c=PaPb|aPc2|b2,Pb,c=Pc2|b2,Pa,b=PaPb|a.In this way, you can understand the advantages and disadvantages of your own products, and then better improve the quality and service of your products. Ordinary users can learn about other people’s evaluations of movies through the comment area of the movie platform. In the research center of natural language processing, we often need to calculate the joint probability distribution of multiple random variables, and the formula for the joint probability distribution ofn random variables can be generalized according to equations (1) and (2).(3)Px1,x2,…,xn=Pxn|xn−1,…,x1Px1,x2,…,xn−1.In the experimental process, it is often necessary to calculatePBi when PBi|A is known. To determine the relationship between the two, the Bayesian formula can be used to calculate.(4)PBi|A=PBiPA|Bi∑i=1nPBiPA|Bi.The probability density of these three variables is now expressed as a chained form of the probability distribution of the two variables [19].(5)Pa,b,c=PaPb|aPc2|b2.However, when the number of words in the test dataset is too large, using unique thermal coding for word vectorization will bring some problems [20]. The sentence feature representation of the fused image is input into the classifier for text sentiment analysis. To solve these problems mentioned above, the word embedding technique based on dense space comes into being, as shown in Figure 4.Figure 4
Statistical information of the experimental dataset.
(a)(b)(c)(d)The laptop dataset is divided into two: the training set with a larger number of samples is mainly used to train the model, and the test set with a smaller number of samples is used to validate the trained model so that the accuracy can be used to determine the variability of the model. The training set contains 994 positive comment texts, 464 negative comment texts, and 128 neutral comment texts. The test set contains 341 positive texts, 169 negative texts, and 870 neutral texts [21].The second dataset, Restaurant, with data from restaurant reviews, is also divided into two parts, i.e., the training set and test set, where the training set has 3697 samples, containing 2164 positive review texts, 637 negative review texts, and 807 neutral review texts. He can make purchase judgments on this product through the emotions shown by these users. The test set consists of 341 positive texts, 169 negative texts, and 870 neutral texts, as shown in Table1.Table 1
Lexical annotation weighting table.
Part of speechWeightsCC0.81CD0.73DT0.71EX0.75FW0.74IN0.64JJ0.8JJR0.7JJS0.8LS0.87MD0.83WRB0.62WDT0.67VBN0.86


## 4. Analysis of Results

### 4.1. Performance Analysis of Natural Language Processing Algorithms for Deep Learning

Usually, deep learning algorithms need to improve the model to reach the optimal validation accuracy through optimization (model tuning) to obtain the optimal values of the parameters or changing the preprocessing of the selected model data, an iterative process to adjust and evaluate the performance of the training model. This usually requires iterative experiments, thus changing the hyperparameters of the model, or including/excluding specific preprocessing steps. And classify each different emotion, to get the correct meaning of the sentence. Then, the performance of the validation set is evaluated and adjusted according to the accuracy and loss rate of the experiments until the parameters obtain the highest validation performance. After several iterations, the hyperparameters of the experimental setup are shown in Table2.Table 2
Hyperparameter settings.
ParameterValuesEmbedding size150Bi-GRU hidden neurons284Bi-GRU hidden layers6GCN network sizeReLUGCN activation function0.0001Learning rate128OptimizerAdamIn terms of recall and F1 values, both values of our method are above 90%, which indicates that our model has a good and stable performance in the sentiment classification experiments on the dataset. Compared with the other three models, both recall and F1 values are higher, which indicates that the construction method based on the BERT model is more advantageous compared with the traditional word vector method. It shows that the model in this paper is feasible for sentiment classification compared with the traditional methods and neural networks. It means that the similarity of the opinions expressed by the user under the topic is higher, and then the high similarity of the expressed emotion can be mapped, so the similarity between texts is taken as another factor affecting the emotional similarity.In daily life, it is often necessary to get feedback from others to perform more recent activities. In the case of Internet social platforms, such feedback mostly exists in the form of user comments. Grid customer service personnel can collect popular feedback from users on the platform and then obtain users’ satisfaction attitude toward power supply services, to improve the quality of grid services. E-commerce customer service can understand the advantages and shortcomings of their products through the information of users’ popular reviews after using the products, to better improve the quality and services of their products. Ordinary users can learn about others’ comments on movies through the comment section of movie platforms and get others’ preferences on movies from these comments to better select movies suitable for them, etc. It is very easy to spread on major online social platforms, so the harm is very great. All these life scenarios are closely connected with the sentiment recognition of social network texts, and thus, this designed social network hot topic analysis system has practical application value in many scenarios.From the experimental results, the accuracy of the plain Bayesian on the three datasets is 97.1%, 93.47%, and 82.35%, respectively, the accuracy of the method of TFIDF-BP is 84.4%, 91.8%, and 84.35%, and the accuracy of the method in this paper on the three datasets is 92.2%, 95.6%, and 96.1%, respectively. The analysis shows that the accuracy of the proposed method in this chapter is lower than the 97.1% of plain Bayes for long text classification, but it is better than the other two methods in short- and medium-length text classification. It achieves 96.1% accuracy in the classification of short texts, which is significantly better than the other two methods. In addition, the classification accuracy of the classification model in this paper is above 92% for all three datasets of the long, medium, and short length, which illustrates the effectiveness of this model for text classification, as shown in Figure5.Figure 5
Model performance comparison.
(a)(b)(c)(d)In terms of accuracy, recall, and F1 values, all three values of this paper’s method are above 90, indicating that the B-feature with neural network model has good and stable performance in text classification of various lengths. Comparing the other two models, B-feature has higher accuracy than TF-IDF on various lengths of text with the same selection of neural networks, which indicates that the feature construction method of B-feature proposed in this chapter is more advantageous and effective compared with the traditional feature construction methods.


### 4.2. Results of Social Network Sentiment Analysis Applications

Based on the above experimental analysis, a filtering strategy for social comment data based on the sentiment analysis model is designed by assigning a certain percentage of reception to social comments with a different sentiment polarity, and the filtering strategy with the best classification results in the experiment is derived after several experiments. Text classification technology can not only help people manage huge data in an efficient and orderly manner, but also help people to mine the hidden information and laws in the data, and achieve multiplier effect with half the effort. In the Twitter English dataset, the best social comment filtering strategy is for positive social comments, 20% probability of receiving; for neutral social comments, 20% probability of receiving; and for negative social comments, 70% probability of receiving, and the comparison results are shown in Figure6.Figure 6
Feature vector weight of the text.Within a certain range, the classification accuracy of the PRE-TF-IDF algorithm increases with the weight of feature words in the text. However, when the proportion of feature words in the text exceeds a certain value, it makes the algorithm’s classification effectiveness decrease and negatively affects the classification accuracy. Therefore, there is a peak in the proportion of feature words in the text. As the proportion of feature words in the text increases, the time required for the algorithm to classify the text becomes longer. The average value of the peak accuracy rate is 17.57% of the text weighted by the feature words. The first module obtains the sentence feature representation through the semantic attention layer, the second module uses the CNN network for image feature extraction, and the third module uses the multimodal attention layer to fuse image and text features to obtain image features including image features. At this point, the PRE-TF-IDF algorithm can balance classification accuracy and operational efficiency.Unlike the natural language inference task, the repetition recognition task focuses more on whether two sentences express the same semantic meaning. Therefore, this task focuses more on the semantic similarity between two input sentences. Figure7 shows the performance of the model on this dataset. The BiMPM model uses a multiangle matching approach to model the semantic matching relationship between two sentences, demonstrating the effect of the baseline model. One is to rely on knowledge base analysis, the second is to use the network for analysis, and the third is to use corpus for analysis. The DIIN model uses a multichannel attentional computation approach to construct the semantic interaction space between sentences and extracts sufficient feature information hierarchically to finally achieve an accurate semantic. The model achieves the accurate understanding of highly abstract sentence semantics with excellent performance. In contrast, by selecting one most important word at each reading step and repeatedly understanding these important words, the proposed method achieves better performance and surpasses most of the compared methods.Figure 7
Experimental results.In other words, if the word extraction phase fails to recognizeX aspect words, the aspect sentiment classification module does not classify these as X aspect words. Therefore, comparing aspect sentiment classification performance with existing systems is not an ideal solution. Note that these existing systems solve the aspect sentiment classification problem term extraction independently of aspects.


## 4.1. Performance Analysis of Natural Language Processing Algorithms for Deep Learning

Usually, deep learning algorithms need to improve the model to reach the optimal validation accuracy through optimization (model tuning) to obtain the optimal values of the parameters or changing the preprocessing of the selected model data, an iterative process to adjust and evaluate the performance of the training model. This usually requires iterative experiments, thus changing the hyperparameters of the model, or including/excluding specific preprocessing steps. And classify each different emotion, to get the correct meaning of the sentence. Then, the performance of the validation set is evaluated and adjusted according to the accuracy and loss rate of the experiments until the parameters obtain the highest validation performance. After several iterations, the hyperparameters of the experimental setup are shown in Table2.Table 2
Hyperparameter settings.
ParameterValuesEmbedding size150Bi-GRU hidden neurons284Bi-GRU hidden layers6GCN network sizeReLUGCN activation function0.0001Learning rate128OptimizerAdamIn terms of recall and F1 values, both values of our method are above 90%, which indicates that our model has a good and stable performance in the sentiment classification experiments on the dataset. Compared with the other three models, both recall and F1 values are higher, which indicates that the construction method based on the BERT model is more advantageous compared with the traditional word vector method. It shows that the model in this paper is feasible for sentiment classification compared with the traditional methods and neural networks. It means that the similarity of the opinions expressed by the user under the topic is higher, and then the high similarity of the expressed emotion can be mapped, so the similarity between texts is taken as another factor affecting the emotional similarity.In daily life, it is often necessary to get feedback from others to perform more recent activities. In the case of Internet social platforms, such feedback mostly exists in the form of user comments. Grid customer service personnel can collect popular feedback from users on the platform and then obtain users’ satisfaction attitude toward power supply services, to improve the quality of grid services. E-commerce customer service can understand the advantages and shortcomings of their products through the information of users’ popular reviews after using the products, to better improve the quality and services of their products. Ordinary users can learn about others’ comments on movies through the comment section of movie platforms and get others’ preferences on movies from these comments to better select movies suitable for them, etc. It is very easy to spread on major online social platforms, so the harm is very great. All these life scenarios are closely connected with the sentiment recognition of social network texts, and thus, this designed social network hot topic analysis system has practical application value in many scenarios.From the experimental results, the accuracy of the plain Bayesian on the three datasets is 97.1%, 93.47%, and 82.35%, respectively, the accuracy of the method of TFIDF-BP is 84.4%, 91.8%, and 84.35%, and the accuracy of the method in this paper on the three datasets is 92.2%, 95.6%, and 96.1%, respectively. The analysis shows that the accuracy of the proposed method in this chapter is lower than the 97.1% of plain Bayes for long text classification, but it is better than the other two methods in short- and medium-length text classification. It achieves 96.1% accuracy in the classification of short texts, which is significantly better than the other two methods. In addition, the classification accuracy of the classification model in this paper is above 92% for all three datasets of the long, medium, and short length, which illustrates the effectiveness of this model for text classification, as shown in Figure5.Figure 5
Model performance comparison.
(a)(b)(c)(d)In terms of accuracy, recall, and F1 values, all three values of this paper’s method are above 90, indicating that the B-feature with neural network model has good and stable performance in text classification of various lengths. Comparing the other two models, B-feature has higher accuracy than TF-IDF on various lengths of text with the same selection of neural networks, which indicates that the feature construction method of B-feature proposed in this chapter is more advantageous and effective compared with the traditional feature construction methods.


## 4.2. Results of Social Network Sentiment Analysis Applications

Based on the above experimental analysis, a filtering strategy for social comment data based on the sentiment analysis model is designed by assigning a certain percentage of reception to social comments with a different sentiment polarity, and the filtering strategy with the best classification results in the experiment is derived after several experiments. Text classification technology can not only help people manage huge data in an efficient and orderly manner, but also help people to mine the hidden information and laws in the data, and achieve multiplier effect with half the effort. In the Twitter English dataset, the best social comment filtering strategy is for positive social comments, 20% probability of receiving; for neutral social comments, 20% probability of receiving; and for negative social comments, 70% probability of receiving, and the comparison results are shown in Figure6.Figure 6
Feature vector weight of the text.Within a certain range, the classification accuracy of the PRE-TF-IDF algorithm increases with the weight of feature words in the text. However, when the proportion of feature words in the text exceeds a certain value, it makes the algorithm’s classification effectiveness decrease and negatively affects the classification accuracy. Therefore, there is a peak in the proportion of feature words in the text. As the proportion of feature words in the text increases, the time required for the algorithm to classify the text becomes longer. The average value of the peak accuracy rate is 17.57% of the text weighted by the feature words. The first module obtains the sentence feature representation through the semantic attention layer, the second module uses the CNN network for image feature extraction, and the third module uses the multimodal attention layer to fuse image and text features to obtain image features including image features. At this point, the PRE-TF-IDF algorithm can balance classification accuracy and operational efficiency.Unlike the natural language inference task, the repetition recognition task focuses more on whether two sentences express the same semantic meaning. Therefore, this task focuses more on the semantic similarity between two input sentences. Figure7 shows the performance of the model on this dataset. The BiMPM model uses a multiangle matching approach to model the semantic matching relationship between two sentences, demonstrating the effect of the baseline model. One is to rely on knowledge base analysis, the second is to use the network for analysis, and the third is to use corpus for analysis. The DIIN model uses a multichannel attentional computation approach to construct the semantic interaction space between sentences and extracts sufficient feature information hierarchically to finally achieve an accurate semantic. The model achieves the accurate understanding of highly abstract sentence semantics with excellent performance. In contrast, by selecting one most important word at each reading step and repeatedly understanding these important words, the proposed method achieves better performance and surpasses most of the compared methods.Figure 7
Experimental results.In other words, if the word extraction phase fails to recognizeX aspect words, the aspect sentiment classification module does not classify these as X aspect words. Therefore, comparing aspect sentiment classification performance with existing systems is not an ideal solution. Note that these existing systems solve the aspect sentiment classification problem term extraction independently of aspects.


## 5. Conclusion

The current state of research on natural language processing techniques has been analyzed, and the knowledge of natural language processing techniques has been introduced, mainly including the process framework of natural language processing, statistical models, word vector techniques, and commonly used classifier models. The limitations of the traditional TF-IDF algorithm in feature word selection and text classification are analyzed. Generally, in the process of recognizing text sentiment, the created sentiment database will contain some sentiment symbols, abbreviations, sentiment words, modifiers, and so on. An optimization algorithm based on weight preprocessing, PRE-TF-IDF, is proposed, which adds a key information weight processing link in the preprocessing stage to solve the problem that the traditional TF-IDF algorithm cannot perform weight values based on the location information where the words are located. In addition, the word density weight processing link is added to assign more effective weights to feature words using two indicators: in-category word density and out-of-category word density. The performance of the PRE-TF-IDF algorithm was evaluated through controlled experiments. The comment data with different sentiment polarities were filtered by a sentiment analysis model, and the experimental results showed that text data with negative sentiment were more discriminative in the online rumor detection task compared with text data with the positive and neutral sentiment. By proposing a new sentence vector feature representation instead of the word vector feature representation, multiple sets of comparison experiments show that the newly proposed method can improve the performance of the model to a certain extent [18].



---

*Source: 1390672-2022-07-19.xml*