Text emotion prediction method, system and equipment based on fine tuning time sequence large model and medium
By merging sentiment analysis and prediction through fine-tuning timing model, the complexity and resource utilization problems of text sentiment analysis and prediction are solved, and efficient mining and accurate prediction of medium and long-term emotional information in the text is achieved.
Patent Information
- Application Number
- CN202510023226.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-07
- Publication Date
- 2025-08-15
AI Technical Summary
The existing text sentiment analysis and prediction process is complex and the system resources are large, so it is impossible to fully tap the medium- and long-term emotional information in the text. The model has the problem of insufficient granularity in emotional calculation and prediction.
The method based on the fine-tuning timing model is adopted, and the emotional prompting model is called by the emotional prompt word to perform emotional calculations, which is converted into a thinking chain prompt word for learning with few samples, and fine-tuning training is performed in combination with the model output format. The fine-tuning timing model is used for emotional reasoning, and the correlation between the emotional prediction sequence value and the business system is obtained through the causality test method.
Integrating emotion analysis and prediction into one whole reduces the complexity and system resource usage, improves the ability to explore medium and long-term emotional information in text information, and enhances the accuracy and application scope of emotional prediction.
Smart Images

Figure CN120493902A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of text emotion prediction, and in particular to a text emotion prediction method, system, device and medium based on a fine-tuned time series large model. Background Art
[0002] Sentiment analysis and prediction are widely used in the economic field and are core components of related business systems. Textual information with time-series characteristics, such as news and social media, is a crucial data source for sentiment analysis and prediction. Traditionally, sentiment analysis and prediction have been primarily conducted in two steps: first, sentiment calculation and analysis of textual information is performed using sentiment classification models, such as sentiment vocabulary matching and statistics, traditional machine learning model classification, and deep learning BERT models. Second, sentiment is predicted using the resulting limited categorical values (e.g., three-category labeling: -1 represents negative sentiment, 0 represents indifferent sentiment, and 1 represents positive sentiment) using time-series statistical models such as ARIMA and GARCH, or deep learning LSTM time-series models.
[0003] However, existing sentiment analysis and prediction have the following technical defects:
[0004] First, when performing sentiment calculation and analysis on text information, the models used are primarily limited classification models (such as the BERT model), which transform sentiment calculation into a classification problem. However, due to the relatively weak capabilities of the models themselves and their simple outputs, the granularity of sentiment calculation on text information is large, making it difficult to fully mine the emotional information within the text. Furthermore, this type of one-hot encoding output is not conducive to the subsequent construction of time series models.
[0005] Second, different models are used from text information to final sentiment prediction, which increases the complexity of text sentiment prediction. For example, the BERT model is used for sentiment analysis, while the LSTM model is used for sentiment prediction. The former model inputs unstructured text information without time series characteristics, while the latter model inputs structured numerical values with time series characteristics.
[0006] Third, when performing sentiment analysis on text information, only short-term sentiment calculation and analysis is performed, and the medium- and long-term sentiment information that may exist in the text information is not mined and obtained. Summary of the Invention
[0007] (1) Technical issues to be resolved
[0008] In view of the above-mentioned shortcomings and deficiencies of the prior art, the present invention provides a text sentiment prediction method, system, device and medium based on a fine-tuned time series large model, which solves the technical problems of the complexity of the existing text sentiment analysis and prediction process and the large system resource occupation.
[0009] (2) Technical solution
[0010] In order to achieve the above objectives, the main technical solutions adopted by the present invention include:
[0011] In a first aspect, an embodiment of the present invention provides a text sentiment prediction method based on a fine-tuned time series large model, comprising:
[0012] Based on the input emotional prompt words, the preset large model is called to perform emotional calculation on the text information to obtain the emotional label dataset;
[0013] Convert the emotional prompt words into thought chain prompt words, and perform few-sample learning training on the large model based on the sample data of the thought chain prompt words to obtain the model output format of the large model;
[0014] The sentiment label dataset is lightweight processed, and the processing results are used as training data. Combined with the model output format, the time series of the large model is fine-tuned to obtain a fine-tuned time series large model;
[0015] The fine-tuned time series model is used to perform sentiment reasoning on the sentiment label dataset to obtain the sentiment prediction sequence value; and the causal relationship test method is used to obtain the correlation between the sentiment prediction sequence value and the business system to which the text information belongs.
[0016] Optionally, based on the input emotional prompt words, a preset large model is called to perform emotional calculation on the text information to obtain an emotional label dataset including:
[0017] Obtaining emotional prompt words and text information to be used for text emotion prediction;
[0018] Based on the emotional prompt words, the preset large model is called to perform sentiment calculation on the text information to obtain the emotional score of the emotional event and the reason information of the emotional analysis;
[0019] According to the sentiment analysis reason information of the emotional events, the emotional events are labeled to obtain the emotional label dataset.
[0020] Optionally, the emotional prompt words are converted into thought chain prompt words, and the large model is trained with a small number of samples based on the sample data of the thought chain prompt words. The model output format of the large model includes:
[0021] Convert emotional prompt words into thought chain prompt words, and construct a text information selection agent based on the thought chain prompt words;
[0022] Based on the selection agent, the text information is screened to obtain sample data of the thought chain prompt words;
[0023] The sample data of the thought chain prompt words are used as training data to perform few-sample learning training on the large model to obtain the model output format of the large model.
[0024] Optionally, the sentiment label dataset is lightweight processed, and the processing results are used as training data. In combination with the model output format, the time series of the large model is fine-tuned to obtain the fine-tuned time series large model, including:
[0025] The emotional label dataset is lightweight processed to obtain the emotional label dataset in json format;
[0026] The sentiment label dataset in JSON format is divided into a training set and a test set. Based on the model output format, the time series of the large model is fine-tuned to obtain a fine-tuned time series large model.
[0027] Among them, each sample data in the json format emotion label dataset includes the emotion label key-value pair of the previous period, the text information key-value pair and the emotion label key-value pair of the next period.
[0028] Optionally, the sentiment label dataset in JSON format is divided into a training set and a test set, and fine-tuning the time series of the large model is performed in combination with the model output format. The fine-tuned time series large model is obtained, including:
[0029] Divide the sentiment label dataset in json format into training set and test set;
[0030] Based on the time series data in the model parameters of the large model and the training set, the amount of fine-tuning training parameters and training data is obtained;
[0031] Fine-tune the time series of the large model based on the amount of fine-tuning training parameters and training data, and obtain the model training process save file;
[0032] Verify the saved files of the model training process based on the test set, and build a fine-tuned time series model based on the verification results and model output format;
[0033] The mathematical expression of fine-tuning the timing model is:
[0034] E=LLM finetune (Text, Γ)
[0035] Where E represents the sentiment prediction value, LLM finetune represents the fine-tuning time series model, Text represents text information, and Γ represents model parameters.
[0036] Optionally, verify the saved file of the model training process based on the test set, and build a fine-tuned time series large model based on the verification results and model output format, including:
[0037] Perform sentiment inference on the text data in the test set by saving the file during the model training process to obtain the sentiment prediction value;
[0038] Determine whether the difference between the predicted emotion value and the actual emotion value in the test set exceeds the set emotion threshold;
[0039] When the difference between the predicted emotion value and the actual emotion value in the test set does not exceed the set emotion threshold, the file and model output format are saved according to the model training process to build a fine-tuned time series large model.
[0040] Optionally, using a fine-tuned time series large model to perform sentiment inference on a sentiment tag dataset to obtain sentiment prediction sequence values; and obtaining the correlation between the sentiment prediction sequence values and the business system to which the text information belongs through a causal relationship test method includes:
[0041] Use the fine-tuned time series large model to perform sentiment inference on the sentiment label dataset and obtain the sentiment prediction sequence value;
[0042] Preprocessing the time series data of the sentiment prediction sequence value to obtain a causal relationship value between the time series data of the sentiment prediction sequence value and the time series data of the business system to which the text information belongs;
[0043] When the causal relationship value meets the set causal relationship threshold, it is determined that there is a causal relationship between the sentiment prediction sequence value and the business system to which the text information belongs;
[0044] The causal relationship values are analyzed to obtain the correlation between the sentiment prediction sequence value and the business system to which the text information belongs.
[0045] In a second aspect, an embodiment of the present invention provides a text sentiment prediction system based on a fine-tuned time series large model, comprising:
[0046] The emotional data acquisition module is used to perform emotional calculation on text information based on the input emotional prompt words and call the preset large model to obtain the emotional label data set;
[0047] The model output format acquisition module is used to convert the emotional prompt words into thought chain prompt words, and perform small-sample learning training on the large model based on the sample data of the thought chain prompt words to obtain the model output format of the large model;
[0048] The fine-tuning training module is used to perform lightweight processing on the emotion label dataset, and use the processing results as training data. Combined with the model output format, it fine-tunes the time series of the large model to obtain a fine-tuned time series large model;
[0049] The sentiment prediction module is used to perform sentiment inference on the sentiment label dataset using a fine-tuned time series model to obtain sentiment prediction sequence values; and to obtain the correlation between the sentiment prediction sequence values and the business system to which the text information belongs through a causal relationship test method.
[0050] In a third aspect, an embodiment of the present invention provides an electronic device, including:
[0051] A memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the steps of the above-mentioned method for predicting text sentiment based on a fine-tuned time series large model are implemented.
[0052] In a fourth aspect, an embodiment of the present invention provides a computer-readable medium having computer-executable instructions stored thereon. When the executable instructions are executed by a processor, the above-mentioned method steps for text sentiment prediction based on a fine-tuned time series large model are implemented.
[0053] (3) Beneficial effects
[0054] The beneficial effects of the present invention are: a text sentiment prediction method based on a fine-tuned time series large model proposed in the present invention, whose fine-tuned time series large model integrates the two parts of sentiment analysis and prediction into a whole, innovates the research and practice paradigm in the branch field of sentiment analysis and prediction, and establishes the modeling of unstructured, non-time series characteristic text information and structured, time series characteristic numerical data under a unified new paradigm, reduces the complexity of sentiment analysis and prediction and the occupation of system resources, improves the model's ability to mine medium- and long-term sentiment information in text information, and further improves the application scope of sentiment analysis and prediction of time series text information in actual application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 A schematic diagram of a method for text sentiment prediction based on a fine-tuned time series large model provided by one embodiment of the present invention;
[0056] Figure 2 A schematic diagram showing the comparison between the predicted emotion value and the actual emotion value provided by one embodiment of the present invention. DETAILED DESCRIPTION
[0057] In order to better explain the present invention and facilitate understanding, the present invention is described in detail below through specific implementation methods in conjunction with the accompanying drawings.
[0058] refer to Figure 1As shown, an embodiment of the present invention proposes a text emotion prediction method based on a fine-tuned time series large model, which includes: based on the input emotion prompt words, calling a preset large model to perform emotion calculation on the text information to obtain an emotion label data set; converting the emotion prompt words into thinking chain prompt words, and performing a few-sample learning training on the large model according to the sample data of the thinking chain prompt words to obtain the model output format of the large model; lightweight processing of the emotion label data set, and using the processing results as training data, combined with the model output format, fine-tuning the time series of the large model to obtain a fine-tuned time series large model; using the fine-tuned time series large model to perform emotion reasoning on the emotion label data set to obtain an emotion prediction sequence value; and obtaining the correlation between the emotion prediction sequence value and the business system to which the text information belongs through a causal relationship test method.
[0059] In this embodiment, the fine-tuning of the time series large model integrates the two parts of sentiment analysis and prediction into a whole, innovates the research and practice paradigm in the branch field of sentiment analysis and prediction, and establishes the modeling of unstructured, non-time series characteristic text information and structured, time series characteristic numerical data under a unified new paradigm, reducing the complexity of sentiment analysis and prediction and the system resource usage, improving the model's ability to mine medium- and long-term sentiment information in text information, and further improving the application scope of sentiment analysis and prediction of time series text information in actual application scenarios.
[0060] To better understand the above technical solutions, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments described herein. Rather, these embodiments are provided to enable a clearer and more thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art.
[0061] Specifically, refer to Figure 1 As shown, an embodiment of the present invention proposes a text sentiment prediction method based on a fine-tuned time series large model, the method comprising:
[0062] S100: Based on the input emotional prompt words, call the preset large model to perform emotional calculation on the text information to obtain an emotional label data set.
[0063] Based on the large model's reasoning capabilities and the input emotional cues, it can directly perform sentiment calculation on text information. The large model outputs fine-grained sentiment values (e.g., a range of -100 to 100), rather than the traditional method of converting sentiment calculation into a classification problem and outputting three or five categories of labeled values. While outputting fine-grained sentiment values, the large model also outputs sentiment analysis and reasoning information for the emotional event to which the fine-grained sentiment value belongs. Based on this sentiment analysis and reasoning information, the emotional event can be labeled to obtain a sentiment label dataset, which circumvents the shortcomings of traditional classification methods and improves the model's ability to capture the sentiment of text information. Large models can be open source or closed source. Open source models include Zhipu Qingyan, Ali Qianwen, and Llama (Alpaca Model).
[0064] In this embodiment, step S100 includes the following sub-steps S110 to S130:
[0065] S110: Acquire emotional prompt words and text information for which emotional prediction is to be performed.
[0066] S110: Based on the emotional prompt words, call the preset large model to perform emotional calculation on the text information to obtain the emotional score of the emotional event and the emotional analysis reason information.
[0067] S110. Label the emotional event according to the emotional analysis reason information of the emotional event to obtain an emotional label dataset.
[0068] In a specific embodiment, a 7B large model with 7 billion model parameters is selected, and sentiment calculation is performed on the following text information in combination with the input sentiment prompt words. The sentiment score ranges from -100 to 100.
[0069] {
[0070] "Sentiment prompt words": Given the context, what is the sentiment of the author of the input text and why? Derived step by step, give me the reasons, and then output the final sentiment score, which can be any integer between -100 and 100.
[0071] "Context (text information): In 2024, the cruise economic prosperity index of Region X increased to 102.13, and a full recovery is predicted in 2025-2026. On November 30, the "2024 Region X and Surrounding Cruise Economic Prosperity Index" and "A Report" were released at the 2024 Region X Forum. In 2024, the cruise economic prosperity index of Region X and surrounding areas was 102.13 and 102.16 respectively, which has steadily improved on the basis of 2023. The cruise economy of Region X has entered a period of climbing and stabilizing with resilience from a period of accumulating momentum to get back on track. It is predicted that in 202 From May to 2026, the region's cruise economic prosperity index will show a steady upward trend, gradually returning to pre-2019 levels. "Report A" highlights the new positioning of the cruise market in Region X from a global perspective, new insights into market recovery and consumption trends, breakthroughs in cruise manufacturing and supply chain optimization, new opportunities for regional collaboration and international cooperation, and new paths for industrial upgrading driven by policy innovation. Expert A pointed out that policies should be used to promote the development of the cruise market and expand collaboration across the entire cruise industry chain. Only by forming a close industry chain ecosystem can we jointly respond to market changes and achieve sustainable development.
[0072] }
[0073] The emotional output calculated by the 7B large model is:
[0074] {
[0075] "Positive vocabulary and expressions": The text uses positive words such as "increase", "steady improvement", "back on track", "recovery of resilience", "steady improvement", and "full recovery", which show that the author is optimistic about the development of the cruise economy.
[0076] "Forecasting the Future": The author predicts that the cruise economic prosperity index in Region X will show a steady upward trend from 2025 to 2026 and gradually return to the level before 2019, which shows confidence in future development.
[0077] "Report Content": The content of "Report A" covers many aspects such as new market positioning, consumption trends, breakthroughs in domestic cruise ship manufacturing, supply chain optimization, and international cooperation, showing the author's comprehensive attention to industrial development.
[0078] "Expert Opinion": The opinion of Expert A is quoted, emphasizing the importance of policy promotion and industrial chain ecology, which shows the author's in-depth thinking and expectations for industrial development.
[0079] "Emotional Tendency": Overall, the author holds a positive and optimistic attitude towards the development of the cruise economy.
[0080] Final Sentiment Score: Based on the above analysis, the author's sentiment score is 80. This score reflects the author's positive outlook and confidence in the future development of the cruise economy, as well as his comprehensive attention and in-depth thinking on the industry's development.
[0081] }
[0082] S200: convert the emotion prompt words into thought chain prompt words, and perform a few-sample learning training on the large model based on the sample data of the thought chain prompt words to obtain the model output format of the large model.
[0083] This embodiment writes and analyzes the short-term and long-term impacts of text information such as news and social media, that is, converts the emotional prompt words input into the large model into thought chain prompt words, and then combines them with the reasoning ability of the large model. It can mine and obtain the medium- and long-term impacts of text information, and further improve the accuracy and real-time performance of emotional prediction.
[0084] In this embodiment, step S200 includes the following sub-steps S210 to S230:
[0085] S210: Convert the emotion prompt words into thought chain prompt words, and construct a text information selection agent based on the thought chain prompt words.
[0086] For example, examples of thought chain prompts for analyzing the short-term and long-term impact of text information are:
[0087] (1) Please select news that may have a long-term impact on the sentiment score.
[0088] (2) Please select news that may have a short-term impact on today's sentiment score.
[0089] S220: Filter the text information based on the selection agent to obtain sample data of the thought chain prompt words.
[0090] S230. Performing a few-sample learning training on the large model using the sample data of the thought chain prompt words as training data to obtain the model output format of the large model.
[0091] In a specific embodiment, by writing thought chain prompts to analyze the short-term and long-term impact of news, social media, and other text information, and the model output format of the large model, few-shot learning (few sample learning, the model output format is the same as the output format of each subsequent sample), and then based on the 7B large model and thought chain prompts, a selection agent is constructed to select valuable news, social media, and other text information. The selection agent selects the original news, social media, and other text information and saves the selected content as a CSV file. Among them, the model output format of the large model is: "Impact on future sentiment scores (long-term and short-term): news (core text) content; regional information; time information; rationality analysis content". The following is an example of sample output of long-term and short-term impacts:
[0092] {
[0093] Long-term impact on future emotional fluctuations:
[0094] News Content: The cruise economic prosperity index for Region X increased to 102.13 in 2024, with a full recovery forecast for 2025-2026. On November 30th, the "2024 Region X and Surrounding Cruise Economic Prosperity Index" and "Report A" were released at the 2024 Region X Forum. In 2024, the cruise economic prosperity index for Region X and Surrounding Regions reached 102.13 and 102.16, respectively, showing a steady improvement from the 2023 level. Region X's cruise economy has transitioned from a period of accumulating momentum to a period of resilient recovery and stabilization. The cruise economic prosperity index for Region X is forecast to show a steady upward trend from 2025-2026, gradually returning to pre-2019 levels. The "Report A" highlights the new positioning of the cruise market in Region X from a global perspective, new insights into market recovery and consumption trends, breakthroughs in cruise manufacturing and supply chain optimization, new opportunities for regional collaboration and international cooperation, and new paths for industrial upgrading driven by policy innovation. Expert A pointed out that policies should be used to promote the development of the cruise market and expand the collaboration between upstream and downstream of the cruise industry chain. Only by forming a close industrial chain ecology can we jointly respond to market changes and achieve sustainable development.
[0095] Region: Region X.
[0096] Time: 2024-12-01 09:05:00
[0097] Reasonableness: As the cruise economic prosperity index in Region X has steadily improved on the basis of 2023, it has entered a period of climbing and stabilizing with resilience and recovery, moving from a period of accumulating momentum to get back on track.
[0098] }
[0099] {
[0100] Short-term impact on current emotional fluctuations:
[0101] "News": In November, District Y, under the jurisdiction of District X, signed 10,429 online contracts for a project, a 20-month high. According to District Y monitoring data, 10,429 contracts were signed online in November, a 14.4% increase from October (9,120 contracts) and an 18.5% increase from November of last year (8,801 contracts). November's online signing volume reached its highest level since January of this year, marking the 20th consecutive month of the highest number of contracts since March 2023.
[0102] Region: Region Y.
[0103] Time: 2024-12-01 09:59:00
[0104] "Reasonableness": As the market for a certain project in Region Y continues to heat up, the number of online signings in November hit a record high in the past two years, which has enhanced the optimism in Region Y about the stabilization of the project market and the local economy.
[0105] }
[0106] S300: Lightweight processing is performed on the emotion label dataset, and the processing results are used as training data. In combination with the model output format, the time series of the large model is fine-tuned to obtain a fine-tuned time series large model.
[0107] In this embodiment, step S300 includes the following sub-steps S310 to S320:
[0108] S310: Lightweight the emotion tag dataset to obtain the emotion tag dataset in JSON format.
[0109] Each sample in the JSON-formatted sentiment tag dataset includes a sentiment tag key-value pair for the previous period, a text information key-value pair, and a sentiment tag key-value pair for the next period. The text information key-value pairs are text information data from news and social media, as well as analysis data on the short-term and long-term impact of thought chain prompts on text information.
[0110] S320. Divide the emotion label dataset in json format into a training set and a test set, and fine-tune the time series of the large model in combination with the model output format to obtain a fine-tuned time series large model.
[0111] Furthermore, step S320 includes the following sub-steps S321 to S324:
[0112] S321. Divide the sentiment label dataset in json format into a training set and a test set.
[0113] S322. Based on the time series data in the model parameters of the large model and in combination with the training set, obtain the amount of fine-tuning training parameters and the amount of training data.
[0114] For example, when the base model of the large model uses the 7B model, the number of model parameters is 6740512768, of which 2097152 are related to data, accounting for 0.03111264783824826% of all model parameters. That is, the number of fine-tuning training parameters is 2097152. The amount of training data obtained from the training set is 3555.
[0115] S323: Fine-tune the time series of the large model based on the fine-tuning training parameters and the amount of training data, and obtain a model training process save file. The training process save file includes a model parameter file, an optimizer state file, and a training information file.
[0116] For example, when fine-tuning a large model for time series training, the following configuration is used: batch size is set to 8 on four GPUs (with 48GB of video memory), evaluation_strategy is set to "steps (model evaluation is performed based on the number of steps in the training process)", learning rate is set to 1e-4, epochs is set to 5, warmup_steps (number of steps in the learning rate warm-up phase) is set to 400, lora_r (LoRA complexity and computational effort) is set to 8, lora_alpha (LoRA scaling factor) is set to 16, quantization bits is set to 8, and training time is set to 26 hours. After fine-tuning training is complete, a file is saved of the model training process.
[0117] S324. Verify the saved files of the model training process based on the test set, and build a fine-tuned time series large model based on the verification results and model output format.
[0118] In a specific embodiment, by writing a test script, loading the large model checkpoint after fine-tuning training (the model training process save file), the text data in the test set is subjected to sentiment reasoning to obtain the sentiment prediction value; then, it is determined whether the difference between the sentiment prediction value and the actual sentiment value in the test set exceeds the set sentiment threshold, and the comparison effect is visualized as shown below. Figure 2 As shown in the figure, the blue curve represents the actual value of emotion, and the red curve represents the predicted value. From this figure, we can see that the model can accurately predict the huge fluctuations and overall trends of the emotion score. Finally, when the difference between the emotion prediction value and the actual emotion value in the test set does not exceed the set emotion threshold, the file and model output format are saved according to the model training process, and the fine-tuned time series large model is constructed. Among them, the mathematical expression of the fine-tuned time series large model is:
[0119] E=LLM finetune (Text, Γ)
[0120] Where E represents the sentiment prediction value, LLM finetune represents the fine-tuning time series model, Text represents text information, and Γ represents model parameters.
[0121] S400, using a fine-tuned time series large model to perform sentiment reasoning on the sentiment tag dataset to obtain sentiment prediction sequence values; and obtaining the correlation between the sentiment prediction sequence values and the business system to which the text information belongs through a causal relationship test method.
[0122] In this embodiment, step S400 includes the following sub-steps S410 to S440:
[0123] S410: Use the fine-tuned time series large model to perform sentiment reasoning on the sentiment label dataset to obtain sentiment prediction sequence values.
[0124] S420 , preprocessing the time series data of the emotion prediction sequence value to obtain a causal relationship value between the time series data of the emotion prediction sequence value and the time series data of the business system to which the text information belongs.
[0125] S430: When the causal relationship value meets the set causal relationship threshold, it is determined that there is a causal relationship between the sentiment prediction sequence value and the business system to which the text information belongs.
[0126] S440: Analyze the causal relationship value to obtain the correlation between the sentiment prediction sequence value and the business system to which the text information belongs.
[0127] In a specific embodiment, first, a fine-tuned time series model is used to perform sentiment inference on the sentiment tag dataset to obtain sentiment prediction sequence values. Then, the time series data of the sentiment prediction sequence values are preprocessed using the difference method, and the Granger causality test is used to calculate the P value (causality value) of the time series data of the sentiment prediction sequence values and the time series data of the business system (such as electricity, retail, finance, security, etc.) to which the text information belongs. When the P value is less than 0.05, the null hypothesis (i.e., there is no causal relationship between the two time series data) can be rejected. When the P value is greater than 0.05, there is a causal relationship between the two time series data.
[0128] In addition, the embodiment of the present invention also proposes a text sentiment prediction system based on a fine-tuned time series large model, including:
[0129] The emotion data acquisition module is used to perform emotion calculation on text information based on the input emotion prompt words and call the preset large model to obtain the emotion label data set.
[0130] The model output format acquisition module is used to convert emotional prompt words into thought chain prompt words, and perform small sample learning training on the large model based on the sample data of the thought chain prompt words to obtain the model output format of the large model.
[0131] The fine-tuning training module is used to perform lightweight processing on the emotion label dataset, and use the processing results as training data. Combined with the model output format, it fine-tunes the time series of the large model to obtain a fine-tuned time series large model.
[0132] The sentiment prediction module is used to perform sentiment inference on the sentiment label dataset using a fine-tuned time series model to obtain sentiment prediction sequence values; and to obtain the correlation between the sentiment prediction sequence values and the business system to which the text information belongs through a causal relationship test method.
[0133] In addition, an embodiment of the present invention further proposes an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the computer program is executed by the processor, the above-mentioned steps of the text sentiment prediction method based on a fine-tuned time series large model are implemented.
[0134] Finally, an embodiment of the present invention further proposes a computer-readable medium having computer-executable instructions stored thereon. When the executable instructions are executed by a processor, the above-mentioned method steps for text sentiment prediction based on a fine-tuned time series large model are implemented.
[0135] In summary, the embodiments of the present invention propose a method, system, device and medium for text sentiment prediction based on a fine-tuned time series large model. First, the present invention uses the reasoning ability of the large model to perform sentiment calculation on text information, and can provide reasons while outputting the sentiment score, thereby avoiding the defects of traditional classification sentiment calculation. The output sentiment score is more refined and accurate, greatly enriching the ability to capture the sentiment of text information. Secondly, the technical solution of the present invention uses a large model in both sentiment analysis and sentiment prediction, integrating the modeling of unstructured, non-time series characteristic text information with the modeling of structured, time series characteristic numerical data, and using the reasoning ability of the large model combined with the thinking chain to capture the long-term impact of text information, thereby improving the model's ability to mine fine-grained emotions of text information and the long-term impact of sentiment scores.
[0136] Since the systems / devices described in the above embodiments of the present invention are systems / devices used to implement the methods of the above embodiments of the present invention, those skilled in the art will be able to understand the specific structures and variations of these systems / devices based on the methods described in the above embodiments of the present invention, and thus will not be described in detail here. All systems / devices used in the methods of the above embodiments of the present invention are within the scope of protection of the present invention.
[0137] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0138] The present invention is described with reference to flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions.
[0139] It should be noted that, in the description of the present invention, the word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. The present invention can be implemented by means of hardware comprising several distinct components and by means of a suitably programmed computer. The use of the words first, second, third, etc., is merely for convenience and does not imply any order. These words should be understood as part of the component name.
[0140] In addition, it should be noted that, in the description of this specification, the description of the terms "one embodiment", "some embodiments", "embodiment", "example", "specific example" or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and the features of different embodiments or examples, unless they are contradictory.
[0141] Although preferred embodiments of the present invention have been described, those skilled in the art will readily appreciate additional variations and modifications to these embodiments upon obtaining the basic inventive concepts.
[0142] Obviously, those skilled in the art can make various modifications and variations to the present invention without departing from the spirit and scope of the invention.
Claims
1. A text sentiment prediction method based on fine-tuning a large temporal model, characterized in that: include: Based on the input emotional prompt words, the preset large model is called to perform emotional calculation on the text information to obtain the emotional label dataset; Convert the emotional prompt words into thought chain prompt words, and perform few-sample learning training on the large model based on the sample data of the thought chain prompt words to obtain the model output format of the large model; The sentiment label dataset is lightweight processed, and the processing results are used as training data. Combined with the model output format, the time series of the large model is fine-tuned to obtain a fine-tuned time series large model; Use the fine-tuned time series large model to perform sentiment inference on the sentiment label dataset and obtain the sentiment prediction sequence value; And the correlation between the sentiment prediction sequence value and the business system to which the text information belongs is obtained through the causal relationship test method.
2. The method according to claim 1, wherein Based on the input emotional prompt words, the preset large model is called to perform emotional calculation on the text information, and the emotional label dataset obtained includes: Obtaining emotional prompt words and text information to be used for text emotion prediction; Based on the emotional prompt words, the preset large model is called to perform sentiment calculation on the text information to obtain the emotional score of the emotional event and the reason information of the emotional analysis; According to the sentiment analysis reason information of emotional events, emotional events are labeled to obtain the emotional label dataset.
3. The method according to claim 1, wherein The emotional prompt words are converted into thought chain prompt words, and the large model is trained with a small number of samples based on the sample data of the thought chain prompt words. The model output format of the large model includes: Convert emotional prompt words into thought chain prompt words, and construct a text information selection agent based on the thought chain prompt words; Based on the selection agent, the text information is screened to obtain sample data of the thought chain prompt words; The sample data of the thought chain prompt words are used as training data to perform few-sample learning training on the large model to obtain the model output format of the large model.
4. The method according to claim 1, wherein The sentiment label dataset is lightweight processed, and the processing results are used as training data. Combined with the model output format, the time series of the large model is fine-tuned to obtain the fine-tuned time series large model, including: The emotional label dataset is lightweight processed to obtain the emotional label dataset in json format; The sentiment label dataset in JSON format is divided into a training set and a test set. Based on the model output format, the time series of the large model is fine-tuned to obtain a fine-tuned time series large model. Among them, each sample data in the json format emotion label dataset includes the emotion label key-value pair of the previous period, the text information key-value pair and the emotion label key-value pair of the next period.
5. The method according to claim 4, wherein The sentiment label dataset in JSON format is divided into a training set and a test set. Based on the model output format, the time series of the large model is fine-tuned. The fine-tuned time series large model is obtained, including: Divide the sentiment label dataset in json format into training set and test set; Based on the time series data in the model parameters of the large model and the training set, the amount of fine-tuning training parameters and training data is obtained; Fine-tune the time series of the large model based on the amount of fine-tuning training parameters and training data, and obtain the model training process save file; Verify the saved files of the model training process based on the test set, and build a fine-tuned time series model based on the verification results and model output format; The mathematical expression of fine-tuning the timing model is: E=LLM finetune (Text,Γ) Where E represents the sentiment prediction value, LLM finetune represents the fine-tuning time series model, Text represents text information, and Γ represents model parameters.
6. The method according to claim 5, wherein Verify the saved files of the model training process based on the test set, and build a fine-tuned time series model based on the verification results and model output format, including: Perform sentiment inference on the text data in the test set by saving the file during the model training process to obtain the sentiment prediction value; Determine whether the difference between the predicted emotion value and the actual emotion value in the test set exceeds the set emotion threshold; When the difference between the predicted emotion value and the actual emotion value in the test set does not exceed the set emotion threshold, the file and model output format are saved according to the model training process to build a fine-tuned time series large model.
7. The method according to claim 1, wherein Use the fine-tuned time series large model to perform sentiment inference on the sentiment label dataset and obtain the sentiment prediction sequence value; And the correlation between the sentiment prediction sequence value and the business system to which the text information belongs is obtained through the causal relationship test method, including: Use the fine-tuned time series large model to perform sentiment inference on the sentiment label dataset and obtain the sentiment prediction sequence value; Preprocessing the time series data of the sentiment prediction sequence value to obtain a causal relationship value between the time series data of the sentiment prediction sequence value and the time series data of the business system to which the text information belongs; When the causal relationship value meets the set causal relationship threshold, it is determined that there is a causal relationship between the sentiment prediction sequence value and the business system to which the text information belongs; The causal relationship values are analyzed to obtain the correlation between the sentiment prediction sequence value and the business system to which the text information belongs.
8. A text sentiment prediction system based on a fine-tuned time series large model, characterized by: include: The emotional data acquisition module is used to perform emotional calculation on text information based on the input emotional prompt words and call the preset large model to obtain the emotional label data set; The model output format acquisition module is used to convert the emotional prompt words into thought chain prompt words, and perform small-sample learning training on the large model based on the sample data of the thought chain prompt words to obtain the model output format of the large model; The fine-tuning training module is used to perform lightweight processing on the emotion label dataset, and use the processing results as training data. Combined with the model output format, it fine-tunes the time series of the large model to obtain a fine-tuned time series large model; The sentiment prediction module is used to perform sentiment inference on the sentiment label dataset using a fine-tuned time series model to obtain sentiment prediction sequence values; And the correlation between the sentiment prediction sequence value and the business system to which the text information belongs is obtained through the causal relationship test method.
9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the steps of a method for predicting text sentiment based on a fine-tuned time series large model as described in any one of claims 1 to 7 are implemented.
10. A computer-readable medium having computer-executable instructions stored thereon, characterized in that: When the executable instructions are executed by the processor, the steps of the text sentiment prediction method based on the fine-tuning time series large model as described in any one of claims 1 to 7 are implemented.