Financial text sentiment analysis method and system based on AI model

By integrating multiple types of financial texts and using optimized AI models for analysis, the problems of insufficient generalization ability and real-time nature of financial sentiment analysis in the existing technology are solved, and more accurate and stable market sentiment analysis is achieved, which is suitable for real-time sentiment analysis in the financial field.

CN120448522APending Publication Date: 2025-08-08SHENZHEN MAOYUAN TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510602822.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-12
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

The existing financial sentiment analysis methods mainly rely on traditional natural language processing models, and there are problems such as insufficient generalization ability, scarce Chinese financial text data, and difficult to meet long text processing and real-time needs, resulting in limited results in the analysis of single text sources, which makes it difficult to fully reflect the true situation of market sentiment.

Method used

By integrating multiple types of financial texts, using financial text sentiment analysis methods based on AI models, using LLM language model and pre-stored configuration files to classify and clean text data, fine-tune using FinRoBERTa-ZH5 model optimized for the Chinese financial field, and designing differentiated processing strategies, combining multiple BERT models to fusion of sentiment analysis results.

Benefits of technology

It significantly improves the accuracy and stability of emotional classification, reduces model reasoning delay, meets the real-time needs in quantitative trading scenarios, and provides a more comprehensive market sentiment analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120448522A_ABST
    Figure CN120448522A_ABST
Patent Text Reader

Abstract

The invention provides a financial text sentiment analysis method and system based on an AI model. The method comprises the steps of obtaining initial text data of a financial field; loading a pre-stored first configuration file, and performing text classification and data cleaning on the initial text data according to the first configuration file to obtain multiple pieces of target text data corresponding to the multiple text types; based on the plurality of text types, executing a plurality of processing operations on the plurality of target text data according to an LLM language model and a plurality of pre-stored operation configuration files to obtain a plurality of target sample data; inputting the plurality of target sample data into a plurality of corresponding target BERT models one by one to obtain a plurality of sentiment analysis results; and fusing the plurality of sentiment analysis results into a target sentiment analysis result, and outputting the target sentiment analysis result. According to the method, the accuracy, the stability, the applicability and the real-time performance of financial text sentiment analysis can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of semantic analysis technology under the field of artificial intelligence technology, and in particular to a financial text sentiment analysis method and system based on an AI model. Background Art

[0002] With the rapid development of financial markets, sentiment analysis of financial texts is playing an increasingly important role in investment decision-making and market forecasting. Financial texts, including news reports, public company announcements, stock forums, and research reports, are crucial in shaping market sentiment and influencing investor behavior. However, existing sentiment analysis methods primarily focus on analyzing text from a single source, such as news or forum content. While this approach can provide some analytical results, its ability to explain market fluctuations is significantly insufficient. In reality, different types of financial texts target different readerships and have varying impacts on market participants. Therefore, single-source analysis results are unlikely to fully reflect the true state of market sentiment.

[0003] In terms of technical implementation, current financial sentiment analysis technologies primarily rely on traditional natural language processing models, such as pre-trained language models based on BERT. These models exhibit limitations when processing complex text. First, financial texts often contain a large amount of specialized terminology and complex market noise, resulting in insufficient generalization capabilities of existing models when processing heterogeneous texts. Second, the extreme scarcity of labeled data in the Chinese financial field and the lack of pre-trained models specifically for Chinese financial texts further limit the performance and applicability of these models. Furthermore, while large language models (LLMs) excel at generalizing knowledge across tasks, their high computational latency and black-box nature make them difficult to meet the real-time requirements of quantitative trading. In particular, for extremely long texts, such as public company announcements, existing models often struggle to provide accurate and effective analysis due to limitations in the processing context length. Summary of the Invention

[0004] This application provides a method and system for sentiment analysis of financial texts based on AI models. By integrating multiple types of financial texts, this method aims to address the limited effectiveness of single-source analysis, alleviate the scarcity of Chinese financial data, and enhance the model's applicability in specific fields. Through model integration and inference acceleration technology, this method significantly reduces model inference latency while maintaining high accuracy, meeting the real-time requirements of quantitative trading scenarios. Furthermore, differentiated processing strategies are designed for different types of financial texts, significantly improving the accuracy and stability of sentiment classification.

[0005] In a first aspect, the present application provides a financial text sentiment analysis method based on an AI model, which is applied to a server of a financial text sentiment analysis system based on an AI model, and the method includes: Obtain initial text data in the financial field; Loading a pre-stored first configuration file, and performing text classification and data cleaning on the initial text data according to the first configuration file to obtain a plurality of target text data corresponding to a plurality of text types, wherein the first configuration file includes a plurality of configuration information for representing text cleaning rules; Based on the multiple text types, performing multiple processing operations on the multiple target text data according to the LLM language model and multiple pre-stored operation configuration files to obtain multiple target sample data, the multiple text types corresponding to the multiple processing operations in a one-to-one manner, the multiple processing operations including a summary generation operation and a subject identification operation, and the multiple operation configuration files including multiple processing rules for implementing the multiple processing operations; Inputting the multiple target sample data one by one into corresponding multiple target BERT models to obtain multiple sentiment analysis results, wherein the multiple target BERT models are obtained by fine-tuning a pre-trained FinRoBERTa-ZH5 model based on the multiple text types; The multiple sentiment analysis results are fused into a target sentiment analysis result, and the target sentiment analysis result is output.

[0006] In a second aspect, an embodiment of the present application provides a financial text sentiment analysis system based on an AI model, the system comprising an acquisition unit, a processing unit, and an output unit, wherein: The acquisition unit is used to acquire initial text data in the financial field; The processing unit is configured to load a pre-stored first configuration file, and perform text classification and data cleaning on the initial text data according to the first configuration file to obtain multiple target text data corresponding to multiple text types, wherein the first configuration file includes multiple configuration information for characterizing text cleaning rules; and, based on the multiple text types, perform multiple processing operations on the multiple target text data according to an LLM language model and multiple pre-stored operation configuration files to obtain multiple target sample data, wherein the multiple text types correspond one-to-one to the multiple processing operations, the multiple processing operations include a summary generation operation and a subject identification operation, and the multiple operation configuration files include multiple processing rules for implementing the multiple processing operations; and, input the multiple target sample data one-to-one into the corresponding multiple target BERT models to obtain multiple sentiment analysis results, wherein the multiple target BERT models are obtained by fine-tuning a pre-trained FinRoBERTa-ZH5 model based on the multiple text types; The output unit is used to fuse the multiple sentiment analysis results into a target sentiment analysis result and output the target sentiment analysis result.

[0007] In a third aspect, an embodiment of the present application provides an electronic device comprising a processor, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the programs include instructions for executing the steps in the first aspect of the embodiment of the present application.

[0008] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program / instruction stored thereon, which is executed by a processor to implement the steps of the method described in the first aspect above.

[0009] It can be seen that in the embodiment of the present application, the server obtains initial text data in the financial field; loads a pre-stored first configuration file, and performs text classification and data cleaning on the initial text data according to the first configuration file to obtain multiple target text data corresponding to multiple text types; based on multiple text types, multiple processing operations are performed on the multiple target text data according to the LLM language model and multiple pre-stored operation configuration files to obtain multiple target sample data; the multiple target sample data are input one by one into the corresponding multiple target BERT models to obtain multiple sentiment analysis results; the multiple sentiment analysis results are merged into the target sentiment analysis result, and the target sentiment analysis result is output. In this way, compared with the existing financial text sentiment analysis method, the present application solves the problem of limited analysis effect of a single text source by integrating multiple types of financial texts, alleviates the scarcity of Chinese financial data, improves the applicability of the model in specific fields, and significantly reduces the model inference delay while maintaining high accuracy, meeting the real-time requirements in quantitative trading scenarios. In addition, differentiated processing strategies are designed for different types of financial texts, which significantly improves the accuracy and stability of sentiment classification. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0011] Figure 1 This is a schematic diagram of the structure of a server in a financial text sentiment analysis system based on an AI model provided in an embodiment of the present application; Figure 2 This is a flowchart of a method for sentiment analysis of financial texts based on an AI model provided in an embodiment of the present application; Figure 3 Schematic diagram of a target BERT model generation method provided in an embodiment of the present application; Figure 4 This is a flow chart of a method for generating target sample data provided by an embodiment of the present application; Figure 5 This is a flow chart of a data cleaning method provided in an embodiment of the present application; Figure 6 This is an overall flow chart of a financial text sentiment analysis method based on an AI model provided in an embodiment of the present application; Figure 7 This is an application scenario diagram of a financial text sentiment analysis method based on an AI model provided in an embodiment of the present application; Figure 8 This is a structural block diagram of an electronic device provided in an embodiment of the present application; Figure 9 This is a functional unit block diagram of a financial text sentiment analysis system based on an AI model provided in an embodiment of the present application. DETAILED DESCRIPTION

[0012] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0013] The terms "first," "second," and the like in the specification and claims of this application and the accompanying drawings are used to distinguish between different objects, not to describe a particular order. Furthermore, the terms "including," "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements but may optionally include steps or elements not listed, or may optionally include other steps or elements inherent to the process, method, product, or apparatus.

[0014] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0015] In the embodiments of this application, "and / or" describes the relationship between associated objects and indicates that three relationships can exist. For example, "A and / or B" can represent the following three situations: A exists alone; A and B exist simultaneously; and B exists alone. A and B can be singular or plural.

[0016] In the embodiments of the present application, the symbol " / " can indicate that the preceding and following objects are in an "or" relationship. In addition, the symbol " / " can also represent a division sign, that is, performing a division operation. For example, A / B can mean A divided by B.

[0017] In the embodiments of the present application, "at least one item" or similar expressions refers to any combination of these items, including any combination of single items or plural items, and refers to one or more, and multiple refers to two or more. For example, at least one item (item) of a, b, or c can represent the following seven situations: a, b, c, a and b, a and c, b and c, a, b, and c. Among them, each of a, b, and c can be an element or a set containing one or more elements.

[0018] In the embodiments of this application, "equal to" can be used in conjunction with "greater than" and is applicable to the technical solution adopted when "greater than" is used, and can also be used in conjunction with "less than" and is applicable to the technical solution adopted when "less than" is used. When "equal to" is used in conjunction with "greater than", it should not be used in conjunction with "less than"; when "equal to" is used in conjunction with "less than", it should not be used in conjunction with "greater than".

[0019] Existing financial sentiment analysis technologies are mostly limited to a single text source, such as news or forums, and ignore the heterogeneity of other types of text, such as announcements and research reports. These different text types have significant differences in content depth, readership, and scope of influence, making it difficult for a single model to effectively handle them. They face the following challenges: (1) Insufficient domain specificity and generalization capabilities: Financial texts are densely packed with professional terminology, and the generalization capabilities of traditional BERT models in the financial field are limited. (2) Scarcity of Chinese financial text data: The lack of annotated data in the Chinese financial field makes it difficult to train applicable models. (3) Limitations in long text processing: A large amount of financial text exceeds the processing capabilities of existing models. For example, listing announcements usually contain more than 512 tokens. (3) Computational latency and real-time requirements: The high latency and black-box characteristics of large language models (such as LLMs) in real-time scenarios make it difficult to meet the needs of quantitative trading.

[0020] In response to the above problems, the embodiment of the present application provides a financial text sentiment analysis method and system based on an AI model. The embodiment of the present application is described in detail below with reference to the accompanying drawings.

[0021] See also Figure 1 , Figure 1 This is a schematic diagram of the structure of a server in a financial text sentiment analysis system based on an AI model provided by an embodiment of the present application. Figure 1 As shown, the server 110 includes a processor 111 and a memory 112, and the processor 111 is communicatively connected to the memory 112. One or more programs are stored in the memory 112, and the one or more programs are configured to be executed by the processor 111. The functions of the one or more programs are to obtain initial text data in the financial field; load a pre-stored first configuration file, and perform text classification and data cleaning on the initial text data according to the first configuration file to obtain multiple target text data corresponding to multiple text types; based on the multiple text types, perform multiple processing operations on the multiple target text data according to the LLM language model and multiple pre-stored operation configuration files to obtain multiple target sample data; input the multiple target sample data one by one into the corresponding multiple target BERT models to obtain multiple sentiment analysis results; fuse the multiple sentiment analysis results into a target sentiment analysis result, and output the target sentiment analysis result.

[0022] The following describes a financial text sentiment analysis method based on an AI model provided in an embodiment of the present application.

[0023] See also Figure 2 , Figure 2 This is a flowchart of a method for sentiment analysis of financial texts based on an AI model provided by an embodiment of the present application, which is applied to Figure 1 The server 110 in Figure 2 As shown, the method includes the following steps: Step S201: Acquire initial text data in the financial field.

[0024] Among them, the initial text data in the financial field comes from a wide range of sources, including news reports, announcements from listed companies, stock forums, and research reports.

[0025] Specifically, news reports include various news items published by financial media, such as macroeconomic policy adjustments, industry trends, and major corporate events (mergers and acquisitions, restructuring, earnings releases, etc.). Announcements from listed companies include regular reports (annual, semi-annual, and quarterly) and interim announcements (such as major litigation, related-party transactions, and equity changes). Stock forums are forums where investors share their investment experiences, perspectives, and market insights, including predictions and evaluations of specific stocks or the market as a whole. Research reports, written by professional financial analysts, provide in-depth research and analysis of specific industries or companies, including analysis of industry trends, company fundamentals, and earnings forecasts. Research reports reflect the judgment and perspectives of professional institutions on the financial market.

[0026] Step S202 : loading a pre-stored first configuration file, and performing text classification and data cleaning on the initial text data according to the first configuration file to obtain a plurality of target text data corresponding to a plurality of text types.

[0027] The first configuration file includes a plurality of configuration information for representing text cleaning rules.

[0028] In a possible embodiment, the plurality of configuration information for characterizing text cleaning rules includes at least the following information: rule ID, rule level, rule category, processing field, location, rule logic, rule keyword or threshold, and rule explanation; The rule levels include document level and paragraph level; and the rule categories include deletion operation, cleaning operation and retention operation.

[0029] Document-level cleaning processes the entire text globally, for example, deleting entire documents containing specific sensitive information. Paragraph-level cleaning focuses on individual paragraphs within the text, performing targeted processing on the content within them, such as removing sections of a paragraph that do not conform to formatting requirements. Rules at different levels work together to achieve comprehensive text cleaning.

[0030] The first configuration file is pre-recorded in a cloud document Excel file, facilitating the participation of business experts and data engineers. Specifically, the "Rule ID" uniquely identifies each cleaning rule, facilitating the management, search, and invocation of numerous rules. The "Processing Field" represents the text field to be checked, including "Title" and "Original Text." "Position" includes fields such as "First Paragraph, First Sentence." "Rule Logic" represents operators such as "Contains," "Less Than," and "Rule Keywords or Thresholds" represent specific cleaning rules, such as regular expressions and thresholds. Judgments are made based on the aforementioned fields, and then loaded, parsed, and executed.

[0031] In specific implementations, when performing data cleaning, the system loads the first configuration file and parses the configuration information therein. It then makes a comprehensive judgment on the initial text data based on information such as the rule level, processing field, location, rule logic, and rule keywords or thresholds. For example, if the rule level is paragraph level, the processing field is "original text," the location is "first paragraph," the rule logic is "include," the rule keyword is a specific noise word, and the rule category is "delete," then the system will search for the paragraph containing the noise word in the first paragraph of the original text of the initial text data and delete it. Ultimately, the system will obtain the target text data corresponding to multiple text types that have been classified and cleaned, providing a high-quality data foundation for subsequent analysis.

[0032] It can be seen that in this embodiment, by storing the first configuration file containing multiple configuration information in the cloud document Excel, and using information such as rule ID, rule level, and rule category, the system can classify and clean the initial text data in the financial field, remove noise, retain key information, and provide high-quality, clearly classified target text data for subsequent analysis, thereby improving the accuracy and reliability of the analysis.

[0033] Step S203 : Based on the multiple text types, multiple processing operations are performed on the multiple target text data according to the LLM language model and multiple pre-stored operation configuration files to obtain multiple target sample data.

[0034] The operation profile contains the specific processing rules for implementing each processing operation. These rules are carefully formulated based on the characteristics and processing requirements of different text types, providing clear guidance and constraints for processing operations. For example, the summary generation rules for announcement text data take into account factors such as the announcement's format, language style, and distribution of important information, ensuring that the generated summary accurately reflects the announcement's core content. The subject identification rules, on the other hand, specify how to accurately identify the corporate entity from the text, which may involve methods such as keyword matching and contextual analysis.

[0035] The multiple text types correspond one-to-one to the multiple processing operations, the multiple processing operations include a summary generation operation and a subject identification operation, and the multiple operation configuration files include multiple processing rules for implementing the multiple processing operations.

[0036] Specifically, text types include news, forum, announcement, and research report. The announcement type corresponds to the first summary generation operation, the research report type corresponds to the second summary generation operation, and the news type corresponds to the subject identification operation.

[0037] Among them, the target text data includes target news text data, target announcement text data, target research report text data and target forum text data; the target sample data includes news sample data corresponding to the target news text data, announcement sample data corresponding to the target announcement text data, research report sample data corresponding to the target research report text data, and forum sample data corresponding to the target forum text data.

[0038] Understandably, for some long, complex texts, such as announcements and research reports, summarization can extract the core points of the text, reduce redundant information, and make the data more refined. In news text data, it is necessary to identify the corporate entities involved in the news. Subject identification can help focus on key analysis objects, linking sentiment analysis to specific subjects, and thus more accurately assessing the image and influence of different entities in the financial market.

[0039] It can be seen that in this embodiment, according to different text types, the LLM language model and pre-stored operation configuration files are used to perform corresponding processing operations such as summary generation and subject identification on the target text data, and the original text is converted into target sample data, which improves the data quality and availability, provides accurate and efficient data support for subsequent sentiment analysis, and also reflects the intelligence and automation of the processing process.

[0040] Step S204: Input the multiple target sample data into the corresponding multiple target BERT models one by one to obtain multiple sentiment analysis results.

[0041] The target BERT models are obtained by fine-tuning the pre-trained FinRoBERTa-ZH5 model based on the multiple text types. In this solution, the Chinese-roberta-wwm-ext-large model is used as the reference model in the construction of the core model, and FinRoBERTa-ZH5 is further trained.

[0042] Specifically, the FinRoBERTa-ZH5 model is obtained by self-supervised pre-training of the RoBERTa-wwm-ext-large pre-trained model under the Transformers and DeepSpeed training framework.

[0043] It should be made clear that other Chinese models (BERT-Large-chinese, Chinese-bert-wwm, etc.) can be used as substitutes for this solution, but the internal data evaluation effect is weaker than the selected model.

[0044] Understandably, the FinRoBERTa-ZH5 model was chosen as the foundation because it was specifically optimized and trained for the Chinese financial sector, giving it an inherent advantage in processing financial text. However, different types of financial text, such as news, forums, announcements, and research reports, exhibit significant differences in language style, content structure, and emotional expression. Therefore, directly using a single base model makes it difficult to accurately capture the sentiment characteristics of various text types. By fine-tuning the FinRoBERTa-ZH5 model based on different text types, the model can be better adapted to the unique characteristics of various text types, improving the accuracy of sentiment analysis for specific text types.

[0045] Among them, multiple target BERT models include target news BERT model, target forum BERT model, target announcement BERT model and target research report BERT model; news sample data is input into the target news BERT model, announcement sample data is input into the target announcement BERT model, research report sample data is input into the target research report BERT model, and forum sample data is input into the target forum BERT model.

[0046] It can be seen that in this embodiment, the FinRoBERTa-ZH5 model optimized and trained for the Chinese financial field is selected as the basis. Taking into account the large differences between different financial text types, FinRoBERTa-ZH5 is fine-tuned based on the text type to obtain multiple target BERT models. The corresponding target sample data is input into each model, which can accurately capture the emotional characteristics of different texts and improve the accuracy of sentiment analysis of financial texts.

[0047] Step S205: Fusing the multiple sentiment analysis results into a target sentiment analysis result, and outputting the target sentiment analysis result.

[0048] Common fusion methods include weighted averaging, voting, and machine learning-based fusion methods. In practical applications, experiments and evaluations are required to determine the most suitable fusion method.

[0049] The fusion of multiple sentiment analysis results is affected by data quality. If a certain type of text data contains bias or noise, it may negatively impact the final target sentiment analysis results. Therefore, before fusion, it is necessary to ensure the accuracy and reliability of each sentiment analysis result and thoroughly clean and preprocess the data.

[0050] As can be seen, this example effectively integrates multi-source information by fusing the sentiment analysis results of multiple target BERT models for different types of financial text, overcoming the limitations of single-text analysis and comprehensively and accurately reflecting the overall sentiment of the financial market. The output target sentiment analysis results provide key decision-making references for financial institutions, investors, and others, facilitating market monitoring, enabling timely detection and response to changes in market sentiment, and helping to prevent financial risks.

[0051] See also Figure 3 , Figure 3 : This is a flow chart of a method for generating a target BERT model provided in an embodiment of the present application, which includes the following steps: Step S301: Acquire multiple financial terms.

[0052] Financial terms are standardized explanations and descriptions of specific concepts, terms, institutions, and products in the financial field. They are the basic units of the financial knowledge system.

[0053] Specifically, methods for obtaining multiple financial terms include, but are not limited to, obtaining them through professional financial dictionaries and encyclopedias, financial databases, financial news, research reports, and announcements. Examples of these include professional financial dictionaries such as the New Palgrave Dictionary of Money and Finance, financial encyclopedia platforms such as the "Financial Encyclopedia" website, financial databases such as Wind and Bloomberg, and financial news media platforms such as Securities Times and Caixin.

[0054] Step S302: Acquire a news text dataset, a forum text dataset, an announcement text dataset, and a research report text dataset as pre-training samples.

[0055] Among them, a single data set includes multiple financial text data belonging to a single text type, and the amount of financial text data in the news text data set, the forum text data set, the announcement text data set and the research report text data set is distributed according to a preset ratio.

[0056] Specifically, a reasonable distribution ratio ensures that the model acquires a balanced mix of knowledge and sentiment patterns during learning, avoiding biases in model learning caused by an overabundance or underabundance of any particular data type. Experiments determined that the data distribution ratio for news, forums, announcements, and research reports should be 5:3:2:1. This is primarily due to the fact that news texts contain large amounts of information, are updated frequently, and have a wide impact on market sentiment, so they receive a larger share. Research reports, while highly professional, are relatively rare and therefore receive a smaller share. This distribution method, based on data characteristics and model requirements, helps improve model training effectiveness and the accuracy of sentiment analysis of financial texts.

[0057] In step S303, under the Transformers and DeepSpeed training framework, self-supervised pre-training is performed on the RoBERTa-wwm-ext-large pre-trained model to obtain the FinRoBERTa-ZH5 model.

[0058] RoBERTa-wwm-ext-large is a model pre-trained on a Chinese corpus and utilizes Whole Word Masking (wwm) technology. This technology allows the model to perform masking operations on a complete word basis during pre-training, which is more consistent with the characteristics of the Chinese language and helps the model better understand Chinese semantics. In financial text analysis, many financial terms and specialized vocabulary are complete words. Whole word masking enables the model to more accurately learn the semantics and contextual relationships of these words.

[0059] Furthermore, although RoBERTa-wwm-ext-large has been pre-trained on a large-scale Chinese corpus, financial text has unique linguistic styles, specialized terminology, and semantic expressions. Through self-supervised pre-training, using multiple financial terms, news text datasets, forum text datasets, announcement text datasets, and research report text datasets as pre-training samples, the model is further trained on financial text. This allows the model to better adapt to the linguistic characteristics and semantic patterns of the financial sector, improving its performance in sentiment analysis tasks for financial text.

[0060] Among them, the Transformers framework is a Python software package that supports the Transformer architecture of large language models and is developed for the Transformer architecture. Specifically, Transformers is a tool library containing pre-trained models, suitable for reasoning and training of natural language processing, computer vision, audio, and multimodal tasks. Developers can use this library to train models on their own data, build inference applications, and generate text using large model languages. DeepSpeed is an optimization framework for large-scale model training, which provides a series of optimization techniques such as mixed precision training, gradient accumulation, ZeRO optimization, etc. These technologies can significantly improve the efficiency and scalability of model training, reduce training time and memory usage. It is conducive to the efficient use of computing resources and accelerates the model training process.

[0061] As can be seen in this example, the FinRoBERTa-ZH5 model is specifically optimized for the Chinese financial domain. It combines the advantages of the RoBERTa-wwm-ext-large model with self-supervised learning in the financial domain, enabling more accurate sentiment analysis of financial text. Compared to general pre-trained models, the FinRoBERTa-ZH5 model demonstrates higher accuracy and greater adaptability for sentiment analysis of financial text.

[0062] Step S304 , fine-tuning the FinRoBERTa-ZH5 model according to the forum text dataset, the announcement text dataset, and the research report text dataset.

[0063] Specifically, the FinRoBERTa-ZH5 model is fine-tuned according to the forum text dataset, announcement text dataset and research report text dataset, that is, the first fine-tuning scheme is executed, so that a single corresponding sentiment analysis result can be output based on a single input text data.

[0064] Among them, the sentiment analysis results are used to represent positive sentiment, negative sentiment, or neutral sentiment.

[0065] Among them, the first fine-tuning scheme is to fine-tune the FinRoBERTa-ZH5 model based on a single text dataset, so that a single corresponding sentiment analysis result can be output based on a single input text data, and the sentiment analysis result is used to characterize positive sentiment, negative sentiment, or neutral sentiment.

[0066] For example, for the three types of text, "announcements, forums, and research reports," we use a unified modeling approach: fine-tuning FinRoBERTa-ZH5 to build a text sequence classification model for a single input, i.e., "x~y." "x" is a piece of text, and y is "positive, medium, and negative" (2, 1, 0).

[0067] Step S305: Obtain the target forum BERT model, target announcement BERT model, and target research report BERT model.

[0068] Step S306 : adding a preset number of reference news text data to the news text data set to obtain a first news text data set.

[0069] Among them, the reference news text data is neutral sentiment data.

[0070] It's important to note that news text data may contain multiple corporate entities: entity 1 may express positive sentiment, while entity 2 may express no sentiment (neutral) or a sentiment opposite to entity 1. For the ASC problem involving news text, the task can be broken down into: the sentiment of company A on aspect {1, n}, and the sentiment of company B on aspect {1, n}. This is a complex problem. This solution aims to identify general sentiment rather than focusing on the sentiment of individual aspects. In this case, the problem is simplified and transformed into the sentiment of a "text segment" towards company A and the sentiment towards company B.

[0071] Step S307: Using preset symbols to replace non-target corporate entities in the first news text dataset to obtain a second news text dataset.

[0072] The second news text dataset includes multiple corporate entities.

[0073] Exemplarily, special symbols are used to replace non-target enterprise entities, such as sentence 1: target entity; sentence 2: text segment, where the non-target entity is replaced by [E].

[0074] Step S308: fine-tune the FinRoBERTa-ZH5 model using the second news text dataset.

[0075] Specifically, the FinRoBERTa-ZH5 model is fine-tuned using the second news text dataset, i.e., a second fine-tuning scheme is executed, so that multiple sentiment analysis results corresponding to the multiple corporate entities can be output based on a single input of news text data.

[0076] Among them, the second fine-tuning scheme is to add a preset number of reference news text data to the news text dataset to obtain a first news text dataset, and the reference news text data is neutral sentiment data; use preset symbols to replace non-target corporate entities in the first news text dataset to obtain a second news text dataset, and the second news text dataset includes multiple corporate entities; the FinRoBERTa-ZH5 model is fine-tuned through the second news text dataset, so that multiple sentiment analysis results corresponding to the multiple corporate entities can be output based on a single input of news text data.

[0077] Understandably, the problem becomes more complex when news text data contains multiple corporate entities, each of which may have different sentiments in different aspects (i.e., aspects). Aspects may involve unknown areas such as performance and equity. This means that sentiment analysis cannot simply start from the overall text; it must delve into the different levels of each corporate entity to determine sentiment, requiring both complexity and precision.

[0078] Furthermore, solving this complex aspect-based sentiment classification (ASC) problem requires two arduous tasks. First, define the aspects—specifically, clarify the specific aspects of the enterprise subject from which sentiment analysis should be conducted, such as performance, equity, or market competitiveness. Second, label samples for these defined aspects to provide supervised learning data for model training. Models are then constructed for each aspect, and finally, comprehensive sentiment analysis results are obtained through ensemble or average aggregation.

[0079] Step S309: Obtain the target news BERT model.

[0080] As can be seen, in this embodiment, by acquiring multiple financial terms and a text dataset of news, forums, announcements, and research reports distributed in a preset proportion, the RoBERTa-wwm-ext-large pre-trained model is self-supervised pre-trained under a specific framework to obtain the FinRoBERTa-ZH5 model adapted for the Chinese financial domain. Next, the model undergoes two types of fine-tuning: the first fine-tuning scheme is executed using the forum, announcement, and research report datasets to obtain the corresponding target BERT model, and the second fine-tuning scheme is executed using the processed news dataset to obtain the target news BERT model. This overall approach effectively improves the model's accuracy and adaptability for sentiment analysis of different types of financial text.

[0081] See also Figure 4 , Figure 4 : is a flow chart of a method for generating target sample data provided by an embodiment of the present application, the method comprising the following steps: Step S410 , determining target news text data, target announcement text data, target research report text data, and target forum text data.

[0082] In the specific implementation, by performing text classification and data cleaning on the initial text data, target news text data, target announcement text data, target research report text data and target forum text data are obtained.

[0083] Step S420 : performing a subject recognition operation on the target news text data according to the LLM language model and the first operation configuration file to obtain news sample data.

[0084] The first operation configuration file includes a subject identification rule.

[0085] In one possible embodiment, the subject identification rule includes a first matching rule and a second matching rule; performing the subject identification operation on target news text data according to the LLM language model and the first operation configuration file to obtain news sample data includes: obtaining a preset enterprise name database; executing the first matching rule on the news text data according to the Aho-Corasick matching algorithm and the enterprise name database to determine a plurality of first enterprise entities and a plurality of suspected enterprise entities in the news text data; and determining context data of the plurality of suspected enterprise entities in the target news text data; executing the second matching rule on the context data according to the Prompt project of the LLM language model to determine a plurality of second enterprise entities present in the target news text data from the plurality of suspected enterprise entities; The entity identification operation is completed according to the multiple first enterprise entities and the multiple second enterprise entities.

[0086] Among them, the corporate name database contains historical full name and abbreviation change information, and fully covers the Chinese A-share market (about 5,000 stocks).

[0087] In specific implementations, the Aho-Corasick matching algorithm can completely and correctly match more than 97.1% of corporate names, an effect that exceeds the mainstream subject recognition model scheme. However, there are still about 3% of corporate names that cannot be correctly matched. The main reason is the ambiguity and ambiguity of the abbreviations of Chinese corporate names. Some corporate abbreviations may overlap with common words or other concepts, making identification difficult. For example, "China Great Wall" can refer to the Great Wall of China, or it can be the abbreviation of "China Great Wall Technology Group Co., Ltd."; two-character corporate abbreviations such as "Hongtu" and "Dangfang" are more likely to be ambiguous because they are common words themselves. Therefore, it is necessary to further judge multiple suspected corporate entities to determine the true corporate entity.

[0088] In a possible embodiment, executing the second matching rule on the context data according to the Prompt project of the LLM language model includes: For each of the multiple suspected corporate entities, prompt the LLM language model to inquire about the corporate entity judgment result, and obtain multiple corporate entity judgment results; and For each of the multiple suspected corporate entities, add preset keywords before and after the keyword corresponding to the suspected corporate entity, and perform a prompt query on the LLM language model for a grammatical logic judgment result to obtain multiple grammatical logic judgment results; The plurality of second enterprise entities are determined by performing cross-validation based on the plurality of enterprise entity judgment results and the plurality of grammatical logic judgment results.

[0089] For example, the result of prompting the LLM language model to determine the corporate entity can be: please analyze the two words "Hongtu" in the following paragraph, determine whether it can independently refer to the abbreviation of a company in the text, and finally output in the format: "Result: yes or no"; the result of prompting the LLM language model to determine the grammatical logic can be: please analyze the four words "Hongtu Company" in the following paragraph, determine whether its grammatical logic in the text is correct, and finally output in the format: "Result: yes or no".

[0090] Step S430: Perform a first summary generation operation on the target announcement text data according to the LLM language model and the second operation configuration file to obtain announcement summary data.

[0091] The second operation configuration file includes summary generation rules for the announcement text data.

[0092] Announcement summary data is a distillation and summary of the core content of the target announcement text data. Summary data can highlight key information in the announcement, such as important decisions and major event results.

[0093] In the implementation, GLM and Deepseek large models are used in the summary generation solution. Other Chinese models (such as Qwen and Yi) can also be used as substitutes, but the performance of internal data evaluation is weaker than the selected model.

[0094] Step S431: Merge the target announcement text data with the announcement summary data to obtain announcement sample data.

[0095] Among them, the target announcement text data contains all the detailed contents of the announcement released by the enterprise, including specific information on the enterprise's financial status, major decisions, business dynamics, etc.

[0096] It's understandable that the detailed content of the target announcement text data helps more accurately capture the sentiment within the announcement. Some emotional information may be hidden in specific descriptions and details, and might be missed through a mere summary. The fused announcement sample data combines both detailed content and key points, enabling sentiment analysis to more comprehensively consider various factors within the text. Different parts of the text may convey different emotional information, and fusion can integrate this information, avoiding biased sentiment analysis caused by focusing only on a subset of the content.

[0097] Step S440: Perform a second summary generation operation on the target research report text data according to the LLM language model and the third operation configuration file to obtain research report summary data.

[0098] The third operation configuration file includes summary generation rules for research report text data.

[0099] Among them, the research report summary data is a condensation and refinement of the core content of the research report, which can quickly convey the main points and important information of the research report.

[0100] In the implementation, GLM and Deepseek large models are used in the summary generation solution. Other Chinese models (such as Qwen and Yi) can also be used as substitutes, but the performance of internal data evaluation is weaker than the selected model.

[0101] Step S441: Merge the target research report text data with the research report summary data to obtain research report sample data.

[0102] Among them, the target research report text data includes all the contents of the research report, such as detailed industry data, company financial statement analysis, in-depth discussion of market trends, etc.

[0103] It is understandable that integrating summary data with the original research report text can make the key points more prominent, facilitate quick grasp of the key points of the research report, and improve the efficiency of information acquisition.

[0104] Step S450: determining the target forum text data as forum sample data.

[0105] It's important to clarify that the target forum text data doesn't require subject identification or summary generation. This is primarily because forum text data, characterized by brevity, immediacy, colloquialism, dispersion, and diversity, can be quickly understood and analyzed by the model without the need for summary generation. Furthermore, the model is more concerned with the overall sentiment of investors or participants, and using the raw forum text data directly can more realistically reflect this overall sentiment.

[0106] As can be seen, this example first processes four target text types within the initial text. News text is identified through subject recognition to determine the corporate entity; announcements and research reports are summarised and merged with the original text; and forum text is used directly as a sample. This method improves the accuracy of financial text processing, integrates information, reflects market sentiment, and provides high-quality data for subsequent analysis.

[0107] See also Figure 5 , Figure 5 The following is a flow chart of a data cleaning method provided in an embodiment of the present application, which includes the following steps: Step S510: Acquire initial text data.

[0108] Among them, the initial text data in the financial field comes from a wide range of sources, including news reports, announcements from listed companies, stock forums, and research reports.

[0109] Step S520: Load the first configuration file.

[0110] The first configuration file includes a plurality of configuration information for representing text cleaning rules.

[0111] Step S530: parsing the configuration information corresponding to the text cleaning rule.

[0112] In one possible embodiment, the multiple configuration information used to characterize text cleaning rules includes at least the following information: rule ID, rule level, rule category, processing field, location, rule logic, rule keyword or threshold, rule interpretation; the rule level includes document level and paragraph level; and the rule category includes deletion operation, cleaning operation and retention operation.

[0113] Furthermore, "rule id" gives each cleaning rule a unique identifier, which facilitates the management, search and call of numerous rules; "processing field" represents the text field to be checked, including "title" and "original text"; "position" includes "first paragraph, first sentence", etc.; "rule logic" represents operators, such as "contains, less than", etc.; "rule keyword or threshold" represents specific cleaning rules, such as filled-in regular expressions, thresholds, etc., and judgments are made based on the aforementioned fields, and then loaded, parsed and executed.

[0114] Step S540 : Classify the initial text data according to text type to obtain a plurality of reference text data.

[0115] Specifically, after text type classification, reference news text data, reference forum text data, reference announcement text data and reference research report text data can be obtained.

[0116] Step S550 : for each reference text data, determine whether to apply document-level rules for cleaning.

[0117] Specifically, if yes, execute step S560; if no, execute step S570.

[0118] Step S560: Apply document-level rules for cleaning.

[0119] Step S561: Execute pre-stored first type irrelevant rules.

[0120] Type-agnostic rules are generally applicable to all types of text, regardless of the specific text type (e.g., financial news, listed company announcements, stock forums, research reports). These rules are designed to improve the overall quality of text based on general text standards.

[0121] Specifically, steps S5611, S5612, and S5613 are respectively executed to execute the first type of irrelevant rules, which specifically include checking the number of words, the proportion of list items, and space processing.

[0122] Step S562: Execute pre-stored first type related rules.

[0123] Among them, type-related rules are exclusive cleaning rules formulated based on the characteristics of specific text types (financial news, listed company announcements, stock forums, research reports).

[0124] Specifically, the first type of related rules acts on the entire document level. During document-level cleaning, the cleaning operation is performed on the entire document based on the characteristics of different text types such as financial news, listed company announcements, stock forums, research reports, etc. For example, the overall format specifications and information disclosure integrity of the announcement document are checked and corrected.

[0125] Step S570: Generate intermediate text.

[0126] Step S571: segment the middle text into paragraphs.

[0127] Step S572: Apply paragraph-level rules for cleaning.

[0128] Step S573: Execute pre-stored second type irrelevant rules.

[0129] Specifically, steps S5731 and S5732 are respectively executed to execute the second type of irrelevant rules, which specifically include character ratio checking and non-Chinese processing.

[0130] Step S574: executing pre-stored second type related rules.

[0131] Among them, the second type of related rules focuses on text paragraphs. In the paragraph-level cleaning stage, paragraphs of different types of text are cleaned according to their respective type characteristics, such as the professional analysis logic in research report paragraphs and the accuracy of event descriptions in financial news paragraphs.

[0132] Step S580: Generate multiple target text data after data cleaning.

[0133] Step S590: output multiple target text data.

[0134] As can be seen, in this embodiment, the data cleaning architecture is divided into two levels: document-level and paragraph-level cleaning. The main reason for not introducing sentence-level cleaning is that the core focus is sentiment analysis of long texts, not sentence-level analysis. By applying type-independent and type-dependent rules to perform document-level and paragraph-level cleaning, we can effectively remove noise from the text, standardize formatting, and improve text quality.

[0135] See also Figure 6 , Figure 6 This is an overall flow chart of a financial text sentiment analysis method based on an AI model provided by an embodiment of the present application, which includes the following steps: obtaining initial text data; obtaining announcement text, research report text, news text and forum text through text classification; performing text cleaning through a cleaning module; for announcement text and research report text, inputting the cleaned target text data into a summary generation module, and then obtaining corresponding summary data based on domain rules and the LLM large model; and performing sample fusion on the summary data and the cleaned target text data to obtain announcement sample data and research report sample data; inputting the announcement sample data and the research report sample data into the target announcement BERT model and the target research report BERT model respectively; for news text, inputting the cleaned target news data into a subject recognition module, and then performing subject recognition based on domain rules and the LLM large model; inputting the recognized news sample data into the target news BERT model; for forum text, inputting the cleaned forum sample data into the target forum BERT model; fusing multiple sentiment analysis results determined by multiple models; and outputting the target sentiment analysis result.

[0136] See also Figure 7 , Figure 7 This is an application scenario diagram of a financial text sentiment analysis method based on an AI model provided in an embodiment of the present application, such as Figure 7 As shown, the application scenario diagram is a schematic diagram of a financial text sentiment analysis page.

[0137] The diagram of the financial text sentiment analysis page primarily consists of two areas: the top half displays questions and answers, while the bottom half is the input area. The input area prompts the user to "send a message or select a file," providing information on available actions. The left side features an icon for uploading a new file, while the right side includes icons for cutting, calling, voice, and sending, providing a variety of interactive options to meet the needs of different users.

[0138] Specifically, in the question-and-answer display area, the user inputs a document including initial text data and asks "Please analyze this document and output the results of the financial text sentiment analysis", clarifying the purpose of the operation, that is, to let the system perform sentiment analysis on the uploaded document; the system outputs the analysis results in the box, such as "Okay, after analysis, the initial text data is news text data, including multiple corporate entities. Among them, Company A has positive sentiment, based on xxx; Company B has negative sentiment, based on xxx; Company C has neutral to negative sentiment, based on xxx." It not only informs the text type, but also explains the emotional tendencies and judgment basis of each corporate entity, making the analysis results more convincing and credible, and convenient for users to understand and use.

[0139] It can be seen that in this embodiment, the function of users uploading initial text data (such as news text) and obtaining analysis results is realized. It can clearly identify the text type, accurately give the emotional tendencies and basis of each corporate entity, and at the same time provide diversified interaction methods to present the results of financial text emotional analysis to users efficiently and intuitively, helping users to understand the financial market situation based on text emotions.

[0140] For the same method as above, please refer to Figure 8 , Figure 8 This is a structural diagram of an electronic device 8 provided in an embodiment of the present application. As shown in the figure, the electronic device 8 includes a processor 81, a communication interface 82, a memory 83, a communication bus 84, and one or more programs 831, wherein the one or more programs 831 are stored in the above-mentioned memory 83 and are configured to be executed by the above-mentioned processor 81, and the one or more programs 831 include instructions for executing any step in the above-mentioned method embodiment.

[0141] The above mainly introduces the solution of the embodiment of the present application from the perspective of the execution process of the method side. It is understandable that, in order to realize the above functions, the electronic device includes a hardware structure and / or software module corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiment provided herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in a hardware or computer software driven hardware manner depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0142] The embodiment of the present application can divide the functional units of the electronic device according to the above method example. For example, each functional unit can be divided according to each function, or two or more functions can be integrated into one processing unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units. It should be noted that the division of units in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0143] See also Figure 9 , Figure 9 This is a functional unit block diagram of a financial text sentiment analysis system based on an AI model provided in an embodiment of the present application, such as Figure 9 As shown, the financial text sentiment analysis system based on the AI model includes the following units: An acquisition unit 100 is used to acquire initial text data in the financial field; The processing unit 200 is used to load a pre-stored first configuration file, and perform text classification and data cleaning on the initial text data according to the first configuration file to obtain multiple target text data corresponding to multiple text types, wherein the first configuration file includes multiple configuration information for characterizing text cleaning rules; and, based on the multiple text types, perform multiple processing operations on the multiple target text data according to the LLM language model and multiple pre-stored operation configuration files to obtain multiple target sample data, wherein the multiple text types correspond one-to-one to the multiple processing operations, the multiple processing operations include a summary generation operation and a subject identification operation, and the multiple operation configuration files include multiple processing rules for implementing the multiple processing operations; and, input the multiple target sample data one-to-one into the corresponding multiple target BERT models to obtain multiple sentiment analysis results, wherein the multiple target BERT models are obtained by fine-tuning a pre-trained FinRoBERTa-ZH5 model based on the multiple text types; The output unit 300 is used to fuse the multiple sentiment analysis results into a target sentiment analysis result and output the target sentiment analysis result.

[0144] As can be seen, the examples in this application address the limited effectiveness of analyzing a single text source by integrating multiple types of financial text, alleviating the scarcity of Chinese financial data and improving the model's applicability in specific fields. While maintaining high accuracy, they significantly reduce model inference latency, meeting the real-time requirements of quantitative trading scenarios. Furthermore, differentiated processing strategies are designed for different types of financial text, significantly improving the accuracy and stability of sentiment classification.

[0145] In one embodiment, in terms of performing multiple processing operations on the multiple target text data according to the LLM language model and multiple pre-stored operation profiles to obtain multiple target sample data, the processing unit 200 is specifically used to: perform the subject identification operation on the target news text data according to the LLM language model and the first operation profile to obtain news sample data, the first operation profile including subject identification rules; and perform a first summary generation operation on the target announcement text data according to the LLM language model and the second operation profile to obtain announcement summary data, the second operation profile including summary generation rules for announcement text data; and fuse the target announcement text data with the announcement summary data to obtain announcement sample data; and perform a second summary generation operation on the target research report text data according to the LLM language model and the third operation profile to obtain research report summary data, the third operation profile including summary generation rules for research report text data; and fuse the target research report text data with the research report summary data to obtain research report sample data; and determine the target forum text data as forum sample data.

[0146] In one embodiment, in terms of performing the subject identification operation on the target news text data according to the LLM language model and the first operation configuration file to obtain news sample data, the processing unit 200 is specifically used to: obtain a preset enterprise name database; perform the first matching rule on the news text data according to the Aho-Corasick matching algorithm and the enterprise name database to determine multiple first enterprise entities and multiple suspected enterprise entities in the news text data; and determine context data of the multiple suspected enterprise entities in the target news text data; perform the second matching rule on the context data according to the Prompt project of the LLM language model to determine multiple second enterprise entities existing in the target news text data from the multiple suspected enterprise entities; and determine the completion of the subject identification operation based on the multiple first enterprise entities and the multiple second enterprise entities.

[0147] In one embodiment, in terms of executing the second matching rule on the context data according to the Prompt project of the LLM language model, the processing unit 200 is specifically used to: for each of the multiple suspected enterprise entities, perform a Prompt query on the enterprise entity judgment result to the LLM language model to obtain multiple enterprise entity judgment results; and, for each of the multiple suspected enterprise entities, add preset keywords before and after the keywords corresponding to the suspected enterprise entity, and perform a Prompt query on the grammatical logic judgment result to the LLM language model to obtain multiple grammatical logic judgment results; and perform cross-validation based on the multiple enterprise entity judgment results and the multiple grammatical logic judgment results to determine the multiple second enterprise entities.

[0148] An embodiment of the present application also provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, and the computer program enables a computer to execute part or all of the steps of any method described in the above method embodiments, and the above computer includes an electronic device.

[0149] It should be noted that for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.

[0150] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0151] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the above-mentioned units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.

[0152] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0153] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0154] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a memory and includes a number of instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the above-mentioned methods in each embodiment of the present application. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk, and other media that can store program code.

[0155] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable memory, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0156] The above is a detailed introduction to the embodiments of the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of the present application. At the same time, for those skilled in the art, according to the idea of the present application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A financial text sentiment analysis method based on AI model, characterized by: A server for a financial text sentiment analysis system based on an AI model, the method comprising: Obtain initial text data in the financial field; Loading a pre-stored first configuration file, and performing text classification and data cleaning on the initial text data according to the first configuration file to obtain a plurality of target text data corresponding to a plurality of text types, wherein the first configuration file includes a plurality of configuration information for representing text cleaning rules; Based on the multiple text types, performing multiple processing operations on the multiple target text data according to the LLM language model and multiple pre-stored operation configuration files to obtain multiple target sample data, the multiple text types corresponding to the multiple processing operations in a one-to-one manner, the multiple processing operations including a summary generation operation and a subject identification operation, and the multiple operation configuration files including multiple processing rules for implementing the multiple processing operations; Inputting the multiple target sample data one by one into corresponding multiple target BERT models to obtain multiple sentiment analysis results, wherein the multiple target BERT models are obtained by fine-tuning a pre-trained FinRoBERTa-ZH5 model based on the multiple text types; The multiple sentiment analysis results are fused into a target sentiment analysis result, and the target sentiment analysis result is output.

2. The method according to claim 1, characterized in that The multiple text types include news type, forum type, announcement type, and research report type; before obtaining the initial text data in the financial field, the method further includes: Get multiple financial terms; Acquire a news text dataset, a forum text dataset, an announcement text dataset, and a research report text dataset, wherein a single dataset includes multiple pieces of financial text data belonging to a single text type, and the amount of financial text data in the news text dataset, the forum text dataset, the announcement text dataset, and the research report text dataset is distributed according to a preset ratio; Using the multiple financial terms, the news text dataset, the forum text dataset, the announcement text dataset, and the research report text dataset as pre-training samples, self-supervised pre-training is performed on the RoBERTa-wwm-ext-large pre-training model under the Transformers and DeepSpeed training framework to obtain the FinRoBERTa-ZH5 model; Different fine-tuning schemes are performed on the FinRoBERTa-ZH5 model according to the multiple text types to obtain the multiple target BERT models.

3. The method according to claim 2, characterized in that The news text dataset includes news text data, and the news text data includes a target enterprise entity; performing different fine-tuning schemes on the FinRoBERTa-ZH5 model according to the multiple text types to obtain the multiple target BERT models includes: Execute a first fine-tuning scheme on the FinRoBERTa-ZH5 model according to the forum text dataset, the announcement text dataset, and the research report text dataset, respectively, to obtain corresponding target forum BERT model, target announcement BERT model, and target research report BERT model; and A second fine-tuning scheme is performed on the FinRoBERTa-ZH5 model according to the news text dataset to obtain a target news BERT model.

4. The method according to claim 3, characterized in that The first fine-tuning scheme is to fine-tune the FinRoBERTa-ZH5 model based on a single text dataset, so that a single corresponding sentiment analysis result can be output based on a single input text data, and the sentiment analysis result is used to represent positive sentiment, negative sentiment, or neutral sentiment; The second fine-tuning scheme is to add a preset number of reference news text data to the news text dataset to obtain a first news text dataset, wherein the reference news text data is neutral sentiment data; non-target corporate entities in the first news text dataset are replaced with preset symbols to obtain a second news text dataset, wherein the second news text dataset includes multiple corporate entities; the FinRoBERTa-ZH5 model is fine-tuned using the second news text dataset so that multiple sentiment analysis results corresponding to the multiple corporate entities can be output based on a single input of news text data.

5. The method according to any one of claims 1 to 4, characterized in that The performing of multiple processing operations on the multiple target text data according to the LLM language model and multiple pre-stored operation configuration files to obtain multiple target sample data includes: Performing the subject recognition operation on target news text data according to the LLM language model and a first operation configuration file to obtain news sample data, wherein the first operation configuration file includes a subject recognition rule; and Performing a first summary generation operation on target announcement text data according to the LLM language model and a second operation configuration file to obtain announcement summary data, wherein the second operation configuration file includes summary generation rules for the announcement text data; and fusing the target announcement text data with the announcement summary data to obtain announcement sample data; and Performing a second summary generation operation on the target research report text data according to the LLM language model and a third operation configuration file to obtain research report summary data, wherein the third operation configuration file includes summary generation rules for the research report text data; and fusing the target research report text data with the research report summary data to obtain research report sample data; and, The target forum text data is determined as the forum sample data.

6. The method according to claim 5, characterized in that The subject identification rule includes a first matching rule and a second matching rule; performing the subject identification operation on the target news text data according to the LLM language model and the first operation configuration file to obtain news sample data includes: Obtain a preset database of company names; executing the first matching rule on the news text data according to the Aho-Corasick matching algorithm and the enterprise name database to determine a plurality of first enterprise entities and a plurality of suspected enterprise entities in the news text data; and determining context data of the plurality of suspected enterprise entities in the target news text data; executing the second matching rule on the context data according to the Prompt project of the LLM language model to determine a plurality of second enterprise entities present in the target news text data from the plurality of suspected enterprise entities; The entity identification operation is completed according to the multiple first enterprise entities and the multiple second enterprise entities.

7. The method according to claim 6, characterized in that The executing the second matching rule on the context data according to the Prompt project of the LLM language model includes: For each of the multiple suspected corporate entities, prompt the LLM language model to inquire about the corporate entity judgment result, and obtain multiple corporate entity judgment results; and For each of the multiple suspected corporate entities, add preset keywords before and after the keyword corresponding to the suspected corporate entity, and perform a prompt query on the LLM language model for a grammatical logic judgment result to obtain multiple grammatical logic judgment results; The plurality of second enterprise entities are determined by performing cross-validation based on the plurality of enterprise entity judgment results and the plurality of grammatical logic judgment results.

8. The method according to claim 7, characterized in that The plurality of configuration information for characterizing text cleaning rules includes at least the following information: rule ID, rule level, rule category, processing field, location, rule logic, rule keyword or threshold, and rule explanation; The rule levels include document level and paragraph level; and the rule categories include deletion operation, cleaning operation and retention operation.

9. A financial text sentiment analysis system based on AI model, characterized by: The system includes an acquisition unit, a processing unit, and an output unit, wherein: The acquisition unit is used to acquire initial text data in the financial field; The processing unit is configured to load a pre-stored first configuration file, and perform text classification and data cleaning on the initial text data according to the first configuration file to obtain multiple target text data corresponding to multiple text types, wherein the first configuration file includes multiple configuration information for characterizing text cleaning rules; and, based on the multiple text types, perform multiple processing operations on the multiple target text data according to an LLM language model and multiple pre-stored operation configuration files to obtain multiple target sample data, wherein the multiple text types correspond one-to-one to the multiple processing operations, the multiple processing operations include a summary generation operation and a subject identification operation, and the multiple operation configuration files include multiple processing rules for implementing the multiple processing operations; and, input the multiple target sample data one-to-one into the corresponding multiple target BERT models to obtain multiple sentiment analysis results, wherein the multiple target BERT models are obtained by fine-tuning a pre-trained FinRoBERTa-ZH5 model based on the multiple text types; The output unit is used to fuse the multiple sentiment analysis results into a target sentiment analysis result and output the target sentiment analysis result.

10. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: The computer program / instructions are executed by a processor to implement the steps of the method according to any one of claims 1 to 8.