Data processing method, device, equipment and storage medium based on sentiment analysis

By applying hybrid neural networks in the financial field to analyze and process the comment text data, the problems of low efficiency and poor accuracy of emotional data analysis in the financial field in the existing technology are solved, and the automated analysis and efficiency of emotional data are achieved.

CN114386433BActive Publication Date: 2025-03-18AGRICULTURAL BANK OF CHINA

Patent Information

Application Number
CN202210030752.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-12
Publication Date
2025-03-18
Estimated Expiration
2042-01-12

AI Technical Summary

Technical Problem

The prior art emotional data analysis and processing in the financial field is inefficient and have poor accuracy, and lacks automated analysis and processing methods.

Method used

By obtaining comment text data in the financial field and inputting it into a hybrid neural network for analysis and processing, sentiment analysis results are generated, and financial market trend data are generated based on these results.

Benefits of technology

It realizes automated analysis and processing of emotional data in the financial field, improves the accuracy and efficiency of analysis and processing, and thus improves the guiding and application of emotional data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114386433B_ABST
    Figure CN114386433B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses a data processing method, device, equipment and storage medium based on sentiment analysis, the method comprising: obtaining financial field review text data of a target date; inputting the financial field review text data into a hybrid neural network to obtain sentiment analysis results of the financial field review text data of the target date; generating financial market trend data of a target associated date according to the sentiment analysis results of the financial field review text data of the target date. The technical solution of the embodiment of the present invention can realize the automatic analysis and processing of financial field sentiment data, improve the accuracy and efficiency of the analysis and processing of financial field sentiment data, and thus improve the guidance and applicability of financial field sentiment data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the technical field of data processing and analysis, and in particular, to a data processing method, apparatus, device and storage medium based on sentiment analysis. Background Art

[0002] At present, the data generated by the Internet and enterprise data processing platforms in the Internet field are characterized by massiveness, real-timeness and dynamic change, so the size of data processing tasks also has dynamic changing characteristics. Processing and analyzing large amounts of data can meet the needs of multi-dimensional scenarios and drive business iterations with data.

[0003] When processing and analyzing data, introducing user sentiment data can provide a deeper understanding of users’ views on services, products, and market or social dynamics. Understanding and utilizing user sentiment can effectively improve the user experience of services or products, or understand and predict market or social dynamics, thereby effectively promoting the healthy development of services or products and playing a positive role in promoting the market or society.

[0004] However, the existing data processing and analysis fields that introduce user emotional data factors are often limited to emotional data on APP (Application) products, services or social public opinion, such as user comment data on a certain type of social APP, etc. User emotional expression is straightforward and easy to understand, and the processing and analysis of this type of emotional data is relatively simple. Products in the financial field are highly professional and require centralized processing and analysis by professionals. For example, analyzing and processing financial field data by building professional dictionaries is inefficient and inaccurate, and there is currently no product or method that can automatically process and analyze emotional data in the financial field. Summary of the invention

[0005] The embodiments of the present invention provide a data processing method, device, equipment and storage medium based on sentiment analysis, which can realize automated analysis and processing of sentiment data in the financial field, improve the accuracy and efficiency of analysis and processing of sentiment data in the financial field, and further improve the guidance and applicability of sentiment data in the financial field.

[0006] In a first aspect, an embodiment of the present invention provides a data processing method based on sentiment analysis, comprising:

[0007] Obtain text data of financial field reviews on the target date;

[0008] Inputting the financial field review text data into a hybrid neural network to obtain sentiment analysis results of the financial field review text data on the target date;

[0009] Financial market trend data of a target associated date is generated according to the sentiment analysis result of the financial field review text data of the target date.

[0010] In a second aspect, an embodiment of the present invention further provides a data processing device based on sentiment analysis, comprising:

[0011] A review text data acquisition module is used to acquire review text data in the financial field on a target date;

[0012] A sentiment analysis result acquisition module, which inputs the financial field review text data into a hybrid neural network to obtain a sentiment analysis result of the financial field review text data on the target date;

[0013] The trend data generation module is used to generate financial market trend data of a target associated date according to the sentiment analysis result of the financial field review text data of the target date.

[0014] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:

[0015] one or more processors;

[0016] A storage device for storing one or more programs;

[0017] When the one or more programs are executed by the one or more processors, the one or more processors implement the data processing method based on sentiment analysis provided by any embodiment of the present invention.

[0018] In a fourth aspect, an embodiment of the present invention further provides a computer storage medium on which a computer program is stored, and when the program is executed by a processor, the data processing method based on sentiment analysis provided by any embodiment of the present invention is implemented.

[0019] The embodiment of the present invention obtains financial field review text data of a target date and inputs it into a hybrid neural network, so that the hybrid neural network automatically analyzes and processes the financial field review text data of the target date, obtains a sentiment analysis result of the financial field review text data of the target date, and generates financial market trend data of a target associated date according to the sentiment analysis result of the financial field review text data of the target date, thereby solving the problems of low data analysis efficiency and poor accuracy in the existing manual analysis and processing of financial field review data, and can realize automated analysis and processing of financial field sentiment data, improve the accuracy and efficiency of analysis and processing of financial field sentiment data, and thus improve the guidance and applicability of financial field sentiment data. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1is a flow chart of a data processing method based on sentiment analysis provided in Embodiment 1 of the present invention;

[0021] Figure 2 is a flow chart of a data processing method based on sentiment analysis provided by Embodiment 2 of the present invention;

[0022] Figure 3 It is a schematic diagram of a network structure of a convolutional neural network and a K-Max pooling layer fusion provided in the second embodiment of the present invention;

[0023] Figure 4 It is a schematic diagram of the structure of GRU;

[0024] Figure 5 is a schematic diagram of the structure of a hybrid neural network provided by Embodiment 2 of the present invention;

[0025] Figure 6 This is a schematic diagram of the effect of the comment sentiment index in the stock market field changing with date provided by the second embodiment of the present invention;

[0026] Figure 7 is a schematic diagram of a data processing device based on sentiment analysis provided by Embodiment 3 of the present invention;

[0027] Figure 8 A schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION

[0028] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention.

[0029] It should also be noted that, for ease of description, only the part relevant to the present invention but not all content is shown in the accompanying drawings. It should be mentioned before discussing exemplary embodiments in more detail that some exemplary embodiments are described as processing or methods depicted as flow charts. Although the flow chart describes each operation (or step) as sequential processing, many operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. When its operation is completed, the processing can be terminated, but it can also have additional steps not included in the accompanying drawings. The processing can correspond to methods, functions, procedures, subroutines, subprograms, etc.

[0030] The terms "first" and "second" and the like in the description, claims and drawings of the embodiments of the present invention are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but may include steps or units that are not listed.

[0031] Embodiment 1

[0032] Figure 1 This is a flowchart of a data processing method based on sentiment analysis provided by the first embodiment of the present invention. This embodiment is applicable to the case of automatically processing and analyzing financial field review data using a hybrid neural network model. The method can be executed by a financial field review device, which can be implemented by software and / or hardware and can generally be integrated in an electronic device. The electronic device can be a terminal device or a server device. The embodiment of the present invention does not limit the specific device type of the electronic device. Accordingly, Figure 1 As shown, the method includes the following operations:

[0033] S110. Obtaining financial field review text data on a target date.

[0034] The target date may be any date for generating or acquiring comment data in the financial field. It is understandable that the target date must be one of the historical dates. Optionally, the target date may be one or more of the historical dates. The comment text data in the financial field may be comment data generated in the financial field, such as comment data in the field of investment and financial management, or comment data in the stock market, etc. The data type may be text type data. The embodiment of the present invention does not limit the specific financial field and data content involved in the comment text data in the financial field.

[0035] In an embodiment of the present invention, financial field review text data of a target date can be obtained to analyze the products, services or markets in the financial field that the financial field review text data matches. Specifically, the financial field review text data can be obtained by directly obtaining the original text data source from a database, or it can be generated after collecting and processing Internet data in the financial field, for example, collecting expert commentary voice data, and performing voice-to-text processing on the collected data to obtain financial field review text data. As long as the financial field review text data of the target date can be obtained, the embodiment of the present invention does not limit the method for obtaining the financial field review text data.

[0036] S120: Input the financial field review text data into a hybrid neural network to obtain a sentiment analysis result of the financial field review text data on the target date.

[0037] Among them, the hybrid neural network can be a hybrid neural network whose network layer is constructed by different types of neural network models. The hybrid neural network can gather the advantages of multiple different types of neural networks and give full play to the advantages of artificial intelligence in data analysis and processing to automatically analyze and process the acquired source data. The sentiment analysis result can be the analysis result of the hybrid neural network on the sentiment of user comments contained in the input financial field review text data.

[0038] Accordingly, after obtaining the financial field review text data, there is no need to construct a professional dictionary to manually analyze the financial field review text data. The financial field review text data can be directly input as input data into a pre-trained hybrid neural network, so as to make full use of the powerful data processing and analysis capabilities of the hybrid neural network to automatically process and analyze the financial field review text data, specifically, to analyze and process the user comments contained in the financial field review text data, and obtain the sentiment analysis results matching the financial field review text data on the target date.

[0039] S130: Generate financial market trend data of the target associated date according to the sentiment analysis result of the financial field review text data of the target date.

[0040] The target associated date may be a date associated with the target date, and specifically may be one or more subsequent dates of the target date. For example, assuming that the target date is 2021.1.1, the target associated date may be 2021.1.2 or 2021.1.2-2021.1.4, etc. The embodiment of the present invention does not limit the specific date and time of the target associated date. Financial market trend data may be guidance data of financial products, services or markets corresponding to financial field commentary text data, and may be used to predict the development trend of the financial market.

[0041] In an embodiment of the present invention, after the hybrid neural network automatically analyzes and processes the financial field review text data to obtain the sentiment analysis result, the financial market trend data of the target associated date can be automatically generated according to the sentiment analysis result of the financial field review text data of the target date output by the hybrid neural network. It can be understood that the financial market trend data of the target associated date can reflect the development direction of the financial products, services or markets corresponding to the financial field review text data. Therefore, the financial products, services or markets corresponding to the financial field review text data can be updated on demand according to the generated financial market trend data of the target associated date.

[0042] In a specific example, assuming that the financial field review text data is the review data of a certain investment and financial management APP, the hybrid neural network can be used to output the sentiment analysis results of the APP users on the investment and financial management APP or the products and services provided by the APP for the financial field review text data. Exemplarily, the sentiment analysis results may include but are not limited to the operating experience of the APP, the user experience of the products provided by the APP, and the sentiment tendency analysis of the investment and financial management field. Furthermore, based on the sentiment analysis results output by the hybrid neural network, the financial market trend data of the investment and financial management APP or the products and services provided by the APP on the target association date can be further generated. The financial market trend data can be the update and improvement data of the investment and financial management APP in terms of user operation, or it can be the suggestion data for updating and iterating the investment products provided by the investment and financial management APP, or it can also be the data for analyzing and predicting the development trend of the investment field market.

[0043] In a specific example, the comment text data in the financial field can also be the comment data of investors in the stock market. In the Internet era, when the stock market fluctuates, investors often post emotional comments on the Internet based on their own investment conditions. At present, the relevant technologies mainly focus on the research on the correlation between investor emotions and stock characteristics, securities market indexes, management performance forecast strategies, open-end fund performance and incentive efficiency of incentive mechanisms, while the research on sentiment analysis of investor comments is relatively lacking. However, the sentiment data of investor comments can measure investor emotions, and further the sentiment data of stocks will reflect the sentiment of the stock market to a certain extent. Therefore, the comment data of investors in the stock market can be input into the hybrid neural network, and the hybrid neural network is used to quantitatively analyze the unstructured investor comment data, and the sentiment analysis results corresponding to the comment data of investors in the stock market are output to obtain the stock comment sentiment tendency data, and further generate the stock market trend data based on the stock comment sentiment tendency data, such as predicting the stock market trend of the next day based on the sentiment analysis results of the investor comment data on the day, and visually counting and displaying the stock market trend of the next day, which is used as reference data for investment decision-making, which is conducive to assisting the benign decision-making of securities investment users.

[0044] For example, most investor comment data are bullish or bearish. Securities investment users can obtain additional information about the stock market through the sentiment analysis results of investor comment data, and tend to be more bullish on stocks with a large number of shares. Accordingly, the investor comment data can be analyzed through a hybrid neural network to obtain the bullish and bearish sentiment analysis results, and further explore and predict the development trends of each stock based on the bullish and bearish sentiment analysis results, so as to provide reference support for securities investment users' decision-making.

[0045] It can be seen that compared with manual analysis, the automatic analysis and processing of financial field review text data through the hybrid neural network model can not only reduce the time and labor costs of data processing and improve the analysis and processing efficiency of financial field review text data, but also the hybrid neural network combining multiple artificial intelligence advantages can improve the accuracy of financial field review text data analysis and processing. At the same time, financial market trend data is generated based on the sentiment analysis results of the hybrid neural network output matching the financial field review text data. The financial market trend data is used as guiding data for products, services or markets in the financial field to make updated decisions on products, services or markets in the financial field, thereby promoting the healthy development of products, services or markets in the financial field.

[0046] The embodiment of the present invention obtains financial field review text data of a target date and inputs it into a hybrid neural network, so that the hybrid neural network automatically analyzes and processes the financial field review text data of the target date, obtains a sentiment analysis result of the financial field review text data of the target date, and generates financial market trend data of a target associated date according to the sentiment analysis result of the financial field review text data of the target date, thereby solving the problems of low data analysis efficiency and poor accuracy in the existing manual analysis and processing of financial field review data, and can realize automated analysis and processing of financial field sentiment data, improve the accuracy and efficiency of analysis and processing of financial field sentiment data, and thus improve the guidance and applicability of financial field sentiment data.

[0047] Embodiment 2

[0048] Figure 2 is a flowchart of a data processing method based on sentiment analysis provided by the second embodiment of the present invention. This embodiment is specific based on the above embodiment. In this embodiment, a specific optional implementation method of generating financial market trend data of a target associated date according to the sentiment analysis results of the financial field review text data of the target date and training the hybrid neural network model is provided. Figure 2 As shown, the method of this embodiment may include:

[0049] S210: Obtaining financial field review text data on a target date.

[0050] S220: Input the financial field review text data into a hybrid neural network to obtain a sentiment analysis result of the financial field review text data on the target date.

[0051] In an embodiment of the present invention, optionally, the hybrid neural network can be constructed by a variety of different neural network models such as Word2Vec language model, Convolutional Neural Networks (CNN), K-Max Pooling (K-MaxPooling, K maximum pooling) layer and Recurrent Neural Network (RNN). Optionally, the recurrent neural network can be, for example, a GRU (Gate Recurrent Unit, gated recurrent unit) network. Accordingly, the hybrid neural network can be specifically referred to as AT-KC&BG model (Attention based K-Max CNN and BiGRUModel).

[0052] Among them, the Word2Vec language model can use an unsupervised approach to learn semantic knowledge from a large amount of text corpus, and map words to real vectors with lower dimensions for distributed representation. After being processed by the Word2vec model, words with similar semantics also have similar geometric distances in the vector space, thus reflecting the semantic relevance between different words. Convolutional neural networks have fewer parameters than traditional neural networks and operate faster. The CNN network structure usually consists of an input layer, a convolutional layer, a pooling layer, and a fully connected layer. The K-Max pooling layer is a technology that globally searches for the top-k important element features. Compared with traditional pooling methods, it can retain word order features to the maximum extent. Figure 3 Schematic diagram of a network structure of a convolutional neural network and a K-Max pooling layer fusion provided by the second embodiment of the present invention. Figure 3 As shown in the figure, the data output by the convolutional layer of the convolutional neural network can be directly input into the K-Max pooling layer for pooling operation. Long Short-Term Memory (LSTM) is a network model modified from RNN. Due to the gradient vanishing or gradient exploding problems in the deep RNN during the back propagation and gradient descent calculation process. LSTM introduces a unit state to save the long-term state, and introduces a Gate mechanism to solve the problems that arise in the RNN during the back propagation and gradient descent calculation process, so as to better obtain the long-distance dependency information of text semantics. The LSTM network model contains three gates: input gate, forget gate, and output gate. GRU is a variant of LSTM network, such as Figure 4 The following is a schematic diagram of the structure of GRU. Compared with LSTM network, GRU has one less gate structure and a simpler structure. GRU can also solve the long dependency problem in RNN network, and its data processing effect is relatively ideal.

[0053] At present, although some relevant technical personnel have adopted neural networks to analyze and process comment data, the neural network models often adopted are relatively simple, and often have shortcomings such as being unable to effectively utilize word information in the context of the data or being weak in the ability to splice bidirectional fusion features. They are unable to combine feature extraction capabilities and capture long-distance dependencies and highlight the importance of keywords, resulting in weak data processing and analysis capabilities and unguaranteed accuracy. The embodiments of the present invention integrate multiple different models to construct a hybrid neural network, which can give full play to the data processing advantages of each network layer of the hybrid neural network and effectively solve the problem of low accuracy of using a single type of neural network to process comment data.

[0054] In an optional embodiment of the present invention, before obtaining the financial field review text data of the target date, the method may further include: obtaining financial field review text sample data; and training the hybrid neural network according to the financial field review text sample data.

[0055] Among them, the sample data of financial field review texts is also the sample data set of financial field review texts.

[0056] It is understandable that before using a hybrid neural network to automatically process and analyze financial field review text data, it is first necessary to train the hybrid neural network using sample data so that the hybrid neural network has the ability to automatically process and analyze financial field review text data. Therefore, financial field review text sample data can be obtained to train the hybrid neural network. Optionally, the original data source of the financial field review text can be obtained according to application requirements, and after screening and preprocessing the original data source, the financial field review text sample data that can be used to train the hybrid neural network can be obtained. Optionally, the hybrid neural network can be trained in a supervised manner using the financial field review text sample data. Therefore, the financial field review text sample data can be sample data with annotations. For example, assuming that the financial field review text sample data is stock review sample data, the bullish type of stock review can be labeled as 1, and the bearish type of stock review can be labeled as 0.

[0057] In an optional embodiment of the present invention, the training of the hybrid neural network according to the financial field review text sample data may include: converting the financial field review text sample data into word vector data through the Word2Vec language model of the hybrid neural network; inputting the word vector data into the BiGRU network layer of the hybrid neural network to extract the bidirectional semantic word order information of the word vector data; inputting the bidirectional semantic word order information into the KCNN (Knowledge-aware CNN) network layer of the hybrid neural network to extract the review sample features of the bidirectional semantic word order information; updating the weight value of the review sample feature through the attention mechanism of the hybrid neural network to obtain the updated review sample feature; inputting the updated review sample feature into the softmax classifier to obtain the sentiment analysis result of the financial field review text sample data; determining the training effect of the hybrid neural network according to the sentiment analysis result, and returning to execute the operation of obtaining the financial field review text sample data until it is determined that the training of the hybrid neural network is completed.

[0058] Among them, the bidirectional semantic word order information also includes the context semantic word order information. The comment sample features are the features extracted from the word vector data converted from the financial field comment text sample data. The updated comment sample features are the comment sample features that have a higher degree of influence on the sentiment analysis results calculated by the attention mechanism.

[0059] Figure 5 is a schematic diagram of the structure of a hybrid neural network provided by the second embodiment of the present invention. Specifically, Figure 5As shown, when the hybrid neural network is trained, the financial field review text sample data can be converted into word vector data through the Word2Vec language model of the hybrid neural network. In addition, in order to further improve the accuracy, the financial field review text sample data can also be converted into word vector data at the same time, and then the word vector data and the word vector data are simultaneously input into the BiGRU network layer of the hybrid neural network as input. Correspondingly, the BiGRU network layer of the hybrid neural network can extract the bidirectional semantic word order information included in the input vector data, and the bidirectional semantic word order information is also the semantic information with context time sequence. Optionally, the forward GRU network layer of the BiGRU network layer can be used to extract the forward semantic word order features, that is, the semantic word order features of the above text, and the backward GRU network layer of the BiGRU network layer can be used to extract the backward semantic word order features, that is, the semantic word order features of the following text. Finally, the extracted forward semantic word order features and the backward semantic word order features are spliced ​​to obtain the bidirectional semantic word order information including the context semantics of the comment text. Further, the obtained bidirectional semantic word order information can be input into the KCNN network layer of the hybrid neural network to extract the comment sample features of the bidirectional semantic word order information. In an embodiment of the present invention, optionally, the KCNN network layer can be composed of a set number of different convolution kernels and a K-Max pooling layer. Among them, the set number can be set according to actual needs, such as 3 or 5, etc., and the embodiment of the present invention does not limit the specific numerical value of the set number. Optionally, the convolution structure of each convolution kernel can be different to extract sentence lengths of different strengths. Further, the weight value of the comment sample feature is updated through the attention mechanism of the hybrid neural network, and the important comment sample features are screened to obtain the updated comment sample features, so as to input the updated comment sample features into the softmax classifier to obtain the sentiment analysis results of the financial field comment text sample data. If the Word2Vec language model only extracts a single type of vector, there is no need to perform other processing on the extracted features. If the Word2Vec language model extracts different types of vectors, such as word vectors and character vectors, the extracted features can be spliced ​​and fused before subsequent processing. After the hybrid neural network outputs the sentiment analysis results of the sample text data of financial field reviews, the loss value can be calculated through a preset loss function based on the output sentiment analysis results and the labeled data of the sample text data of financial field reviews to determine the training effect of the hybrid neural network. If the training effect of the hybrid neural network does not achieve the expected effect, the operation of obtaining the sample text data of financial field reviews can be returned to repeatedly train the hybrid neural network until it is determined that the training effect of the hybrid neural network achieves the expected effect and the training of the hybrid neural network is completed.

[0060] S230: Generate a comment sentiment index for the target date according to a sentiment analysis result of the financial field comment text data for the target date.

[0061] Among them, the comment sentiment index can reflect the user's positive or negative attitude towards the financial field being commented on.

[0062] Specifically, when generating the financial market trend data of the target associated date according to the sentiment analysis results of the financial field review text data of the target date, the review sentiment index of the target date can be first generated according to the sentiment analysis results of the financial field review text data of the target date. Optionally, the review sentiment index can be calculated based on the time unit of day or hour, etc., and the review sentiment index of each day or hour can be counted.

[0063] In an optional embodiment of the present invention, generating the review sentiment index of the target date according to the sentiment analysis result of the financial field review text data of the target date may include:

[0064] The review sentiment index for the target date is generated based on the following formula:

[0065]

[0066] Where BI represents the comment sentiment index, M bult represents the number of first reviews on the target date, M bear Indicates the number of second reviews for the target date.

[0067] Optionally, the first comment may be a positive comment, such as a bullish comment in a stock review, and the second comment may be a negative comment, such as a bearish comment in a stock review. Alternatively, the first comment may be a negative comment, and the second comment may be a positive comment. The embodiment of the present invention does not limit the comment types of the first comment and the second comment. Assuming that the first comment is a positive comment and the second comment is a negative comment, the size and positive and negative situation of the comment sentiment index can reflect the degree of positive and negative treatment of the user to the evaluated financial field. It can be understood that when the comment sentiment index is a positive number, the larger the value of the comment sentiment index, the more optimistic the user is about the evaluated financial field; conversely, when the comment sentiment index is a negative number, the larger the value of the comment sentiment index, the more pessimistic the user is about the evaluated financial field.

[0068] By determining the comment sentiment index of the target date as mentioned above, the comment sentiment index of consecutive dates can be summarized and statistically analyzed, and the development trend or update needs of the financial field evaluated by users can be accurately predicted and analyzed from the perspective of user evaluation.

[0069] Figure 6 2 is a schematic diagram of the effect of the stock market comment sentiment index changing with date provided by the second embodiment of the present invention. In a specific example, Figure 6As shown in the figure, when the comment sentiment index is greater than 0, it indicates that the user is optimistic about the development of the stock market. When the comment sentiment index is less than 0, it indicates that the user is pessimistic about the development of the stock market. By comparing with the actual stock price increase and decrease data of the stock market, it can be found that the distribution of the comment sentiment index in the stock market field is basically consistent with the corresponding stock price increase and decrease. It can be seen that the trend of the comment sentiment index in the stock market field changing with the date can accurately reflect the development of stocks to a certain extent.

[0070] S240: Generate financial market trend data for the target associated date according to the comment sentiment index for the target date.

[0071] Since the comment sentiment index can accurately reflect the development trend or update demand of the financial field evaluated by the user to a certain extent, after obtaining the comment sentiment index, the financial market trend data of the target associated date can be generated according to the comment sentiment index of the target date.

[0072] In a specific example, a comment sentiment index can be generated based on the user's evaluation data on the APP's operating experience on the same day or within a certain period of history. The comment sentiment index can reflect the user's demand for APP updates. Further, based on the comment sentiment data, APP update guidance data for a preset APP update date can be generated to indicate which functions or data of the APP need to be updated. Alternatively, a comment sentiment index can be generated based on the user's comment data on a certain stock on the same day or within a certain period of history. The comment sentiment index can reflect the user's attitude towards the development of the stock. Further, based on the comment sentiment data, the development trend of the stock the next day can be generated for user investment reference.

[0073] S250, generating the financial market sentiment trend data for the set consecutive dates according to the comment sentiment index for the set consecutive dates and a preset financial market moving average.

[0074] The set continuous dates may be continuous historical dates selected according to actual needs. The preset financial market moving average may be the moving average of the financial field where the financial field comment text data is located. The financial market sentiment trend data may be sentiment trend data of the financial market, especially the financial securities market, on continuous dates.

[0075] Optionally, if the financial field commentary text data is financial securities field commentary text data, after generating the financial market trend data of the target associated date based on the commentary sentiment index of the target date, it is also possible to further generate the financial market sentiment trend data of the set continuous dates based on the commentary sentiment index of the set continuous dates combined with the preset financial market moving average.

[0076] Taking the stock market as an example, when investors conduct investment transactions, most of the time they influence the buying and selling actions of stocks based on the emotional changes in a continuous time period. Therefore, it is necessary to construct an index that can reflect the emotional changes over a period of time. Moving Average (MA) is a technical indicator that uses statistical analysis methods to average the securities prices (indexes) within a certain period of time and connect the average values ​​at different times to form an MA to observe the trend of securities price changes. Based on the single-day comment sentiment index obtained by sentiment analysis of stock comment texts, the moving average theory is introduced, and the line of set continuous dates (such as 10 days) is taken to represent the trend of investor sentiment changes over a certain period of time. The average sentiment indexes of different time periods are connected into a line to form the financial market sentiment trend data of set continuous dates. Specifically, the expression of the moving average can be: MA = (C1 + C2 + C3 + ... + Cn) / N. Among them, C1, C2, C3...Cn represent the closing prices of the stock market on the first day, the second day, the third day...the Nth day, respectively, and N represents the number of days, that is, the set continuous date. C1, C2, C3...Cn can be replaced by BI1, BI2, BI3...BIn, that is, the comment sentiment index of the first day, the second day, the third day...the Nth day, to obtain the stock market sentiment trend data for N consecutive days. Furthermore, the closing price of the Shanghai Composite Index for N days and the comment sentiment index for the same N days are subjected to z-score) (z-score) standardization and then compared. It can be found that the data distribution of the two is strongly correlated, that is, there is a strong correlation between the comment sentiment index and the stock market closing price, which can be used to predict the development trend of the stock market.

[0077] The above technical solution generates word vector data through the Word2Vec language model of the hybrid neural network, and uses the BiGRU neural network to extract bidirectional semantics and word order information, avoiding the impact of polysemy on the model. In the KCNN neural network of the hybrid neural network, a variety of different convolution kernels and K-Max pooling functions are used to extract features, and the attention mechanism is introduced to identify sentiment tendencies in the financial field, highlighting the importance of key features, significantly improving the prediction accuracy and efficiency of the sentiment analysis model of financial comments, thereby improving the guidance and applicability of sentiment data in the financial field.

[0078] It should be noted that any arrangement and combination of the technical features in the above embodiments also falls within the protection scope of the present invention.

[0079] Embodiment 3

[0080] Figure 7 is a schematic diagram of a data processing device based on sentiment analysis provided by Embodiment 3 of the present invention. Figure 7As shown, the device includes: a comment text data acquisition module 310, a sentiment analysis result acquisition module 320 and a trend data generation module 330, wherein:

[0081] A review text data acquisition module 310 is used to acquire financial field review text data of a target date;

[0082] The sentiment analysis result acquisition module 320 inputs the financial field review text data into the hybrid neural network to obtain the sentiment analysis result of the financial field review text data of the target date;

[0083] The trend data generating module 330 is used to generate the financial market trend data of the target associated date according to the sentiment analysis result of the financial field review text data of the target date.

[0084] The embodiment of the present invention obtains financial field review text data of a target date and inputs it into a hybrid neural network, so that the hybrid neural network automatically analyzes and processes the financial field review text data of the target date, obtains a sentiment analysis result of the financial field review text data of the target date, and generates financial market trend data of a target associated date according to the sentiment analysis result of the financial field review text data of the target date, thereby solving the problems of low data analysis efficiency and poor accuracy in the existing manual analysis and processing of financial field review data, and can realize automated analysis and processing of financial field sentiment data, improve the accuracy and efficiency of analysis and processing of financial field sentiment data, and thus improve the guidance and applicability of financial field sentiment data.

[0085] Optionally, the trend data generation module 330 is specifically used to: generate a comment sentiment index for the target date based on the sentiment analysis results of the financial field comment text data for the target date; generate financial market trend data for the target associated date based on the comment sentiment index for the target date; wherein the financial field comment text data includes financial securities field comment text data, and the device also includes a sentiment trend data generation module for generating the financial market sentiment trend data for the set consecutive dates based on the comment sentiment index for the set consecutive dates and a preset financial market moving average.

[0086] Optionally, the trend data generating module 330 is specifically used to generate the comment sentiment index of the target date based on the following formula: Where BI represents the comment sentiment index, M bult represents the number of first reviews on the target date, M bear Indicates the number of second reviews for the target date.

[0087] Optionally, the device further includes: a sample data acquisition module for acquiring sample data of financial field review text; and a network training module for training the hybrid neural network according to the sample data of financial field review text.

[0088] Optionally, the network training module is specifically used to: convert the financial field review text sample data into word vector data through the Word2Vec language model of the hybrid neural network; input the word vector data into the BiGRU network layer of the hybrid neural network to extract the bidirectional semantic word order information of the word vector data; input the bidirectional semantic word order information into the KCNN network layer of the hybrid neural network to extract the comment sample features of the bidirectional semantic word order information; update the weight value of the comment sample features through the attention mechanism of the hybrid neural network to obtain updated comment sample features; input the updated comment sample features into the softmax classifier to obtain the sentiment analysis results of the financial field review text sample data; determine the training effect of the hybrid neural network according to the sentiment analysis results, and return to execute the operation of obtaining the financial field review text sample data until it is determined that the training of the hybrid neural network is completed.

[0089] Optionally, the KCNN network layer is composed of a set number of different convolution kernels and K-Max pooling layers.

[0090] Optionally, the network training module is specifically used to: use the forward GRU network layer of the BiGRU network layer to extract forward semantic word order features; use the backward GRU network layer of the BiGRU network layer to extract backward semantic word order features; and concatenate the forward semantic word order features with the backward semantic word order features to obtain bidirectional semantic word order information including the contextual semantics of the comment text.

[0091] The above-mentioned data processing device based on sentiment analysis can execute the data processing method based on sentiment analysis provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not fully described in this embodiment, please refer to the data processing method based on sentiment analysis provided by any embodiment of the present invention.

[0092] Since the data processing device based on sentiment analysis introduced above is a device that can execute the data processing method based on sentiment analysis in the embodiment of the present invention, based on the data processing method based on sentiment analysis introduced in the embodiment of the present invention, the technical personnel in the field can understand the specific implementation of the data processing device based on sentiment analysis in this embodiment and its various variations, so how the data processing device based on sentiment analysis implements the data processing method based on sentiment analysis in the embodiment of the present invention is not introduced in detail here. As long as the technical personnel in the field implement the device adopted by the data processing method based on sentiment analysis in the embodiment of the present invention, it belongs to the scope of protection of this application.

[0093] Embodiment 4

[0094] Figure 8 A schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention. Figure 8 A block diagram of an exemplary electronic device 12 suitable for use in implementing embodiments of the present invention is shown. Figure 8 The electronic device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0095] like Figure 8 As shown, the electronic device 12 is in the form of a general purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors 16, a memory 28, and a bus 18 that connects various system components (including the memory 28 and the processor 16).

[0096] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. For example, these architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.

[0097] The electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 12, including volatile and non-volatile media, removable and non-removable media.

[0098] The memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 8 not shown, usually called a "hard drive"). Although Figure 8 Not shown in the figure, a disk drive for reading and writing a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing a removable non-volatile optical disk (e.g., a read-only optical disk (Compact Disc-Read Only Memory, CD-ROM), a digital video disk (Digital Video Disc-Read Only Memory, DVD-ROM) or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.

[0099] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods of the embodiments described herein.

[0100] The electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), one or more devices that enable a user to interact with the electronic device 12, and / or any device that enables the electronic device 12 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may be performed through an input / output (I / O) interface 22. Furthermore, the electronic device 12 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN) and / or a public network, such as the Internet) through a network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 through the bus 18. It should be understood that although Figure 8Not shown, other hardware and / or software modules may be used in conjunction with the electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, (Redundant Arrays of Independent Disks, RAID) systems, tape drives, and data backup storage systems.

[0101] The processor 16 executes various functional applications and data processing by running the program stored in the memory 28, thereby realizing the data processing method based on sentiment analysis provided by the embodiment of the present invention: obtaining financial field review text data of the target date; inputting the financial field review text data into the hybrid neural network to obtain the sentiment analysis result of the financial field review text data of the target date; generating the financial market trend data of the target associated date according to the sentiment analysis result of the financial field review text data of the target date.

[0102] Embodiment 5

[0103] Embodiment 5 of the present invention further provides a computer storage medium storing a computer program, wherein the computer program, when executed by a computer processor, is used to execute the data processing method based on sentiment analysis described in any of the above embodiments of the present invention: obtaining financial field review text data of a target date; inputting the financial field review text data into a hybrid neural network to obtain a sentiment analysis result of the financial field review text data of the target date; and generating financial market trend data of a target associated date based on the sentiment analysis result of the financial field review text data of the target date.

[0104] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM, or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, a device or a device or used in combination with it.

[0105] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0106] The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wire, optical cable, radio frequency (RF), etc., or any suitable combination of the foregoing.

[0107] Computer program code for performing the operations of the present invention may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0108] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A data processing method based on sentiment analysis, characterized in that: include: Obtain text data of financial field reviews on the target date; Inputting the financial field review text data into a hybrid neural network to obtain sentiment analysis results of the financial field review text data on the target date, wherein the hybrid neural network is a hybrid neural network whose network layer is constructed by different types of neural network models, and is composed of a Word2Vec language model, a convolutional neural network, a K-max pooling layer, and a recurrent neural network; Generate financial market trend data for a target associated date based on sentiment analysis results of the financial field review text data for the target date, wherein the financial market trend data is guidance data for financial products, services or markets corresponding to the financial field review text data, and is used to predict the development trend of the financial market; Before obtaining the financial field review text data of the target date, the method further includes: Obtain sample data of financial review texts; Training the hybrid neural network according to the financial field review text sample data; The obtaining of financial field review text sample data includes: obtaining an original data source of financial field review text according to application requirements, and screening and preprocessing the original data source to obtain the financial field review text sample data for training the hybrid neural network; The step of training the hybrid neural network according to the financial field review text sample data includes: The financial field review text sample data is converted into word vector data through the Word2Vec language model of the hybrid neural network; Inputting the word vector data into the BiGRU network layer of the hybrid neural network to extract bidirectional semantic word order information of the word vector data; Inputting the bidirectional semantic word order information into the KCNN network layer of the hybrid neural network to extract the comment sample features of the bidirectional semantic word order information; the KCNN network layer is composed of a set number of different convolution kernels and a K-Max pooling layer; Updating the weight value of the comment sample feature through the attention mechanism of the hybrid neural network to obtain an updated comment sample feature; Inputting the updated comment sample features into a softmax classifier to obtain sentiment analysis results of the financial field comment text sample data; Determining the training effect of the hybrid neural network according to the sentiment analysis result, and returning to execute the operation of obtaining the sample data of the financial field review text until it is determined that the training of the hybrid neural network is completed; Wherein, determining the training effect of the hybrid neural network according to the sentiment analysis result includes: calculating the loss value through a preset loss function according to the output sentiment analysis result and the annotation data of the sample data of the financial field review text, so as to determine the training effect of the hybrid neural network; The step of inputting the word vector data into the BiGRU network layer of the hybrid neural network to extract bidirectional semantic word order information of the word vector data includes: The forward GRU network layer of the BiGRU network layer is used to extract forward semantic word order features; The backward GRU network layer of the BiGRU network layer is used to extract backward semantic word order features; The forward semantic word order feature is concatenated with the backward semantic word order feature to obtain bidirectional semantic word order information including the contextual semantics of the comment text.

2. The method according to claim 1, characterized in that The generating of financial market trend data of the target associated date according to the sentiment analysis result of the financial field review text data of the target date includes: Generate a comment sentiment index for the target date based on a sentiment analysis result of the financial field comment text data for the target date; Generating financial market trend data for the target associated date based on the comment sentiment index for the target date; Wherein, the financial field review text data includes financial securities field review text data, and the method further includes: The financial market sentiment trend data for the set continuous dates are generated according to the comment sentiment index for the set continuous dates and the preset financial market moving average.

3. The method according to claim 2, characterized in that Generating the comment sentiment index of the target date according to the sentiment analysis result of the financial field comment text data of the target date includes: The review sentiment index for the target date is generated based on the following formula: Where BI represents the comment sentiment index, M bult represents the number of first reviews on the target date, M bear Indicates the number of second reviews for the target date.

4. A data processing device based on sentiment analysis, characterized in that: include: A review text data acquisition module is used to acquire review text data in the financial field on a target date; The sentiment analysis result acquisition module inputs the financial field review text data into a hybrid neural network to obtain the sentiment analysis result of the financial field review text data of the target date, wherein the hybrid neural network is a hybrid mode neural network whose network layer is constructed by different types of neural network models, and is composed of a Word2Vec language model, a convolutional neural network, a K-max pooling layer, and a recurrent neural network; A trend data generation module, used to generate financial market trend data of a target associated date according to the sentiment analysis result of the financial field review text data of the target date, wherein the financial market trend data is the guidance data of the financial products, services or markets corresponding to the financial field review text data, and is used to predict the development trend of the financial market; The device also includes: The sample data acquisition module is used to obtain sample data of financial review texts; A network training module, used for training the hybrid neural network according to the sample data of the financial field review text; The sample data acquisition module is specifically used to obtain the original data source of financial field review text according to application requirements, and obtain the financial field review text sample data for training the hybrid neural network after screening and preprocessing the original data source; The network training module is specifically used for: converting the financial field review text sample data into word vector data through the Word2Vec language model of the hybrid neural network; inputting the word vector data into the BiGRU network layer of the hybrid neural network to extract the bidirectional semantic word order information of the word vector data; inputting the bidirectional semantic word order information into the KCNN network layer of the hybrid neural network to extract the review sample features of the bidirectional semantic word order information, and the KCNN network layer is composed of a set number of different convolution kernels and K-Max pooling layers; updating the weight value of the review sample feature through the attention mechanism of the hybrid neural network to obtain the updated review sample feature; inputting the updated review sample feature into the softmax classifier to obtain the sentiment analysis result of the financial field review text sample data; determining the training effect of the hybrid neural network according to the sentiment analysis result, and returning to perform the operation of obtaining the financial field review text sample data until it is determined that the training of the hybrid neural network is completed; wherein, determining the training effect of the hybrid neural network according to the sentiment analysis result includes: calculating the loss value through a preset loss function according to the output sentiment analysis result and the annotation data of the financial field review text sample data to determine the training effect of the hybrid neural network; The network training module is also used to: use the forward GRU network layer of the BiGRU network layer to extract forward semantic word order features; use the backward GRU network layer of the BiGRU network layer to extract backward semantic word order features; splice the forward semantic word order features with the backward semantic word order features to obtain bidirectional semantic word order information including the contextual semantics of the comment text.

5. An electronic device, characterized in that: The electronic device comprises: one or more processors; a storage device for storing one or more computer programs; When the one or more computer programs are executed by the one or more processors, the one or more processors implement the data processing method based on sentiment analysis as described in any one of claims 1 to 3 when executing the computer programs.

6. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the data processing method based on sentiment analysis as described in any one of claims 1 to 3 is implemented.

Citation Information

Patent Citations

  • Emotion analysis method and system based on real-time data in application

    CN110390097A

  • Online comment sentiment classification method based on dual-channel hybrid neural network

    CN112287106A

Cited By

  • Intelligent message sharing across related devices

    US20250055819A1