Financial product text generation method, device, electronic device and storage medium
By using pre-trained text to generate a large language model, combining the emotional description information of the target user and the financial product template text, keywords are extracted and financial product text is generated, and the problem of low text generation efficiency in the existing technology is solved, achieving efficient and personalized text generation effect.
Patent Information
- Application Number
- CN202411837044.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2044-12-13
AI Technical Summary
In the prior art, the text generation efficiency of financial products is low and relies on manual generation of various types of text.
Pre-trained text is used to generate a large language model. By obtaining the emotional description information of the target user and the template text of the financial product, the text theme keywords and emotional keywords are extracted, and inputting them into the encoding and decoding layer of the large language model to generate high-quality financial product text.
It improves the efficiency of text generation of financial products, the generated text is consistent with the emotions of the target user, and improves the matching degree with the user.
Smart Images

Figure CN119294380B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a method, device, electronic device and storage medium for generating text of a financial product. Background Art
[0002] In order to enrich the categories of financial products, attract users and increase user stickiness, financial trading platforms continue to launch various types of financial products. In order to allow users to quickly understand various financial products, it is necessary to generate various texts of various financial products.
[0003] Currently, staff generally manually generate various types of texts for various financial products, which is inefficient. Summary of the invention
[0004] The purpose of the embodiments of the present invention is to provide a method, device, electronic device and storage medium for generating text of financial products, so as to improve the efficiency of generating text of financial products. The specific technical solution is as follows:
[0005] In a first aspect, an embodiment of the present invention provides a method for generating text of a financial product, the method comprising:
[0006] Obtain target users’ sentiment description information on the financial product market;
[0007] Obtaining a template text of the text to be generated of the target financial product;
[0008] Extracting text topic keywords from the template text, and obtaining emotion keywords based on the emotion description information;
[0009] The template text, the text topic keywords and the emotional keywords are used as discrete prefix prompt information, and the discrete prefix prompt information is input into the encoding layer of the pre-trained text generation large language model to obtain the hidden feature of the first feature output by the encoding layer through feature extraction on the first feature, wherein the first feature is: the encoding layer performs multi-head attention transformation on the discrete prefix prompt information and the trained continuous prefix prompt information, and the obtained feature characterizes the relationship between each information in the discrete prefix prompt information;
[0010] The hidden features of the first feature, the text topic keywords, the emotion polarity corresponding to the emotion keywords and the continuous prefix prompt information are input into the decoding layer of the text generation large language model to decode and transform the input information, and obtain the characters in the text to be generated around the emotion keywords output by the decoding layer.
[0011] In a second aspect, an embodiment of the present invention provides a text generation device for a financial product, the device comprising:
[0012] The emotion description information acquisition module is used to obtain the emotion description information of the target user on the financial product market;
[0013] A template text acquisition module, used to obtain the template text of the to-be-generated text of the target financial product;
[0014] A keyword acquisition module, used to extract text topic keywords from the template text and obtain emotional keywords based on the emotional description information;
[0015] A hidden feature acquisition module is used to use the template text, the text theme keywords and the emotional keywords as discrete prefix prompt information, input the discrete prefix prompt information into the encoding layer of the pre-trained text generation large language model, and obtain the hidden feature of the first feature output by the encoding layer after feature extraction on the first feature, wherein the first feature is: the encoding layer performs multi-head attention transformation on the discrete prefix prompt information and the trained continuous prefix prompt information, and obtains the feature representing the relationship between each information in the discrete prefix prompt information;
[0016] The character acquisition module is used to input the hidden features of the first feature, the text theme keywords, the emotion polarity corresponding to the emotion keywords and the continuous prefix prompt information into the decoding layer of the text generation large language model to decode and transform the input information, and obtain the characters in the text to be generated around the emotion keywords output by the decoding layer.
[0017] In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0018] Memory, used to store computer programs;
[0019] The processor is used to implement the steps of the method for generating text of financial products described in the first aspect when executing the program stored in the memory.
[0020] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for generating text of a financial product described in the first aspect are implemented.
[0021] An embodiment of the present invention further provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the text generation method for a financial product as described in the first aspect above.
[0022] Beneficial effects of the embodiments of the present invention:
[0023] When the technical solution provided by the embodiment of the present invention is applied to text generation, the various types of texts for various financial products are not directly manually generated by the staff. Instead, the text is generated with the help of a large language model. After the text subject keywords extracted from the template text of the to-be-generated text of the target financial product and the emotional keywords obtained based on the emotional description information are input into the large language model used for text generation, the large language model outputs the text of the target financial product. This saves the staff the operation of manually generating text, thereby improving the efficiency of text generation.
[0024] In addition, when using the large language model to generate the text of the target financial product, the target user's emotional description information on the financial product market is taken into consideration. Thus, after inputting content related to the above emotional description information into the large language model, the large language model also takes into consideration the target user's emotions on the financial product market when generating the text of the target financial product. Thus, the generated text is consistent with the target user's emotions, thereby improving the matching degree between the generated text and the target user.
[0025] Of course, it is not necessary to achieve all of the advantages described above at the same time to implement any product or method of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can also be obtained based on these drawings.
[0027] Figure 1 A flowchart of a method for obtaining target user's emotional description information on a financial product market provided by an embodiment of the present invention.
[0028] Figure 2 A flowchart of a method for obtaining public opinion information of a first financial product provided in an embodiment of the present invention.
[0029] Figure 3 A flowchart of a method for determining and setting a feature dimension provided in an embodiment of the present invention.
[0030] Figure 4 A flowchart of a method for generating text for a financial product provided by an embodiment of the present invention.
[0031] Figure 5 A schematic diagram of the structure of a text generation device for a financial product provided by an embodiment of the present invention.
[0032] Figure 6A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0033] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field based on this application belong to the scope of protection of the present invention.
[0034] Currently, there are a wide variety of financial product categories on financial trading platforms. In order to enable users to quickly understand various financial products and become interested in these financial products, it is necessary to generate various types of texts for various financial products and then push the generated texts to users. However, currently, various types of texts for various financial products are generally generated manually by staff, which is inefficient. Therefore, an embodiment of the present invention provides a text generation method, device, electronic device and storage medium for financial products.
[0035] In order to make the text generation solution for financial products provided by the embodiment of the present invention easy to understand, some concepts involved in the solution provided by the embodiment of the present invention and the methods for obtaining them are first explained.
[0036] The emotion description information mentioned in the embodiment of the present invention is information used to describe the target user's emotions toward the performance of the financial product market.
[0037] For example, the emotions expressed by the target user may be the target user's optimism about the financial product market, pessimism about the financial product market, interest in the financial product market, lack of interest in the financial product market, etc.
[0038] The above-mentioned financial product market may include at least one of the following product markets: stock product market, fund product market, bond product market, futures product market, etc.
[0039] It should be noted that the word "feature" is involved in many places in this application. The feature is described by a numerical value, that is, in addition to having a specific physical meaning, the feature also has a numerical value describing its size. On this basis, the processing of the "feature" in the embodiments of this application can be understood as the processing of the specific numerical value of the feature, that is, the processing of the feature value.
[0040] The following is an explanation of the method of obtaining the target user's sentiment description information on the financial product market.
[0041] In one embodiment of the present invention, see Figure 1, a flow chart of a method for obtaining target users' emotional description information on the financial product market is provided, the method comprising the following steps S101-S105.
[0042] Step S101: obtaining the total income of a first financial product held by a target user in a financial product market and market fluctuation information of the first financial product in units of time, obtaining public opinion information of the first financial product, and obtaining market information of the financial product market.
[0043] The above time unit refers to the time unit for information collection. Considering that some financial products in the financial product market may experience price fluctuations in a short period of time due to unexpected events, the above time unit can be 6 hours, 12 hours, 24 hours (that is, one day), or 72 hours, etc.
[0044] The first financial product is a financial product that the user has purchased and not sold. The first financial product held by the user can be one or more.
[0045] The following is an explanation of how to obtain the above-mentioned total returns, market fluctuation information, public opinion information and market situation information.
[0046] In one embodiment of the present invention, the total income of the first financial product in each time unit can be obtained in the following manner:
[0047] For a time unit, the first market price of the first financial product at the starting statistical moment in the time unit is obtained, and the second market price of the first financial product at the ending statistical moment in the time unit is obtained, and the price difference between the second market price and the first market price is calculated to obtain the income of the first financial product in the time unit.
[0048] The sum of the returns of all first financial products in the time unit is the total return of all first financial products in the time unit.
[0049] For example, if the time unit is a day, the starting statistical time in the time unit may be 8:00 a.m. of the day, and the ending statistical time in the time unit may be 17:00 a.m. of the day.
[0050] The above-mentioned market fluctuation information may be changes in the market price of a financial product within a time unit. These changes may be manifested as the extent of price increase, decrease, frequency of increase, frequency of decrease, etc.
[0051] In one embodiment of the present invention, the market fluctuation information of the first financial product in each time unit can be obtained in the following manner:
[0052] Since the market price of financial products changes over time, for a time unit, the market price of the first financial product at each moment can be obtained within the time unit according to the set time interval, and then, in the order of each moment from early to late, the difference between the market price at the next moment and the market price at the previous adjacent moment is calculated as the fluctuation range. When the fluctuation range is a positive number, it indicates that the price of the first financial product has increased, when the fluctuation range is a negative number, it indicates that the price of the first financial product has decreased, and when the fluctuation range is zero, it indicates that the price of the first financial product has not fluctuated. On the basis of the above, the fluctuation sequence formed by the obtained fluctuation ranges from early to late according to the corresponding moments can be used as the market fluctuation information of the first financial product in the time unit.
[0053] On the basis of the above embodiment, the number of positive numbers in the fluctuation sequence can be further counted as the rising frequency, and the number of negative numbers can be counted as the falling frequency, and then the rising frequency, falling frequency and the fluctuation sequence can be used together as the market fluctuation information of the first financial product in the time unit.
[0054] The above market information can be understood as the overall market information of the financial product market, reflecting the overall market performance of the entire financial product market. For example, the above market information can reflect whether the entire financial product market is active, whether the entire financial product market is in an upward channel, etc.
[0055] In one embodiment of the present invention, the market information of the financial product market can be obtained by:
[0056] For a time unit, data such as the market trading volume, turnover rate, overall rise and fall range, and overall rise and fall frequency of the financial product market can be obtained as original data, and then the above-mentioned various original data are normalized. According to the weights corresponding to various original data, weighted calculation is performed on the normalized original data, and the result of the weighted calculation is used as the above-mentioned market information corresponding to the time unit.
[0057] On the basis of the above embodiment, further, when determining the market information corresponding to a time unit, the market information corresponding to the N time units before the time unit can also be considered. For example, the market information corresponding to the time unit and the market information corresponding to the above N time units are weightedly calculated, and the weighted calculation result is used as the market information finally corresponding to the time unit.
[0058] From the above description, each piece of market information actually corresponds to a period of time, and this period of time is not very long, so the above market information can also be called recent market information.
[0059] The method for obtaining the above public opinion information is given in the subsequent embodiments and will not be described in detail here.
[0060] The first financial product mentioned in the above description and the market price of the first financial product at each moment, etc., can all be obtained from the backend server of the financial transaction platform.
[0061] Step S102: Obtaining the target user's behavior data on the financial transaction platform.
[0062] In daily work, in addition to providing various services to users, the financial trading platform can also record the user's behavior data on the financial trading platform. In view of this, in this step, various behavior data of the target user on the financial trading platform can be obtained from the background server of the financial trading platform.
[0063] In one embodiment of the present invention, the target user's behavior data on the financial transaction platform includes at least one of the following information 1-4:
[0064] Information 1: Transaction frequency of target users.
[0065] The above-mentioned transaction frequency can be understood as: the number of times the target user conducts financial product transactions on the financial trading platform within a unit time, where the above-mentioned unit time can be a day, a week, or a month.
[0066] Information 2: The number of times the target users browsed news about financial products in the first period of time.
[0067] Specifically, the above-mentioned number of news reports may be the number of times the target user browses news about all financial products on the financial trading platform within the first period of time, that is, including both financial products held by the target user and financial products not held by the target user; in addition, the above-mentioned number of news reports may also be the number of times the target user browses news about the first financial product held by the target user on the financial trading platform within the first period of time.
[0068] Information 3: The number of complaints made by the target users in the second period.
[0069] In order to provide better services to users, the financial trading platform can provide users with complaint entrances, such as online complaint entrances and telephone complaint entrances. In addition, it can also provide users with counter complaint entrances. After the user makes a complaint at the counter, the counter staff can also enter the user's complaint information into the financial trading platform. On this basis, the above number of complaints can be the sum of the number of complaints made by the target user through various complaint entrances within the second time period.
[0070] Information 4: The number of target users’ emotional fluctuations during the third period of time.
[0071] Financial trading platforms can collect at least one of the following information from target users:
[0072] Transaction data, information on changes in financial products held, income information, complaint information, news browsing information, etc.
[0073] Predict whether the target user has emotional changes based on the collected information. For example, the above collected information can be used as model input to predict the emotional changes of the target user through a pre-trained emotional fluctuation prediction model.
[0074] Then, based on the above prediction results, the number of emotional fluctuations of the target user within the third time period is counted.
[0075] The first, second and third durations may be 12 hours, 24 hours, 48 hours, 72 hours, etc. In addition, the first, second and third durations may be the same or different.
[0076] It can be seen from the above that using at least one of the above information 1-information 4 as behavioral data makes the obtained behavioral data richer and more diversified, providing more abundant basis data for subsequent accurate prediction of the target user's emotions, making the subsequent prediction of the target user's emotions more accurate.
[0077] Step S103: Based on the obtained total revenue, market fluctuation information, public opinion information and market situation information, the features corresponding to each set feature dimension are obtained.
[0078] Different feature dimensions have different meanings, and the contribution of the extracted features to sentiment prediction may also be different. Based on this, we can pre-select feature dimensions that contribute more to sentiment prediction from a large number of feature dimensions as set feature dimensions. In this way, feature extraction is performed on the total revenue, market fluctuation information, public opinion information and market situation information obtained in the set feature dimensions, so that the extracted features are more targeted and can better reflect the user's emotions.
[0079] The method of selecting and setting a feature dimension from a plurality of feature dimensions will be described in subsequent embodiments and will not be described in detail here.
[0080] Step S104: Based on the obtained features, predict the correlation between the target user's emotions and the financial product market.
[0081] Considering that some users are particularly concerned about the financial product market, while some users are not so concerned about the financial product market, that is, the degree of correlation between the emotions of different users and the financial product market is different, therefore, in the implementation of the present invention, the user's emotions are not directly predicted in general, but the correlation between the target user's emotions and the financial product market is innovatively predicted first, and then the target user's emotions are predicted based on the correlation between the target user's emotions and the financial product market, combined with the above-mentioned features. This can effectively avoid the deviation of the emotion prediction results caused by simply using the above-mentioned features for emotion prediction, thereby greatly affecting the prediction accuracy of the final target user's emotions.
[0082] In one embodiment of the present invention, the above-mentioned correlation degree can be realized using a pre-trained decision tree group. The specific prediction process and the training process of the decision tree group are given in subsequent embodiments and are not described in detail here.
[0083] Step S105: using the obtained features and correlations, obtain the target user's sentiment description information on the financial product market.
[0084] The above-mentioned emotion description information is information describing the target user's emotion towards the financial product market. The emotion description information can be emotion keywords, such as pessimistic, optimistic, interested, uninterested, etc., or a sentence describing the emotion, such as hoping to continue to pay attention to financial product X, being disappointed with the performance of financial product X, etc.
[0085] In one embodiment of the present invention, a sentiment prediction model may be pre-trained. When sentiment description information needs to be obtained in the above step S105, the features and correlations obtained in the above steps S103 and S104 are input into the pre-trained sentiment prediction model to obtain the target user's sentiment description information for the financial product market output by the sentiment prediction model.
[0086] The training method of the above emotion prediction model is explained below.
[0087] Collect data of multiple second sample users, and then perform the following operations for each second sample user:
[0088] Taking time units as units, obtain the total income of the second financial product held by the second sample user in the financial product market and the market fluctuation information of the second financial product, obtain the public opinion information of the second financial product, obtain the market information of the financial product market, obtain the behavior data of the second sample user on the financial trading platform, and obtain the features corresponding to each set feature dimension based on the total income, market fluctuation information, public opinion information and market information. Based on the obtained features, predict the sample correlation between the emotion of the second sample user and the financial product market. So far, the above process is similar to the aforementioned steps S101-S104, and the only difference is the second sample user and the target user.
[0089] In addition, the true value of whether the second sample users have positive sentiment towards the financial product market is also obtained.
[0090] After completing the above process for multiple second sample users, the obtained features and sample associations corresponding to each second sample user are input into the initial network model, and the predicted emotional description information corresponding to each second sample user output by the initial network model and the predicted probability that the second sample user has a positive emotion on the financial product market are obtained. Then, the loss value is calculated based on the following loss function, and the network parameters of the initial network model are adjusted based on the loss value. After multiple rounds of network parameter adjustment are performed in this way, the initial network model after the network parameters are adjusted is used as the emotion prediction model after the training end conditions are met.
[0091] Among them, the above loss function is:
[0092]
[0093] Where L represents the loss value, N represents the total number of second sample users, represents the correlation between the sentiment of the i-th second sample user and the financial product market, Indicates the true value of whether the i-th second sample user has a positive sentiment towards the financial product market, It represents the predicted probability that the i-th second sample user has a positive sentiment towards the financial product market.
[0094] The above loss function is used to train the emotion prediction model, and the correlation between the user's emotion and the financial product market is included in the model training process. This makes the trained emotion prediction model more accurate. When the emotion prediction model is used for emotion prediction, the obtained emotion description information is more accurate.
[0095] From the above, it can be seen that when predicting the target user's emotional description information on the financial product market in the solution provided in this embodiment, not only the income situation, market fluctuations, and public opinion information on the first financial product held by the target user are taken into consideration, but also the market information of the entire financial product market and the behavioral data of the target user are taken into consideration. In this way, diversified information is taken into consideration when predicting the above-mentioned emotional description information, and the user's emotions reflected by information of different dimensions can be combined to comprehensively obtain the target user's emotional description information on the financial product market, which can improve the accuracy of the predicted emotional description information.
[0096] In addition, when predicting the emotion description information in the solution provided in the embodiment of the present invention, the correlation between the target user's emotions and the financial product market is also taken into account. In this way, regardless of whether the target user is more concerned about the financial product market or not, the predicted target user's emotions can be corrected through the above-mentioned correlation, thereby improving the accuracy of the target user's emotion description information finally predicted.
[0097] The method for obtaining the public opinion information mentioned in the aforementioned step S101 is described in detail below.
[0098] The public opinion information of the first financial product refers to the description information of various news related to the first financial product that have been published. For example, the public opinion information may include at least one of the following information:
[0099] The total number of various news related to First Financial products, the number of positive news, the number of negative news, the popularity of various news, the number of positive reactions of users to various news, the number of negative reactions of users to various news, etc.
[0100] In one embodiment of the present invention, public opinion information of the first financial product can be obtained based on the number of positive news and the number of negative news about the first financial product. For details, see Figure 2 , Figure 2 A flowchart of a method for obtaining public opinion information of a first financial product provided in an embodiment of the present invention, the method comprising the following steps S201-S205.
[0101] Step S201: obtaining news about a first financial product in a first number of recent time units.
[0102] The news messages about the first financial product in the latest first number of time units may be understood as: news messages whose release time is in the latest first number of time units, and these news messages are associated with the first financial product.
[0103] Specifically, a web crawler may be used to crawl news about the first financial product from the Internet, wherein the web crawler may be run regularly or at a set time interval to crawl news. After the web crawler crawls the news about the first financial product, the backend server of the financial trading platform may store the news crawled by the web crawler. In this way, when the news needs to be obtained during the execution of the above step S201, the news about the first financial product published in the most recent first number of time units is obtained from the backend server.
[0104] The above-mentioned first number can be set based on actual needs, for example, it can be set to 3, 5, 10, etc., and the embodiment of the present invention is not limited to this.
[0105] Step S202: Analyze the attitude polarity of each news message towards the performance of the first financial product.
[0106] The above attitude polarity can be negative or positive.
[0107] Specifically, the attitude polarity of each news message on the performance of the first financial product can be obtained in the following way.
[0108] In one implementation, for each news message, the news message may be input into a pre-trained sentiment analysis network model to obtain the attitude polarity output by the model.
[0109] In another implementation method, for each news message, emotion-related words in the news message, called emotion words, can be identified, and then the number of words with positive emotions in these emotion words, that is, the number of positive words, and the number of words with negative emotions in these situation words, that is, the number of negative words, are counted. Based on the number of positive words and the number of negative words, the above-mentioned attitude polarity is determined.
[0110] For example, in one case, the ratio of the number of positive words to the number of negative words can be calculated. If the ratio is greater than 1, the attitude polarity can be determined to be positive, otherwise, the attitude polarity can be determined to be negative. In another case, the number of positive words and the number of negative words can be determined. If the number of positive words is greater than the number of negative words, the attitude polarity can be determined to be positive, otherwise, the attitude polarity can be determined to be negative.
[0111] It should be noted that in this step, the attitude polarity of each news message towards the first financial product can be obtained by analyzing after the crawler crawls the news message, so that the attitude polarity of the news message towards the first financial product can be stored in the background server. In addition, the attitude polarity of the news message towards the first financial product can also be performed after the above step S201 is performed, and the embodiment of the present invention is not limited to this.
[0112] Step S203: Taking time units as units, count the second number of news messages representing positive attitudes and the third number of news messages representing negative attitudes, and obtain the second number and the third number corresponding to each time unit.
[0113] In this step, the second quantity and the third quantity are counted in units of time units, so that for each time unit, a pair of the second quantity and the third quantity is obtained. From the previous description, it can be seen that in this embodiment, the first number of time units should be considered, so after the quantity is counted in this step, the second quantity and the third quantity corresponding to the first number of time units can be obtained, that is, the first quantity can be obtained. The second quantity and the third quantity.
[0114] Step S204: If the second quantity or the third quantity corresponding to each time unit is missing, fill in the missing values, and determine the second quantity and the third quantity corresponding to each time unit after the missing values are filled in as the public opinion information of the first financial product.
[0115] When using a web crawler to crawl news, it may be affected by factors such as the crawling time length and crawling scope, and the crawled news about the first financial product may be incomplete. In this way, the second quantity and / or third quantity corresponding to some time units may be missing. In order to improve the accuracy of the determined public opinion information, the missing quantity is filled in this embodiment.
[0116] Specifically, missing values can be filled according to the following expression:
[0117]
[0118] in, Indicates the fill value, Indicates the number of non-missing quantities in the target quantity corresponding to each time unit. The target quantity is: the second quantity or the third quantity. Represents the total number of time units, represents the number of targets corresponding to the i-th time unit, Indicates whether the target quantity corresponding to the i-th time unit is missing.
[0119] Step S205: If the second quantity and the third quantity corresponding to each time unit are not missing, the second quantity and the third quantity corresponding to each time unit are determined as the public opinion information of the first financial product.
[0120] In one embodiment of the present invention, considering that the second and third quantities are quantitative data and differ greatly from qualitative data such as the market fluctuation information of the first financial product, the public opinion information of the first financial product can be normalized. In this way, the scaling of the public opinion information can be achieved and maintained at the same data scale as the market fluctuation information, thereby increasing the availability of the public opinion information in sentiment prediction.
[0121] As can be seen from the above, the scheme provided by this embodiment obtains the public opinion information of the first financial product from the perspective of the attitude polarity expressed by each news message towards the first financial product. Since the second number is the number of news messages representing positive attitudes, and the third number is the number of news messages representing negative attitudes, the second number and the third number can intuitively reflect whether there are more positive or negative public opinions on the first financial product in each time unit, which can make the public opinion information of the first financial product more intuitive. In addition, in the scheme provided by this embodiment, in order to prevent the obtained news messages from being incomplete, resulting in the missing of the second number and / or the third number in each time unit, the missing numbers are filled with missing values, so that the second number and the third number corresponding to each time unit are more complete, thereby improving the accuracy of the obtained public opinion information.
[0122] In one embodiment of the present invention, after obtaining the market fluctuation information and public opinion information of the first financial product in the above step S101, the market fluctuation information and public opinion information of the first financial product may be mapped and transformed according to the following expression:
[0123]
[0124] in, represents the market fluctuation information or public opinion information of the i-th first financial product, Express The result after mapping transformation is: represents the total price held by the target user for the i-th first financial product, Indicates the total price of the target user's holdings of the 1st, 2nd, and nth first financial products, Represented as the amount of market fluctuation information or public opinion information of the first financial product.
[0125] Specifically, the market fluctuation information and public opinion information of the first financial product may be mapped and transformed according to the above expression.
[0126] When the market fluctuation information and public opinion information of the first financial product are mapped and transformed as above, the market fluctuation information and public opinion information of each first financial product can be mapped to the same dimension according to the proportion of the target user's holdings of different first financial products.
[0127] In view of the above situation, when the above step S103 obtains the features corresponding to each set dimension, specifically in each of the above set feature dimensions, feature extraction is performed on the obtained total revenue, the market fluctuation information after mapping transformation, the public opinion information after mapping transformation and the market situation information to obtain the features corresponding to each set dimension.
[0128] After the scheme provided in this embodiment is used to map and transform the financial products held by users, even if the number of financial products held by different users is different, that is, the amount of market fluctuation information and public opinion information of financial products obtained by different users is different, the market fluctuation information, public opinion information, etc. corresponding to each user can be unified into the same dimension, so that the data of different users have the same number of items, which provides convenience for different users to use the same method to perform emotion prediction, especially when using a neural network model for emotion prediction, because once the neural network model is trained, it generally requires the same dimension of the input data. After the mapping transformation is performed using the above method, it can well ensure that the data dimensions of different users are the same, which can well ensure the smooth progress of emotion prediction.
[0129] In addition, the above-mentioned method for mapping transformation can effectively avoid data sparsity compared to the common zero-filling method, especially when the data of financial products held by different users are very different, the effect of reducing data sparsity is more obvious. Furthermore, once the obtained data is relatively sparse, it is easy to cause large memory overhead and reduce device performance. After applying the scheme provided by the above embodiment for mapping transformation, the memory overhead can be greatly reduced, thereby improving the performance of the device.
[0130] The following describes a method for determining and setting feature dimensions.
[0131] In one embodiment of the present invention, see Figure 3 , a flow chart of a method for determining and setting feature dimensions is provided, the method comprising the following steps S301-S307.
[0132] Step S301: obtaining the total income of the second financial product held by the first sample user in the financial product market and the market fluctuation information of the second financial product in units of time, obtaining the public opinion information of the second financial product, and obtaining the market information of the financial product market.
[0133] Step S302: Obtaining behavioral data of a first sample user on a financial transaction platform.
[0134] It should be noted that the above steps S301 and S302 are similar to the above steps S101 and S102 respectively, and the only difference is the difference in the names of the target user and the first sample user, and the first financial product and the second financial product. The specific implementation method of each step is the same, so it will not be repeated here.
[0135] Step S303: In the expanded feature dimension, feature extraction is performed on the obtained total revenue, market fluctuation information, public opinion information and market situation information to obtain features corresponding to the expanded feature dimension.
[0136] The above-mentioned expanded feature dimension is a pre-set feature dimension, and specifically may include multiple feature dimensions.
[0137] In one embodiment of the present invention, the expanded feature dimension includes at least one of the following dimensions 1 to 5:
[0138] Dimension 1: Count feature dimension
[0139] The features of the counting feature dimension include: the fifth number of financial products lacking positive news and the sixth number of financial products lacking negative news among the financial products held by the user within the time unit.
[0140] For example, in a time unit, a user holds 5 financial products, of which 1 financial product has no positive news, and 2 financial products have no negative news. Then the fifth quantity is 1, and the sixth quantity is 2. At this time, the features of the counting feature dimension include: 1 and 2.
[0141] Since the amount of financial product news held by a user can reflect the user's psychological tendencies to a certain extent, users who tend to hold financial products with fewer followers generally have relatively small emotional fluctuations. Therefore, introducing the above-mentioned counting feature dimension in the expanded feature dimension can reflect the user's emotional stability to a certain extent.
[0142] Dimension 2: Slope feature dimension
[0143] The characteristics of the above slope feature dimension represent the magnitude of changes in information over time.
[0144] For information such as the total amount of financial products held by users and the number of financial products held by users, the slope of change of this information can better reflect the changes in the user's psychological emotions than the information itself.
[0145] For information such as the total returns of financial products held by users and market fluctuations, the numerical changes of this information along the time series can also represent state changes related to user emotions.
[0146] In view of the above situation, the slope feature dimension is introduced into the expanded feature dimension to generate a slope feature that reflects the rate of change of information. Then, the slope feature can be used to determine whether there are abnormal mutations in the information. The abnormal mutations will affect the user's emotions. Therefore, the characteristics of the slope feature dimension can reflect the user's emotional changes and expand the characteristics that reflect the user's emotions.
[0147] Dimension 3: Combined feature dimension
[0148] The characteristics of the above-mentioned combined feature dimension are: characteristics formed by combining two types of features in the obtained features.
[0149] The above-mentioned acquired features may include the total income of the financial products held by the user, market fluctuation information, public opinion information and market information of the financial product market mentioned above. The above-mentioned two types of features are two different features among the above-mentioned acquired features.
[0150] Specifically, the features of the above combined feature dimensions can be generated according to the following expression:
[0151]
[0152] in, is the feature of the combined feature dimension, and There are two types of features among the obtained features.
[0153] Taking into account the fact that different features can jointly reflect user emotions, the combined feature dimension is introduced into the expanded feature dimension, so that features that can stably reflect user emotions can be obtained, thereby improving the stability of the features.
[0154] Dimension 4: Window feature dimension
[0155] The characteristics of the above-mentioned window feature dimension are: the weighted features obtained by adding the changes of various types of features along the time unit.
[0156] Specifically, when performing the above weighting operation, a higher weight may be assigned to a newer feature, that is, a feature whose generation time of the corresponding original data is closer to the emotion prediction time is assigned a higher weight.
[0157] The features of the above window feature dimensions change over time, and various types of features within the window are aggregated into one feature. This feature transformation is conducive to improving the stability of the features. Using stable features for sentiment prediction can improve the accuracy of the prediction results.
[0158] Dimension 5: Statistical feature dimension
[0159] The feature of the above statistical feature dimension is: the statistical value of the obtained features of a type in the seventh number of time units of the obtained features of the type.
[0160] The seventh number of time units is a continuous number of time units, and may be the seventh number of time units from the time when the emotion prediction is performed.
[0161] The above statistical values can be the maximum value, minimum value, variance, mean, skewness, etc. of the feature.
[0162] For a type of feature, it is generally stable for a long time under normal conditions. When there is a pulse on the stable sequence, it indicates an abnormality. This abnormality can often reflect the changes in the user's psychological emotions. This abnormality can be reflected by the maximum value and value range of the feature. In addition, abnormal fluctuations and the continuous growth of abnormal fluctuations can also reflect that the time series of the feature is abnormal. The above abnormal fluctuations and continuous growth can be represented by the variance and mean of the feature sequence.
[0163] It can be seen from the above description that the above five different feature dimensions reflect the user's emotional changes from different angles. In this way, introducing the above five different feature dimensions into the feature expansion process can enrich the extracted features.
[0164] Step S304: using a statistical method to determine the first scores corresponding to the total revenue, market fluctuation information, public opinion information, market information, and features corresponding to the expanded feature dimension.
[0165] The first score represents the amount of information contained. A higher first score represents more information contained in the feature.
[0166] In one implementation, the above statistical method may include at least one of a chi-square test, information gain calculation, and correlation coefficient calculation, so that the implicit information of the feature can be derived from a statistical perspective.
[0167] Step S305: Determine the second scores corresponding to the obtained total revenue, market fluctuation information, public opinion information, market information, and features corresponding to the expanded feature dimension.
[0168] The second score represents the contribution to the prediction of the user's sentiment description information on the financial product market.
[0169] Specifically, the second score can be obtained based on a model, where the model is a model for predicting the user's emotional description information for the financial product market. The number of the models can be multiple, for example, 2, 3, etc., and these models are different models.
[0170] When determining the above-mentioned second score, the total revenue, market fluctuation information, public opinion information, market information and features corresponding to the expanded feature dimension can be input into different models one by one to obtain the emotional description information output by the model, and the contribution degree of the features input into the model in the process of the model generating emotional description information can be obtained, that is, the role degree of the input features in the process of generating emotional description information, that is, the gain of the features to the model's prediction performance.
[0171] Step S306: Based on the first score and the second score obtained, generate final scores corresponding to the total revenue, market fluctuation information, public opinion information, market information, and features corresponding to the expanded feature dimension, and select a fourth number of scores from the generated final scores in descending order.
[0172] After the above steps S305 and S306, the total revenue, market fluctuation information, public opinion information, market information, and features corresponding to the expanded feature dimensions will respectively obtain multiple first scores and second scores. In one implementation, for each feature of the total revenue, market fluctuation information, public opinion information, market information, and features corresponding to the expanded feature dimensions, the average of the first score and the second score corresponding to the feature is calculated as the final score of the feature. Of course, the highest score or the lowest score among the first score and the second score corresponding to each feature can also be used as the final score of the feature, and the embodiment of the present invention is not limited to this.
[0173] Step S307: Determine the feature dimension corresponding to the selected score as the set feature dimension.
[0174] If the feature dimensions corresponding to the selected score include: the total return obtained, market volatility information, features corresponding to the slope feature dimension, and features corresponding to the count feature dimension, then the above-mentioned set feature dimensions include: the total return dimension of the financial products held by the user, the market volatility information dimension of the financial products held by the user, the slope feature dimension, and the technical feature dimension.
[0175] As can be seen from the above, in the solution provided by this embodiment, feature screening is performed based on the total revenue, market fluctuation information, public opinion information, market information and expanded feature dimensions obtained, and in the screening process, not only statistical methods are considered, but also the contribution of various features to predicting the user's emotional description information for the financial product market is considered. In this way, the screened features not only take into account the gain of the features on the performance of predicting the emotional description information, but also retain the implicit information of the features derived from the statistical perspective to the greatest extent. Subsequent emotional description information prediction based on the features screened out in this way can improve the accuracy of the prediction.
[0176] The following is an explanation of the method of predicting the correlation between the target user's emotion and the financial product market in the above step S104.
[0177] In one embodiment of the present invention, based on the above-obtained features, the following steps A to D are used to predict the correlation between the target user's emotions and the financial product market:
[0178] Step A: Input the obtained features into the root node of the first decision tree arranged in order in the decision tree group, and perform feature value judgment processing on the obtained features node by node starting from the root node of the first decision tree, to obtain the predicted correlation between the target user's emotions and the financial product market output by the leaf node of the first decision tree and predicted according to the correlation prediction strategy corresponding to the first decision tree.
[0179] The decision tree group is pre-trained, and the decision tree group includes multiple decision trees. The arrangement order between the decision trees is set before training the decision tree group. The decision trees in the decision tree group can be gradient boosting decision trees, and each decision tree can have the same structure.
[0180] Each decision tree includes multiple nodes, and these nodes are arranged layer by layer according to a tree structure. For example, a decision tree can be a binary tree. The first layer of the decision tree includes a node, which is called the root node of the decision tree. The nodes included in the last layer of the decision tree are called leaf nodes, and the leaf nodes output the output results of the decision tree.
[0181] In addition, nodes other than leaf nodes in the decision tree are set with thresholds corresponding to the nodes, and the specific values of the thresholds can be obtained through training.
[0182] Each decision tree in the decision tree group has a different division of labor, wherein the first decision tree arranged in the above order is used to predict the correlation between the user's emotions and the financial product market, and the other decision trees are used to predict the adjustment value of the correlation between the user's emotions and the financial product market. In view of this, the first decision tree corresponds to a correlation prediction strategy, and the other decision trees correspond to a correlation adjustment value prediction strategy, and the correlation adjustment values corresponding to different decision trees may be different.
[0183] For each decision tree, the above-mentioned feature value judgment processing is performed by nodes other than leaf nodes in the decision tree. Specifically, in the application process, that is, in the process of using the decision tree for data prediction, the feature value judgment processing performed by the node can be understood as judging whether the feature value of the feature input to the node is greater than the threshold corresponding to the node. If greater than, the feature value greater than the above threshold is output to the next layer of child nodes. For example, in the case where the decision tree is a binary tree, the feature value greater than the above threshold can be input into the left child node of the next layer of nodes.
[0184] Based on the above description, it can be seen that the predicted correlation output by the leaf node in the first decision tree is obtained based on the feature prediction obtained after the feature values of the obtained features are judged layer by layer by the nodes in each layer other than the leaf node in the decision tree.
[0185] Step B: Input the target input data into the root node of the target decision tree in the decision tree group, and perform feature value judgment processing on the obtained features included in the target input data node by node starting from the root node of the target decision tree, and obtain the adjustment value of the correlation between the target user's emotion and the financial product market predicted by the correlation adjustment value prediction strategy corresponding to the target decision tree, which is output by the leaf node of the target decision tree.
[0186] The initial value of the target decision tree is: the second decision tree arranged in order in the decision tree group, and the target input data includes: the obtained features and the output data of the leaf nodes in the previous decision tree of the target decision tree.
[0187] When the target decision tree is the second decision tree, the output data of the leaf node in the previous decision tree included in the target input data is: the predicted correlation degree output by the leaf node of the first decision tree.
[0188] When the target decision tree is the third decision tree and subsequent decision trees, the output data of the leaf nodes in the previous decision tree included in the target input data is: the adjusted value of the degree of association output by the leaf nodes of the previous decision tree.
[0189] Based on the description in step A above, it can be seen that the adjustment value of the correlation degree output by the leaf node in the target decision tree is obtained based on the feature prediction obtained after the feature values of the obtained features are judged layer by layer by the nodes in each layer other than the leaf node in the target decision tree.
[0190] Step C: If there is a decision tree in the decision tree group that has not been processed for feature value judgment, update the target decision tree to the next decision tree in sequence, and return to step B.
[0191] It should be noted that after the target decision tree is updated to the next decision tree, because the target input data includes the output data of the leaf nodes in the previous decision tree of the target decision tree, if the target decision tree changes, the above output data included in the target input data will also change accordingly.
[0192] For example, the target decision tree is the third decision tree. At this time, the output data included in the target input data is: the adjusted value output by the leaf node in the second decision tree. After the target decision tree is updated, the target decision tree is updated to the fourth decision tree. At this time, the target input data changes, and the output data included therein changes to the adjusted value output by the leaf node in the third decision tree.
[0193] Step D: If there is no decision tree in the decision tree group that has not been subjected to feature value judgment processing, the predicted correlation and the sum of all the obtained adjustment values are calculated, and the sum is determined as the correlation between the target user's emotion and the financial product market.
[0194] As can be seen from the above, in the solution provided by this embodiment, for each decision tree, after the node performs feature screening, that is, the input features are divided into two categories, one category is the features to be passed to the next layer of nodes, and the other category is the features that do not need to be passed to the next layer of nodes, so that the features are screened layer by layer. In addition, the closer the above-mentioned final correlation is to 1, the higher the correlation between the user's emotions and the financial product market is, and the closer the above-mentioned correlation is to 0, the lower the correlation between the user's emotions and the financial product market is. Furthermore, it can be seen from the above process that the latter decision tree in the above-mentioned decision tree group learns the deviation of the corresponding node of the previous decision tree, that is, the adjustment value mentioned above, and then summarizes all decision tree decisions to obtain the final result, that is, the correlation between the final user's emotions and the financial product market. In this way, the degree of correlation between each user's emotions and the financial product market can be predicted more accurately, laying the foundation for the subsequent use of predicting user emotions.
[0195] The training process of the above decision tree group is introduced below.
[0196] Each decision tree in the above decision tree group is trained by following steps E-J:
[0197] Step E: Obtain sample features corresponding to sample users, and obtain the labeled correlation between the sample users' emotions and the financial product market.
[0198] The method of obtaining the above-mentioned sample features is similar to the method of obtaining the "obtained features" mentioned in the previous article. The only difference is that the user data used to obtain the sample features is the data of the sample user, while the user data used to obtain the "obtained features" is the data of the target user. Therefore, it will not be repeated here.
[0199] Step F: Input the sample features into the root node of the first decision tree arranged in order in the decision tree group, split the sample features node by node starting from the root node of the first decision tree, and obtain the sample prediction correlation between the sample user's emotions and the financial product market predicted by the correlation prediction strategy corresponding to the first decision tree and the leaf node output of the first decision tree.
[0200] In each decision tree, each node except the leaf node is set with a split threshold. The splitting processing based on this can be understood as the following process: obtain the loss value of the first correlation degree corresponding to each feature of the input node relative to the above-mentioned labeled correlation degree. If the loss value is greater than the split threshold corresponding to the node, the feature is classified as a feature that needs to be transmitted to the next layer of nodes. If the loss value is not greater than the split threshold corresponding to the node, the feature is classified as a feature that does not need to be transmitted to the next layer of nodes. After that, the features classified as needing to be transmitted to the next layer of nodes are transmitted to the next layer of nodes.
[0201] The first correlation corresponding to each of the above features is: the correlation between the sample user's emotions predicted by each feature and the financial product market.
[0202] In this way, after training, the nodes of each decision tree can know which features to transfer to the nodes of the next layer. These features to be transferred to the next layer can be called specific features corresponding to the node.
[0203] Feature G: Input the sample input data into the root node of the target decision tree in the decision tree group, and split the sample features included in the sample input data node by node starting from the root node of the target decision tree to obtain the sample adjustment value of the correlation between the target user's emotion and the financial product market predicted by the correlation adjustment value prediction strategy corresponding to the target decision tree, which is output by the leaf node of the target decision tree.
[0204] The initial value of the target decision tree is: the second decision tree in the decision tree group arranged in the above order, and the sample input data includes: sample features and output data of leaf nodes in the previous decision tree of the target decision tree.
[0205] Step H: If there is a decision tree in the decision tree group that has not been split, update the target decision tree to the next decision tree arranged in the above order, and return to execute step G.
[0206] Step I: If there is no decision tree in the decision tree group that has not been split, calculate the sample prediction correlation and the sum of all the sample adjustment values obtained, and determine the calculated sum as the correlation between the sample user's emotions and the financial product market.
[0207] Step J: Based on the difference between the association degree obtained in the above step I and the above labeled association degree, the parameters of each decision tree in the decision tree group are adjusted.
[0208] If the training end condition is not met, then continue to execute the above steps E to J. If the training end condition is met, then stop the training to obtain the trained decision tree group.
[0209] When adjusting the parameters of each decision tree in the decision tree group, the strategy corresponding to each decision tree, the threshold corresponding to the node in the decision tree, that is, the splitting threshold corresponding to the node in the decision tree, etc. can be adjusted.
[0210] Based on the above description, the text generation method of a financial product provided by an embodiment of the present invention is described in detail below.
[0211] See also Figure 4 , a flow chart of a method for generating text of a financial product is provided, the method comprising the following steps S401-S405.
[0212] Step S401: Obtaining target user's emotional description information on the financial product market.
[0213] The emotion description information mentioned in this step is obtained using the solution provided in the above-mentioned embodiment, which will not be described in detail here.
[0214] Step S402: Obtain the template text of the text to be generated of the target financial product.
[0215] The target financial product may be a financial product to be recommended to the target user.
[0216] The template text of the text to be generated may be specifically related to the purpose of recommending the target financial product to the target user. For example, if the purpose is to market the target financial product to the target user, the template text is a marketing template text; if the purpose is to introduce the target financial product to the target user, the template text is a product introduction template text.
[0217] Specifically, the above template text can be obtained from the backend server of the financial transaction platform.
[0218] Step S403: extracting text topic keywords from the template text, and obtaining emotion keywords based on the emotion description information.
[0219] Specifically, a PLSA (probabilistic latent semantic analysis) model, a keyword extraction algorithm, a part-of-speech recognition algorithm, etc. may be used to extract text topic keywords from the template text.
[0220] The above algorithm can also be used to extract keywords from the emotion description information to obtain emotion keywords. In addition, since the emotion description information itself can also exist in the form of keywords, in this case, the emotion description information can also be directly used as emotion keywords.
[0221] Step S404: using the template text, text topic keywords and emotional keywords as discrete prefix prompt information, inputting the discrete prefix prompt information into the encoding layer of the pre-trained text generation large language model, and obtaining the hidden features of the first feature output by the encoding layer through feature extraction of the first feature.
[0222] Among them, the first feature is: the encoding layer performs multi-head attention transformation on the discrete prefix prompt information and the trained continuous prefix prompt information, and obtains the feature that characterizes the relationship between the information in the discrete prefix prompt information.
[0223] Specifically, the template text, text theme keywords and emotional keywords may be firstly structured to obtain structured information as discrete prefix prompt information.
[0224] The above-mentioned text generation large language model can be a model based on the Transformer network architecture. The network model architecture includes an encoding layer and a decoding layer. The encoding layer is responsible for converting the input sequence into a series of vector representations, and the decoding layer uses these vector representations to generate an output sequence, wherein the above-mentioned vector representation is the hidden feature of the above-mentioned first feature.
[0225] Since the continuous prefix prompt information is the trained data, after the above discrete prefix prompt information is input into the encoding layer, the encoding layer not only performs multi-head attention transformation on the discrete prefix prompt information, but also performs multi-head attention transformation on the discrete prefix prompt information and the continuous prefix prompt information together, and the result of the multi-head attention transformation can be input into the feedforward neural network and normalization to perform Softmax transformation and normalization processing, etc., so as to obtain the hidden feature of the above first feature.
[0226] Step S405: The hidden features of the first feature, the text topic keywords, the emotional polarity and the continuous prefix prompt information corresponding to the emotional keywords are input into the decoding layer of the text generation large language model to decode and transform the input information, and obtain the characters in the text to be generated around the emotional keywords output by the decoding layer.
[0227] In this step, in addition to inputting the hidden features of the first feature into the decoding layer, the text topic keywords, emotional polarity corresponding to the emotional keywords and the continuous prefix prompt information are also input into the decoding layer as control quantities. The above control quantities can constrain the generated text based on the text topic and user emotions.
[0228] When the decoder decodes the hidden features of the above-mentioned first feature and the above-mentioned control amount, it can first convert the above-mentioned control amount into the form of Key-Value, perform masked multi-head attention transformation on the result obtained after the transformation, and then perform multi-head attention transformation on the masked multi-head attention transformation result and the hidden features of the first feature. After that, the result of the multi-head attention transformation is input into the feedforward neural network and the normalization layer for Softmax transformation and normalization processing, etc., to obtain the characters in the text to be generated around the emotional keywords.
[0229] The following is a brief explanation of the above process from the perspective of training a large language model for text generation.
[0230] For an input sequence X={x1, x2, …x n |y}, where x1, x2, ..., x n is a character in text x, the discrete prompt information obtained based on the above text x and emotion description information y is denoted as D, and the continuous prefix is denoted as PREFIX. The training sample Z composed of the above information is: Z=[PREFIX; D; X].
[0231] When training the model, a trainable parameter matrix is initialized for PREFIX. The dimension of the matrix is the length of PREFIX multiplied by the dimension of the model hidden state. The hidden state of the above model can be expressed by the following expression:
[0232]
[0233] Among them, LM is an autoregressive language model, which is the initial model of the large language model generated by the above text. Expressed as the parameterization of the autoregressive language model, is the above trainable parameter matrix. Generate activations at the i-th layer token in the large language model for a text with l layers, that is, the token in PREFIX (which can be understood as a discrete text unit) is used The discrete prompt information D outside PREFIX and the token of input X are output normally using the LM activation layer. is the prefix prompt information when the time step is i, Generate activations for text at tokens smaller than the i-th layer in the large language model. Tokens outside PREFIX will still be affected by PREFIX because PREFIX is always on the left. In essence, a PREFIX vector is concatenated before the K and V vectors of each token in each layer. The probability of the final text can be modeled as P(X)=P(X|PREFIX,D).
[0234] From the above description, it can be seen that in the solution provided in the embodiment of the present application, continuous prefix prompt information is added to each layer of the large language model for text generation, rather than only adding continuous prefix prompt information to the input layer. In this way, feature vectors in the continuous space can be generated and optimized during the text generation process, thereby improving the quality and accuracy of the generated text.
[0235] When the technical solution provided by the embodiment of the present invention is applied to text generation, the various types of texts for various financial products are not directly manually generated by the staff. Instead, the text is generated with the help of a large language model. After the text subject keywords extracted from the template text of the to-be-generated text of the target financial product and the emotional keywords obtained based on the emotional description information are input into the large language model used for text generation, the large language model outputs the text of the target financial product. This saves the staff the operation of manually generating text, thereby improving the efficiency of text generation.
[0236] In addition, when using the large language model to generate the text of the target financial product, the different user information of each user is taken into consideration, and different emotions will be generated with the fluctuation of market conditions. Therefore, the emotional description information of the above users is introduced into the large language model, so that the large language model can output high-quality financial text that matches the user's emotions.
[0237] Furthermore, when the scheme provided by the embodiment of the present invention is used to generate financial texts, the user's information is taken into consideration. Thus, different information is considered for different users, and the generated texts are also targeted at different users and are personalized and specific. Thus, the scheme provided by the embodiment of the present invention can generate financial texts for different users.
[0238] Furthermore, when generating financial text, template text, text subject keywords and emotional keywords are used as discrete prefix prompt information, so that financial text can be generated around the discrete prefix prompt information, that is, the generated financial text is around the above template text, text subject keywords and emotional keywords.
[0239] It should be noted that in the technical solution of the present invention, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0240] Corresponding to the above-mentioned method for generating text of a financial product, an embodiment of the present invention further provides a structural schematic diagram of a device for generating text of a financial product.
[0241] See also Figure 5 , a schematic diagram of a structure of a text generation device for a financial product is provided, the device comprising:
[0242] The emotion description information acquisition module 501 is used to obtain the emotion description information of the target user with respect to the financial product market;
[0243] The template text obtaining module 502 is used to obtain the template text of the to-be-generated text of the target financial product;
[0244] A keyword acquisition module 503 is used to extract text topic keywords from the template text and obtain emotional keywords based on the emotional description information;
[0245] The hidden feature obtaining module 504 is used to use the template text, the text theme keywords and the emotional keywords as discrete prefix prompt information, input the discrete prefix prompt information into the encoding layer of the pre-trained text generation large language model, and obtain the hidden feature of the first feature output by the encoding layer after feature extraction on the first feature, wherein the first feature is: the feature characterizing the relationship between each information in the discrete prefix prompt information obtained by performing multi-head attention transformation on the discrete prefix prompt information and the trained continuous prefix prompt information by the encoding layer;
[0246] The character acquisition module 505 is used to input the hidden features of the first feature, the text theme keywords, the emotional polarity and the continuous prefix prompt information corresponding to the emotional keywords into the decoding layer of the text generation large language model to decode and transform the input information, and obtain the characters in the text to be generated around the emotional keywords output by the decoding layer.
[0247] In one embodiment of the present invention, the emotion description information obtaining module 501 includes:
[0248] The information acquisition submodule is used to obtain the total income of the first financial product held by the target user in the financial product market and the market fluctuation information of the first financial product, obtain the public opinion information of the first financial product, and obtain the market information of the financial product market in units of time;
[0249] The behavior data acquisition submodule is used to obtain the behavior data of the target user on the financial trading platform;
[0250] The feature acquisition submodule is used to obtain the features corresponding to each set feature dimension based on the total revenue, market fluctuation information, public opinion information and market information obtained;
[0251] A correlation prediction submodule is used to predict the correlation between the target user's emotions and the financial product market based on the obtained features;
[0252] The emotion description information acquisition submodule is used to obtain the emotion description information of the target user for the financial product market using the obtained features and correlations.
[0253] In one embodiment of the present invention, the first obtaining module includes:
[0254] A news information obtaining unit, used to obtain news information of a first financial product in the latest first number of time units;
[0255] An attitude polarity analysis unit, used to analyze the attitude polarity of each news message on the performance of the first financial product;
[0256] The quantity obtaining unit is used to count the second quantity of news messages representing positive attitudes and the third quantity of news messages representing negative attitudes in units of time units, and obtain the second quantity and the third quantity corresponding to each time unit; if the second quantity or the third quantity corresponding to each time unit is missing, the missing value is filled according to the following expression, and the second quantity and the third quantity corresponding to each time unit after the missing value is filled are determined as the public opinion information of the first financial product:
[0257]
[0258] in, Indicates the fill value, Indicates the number of non-missing quantities in the target quantity corresponding to each time unit. The target quantity is: the second quantity or the third quantity. Represents the total number of time units, represents the number of targets corresponding to the i-th time unit, Indicates whether the target quantity corresponding to the i-th time unit is missing; if the second quantity and the third quantity corresponding to each time unit are not missing, the second quantity and the third quantity corresponding to each time unit are determined as the public opinion information of the first financial product.
[0259] In one embodiment of the present invention, the above-mentioned behavior data includes at least one of the following information:
[0260] The transaction frequency of target users;
[0261] The number of times the target users browsed news about financial products in the first period of time;
[0262] The number of complaints from target users in the second period;
[0263] The number of target users’ emotions fluctuating during the third time period.
[0264] In one embodiment of the present invention, the above-mentioned text generation device for financial products further includes:
[0265] The mapping change module is used to map and transform the market fluctuation information and public opinion information of the first financial product according to the following expression:
[0266]
[0267] in, represents the market fluctuation information or public opinion information of the i-th first financial product, Express The result after mapping transformation is: represents the total price held by the target user for the i-th first financial product, Indicates the total price of the target user's holdings of the 1st, 2nd, and nth first financial products, It is expressed as the amount of market fluctuation information or public opinion information of the first financial product;
[0268] The feature acquisition submodule is specifically used to extract features of the total revenue, market fluctuation information after mapping transformation, public opinion information after mapping transformation and market information in each set feature dimension, so as to obtain features corresponding to each set dimension.
[0269] In one embodiment of the present invention, the text generation device of the financial product determines and sets the feature dimension in the following manner:
[0270] Taking time units as units, obtaining the total income of the second financial product held by the first sample user in the financial product market and the market fluctuation information of the second financial product, obtaining the public opinion information of the second financial product, and obtaining the market information of the financial product market;
[0271] Obtaining behavioral data of the first sample user on the financial trading platform;
[0272] In the expanded feature dimension, feature extraction is performed on the total revenue, market fluctuation information, public opinion information, and market information to obtain features corresponding to the expanded feature dimension;
[0273] Determine, by statistical means, first scores corresponding to the total revenue, market fluctuation information, public opinion information, market information, and features corresponding to the expanded feature dimension, respectively, wherein the first scores represent the amount of information contained;
[0274] Determine the second scores corresponding to the total revenue, market fluctuation information, public opinion information, market information, and features corresponding to the expanded feature dimension, respectively, wherein the second scores represent the contribution to the prediction of the user's emotional description information on the financial product market;
[0275] Based on the obtained first score and the second score, generating final scores corresponding to the obtained total revenue, market fluctuation information, public opinion information, market information, and features corresponding to the expanded feature dimension, respectively, and selecting a fourth number of scores from the generated final scores in descending order of scores;
[0276] The feature dimension corresponding to the selected score is determined as the set feature dimension.
[0277] In one embodiment of the present invention, the expanded feature dimension includes at least one of the following dimensions:
[0278] A counting feature dimension, wherein the features of the counting feature dimension include: a fifth number of financial products lacking positive news messages and a sixth number of financial products lacking negative news messages among the financial products held by the user within the time unit;
[0279] Slope feature dimension, where the characteristics of the slope feature dimension represent the magnitude of changes in information over time;
[0280] A combined feature dimension, wherein the feature of the combined feature dimension is: a feature formed by combining two types of features in the obtained features;
[0281] Window feature dimension, wherein the characteristics of the window feature dimension are: the weighted features obtained by the changes of various types of features along the time unit;
[0282] The statistical feature dimension is characterized by: the statistical value of the obtained features of a type in the seventh number of time units of the obtained features of the type.
[0283] In one embodiment of the present invention, the above-mentioned correlation prediction submodule is specifically used to input the obtained features into the root node of the first decision tree arranged in order in the decision tree group, and perform feature value judgment processing on the obtained features node by node starting from the root node of the first decision tree, so as to obtain the predicted correlation between the target user's emotions and the financial product market output by the leaf node of the first decision tree and predicted according to the correlation prediction strategy corresponding to the first decision tree; input the target input data into the root node of the target decision tree in the decision tree group, and perform feature value judgment processing on the obtained features included in the target input data node by node starting from the root node of the target decision tree, so as to obtain the predicted correlation between the target user's emotions and the financial product market output by the leaf node of the target decision tree and predicted according to the correlation adjustment value prediction strategy corresponding to the target decision tree. The adjustment value of the correlation between the emotion of the target user and the financial product market, wherein the initial value of the target decision tree is: the second decision tree in the decision tree group arranged in the order, and the target input data includes: the obtained features and the output data of the leaf nodes in the previous decision tree of the target decision tree; if there is a decision tree in the decision tree group that has not been processed by feature value judgment, the target decision tree is updated to the next decision tree arranged in the order, and the step of inputting the target input data into the root node of the target decision tree in the decision tree group is returned to execute; if there is no decision tree in the decision tree group that has not been processed by feature value judgment, the sum of the predicted correlation and all the adjusted values obtained is calculated, and the sum is determined as the correlation between the emotion of the target user and the financial product market.
[0284] In one embodiment of the present invention, the above-mentioned emotion description information acquisition submodule is specifically used to input the obtained features and relevance into a pre-trained relevance prediction model to obtain the target user's emotion description information for the financial product market output by the relevance prediction model;
[0285] Among them, the relevance prediction model is trained based on the following loss function:
[0286]
[0287] Where L represents the loss value, N represents the total number of second sample users, represents the correlation between the sentiment of the i-th second sample user and the financial product market, Indicates the true value of whether the i-th second sample user has a positive sentiment towards the financial product market, It represents the predicted probability that the i-th second sample user has a positive sentiment towards the financial product market.
[0288] The beneficial effects of the above-mentioned various device embodiments can be found in the above-mentioned method embodiment part, which will not be repeated here.
[0289] The embodiment of the present invention further provides an electronic device, such as Figure 6 As shown, it includes a processor 601 , a communication interface 602 , a memory 603 and a communication bus 604 , wherein the processor 601 , the communication interface 602 , and the memory 603 communicate with each other via the communication bus 604 .
[0290] Memory 603, used for storing computer programs;
[0291] The processor 601 is used to implement the text generation solution for financial products provided by the above method embodiment when executing the program stored in the memory 603.
[0292] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0293] The communication interface is used for communication between the above electronic device and other devices.
[0294] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0295] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0296] In another embodiment provided by the present invention, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the text generation solution for the financial product provided by the above method embodiment is implemented.
[0297] In another embodiment provided by the present invention, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute the text generation solution for the financial product provided by the above method embodiment.
[0298] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.
[0299] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0300] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0301] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A method for generating text of a financial product, characterized in that: The method comprises: Obtain target users’ sentiment description information on the financial product market; Obtaining a template text of the text to be generated of the target financial product; Extracting text topic keywords from the template text, and obtaining emotion keywords based on the emotion description information; The template text, the text topic keywords and the emotional keywords are used as discrete prefix prompt information, and the discrete prefix prompt information is input into the encoding layer of the pre-trained text generation large language model to obtain the hidden feature of the first feature output by the encoding layer through feature extraction on the first feature, wherein the first feature is: the feature characterizing the relationship between each information in the discrete prefix prompt information obtained by the encoding layer performing multi-head attention transformation on the discrete prefix prompt information and the trained continuous prefix prompt information; Input the hidden features of the first feature, the text topic keywords, the emotion polarity corresponding to the emotion keywords, and the continuous prefix prompt information into the decoding layer of the text generation large language model to decode and transform the input information, and obtain the characters in the text to be generated around the emotion keywords output by the decoding layer; The obtaining of the target user's emotional description information on the financial product market includes: Taking time units as units, obtaining the total income of a first financial product held by a target user in a financial product market and market fluctuation information of the first financial product, obtaining public opinion information of the first financial product, and obtaining market information of the financial product market; Obtaining the target user's behavior data on the financial transaction platform; Based on the total revenue, market fluctuation information, public opinion information and market information obtained, the features corresponding to each set feature dimension are obtained; Based on the obtained features, predict the correlation between the target user's emotions and the financial product market; The obtained features and the correlation are used to obtain the target user's sentiment description information for the financial product market.
2. The method according to claim 1, characterized in that The obtaining of public opinion information of the first financial product includes: Obtain news information about a first financial product in the most recent first number of time units; Analyze the attitude polarity of each news item on the performance of First Financial products; Taking time units as units, counting the second number of news messages representing positive attitudes and the third number of news messages representing negative attitudes, to obtain the second number and the third number corresponding to each time unit; If the second quantity or the third quantity corresponding to each time unit is missing, the missing value is filled according to the following expression, and the second quantity and the third quantity corresponding to each time unit after the missing value is filled are determined as the public opinion information of the first financial product: ; in, Indicates the fill value, represents the number of non-missing quantities in the target quantity corresponding to each time unit, where the target quantity is: the second quantity or the third quantity, Represents the total number of time units, represents the number of targets corresponding to the i-th time unit, Indicates whether the target quantity corresponding to the i-th time unit is missing; If the second quantity and the third quantity corresponding to each time unit are not missing, the second quantity and the third quantity corresponding to each time unit are determined as the public opinion information of the first financial product.
3. The method according to claim 1, characterized in that: The behavior data includes at least one of the following information: The transaction frequency of the target user; The number of times the target user browses news about financial products within the first period of time; The number of complaints made by the target user within the second time period; The number of emotional fluctuations of the target user within a third time period.
4. The method according to claim 1, characterized in that: After obtaining the market fluctuation information and public opinion information of First Financial products, it also includes: The market fluctuation information and public opinion information of the first financial product are mapped and transformed according to the following expression: ; in, represents the market fluctuation information or public opinion information of the i-th first financial product, Express The result after mapping transformation is: represents the total price held by the target user for the i-th first financial product, represents the total price held by the target user for the first, second, and nth first financial products, It is represented by the amount of market fluctuation information or public opinion information of the first financial product; Based on the obtained total revenue, market fluctuation information, public opinion information and market information, the features corresponding to each set dimension are obtained, including: In each set feature dimension, feature extraction is performed on the obtained total revenue, the market fluctuation information after mapping transformation, the public opinion information after mapping transformation, and the market situation information to obtain the features corresponding to each set dimension.
5. The method according to claim 1, characterized in that The feature dimensions are determined as follows: Taking time units as units, obtaining the total income of the second financial product held by the first sample user in the financial product market and the market fluctuation information of the second financial product, obtaining the public opinion information of the second financial product, and obtaining the market information of the financial product market; Obtaining behavioral data of the first sample user on the financial trading platform; In the expanded feature dimension, feature extraction is performed on the total revenue, market fluctuation information, public opinion information, and market information to obtain features corresponding to the expanded feature dimension; Determine, by statistical means, first scores corresponding to the total revenue, market fluctuation information, public opinion information, market information, and features corresponding to the expanded feature dimension, respectively, wherein the first scores represent the amount of information contained; Determine the second scores corresponding to the total revenue, market fluctuation information, public opinion information, market information, and features corresponding to the expanded feature dimension, respectively, wherein the second scores represent the contribution to the prediction of the user's emotional description information on the financial product market; Based on the obtained first score and the second score, generating final scores corresponding to the obtained total revenue, market fluctuation information, public opinion information, market information, and features corresponding to the expanded feature dimension, respectively, and selecting a fourth number of scores from the generated final scores in descending order of scores; The feature dimension corresponding to the selected score is determined as the set feature dimension.
6. The method according to claim 5, characterized in that The expanded feature dimension includes at least one of the following dimensions: A counting feature dimension, wherein the features of the counting feature dimension include: a fifth number of financial products lacking positive news messages and a sixth number of financial products lacking negative news messages among the financial products held by the user within the time unit; A slope feature dimension, wherein the feature of the slope feature dimension represents the magnitude of change of information over time; A combined feature dimension, wherein the feature of the combined feature dimension is: a feature formed by combining two types of features in the obtained features; Window feature dimension, wherein the feature of the window feature dimension is: a feature obtained by weighting the variation of various types of features obtained along the time unit; A statistical feature dimension, wherein the feature of the statistical feature dimension is: a statistical value of a type of obtained features in a seventh number of time units of the type of obtained features.
7. The method according to claim 1, characterized in that The predicting, based on the obtained features, the correlation between the target user's emotions and the financial product market includes: Input the obtained features into the root node of the first decision tree arranged in order in the decision tree group, perform feature value judgment processing on the obtained features node by node starting from the root node of the first decision tree, and obtain the predicted correlation between the target user's emotion and the financial product market output by the leaf node of the first decision tree and predicted according to the correlation prediction strategy corresponding to the first decision tree; Input the target input data into the root node of the target decision tree in the decision tree group, perform feature value judgment processing on the obtained features included in the target input data node by node starting from the root node of the target decision tree, and obtain the adjustment value of the correlation between the target user's emotion and the financial product market predicted by the correlation adjustment value prediction strategy corresponding to the target decision tree, which is output by the leaf node of the target decision tree, wherein the initial value of the target decision tree is: the second decision tree in the decision tree group arranged in the order, and the target input data includes: the obtained features and the output data of the leaf node in the previous decision tree of the target decision tree; If there is a decision tree in the decision tree group that has not been subjected to feature value judgment processing, the target decision tree is updated to the next decision tree arranged in the order, and the step of inputting the target input data into the root node of the target decision tree in the decision tree group is returned to execute; If there is no decision tree in the decision tree group that has not been subjected to feature value judgment processing, the predicted correlation degree and the sum of all the obtained adjustment values are calculated, and the sum is determined as the correlation degree between the emotion of the target user and the financial product market.
8. The method according to claim 1, characterized in that: The using the obtained features and the correlation to obtain the target user's emotional description information for the financial product market includes: Inputting the obtained features and the correlation into a pre-trained emotion prediction model to obtain the emotion description information of the target user for the financial product market output by the emotion prediction model; The emotion prediction model is trained based on the following loss function: ; Where L represents the loss value, N represents the total number of second sample users, represents the correlation between the sentiment of the i-th second sample user and the financial product market, Indicates the true value of whether the i-th second sample user has a positive sentiment towards the financial product market, It represents the predicted probability that the i-th second sample user has a positive sentiment towards the financial product market.
9. A text generation device for a financial product, characterized in that: The device comprises: The emotion description information acquisition module is used to obtain the emotion description information of the target user on the financial product market; A template text acquisition module, used to obtain the template text of the to-be-generated text of the target financial product; A keyword acquisition module, used to extract text topic keywords from the template text and obtain emotional keywords based on the emotional description information; A hidden feature acquisition module is used to use the template text, the text theme keywords and the emotional keywords as discrete prefix prompt information, input the discrete prefix prompt information into the encoding layer of the pre-trained text generation large language model, and obtain the hidden feature of the first feature output by the encoding layer after feature extraction on the first feature, wherein the first feature is: the feature characterizing the relationship between each information in the discrete prefix prompt information obtained by the encoding layer performing multi-head attention transformation on the discrete prefix prompt information and the trained continuous prefix prompt information; The character acquisition module is used to input the hidden features of the first feature, the text theme keywords, the emotion polarity corresponding to the emotion keywords and the continuous prefix prompt information into the decoding layer of the text generation large language model to decode and transform the input information, and obtain the characters in the text to be generated around the emotion keywords output by the decoding layer; the emotion description information acquisition module includes: an information acquisition submodule, which is used to obtain the total income of the first financial product held by the target user in the financial product market and the market fluctuation information of the first financial product in units of time, obtain the public opinion information of the first financial product, and obtain the market information of the financial product market; a behavior data acquisition submodule, which is used to obtain the behavior data of the target user on the financial trading platform; a feature acquisition submodule, which is used to obtain the features corresponding to each set feature dimension based on the total income, market fluctuation information, public opinion information and market information; a correlation prediction submodule, which is used to predict the correlation between the emotion of the target user and the financial product market based on the obtained features; and an emotion description information acquisition submodule, which is used to obtain the emotion description information of the target user for the financial product market using the obtained features and the correlation.
10. The device according to claim 9, characterized in that The information acquisition submodule is specifically used to obtain public opinion information of the first financial product through the following units: a news message acquisition unit is used to obtain news messages of the first financial product in the latest first number of time units; An attitude polarity analysis unit, used to analyze the attitude polarity of each news message on the performance of the first financial product; The quantity obtaining unit is used to count the second quantity of news messages representing positive attitudes and the third quantity of news messages representing negative attitudes in units of time units, and obtain the second quantity and the third quantity corresponding to each time unit; if the second quantity or the third quantity corresponding to each time unit is missing, the missing value is filled according to the following expression, and the second quantity and the third quantity corresponding to each time unit after the missing value is filled are determined as the public opinion information of the first financial product: ; in, Indicates the fill value, represents the number of non-missing quantities in the target quantity corresponding to each time unit, where the target quantity is: the second quantity or the third quantity, Represents the total number of time units, represents the number of targets corresponding to the i-th time unit, Indicates whether the target quantity corresponding to the i-th time unit is missing; if the second quantity and the third quantity corresponding to each time unit are not missing, the second quantity and the third quantity corresponding to each time unit are determined as the public opinion information of the first financial product; and / or The behavior data includes at least one of the following information: the transaction frequency of the target user; the number of times the target user browses news about financial products within a first time period; the number of times the target user complains within a second time period; the number of times the target user's mood swings within a third time period; and / or The device further includes: a mapping change module, which is used to map and transform the market fluctuation information and public opinion information of the first financial product according to the following expression after the information acquisition submodule obtains the market fluctuation information and public opinion information of the first financial product: ; in, represents the market fluctuation information or public opinion information of the i-th first financial product, Express The result after mapping transformation is: represents the total price held by the target user for the i-th first financial product, represents the total price held by the target user for the first, second, and nth first financial products; the feature acquisition submodule is specifically used to extract features of the obtained total income, the market fluctuation information after mapping transformation, the public opinion information after mapping transformation, and the market information in each set feature dimension to obtain the features corresponding to each set dimension. It is represented by the amount of market fluctuation information or public opinion information of the first financial product; and / or The set feature dimension is determined in the following manner: taking the time unit as the unit, obtaining the total income of the second financial product held by the first sample user in the financial product market and the market fluctuation information of the second financial product, obtaining the public opinion information of the second financial product, and obtaining the market information of the financial product market; obtaining the behavior data of the first sample user on the financial trading platform; in the expanded feature dimension, extracting the features of the total income, market fluctuation information, public opinion information and market information obtained, and obtaining the features corresponding to the expanded feature dimension; using statistical methods to determine the total income, market fluctuation information, public opinion information, market information and the features corresponding to the expanded feature dimension. A first score, wherein the first score represents the amount of information contained; determining second scores corresponding to the total revenue, market fluctuation information, public opinion information, market information, and features corresponding to the expanded feature dimension, wherein the second score represents the contribution to the prediction of the user's emotional description information for the financial product market; based on the first score and the second score obtained, generating final scores corresponding to the total revenue, market fluctuation information, public opinion information, market information, and features corresponding to the expanded feature dimension, respectively, and selecting a fourth number of scores from the generated final scores in descending order; determining the feature dimension corresponding to the selected score as the set feature dimension; and / or The extended feature dimension includes at least one of the following dimensions: a counting feature dimension, wherein the features of the counting feature dimension include: the fifth number of financial products lacking positive news messages and the sixth number of financial products lacking negative news messages among the financial products held by the user within the time unit; a slope feature dimension, wherein the features of the slope feature dimension represent the magnitude of change of information over time; a combination feature dimension, wherein the features of the combination feature dimension are: features formed by combining two types of features in the obtained features; a window feature dimension, wherein the features of the window feature dimension are: features obtained by weighting the changes of various types of features obtained along the time unit; a statistical feature dimension, wherein the features of the statistical feature dimension are: statistical values of a type of obtained features in the seventh number of time units of the type of obtained features; and / or The correlation prediction submodule is specifically used to input the obtained features into the root node of the first decision tree arranged in sequence in the decision tree group, perform feature value judgment processing on the obtained features node by node starting from the root node of the first decision tree, and obtain the predicted correlation between the target user's emotions and the financial product market output by the leaf node of the first decision tree and predicted according to the correlation prediction strategy corresponding to the first decision tree; input the target input data into the root node of the target decision tree in the decision tree group, perform feature value judgment processing on the obtained features included in the target input data node by node starting from the root node of the target decision tree, and obtain the target user's emotions output by the leaf node of the target decision tree and predicted according to the correlation adjustment value prediction strategy corresponding to the target decision tree. The adjustment value of the correlation between the user's emotions and the financial product market, wherein the initial value of the target decision tree is: the second decision tree in the decision tree group arranged in the order, and the target input data includes: the obtained features and the output data of the leaf nodes in the previous decision tree of the target decision tree; if there is a decision tree in the decision tree group that has not been processed by feature value judgment, the target decision tree is updated to the next decision tree arranged in the order, and the step of inputting the target input data into the root node of the target decision tree in the decision tree group is returned to execute; if there is no decision tree in the decision tree group that has not been processed by feature value judgment, the sum of the predicted correlation and all the obtained adjustment values is calculated, and the sum is determined as the correlation between the target user's emotions and the financial product market; and / or The emotion description information acquisition submodule is specifically used to input the obtained features and the correlation into a pre-trained correlation prediction model to obtain the target user's emotion description information for the financial product market output by the correlation prediction model; wherein the correlation prediction model is trained based on the following loss function: ; Where L represents the loss value, N represents the total number of second sample users, represents the correlation between the sentiment of the i-th second sample user and the financial product market, Indicates the true value of whether the i-th second sample user has a positive sentiment towards the financial product market, It represents the predicted probability that the i-th second sample user has a positive sentiment towards the financial product market.
11. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing any of the methods described in claims 1-8 when executing a program stored in a memory.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Market prediction method based on news corpus
CN108776652A
Emotion analysis method, device and system and medium
CN118916491A