A regional data monitoring method and system
By constructing a semantic information extraction model and a sentiment regression model, and combining a sentiment dictionary and a trend expression dictionary, the problem of low accuracy in financial public opinion analysis was solved, and more accurate public opinion data monitoring was achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANDONG SHANKE DIGITAL ECONOMY RES INST CO LTD
- Filing Date
- 2022-12-31
- Publication Date
- 2026-05-15
AI Technical Summary
The accuracy of existing financial sentiment analysis technologies is low, especially due to the complexity of sentiment dictionaries and the large parameter scale of machine learning models, which leads to model overfitting and feature redundancy, making it difficult to fully extract the semantic information of financial texts.
By constructing a semantic information extraction model, the scores of sentiment segmentation and trend expression words are determined based on sentiment lexicon and trend expression lexicon. The sentiment regression model is used to enhance the semantic vector analysis of financial texts, and regression analysis is performed by combining sentiment and trend information to improve the accuracy of semantic information extraction.
It improves the accuracy of sentiment analysis in financial texts, enables more accurate monitoring of public opinion data, supplements missing contextual information, and enhances the precision of public opinion analysis.
Smart Images

Figure CN115965030B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of electrical data processing technology, and in particular to a regional data monitoring method and system. Background Technology
[0002] The generation, expansion, and dissemination of public opinion related to the financial industry have a significant impact on investors, financial institutions, the financial industry, and even the macroeconomic operation. Therefore, effective monitoring and analysis of financial public opinion can reduce and avoid the outbreak of financial public opinion crises, and has important reference value in assisting the public or financial institutions in investment and the government in grasping the public opinion trend of the stock market.
[0003] Traditional financial sentiment analysis methods primarily rely on sentiment dictionaries and machine learning. Sentiment dictionaries analyze the corresponding sentiment polarity by counting positive and negative sentiment words in financial texts. Machine learning methods include support vector machines, Naive Bayes, logistic regression, and deep learning-based text classification models. However, for sentiment dictionary-based sentiment analysis, the complexity of language means that many words have different, even vastly different, meanings in different contexts, and the emotions they express also vary significantly with context. Therefore, sentiment analysis methods based solely on dictionaries struggle to achieve high accuracy in semantic understanding and reasoning. Similarly, machine learning methods also struggle to fully extract the semantic information of financial texts. In particular, the linear operations of convolutional neural networks cannot adequately learn discontinuous phrase structures in texts, such as expressions of emotional shifts in the middle of texts, which significantly influence the overall sentiment. Furthermore, due to the limited availability of labeled financial sentiment text datasets, current models have relatively large parameter sizes, easily leading to overfitting and feature redundancy, thus reducing the accuracy of sentiment analysis. Summary of the Invention
[0004] This invention provides a regional data monitoring method and system to address the shortcomings of low accuracy in financial public opinion analysis in existing technologies.
[0005] This invention provides a regional data monitoring method, comprising:
[0006] Retrieve multiple financial texts from the target region;
[0007] Based on the semantic information extraction model, semantic extraction is performed on the financial text to obtain the initial semantic vector of each word in the financial text;
[0008] The emotional segmentation words and their emotional scores in the financial text are determined based on an emotional lexicon, and the trend expression words and their trend scores in the financial text are determined based on a trend expression lexicon; wherein, the emotional segmentation words represent elements that bring positive or negative emotions, and the trend expression words represent the positive or negative trends of element changes;
[0009] The initial semantic vectors of the corresponding emotion segments are enhanced based on the emotion scores of each emotion segment, and the initial semantic vectors of the corresponding trend expression words are enhanced based on the trend scores of each trend expression word, resulting in enhanced semantic vectors for the emotion segments and trend expression words, respectively.
[0010] Based on the sentiment regression model, regression analysis is performed on the enhanced semantic vectors of sentiment segmentation words and trend expression words in the financial text, as well as the initial semantic vectors of the remaining segmentation words, to obtain the sentiment score of the financial text.
[0011] Based on the sentiment scores of the multiple financial texts, statistical analysis of financial public opinion data for the target region is conducted.
[0012] According to a regional data monitoring method provided by the present invention, the trend expression dictionary is constructed based on the following steps:
[0013] Based on the emotion dictionary, the positive emotion segmentation and negative emotion segmentation of each sample sentence in the general emotion corpus are determined;
[0014] Based on the number of positive and negative emotion segment words in any sample sentence, and the emotion tag of the sample sentence, the expression direction of the sample sentence is determined.
[0015] Specifically, if the number of positive emotion segment words in any sample sentence is greater than the number of negative emotion segment words and the emotion label is positive, or if the number of positive emotion segment words in any sample sentence is less than the number of negative emotion segment words and the emotion label is negative, then the expression direction of any sample sentence is positive; if the number of positive emotion segment words in any sample sentence is greater than the number of negative emotion segment words and the emotion label is negative, or if the number of positive emotion segment words in any sample sentence is less than the number of negative emotion segment words and the emotion label is positive, then the expression direction of any sample sentence is negative.
[0016] Based on the probability of each word segment appearing in each sample sentence with a positive expression direction in the general emotion corpus, and the probability of each word segment appearing in each sample sentence with a negative expression direction, positive trend expression words and negative trend expression words are determined.
[0017] The trend expression dictionary is constructed based on the positive trend expression words and the negative trend expression words.
[0018] According to a regional data monitoring method provided by the present invention, the step of determining positive trend expression words and negative trend expression words based on the probability of each word appearing in each sample sentence with a positive expression direction and the probability of each word appearing in each sample sentence with a negative expression direction specifically includes:
[0019] Based on the probability of any word appearing in each sample sentence with a positive expression direction in the general emotion corpus, and the probability of any word appearing in all sample sentences in the general emotion corpus, the positive score of any word is determined.
[0020] Based on the probability of any word appearing in each sample sentence with the opposite expression direction in the general emotion corpus, and the probability of any word appearing in all sample sentences in the general emotion corpus, the reverse score of any word is determined.
[0021] If the positive score of any word segment is greater than the negative score, then the word segment is determined to be a positive trend expression word, and the positive score of the word segment is determined to be the trend score of the word segment.
[0022] If the positive score of any word segment is less than the negative score, then the word segment is determined to be a word expressing a negative trend, and the negative number of the absolute value of the negative score of the word segment is determined to be the trend score of the word segment.
[0023] According to a regional data monitoring method provided by the present invention, the step of performing regression analysis on the enhanced semantic vectors of sentiment segmentation words and trend expression words in the financial text, as well as the initial semantic vectors of the remaining segmentation words, to obtain the sentiment score of the financial text specifically includes:
[0024] Based on the positions of each sentiment segment, trend expression word, and remaining segment in the financial text, positional encoding is performed on the enhanced semantic vectors of the corresponding sentiment segment and trend expression words, as well as the initial semantic vectors of the remaining segments, to obtain the positional feature vector of each segment in the financial text.
[0025] The positional feature vectors of each word in the financial text are fused to obtain the first text vector of the financial text.
[0026] The initial semantic vector of each word in the financial text is averaged and pooled to obtain the second text vector of the financial text.
[0027] The first and second text vectors of the financial text are concatenated to obtain a concatenated text vector. Then, regression analysis is performed on the concatenated text vector to obtain the sentiment score of the financial text.
[0028] According to a regional data monitoring method provided by the present invention, the step of fusing the positional feature vectors of each word in the financial text to obtain a first text vector of the financial text specifically includes:
[0029] The positional feature vectors of each word in the financial text are concatenated to obtain the word concatenation vector;
[0030] The first text vector of the financial text is obtained by continuously encoding the word segmentation and concatenation vector using a multi-layer encoder.
[0031] According to a regional data monitoring method provided by the present invention, the enhanced semantic vectors of sentiment segmentation words and trend expression words in the financial text, as well as the initial semantic vectors of the remaining segmentation words, are regressed based on a sentiment regression model to obtain a sentiment score for the financial text. The method further includes:
[0032] The sentiment segments and trend expression words in the financial text are combined to obtain positive word groups and / or negative word groups; wherein, the positive word group is composed of positive sentiment segments and positive trend expression words or negative sentiment segments and reverse trend expression words; the negative word group is composed of positive sentiment segments and reverse trend expression words or negative sentiment segments and positive trend expression words.
[0033] The sentiment score of the financial text is fine-tuned based on the number of positive and / or negative words in the text.
[0034] According to a regional data monitoring method provided by the present invention, the step of fine-tuning the sentiment score of the financial text based on the number of positive and / or negative word groups in the financial text specifically includes:
[0035] If the number of positive words in the financial text is greater than the number of negative words, then a preset value is added to the sentiment score of the financial text.
[0036] If the number of positive words in the financial text is less than the number of negative words, then a preset value is subtracted from the sentiment score of the financial text.
[0037] According to a regional data monitoring method provided by the present invention, the semantic information extraction model and the sentiment regression model are trained based on the following steps:
[0038] A semantic information extraction model is obtained by training a pre-trained language model based on sample sentences from a financial corpus.
[0039] The semantic information extraction model and the sentiment regression model are jointly trained based on sample sentences and their sentiment labels in the financial sentiment corpus to obtain the trained semantic information extraction model and sentiment regression model.
[0040] According to a regional data monitoring method provided by the present invention, the step of statistically analyzing financial public opinion data of the target region based on the sentiment scores of the plurality of financial texts specifically includes:
[0041] Classify the multiple financial texts according to financial market elements and determine the market element labels of the multiple financial texts;
[0042] Based on the market element tags of the multiple financial texts and the sentiment scores of the corresponding financial texts, the public opinion data of each financial market element in the target area are statistically analyzed.
[0043] The present invention also provides a regional data monitoring system, comprising:
[0044] The financial text acquisition unit is used to acquire multiple financial texts from a target area.
[0045] The semantic extraction unit is used to extract semantics from the financial text based on the semantic information extraction model, and obtain the initial semantic vector of each word in the financial text.
[0046] The key word extraction unit is used to determine the sentiment segment words and their sentiment scores in the financial text based on the sentiment dictionary, and to determine the trend expression words and their trend scores in the financial text based on the trend expression dictionary; wherein, the sentiment segment words represent elements that bring positive or negative emotions, and the trend expression words represent the positive or negative trend of element changes;
[0047] The semantic enhancement unit is used to enhance the initial semantic vector of the corresponding emotion segment based on the emotion score of each emotion segment, and to enhance the initial semantic vector of the corresponding trend expression word based on the trend score of each trend expression word, so as to obtain the enhanced semantic vectors of the emotion segment and the trend expression word respectively.
[0048] The sentiment regression unit is used to perform regression analysis on the enhanced semantic vectors of sentiment segmentation words and trend expression words in the financial text, as well as the initial semantic vectors of the remaining segmentation words, based on the sentiment regression model, to obtain the sentiment score of the financial text.
[0049] The financial public opinion data statistics unit is used to statistically analyze the financial public opinion data of the target area based on the sentiment scores of the multiple financial texts.
[0050] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the area data monitoring method as described above.
[0051] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the area data monitoring method as described above.
[0052] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the regional data monitoring method as described above.
[0053] This invention provides a regional data monitoring method and system. It extracts semantic information from any financial text using a semantic information extraction model, obtaining the initial semantic vector of each word in the text. This initial semantic information acquisition is then performed. Furthermore, a sentiment dictionary is used to determine sentiment words and their sentiment scores within the financial text, and a trend expression dictionary is used to determine trend expression words and their trend scores. The initial semantic vectors of the corresponding sentiment words are strengthened based on their sentiment scores, and the initial semantic vectors of the corresponding trend expression words are strengthened based on their trend scores. This results in strengthened semantic vectors for both sentiment words and trend expression words. This approach supplements the contextual information of the financial text when the semantic information extraction model fails to extract sufficient semantic information from some sentiment words and trend expression words, leading to incomplete contextual information extraction. This improves the overall semantic information extraction accuracy of the financial text, thereby enhancing the accuracy of subsequent sentiment analysis and achieving more accurate public opinion data monitoring in the target area. Attached Figure Description
[0054] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0055] Figure 1 This is a flowchart illustrating the regional data monitoring method provided by the present invention;
[0056] Figure 2 This is a flowchart illustrating the emotion score regression method provided by the present invention;
[0057] Figure 3 This is a flowchart illustrating the emotion score fine-tuning method provided by the present invention;
[0058] Figure 4 This is a schematic diagram of the structure of the regional data monitoring system provided by the present invention;
[0059] Figure 5 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0060] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0061] Figure 1 This is a flowchart illustrating the regional data monitoring method provided by the present invention, as shown below. Figure 1 As shown, the method includes:
[0062] Step 110: Obtain multiple financial texts from the target area;
[0063] Step 120: Based on the semantic information extraction model, perform semantic extraction on the financial text to obtain the initial semantic vector of each word in the financial text;
[0064] Step 130: Determine the sentiment segmentation words and their sentiment scores in the financial text based on the sentiment dictionary, and determine the trend expression words and their trend scores in the financial text based on the trend expression dictionary; wherein, the sentiment segmentation words represent elements that bring positive or negative emotions, and the trend expression words represent the positive or negative trend of element changes;
[0065] Step 140: Strengthen the initial semantic vector of the corresponding emotion segment based on the emotion score of each emotion segment, and strengthen the initial semantic vector of the corresponding trend expression word based on the trend score of each trend expression word, so as to obtain the strengthened semantic vectors of the emotion segment and the trend expression word respectively.
[0066] Step 150: Based on the sentiment regression model, perform regression analysis on the enhanced semantic vectors of sentiment segmentation words and trend expression words in the financial text, as well as the initial semantic vectors of the remaining segmentation words, to obtain the sentiment score of the financial text.
[0067] Step 160: Based on the sentiment scores of the multiple financial texts, statistically analyze the financial public opinion data of the target region.
[0068] Specifically, to analyze and monitor financial public opinion data in a target region, multiple financial texts corresponding to that target region can be obtained, including financial analysis reports, financial news, and comments from local residents regarding the region's financial situation. Since financial analysis reports and financial news are often lengthy and contain a lot of redundant information, only the titles or summaries of these documents can be extracted as the financial text to be analyzed.
[0069] Subsequently, semantic extraction is performed on any financial text based on a semantic information extraction model to obtain the initial semantic vector for each word in the financial text. The semantic information extraction model can be any language model based on the Transformer structure, such as the BERT model and its variants. The semantic information extraction model has the ability to extract the semantic information of each word from natural language text. Therefore, by using this model to extract semantic information from financial text, the semantic information of each word in the text can be obtained, thereby constructing an initial semantic vector containing the respective semantic information of each word. However, while language models based on the Transformer structure can extract certain contextual information from financial texts, analysis reveals that financial texts contain complex expressions. Even if there are segmentations that clearly express positive emotions (e.g., profit), once combined with segmentations that express a reverse trend (e.g., decline), the overall emotion will become negative. In many scenarios, the segmentations expressing emotion and those expressing trends are discontinuous or even far apart. Language models based on the Transformer structure struggle to establish a connection between these two segments, resulting in incomplete and inaccurate extracted contextual information, which affects the accuracy of sentiment analysis in financial texts.
[0070] In response, this invention, in addition to extracting semantic information from financial text, also extracts sentiment segmentation words and trend expression words from financial text based on sentiment dictionaries and trend expression dictionaries. These words are crucial for sentiment analysis tasks. This is to supplement the contextual information of financial text when the semantic information extraction model fails to extract sufficient semantic information from some sentiment segmentation words and trend expression words, resulting in incomplete contextual information extraction. This improves the overall semantic information extraction accuracy of financial text and thus enhances the accuracy of subsequent sentiment analysis.
[0071] Specifically, a sentiment lexicon can be used to determine sentiment segmentation words and their sentiment scores in financial texts. These sentiment segmentation words characterize elements in the financial text that evoke positive or negative emotions, typically appearing as nouns such as profit, cost, reputation, and bad debt. The sentiment score indicates the degree to which the segmentation word evokes the corresponding emotion; a higher score indicates a stronger emotional response. Additionally, a trend expression lexicon can be used to determine trend expression words and their trend scores in financial texts. These trend expression words express the changing trends of certain financial elements, including positive and negative trends, such as rising, falling, increasing, decreasing, growing, shrinking, filling, and slowing down. The trend score characterizes the likelihood that the word is used to express the corresponding trend; a higher score indicates a higher probability. To provide more complete and accurate contextual information, the initial semantic vectors of the corresponding sentiment segments can be enhanced based on their sentiment scores, and the initial semantic vectors of the corresponding trend expression words can be enhanced based on their trend scores. This results in enhanced semantic vectors for the sentiment segments and trend expression words, allowing the subsequent sentiment regression model to focus more attention on these sentiment segments and trend expression words, thus enabling more accurate regression analysis of the sentiment in financial texts.
[0072] Here, the sentiment scores of each sentiment segment in the financial text are normalized to obtain a normalized sentiment score for each sentiment segment, and the trend scores of each trend expression word are normalized to obtain a normalized trend score for each trend expression word. The normalized sentiment scores and trend scores of each sentiment segment and trend expression word are then incremented by 1 and used as the weights of the corresponding words. This weighting is applied to the initial semantic vectors of the corresponding words to obtain enhanced semantic vectors for the sentiment segments and trend expression words. This results in sentiment segments and trend expression words having a higher proportion of semantic information compared to other segments, thus attracting more attention from the sentiment regression model.
[0073] Based on a sentiment regression model, regression analysis is performed on the enhanced semantic vectors of sentiment-related words and trend-expressing words in financial texts, as well as the initial semantic vectors of remaining words (i.e., words other than sentiment-related words and trend-expressing words) to obtain the sentiment score of the financial text. The sentiment score of the financial text takes values in the range [-1, 1]. A sentiment score less than 0 indicates a negative sentiment, a sentiment score greater than 0 indicates a positive sentiment, and a sentiment score equal to 0 indicates a neutral sentiment. The closer the absolute value of the sentiment score is to 1, the more pronounced the sentiment expression of that type in the financial text. The sentiment regression model can be constructed using a regression model based on a Transformer structure. After obtaining the sentiment scores of each financial text, the financial public opinion data for the target region can be statistically obtained. This financial public opinion data can include various sentiments regarding the financial situation in the target region, as well as the proportion of each type of sentiment. Furthermore, the degree of each type of sentiment can be classified according to the sentiment score (e.g., mild, severe), obtaining the proportion of different degrees of sentiment within each type.
[0074] The method provided in this invention extracts semantic information from any financial text using a semantic information extraction model, obtaining the initial semantic vector of each word in the financial text. This provides preliminary semantic information acquisition of the financial text. Furthermore, it determines sentiment words and their sentiment scores based on a sentiment dictionary, and determines trend expression words and their trend scores based on a trend expression dictionary. The initial semantic vectors of the corresponding sentiment words are strengthened based on their sentiment scores, and the initial semantic vectors of the corresponding trend expression words are strengthened based on their trend scores, resulting in strengthened semantic vectors for both sentiment words and trend expression words. This method supplements the contextual information of the financial text when the semantic information extraction model fails to extract sufficient semantic information from some sentiment words and trend expression words, leading to incomplete contextual information extraction. This improves the overall semantic information extraction accuracy of the financial text, thereby enhancing the accuracy of subsequent sentiment analysis and achieving more accurate public opinion data monitoring in the target area.
[0075] Based on the above embodiments, the trend expression dictionary is constructed based on the following steps:
[0076] Based on the emotion dictionary, the positive emotion segmentation and negative emotion segmentation of each sample sentence in the general emotion corpus are determined;
[0077] Based on the number of positive and negative emotion segment words in any sample sentence, and the emotion tag of the sample sentence, the expression direction of the sample sentence is determined.
[0078] Specifically, if the number of positive emotion segment words in any sample sentence is greater than the number of negative emotion segment words and the emotion label is positive, or if the number of positive emotion segment words in any sample sentence is less than the number of negative emotion segment words and the emotion label is negative, then the expression direction of any sample sentence is positive; if the number of positive emotion segment words in any sample sentence is greater than the number of negative emotion segment words and the emotion label is negative, or if the number of positive emotion segment words in any sample sentence is less than the number of negative emotion segment words and the emotion label is positive, then the expression direction of any sample sentence is negative.
[0079] Based on the probability of each word segment appearing in each sample sentence with a positive expression direction in the general emotion corpus, and the probability of each word segment appearing in each sample sentence with a negative expression direction, positive trend expression words and negative trend expression words are determined.
[0080] The trend expression dictionary is constructed based on the positive trend expression words and the negative trend expression words.
[0081] Specifically, since no existing trend expression dictionary is currently available, a custom trend expression dictionary can be constructed using a general sentiment corpus. When constructing the trend expression dictionary, a sentiment dictionary can be used to determine the positive and negative sentiment segmentation words for each sample sentence in the general sentiment corpus. Positive sentiment segmentation words represent elements that bring about positive emotions, while negative sentiment segmentation words represent elements that bring about negative emotions. Subsequently, based on the number of positive and negative sentiment segmentation words in any sample sentence, as well as the sentiment tag of that sample sentence, the expression direction of that sample sentence is determined. The expression direction of any sample sentence includes positive and negative directions. A positive expression direction refers to an expression that uses elements expressing positive emotions (e.g., profit) to express positive emotions or an expression that uses elements expressing negative emotions (e.g., cost) to express negative emotions; a negative expression direction refers to an expression that uses elements expressing positive emotions to express negative emotions or an expression that uses elements expressing negative emotions to express positive emotions.
[0082] Here, if the number of positive emotion segmentations in any sample sentence is greater than the number of negative emotion segmentations and the emotion label is positive, or if the number of positive emotion segmentations in any sample sentence is less than the number of negative emotion segmentations and the emotion label is negative, it indicates that the sample sentence tends to use positive emotion segmentations to express positive emotions or tends to use negative emotion segmentations to express negative emotions. Therefore, the expression direction of the sample sentence can be determined to be positive. Conversely, if the number of positive emotion segmentations in any sample sentence is greater than the number of negative emotion segmentations and the emotion label is negative, or if the number of positive emotion segmentations in any sample sentence is less than the number of negative emotion segmentations and the emotion label is positive, it indicates that the sample sentence tends to use positive emotion segmentations to express negative emotions or tends to use negative emotion segmentations to express positive emotions. Therefore, the expression direction of the sample sentence can be determined to be negative.
[0083] Subsequently, using the NLTK3 library, part-of-speech tagging and lexicalization were performed on each word segment in the general sentiment corpus, converting each sample sentence into a list of nouns. Based on the probability of each word segment appearing in sample sentences with a positive expression direction and the probability of each word segment appearing in sample sentences with a negative expression direction, positive trend expression words and negative trend expression words were determined. Specifically, if any word frequently appears in sample sentences with a positive expression direction, it can be considered that the word may represent a positive trend of element change, and therefore it can be determined as a positive trend expression word, and its trend score is calculated. Conversely, if any word frequently appears in sample sentences with a negative expression direction, it can be considered that the word may represent a negative trend of element change, and therefore it can be determined as a negative trend expression word, and its trend score is calculated. It should be noted that by calculating the trend scores of positive and negative trend expressions, the likelihood of each word segment representing a positive or negative trend is characterized. Even if some word segments do not actually represent a positive or negative trend, their determined trend scores are correspondingly lower. This allows the subsequent sentiment regression model to distinguish them from the true positive or negative trend expressions, thus avoiding interference and improving its fault tolerance and the accuracy of subsequent sentiment analysis. Based on the above determination of positive and negative trend expressions and their trend scores, a trend expression dictionary is constructed.
[0084] Based on any of the above embodiments, determining positive trend words and negative trend words based on the probability of each word appearing in each sample sentence with a positive expression direction and the probability of each word appearing in each sample sentence with a negative expression direction specifically includes:
[0085] Based on the probability of any word appearing in each sample sentence with a positive expression direction in the general emotion corpus, and the probability of any word appearing in all sample sentences in the general emotion corpus, the positive score of any word is determined.
[0086] Based on the probability of any word appearing in each sample sentence with the opposite expression direction in the general emotion corpus, and the probability of any word appearing in all sample sentences in the general emotion corpus, the reverse score of any word is determined.
[0087] If the positive score of any word segment is greater than the negative score, then the word segment is determined to be a positive trend expression word, and the positive score of the word segment is determined to be the trend score of the word segment.
[0088] If the positive score of any word segment is less than the negative score, then the word segment is determined to be a word expressing a negative trend, and the negative number of the absolute value of the negative score of the word segment is determined to be the trend score of the word segment.
[0089] Specifically, to more accurately extract positive and negative trend expression words from a general sentiment corpus, a positive score for a word segment can be determined based on the probability of any word segment appearing in each sample sentence with a positive expression direction, and the probability of that word segment appearing in all sample sentences of the general sentiment corpus. Conversely, a negative score for a word segment can be determined based on the probability of any word segment appearing in each sample sentence with a negative expression direction, and the probability of that word segment appearing in all sample sentences of the general sentiment corpus. Specifically, a first ratio can be determined between the probability of any word segment appearing in each sample sentence with a positive expression direction and the probability of each sample sentence appearing in all sample sentences with a positive expression direction. Then, a second ratio can be determined between the first ratio and the probability of that word segment appearing in all sample sentences of the general sentiment corpus, and this second ratio can be used as the positive score for that word segment. In addition, a first ratio can be determined between the probability of any word appearing in each sample sentence with the opposite expression direction and the probability of each sample sentence with the opposite expression direction appearing in all sample sentences. Then, based on the first ratio and a second ratio between the probability of the word appearing in all sample sentences of the general sentiment corpus, the second ratio is used as the reverse score of the word.
[0090] If the positive score of any segment is greater than its negative score, then the segment is determined to be a positive trend expression segment, and its positive score is determined to be its trend score. If the positive score of any segment is less than its negative score, then the segment is determined to be a negative trend expression segment, and the negative of the absolute value of its negative score is determined to be its trend score. The reason for using the negative of the absolute value of the negative score as the trend score is that the positive or negative nature of the trend score can be used to distinguish whether a segment is a positive or negative trend expression segment.
[0091] Based on any of the above embodiments, such as Figure 2 As shown, the regression analysis performed on the enhanced semantic vectors of sentiment segmentation words and trend expression words in the financial text, as well as the initial semantic vectors of the remaining segmentation words, to obtain the sentiment score of the financial text specifically includes:
[0092] Step 151: Based on the positions of each sentiment segment, trend expression word, and remaining segment in the financial text, positional encoding is performed on the enhanced semantic vectors of the corresponding sentiment segment and trend expression words, as well as the initial semantic vectors of the remaining segment, to obtain the positional feature vector of each segment in the financial text.
[0093] Step 152: Fuse the positional feature vectors of each word in the financial text to obtain the first text vector of the financial text;
[0094] Step 153: Perform average pooling on the initial semantic vector of each word in the financial text to obtain the second text vector of the financial text;
[0095] Step 154: Concatenate the first text vector and the second text vector of the financial text to obtain a concatenated text vector. Then, perform regression analysis on the concatenated text vector to obtain the sentiment score of the financial text.
[0096] Specifically, when encoding the positional features of the enhanced semantic vectors of the corresponding sentiment and trend expression words, as well as the initial semantic vectors of the remaining words, the position of the corresponding word in the financial text can be numerically represented and concatenated with the initial semantic vector of the corresponding word to obtain the positional feature vector of each word in the financial text. Since the positional feature vector of any word contains the positional information of the corresponding word, the order information of each word in the financial text can be preserved when the positional feature vectors of each word are fused and encoded in the subsequent process, thus improving the accuracy of the subsequent encoding. Subsequently, the positional feature vectors of each word in the financial text are fused to obtain the first text vector of the financial text. In addition, the initial semantic vector of each word in the financial text is averaged and pooled to obtain the second text vector of the financial text. It can be seen that the first text vector of the financial text can provide more contextual information for the second text vector, which helps to improve the accuracy of the subsequent regression analysis. After concatenating the first text vector and the second text vector of the financial text to obtain the concatenated text vector, regression analysis is performed on the concatenated text vector to obtain the sentiment score of the financial text.
[0097] Based on any of the above embodiments, fusing the positional feature vectors of each word in the financial text to obtain the first text vector of the financial text specifically includes:
[0098] The positional feature vectors of each word in the financial text are concatenated to obtain the word concatenation vector;
[0099] The first text vector of the financial text is obtained by continuously encoding the word segmentation and concatenation vector using a multi-layer encoder.
[0100] Specifically, the positional feature vectors of each word in the financial text are concatenated in word order to obtain the concatenated word vector of the financial text. Then, a multi-layer encoder is used to continuously encode this concatenated word vector to extract important information from different dimensions, resulting in the first text vector of the financial text output by the last layer encoder.
[0101] Based on any of the above embodiments, such as Figure 3 As shown, the sentiment regression model is used to perform regression analysis on the enhanced semantic vectors of sentiment segmentation words and trend expression words in the financial text, as well as the initial semantic vectors of the remaining segmentation words, to obtain the sentiment score of the financial text. This process also includes:
[0102] Step 310: Combine the sentiment segments and trend expression words in the financial text to obtain positive word groups and / or negative word groups; wherein, the positive word group is composed of positive sentiment segments and positive trend expression words or negative sentiment segments and reverse trend expression words; the negative word group is composed of positive sentiment segments and reverse trend expression words or negative sentiment segments and positive trend expression words.
[0103] Step 320: Fine-tune the sentiment score of the financial text based on the number of positive and / or negative word groups in the financial text.
[0104] Specifically, after obtaining the sentiment score of the financial text based on the sentiment regression model, the sentiment score can be fine-tuned based on the sentiment segmentation words and trend expression words in the financial text to further improve the accuracy of sentiment analysis. Here, the sentiment segmentation words and trend expression words in the financial text can be combined to obtain positive and / or negative word groups. Positive word groups are composed of positive sentiment segmentation words and positive trend expression words or negative sentiment segmentation words and negative trend expression words, while negative word groups are composed of positive sentiment segmentation words and negative trend expression words or negative sentiment segmentation words and positive trend expression words. It is evident that positive word groups represent elements that bring positive sentiment developing in a positive trend, or elements that bring negative sentiment developing in a negative trend; therefore, positive word groups represent positive sentiment. Correspondingly, negative word groups represent elements that bring negative sentiment developing in a positive trend, or elements that bring negative sentiment developing in a positive trend; therefore, negative word groups represent negative sentiment.
[0105] Based on the number of positive and / or negative phrases in a financial text, the sentiment score can be fine-tuned. If the number of positive phrases is greater than the number of negative phrases, it indicates that positive sentiment dominates the text, and the sentiment score can be appropriately increased, for example, by adding a preset value to the sentiment score. Conversely, if the number of negative phrases is greater than the number of positive phrases, it indicates that negative sentiment dominates the text, and the sentiment score can be appropriately decreased, for example, by subtracting a preset value from the sentiment score.
[0106] Based on any of the above embodiments, the semantic information extraction model and the sentiment regression model are trained based on the following steps:
[0107] A semantic information extraction model is obtained by training a pre-trained language model based on sample sentences from a financial corpus.
[0108] The semantic information extraction model and the sentiment regression model are jointly trained based on sample sentences and their sentiment labels in the financial sentiment corpus to obtain the trained semantic information extraction model and sentiment regression model.
[0109] Specifically, considering the limited number of samples in the financial sentiment corpus and the significant impact of semantic information extraction accuracy on the completion of financial sentiment analysis tasks, a pre-trained language model (e.g., BERT) pre-trained using a general corpus can be selected when training the semantic information extraction model and the sentiment regression model. In the first stage, the pre-trained language model is trained separately using sample sentences from the financial corpus to obtain the semantic information extraction model, making it more adaptable to the language expressions in the financial domain. The financial corpus contains sample texts from various financial fields, but without the need for sentiment labels. In the second stage, the semantic information extraction model and the sentiment regression model are jointly trained based on sample sentences and their sentiment labels from the financial sentiment corpus, resulting in the trained semantic information extraction model and sentiment regression model. The financial sentiment corpus contains sample texts from various financial fields and labeled sentiment labels, which represent the sentiment of the corresponding text.
[0110] Based on any of the above embodiments, the step of statistically analyzing the financial public opinion data of the target region based on the sentiment scores of the plurality of financial texts specifically includes:
[0111] Classify the multiple financial texts according to financial market elements and determine the market element labels of the multiple financial texts;
[0112] Based on the market element tags of the multiple financial texts and the sentiment scores of the corresponding financial texts, the public opinion data of each financial market element in the target area are statistically analyzed.
[0113] Specifically, to monitor financial sentiment in a target region more granularly, multiple financial texts can be categorized into financial market elements based on a classification model, thereby determining the market element labels for each text. These market element labels can include stocks, bonds, securities, etc. Subsequently, based on the market element labels of multiple financial texts and the corresponding sentiment scores, sentiment data for each financial market element in the target region is statistically analyzed.
[0114] The classification model can be trained based on sample texts from various financial fields and their market element sample labels in a financial corpus.
[0115] The regional data monitoring system provided by the present invention is described below. The regional data monitoring system described below can be referred to in correspondence with the regional data monitoring method described above.
[0116] Based on any of the above embodiments Figure 4 This is a schematic diagram of the structure of the regional data monitoring system provided by the present invention, as shown below. Figure 4 As shown, the system includes: a financial text acquisition unit 410, a semantic extraction unit 420, a key word extraction unit 430, a semantic enhancement unit 440, a sentiment regression unit 450, and a financial public opinion data statistics unit 460.
[0117] Among them, the financial text acquisition unit 410 is used to acquire multiple financial texts in the target area;
[0118] The semantic extraction unit 420 is used to extract semantics from the financial text based on the semantic information extraction model, and obtain the initial semantic vector of each word in the financial text.
[0119] The key word extraction unit 430 is used to determine the sentiment segment words and their sentiment scores in the financial text based on the sentiment dictionary, and to determine the trend expression words and their trend scores in the financial text based on the trend expression dictionary; wherein, the sentiment segment words represent elements that bring positive or negative emotions, and the trend expression words represent the positive or negative trend of element changes;
[0120] The semantic enhancement unit 440 is used to enhance the initial semantic vector of the corresponding emotion segment based on the emotion score of each emotion segment, and to enhance the initial semantic vector of the corresponding trend expression word based on the trend score of each trend expression word, so as to obtain the enhanced semantic vectors of the emotion segment and the trend expression word respectively.
[0121] The sentiment regression unit 450 is used to perform regression analysis on the enhanced semantic vectors of sentiment segmentation words and trend expression words in the financial text, as well as the initial semantic vectors of the remaining segmentation words, based on the sentiment regression model, to obtain the sentiment score of the financial text.
[0122] The financial public opinion data statistics unit 460 is used to statistically analyze the financial public opinion data of the target area based on the sentiment scores of the multiple financial texts.
[0123] The system provided in this invention performs semantic extraction on any financial text based on a semantic information extraction model, obtaining the initial semantic vector of each word in the financial text, thus acquiring preliminary semantic information. In addition, it determines sentiment words and their sentiment scores based on a sentiment dictionary, and determines trend expression words and their trend scores based on a trend expression dictionary. The initial semantic vectors of the corresponding sentiment words are strengthened based on their sentiment scores, and the initial semantic vectors of the corresponding trend expression words are strengthened based on their trend scores, resulting in strengthened semantic vectors for both sentiment words and trend expression words. This is to supplement the contextual information of the financial text when the semantic information extraction model fails to sufficiently extract the semantic information of some sentiment words and trend expression words, leading to incomplete contextual information extraction. This improves the overall semantic information extraction accuracy of the financial text, thereby enhancing the accuracy of subsequent sentiment analysis and achieving more accurate public opinion data monitoring in the target area.
[0124] Based on any of the above embodiments, the trend expression dictionary is constructed based on the following steps:
[0125] Based on the emotion dictionary, the positive emotion segmentation and negative emotion segmentation of each sample sentence in the general emotion corpus are determined;
[0126] Based on the number of positive and negative emotion segment words in any sample sentence, and the emotion tag of the sample sentence, the expression direction of the sample sentence is determined.
[0127] Specifically, if the number of positive emotion segment words in any sample sentence is greater than the number of negative emotion segment words and the emotion label is positive, or if the number of positive emotion segment words in any sample sentence is less than the number of negative emotion segment words and the emotion label is negative, then the expression direction of any sample sentence is positive; if the number of positive emotion segment words in any sample sentence is greater than the number of negative emotion segment words and the emotion label is negative, or if the number of positive emotion segment words in any sample sentence is less than the number of negative emotion segment words and the emotion label is positive, then the expression direction of any sample sentence is negative.
[0128] Based on the probability of each word segment appearing in each sample sentence with a positive expression direction in the general emotion corpus, and the probability of each word segment appearing in each sample sentence with a negative expression direction, positive trend expression words and negative trend expression words are determined.
[0129] The trend expression dictionary is constructed based on the positive trend expression words and the negative trend expression words.
[0130] Based on any of the above embodiments, determining positive trend words and negative trend words based on the probability of each word appearing in each sample sentence with a positive expression direction and the probability of each word appearing in each sample sentence with a negative expression direction specifically includes:
[0131] Based on the probability of any word appearing in each sample sentence with a positive expression direction in the general emotion corpus, and the probability of any word appearing in all sample sentences in the general emotion corpus, the positive score of any word is determined.
[0132] Based on the probability of any word appearing in each sample sentence with the opposite expression direction in the general emotion corpus, and the probability of any word appearing in all sample sentences in the general emotion corpus, the reverse score of any word is determined.
[0133] If the positive score of any word segment is greater than the negative score, then the word segment is determined to be a positive trend expression word, and the positive score of the word segment is determined to be the trend score of the word segment.
[0134] If the positive score of any word segment is less than the negative score, then the word segment is determined to be a word expressing a negative trend, and the negative number of the absolute value of the negative score of the word segment is determined to be the trend score of the word segment.
[0135] Based on any of the above embodiments, the step of performing regression analysis on the enhanced semantic vectors of sentiment segmentation words and trend expression words in the financial text, as well as the initial semantic vectors of the remaining segmentation words, to obtain the sentiment score of the financial text specifically includes:
[0136] Based on the positions of each sentiment segment, trend expression word, and remaining segment in the financial text, positional encoding is performed on the enhanced semantic vectors of the corresponding sentiment segment and trend expression words, as well as the initial semantic vectors of the remaining segments, to obtain the positional feature vector of each segment in the financial text.
[0137] The positional feature vectors of each word in the financial text are fused to obtain the first text vector of the financial text.
[0138] The initial semantic vector of each word in the financial text is averaged and pooled to obtain the second text vector of the financial text.
[0139] The first and second text vectors of the financial text are concatenated to obtain a concatenated text vector. Then, regression analysis is performed on the concatenated text vector to obtain the sentiment score of the financial text.
[0140] Based on any of the above embodiments, fusing the positional feature vectors of each word in the financial text to obtain the first text vector of the financial text specifically includes:
[0141] The positional feature vectors of each word in the financial text are concatenated to obtain the word concatenation vector;
[0142] The first text vector of the financial text is obtained by continuously encoding the word segmentation and concatenation vector using a multi-layer encoder.
[0143] Based on any of the above embodiments, the step of performing regression analysis on the enhanced semantic vectors of sentiment segmentation words and trend expression words in the financial text, as well as the initial semantic vectors of the remaining segmentation words, based on the sentiment regression model to obtain the sentiment score of the financial text, further includes:
[0144] The sentiment segments and trend expression words in the financial text are combined to obtain positive word groups and / or negative word groups; wherein, the positive word group is composed of positive sentiment segments and positive trend expression words or negative sentiment segments and reverse trend expression words; the negative word group is composed of positive sentiment segments and reverse trend expression words or negative sentiment segments and positive trend expression words.
[0145] The sentiment score of the financial text is fine-tuned based on the number of positive and / or negative words in the text.
[0146] Based on any of the above embodiments, the fine-tuning of the sentiment score of the financial text based on the number of positive and / or negative word groups in the financial text specifically includes:
[0147] If the number of positive words in the financial text is greater than the number of negative words, then a preset value is added to the sentiment score of the financial text.
[0148] If the number of positive words in the financial text is less than the number of negative words, then a preset value is subtracted from the sentiment score of the financial text.
[0149] Based on any of the above embodiments, the semantic information extraction model and the sentiment regression model are trained based on the following steps:
[0150] A semantic information extraction model is obtained by training a pre-trained language model based on sample sentences from a financial corpus.
[0151] The semantic information extraction model and the sentiment regression model are jointly trained based on sample sentences and their sentiment labels in the financial sentiment corpus to obtain the trained semantic information extraction model and sentiment regression model.
[0152] Based on any of the above embodiments, the step of statistically analyzing the financial public opinion data of the target region based on the sentiment scores of the plurality of financial texts specifically includes:
[0153] Classify the multiple financial texts according to financial market elements and determine the market element labels of the multiple financial texts;
[0154] Based on the market element tags of the multiple financial texts and the sentiment scores of the corresponding financial texts, the public opinion data of each financial market element in the target area are statistically analyzed.
[0155] Figure 5 This is a schematic diagram of the structure of the electronic device provided by the present invention, such as... Figure 5 As shown, the electronic device may include: a processor 510, a memory 520, a communication interface 530, and a communication bus 540, wherein the processor 510, the memory 520, and the communication interface 530 communicate with each other through the communication bus 540. The processor 510 can call logical instructions in the memory 520 to execute a regional data monitoring method, which includes: acquiring multiple financial texts of a target region; performing semantic extraction on the financial texts based on a semantic information extraction model to obtain an initial semantic vector for each word in the financial texts; determining sentiment words and their sentiment scores in the financial texts based on a sentiment dictionary, and determining trend expression words and their trend scores in the financial texts based on a trend expression dictionary; wherein, the sentiment words represent elements that bring positive or negative emotions, and the trend expression words represent positive or negative trends in element changes; strengthening the initial semantic vectors of the corresponding sentiment words based on their sentiment scores, and strengthening the initial semantic vectors of the corresponding trend expression words based on their trend scores, respectively obtaining strengthened semantic vectors for the sentiment words and trend expression words; performing regression analysis on the strengthened semantic vectors of the sentiment words and trend expression words in the financial texts, as well as the initial semantic vectors of the remaining words, based on a sentiment regression model to obtain the sentiment score of the financial texts; and statistically analyzing the financial public opinion data of the target region based on the sentiment scores of the multiple financial texts.
[0156] Furthermore, the logical instructions in the aforementioned memory 520 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0157] On the other hand, the present invention also provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, wherein when the program instructions are executed by a computer, the computer is able to execute the regional data monitoring method provided by the above methods, the method comprising: acquiring multiple financial texts of a target region; performing semantic extraction on the financial texts based on a semantic information extraction model to obtain an initial semantic vector for each word in the financial texts; determining the sentiment words and their sentiment scores in the financial texts based on a sentiment dictionary, and determining the trend expression words and their trend scores in the financial texts based on a trend expression dictionary; wherein, The emotion segmentation represents elements that bring positive or negative emotions, and the trend expression words represent the positive or negative trends of element changes. Based on the emotion scores of each emotion segmentation word, the initial semantic vector of the corresponding emotion segmentation word is strengthened, and based on the trend scores of each trend expression word, the initial semantic vector of the corresponding trend expression word is strengthened, resulting in strengthened semantic vectors for both emotion segmentation words and trend expression words. Based on an emotion regression model, regression analysis is performed on the strengthened semantic vectors of emotion segmentation words and trend expression words in the financial text, as well as the initial semantic vectors of the remaining segments, to obtain the emotion score of the financial text. Based on the emotion scores of the multiple financial texts, statistical analysis of financial public opinion data for the target region is conducted.
[0158] Furthermore, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the aforementioned regional data monitoring methods. The method includes: acquiring multiple financial texts of a target region; performing semantic extraction on the financial texts based on a semantic information extraction model to obtain an initial semantic vector for each word segment in the financial texts; determining sentiment words and their sentiment scores in the financial texts based on a sentiment dictionary, and determining trend expression words and their trend scores in the financial texts based on a trend expression dictionary; wherein the sentiment words represent positive or negative emotions. The elements are defined as follows: the trend expression words represent the positive or negative trend of element changes; the initial semantic vectors of the corresponding sentiment segments are strengthened based on the sentiment scores of each sentiment segment, and the initial semantic vectors of the corresponding trend expression words are strengthened based on the trend scores of each trend expression word, resulting in strengthened semantic vectors for sentiment segments and trend expression words respectively; based on the sentiment regression model, regression analysis is performed on the strengthened semantic vectors of sentiment segments and trend expression words in the financial text, as well as the initial semantic vectors of the remaining segments, to obtain the sentiment score of the financial text; based on the sentiment scores of the multiple financial texts, the financial public opinion data of the target area is statistically analyzed.
[0159] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0160] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0161] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for regional data monitoring, characterized in that, include: Retrieve multiple financial texts from the target region; Based on the semantic information extraction model, semantic extraction is performed on the financial text to obtain the initial semantic vector of each word in the financial text; The emotional segmentation words and their emotional scores in the financial text are determined based on an emotional lexicon, and the trend expression words and their trend scores in the financial text are determined based on a trend expression lexicon; wherein, the emotional segmentation words represent elements that bring positive or negative emotions, the trend expression words represent the positive or negative trends of element changes, and the trend scores represent the likelihood that the corresponding trend expression words are used to express the corresponding trends. The initial semantic vectors of the corresponding emotion segments are enhanced based on the emotion scores of each emotion segment, and the initial semantic vectors of the corresponding trend expression words are enhanced based on the trend scores of each trend expression word, resulting in enhanced semantic vectors for the emotion segments and trend expression words, respectively. Based on the sentiment regression model, regression analysis is performed on the enhanced semantic vectors of sentiment segmentation words and trend expression words in the financial text, as well as the initial semantic vectors of the remaining segmentation words, to obtain the sentiment score of the financial text. Based on the sentiment scores of the multiple financial texts, statistical analysis of financial public opinion data for the target region is performed. The trend expression dictionary was constructed based on the following steps: Based on the emotion dictionary, the positive emotion segmentation and negative emotion segmentation of each sample sentence in the general emotion corpus are determined; Based on the number of positive and negative emotion segment words in any sample sentence, and the emotion tag of the sample sentence, the expression direction of the sample sentence is determined. Specifically, if the number of positive emotion segment words in any sample sentence is greater than the number of negative emotion segment words and the emotion label is positive, or if the number of positive emotion segment words in any sample sentence is less than the number of negative emotion segment words and the emotion label is negative, then the expression direction of any sample sentence is positive; if the number of positive emotion segment words in any sample sentence is greater than the number of negative emotion segment words and the emotion label is negative, or if the number of positive emotion segment words in any sample sentence is less than the number of negative emotion segment words and the emotion label is positive, then the expression direction of any sample sentence is negative. Based on the probability of any word appearing in each sample sentence with a positive expression direction in the general emotion corpus, and the probability of any word appearing in all sample sentences in the general emotion corpus, the positive score of any word is determined. Based on the probability of any word appearing in each sample sentence with the opposite expression direction in the general emotion corpus, and the probability of any word appearing in all sample sentences in the general emotion corpus, the reverse score of any word is determined. If the positive score of any word segment is greater than the negative score, then the word segment is determined to be a positive trend expression word, and the positive score of the word segment is determined to be the trend score of the word segment. If the positive score of any word segment is less than the negative score, then the word segment is determined to be a word expressing a negative trend, and the negative number of the absolute value of the negative score of the word segment is determined to be the trend score of the word segment. The trend expression dictionary is constructed based on the positive trend expression words and the negative trend expression words.
2. The regional data monitoring method according to claim 1, characterized in that, The process involves performing regression analysis on the enhanced semantic vectors of sentiment segmentation words and trend expression words in the financial text, as well as the initial semantic vectors of the remaining segmentation words, to obtain the sentiment score of the financial text. Specifically, this includes: Based on the positions of each sentiment segment, trend expression word, and remaining segment in the financial text, positional encoding is performed on the enhanced semantic vectors of the corresponding sentiment segment and trend expression words, as well as the initial semantic vectors of the remaining segments, to obtain the positional feature vector of each segment in the financial text. The positional feature vectors of each word in the financial text are fused to obtain the first text vector of the financial text. The initial semantic vector of each word in the financial text is averaged and pooled to obtain the second text vector of the financial text. The first and second text vectors of the financial text are concatenated to obtain a concatenated text vector. Then, regression analysis is performed on the concatenated text vector to obtain the sentiment score of the financial text.
3. The regional data monitoring method according to claim 2, characterized in that, The process of fusing the positional feature vectors of each word in the financial text to obtain the first text vector of the financial text specifically includes: The positional feature vectors of each word in the financial text are concatenated to obtain the word concatenation vector; The first text vector of the financial text is obtained by continuously encoding the word segmentation and concatenation vector using a multi-layer encoder.
4. The regional data monitoring method according to claim 1, characterized in that, The sentiment regression model is used to perform regression analysis on the enhanced semantic vectors of sentiment segmentation words and trend expression words in the financial text, as well as the initial semantic vectors of the remaining segmentation words, to obtain the sentiment score of the financial text. This process also includes: The sentiment segments and trend expression words in the financial text are combined to obtain positive word groups and / or negative word groups; wherein, the positive word group is composed of positive sentiment segments and positive trend expression words or negative sentiment segments and reverse trend expression words; the negative word group is composed of positive sentiment segments and reverse trend expression words or negative sentiment segments and positive trend expression words. The sentiment score of the financial text is fine-tuned based on the number of positive and / or negative words in the text.
5. The regional data monitoring method according to claim 4, characterized in that, The process of fine-tuning the sentiment score of the financial text based on the number of positive and / or negative word groups in the text specifically includes: If the number of positive words in the financial text is greater than the number of negative words, then a preset value is added to the sentiment score of the financial text. If the number of positive words in the financial text is less than the number of negative words, then a preset value is subtracted from the sentiment score of the financial text.
6. The regional data monitoring method according to claim 1, characterized in that, The semantic information extraction model and the sentiment regression model are trained based on the following steps: A semantic information extraction model is obtained by training a pre-trained language model based on sample sentences from a financial corpus. The semantic information extraction model and the sentiment regression model are jointly trained based on sample sentences and their sentiment labels in the financial sentiment corpus to obtain the trained semantic information extraction model and sentiment regression model.
7. A regional data monitoring method according to any one of claims 1 to 6, characterized in that, The process of calculating financial public opinion data for the target region based on sentiment scores from the multiple financial texts specifically includes: Classify the multiple financial texts according to financial market elements and determine the market element labels of the multiple financial texts; Based on the market element tags of the multiple financial texts and the sentiment scores of the corresponding financial texts, the public opinion data of each financial market element in the target area are statistically analyzed.
8. A regional data monitoring system, characterized in that, include: The financial text acquisition unit is used to acquire multiple financial texts from a target area. The semantic extraction unit is used to extract semantics from the financial text based on the semantic information extraction model, and obtain the initial semantic vector of each word in the financial text. The key word extraction unit is used to determine the sentiment segmentation words and their sentiment scores in the financial text based on the sentiment dictionary, and to determine the trend expression words and their trend scores in the financial text based on the trend expression dictionary; wherein, the sentiment segmentation words represent the elements that bring positive or negative emotions, the trend expression words represent the positive or negative trends of element changes; and the trend score represents the likelihood that the corresponding trend expression word is used to express the corresponding trend. The semantic enhancement unit is used to enhance the initial semantic vector of the corresponding emotion segment based on the emotion score of each emotion segment, and to enhance the initial semantic vector of the corresponding trend expression word based on the trend score of each trend expression word, so as to obtain the enhanced semantic vectors of the emotion segment and the trend expression word respectively. The sentiment regression unit is used to perform regression analysis on the enhanced semantic vectors of sentiment segmentation words and trend expression words in the financial text, as well as the initial semantic vectors of the remaining segmentation words, based on the sentiment regression model, to obtain the sentiment score of the financial text. The financial public opinion data statistics unit is used to statistically analyze the financial public opinion data of the target area based on the sentiment scores of the multiple financial texts. The trend expression dictionary was constructed based on the following steps: Based on the emotion dictionary, the positive emotion segmentation and negative emotion segmentation of each sample sentence in the general emotion corpus are determined; Based on the number of positive and negative emotion segment words in any sample sentence, and the emotion tag of the sample sentence, the expression direction of the sample sentence is determined. Specifically, if the number of positive emotion segment words in any sample sentence is greater than the number of negative emotion segment words and the emotion label is positive, or if the number of positive emotion segment words in any sample sentence is less than the number of negative emotion segment words and the emotion label is negative, then the expression direction of any sample sentence is positive; if the number of positive emotion segment words in any sample sentence is greater than the number of negative emotion segment words and the emotion label is negative, or if the number of positive emotion segment words in any sample sentence is less than the number of negative emotion segment words and the emotion label is positive, then the expression direction of any sample sentence is negative. Based on the probability of any word appearing in each sample sentence with a positive expression direction in the general emotion corpus, and the probability of any word appearing in all sample sentences in the general emotion corpus, the positive score of any word is determined. Based on the probability of any word appearing in each sample sentence with the opposite expression direction in the general emotion corpus, and the probability of any word appearing in all sample sentences in the general emotion corpus, the reverse score of any word is determined. If the positive score of any word segment is greater than the negative score, then the word segment is determined to be a positive trend expression word, and the positive score of the word segment is determined to be the trend score of the word segment. If the positive score of any word segment is less than the negative score, then the word segment is determined to be a word expressing a negative trend, and the negative number of the absolute value of the negative score of the word segment is determined to be the trend score of the word segment. The trend expression dictionary is constructed based on the positive trend expression words and the negative trend expression words.