Method and device for multi-label classification of financial texts

By employing a method of iterative training and adaptive adjustment of the loss function, the accuracy of the multi-label classification model for financial text is improved, solving the problem of inaccurate classification results in existing technologies. This model is suitable for multi-label classification in complex financial scenarios.

CN116484000BActive Publication Date: 2026-05-08BEIJING CHIBO INFORMATION ENG CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING CHIBO INFORMATION ENG CO LTD
Filing Date
2023-04-24
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Existing multi-label classification models for financial texts are inaccurate when dealing with complex scenarios, making it difficult to meet practical needs. In particular, they are inefficient in the hierarchical classification of commercial banks with multiple categories and implicit semantics that require inference.

Method used

A multi-label classification method for financial texts is adopted. The model is trained iteratively with a sample set containing fewer than the preset number of labeled samples. The model is then dynamically trained by adjusting the sample set data in conjunction with adaptively adjusting the Lawl and Lcal loss functions. This allows for automatic labeling of more sample data and unsupervised initial clustering and labeling.

Benefits of technology

It improves the accuracy of multi-label classification of financial texts, enhances the model's performance and feasibility for practical deployment, and adapts to the multi-label classification needs of complex financial scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116484000B_ABST
    Figure CN116484000B_ABST
Patent Text Reader

Abstract

The application discloses a financial text multi-label classification method and device, and the method comprises the following steps: obtaining a plurality of sentences of a financial text to be classified by multi-labels; inputting the plurality of sentences into a pre-established financial text multi-label classification model to obtain a plurality of categories corresponding to each sentence; the model is: taking a few sample category-labeled samples as an initial sample set, cyclically training a classification model until a model is obtained by labeling all unlabeled sentences with labels, adding the category-labeled samples obtained in each cycle to the sample set in the next cycle to train the model, comparing the unsupervised initial clustering result of the unlabeled sentences with the existing category-labeled samples according to the classification result of the model, and labeling the unlabeled sentences with labels; and during the training, the sample set is iteratively trained by dynamically adjusting the Lawl function and the Lcal function. The application improves the accuracy of financial text multi-label classification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method and apparatus for multi-label classification of financial text. Background Technology

[0002] This section is intended to provide background or context for the embodiments of the invention set forth in the claims. The description herein is not an admission that it is prior art simply because it is included in this section.

[0003] The goal of multi-label classification tasks is to categorize input data into multiple classes. For example, "increased non-performing loan ratio" affects both a bank's "asset quality" and its "management quality." Another example is "inflated deposits and loans; handling bill transactions without genuine trade background," which involves multiple aspects such as "profitability," "asset quality," and "management quality."

[0004] Existing classification models for financial text are mostly single-label models. Multi-label classification models can only handle simple tasks, i.e., with few label categories, requiring explicit semantics and labels appearing within sentences. This leads to inefficiency when deployed to specific scenarios (with many categories and implicit semantics requiring inference; for example, existing classification models do not perform well in classifying commercial banks, and some models do not meet actual classification needs because of the limited number of categories and difficulty in expansion). The difference between multi-label classification and multi-class classification is that the former allows categories to coexist, while the latter requires choosing one of several categories. Therefore, the classification results of existing multi-label classification schemes for financial text are inaccurate. Summary of the Invention

[0005] This invention provides a multi-label classification method for financial texts to improve the accuracy of multi-label classification. The method includes:

[0006] Obtain multiple sentences corresponding to the financial text to be classified by multiple tags;

[0007] Multiple statements are input into a pre-established multi-label financial text classification model to identify multiple categories corresponding to each statement. The multi-label financial text classification model is as follows: using a sample set with fewer than a preset number of labeled samples as the initial sample set, the operation of training the multi-label financial text classification model is performed iteratively until all unlabeled statements are labeled with category tags. The labeled samples obtained in each cycle are added to the sample set of the next cycle to train the multi-label financial text classification model. Specifically, the classification results of the multi-label financial text classification model are compared with the results of unsupervised initial clustering of unlabeled statements centered on the sample set with fewer than a preset number of labeled samples, and labels are assigned to the unlabeled statements. During the training process, the loss functions Lawl and Lcal are adaptively adjusted to dynamically adjust the sample set data for iterative training of the multi-label financial text classification model.

[0008] This invention also provides a financial text multi-label classification device to improve the accuracy of financial text multi-label classification. The device includes:

[0009] The acquisition unit is used to acquire multiple sentences corresponding to the financial text to be classified by multiple labels;

[0010] A multi-label classification unit is used to input multiple statements into a pre-established financial text multi-label classification model to identify multiple categories corresponding to each statement. The financial text multi-label classification model is as follows: using a sample set with fewer than a preset number of labeled samples as the initial sample set, the operation of training the financial text multi-label classification model is performed iteratively until all unlabeled statements are labeled with category tags. The labeled samples obtained in each cycle are added to the sample set of the next cycle to train the financial text multi-label classification model. Specifically, the classification results of the financial text multi-label classification model are compared with the results of unsupervised initial clustering of unlabeled statements centered on the sample set with fewer than a preset number of labeled samples, and labels are assigned to the unlabeled statements. During the training process, the Lawl and Lcal loss functions are adaptively adjusted to dynamically adjust the sample set data for iterative training of the financial text multi-label classification model.

[0011] This invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the above-described financial text multi-label classification method.

[0012] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described financial text multi-label classification method.

[0013] This invention also provides a computer program product, which includes a computer program that, when executed by a processor, implements the above-described financial text multi-label classification method.

[0014] In this embodiment of the invention, the financial text multi-label classification scheme operates as follows: Multiple sentences corresponding to the financial text to be classified are acquired; these sentences are input into a pre-established financial text multi-label classification model to identify multiple categories corresponding to each sentence; the financial text multi-label classification model is as follows: using a sample set with fewer than a preset number of labeled samples as the initial sample set, the operation of training the financial text multi-label classification model is repeatedly executed until all unlabeled sentences are labeled with category tags, resulting in a financial text multi-label classification model. The labeled samples obtained in each cycle are added to the sample set of the next cycle to train the financial text multi-label classification model. Specifically, the classification results of the financial text multi-label classification model are compared with the results of unsupervised initial clustering of unlabeled sentences centered on fewer than a preset number of labeled samples, and labels are assigned to the unlabeled sentences; during training, the Lawl and Lcal loss functions are adaptively adjusted to dynamically adjust the sample set data for iterative training of the financial text multi-label classification model.

[0015] Compared with existing technologies where multi-label classification results are inaccurate, the beneficial technical effects of the financial text multi-label classification scheme provided in this invention are:

[0016] First, in this embodiment of the invention, the financial text multi-label classification model is as follows: Using a sample set with fewer than a preset number of labeled samples as the initial sample set, the operation of training the financial text multi-label classification model is performed iteratively until all unlabeled statements are labeled with category tags. The resulting financial text multi-label classification model is then obtained. The labeled samples obtained in each cycle are added to the sample set of the next cycle to train the financial text multi-label classification model. Specifically, the classification results of the financial text multi-label classification model are compared with the results of unsupervised initial clustering of unlabeled statements centered on a sample set with fewer than a preset number of labeled samples. Labels are then assigned to the unlabeled statements. In other words, this embodiment of the invention starts with a small number of samples and automatically labels more sample data to be added to the training, thus improving the performance of the financial text multi-label classification model.

[0017] Secondly, in this embodiment of the invention, during the training process, the sample set data is dynamically adjusted by adaptively adjusting the two loss functions, Lawl and Lcal, to iteratively train the financial text multi-label classification model. That is, this embodiment of the invention integrates two loss functions for iterative training of the model, and the final financial text multi-label classification model has a high classification accuracy.

[0018] In summary, the multi-label classification scheme for financial texts provided in this embodiment of the invention can improve the accuracy of multi-label classification of financial texts. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings:

[0020] Figure 1 This is a flowchart illustrating the multi-label classification method for financial text in an embodiment of the present invention.

[0021] Figure 2 This is a schematic diagram illustrating the principle of unsupervised labeled financial text sample data in an embodiment of the present invention;

[0022] Figure 3 This is a schematic diagram of the process of pre-training and generating a multi-label classification model for financial text in an embodiment of the present invention;

[0023] Figure 4 This is a schematic diagram of the process of pre-iterally training and generating a multi-label classification model for financial text based on adaptively adjusting the two loss functions Lawl and Lcal in an embodiment of the present invention;

[0024] Figure 5 This is a schematic diagram of the structure of the financial text multi-label classification device in an embodiment of the present invention. Detailed Implementation

[0025] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.

[0026] The acquisition, storage, use, and processing of data in this application all comply with the relevant provisions of national laws and regulations.

[0027] Figure 1 This is a flowchart illustrating the multi-label classification method for financial text in an embodiment of the present invention, such as... Figure 1 As shown, the method includes the following steps:

[0028] Step 101: Obtain multiple sentences corresponding to the financial text to be classified by multiple tags;

[0029] Step 102: Input multiple statements into a pre-established financial text multi-label classification model to identify multiple categories corresponding to each statement; the financial text multi-label classification model is as follows: using fewer than a preset number of labeled samples as the initial sample set, the operation of training the financial text multi-label classification model is performed cyclically until all unlabeled statements are labeled with category tags, resulting in a financial text multi-label classification model. The labeled samples obtained in each cycle are added to the sample set of the next cycle to train the financial text multi-label classification model. Specifically, the classification results of the financial text multi-label classification model are compared with the results of unsupervised initial clustering of unlabeled statements centered on fewer than a preset number of labeled samples, and labels are assigned to unlabeled statements; during the training process, the sample set data is dynamically adjusted to iteratively train the financial text multi-label classification model by adaptively adjusting the two loss functions: Lawl (Attention Wrong Loss, AWL: giving higher weights to misclassified samples, i.e., weights greater than the preset value) and Lcal (Class-balanced Attention Loss, CAL: assigning different weights to different labels).

[0030] In this embodiment of the invention, the financial text multi-label classification method operates as follows: Multiple statements corresponding to the financial text to be classified are obtained; these statements are input into a pre-established financial text multi-label classification model to identify multiple categories corresponding to each statement (though a single category is also possible), thus obtaining the event type of the financial text; the financial text multi-label classification model is established by: using a sample set with fewer than a preset number of labeled samples (few samples) as the initial sample set, repeatedly executing the operation of training the financial text multi-label classification model until all unlabeled statements are labeled with category tags, resulting in the financial text multi-label classification model. The labeled samples obtained in each cycle are added... The financial text multi-label classification model is trained on the sample set entering the next cycle. The model's classification results (model classification labels) are compared with the results of unsupervised initial clustering of unlabeled statements centered on a subset of labeled samples (less than a preset number of samples). Labels are then assigned to the unlabeled statements. During training, the Lawl and Lcal loss functions are adaptively adjusted to dynamically adjust the sample set data for iterative training of the financial text multi-label classification model. One approach to multi-label classification is to select the top N most relevant categories (highest relevance) for a given statement as the classification result. Typically, a threshold is set, and categories with probabilities below a certain preset value are discarded. The specific relevance value is determined by the probability magnitude, which considers not only the number of relevant statements but also the strength of their relevance. In other words, both the quantity and quality of text are considered.

[0031] Compared with existing technologies where multi-label classification results are inaccurate, the beneficial technical effects of the multi-label classification method for financial text provided in this invention are:

[0032] First, in this embodiment of the invention, the financial text multi-label classification model is as follows: Using a sample set with fewer than a preset number of labeled samples as the initial sample set, the operation of training the financial text multi-label classification model is performed iteratively until all unlabeled statements are labeled with category tags. The resulting financial text multi-label classification model is then obtained. The labeled samples obtained in each cycle are added to the sample set of the next cycle to train the financial text multi-label classification model. Specifically, the classification results of the financial text multi-label classification model are compared with the results of unsupervised initial clustering of unlabeled statements centered on a sample set with fewer than a preset number of labeled samples. Labels are then assigned to the unlabeled statements. In other words, this embodiment of the invention starts with a small number of samples and automatically labels more sample data to be added to the training, thus improving the performance of the financial text multi-label classification model.

[0033] Secondly, in this embodiment of the invention, during the training process, the sample set data is dynamically adjusted by adaptively adjusting the two loss functions, Lawl and Lcal, to iteratively train the financial text multi-label classification model. That is, this embodiment of the invention integrates two loss functions for iterative training of the model, and the final financial text multi-label classification model has a high classification accuracy.

[0034] In summary, the multi-label classification scheme for financial texts provided in this invention can improve the accuracy of multi-label classification of financial texts. The following is a combination of... Figures 2 to 4 This paper provides a detailed introduction to the multi-label classification method for financial texts.

[0035] In this embodiment of the invention, firstly, because the specific scenarios of multi-label classification (such as "increased non-performing loan ratio," which affects both the bank's "asset quality" and "management quality," or "inflated deposits and loans; handling bill business without genuine trade background," which involves multiple aspects such as "profitability," "asset quality," and "management quality") are often not singular or simple, a deep understanding of multiple labels is required. We input policy documents (financial documents, such as the "Banking Supervision and Management Law" and the "Quantitative and Qualitative Evaluation Standards for Commercial Bank Regulatory Ratings") into the BERT model, allowing the model to first learn the definition of event types (event types are different classifications; for example, "asset quality" and "management quality" mentioned above belong to different event types, i.e., different classifications). Secondly, knowledge is embedded. Multiple people select a sample library for manual multi-label annotation. At the same time, an unsupervised clustering model performs initial clustering on the sample library. The model results are compared, and the incorrect classification results are adaptively and dynamically adjusted, allowing the model to relearn, finally completing the multi-label classification task of the dataset. A detailed introduction follows.

[0036] In practice, the embodiments of the present invention can use two BERT-based models: one is the S-BERT model (an unsupervised clustering model) for similarity calculation, and the other is the FinBERT model (a multi-label classification model for financial text) for financial text classification.

[0037] The embodiment of this invention is to cluster unlabeled statements. The goal is to calculate the semantic similarity, or distance, between the statement and a specified label (a sample label with a category label at the center of each class), thereby labeling the unlabeled statements. The clustering method used at this time can be the S-BERT model with multi-dimensional similarity calculation function.

[0038] Starting with a small sample size, more labeled data is automatically added to the training to improve model performance. The pre-trained multi-label classification model for financial text includes the following steps 1)-4):

[0039] 1) Cluster the unlabeled statements using a clustering method with specified centers, such as... Figure 2 As shown, the center can be a tag, such as assets, management, technology, for example. Figure 2 In this context, A represents assets, B represents management, and C represents technology. dist_a This represents the current period distance threshold corresponding to category A. dist_b This represents the current period distance threshold corresponding to category B. dist_c The current period distance threshold corresponding to category C is represented by... Figure 2 As can be seen, some tags can belong to multiple categories;

[0040] 2) Train a multi-label classifier (financial text multi-label classification model, i.e., FinBERT model) using labeled samples.

[0041] 3) Set multiple distance thresholds dist For each label, the distance is less than the threshold. n Given 1 input, use a classifier to infer classification; if... n If all results are consistent with the multiple labels of unsupervised clustering, then the input is labeled as the label to which the center word belongs, and used as new labeled data (this new labeled data is added to the sample set of the next cycle).

[0042] 4) Repeat step 2) to train the classifier with more sample data, increasing the... dist Add more data until no new labeled data is found, at which point the process ends.

[0043] As can be seen from the above, Figure 3 As shown, in one embodiment, the above-mentioned multi-label classification of financial text may further include pre-training and generating the multi-label classification model of financial text according to the following method:

[0044] Step 201: Obtain multiple unlabeled statements and multiple categorized samples corresponding to historical financial texts; the number of categorized samples is less than a preset sample number value;

[0045] Step 202: Using an unsupervised clustering model, cluster multiple unlabeled statements to obtain the unsupervised clustering label corresponding to each unlabeled statement; the center of each cluster is a sample with a category label.

[0046] Step 203: Using the multiple labeled samples as the initial sample set, repeatedly execute the operation of training the financial text multi-label classification model until all unlabeled sentences are labeled with category labels, thus obtaining the final trained financial text multi-label classification model. The following operation is performed in each loop cycle:

[0047] Step 2031: Train a multi-label classification model for financial text corresponding to the current cycle using multiple labeled sample sets of the current cycle; the multiple labeled sample sets of the current cycle consist of the initial sample set and the labeled sample sets obtained in each cycle.

[0048] Step 2032: Find the target unlabeled statements whose distance to each labeled sample is less than the distance threshold of the current period corresponding to that labeled sample; for each target unlabeled statement corresponding to a labeled sample, perform the following data labeling operation: input the target unlabeled statement into the financial text multi-label classification model corresponding to the current period, and identify the model classification label corresponding to each target unlabeled statement; when the unsupervised clustering label corresponding to each target unlabeled statement is consistent with the corresponding model classification label, assign each target unlabeled statement to the label consistent with the corresponding labeled sample, and obtain the labeled samples of the current cycle; each distance threshold represents the semantic similarity between the unlabeled statement and the corresponding labeled sample;

[0049] Step 204: When an unlabeled statement corresponding to financial text is detected, add the labeled samples obtained in the current cycle to the labeled sample set in the next cycle, increase the distance threshold for each step, and repeat the operation of training the multi-label classification model for financial text until no unlabeled statement corresponding to financial text is detected, thus obtaining the final multi-label classification model for financial text.

[0050] This invention's embodiments can adaptively adjust the loss function to improve the model's classification accuracy, much like allowing students to focus on reviewing their mistakes. Technically, its key feature is its iterative function, specifically achieved through iterative training using the Lawl and Lcal functions. Compared to using a single loss function, this invention integrates two loss functions, a mechanism absent in existing solutions. Specifically, in one embodiment, iteratively training the financial text multi-label classification model corresponding to the current cycle using multiple labeled sample sets from the current cycle can include: dynamically adjusting the sample set data through adaptive adjustment of the Lawl and Lcal loss functions to iteratively train the financial text multi-label classification model corresponding to the current cycle, further improving the accuracy of financial text multi-label classification.

[0051] The core concept of adaptive learning is to adjust the method of calculating the loss function.

[0052] For a dataset containing N samples in ( i (representing the number of categories), corresponding to the output of the classifier. Calculate using the sigmoid function .

[0053] Attention Wrong Loss (AWL) works by giving higher weights to misclassified samples. In one implementation, the Lawl loss function is a function that gives higher weights to misclassified samples to improve the model's classification accuracy.

[0054] ;

[0055] In the formula, for those containing N A dataset of samples {( x 1 , y 1 ), , ( x N , y N )},in y k =[ y 1 k , , y i k ]∈{0, 1} i ( i (Indicates the number of categories), corresponding to the output of the classifier (financial text multi-label classification model). z k =[ z 1 k , , z i k ]∈ R Calculate using the sigmoid function p i k = σ ( z i k ),therefore, L awl These are custom parameters, meaning that AttentionWrong Loss (AWL) assigns higher (greater than a preset value) weights to misclassified samples. k For the first k One sample, i The number of categories for a given sample. p The probability of the number of categories is obtained after calculating it using the sigmoid function. x Represents the input text. y This represents the set of categories corresponding to the input text.

[0056] Class-balanced Attention Loss (CAL) assigns different weights to different labels and removes labels with weights below a set threshold to alleviate class imbalance. For an overall frequency of [value missing], [the following is a separate, unrelated point:] The labels. In one embodiment, the Lcal loss function is a function that assigns different weights to different labels to alleviate class imbalance and further improve the model's classification accuracy.

[0057] ;

[0058] In the formula, for those containing N A dataset of samples {( x 1 , y 1 ), , ( x N , y N )},in y k =[ y 1 k , , y i k ]∈{0, 1} i ( i (Indicates the number of categories), corresponding to the output of the classifier (financial text multi-label classification model). z k =[ z 1 k , , z i k ]∈ R Calculate using the sigmoid function p i k = σ ( z i k ), L cal These are also custom parameters, meaning that Class-balancedAttention Loss (CAL) assigns different weights to different labels, removes labels with weights below a set threshold, and alleviates the class imbalance problem. For an overall frequency of... n i The labels are α ≥ 0 and β ∈ [0, 1), both of which are user-defined parameters. It is worth noting that here... i belongn subscript, n i Indicates the first i The probability of each category appearing.

[0059] As can be seen from the above, in one embodiment, such as Figure 4 As shown, dynamically adjusting the sample set data to iteratively train the multi-label classification model of financial text corresponding to the current period by adaptively adjusting the two loss functions, Lawl and Lcal, can include:

[0060] The following steps are performed in each iteration until the preset iteration termination condition is met to obtain the financial text multi-label classification model:

[0061] Step 301: By adjusting the Lawl loss function, give higher weights to the misclassified sample set data to obtain the first weighting result;

[0062] Step 302: Based on the first weighting result, different weights are assigned to different labels of the sample set data by adjusting the Lcal loss function to obtain the second weighting result;

[0063] Step 303: Use the sample set data corresponding to the second weight processing result to train the model until the preset iteration termination condition is met to obtain the financial text multi-label classification model.

[0064] In step 101 above, obtaining multiple sentences corresponding to the financial text to be classified by multiple labels may include: obtaining the financial text to be classified by multiple labels; and segmenting the financial text into multiple sentences. Furthermore, the process of obtaining multiple sentences corresponding to historical financial text during the pre-training of the model can refer to this acquisition scheme. After the financial text multi-label classification model is pre-established, steps 101-103 above can be implemented, that is, the actual multi-label classification operation of the financial text to be classified by multiple labels can be performed. Using this pre-established financial text multi-label classification model for financial text multi-label classification achieves high accuracy.

[0065] Furthermore, the embodiments of this invention emphasize iterative deployment during actual operation. For example, the financial text "Banking Supervision and Administration Law" specifies regulatory subjects for commercial banks, which can be regarded as labels. These labels are fixed. Since the actual number of samples labeled is small in actual operation, the embodiments of this invention can increase the number of label samples and the accuracy of classification, thereby improving the feasibility of real deployment.

[0066] This invention discloses a method and apparatus for multi-label classification of financial texts. The method mainly includes data collection and selection, training data annotation, model training, and event classification. Specifically, it involves acquiring policy documents and financial news data through an algorithm and storing them in a database, performing data deduplication and preprocessing, and then manually annotating and screening the data with multiple labels. The method learns event type definitions from policy documents (financial documents), selects a sample library for manual multi-label annotation, performs initial multi-label classification on the sample library, and selects data based on an unsupervised clustering model. n The model performs multi-label classification on the dataset, comparing the clustering results with the model's classification results. It adaptively adjusts misclassified results and under-classified categories, allowing the multi-label classification model for financial text to relearn. Finally, it performs multi-label classification on the dataset. This technical solution addresses the problem of multiple labels for the same news event in financial news, improving the accuracy and coverage of event classification. The embodiments of this invention closely resemble real-world scenarios and have strong application and promotion value.

[0067] In summary, the financial text multi-label classification scheme provided by this invention achieves: integration of supervised and unsupervised learning methods; adaptive adjustment of the loss function; strong operability and iterative deployment.

[0068] This invention also provides a financial text multi-label classification device, as described in the following embodiments. Since the principle behind this device's problem-solving is similar to that of the financial text multi-label classification method, its implementation can be found in the implementation of the financial text multi-label classification method; repeated details will not be elaborated further.

[0069] Figure 5 This is a schematic diagram of the structure of the financial text multi-label classification device in an embodiment of the present invention, as shown below. Figure 5 As shown, the device includes:

[0070] Acquisition unit 01 is used to acquire multiple sentences corresponding to the financial text to be classified by multiple labels;

[0071] The multi-label classification unit 02 is used to input multiple statements into a pre-established financial text multi-label classification model to identify multiple categories corresponding to each statement. The financial text multi-label classification model is as follows: using a sample set with fewer than a preset number of labeled samples as the initial sample set, the operation of training the financial text multi-label classification model is performed iteratively until all unlabeled statements are labeled with category tags. The financial text multi-label classification model is obtained by adding the labeled samples obtained in each cycle to the sample set of the next cycle to train the financial text multi-label classification model. Specifically, the classification results of the financial text multi-label classification model are compared with the results of the unsupervised initial clustering of unlabeled statements centered on the sample set with fewer than a preset number of labeled samples, and labels are assigned to the unlabeled statements. During the training process, the loss functions Lawl and Lcal are adaptively adjusted to dynamically adjust the sample set data to iteratively train the financial text multi-label classification model.

[0072] In one embodiment, the above-described financial text multi-label classification device may further include a training unit for pre-training and generating the financial text multi-label classification model according to the following method:

[0073] Obtain multiple unlabeled statements and multiple categorized samples corresponding to historical financial texts; the number of categorized samples is less than a preset sample number value.

[0074] Using a clustering method with specified centers, multiple unlabeled statements are clustered to obtain unsupervised cluster labels for each unlabeled statement; the center of each cluster is a sample with a category label.

[0075] Using the multiple labeled samples as the initial sample set, the operation of training a multi-label financial text classification model is performed iteratively until all unlabeled sentences are labeled, resulting in the final trained multi-label financial text classification model. Each cycle includes the following steps:

[0076] The financial text multi-label classification model corresponding to the current cycle is trained using multiple labeled sample sets of the current cycle; the multiple labeled sample sets of the current cycle consist of the initial sample set and the labeled sample sets obtained in each cycle.

[0077] For each labeled sample, the following data labeling steps are performed for unlabeled statements whose distance to the labeled sample is less than the distance threshold of the current period corresponding to the labeled sample: The financial text multi-label classification model is used to determine the model-identified category label for the unlabeled statement whose distance is less than the distance threshold of the current period corresponding to the labeled sample; when the unsupervised clustering label for each unlabeled statement matches the model-identified category label for that unlabeled statement, the unlabeled statement is assigned the same label as the labeled sample, thus obtaining the labeled samples for the current cycle; each distance threshold represents the semantic similarity between the unlabeled statement and the labeled sample.

[0078] When an unlabeled statement corresponding to financial text is detected, the labeled samples obtained in the current cycle are added to the labeled sample set in the next cycle. The distance threshold is increased, and the operation of training a multi-label classification model for financial text is repeated until no unlabeled statement corresponding to financial text is detected, thus obtaining the sample training data for the multi-label classification model for financial text.

[0079] In one embodiment, the training unit is specifically used to dynamically adjust the sample set data to iteratively train the financial text multi-label classification model corresponding to the current period by adaptively adjusting the two loss functions, Lawl and Lcal.

[0080] In one embodiment, the multi-label classification model for financial text corresponding to the current period is dynamically adjusted by adaptively adjusting the two loss functions, Lawl and Lcal, including:

[0081] The following steps are performed in each iteration until the preset iteration termination condition is met to obtain the financial text multi-label classification model:

[0082] By adjusting the Lawl loss function to give higher weights to the misclassified sample data, the first weighting result is obtained;

[0083] Based on the first weighting result, the Lcal loss function is adjusted to assign different weights to different labels of the sample data to obtain the second weighting result;

[0084] The sample set data corresponding to the second weighting result is used to train the model until the preset iteration termination condition is met, thus obtaining the financial text multi-label classification model.

[0085] In one embodiment, the Lawl loss function can be:

[0086] ;

[0087] In the formula, for those containing N A dataset of samples {( x 1 , y 1 ), , ( x N , y N )},in y k =[ y 1 k , , y i k ]∈{0, 1} i The output of the multi-label classification model for financial text is z k =[ z 1 k , , z i k ]∈ R Calculate using the sigmoid function p i k = σ ( z i k ), L awl These are custom parameters, meaning that Attention Wrong Loss assigns greater than a preset weight to misclassified samples. k For the first k One sample, i The number of categories in the sample. p The probability of the number of categories is obtained after calculating it using the sigmoid function. x This represents the input financial text. y This represents the set of categories corresponding to the input financial text.

[0088] In one embodiment, the Lcal loss function can be:

[0089] ;

[0090] In the formula, for those containing N A dataset of samples {( x 1 , y 1 ), , ( xN , y N )},in y k =[ y 1 k , , y i k ]∈{0, 1} i The output of the multi-label classification model for financial text is z k =[ z 1 k , , z i k ]∈ R Calculate using the sigmoid function p i k = σ ( z i k ), L cal These are custom parameters, meaning that Class-balanced Attention Loss assigns different weights to different labels, removes labels with weights below a set threshold, and alleviates the class imbalance problem. For an overall frequency of... n i The labels are defined as follows: α ≥ 0, β ∈ [0, 1), where α and β are user-defined parameters. i belong n subscript, n i Indicates the first i The probability of each category appearing. k For the first k One sample, i The number of categories in the sample. p The probability of the number of categories is obtained after calculating it using the sigmoid function. x This represents the input financial text. y This represents the set of categories corresponding to the input financial text.

[0091] This invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the above-described financial text multi-label classification method.

[0092] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described financial text multi-label classification method.

[0093] This invention also provides a computer program product, which includes a computer program that, when executed by a processor, implements the above-described financial text multi-label classification method.

[0094] In this embodiment of the invention, the financial text multi-label classification scheme operates as follows: Multiple sentences corresponding to the financial text to be classified are acquired; these sentences are input into a pre-established financial text multi-label classification model to identify multiple categories corresponding to each sentence; the financial text multi-label classification model is as follows: using a sample set with fewer than a preset number of labeled samples as the initial sample set, the operation of training the financial text multi-label classification model is repeatedly executed until all unlabeled sentences are labeled with category tags, resulting in a financial text multi-label classification model. The labeled samples obtained in each cycle are added to the sample set of the next cycle to train the financial text multi-label classification model. Specifically, the classification results of the financial text multi-label classification model are compared with the results of unsupervised initial clustering of unlabeled sentences centered on fewer than a preset number of labeled samples, and labels are assigned to the unlabeled sentences; during training, the Lawl and Lcal loss functions are adaptively adjusted to dynamically adjust the sample set data for iterative training of the financial text multi-label classification model.

[0095] Compared with existing technologies where multi-label classification results are inaccurate, the beneficial technical effects of the financial text multi-label classification scheme provided in this invention are:

[0096] First, in this embodiment of the invention, the financial text multi-label classification model is as follows: Using a sample set with fewer than a preset number of labeled samples as the initial sample set, the operation of training the financial text multi-label classification model is performed iteratively until all unlabeled statements are labeled with category tags. The resulting financial text multi-label classification model is then obtained. The labeled samples obtained in each cycle are added to the sample set of the next cycle to train the financial text multi-label classification model. Specifically, the classification results of the financial text multi-label classification model are compared with the results of unsupervised initial clustering of unlabeled statements centered on a sample set with fewer than a preset number of labeled samples. Labels are then assigned to the unlabeled statements. In other words, this embodiment of the invention starts with a small number of samples and automatically labels more sample data to be added to the training, thus improving the performance of the financial text multi-label classification model.

[0097] Secondly, in this embodiment of the invention, during the training process, the sample set data is dynamically adjusted by adaptively adjusting the two loss functions, Lawl and Lcal, to iteratively train the financial text multi-label classification model. That is, this embodiment of the invention integrates two loss functions for iterative training of the model, and the final financial text multi-label classification model has a high classification accuracy.

[0098] In summary, the multi-label classification scheme for financial texts provided in this embodiment of the invention can improve the accuracy of multi-label classification of financial texts.

[0099] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0100] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0101] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0102] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1The steps of the function specified in one or more boxes.

[0103] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A multi-label classification method for financial texts, characterized in that, include: Obtain multiple sentences corresponding to the financial text to be classified by multiple tags; Multiple statements are input into a pre-established multi-label financial text classification model to identify multiple categories corresponding to each statement. The multi-label financial text classification model is as follows: using a sample set with fewer than a preset number of labeled samples as the initial sample set, the operation of training the multi-label financial text classification model is performed iteratively until all unlabeled statements are labeled with category tags. The labeled samples obtained in each cycle are added to the sample set of the next cycle to train the multi-label financial text classification model. Specifically, the classification results of the multi-label financial text classification model are compared with the results of unsupervised initial clustering of unlabeled statements centered on the sample set with fewer than a preset number of labeled samples, and labels are assigned to the unlabeled statements. During the training process, the sample set data is dynamically adjusted to iteratively train the multi-label financial text classification model by adaptively adjusting the two loss functions, Lawl and Lcal. Lawl means Attention Wrong Loss, which gives weights greater than a preset value to misclassified samples, and Lcal means Class-balanced Attention Loss, which assigns different weights to different labels and removes labels below a set threshold.

2. The method as described in claim 1, characterized in that, It also includes pre-training the multi-label classification model for the financial text using the following method: Obtain multiple unlabeled statements and multiple categorized samples corresponding to historical financial texts; the number of categorized samples is less than a preset sample number value. Using an unsupervised clustering model, multiple unlabeled statements are clustered to obtain the unsupervised clustering label for each unlabeled statement; the center of each cluster is a sample with a category label. Using the multiple labeled samples as the initial sample set, the operation of training the multi-label financial text classification model is performed iteratively until all unlabeled statements are labeled with category labels, resulting in the final trained multi-label financial text classification model. The following operations are performed in each loop cycle: The financial text multi-label classification model corresponding to the current cycle is trained using multiple labeled sample sets of the current cycle; the multiple labeled sample sets of the current cycle consist of the initial sample set and the labeled sample sets obtained in each cycle. Find the target unlabeled statement whose distance to each labeled sample is less than the current period distance threshold corresponding to the labeled sample; for each target unlabeled statement corresponding to a labeled sample, perform the following data labeling operation: input the target unlabeled statement into the financial text multi-label classification model corresponding to the current period, and identify the model classification label corresponding to each target unlabeled statement; When the unsupervised clustering label corresponding to each target unlabeled statement is consistent with the corresponding model classification label, assign each target unlabeled statement a label consistent with the corresponding labeled sample to obtain the labeled sample of the current cycle. Each distance threshold represents the semantic similarity between an unlabeled statement and its corresponding labeled sample; When an unlabeled statement corresponding to financial text is detected, the labeled samples obtained in the current cycle are added to the labeled sample set in the next cycle. The distance threshold is increased, and the operation of training the multi-label classification model of financial text is repeated until no unlabeled statement corresponding to financial text is detected, thus obtaining the final multi-label classification model of financial text.

3. The method as described in claim 2, characterized in that, The process involves iteratively training a multi-label classification model for financial text corresponding to the current cycle using multiple labeled sample sets within the current cycle. This includes dynamically adjusting the sample set data by adaptively adjusting the Lawl and Lcal loss functions to iteratively train the multi-label classification model for financial text corresponding to the current cycle.

4. The method as described in claim 3, characterized in that, The multi-label classification model for financial text corresponding to the current period is dynamically adjusted by adaptively adjusting the Lawl and Lcal loss functions, including: The following steps are performed in each iteration until the preset iteration termination condition is met to obtain the financial text multi-label classification model: By adjusting the Lawl loss function to give higher weights to the misclassified sample data, the first weighting result is obtained; Based on the first weighting result, the Lcal loss function is adjusted to assign different weights to different labels of the sample data to obtain the second weighting result; The sample set data corresponding to the second weighting result is used to train the model until the preset iteration termination condition is met, thus obtaining the financial text multi-label classification model.

5. The method according to any one of claims 1 to 4, characterized in that, The Lawl loss function is: ; In the formula, for those containing N A dataset of samples {( x 1 , y 1 ), ,( x N , y N )},in y k =[ y 1 k , , y i k ]∈{0, 1} i The output of the multi-label classification model for financial text is z k =[ z 1 k , , z i k ]∈ R Calculate using the sigmoid function p i k = σ ( z i k ), k For the first k One sample, i The number of categories in the sample. p The probability of the number of categories is obtained after calculating it using the sigmoid function. x This represents the input financial text. y This represents the set of categories corresponding to the input financial text, where α ≥ 0 and α is a user-defined parameter.

6. The method according to any one of claims 1 to 4, characterized in that, The Lcal loss function is: ; In the formula, for those containing N A dataset of samples {( x 1 , y 1 ), , ( x N , y N )},in y k =[ y 1 k , , y i k ]∈{0, 1} i The output of the multi-label classification model for financial text is z k =[ z 1 k , , z i k ]∈ R Calculate using the sigmoid function p i k = σ ( z i k For the overall frequency of n i The labels are defined as follows: α ≥ 0, β ∈ [0, 1), where α and β are user-defined parameters. i belong n subscript, n i Indicates the first i The probability of each category appearing. k For the first k One sample, i The number of categories in the sample. p The probability of the number of categories is obtained after calculating it using the sigmoid function. x This represents the input financial text. y This represents the set of categories corresponding to the input financial text.

7. A multi-label classification device for financial texts, characterized in that, include: The acquisition unit is used to acquire multiple sentences corresponding to the financial text to be classified by multiple labels; A multi-label classification unit is used to input multiple statements into a pre-established financial text multi-label classification model to identify multiple categories corresponding to each statement. The financial text multi-label classification model is as follows: using a sample set with fewer than a preset number of labeled samples as the initial sample set, the operation of training the financial text multi-label classification model is performed iteratively until all unlabeled statements are labeled with category tags. The labeled samples obtained in each cycle are added to the sample set of the next cycle to train the financial text multi-label classification model. Specifically, the classification results of the financial text multi-label classification model are compared with the results of unsupervised initial clustering of unlabeled statements centered on the sample set with fewer than a preset number of labeled samples, and labels are assigned to the unlabeled statements. During the training process, the sample set data is dynamically adjusted to iteratively train the financial text multi-label classification model by adaptively adjusting the two loss functions, Lawl and Lcal. Lawl means Attention Wrong Loss, which gives weights greater than a preset value to misclassified samples, and Lcal means Class-balanced Attention Loss, which assigns different weights to different labels and removes labels below a set threshold.

8. The apparatus as claimed in claim 7, characterized in that, It also includes a training unit for pre-training the financial text multi-label classification model as follows: Obtain multiple unlabeled statements and multiple categorized samples corresponding to historical financial texts; the number of categorized samples is less than a preset sample number value. Using a clustering method with specified centers, multiple unlabeled statements are clustered to obtain unsupervised cluster labels for each unlabeled statement; the center of each cluster is a sample with a category label. Using the multiple labeled samples as the initial sample set, the operation of training a multi-label financial text classification model is performed iteratively until all unlabeled sentences are labeled, resulting in the final trained multi-label financial text classification model. Each cycle includes the following steps: The financial text multi-label classification model corresponding to the current cycle is trained using multiple labeled sample sets of the current cycle; the multiple labeled sample sets of the current cycle consist of the initial sample set and the labeled sample sets obtained in each cycle. For each sample with a category label, the following data labeling steps are performed: the financial text multi-label classification model is used to determine the model identification category label corresponding to the unlabeled statement whose distance to the sample with the category label is less than the distance threshold of the current period corresponding to the sample with the category label; When the unsupervised clustering label corresponding to each unlabeled statement matches the model-identified category label corresponding to that unlabeled statement, the unlabeled statement is assigned a label that matches the labeled sample, thus obtaining the labeled sample for the current cycle. Each distance threshold represents the semantic similarity between unlabeled statements and category-labeled samples; When an unlabeled statement corresponding to financial text is detected, the labeled samples obtained in the current cycle are added to the labeled sample set in the next cycle. The distance threshold is increased, and the operation of training a multi-label classification model for financial text is repeated until no unlabeled statement corresponding to financial text is detected, thus obtaining the sample training data for the multi-label classification model for financial text.

9. The apparatus as claimed in claim 8, characterized in that, The training unit is specifically used to dynamically adjust the sample set data and iteratively train the financial text multi-label classification model corresponding to the current period by adaptively adjusting the two loss functions, Lawl and Lcal.

10. The apparatus as claimed in claim 9, characterized in that, The multi-label classification model for financial text corresponding to the current period is dynamically adjusted by adaptively adjusting the Lawl and Lcal loss functions, including: The following steps are performed in each iteration until the preset iteration termination condition is met to obtain the financial text multi-label classification model: By adjusting the Lawl loss function to give higher weights to the misclassified sample data, the first weighting result is obtained; Based on the first weighting result, the Lcal loss function is adjusted to assign different weights to different labels of the sample data to obtain the second weighting result; The sample set data corresponding to the second weighting result is used to train the model until the preset iteration termination condition is met, thus obtaining the financial text multi-label classification model.

11. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 6.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method of any one of claims 1 to 6.

13. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the method of any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method and system for text classification system construction and annotation corpus expanding

    CN110457475A

  • Text multi-label classification method and device, equipment and storage medium

    CN113435308A