NLP-based tourist bullet screen emotion analysis and content generation method
Through the BERT-based deep word segmentation and multi-head attention mechanism, combined with the sliding time window and Morlet wavelet transform, the problem of the lack of emoticons and temporal features in traditional barrage sentiment analysis is solved, and accurate analysis and reliable response to the emotions of travel live barrage are achieved, thereby improving the accuracy and real-time performance of sentiment analysis.
Patent Information
- Application Number
- CN202510841416.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-23
- Publication Date
- 2025-09-19
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the travel live broadcast scenario, the traditional barrage sentiment analysis method fails to effectively capture the emotional intensity information of emoticons, repeated characters and punctuation marks, ignores the temporal dynamic characteristics of barrage data, resulting in large deviations in the quantification of emotional intensity, and has bottlenecks in multimodal information fusion and decision reliability, which cannot meet the needs of real-time interaction.
Through BERT-based deep word segmentation, the features of word sequences, emoticons, and punctuation marks are extracted. The sliding time window and Morlet wavelet transform are combined to generate a fused feature vector. The generalized additive mixture model and multi-head attention mechanism are used to output the sentiment probability, and the Beta distribution calibration mechanism is introduced to process boundary samples.
It achieves accurate analysis and reliable response to the emotions of travel live broadcast barrage, reduces the quantification deviation of emotion intensity, improves the decision-making reliability of emotion analysis, and can dynamically capture the deep correlation of multi-dimensional features to meet real-time interaction needs.
Smart Images

Figure CN120671663A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of barrage sentiment analysis, and in particular to a method for analyzing visitor barrage sentiment and generating content based on NLP. Background Art
[0002] With the vigorous development of short video and live broadcast technology, the interactive data of tourists in tourism scenes has exploded, becoming the core carrier for capturing user experience and emotional tendencies in real time. Accurately analyzing the emotions of barrage is of key significance to optimizing tourism service design and improving the quality of live broadcast interaction. The current mainstream barrage sentiment analysis methods mainly rely on natural language processing technology, such as extracting vocabulary-level sentiment features by constructing text semantic models. However, this type of traditional solution has exposed significant limitations in complex sentiment analysis scenarios: it only focuses on one-way analysis of text semantics, lacks effective analysis of the emotional intensity information carried by paralinguistic symbols such as emoticons, repeated characters, and punctuation marks, and ignores the natural temporal dynamic characteristics of barrage data, such as the sudden change of emotional tendencies in dense barrages when the live broadcast screen switches, resulting in excessive deviation in the quantitative analysis of emotional intensity in strong emotional scenes, which is difficult to meet the refined needs of real-time interaction in tourism live broadcasts.
[0003] Existing technologies not only lack feature dimensions, but also face bottlenecks in multimodal information fusion and decision reliability. On the one hand, traditional methods separate semantic text, paralinguistic symbols and time series information, or adopt a shallow fusion method of simple splicing, which cannot capture the deep connection between "lexical semantics-symbol reinforcement-time series fluctuations". On the other hand, existing models directly output sentiment classification probabilities and do not perform probability calibration for the large number of boundary samples in the barrage data. This makes it easy to make misjudgments when triggering operational strategies, especially in the real-time monitoring scenario of scenic spot public opinion. The decision delay caused by insufficient probability confidence often exceeds 500ms, which cannot meet the requirements of immediate response to risk events. How to build a deep fusion analysis system covering multi-dimensional features and realize full-link optimization from accurate extraction of sentiment features to reliable judgment output has become a core problem that needs to be urgently solved in the current field of barrage sentiment analysis technology. Summary of the Invention
[0004] In response to the shortcomings of the existing technology, the present invention proposes a method for analyzing the sentiment and generating content of tourist barrages based on NLP, which solves the problem that the method only focuses on the single-dimensional barrage sentiment analysis, lacks effective analysis of the emotional intensity information carried by paralinguistic symbols such as emoticons, repeated characters, and punctuation marks, ignores the temporal dynamic characteristics naturally possessed by barrage data, and fails to perform probability calibration for the large number of boundary samples in the barrage data.
[0005] To achieve the above objectives, the present invention is implemented through the following technical solutions: Obtain the original barrage text, perform deep word segmentation based on BERT on the original barrage text, and extract word sequences, emoticons, punctuation sequences, and repeated character strings; The sum of the sentiment polarity values of the word sequence is calculated based on the predefined sentiment dictionary, and a text embedding vector is generated through the self-attention mechanism. The sum of the sentiment polarity values and the embedding vector are concatenated into a vocabulary feature vector. Predefine the emotional intensity value of emoticons, calculate the information entropy of punctuation string sequences, quantify the energy value of repeated strings, and splice the three into a paralinguistic feature vector; Set a sliding time window, calculate the density of bullet comments within the sliding time window, extract the frequency domain feature vector of the density through Morlet wavelet transform, and generate the time feature vector by combining the emotional intensity value of the emoticon; The lexical feature vector, paralinguistic feature vector, and time feature vector are concatenated to generate a fused feature vector, and the output emotion probability is identified and a classification label is added based on the trained generalized additive mixture model.
[0006] Furthermore, the original barrage text is the barrage interactive text in the travel live broadcast scene, including text, emoticons and punctuation marks and records the timestamp of the original barrage text.
[0007] Furthermore, the original barrage text is segmented based on the pre-trained Chinese BERT word segmenter, word sequences and repeated character strings are extracted from the text of the original barrage text, Unicode emoticon encoding is recognized, emoticons are extracted and converted into internal identifiers, continuous punctuation marks are extracted and recorded as a punctuation string sequence P with a length, continuous repeated characters are detected, repeated character strings are extracted, and the number of repetitions is recorded.
[0008] Furthermore, the specific method of calculating the sum of the sentiment polarity values of the word sequence based on the predefined sentiment dictionary is as follows: the sum of the sentiment polarity values of the word sequence is obtained by accumulating the polarity scores of each word in the word sequence corresponding to the predefined sentiment dictionary; Generate text embedding vectors through self-attention mechanism including input word sequence , use Word2Vec to transform each word Mapping to word vectors ; Use the sine-cosine function to generate the position encoding vector, and add the word vector to the position encoding vector to get the word embedding vector. The specific calculation formula is: In the formula is the word embedding vector, is the position encoding vector, Indicates the position index of the current word in the word sequence is ; By embedding words into vectors Input multi-head self-attention to calculate the relationship between words, and finally obtain the text embedding vector after residual connection and layer normalization. ; Convert the sum of the word sentiment polarity values into a 1-dimensional vector and concatenate it with the embedding vector to obtain the word feature vector .
[0009] Furthermore, the sum of the emotional intensity values of the emoticons is obtained by summing up the emotional intensity values of the predefined common emoticons corresponding to the emoticons in the original barrage text. ; Based on the punctuation string sequence P, the information entropy of the punctuation string sequence is calculated. The specific calculation formula is: In the formula is the information entropy of the punctuation string sequence P, is the punctuation mark in the punctuation string sequence P, is the first The frequency of occurrence of punctuation marks; The energy value of the repeated string is quantified according to the number of repetitions of the repeated characters. The energy value of the repeated string is obtained by squaring the difference between the number of repetitions of the repeated character and 2. ; Sum the emotional intensity values of the emojis , information entropy of punctuation string sequence and the energy value of the repeated string Perform feature concatenation to obtain the paralinguistic feature vector .
[0010] Furthermore, the density of the bullet comments is obtained by setting a sliding time window, calculating the density of the bullet comments within the sliding time window, and extracting the frequency domain feature vector of the density through Morlet wavelet transform. , based on the positive and negative directions of the sum of the emotional intensity values of the emoticons, multiply the corresponding frequency domain feature vector to obtain the optimized frequency domain feature vector. The specific calculation formula is as follows: In the formula is the optimized frequency domain eigenvector, is the positive and negative direction of the sum of the emotional intensity values of the emoticons; The density of the bullet comments in the sliding time window is compared with the optimized frequency domain feature vector Splicing to obtain the time feature vector .
[0011] Furthermore, the vocabulary feature vector , paralinguistic feature vector , time feature vector Through the trainable matrix , , Projected to 64-dimensional Query / Key / Value space: ; The interaction weights between channels are calculated based on the multi-head attention mechanism. The specific calculation formula is as follows: In the formula The output vector representing the interaction weights between channels in the multi-head attention mechanism, i.e., the correlation strength of different feature dimensions, is the activation function, is the transpose multiplication of the Query matrix and the Key matrix, Indicates the dimension of the Key vector in each header; The output vector of the channel interaction weights in the multi-head attention mechanism is concatenated and projected through the fully connected layer to obtain the fused feature vector .
[0012] Furthermore, based on the generalized additive mixture model, the sentiment probability is output. The specific steps are as follows: Obtain historical boundary samples, which are historically labeled barrage data training sets. The training set includes the original barrage text and its corresponding emotional probability. Input the historical boundary samples into the generalized additive mixture model for training. The Beta distribution parameters are fitted by the generalized additive mixture model. , based on the cubic spline basis function fitting fusion feature vector, output the emotion probability; Set the classification label determination threshold and add classification labels based on sentiment probability.
[0013] Compared with the existing technology, it has the following beneficial effects: This proposal proposes an NLP-based tourist barrage sentiment analysis and content generation method. By constructing a multi-dimensional feature fusion system and a probability calibration mechanism, it achieves accurate analysis and reliable response to the emotions of travel live broadcast barrages, effectively making up for the shortcomings of traditional methods in paralinguistic symbol analysis, temporal feature utilization and boundary sample processing. Through in-depth analysis of word sequences, emoticons, punctuation string sequences, repeated string word sequences and temporal fluctuations, it can capture the synergistic reinforcement effect of emotional symbols and the immediate emotional outburst corresponding to the high-frequency fluctuations of barrage density. Compared with traditional single text analysis methods, it improves the accuracy of emotional probability calculation, especially reduces the intensity quantification deviation in complex emotional scenarios. In addition, this solution innovatively introduces a Beta distribution calibration mechanism, trains on historical boundary samples, maps fuzzy sentiment judgments to clear classification thresholds, reduces the misjudgment rate of boundary samples, and significantly improves the decision reliability of sentiment analysis results. Combined with the channel interaction modeling achieved by the multi-head attention mechanism, it can dynamically capture the deep associations of "lexical semantics - paralinguistic reinforcement - temporal fluctuations", providing accurate sentiment basis for real-time interaction in the tourism live broadcast scenario, effectively solving the problem of the traditional method's fragmented processing of multi-modal information, and promoting the technical upgrade of bullet screen sentiment analysis from single-text semantic parsing to multi-dimensional fusion decision-making. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 It is a schematic flowchart of the method of the present invention; DETAILED DESCRIPTION OF THE EMBODIMENTS
[0015] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.
[0016] Please refer to Figure 1 , this application provides a method for tourist bullet screen sentiment analysis and content generation based on NLP; [[ID=十七]] As the first embodiment of this application, the method specifically includes the following steps: Step 1: Taking the real-time bullet screen stream in the tourism live broadcast scenario as an example, obtain the original bullet screen text. For example, a certain original bullet screen text is "This waterfall is so spectacular!! [Like], thumbs up, thumbs up, thumbs up", which contains text, emojis, and punctuation marks. Among them, [Like] is the text expression symbol of the emoji in the live broadcast platform's bullet screen. Record the timestamp of this bullet screen, such as "2023-05-17_15:30:25".
[0017] Step 2: Segment the original bullet screen text based on the pre-trained Chinese BERT tokenizer to extract the word sequence: ["This", "waterfall", "is", "so", "spectacular"]; identify the Unicode emoji encoding, extract the emoji "[Like]", and convert it to the internal identifier E_1, corresponding to the strongly positive emoji of the like category; extract the consecutive punctuation marks "!!", and record them as a punctuation string sequence P of length two = ["!", "!"]; detect consecutive repeated characters (≥2), extract the repeated string "thumbs up, thumbs up, thumbs up", record the repeated character as "thumbs up", and the number of repetitions is three; [[ID=二十四]] Step 3: Calculate the sum of the sentiment polarity values of the word sequence based on a predefined sentiment dictionary. For example, based on the extended version of the HowNet Sentiment Dictionary, each word is labeled with a polarity score ranging from -5 to +5. For instance, "spectacular" = +4, "this" = 0, "waterfall" = 0, "le" = 0 (neutral words have no polarity), "too" = +1 (intensifying adverb). It should be noted that the score of the intensifying adverb is dynamically adjusted according to the polarity direction of the modified word. For example, when modifying a negative word, "too" = -1. By summing the polarity scores of each word in the word sequence, the total lexical sentiment polarity value is obtained; Generate a text embedding vector through the self-attention mechanism. Specifically, input the word sequence , and use Word2Vec to map each word to a word vector ; Use the sine and cosine functions to generate a position encoding vector, and add the word vector and the position encoding vector to obtain a word embedding vector. The specific calculation formula is: In the formula is the word embedding vector, is the position encoding vector, represents that the position index of the current word in the word sequence is ; Calculate the inter-word correlation by inputting the word embedding vector into the multi-head self-attention. Taking 8 heads as an example, after residual connection and layer normalization, a 128-dimensional text embedding vector is finally obtained ; Convert the sum of the lexical sentiment polarity values into a 1D vector, and splice it with the 128-dimensional embedding vector to obtain a 129-dimensional lexical feature vector .
[0018] Step 4: Predefine the sentiment intensity values of common emoticons. For example, in this case, the predefined sentiment intensity value of "[like]" is , and the total sentiment intensity value in this case is ; [[ID=:39]]Based on the punctuation string sequence P, calculate the information entropy of the punctuation string sequence. The specific calculation formula is: In the formula is the information entropy of the punctuation string sequence P, is the punctuation symbol in the punctuation string sequence P, is the frequency of the th punctuation symbol in the punctuation string sequence P. In this case, the punctuation string sequence P is 2 "!", and the frequency is 100%. Therefore , indicating that the single punctuation entropy value is the lowest, representing strong emotional consistency; Quantize the energy value of a repeated string according to the repetition count of repeated characters. The specific calculation formula is as follows: In the formula is the energy value of the repeated string, is the repetition count of the th repeated character. In this example, the repetition count of the repeated string "赞赞赞" is 3, so ; Sum up the emotional intensity values of emoji , the information entropy of the punctuation string sequence and the energy value of the repeated string to perform feature splicing to obtain the paralinguistic feature vector . In this example, the paralinguistic feature vector .
[0019] Step 5: Set a sliding time window and calculate the bullet screen density within the sliding time window. In this example, the timestamp of the original bullet screen text is "2023-05-17_ 15:30:25". If the sliding time window is set to a size of 5 seconds, the window range is 15:30:20~15:30:25. Assuming there are 8 bullet screens within this time window, the bullet screen density within the sliding time window is 1.6 bullet screens / second; Extract the frequency domain feature vector of the density through Morlet wavelet transform. In this example, perform frequency domain analysis on the bullet screen density sequence of the past 300 seconds with the timestamp "2023-05-17_15:30:25", decompose it into N frequency subbands using Morlet wavelet transform, calculate the wavelet coefficients of each frequency subband, extract the high-frequency subband, and perform energy normalization on the wavelet coefficients of the high-frequency subband to obtain the frequency domain feature vector ; Multiply the positive or negative direction of the sum of the emotional intensity values of emoji by the corresponding frequency domain feature vector to obtain the optimized frequency domain feature vector. The specific calculation formula is as follows: In the formula is the optimized frequency domain feature vector, is the positive or negative direction of the sum of the emotional intensity values of emoji. Specifically, extracting the frequency domain feature vector of the density through Morlet wavelet transform can discover the fluctuation frequency and pattern of the bullet screen density, but it cannot be directly associated with emotions. Combining the positive or negative direction of the sum of the emotional intensity values of emoji with the frequency domain feature vector endows the frequency domain feature with emotional semantics. For example, if a certain high-frequency fluctuation is detected in the frequency domain feature, without combining the emotional intensity, it is impossible to determine whether this fluctuation is a lively discussion of positive emotions or a concentrated outburst of negative emotions, while by combining the positive or negative direction of the sum of the emotional intensity values of emoji, the emotional nature of the fluctuation can be clarified; The density of the bullet comments in the sliding time window is compared with the optimized frequency domain feature vector Splicing to obtain the time feature vector .
[0020] Step 6: Transform vocabulary feature vectors , paralinguistic feature vector , time feature vector Through the trainable matrix , , Projected to 64-dimensional Query / Key / Value space: ; The interaction weights between channels are calculated based on the multi-head attention mechanism. The specific calculation formula is as follows: In the formula Represents the output result of the interaction weights between channels in the multi-head attention mechanism, is the activation function, is the transpose multiplication of the Query matrix and the Key matrix, Indicates the dimension of the Key vector in each header; The output result of splicing the interaction weights between channels in the multi-head attention mechanism, taking 4 heads as an example, the output result is Dimension, projected to 32 dimensions through the fully connected layer to obtain the fused feature vector .
[0021] Step 7: Based on the generalized additive mixture model, use the cubic spline basis function to calculate the fusion feature vector and output the sentiment probability, which includes: Obtain historical boundary samples, which are historically labeled barrage data training sets. The training set includes the original barrage text and its corresponding emotional probability. Input the historical boundary samples into the generalized additive mixture model for training. The Beta distribution parameters are fitted by the generalized additive mixture model. , based on the cubic spline basis function fitting fusion feature vector, output the emotion probability, the specific calculation formula is as follows: Where, is the activation function, To use cubic spline basis function to fuse feature vectors The function to be fitted, is the emotion probability, After obtaining historical boundary samples, use these sample data to calculate the parameters of the Beta distribution The parameter values obtained by fitting are =2, =1, the calculated probability of positive emotion 82%; Set the classification label judgment threshold and positive emotion probability 0.6, negative sentiment probability 0.4, neutral sentiment probability 0.4-0.6, output classification label based on sentiment probability, in this case classification label , for positive emotions; As a second embodiment of the present application, the method specifically includes the following steps: This embodiment is implemented on the basis of the first embodiment. The difference from the first embodiment is that after obtaining the original barrage text, invalid original barrage text is filtered out through scene-related vocabulary detection, specifically: Build an "operational command keyword library" (such as "send," "participate," "draw," "follow," and "receive red envelopes"). Use named entity recognition technology to extract scenic spot-related entity words from the original barrage text (for example, when live-streaming Huangguoshu Waterfall, detect words like "waterfall," "water curtain cave," and "spectacular"). Use a text matching algorithm to identify the original barrage text. If the original barrage text contains both emotional words and command keywords, it is considered invalid and filtered out. Calculate the ratio of scenic spot words and emotional words in the total vocabulary of the original barrage text, preset a ratio threshold, and when the ratio ≥ the preset ratio threshold or when emotional words (such as "shocking" and "beautiful") form semantic co-occurrence with scenic spot words (such as "waterfall + shock"), it is determined to be a real emotional barrage and retained. If the ratio is ≤ the preset ratio threshold, it is determined to be invalid original barrage text and filtered; After setting the sliding time window, invalid original bullet comment text is filtered out through unnatural repetition interval detection, specifically: Set a sliding time window of preset length, split the bullet comment stream with preset step size, and perform the following operations within each window: Obtain all the original barrage texts that have been retained in the window, calculate the similarity between any two original barrage texts using a semantic similarity algorithm, and determine the original barrage texts with a similarity ≥ a preset threshold as duplicate barrage texts; Count the time interval distribution of repeated bullet comments within the window, and calculate the proportion R1 of bullet comments with an interval ≤ a first preset time threshold and the proportion R2 of bullet comments with an interval ≥ a second preset time threshold; When R1≥the first preset ratio and R2≤the second preset ratio, it is determined to be an unnatural repetitive screen-swiping bullet comment and filtered, and then the bullet comment density within the sliding time window is calculated.
[0022] As the third embodiment of the present application, the method specifically includes the following steps: This embodiment is implemented on the basis of the first embodiment. The difference from the first embodiment is that after obtaining the original barrage text, the unique identifier UID of the account that sent the original barrage text is further obtained, the total number of barrage posts retained by each UID is counted, and based on the classification labels, the proportion of barrages with positive emotions and the proportion of barrages with negative emotions are counted; When the proportion of positive or negative emotions in the barrage is greater than or equal to the preset emotion threshold, the barrage emotion of the UID is marked as highly consistent; Based on the set sliding time window, the average sending interval of the barrage is calculated for the UIDs marked as highly consistent in emotion within the window. When the average sending interval is ≥ the preset frequency threshold, the barrage sending frequency of the UID is marked as high-frequency posting; UIDs that have been marked as highly consistent with emotions and frequently posted are marked as suspicious UIDs and are graded and processed as follows: When the UID is first marked as a suspicious UID, it is determined to be a level one warning, and the sentiment weight of the original barrage text of the UID is reduced, for example, the sentiment polarity value of the original barrage text of the UID that has been retained is multiplied by 0.2; When the UID is marked as suspicious in two consecutive windows, it is judged as a level 2 warning and the reception of new comments from the UID is suspended, and only historical data is retained; When the UID is marked as suspicious in three consecutive windows, it is judged as a level 3 warning, the historical data of the UID is cleared, and the original barrage text of the UID is no longer obtained.
[0023] The above contents are merely examples and explanations of the present invention. Those skilled in the art may make various modifications or additions to the described specific embodiments or replace them in similar ways. As long as they do not deviate from the invention or exceed the scope defined by the claims, they should all fall within the scope of protection of the present invention.
Claims
1. A method for analyzing visitor comments' sentiment and generating content based on NLP, characterized by: include: Obtain the original barrage text, perform deep word segmentation based on BERT on the original barrage text, and extract word sequences, emoticons, punctuation sequences, and repeated character strings; The sum of the sentiment polarity values of the word sequence is calculated based on the predefined sentiment dictionary, and a text embedding vector is generated through the self-attention mechanism. The sum of the sentiment polarity values and the embedding vector are concatenated into a vocabulary feature vector. Predefine the emotional intensity value of emoticons, calculate the information entropy of punctuation string sequences, quantify the energy value of repeated strings, and splice the three into a paralinguistic feature vector; Set a sliding time window, calculate the density of bullet comments within the sliding time window, extract the frequency domain feature vector of the density through Morlet wavelet transform, and generate the time feature vector by combining the emotional intensity value of the emoticon; The lexical feature vector, paralinguistic feature vector, and time feature vector are concatenated to generate a fused feature vector, and the output emotion probability is identified and a classification label is added based on the trained generalized additive mixture model.
2. The NLP-based visitor comment sentiment analysis and content generation method according to claim 1 is characterized in that: The original barrage text is the barrage interactive text in the travel live broadcast scene, including text, emoticons and punctuation marks, and records the timestamp of the original barrage text.
3. The method for analyzing tourist comments' sentiment and generating content based on NLP according to claim 2 is characterized in that: The original barrage text is segmented based on the pre-trained Chinese BERT word segmenter, word sequences and repeated strings are extracted from the text of the original barrage text, Unicode emoticon encoding is recognized, emoticons are extracted and converted into internal identifiers, continuous punctuation marks are extracted and recorded as a punctuation string sequence with a length P, continuous repeated characters are detected, repeated strings are extracted, and the number of repetitions is recorded.
4. The NLP-based visitor comment sentiment analysis and content generation method according to claim 3 is characterized in that: The specific method of calculating the sum of the sentiment polarity values of the word sequence based on the predefined sentiment dictionary is as follows: the sum of the sentiment polarity values of the word sequence is obtained by accumulating the polarity scores of each word in the word sequence in the predefined sentiment dictionary; Generate text embedding vectors through self-attention mechanism including input word sequence , use Word2Vec to transform each word Mapping to word vectors ; Use the sine-cosine function to generate the position encoding vector, and add the word vector to the position encoding vector to get the word embedding vector. The specific calculation formula is: In the formula is the word embedding vector, is the position encoding vector, Indicates the position index of the current word in the word sequence is ; By embedding words into vectors Input multi-head self-attention to calculate the relationship between words, and finally obtain the text embedding vector after residual connection and layer normalization. ; Sum the sentiment polarity values of the words Convert to a 1-dimensional vector and concatenate it with the embedding vector to get the vocabulary feature vector .
5. The method for analyzing tourist comments' sentiment and generating content based on NLP according to claim 4 is characterized in that: The sum of the emotional intensity values of the emoticons is obtained by adding the emotional intensity values of the predefined common emoticons corresponding to the emoticons in the original barrage text. ; Based on the punctuation string sequence P, the information entropy of the punctuation string sequence is calculated. The specific calculation formula is: In the formula is the information entropy of the punctuation string sequence P, is the punctuation mark in the punctuation string sequence P, is the first The frequency of occurrence of punctuation marks; The energy value of the repeated string is quantified according to the number of repetitions of the repeated characters. The energy value of the repeated string is obtained by squaring the difference between the number of repetitions of the repeated character and 2. ; Sum the emotional intensity values of the emojis , information entropy of punctuation string sequence and the energy value of the repeated string Perform feature concatenation to obtain the paralinguistic feature vector .
6. The method for analyzing tourist comments' sentiment and generating content based on NLP according to claim 5 is characterized in that: The density of the bullet comments is obtained by setting a sliding time window, calculating the density of the bullet comments within the sliding time window, and extracting the frequency domain feature vector of the density through Morlet wavelet transform. , based on the positive and negative directions of the sum of the emotional intensity values of the emoticons, multiply the corresponding frequency domain feature vector to obtain the optimized frequency domain feature vector. The specific calculation formula is as follows: In the formula is the optimized frequency domain eigenvector, is the positive and negative direction of the sum of the emotional intensity values of the emoticons; The density of the bullet comments in the sliding time window is compared with the optimized frequency domain feature vector Splicing to obtain the time feature vector .
7. The method for analyzing tourist comments' sentiment and generating content based on NLP according to claim 6 is characterized in that: The vocabulary feature vector , paralinguistic feature vector , time feature vector Through the trainable matrix , , Projected to 64-dimensional Query / Key / Value space: ; The interaction weights between channels are calculated based on the multi-head attention mechanism. The specific calculation formula is as follows: In the formula represents the output vector of the interaction weights between channels in the multi-head attention mechanism, is the activation function, is the transpose multiplication of the Query matrix and the Key matrix, Indicates the dimension of the Key vector in each header; The output vector of the channel interaction weights in the multi-head attention mechanism is concatenated and projected through the fully connected layer to obtain the fused feature vector .
8. The method for analyzing tourist comments' sentiment and generating content based on NLP according to claim 7 is characterized in that: Based on the generalized additive mixture model, the sentiment probability is output. The specific steps are as follows: Obtain historical boundary samples, which are historically labeled barrage data training sets. The training set includes the original barrage text and its corresponding emotional probability. Input the historical boundary samples into the generalized additive mixture model for training. The Beta distribution parameters are fitted by the generalized additive mixture model. , based on the cubic spline basis function fitting fusion feature vector, output the emotion probability; Set the classification label determination threshold and add classification labels based on sentiment probability.