Emotion classification model training method, emotion prediction method and device

By introducing the above word vector and the following word vector into the market sentiment classification model and calculating the second word segment vector, the problem of ignoring text association relationships in traditional technology is solved, and the accuracy of market sentiment classification is improved.

CN113988456BActive Publication Date: 2024-11-22INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111329185.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-10
Publication Date
2024-11-22
Estimated Expiration
2041-11-10

AI Technical Summary

Technical Problem

In traditional technology, the market sentiment classification model only considers the text data itself when extracting text features, and ignores the correlation relationship between texts, resulting in a low accuracy of market sentiment classification.

Method used

By obtaining the above word vector and the following word vector of text participle, calculate the second word participle vector, and train the emotion classification model with the first word participle vector, considering the correlation between texts.

Benefits of technology

It improves the accuracy of market sentiment classification and enhances the model's ability to predict market sentiment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113988456B_ABST
    Figure CN113988456B_ABST
Patent Text Reader

Abstract

The present application relates to a sentiment classification model training method, sentiment prediction method, device, computer equipment and storage medium. The present application relates to the field of artificial intelligence and can be used in the field of financial technology or other related fields. The sentiment classification model training method includes: obtaining sample text data of sample participants and sample labels; inputting the sample text data into the text data classification model to be trained, and using the text data classification model to determine the first segmentation vector corresponding to the text segmentation contained in the sample text data, as well as the previous word vector and the following word vector; obtaining the second segmentation vector corresponding to the text segmentation according to the previous word vector and the following word vector; determining the market sentiment prediction probability based on the first segmentation vector and the second segmentation vector; training the text data classification model according to the difference loss between the market sentiment prediction probability and the sample label to obtain a sentiment classification model. The adoption of this method can improve the accuracy of market sentiment classification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to an emotion classification model training method, emotion prediction method, device, computer equipment, storage medium and computer program product. Background Art

[0002] With the development of artificial intelligence technology, a method of using artificial intelligence technology to analyze market sentiment has emerged. This method trains the model by collecting text data related to market participants and the corresponding market sentiment data, so that the market sentiment can be predicted through the trained model using text data.

[0003] In traditional technology, after collecting text data, it is necessary to first extract features from the collected text data, such as extracting word vectors through a feature extraction model, so as to obtain text features for model training. However, this text feature extraction method only considers the characteristics of the text data itself, but lacks consideration of the correlation between texts. Therefore, the accuracy of the trained model in market sentiment classification is low. Summary of the invention

[0004] Based on this, it is necessary to provide a sentiment classification model training method, sentiment prediction method, device, computer equipment, storage medium and computer program product that can improve the accuracy of market sentiment classification in response to the above technical problems.

[0005] In a first aspect, the present application provides a method for training an emotion classification model, the method comprising:

[0006] Acquire sample text data corresponding to the sample participants, and acquire sample labels corresponding to the sample text data; the sample labels are used to identify the market sentiment type corresponding to the sample text data;

[0007] Input the sample text data into a text data classification model to be trained, and use the text data classification model to determine a first word segmentation vector corresponding to a text word contained in the sample text data, as well as a previous word vector and a following word vector corresponding to the text word segmentation;

[0008] Obtaining a second word segmentation vector corresponding to the text word segmentation according to the previous word vector and the following word vector corresponding to the text word segmentation;

[0009] Determine the market sentiment prediction probability corresponding to the sample text data based on the first word segmentation vector and the second word segmentation vector;

[0010] The text data classification model is trained according to the difference loss between the market sentiment prediction probability and the sample label to obtain a sentiment classification model.

[0011] In one of the embodiments, the number of the previous word vectors and the following word vectors corresponding to the text segmentation is multiple; the obtaining of the second word segmentation vector corresponding to the text segmentation based on the previous word vectors and the following word vectors corresponding to the text segmentation includes: obtaining a previous mean vector corresponding to the text segmentation based on the multiple previous word vectors corresponding to the text segmentation, and obtaining a following mean vector corresponding to the text segmentation based on the multiple following word vectors corresponding to the text segmentation; obtaining a first space mapping vector corresponding to the previous mean vector, and obtaining a second space mapping vector corresponding to the following mean vector; obtaining the second word segmentation vector corresponding to the text segmentation based on the first space mapping vector and the second space mapping vector.

[0012] In one embodiment, the obtaining of the first spatial mapping vector corresponding to the previous context mean vector and the obtaining of the second spatial mapping vector corresponding to the following context mean vector include: obtaining preset spatial mapping transformation information; using the spatial mapping transformation information to perform spatial mapping transformations on the previous context mean vector and the following context mean vector, respectively, to obtain the first spatial mapping vector and the second spatial mapping vector, respectively; the obtaining of the second word segmentation vector corresponding to the text word segmentation based on the first spatial mapping vector and the second spatial mapping vector includes: performing a difference processing between the second spatial mapping vector and the first spatial mapping vector, to obtain the second word segmentation vector corresponding to the text word segmentation.

[0013] In one of the embodiments, determining the market sentiment prediction probability corresponding to the sample text data based on the first word segmentation vector and the second word segmentation vector includes: obtaining the vector mean of the first word segmentation vector and the second word segmentation vector, and using the vector mean as the target word segmentation vector corresponding to the text segmentation; obtaining sample text features corresponding to the sample text data according to the target word segmentation vector corresponding to the text segmentation; and determining the market sentiment prediction probability corresponding to the sample text data according to the sample text features.

[0014] In one of the embodiments, before inputting the sample text data into the text data classification model to be trained, it also includes: obtaining the initial text segmentation contained in the sample text data according to a preset sentence segmentation corpus; obtaining a preset stop word corpus, and using the stop word corpus to filter the initial text segmentation to obtain the text segmentation contained in the sample text data; inputting the sample text data into the text data classification model to be trained includes: inputting the text segmentation contained in the sample text data into the text data classification model to be trained.

[0015] In one embodiment, the obtaining of sample text data corresponding to the sample participants includes: obtaining sample news data corresponding to the sample participants, and using the sample news data as the sample text data; and / or obtaining sample video data corresponding to the sample participants, extracting corresponding audio data from the sample video data to obtain sample audio data; and using text data corresponding to the sample audio data as the sample text data.

[0016] In a second aspect, the present application also provides a method for predicting emotions, the method comprising:

[0017] Obtaining participant text data for market participants collected within a preset time period;

[0018] The text data of the participant is input into a sentiment classification model, and the market sentiment type corresponding to the market participant is output through the sentiment classification model; the sentiment classification model is obtained through the sentiment classification model training method as described above.

[0019] In a third aspect, the present application further provides a device for training an emotion classification model, the device comprising:

[0020] A sample data acquisition module is used to acquire sample text data corresponding to a sample participant, and acquire a sample label corresponding to the sample text data; the sample label is used to identify the market sentiment type corresponding to the sample text data;

[0021] A first vector acquisition module, used for inputting the sample text data into a text data classification model to be trained, and using the text data classification model to determine a first word segmentation vector corresponding to a text word contained in the sample text data, as well as a previous word vector and a following word vector corresponding to the text word segmentation;

[0022] A second vector acquisition module, used for obtaining a second word segmentation vector corresponding to the text word segmentation according to a previous word vector and a following word vector corresponding to the text word segmentation;

[0023] A prediction probability acquisition module, used to determine the market sentiment prediction probability corresponding to the sample text data based on the first word segmentation vector and the second word segmentation vector;

[0024] The classification model training module is used to train the text data classification model according to the difference loss between the market sentiment prediction probability and the sample label to obtain a sentiment classification model.

[0025] In a fourth aspect, the present application further provides an emotion prediction device, the device comprising:

[0026] A predictive text acquisition module, used to acquire participant text data for market participants collected within a preset time period;

[0027] The market sentiment prediction module is used to input the text data of the participant into the sentiment classification model, and output the market sentiment type corresponding to the text data of the participant through the sentiment classification model; the sentiment classification model is obtained through the sentiment classification model training method as described above.

[0028] In a fifth aspect, the present application further provides a computer device, the computer device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the following steps when executing the computer program:

[0029] Acquire sample text data corresponding to the sample participants, and acquire sample labels corresponding to the sample text data; the sample labels are used to identify the market sentiment type corresponding to the sample text data;

[0030] Input the sample text data into a text data classification model to be trained, and use the text data classification model to determine a first word segmentation vector corresponding to a text word contained in the sample text data, as well as a previous word vector and a following word vector corresponding to the text word segmentation;

[0031] Obtaining a second word segmentation vector corresponding to the text word segmentation according to the previous word vector and the following word vector corresponding to the text word segmentation;

[0032] Determine the market sentiment prediction probability corresponding to the sample text data based on the first word segmentation vector and the second word segmentation vector;

[0033] The text data classification model is trained according to the difference loss between the market sentiment prediction probability and the sample label to obtain a sentiment classification model.

[0034] Or implement the following steps:

[0035] Obtaining participant text data for market participants collected within a preset time period;

[0036] The text data of the participant is input into a sentiment classification model, and the sentiment classification model outputs the market sentiment type corresponding to the text data of the participant; the sentiment classification model is obtained by the sentiment classification model training method as described above.

[0037] In a sixth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0038] Acquire sample text data corresponding to the sample participants, and acquire sample labels corresponding to the sample text data; the sample labels are used to identify the market sentiment type corresponding to the sample text data;

[0039] Input the sample text data into a text data classification model to be trained, and use the text data classification model to determine a first word segmentation vector corresponding to a text word contained in the sample text data, as well as a previous word vector and a following word vector corresponding to the text word segmentation;

[0040] Obtaining a second word segmentation vector corresponding to the text word segmentation according to the previous word vector and the following word vector corresponding to the text word segmentation;

[0041] Determine the market sentiment prediction probability corresponding to the sample text data based on the first word segmentation vector and the second word segmentation vector;

[0042] The text data classification model is trained according to the difference loss between the market sentiment prediction probability and the sample label to obtain a sentiment classification model.

[0043] Or implement the following steps:

[0044] Obtaining participant text data for market participants collected within a preset time period;

[0045] The text data of the participant is input into a sentiment classification model, and the sentiment classification model outputs the market sentiment type corresponding to the text data of the participant; the sentiment classification model is obtained by the sentiment classification model training method as described above.

[0046] In a seventh aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0047] Acquire sample text data corresponding to the sample participants, and acquire sample labels corresponding to the sample text data; the sample labels are used to identify the market sentiment type corresponding to the sample text data;

[0048] Input the sample text data into a text data classification model to be trained, and use the text data classification model to determine a first word segmentation vector corresponding to a text word contained in the sample text data, as well as a previous word vector and a following word vector corresponding to the text word segmentation;

[0049] Obtaining a second word segmentation vector corresponding to the text word segmentation according to the previous word vector and the following word vector corresponding to the text word segmentation;

[0050] Determine the market sentiment prediction probability corresponding to the sample text data based on the first word segmentation vector and the second word segmentation vector;

[0051] The text data classification model is trained according to the difference loss between the market sentiment prediction probability and the sample label to obtain a sentiment classification model.

[0052] Or implement the following steps:

[0053] Obtaining participant text data for market participants collected within a preset time period;

[0054] The text data of the participant is input into a sentiment classification model, and the sentiment classification model outputs the market sentiment type corresponding to the text data of the participant; the sentiment classification model is obtained by the sentiment classification model training method as described above.

[0055] The above-mentioned emotion classification model training method, emotion prediction method, device, computer equipment, storage medium and computer program product obtain sample text data corresponding to sample participants and obtain sample labels corresponding to the sample text data; the sample labels are used to identify the market emotion type corresponding to the sample text data; the sample text data is input into the text data classification model to be trained, and the text data classification model is used to determine the first word segmentation vector corresponding to the text segmentation contained in the sample text data, as well as the previous word vector and the following word vector corresponding to the text segmentation; according to the previous word vector and the following word vector corresponding to the text segmentation, the second word segmentation vector corresponding to the text segmentation is obtained; based on the first word segmentation vector and the second word segmentation vector, the market emotion prediction probability corresponding to the sample text data is determined; the text data classification model is trained according to the difference loss between the market emotion prediction probability and the sample label to obtain the emotion classification model. In the sentiment classification model training method provided by the present application, in the process of extracting text features from sample text data, the first word segmentation vector corresponding to the text segmentation is obtained, and the previous word vector and the following word vector corresponding to the text segmentation are also obtained, so that the second word segmentation vector corresponding to the text segmentation is determined by using the previous word vector and the following word vector, and the first word segmentation vector and the second word segmentation vector are further used to train the sentiment classification model. Compared with the traditional technology in which the model training only considers the first word segmentation vector of the text data itself, the present application also introduces the second word segmentation vector obtained by the previous word vector and the following word vector for model training, thereby considering the correlation between texts, so the trained model can improve the accuracy of market sentiment classification. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 A schematic diagram of a flow chart of a method for training a sentiment classification model in one embodiment;

[0057] Figure 2 A schematic diagram of a process of obtaining a second word segmentation vector corresponding to a text word segmentation in one embodiment;

[0058] Figure 3 A schematic diagram of a process for determining a market sentiment prediction probability in one embodiment;

[0059] Figure 4 is a flow chart of a method for predicting emotions in one embodiment;

[0060] Figure 5 A flowchart of a transaction processing method in an application example;

[0061] Figure 6 It is a schematic diagram of the structure of an account management device in an application example;

[0062] Figure 7 is a structural block diagram of a sentiment classification model training device in one embodiment;

[0063] Figure 8 is a structural block diagram of an emotion prediction device in one embodiment;

[0064] Fig. 9 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0065] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is 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 application and are not used to limit the present application.

[0066] In one embodiment, Figure 1 As shown, a method for training an emotion classification model is provided. This embodiment uses the method applied to a server as an example. It can be understood that the method can also be applied to a terminal, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. The server can be implemented as an independent server or a server cluster composed of multiple servers. In this embodiment, the method includes the following steps:

[0067] Step S101, obtaining sample text data corresponding to the sample participants, and obtaining sample labels corresponding to the sample text data; the sample labels are used to identify the market sentiment type corresponding to the sample text data.

[0068] Among them, sample participants refer to participants who can participate in market economic activities, such as various market institutions or enterprises, etc. Market sentiment refers to the comprehensive display of the views of all market participants in the overall market. The market sentiment can include multiple types to reflect different market development directions, and sample text data refers to text data related to sample participants. The text data can be obtained by searching and collecting based on sample participants and used for new model training. For example, a sample participant can be a certain enterprise, and its corresponding sample text data can be retrieved by using the enterprise name of the enterprise as a keyword, and the retrieved text data can be used as sample text data for model training. The sample label refers to the label for the type of market sentiment reflected by the sample text data. The sample label can be of multiple types, each used to represent different types of market sentiment.

[0069] Specifically, the server can pre-collect a variety of text data related to market participants for model training as sample text data, and can also obtain sample labels corresponding to the above sample text data for characterizing the market sentiment type corresponding to the sample text data. The sample label can be obtained by the user labeling the market sentiment type of the above sample text data in advance, and inputting it into the server, so that the server can obtain sample text data for model training and the sample label corresponding to the sample text data.

[0070] Step S102, inputting the sample text data into the text data classification model to be trained, and using the text data classification model to determine the first word segmentation vector corresponding to the text word contained in the sample text data, as well as the previous word vector and the following word vector corresponding to the text word.

[0071] The text data classification model refers to an untrained sentiment classification model. The present application can train the text data classification model to realize the classification prediction of market sentiment types, and the text segmentation refers to the segmentation corresponding to the sample text data input into the text data classification model. The text segmentation can be obtained by the text data classification model performing segmentation processing on the text data, or the server can perform segmentation processing on the sample text data in advance and then input it into the text data classification model. The first segmentation vector refers to the segmentation vector corresponding to the text segmentation, which can be realized by the text feature extraction module carried in the text data classification model, and the preceding word vector and the following word vector corresponding to the text segmentation respectively represent the word vector corresponding to the preceding text in the text segmentation and the word vector corresponding to the following text in the text segmentation.

[0072] Specifically, after the server obtains the text data, it can extract text features for each text segmentation carried in the text data, thereby obtaining the word vector corresponding to each text segmentation as the first segmentation vector of the text segmentation, and determine the previous segmentation and the following segmentation corresponding to each text segmentation according to the order between the sequential segmentations, thereby determining the word vectors corresponding to the previous segmentation and the following segmentation, as the previous segmentation vector and the following segmentation vector, respectively.

[0073] For example, the input sample text data consists of word segmentation A, word segmentation B and word segmentation C, and the order of word segmentation is also word segmentation A-word segmentation B-word segmentation C. The server can obtain the word segmentation vector corresponding to each text segmentation respectively. Taking word segmentation B as an example, the word vector corresponding to word segmentation B obtained by the server can be used as the first word segmentation vector of word segmentation B, and the word vector corresponding to word segmentation A is used as the previous word vector of word segmentation B, and the word vector corresponding to word segmentation C is used as the following word vector of word segmentation B.

[0074] Step S103, obtaining a second word segmentation vector corresponding to the text word segmentation according to the previous word vector and the following word vector corresponding to the text word segmentation.

[0075] The second word segmentation vector refers to the word vector corresponding to the text segmentation obtained by the previous word vector and the following word vector of the text segmentation. After obtaining the previous word vector and the following word vector corresponding to the text segmentation, the previous word vector and the following word vector can be used to obtain a word vector corresponding to the text segmentation as the second word segmentation vector corresponding to the text segmentation.

[0076] Step S104: determining the market sentiment prediction probability corresponding to the sample text data based on the first word segmentation vector and the second word segmentation vector.

[0077] The sentiment prediction probability refers to the probability that the sample text data belongs to each market sentiment type, predicted by the text data classification model based on the input first segmentation vector and second segmentation vector. In this step, after obtaining the first segmentation vector and the second segmentation vector corresponding to the text segmentation in the sample text data, the obtained first segmentation vector and the second segmentation vector can be used to predict the market sentiment type corresponding to the sample text data, thereby obtaining the corresponding market sentiment prediction probability.

[0078] Step S105, training the text data classification model according to the difference loss between the market sentiment prediction probability and the sample label to obtain a sentiment classification model.

[0079] The sentiment classification model refers to the trained market sentiment classification model. After obtaining the market sentiment prediction probability, the corresponding loss function can be constructed based on the above prediction probability and the sample label matching the sample text data obtained in step S101, so as to obtain the corresponding difference loss, and use the difference loss to train the text data classification model. The training can be stopped by changing the model parameters of the text data classification model until the difference loss is less than a loss threshold, or by pre-setting a training number threshold and stopping the training when the training number meets the threshold, so as to obtain a trained sentiment classification model.

[0080] In the above-mentioned sentiment classification model training method, sample text data corresponding to sample participants are obtained, and sample labels corresponding to the sample text data are obtained; the sample labels are used to identify the market sentiment type corresponding to the sample text data; the sample text data are input into the text data classification model to be trained, and the text data classification model is used to determine the first segmentation vector corresponding to the text segmentation contained in the sample text data, as well as the previous word vector and the following word vector corresponding to the text segmentation; the second segmentation vector corresponding to the text segmentation is obtained according to the previous word vector and the following word vector corresponding to the text segmentation; based on the first segmentation vector and the second segmentation vector, the market sentiment prediction probability corresponding to the sample text data is determined; the text data classification model is trained according to the difference loss between the market sentiment prediction probability and the sample label to obtain the sentiment classification model. In the sentiment classification model training method provided by the present application, in the process of extracting text features from sample text data, the first word segmentation vector corresponding to the text segmentation is obtained, and the previous word vector and the following word vector corresponding to the text segmentation are also obtained, so that the second word segmentation vector corresponding to the text segmentation is determined by using the previous word vector and the following word vector, and the first word segmentation vector and the second word segmentation vector are further used to train the sentiment classification model. Compared with the traditional technology in which the model training only considers the first word segmentation vector of the text data itself, the present application also introduces the second word segmentation vector obtained by the previous word vector and the following word vector for model training, thereby considering the correlation between texts, so the trained model can improve the accuracy of market sentiment classification.

[0081] In one embodiment, the number of preceding word vectors and following word vectors corresponding to the text segmentation is multiple; Figure 2 As shown, step S103 may further include:

[0082] Step S201, obtaining a context mean vector corresponding to the text segmentation based on multiple context word vectors corresponding to the text segmentation, and obtaining a context mean vector corresponding to the text segmentation based on multiple context word vectors corresponding to the text segmentation.

[0083] In this embodiment, the sample text data may be composed of multiple text segmentations, so the text segmentation corresponding to the previous word vector and the following word vector may also be multiple. For example, when the sample text data is composed of 7 text segmentations, for the third text segmentation, the corresponding previous word vector may be 2, and the following word vector may be 4. For the fourth text segmentation, the corresponding previous word vector may be 3, and the following word vector may also be 3. Therefore, the text segmentation corresponding to the previous word vector and the following word vector may also be multiple, that is, for the third text segmentation, the corresponding previous word vector may be 2, and the following word vector may be 4. For the fourth text segmentation, the corresponding previous word vector may be 3, and the following word vector may also be 3. The previous mean vector refers to the mean vector obtained by averaging multiple previous word vectors, and the following mean vector is the mean vector obtained by averaging multiple following word vectors.

[0084] For example, for the sample text data composed of word segmentation A, word segmentation B, word segmentation C, word segmentation D, word segmentation E, word segmentation F and word segmentation G, taking word segmentation C as an example, the context word vector can include the context word vector A corresponding to word segmentation A and the context word vector B corresponding to word segmentation B, and the context word vector can include the context word vector D corresponding to word segmentation D, the context word vector E corresponding to word segmentation E, the context word vector F corresponding to word segmentation F and the context word vector G corresponding to word segmentation G. Then the context mean vector corresponding to word segmentation C is the mean vector obtained based on the context word vector A and the context vector B, and the context mean vector corresponding to word segmentation C is the mean vector obtained based on the context word vector D, the context word vector E, the context word vector F and the context word vector G.

[0085] Step S202, obtaining a first space mapping vector corresponding to the above mean vector, and obtaining a second space mapping vector corresponding to the below mean vector.

[0086] Among them, the first space mapping vector refers to the vector obtained by performing a vector space mapping transformation on the above mean vector, and the second space mapping vector refers to the vector obtained by performing a vector space mapping transformation on the above mean vector. In this embodiment, the server can also perform a vector space mapping transformation on the above mean vector and the below mean vector to obtain the corresponding first space mapping vector and second space mapping vector respectively.

[0087] Step S203: Obtain a second word segmentation vector corresponding to the text word segmentation according to the first space mapping vector and the second space mapping vector.

[0088] Finally, the server may also use the spatial relationship of the spatial mapping vector to determine the word segmentation vector corresponding to the text word segmentation as the second word segmentation vector.

[0089] In this embodiment, the server can also obtain the previous context mean vector and the following context mean vector of the text segmentation, and obtain the second word segmentation vector after performing spatial mapping transformation on them. The second word segmentation vector of the text segmentation provides a new calculation method, which can improve the efficiency of obtaining the second word segmentation vector.

[0090] Furthermore, step S202 may further include: obtaining preset spatial mapping transformation information; using the spatial mapping transformation information to perform spatial mapping transformation on the previous context mean vector and the following context mean vector, respectively, to obtain a first spatial mapping vector and a second spatial mapping vector, respectively; step S203 may further include: subtracting the second spatial mapping vector from the first spatial mapping vector to obtain a second word segmentation vector corresponding to the text segmentation.

[0091] Spatial mapping transformation information refers to information used to perform spatial mapping transformation on the mean vector, which may be a matrix used to perform spatial mapping transformation on the vector. In this embodiment, the server may be pre-set with a transformation matrix for performing spatial mapping transformation, and use the transformation matrix to perform spatial mapping transformation on the previous mean vector and the following mean vector, respectively, so as to obtain the first spatial mapping vector and the second spatial mapping vector, respectively. After the server obtains the first spatial mapping vector and the second spatial mapping vector, it may also perform difference processing on the second spatial mapping vector and the first spatial mapping vector, that is, by subtracting the first spatial mapping vector from the second spatial mapping vector, the second word segmentation vector corresponding to the text word segmentation may be obtained.

[0092] For example, h can be used to represent the mean vector of the previous context, and t can be used to represent the mean vector of the following context. rh It represents the spatial mapping transformation matrix, through the formula h ⊥ =M rh h and t ⊥ =M rh t, the first space mapping vector h can be calculated respectively ⊥ and the second space mapping vector t ⊥ , and according to the space vector relationship, h ⊥ +F2=t ⊥ , F2 can represent the second word segmentation vector corresponding to the text word segmentation.

[0093] In this embodiment, the spatial mapping transformation of the mean vector can also be achieved by introducing a preset spatial mapping transformation matrix. After obtaining the first spatial mapping vector and the second spatial mapping vector, the second word segmentation vector corresponding to the text word segmentation can be obtained by difference, thereby improving the calculation efficiency of the second word segmentation vector.

[0094] In one embodiment, Figure 3 As shown, step S104 may further include:

[0095] Step S301, obtain the vector mean of the first word segmentation vector and the second word segmentation vector, and use the vector mean as the target word segmentation vector corresponding to the text segmentation.

[0096] The target word segmentation vector refers to the word segmentation vector finally obtained for the text segmentation. The word segmentation vector is obtained based on the first word segmentation vector and the vector average of the second word segmentation vector. Therefore, the target word segmentation vector obtained not only reflects the characteristics of the text segmentation itself, but also takes into account the relationship between the text segmentation and the context. Specifically, after obtaining the first word segmentation vector and the second word segmentation vector, the server can calculate the vector average between the first word segmentation vector and the second word segmentation vector, and use it as the target word segmentation vector corresponding to the text segmentation.

[0097] Step S302, obtaining sample text features corresponding to the sample text data according to the target word segmentation vector corresponding to the text word segmentation;

[0098] Step S303: determining the market sentiment prediction probability corresponding to the sample text data according to the sample text features.

[0099] The server determines the target word segmentation vector in step S301, and can further use the text data classification model to extract text features from the obtained target word segmentation vector as sample text features corresponding to the sample text data. The server can also output the probability that the sample text data belongs to different market sentiment types based on the above sample text features as the market sentiment prediction probability corresponding to the sample text data.

[0100] In this embodiment, the server can also obtain a corresponding target word segmentation vector based on the first word segmentation vector and the second word segmentation vector, and further use the second word segmentation vector to perform feature extraction of the sample text data, so that the extracted sample text features take into account both the characteristics of each text segmentation itself and the contextual connection between the texts, thereby improving the accuracy of the output market sentiment prediction probability.

[0101] In addition, before step S102, it can also include: obtaining the initial text segmentation contained in the sample text data according to a preset sentence segmentation corpus; obtaining a preset stop word corpus, and using the stop word corpus to filter the initial text segmentation to obtain the text segmentation contained in the sample text data; step S102 can further include: inputting the text segmentation contained in the sample text data into the text data classification model to be trained.

[0102] Among them, the sentence segmentation corpus is a text database used to perform text segmentation processing, and the stop word corpus is a text database used to remove stop words in sample text data. Specifically, before the server inputs the sample text data into the text data classification model, it can also pre-process the collected sample text data, wherein the pre-processing process can include the following two methods: firstly, the sample text data is segmented, and then the stop words that may be carried in the initial text segmentation obtained after the segmentation are removed, that is, firstly, the collected sample text data is segmented through the pre-constructed sentence segmentation corpus, so as to obtain the initial text segmentation contained in the sample text data, and then the stop word corpus can be used to filter the stop words that may be carried in the initial text segmentation, so as to retain only the initial text segmentation without stop words, that is, only the text segmentation corresponding to the sample text data is retained.

[0103] After obtaining the text segmentation included in the sample text data, the server may also directly input the text segmentation into the text data classification model, and the text data classification model may perform the acquisition of the first segmentation vector of the text segmentation.

[0104] In this embodiment, before the sample text data is input into the text data classification model, preprocessing of the sample text data is also implemented, wherein the preprocessing process may include a text segmentation process performed using a sentence segmentation corpus, and a stop word filtering process performed using a stop word corpus. Through the above preprocessing process, the input text segmentation can be made more complete and accurate, thereby improving the accuracy of model training.

[0105] In one embodiment, step S101 may further include: obtaining sample news data corresponding to the sample participants, and using the sample news data as sample text data; and / or obtaining sample video data corresponding to the sample participants, extracting corresponding audio data from the sample video data to obtain sample audio data; and using the text data corresponding to the sample audio data as sample text data.

[0106] In this embodiment, the source of sample text data is mainly through the following two ways: one is to use the news data corresponding to the sample participants, that is, the sample news data, which can be news data carrying relevant information of the sample participants, for example, the sample participant can be a certain enterprise, then the sample news data can be news data carrying enterprise name keywords. Another way is to use the video data corresponding to the sample participants, that is, the sample video data, which can describe the relevant information of the sample participants, for example, it can be a video related to the introduction of the enterprise, etc.

[0107] Specifically, the server can pre-collect sample news data and sample video data for sample participants. If it is sample news data, the server can use the news text in the sample news data as sample text data and input it into the text data classification model for training. If it is sample video data, it is necessary to first perform audio extraction on the audio contained in the sample video. For example, the audio data carried in the video can be extracted through ASR technology, and then text data conversion can be performed on the obtained audio data to obtain sample text data, which is then input into the text data classification model for training.

[0108] In this embodiment, the sample text data used for training can be sample news data corresponding to the sample participants, or can be obtained from sample video data of the sample participants, thereby increasing the diversity of sample text data sources and further improving the accuracy of the trained market sentiment classification model.

[0109] In one embodiment, Figure 4 As shown, a method for predicting emotions is provided. This embodiment uses the method applied to a server as an example for illustration. In this embodiment, the method may include the following steps:

[0110] Step S401, obtaining participant text data for market participants collected within a preset time period.

[0111] The preset time period refers to the time period corresponding to the text data collected for realizing the market sentiment prediction. In the process of training the sentiment prediction model in this embodiment, the server needs to first collect the text data related to the duration participants within a certain time period, that is, the participant text data. Then the time period can be used as the preset time period, and the preset time period can be one week. Specifically, when the server needs to predict the market sentiment, it can first collect the text data related to the market participants within the past week as the participant text data.

[0112] Step S402, inputting the text data of the participant into a sentiment classification model, and outputting the market sentiment type corresponding to the text data of the participant through the sentiment classification model; the sentiment classification model is obtained by the sentiment classification model training method as described in any of the above embodiments.

[0113] After obtaining the text data of the participants, the above text data of the participants can be input into a pre-trained emotion classification model. The emotion classification model is trained by the emotion classification model training method used in the above embodiment, and can output the market emotion type corresponding to the text data of the participants, thereby obtaining the market emotion that needs to be predicted.

[0114] In the above-mentioned emotion prediction method, the text data of the participants for the market participants collected within a preset time period is obtained; the text data of the participants is input into the emotion classification model, and the market emotion type corresponding to the text data of the participants is output through the emotion classification model; the emotion classification model is obtained by the emotion classification model training method as described in any of the above embodiments. The emotion prediction method provided in the present application can realize the prediction of market emotions through the trained emotion classification model. Since the emotion classification model used not only considers the text features of the text data itself, but also considers the correlation between texts during training, the accuracy of the prediction can be improved when the emotion classification model is used to realize the market emotion prediction.

[0115] In one application example, a transaction processing method is also provided, which uses artificial intelligence algorithm technology to calculate the redemption plan that best meets customer and regulatory requirements, thereby achieving efficient management of current resources. Figure 5 As shown, the method may include the following steps:

[0116] Step 1: The system obtains redemption instructions, redemption information, and customer position information. The obtained redemption instructions can come from the batch of automated redemption agreement execution signed by the customer. The agreement sets the minimum limit of current funds in the account. When the account funds are lower than the minimum limit, the system automatically initiates the redemption instruction. Customers can also initiate redemption transactions through mobile banking, online banking and other channels, and the system issues redemption instructions. The redemption information includes the amount the customer plans to redeem and the arrival date requirement. The arrival date requirement is manually entered by the customer on the interface or set by the agreement, and can include same-day arrival and T+N arrival. The customer's position information includes product code, position share, transaction details, yield, product seven-day annualized yield, yield per 10,000 shares, product historical price data, etc.

[0117] Step 2: All redemption instructions are received and the optimal redemption amount product and redemption share are calculated based on the redemption model. The model inputs information such as the customer's historical redemption preferences, regulatory requirements, and redemption amount, and outputs the optimal redemption plan.

[0118] Step 2.1, the system obtains the customer's product information and filters it according to the arrival date requirements in the redemption information. If the customer requires the arrival on the same day, the redemption plan product type will be filtered to cash management products. If the customer requires T+N arrival, the redemption plan products will be filtered to products with a redemption payment deferral period of ≤N.

[0119] Step 2.2, determine the type of product. The product types include cash management T+0 products, fixed income products and net value products.

[0120] Step 2.3, for cash management T+0 products, the system obtains the predicted income of the customer's holdings in the next cycle (income prediction module). 1) Income prediction model: obtain the historical income data of each product, including the historical income of each product every week and every day, as training data. The model is trained through the training samples, and the machine learning linear regression algorithm is used to predict the daily income of the product in the future redemption cycle. For example: use the income data of every Monday in the historical data as a sample to predict the product income on Monday in the redemption week. 2) Daily income bar chart: Import the predicted data output by the prediction model into origin for drawing, and obtain a bar chart of the income of each product every day in the redemption cycle. The bar chart can be used to analyze the products with the lowest daily income. 3) Daily average income line chart: According to the model's predicted data, calculate the average income of all products every day, import it into origin to obtain a line chart of the average income of products every day in the cycle, and the discount chart can be used to analyze the date with the lowest average income. 4) Data analysis: Use the daily average return line chart to obtain the date with the lowest average return in a week. Based on the date with the lowest return, use the daily return bar chart to analyze the product with the lowest return on that day and use it as the product to be redeemed.

[0121] Step 2.4, for fixed income products, take the annualized rate of return of the product and calculate the return for the next cycle. Customer return = customer share * issue price * annualized rate of return of the corresponding level * (registration date - interest start date + 1) / calculation days. For example, if the customer's annualized rate of return is 4.5%, then the return = product share * 4.5% * holding days / 365.

[0122] Step 2.5, for equity products, obtain the corresponding investment stock portfolio of the product. Obtain the latest macroeconomic indicators of the current economy, the financial indicators of the listed companies invested in, and the market sentiment of the companies, use machine learning algorithms to learn stock prices, and predict customer returns through the predicted stock price growth value. If the investment includes a stock index, the predicted stock index price is obtained by weighting according to the predicted value of the constituent stocks.

[0123] Step 2.5.1, obtain the latest macroeconomic indicators of the current economy, the financial indicators of the invested enterprises, the market sentiment of the enterprises, and the market transaction data indicators.

[0124] 1. Macroeconomic indicator data analysis: The analysis of macroeconomic indicators is based on the following four influencing factors: inflation rate X1, actual GDP growth rate X2, government fiscal support growth rate X3, and monetary policy-actual interest rate X4. The calculation is done using a multivariate linear analysis regression model, where α is the coefficient of variable X, which can be calculated using the stock X variable data. The formula for calculating macroeconomic indicators is: Y = α0 + α1X1 + α2X2 + α3X3 + α4X4, where Y is the score of the macroeconomic indicator data.

[0125] 2. Financial indicator data analysis: Analyze the financial indicator data according to the factors affecting the financial indicators. Return on total assets, return on net assets, and debt-to-asset ratio are used as profit factors G1; year-on-year growth rates of total assets and net assets are used as growth factors G2; total share capital and circulating share capital of the company are used as scale factors G3; cash operating index and accounts receivable turnover rate are used as cash factors G4. Based on the above factors, the regression analysis of financial indicators is carried out, and the formula for calculating the financial indicator score is: P = β0 + β1G1 + β2G2 + β3G3 + β4G4. The variable coefficient β is calculated through the stock F variable data and the financial indicator P score.

[0126] 3. Market sentiment data analysis: Market sentiment is mainly obtained through the Wind system, using the company name as a keyword to query news data related to the company, including video data and text data, and natural language processing technology to predict market sentiment. Market sentiment is divided into positive and negative. Get the company news document data for the past week and perform the following steps:

[0127] (1) Data preprocessing:

[0128] For video data, ASR technology is used to extract audio from the video and convert it into text for processing. The video data and news text data converted into text are segmented according to the sentence segmentation corpus and the statistical segmentation method; stop words are removed from the segmented text based on the stop word corpus to complete the text preprocessing.

[0129] (2) Data feature extraction:

[0130] Feature extraction is performed on the text after word segmentation, and a feature extraction method based on word vectors is adopted. The representation of word vectors adds the input method of context word vectors on the basis of the CBOW model. The context word vectors of the input layer of the CBOW model use one-hot vector representation. This representation method lacks the association relationship with the context and will lose the hidden information between the contexts. Therefore, the optimization model CBOW-B adds the input method of mean vector, and uses the mean vector of the previous word vector and the mean vector of the following word vector as the head vector and tail vector of the intermediate vector respectively. The specific operation steps are as follows: 1) The mean vector of the weighted sum of the input vectors of the projection layer is obtained through the CBOW model, which is used as the input vector F1 of the output layer. 2) Optimization model CBOW-B: Use the mean of the previous context as the head vector H, and the mean of the following context as the tail vector T, and calculate the intermediate vector F. The head vector and the tail vector are mapped into the spatial form h through the spatial mapping matrix ⊥ =M rh h and t ⊥ =M rh t,h ⊥ +F2=t ⊥ , through h⊥ and t ⊥ Get the corresponding intermediate vector F2. 3) Output the mean vector of the output vector F1 and the intermediate vector of F2 through the softmax function to get the target vector.

[0131] (3) Sentiment classification model: A deep learning recurrent neural network (RNN) model is used. The pre-processed historical news data, video data, and sentiment label data (major positive, general positive, general negative, major negative) are used as training data to train the RNN model. Corporate news data from the past week is obtained as a prediction sample and input into the trained model to predict market sentiment in the next three months.

[0132] (4) Market sentiment score: The classification result of the sentiment predicted by the model, which includes the proportion of each sentiment label. The classified sentiment is scored based on the predicted sentiment proportion and market trading indicators. The sentiment score range is [-1, 1], and the final market sentiment index score S is obtained.

[0133] Step 2.5.2, use machine learning algorithm to learn stock prices. Through step 2.5.1, the score data of each indicator that affects stock prices or bond prices can be calculated: macro indicator Y, financial indicator P, market sentiment indicator S. The historical scores of each indicator and the stock price are used as training sample data, and the machine learning linear regression algorithm is used to train the stock price model. Obtain the data of each indicator in the past week and input it into the stock price prediction model as a prediction sample to predict the stock price in the next cycle and obtain the stock price in the next cycle.

[0134] Step 2.5.3, calculate the customer's income through the predicted stock price growth value. Calculate the total income of the product according to the weight of the investment proportion of the product. The total net value of the wealth management product = the total amount of wealth management product subscription + the total income of the wealth management product - the total tax and fee of the wealth management product - the total amount of accumulated termination, redemption and dividends of the wealth management product. The unit net value of the wealth management product = the total net value of the wealth management product / the total outstanding shares of the wealth management product. The customer's income has nothing to do with the time of holding the product. The customer's return funds = customer shares * net value, and the income = shares * (net value - purchase price).

[0135] Step 2.6, for hybrid products, the invested assets include bonds and stocks, and the total return is obtained by weighting the fixed-income bonds and stocks. The stock return can be calculated based on step 2.5, and the bond return includes bond coupons and capital gains. The coupon income per period = bond face value * coupon rate, and capital gains = bond present value - bond purchase price. The present value of a bond is the discounted price of future cash flows including coupons and principal according to the yield, and the present value of a bond can be predicted by predicting the bond yield. The bond yield can be predicted by a machine learning algorithm, and the yield curve data (i.e., the annualized yield to maturity of zero-coupon bonds with a maturity of 1-10 years at the current time), macro indicators (including gross national product, industrial added value, total retail sales of consumer goods, total import and export value, consumer price index, real estate prices, fixed asset investment, bill acceptance volume, exchange rate and other indicators), and corporate credit risk indicators (including corporate credit rating and other indicators) are used as variables as training sample data, and a machine learning linear regression algorithm is used to train the bond yield model. Obtain the data of various indicators in the most recent week and input them into the bond yield prediction model as prediction samples to predict the bond yield in the next cycle and obtain the price of the bond in the next cycle. The total net value of wealth management products = the total amount of subscription of wealth management products + the total income obtained from wealth management products - the total taxes and fees of wealth management products - the total amount of accumulated termination, redemption and dividends of wealth management products. The unit net value of wealth management products = the total net value of wealth management products / the total outstanding shares of wealth management products. Customer income has nothing to do with the time of holding the product. Customer return funds = customer shares * net value, customer income = share * (net value - purchase price).

[0136] Step 2.7, the system sorts the redemption products according to the principle of the lowest predicted customer return, and calculates the allocation ratio based on the customer's redemption amount. For example, a customer holds 10,000 shares of product A, 20,000 shares of product B, and 10,000 shares of product C, and the redemption amount is 25,000. The redemption is sorted from small to large according to the redemption return as A, B, and C. The redemption amount is allocated to each product in the following ratios: 10,000 shares of product A are redeemed, accounting for 40% of the redemption amount; 15,000 shares of product B are redeemed, accounting for 60% of the redemption amount; and no shares of product C are redeemed.

[0137] Step 2.8, adjust the redemption order according to the customer's historical redemption plan. The system queries the historical plan adjustment record of the last redemption product in the redemption plan. If there is no record, no adjustment will be made. If there is a record, the adjustment will be made according to the latest adjustment ratio. The adjustment ratio specifically refers to the adjustment ratio of adjusting the product x in the plan to the order m if it exists in the order n = (nm) / (n-1), where m≤n.

[0138] For example, the last product to be redeemed in the redemption plan obtained as of step 2.6 is B. Check the system's historical adjustment records to see if there are any adjustment records related to product B. If the customer has adjusted product B to the first place in the historical redemption plan of step S300 (three products are redeemed in the plan, and product B is the last one), the forward adjustment ratio is 1. In this plan, adjust product B forward by 1, and change the redemption plan to product B—>product A.

[0139] Check the customer adjustment records to see if there are any products that have been cancelled. If there are any, do not include them in the redemption plan. For example, if the redemption plan is still Product A->Product B, and there is a record of a customer canceling the redemption of Product B in the historical redemption plan, then remove Product B from the redemption plan and change the existing redemption plan to Product A->Product C.

[0140] If the customer has actively selected a product in the adjustment record, the product with the lowest return will be replaced. For example, if the redemption plan is still Product A->Product B, and there is a record of the customer actively selecting Product C for redemption in the historical redemption plan, the existing redemption plan will be changed to Product A->Product C.

[0141] In step 2.9, the system obtains the regulatory requirements related to the redemption product and determines the redemption plan. For example, the order of redemption products determined by the system is Product A—>Product B—>Product C, where Product A and Product B are cash management products, and Product C is a net value product. Regulatory requirements for cash management products have a daily redemption limit of 10,000. For ease of understanding, a redemption plan is set to determine the redemption amount of redeemed product i as X(i). Assuming that the redemption amount contained in the redemption instruction is 25,000, the system first derives X(A)=10,000, X(B)=10,000, and X(C)=5,000 based on Product A and regulatory requirements X(A)≤10,000, X(B)≤10,000.

[0142] Step 3: Obtain the confirmation result of the customer's online plan adjustment, including the adjustment order and adjustment ratio, and initiate a redemption instruction. Figure 3 As shown in a schematic diagram of online submission of redemption applications and adjustment plans, customers can cancel the redemption of a product by unchecking it, and customers can include the product in the redemption plan by checking it. Customers can actively adjust the redemption order.

[0143] Step 4: The system receives the redemption execution instruction and completes the transaction redemption based on the product, amount or share and redemption order contained in the instruction.

[0144] In addition, an account management device is also provided, such as Figure 6 As shown, it may specifically include:

[0145] The transaction management module 610 is used to obtain transaction applications from customers, obtain redemption plans from the redemption calculation module, receive plan adjustment data from customers, and initiate final redemption transaction instructions and plans to the financial investment comprehensive module, including: an instruction collection module, a plan acquisition module, a redemption plan adjustment module, and a transaction instruction output module.

[0146] The instruction collection module is used by the system to obtain redemption instructions, redemption information, and customer position information.

[0147] The solution acquisition module is used to call the solution storage module in the model calculation solution according to the instruction to obtain the corresponding redemption solution.

[0148] The redemption plan adjustment module is used to obtain the customer's online plan adjustment confirmation results, including adjustment sequence, adjustment ratio, and initiation of redemption instructions.

[0149] The transaction instruction output module is used to send the transaction instruction to the financial investment comprehensive module to execute the transaction. The transaction instruction includes the executed transaction type, transaction product, and transaction amount.

[0150] The model calculation module 620 is used to obtain model input information, distinguish product types, predict the expected returns of customers holding products, adjust and store redemption plans based on customer historical preferences and regulatory requirements, and output redemption plans to the transaction management module, including: information acquisition module, return prediction module, redemption plan calculation module, and plan storage module.

[0151] The information acquisition module is used to obtain model input information, including product information, customer information, and regulatory requirements information. Product information may include basic information, risk level, historical yield and net value information. Customer information includes customer assets, customer account opening information, customer credit information, customer risk level, purchased wealth management products, the proportion of purchased wealth management amount to total assets, and the income of each wealth management product. Regulatory requirements information includes the maximum and minimum purchase or redemption limit requirements for specific types of products.

[0152] The income prediction module is used to predict the daily income of the product in the future redemption cycle based on the product's historical income information.

[0153] The redemption plan calculation module is used to calculate the product income according to the income prediction module, adjust the plan based on customer preferences and regulatory requirements using the adjustment module, and output the relevant plan information to the plan storage module for storage, including series product information, transaction type, transaction amount, redemption order, etc. The income prediction module includes a cash management product income prediction module, a fixed income product income calculation module, an equity product income prediction module, and a hybrid product income prediction module, which respectively predict and calculate the holding income in the next cycle for the four types of products. The adjustment module includes a preference adjustment module and a regulatory limit adjustment module, which respectively adjust the plan based on customer preferences and regulatory requirements.

[0154] The plan storage module is used to store the purchase plan or redemption plan of the customer's current account management.

[0155] The integrated financing and investment module 630 is mainly used to receive redemption instructions and redemption plans from the transaction management module and complete transaction execution, including: a transaction instruction receiving module, a transaction execution module, and a transaction result feedback module.

[0156] The transaction instruction receiving module is used to receive transaction instructions and obtain the transaction type, transaction product, and transaction amount of the transaction instruction output module.

[0157] The transaction execution module completes the transaction redemption according to the products and amount or shares included in the instruction.

[0158] The transaction result feedback module is used to return the transaction results to the transaction management module and the model calculation module after executing the redemption transaction, and update the customer's position information.

[0159] The above application examples can combine the customer's own needs and regulatory policy requirements, and use artificial intelligence algorithm technology to calculate the redemption plan that best meets customer and regulatory requirements, thereby achieving efficient management of customer demand funds.

[0160] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0161] Based on the same inventive concept, the embodiment of the present application also provides an emotion classification model training device for implementing the emotion classification model training method involved above, and an emotion prediction device for implementing the emotion prediction method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more emotion classification model training device embodiments provided below can refer to the limitations on the emotion classification model training method above, and the specific limitations in the emotion prediction device embodiment can refer to the limitations on the emotion prediction method above, which will not be repeated here.

[0162] In one embodiment, Figure 7 As shown, a sentiment classification model training device is provided, comprising: a sample data acquisition module 701, a first vector acquisition module 702, a second vector acquisition module 703, a prediction probability acquisition module 704 and a classification model training module 705, wherein:

[0163] The sample data acquisition module 701 is used to acquire sample text data corresponding to the sample participants, and acquire sample labels corresponding to the sample text data; the sample labels are used to identify the market sentiment type corresponding to the sample text data;

[0164] A first vector acquisition module 702 is used to input the sample text data into the text data classification model to be trained, and use the text data classification model to determine the first word segmentation vector corresponding to the text word contained in the sample text data, as well as the previous word vector and the following word vector corresponding to the text word;

[0165] A second vector acquisition module 703 is used to obtain a second word segmentation vector corresponding to the text word segmentation according to the previous word vector and the following word vector corresponding to the text word segmentation;

[0166] A prediction probability acquisition module 704 is used to determine the market sentiment prediction probability corresponding to the sample text data based on the first word segmentation vector and the second word segmentation vector;

[0167] The classification model training module 705 is used to train the text data classification model according to the difference loss between the market sentiment prediction probability and the sample label to obtain the sentiment classification model.

[0168] In one embodiment, there are multiple context word vectors and context word vectors corresponding to the text segmentation; the second vector acquisition module 703 is further used to obtain a context mean vector corresponding to the text segmentation based on the multiple context word vectors corresponding to the text segmentation, and to obtain a context mean vector corresponding to the text segmentation based on the multiple context word vectors corresponding to the text segmentation; obtain a first space mapping vector corresponding to the context mean vector, and obtain a second space mapping vector corresponding to the context mean vector; obtain the second space mapping vector corresponding to the text segmentation based on the first space mapping vector and the second space mapping vector.

[0169] In one embodiment, the second vector acquisition module 703 is further used to obtain preset spatial mapping transformation information; use the spatial mapping transformation information to perform spatial mapping transformation on the previous mean vector and the following mean vector, respectively, to obtain a first spatial mapping vector and a second spatial mapping vector, respectively; and perform a difference processing on the second spatial mapping vector and the first spatial mapping vector to obtain a second word segmentation vector corresponding to the text segmentation.

[0170] In one embodiment, the prediction probability acquisition module 704 is further used to obtain the vector mean of the first word segmentation vector and the second word segmentation vector, and use the vector mean as the target word segmentation vector corresponding to the text segmentation; according to the target word segmentation vector corresponding to the text segmentation, obtain the sample text features corresponding to the sample text data; according to the sample text features, determine the market sentiment prediction probability corresponding to the sample text data.

[0171] In one embodiment, a sentiment classification model training device includes: a sample data preprocessing module, which is used to obtain initial text segmentations contained in sample text data based on a preset sentence segmentation corpus; obtain a preset stop word corpus, and use the stop word corpus to filter the initial text segmentations to obtain text segmentations contained in the sample text data; a first vector acquisition module 702, which is further used to input the text segmentations contained in the sample text data into a text data classification model to be trained.

[0172] In one embodiment, the sample data acquisition module 701 is further used to acquire sample news data corresponding to the sample participants, and use the sample news data as sample text data; and to acquire sample video data corresponding to the sample participants, extract corresponding audio data from the sample video data, and obtain sample audio data; and use the text data corresponding to the sample audio data as sample text data.

[0173] In one embodiment, Figure 8 As shown, a sentiment prediction device is provided, including: a prediction text acquisition module 801 and a market sentiment prediction module 802, wherein:

[0174] The predicted text acquisition module 801 is used to acquire the participant text data for the market participants collected within a preset time period;

[0175] The market sentiment prediction module 802 is used to input the text data of the participants into the sentiment classification model, and output the market sentiment type corresponding to the text data of the participants through the sentiment classification model; the sentiment classification model is obtained by the sentiment classification model training method described in any of the above embodiments.

[0176] Each module in the above-mentioned emotion classification model training device and emotion prediction device can be implemented in whole or in part by software, hardware and their combination. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0177] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig. 9 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store sample text data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for training an emotion classification model is implemented, or a method for predicting emotions is implemented.

[0178] Those skilled in the art will understand that Fig. 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0179] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0180] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0181] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0182] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0183] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0184] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0185] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for training an emotion classification model, characterized in that: Applied to a server, the method comprises: Acquire sample text data corresponding to the sample participants, and acquire sample labels corresponding to the sample text data; the sample labels are used to identify the market sentiment type corresponding to the sample text data; the acquiring sample text data corresponding to the sample participants includes: acquiring sample video data corresponding to the sample participants, extracting corresponding audio data from the sample video data by ASR technology to obtain sample audio data; and using the text data corresponding to the sample audio data as the sample text data; Input the sample text data into a text data classification model to be trained, and use the text data classification model to determine a first word segmentation vector corresponding to a text word contained in the sample text data, as well as a previous word vector and a following word vector corresponding to the text word; the number of the previous word vector and the following word vector corresponding to the text word is multiple; According to the previous word vector and the following word vector corresponding to the text segmentation, a second word segmentation vector corresponding to the text segmentation is obtained; including: according to multiple previous word vectors corresponding to the text segmentation, a previous mean vector corresponding to the text segmentation is obtained, and according to multiple following word vectors corresponding to the text segmentation, a following mean vector corresponding to the text segmentation is obtained; obtaining preset spatial mapping transformation information; using the spatial mapping transformation information to perform spatial mapping transformation on the previous mean vector and the following mean vector, respectively, to obtain a first spatial mapping vector corresponding to the previous mean vector and a second spatial mapping vector corresponding to the following mean vector; performing a difference processing on the second spatial mapping vector and the first spatial mapping vector to obtain the second word segmentation vector corresponding to the text segmentation; Determine the market sentiment prediction probability corresponding to the sample text data based on the first word segmentation vector and the second word segmentation vector; The text data classification model is trained according to the difference loss between the market sentiment prediction probability and the sample label to obtain a sentiment classification model.

2. The method according to claim 1, characterized in that The determining, based on the first word segmentation vector and the second word segmentation vector, a market sentiment prediction probability corresponding to the sample text data includes: Obtaining a vector mean of the first word segmentation vector and the second word segmentation vector, and using the vector mean as a target word segmentation vector corresponding to the text segmentation; Obtaining sample text features corresponding to the sample text data according to the target word segmentation vector corresponding to the text word segmentation; According to the sample text features, the market sentiment prediction probability corresponding to the sample text data is determined.

3. The method according to claim 1 or 2, characterized in that: Before inputting the sample text data into the text data classification model to be trained, the method further includes: According to a preset sentence segmentation corpus, obtaining the initial text segmentation contained in the sample text data; Obtaining a preset stop word corpus, and using the stop word corpus to filter the initial text segmentation to obtain the text segmentation included in the sample text data; The step of inputting the sample text data into a text data classification model to be trained comprises: The text segmentations contained in the sample text data are input into the text data classification model to be trained.

4. The method according to claim 1 or 2, characterized in that: The obtaining of sample text data corresponding to the sample participants also includes: The sample news data corresponding to the sample participant is obtained, and the sample news data is used as the sample text data.

5. A sentiment classification model training device, characterized in that: Applied to a server, the device comprises: The sample data acquisition module is used to acquire sample text data corresponding to the sample participants, and acquire sample tags corresponding to the sample text data; the sample tags are used to identify the market sentiment type corresponding to the sample text data; and further used to acquire sample video data corresponding to the sample participants, extract corresponding audio data from the sample video data through ASR technology, and obtain sample audio data; and use the text data corresponding to the sample audio data as the sample text data; A first vector acquisition module is used to input the sample text data into a text data classification model to be trained, and use the text data classification model to determine a first word segmentation vector corresponding to a text word contained in the sample text data, as well as a previous word vector and a following word vector corresponding to the text word; the number of the previous word vector and the following word vector corresponding to the text word is multiple; The second vector acquisition module is used to obtain the second segmentation vector corresponding to the text segmentation according to the previous word vector and the following word vector corresponding to the text segmentation; further used to obtain the previous mean vector corresponding to the text segmentation according to the multiple previous word vectors corresponding to the text segmentation, and obtain the following mean vector corresponding to the text segmentation according to the multiple following word vectors corresponding to the text segmentation; obtain preset spatial mapping transformation information; use the spatial mapping transformation information to perform spatial mapping transformation on the previous mean vector and the following mean vector, respectively, to obtain the first spatial mapping vector corresponding to the previous mean vector, and the second spatial mapping vector corresponding to the following mean vector; perform difference processing on the second spatial mapping vector and the first spatial mapping vector to obtain the second segmentation vector corresponding to the text segmentation; A prediction probability acquisition module, used to determine the market sentiment prediction probability corresponding to the sample text data based on the first word segmentation vector and the second word segmentation vector; The classification model training module is used to train the text data classification model according to the difference loss between the market sentiment prediction probability and the sample label to obtain a sentiment classification model.

6. The device according to claim 5, characterized in that The prediction probability acquisition module is further used to obtain the vector mean of the first word segmentation vector and the second word segmentation vector, and use the vector mean as the target word segmentation vector corresponding to the text segmentation; according to the target word segmentation vector corresponding to the text segmentation, obtain the sample text features corresponding to the sample text data; according to the sample text features, determine the market sentiment prediction probability corresponding to the sample text data.

7. The device according to claim 5 or 6, characterized in that The device also includes: a sample data preprocessing module, which is used to obtain the initial text segmentation contained in the sample text data according to a preset sentence segmentation corpus; obtain a preset stop word corpus, and use the stop word corpus to filter the initial text segmentation to obtain the text segmentation contained in the sample text data; and a first vector acquisition module, which is further used to input the text segmentation contained in the sample text data into the text data classification model to be trained.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the emotion classification model training method described in any one of claims 1 to 4 is implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the emotion classification model training method described in any one of claims 1 to 4 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the emotion classification model training method described in any one of claims 1 to 4 is implemented.