Financial statement field grading method and system based on prompt learning
Through a prompt learning method, using pre-trained language model and answer mapper, intelligent grading of financial statement fields is achieved, solving the problem of lack of automated methods for financial field grading in the existing technology, and improving the accuracy and consistency of classification.
Patent Information
- Application Number
- CN202411735201.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-21
AI Technical Summary
The existing technology lacks effective automation methods in the financial field classification process, resulting in large workload and high cost.
Using a prompt learning method, by preprocessing the text data of financial statement fields, multiple template functions are designed to convert text into cloze-filling questions, and the answer is predicted using a pre-trained language model, and the answer is mapped into label words in the financial field grading output set through the answer mapper, and finally the grading results are comprehensively graded through the voting mechanism.
The prediction process of financial text classification is simplified, the accuracy and consistency of classification is improved, the intelligent grading of financial statement fields is realized, and the dependence on artificial feature engineering is reduced.
Smart Images

Figure CN119669472A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer natural language processing, and in particular to a method and system for grading financial report fields based on prompt learning. Background Art
[0002] In recent years, the informatization of my country's securities and futures markets has developed rapidly. With the advancement of technology and the deepening of its application, various market players have accumulated a large amount of data, which has posed new challenges to digital construction. For example, it is necessary to identify data usage needs, clarify technical standards, identify risks and hidden dangers, and strengthen data security management. Standardized data classification and grading will help clarify data assets, determine their importance or sensitivity, and take appropriate management measures and security protection accordingly, forming a scientific data asset management and protection mechanism.
[0003] The classification and grading of financial data, starting from the business line, firstly subdivides the business, solves the business classification problem, and determines the data management subject; secondly, subdivides the data to form a tree-shaped logical system structure from general to specific, and focuses on solving the data classification problem on the basis of clarifying the data management subject and business classification; finally, the level of the classified data is determined while considering the determination of the data form. Data classification, that is, on the basis of data classification, the classified data is graded according to the impact caused by data leakage or damage, forming a unified classification and grading method. Data levels range from high to low, generally from level 4 to level 1. Level 4 (very high) data is mainly used for important business use in large or extra-large institutions in the industry, generally open to specific personnel, and only accessed or used by objects that must know; Level 3 (high) data is used for important business use, generally open to specific personnel, and only accessed or used by objects that must know; Level 2 (medium) data is used for general business use, generally open to restricted objects, and refers to data that is internally managed and not suitable for wide disclosure; Level 1 (low) data can generally be disclosed or known and used by the public. When classifying data, principles such as compliance, enforceability, and timeliness must be followed.
[0004] Although the financial industry has developed a series of general data classification standards and methodologies, the data classification still faces the problem of complex process and heavy workload, making it difficult to carry out reasonable, effective and comprehensive data classification because the data level must be determined comprehensively based on multiple factors such as the nature of the enterprise, data classification, scope of influence and degree of influence. Through research and analysis of a large number of literature, it is found that there has been a lack of effective automated methods for the classification of financial fields. At present, the classification of financial data fields mainly relies on manual methods, which is labor-intensive and costly. Summary of the invention
[0005] In order to solve the problems of large workload and high cost caused by the lack of effective automated methods in the prior art in the process of financial field classification, the primary purpose of the present invention is to provide a financial report field classification method based on prompt learning that simplifies the prediction process of financial text classification, realizes intelligent classification of financial report fields, enhances the understanding and classification capabilities of text, and greatly improves the accuracy and consistency of classification.
[0006] To achieve the above object, the present invention adopts the following technical solution: a method for grading financial statement fields based on prompt learning, the method comprising the following steps in order:
[0007] (1) Preprocessing the original data of the financial report field text to obtain preprocessed data samples, the preprocessed data samples forming a standard data set for classification and grading of securities data report fields, the preprocessing including word segmentation and removal of stop words;
[0008] (2) For each sample x in the standard dataset, use multiple template functions f prompt,i Convert x to multiple inputs p i (x), where i is a natural number, p i (x) Adding a prompt language for the classification task to sample x, where the prompt language contains the mask position that needs to be predicted and filled in with the label;
[0009] (3) Multiple inputs p i (x) Input the pre-trained language model M, which predicts the answer k to fill in each mask position of the template function i ;
[0010] (4) The answer k i Input answer mapper v, answer mapper v converts answer k i Mapped to the corresponding output label word v(k i ), the classification results of each template function are combined to output the label word v(k i ) to obtain the final financial field classification result.
[0011] In step (1), the word segmentation processing refers to using the Jieba word segmentation method to segment the original data of the financial report field text, and the word segmentation is performed at different granularities, including word level and character level, to convert the text data into the corresponding words or character sequences after word segmentation; the removal of stop words refers to removing stop words from the words or character sequences obtained after the word segmentation processing based on a custom stop word list, that is, deleting words that appear frequently in the text and have no practical meaning.
[0012] In step (2), the p iThe formula for (x) is:
[0013] p i (x) = f prompt,i (x,[mask])
[0014] Among them, f prompt,i For different template functions, x is passed through f prompt,i After the conversion of (x,[mask]), the financial text classification problem is converted into a cloze problem, that is, the pre-trained language model M is represented by p in the form of a cloze problem. i (x) is the input, and mask is the mask position.
[0015] The step (3) specifically refers to: calculating the answer k by using the pre-trained language model M i Fill in the probability of the template function mask position and search based on the probability. The formula is as follows:
[0016]
[0017] Among them, f fill (p i (x),k i ) is the pre-trained language model M that converts different answers k i Fill in p i (x); θ represents the parameter set of the pre-trained language model M; K is the label set of the text classification task, that is, the answer space, that is, the answer set to be predicted by the pre-trained language model M; search is an argmax search or a sampling function. The argmax search directly finds the output with the highest score for each prompt language according to the output distribution. The sampling function randomly generates output according to the probability distribution of the output of the pre-trained language model M.
[0018] In step (4), the mapping formula of the answer mapper v is as follows:
[0019] V=[v1,v2,v3,..,v i ]=[v(k1),v(k2),v(k3),..,v(k i )]
[0020] v i =v(k i )
[0021] Finally, a voting mechanism is adopted to integrate the grading results of each template function, and the number of occurrences of each grading result is counted. The grading result with a higher number of occurrences is the predicted final financial field grading result.
[0022] Another object of the present invention is to provide a financial statement field grading system based on prompt learning, comprising:
[0023] The field classification data preprocessing module is used to preprocess the original data of the financial report field text to obtain the securities data report field classification and grading standard data set, wherein the preprocessing operation includes word segmentation and stop word removal;
[0024] The prompt engineering module is used to design different prompt languages and answer spaces for preprocessed data samples;
[0025] The field classification module is used to classify multiple input p i (x) are respectively input into the pre-trained language model M to predict the answer to fill in each prompt language mask position, and then the predicted answer is mapped to the corresponding output label word in the pre-constructed financial field classification output set through the answer mapper. The classification result of each template function is the output label word v(k i ) to obtain the final financial field classification result.
[0026] It can be seen from the above technical scheme that the beneficial effects of the present invention are: First, the present invention simplifies the prediction process of financial text classification: the present invention effectively utilizes the advantages of pre-trained language models such as BERT in the field of natural language processing by converting the financial text classification problem into a classification prediction problem similar to cloze test, reduces the dependence on a large amount of artificial feature engineering, simplifies the prediction process of financial text classification, and improves classification efficiency and accuracy; second, the present invention realizes intelligent grading of financial report fields: it can intelligently classify and grade the fields in financial reports. Compared with the traditional rule-based manual classification method, the present invention does not rely on hard-coded rules and can dynamically adjust the classification standards according to actual needs; third, the present invention adopts a prompt integration strategy to improve classification performance: adopting a prompt integration strategy, by integrating multiple prompt language information, it enhances the understanding and classification ability of text, and greatly improves the accuracy and consistency of classification. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 is a flow chart of the method of the present invention;
[0028] Figure 2 It is a schematic diagram of a specific application of the present invention. DETAILED DESCRIPTION
[0029] like Figure 1 As shown, a method for classifying financial statement fields based on prompt learning comprises the following steps in order:
[0030] (1) Preprocessing the original data of the financial report field text to obtain preprocessed data samples, the preprocessed data samples forming a standard data set for classification and grading of securities data report fields, the preprocessing including word segmentation and removal of stop words;
[0031] (2) For each sample x in the standard dataset, use multiple template functions f prompt,i Convert x to multiple inputs p i (x), where i is a natural number, p i (x) Adding a prompt language for the classification task to sample x, where the prompt language contains the mask position that needs to be predicted and filled in with the label;
[0032] (3) Multiple inputs p i (x) Input the pre-trained language model M, which predicts the answer k to fill in each mask position of the template function i ;
[0033] (4) The answer k i Input answer mapper v, answer mapper v converts answer k i Mapped to the corresponding output label word v(k i ), the classification results of each template function are combined to output the label word v(k i ) to obtain the final financial field classification result.
[0034] In step (1), the word segmentation process refers to the use of the Jieba word segmentation method to segment the original data of the financial report field text, and the word segmentation is performed at different granularities, including word level and character level, to convert the text data into the corresponding word or character sequence after word segmentation. In Chinese data, the choice of granularity is one of the main factors. It is necessary to select a suitable word segmentation granularity in the scenario of financial report field text to achieve a better model effect; the removal of stop words refers to the removal of stop words based on a custom stop word list for the words or character sequences obtained after word segmentation, that is, deleting words that appear frequently in the text and have no practical meaning.
[0035] In step (2), the p i The formula for (x) is:
[0036] p i (x) = f prompt,i (x,[mask])
[0037] Among them, f prompt,i For different template functions, x is passed through f prompt,iAfter the conversion of (x,[mask]), the financial text classification problem is converted into a cloze problem, that is, the pre-trained language model M is represented by p in the form of a cloze problem. i (x) is the input, and mask is the mask position.
[0038] The step (3) specifically refers to: calculating the answer k by using the pre-trained language model M i Fill in the probability of the template function mask position and search based on the probability. The formula is as follows:
[0039]
[0040] Among them, f fill (p i (x),k i ) is the pre-trained language model M that converts different answers k i Fill in p i (x); θ represents the parameter set of the pre-trained language model M; K is the label set of the text classification task, that is, the answer space, that is, the answer set to be predicted by the pre-trained language model M; search is an argmax search or a sampling function. The argmax search directly finds the output with the highest score for each prompt language according to the output distribution. The sampling function randomly generates output according to the probability distribution of the output of the pre-trained language model M.
[0041] In step (4), the mapping formula of the answer mapper v is as follows:
[0042] V=[v1,v2,v3,..,v i ]=[v(k1),v(k2),v(k3),..,v(k i )]
[0043] v i =v(k i )
[0044] Finally, a voting mechanism is adopted to integrate the grading results of each template function, and the number of occurrences of each grading result is counted. The grading result with a higher number of occurrences is the predicted final financial field grading result.
[0045] The system includes:
[0046] The field classification data preprocessing module is used to preprocess the original data of the financial report field text to obtain the securities data report field classification and grading standard data set, wherein the preprocessing operation includes word segmentation and stop word removal;
[0047] The prompt engineering module is used to design different prompt languages and answer spaces for preprocessed data samples;
[0048] The field classification module is used to classify multiple input p i (x) are respectively input into the pre-trained language model M to predict the answer to fill in each prompt language mask position, and then the predicted answer is mapped to the corresponding output label word in the pre-constructed financial field classification output set through the answer mapper. The classification result of each template function is the output label word v(k i ) to obtain the final financial field classification result.
[0049] Embodiment 1
[0050] like Figure 2 As shown, the original sequence "transaction-transaction management-bank-securities transfer" is preprocessed to obtain the word sequence x = "transaction transaction management bank-securities transfer";
[0051] Construct the prompt language as f1 = "[x] may be [mask] in the financial field classification task", f2 = "According to financial risk assessment, the type of [x] is [mask]", and f3 = "Financial analysts may classify [x] as [mask]". Substitute the word sequence x into the above prompt language as the input of the pre-trained language model Bert;
[0052] Design the answer space K as (sensitive data, core transaction indicators, internal data, auxiliary transaction information, public data, general transaction records, less important information); input the word sequence x into the pre-trained language model Bert, and obtain the output k predicted by the pre-trained language model i They are sensitive data, auxiliary transaction information, and sensitive data.
[0053] Design the financial field hierarchical output set V as (level 1, level 2, level 3), the answer mapper v: (sensitive data, core transaction indicators) ∈ level 3, (internal data, auxiliary transaction information) ∈ level 2, (public data, general transaction records, less important information) ∈ level 1.
[0054] Get the corresponding level v(k i ), which are level 3, level 2, and level 3 respectively. According to the voting mechanism and the classification results of each template function, it is predicted that the classification of the financial statement field is 3.
[0055] In summary, the present invention transforms the financial text classification problem into a classification prediction problem similar to cloze test, effectively utilizes the advantages of pre-trained language models such as BERT in the field of natural language processing, reduces the dependence on a large amount of artificial feature engineering, simplifies the prediction process of financial text classification, and improves classification efficiency and accuracy; it can intelligently classify and grade the fields in financial statements. Compared with the traditional rule-based manual classification method, the present invention does not rely on hard-coded rules and can dynamically adjust the classification criteria according to actual needs; the present invention adopts a prompt integration strategy, and by integrating multiple prompt language information, it enhances the ability to understand and classify text, and greatly improves the accuracy and consistency of classification.
Claims
1. A method for grading financial statement fields based on prompt learning, characterized in that: The method comprises the following steps in order: (1) Preprocessing the original data of the financial report field text to obtain preprocessed data samples, the preprocessed data samples forming a standard data set for classification and grading of securities data report fields, the preprocessing including word segmentation and removal of stop words; (2) For each sample x in the standard dataset, use multiple template functions f prompt,i Convert x to multiple inputs p i (x), where i is a natural number, p i (x) Adding a prompt language for the classification task to sample x, where the prompt language contains the mask position that needs to be predicted and filled in with the label; (3) Multiple inputs p i (x) Input the pre-trained language model M, which predicts the answer k to fill in each mask position of the template function i ; (4) The answer k i Input answer mapper v, answer mapper v converts answer k i Mapped to the corresponding output label word v(k i ), the classification results of each template function are combined to output the label word v(k i ) to obtain the final financial field classification result.
2. The method for grading financial statement fields based on prompt learning according to claim 1, characterized in that: In step (1), the word segmentation processing refers to using the Jieba word segmentation method to segment the original data of the financial report field text, and the word segmentation is performed at different granularities, including word level and character level, to convert the text data into the corresponding words or character sequences after word segmentation; the removal of stop words refers to removing stop words from the words or character sequences obtained after the word segmentation processing based on a custom stop word list, that is, deleting words that appear frequently in the text and have no practical meaning.
3. The method for grading financial statement fields based on prompt learning according to claim 1, characterized in that: In step (2), the p i The formula for (x) is: p i (x)=f prompt,i (x,[mask]) Among them, f prompt,i For different template functions, x is passed through f prompt,i After the conversion of (x,[mask]), the financial text classification problem is converted into a cloze problem, that is, the pre-trained language model M is represented by p in the form of a cloze problem. i (x) is the input, and mask is the mask position.
4. The method for grading financial statement fields based on prompt learning according to claim 1, characterized in that: The step (3) specifically refers to: calculating the answer k by using the pre-trained language model M i Fill in the probability of the template function mask position and search based on the probability. The formula is as follows: Among them, f fill (p i (x),k i ) is the pre-trained language model M that converts different answers k i Fill in p i (x); θ represents the parameter set of the pre-trained language model M; K is the label set of the text classification task, that is, the answer space, that is, the answer set to be predicted by the pre-trained language model M; search is an argmax search or a sampling function. The argmax search directly finds the output with the highest score for each prompt language according to the output distribution. The sampling function randomly generates output according to the probability distribution of the output of the pre-trained language model M.
5. The method for grading financial statement fields based on prompt learning according to claim 1, characterized in that: In step (4), the mapping formula of the answer mapper v is as follows: V=[v1,v2,v3,..,v i ]=[v(k1),v(k2),v(k3),..,v(k i )] v i =v(k i ) Finally, a voting mechanism is adopted to integrate the grading results of each template function, and the number of occurrences of each grading result is counted. The grading result with a higher number of occurrences is the predicted final financial field grading result.
6. A system for implementing the method for grading financial statement fields based on prompt learning according to any one of claims 1 to 5, characterized in that: include: The field classification data preprocessing module is used to preprocess the original data of the financial report field text to obtain the securities data report field classification and grading standard data set, wherein the preprocessing operation includes word segmentation and stop word removal; The prompt engineering module is used to design different prompt languages and answer spaces for preprocessed data samples; The field classification module is used to classify multiple input p i (x) are respectively input into the pre-trained language model M to predict the answer to fill in each prompt language mask position, and then the predicted answer is mapped to the corresponding output label word in the pre-constructed financial field classification output set through the answer mapper. The classification result of each template function is the output label word v(k i ) to obtain the final financial field classification result.