Power audit text classification method based on large language model

By constructing and optimizing the classification representation of historical power audit text data, evaluating classification misleading degree, correcting the matching degree of real-time power audit text data, solving the problem of uneven distribution of text categories, and improving the accuracy and reliability of power audit text classification sex.

CN119202260BActive Publication Date: 2025-02-18TECH TRAINING CENT OF STATE GRID HUBEI ELECTRIC POWER CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411718297.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-02-18
Estimated Expiration
2044-11-28

AI Technical Summary

Technical Problem

During the power audit process, due to the uneven distribution of text categories, the model has different learning degrees of different types of text features during training, which leads to the model tend to predict the majority class and ignore the minority class, which affects the accuracy and reliability of the audit model. sex.

Method used

By obtaining historical power audit text data, constructing and optimizing classification representations, and evaluating classification misleading, correcting the matching degree of real-time power audit text data, thereby realizing text classification.

Benefits of technology

It improves the accuracy and reliability of text classification, reduces classification deviations due to data differences and noise, and improves the degree of automation and efficiency of audit work.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119202260B_ABST
    Figure CN119202260B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of data processing, and in particular to a method for classifying electric power audit text based on a large language model, the method comprising: obtaining classified historical electric power audit text data; constructing and optimizing classification representations of the historical electric power audit text data, and evaluating the classification misleadingness of these representations between different categories; obtaining real-time electric power audit text data, and correcting the initial matching degree of the real-time electric power audit text data relative to the selected type based on the classification misleadingness to obtain the final matching degree; and realizing text classification of the real-time electric power audit text data based on the final matching degree. The implementation of the method can avoid the problem of prediction result deviation caused by uneven distribution of electric power audit text sample data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to a method for classifying electric power audit text based on a large language model. Background Art

[0002] The classification of power audit texts based on large language models is mainly aimed at the efficient management needs of massive audit texts in the power industry. It achieves accurate classification and rapid retrieval of audit texts by utilizing advanced natural language processing technology, especially large-scale pre-trained language models, thereby improving the intelligence level of power audit work and ensuring the economy, compliance and safety of the power system.

[0003] However, during the audit process, sample collection may be affected by many factors, such as the allocation of audit resources, the judgment of auditors, etc. This will cause certain categories of audit text to be more easily collected, while other categories of audit text are relatively rare. In this way, in the case of an unbalanced distribution of text categories, the model will have different degrees of learning of different types of text features during the training process, causing the model to tend to predict the majority class and ignore the minority class after training. If the problem of unbalanced distribution of text categories is not solved, it will seriously affect the accuracy and reliability of the audit model, thereby reducing the quality of the entire audit process. Summary of the invention

[0004] In order to avoid the problem of prediction result deviation caused by uneven distribution of power audit text sample data, the purpose of the present invention is to provide a power audit text classification method based on a large language model. The technical scheme adopted is as follows:

[0005] The present application discloses a method for classifying electric power audit text based on a large language model, the method comprising:

[0006] S1. Obtain classified historical power audit text data;

[0007] S2. construct and optimize classification representations of the historical power audit text data, and evaluate the classification misleadingness of these representations among different categories;

[0008] S3, obtaining real-time power audit text data, and correcting the initial matching degree of the real-time power audit text data relative to the selected type based on the classification misleading degree to obtain a final matching degree;

[0009] S4. Implement text classification of the real-time power audit text data based on the final matching degree.

[0010] Furthermore, in step S2, constructing and optimizing the classification representation of the historical power audit text data and evaluating the classification misleadingness of these representations between different categories include:

[0011] S21. Create data dictionaries containing target key words for different categories of historical power audit text data;

[0012] S22, obtaining a list of audit opinion paragraphs related to the historical power audit text data, and dividing the audit opinion categories based on the list of audit opinion paragraphs;

[0013] S23, for the data dictionary corresponding to the same audit opinion category, each target key word contained in the data dictionary is converted into a corresponding multi-dimensional vocabulary vector according to the semantic features, position features, and context paragraph features of the vocabulary, and the overlap between the two vectors is matched, and when the overlap is greater than a preset threshold, the vocabulary vectors are merged to obtain a corresponding data vector dictionary;

[0014] S24. For each word vector included in each category data vector dictionary, the classification misleadingness is evaluated based on the maximum vector similarity mean relative to the different category data vector dictionaries.

[0015] Furthermore, in step S21, for the historical power audit text data of the corresponding category, a data dictionary containing target key words is created through the following steps:

[0016] S211, obtaining all text strings covered by the historical power audit text data of the corresponding category, and performing word splitting and non-keyword filtering based on these text strings to obtain corresponding candidate key words;

[0017] S212, calculating the relative importance of each candidate keyword;

[0018] S213: Filter out a preset proportion of target key words from each candidate key word according to relative importance, and create a corresponding data dictionary based on the target key words.

[0019] Furthermore, in step S22, the classification of audit opinions based on the audit opinion paragraph list includes:

[0020] S221, inputting each audit opinion paragraph in the audit opinion paragraph list into the Doc2Vec model for processing to obtain a corresponding audit opinion vector;

[0021] S222. Perform cluster analysis based on the audit opinion vectors obtained, and classify the audit opinions into categories according to the clustering results obtained.

[0022] Furthermore, in step S23, each target key word contained in the data dictionary is converted into a corresponding multi-dimensional vocabulary vector according to the semantic features, position features, and context paragraph features of the vocabulary, and the overlap degree matching between the two vectors is performed, including:

[0023] S231, for each target key word included in the data dictionary, respectively, perform semantic analysis and context paragraph analysis according to position features to obtain a corresponding word vector and multiple paragraph vectors;

[0024] S232, constructing a multi-dimensional vocabulary vector for each target key word based on the corresponding word vector and multiple paragraph vectors;

[0025] S233: When performing overlap matching between two vectors based on the obtained multi-dimensional vocabulary vectors, the overlap between the vocabulary is reflected based on the cosine similarity between the corresponding multi-dimensional vectors.

[0026] Further, in step S24, for the v The first type of data vector dictionary i Word vectors , the maximum vector similarity mean relative to the vector dictionary of different categories of data Calculated by the following formula:

[0027] ;

[0028] in, Indicates the number of categories covered by the current data vector dictionary, Indicates A dictionary of data vectors of types, Indicates the calculation v The first type of data vector dictionary i Word vectors With Dictionary of data vectors of type The similarity of all word vectors in , and find the maximum similarity.

[0029] Further, in step S3, the initial matching degree of the real-time power audit text data relative to the selected type is corrected based on the classification misleading degree to obtain a final matching degree, including:

[0030] S31, constructing a first multidimensional vector set of the real-time power audit text data and a second multidimensional vector set of the historical power audit text data based on the semantic features, position features, and context paragraph features of the segmented vocabulary;

[0031] S32, obtaining various types of data dictionaries corresponding to the historical power audit text data;

[0032] S33, for each split word in the real-time power audit text data, respectively calculate its maximum similarity with respect to each word in the selected type data dictionary based on the first and second multidimensional vector sets, and after performing mean calculation based on the obtained maximum similarities, obtain the initial matching degree of the real-time power audit text data with respect to the selected type;

[0033] S34. Based on the classification misleading degree, the initial matching degree is corrected to obtain the final matching degree of the real-time power audit text data relative to the selected type.

[0034] Further, in step S34, the initial matching degree is corrected based on the classification misleading degree to obtain the final matching degree of the real-time power audit text data relative to the selected type, including:

[0035] S341, obtaining the relative proportion of the power audit report samples corresponding to the selected type in all samples, and combining the relative proportion and the average classification misleading degree of all matching words in the selected type to obtain the correction coefficient of the power audit text of the selected type;

[0036] S342. After correcting the initial matching degree based on the correction coefficient, a final matching degree of the real-time power audit text data relative to the selected type is obtained.

[0037] Further, in step S341, the selected Correction factors for power audit texts of categories , which is calculated by the following formula:

[0038] ;

[0039] in, Indicates the selected Number of power audit text samples by category, represents the total number of samples in all samples, Indicates the selected The number of words that match the category. Indicates the selected Category data dictionary The classification misleading degree of the matching words, norm () represents the normalization function 。

[0040] Furthermore, in step S342, the final matching degree is calculated by the following formula:

[0041] ;

[0042] in, Indicates that the real-time power audit text data is relative to the selected The final matching degree of the category, Indicates that the real-time power audit text data is relative to the selected The initial matching degree of the category, Indicates the selected Correction factor for power audit text of category.

[0043] The present invention has the following beneficial effects:

[0044] 1. Construct and optimize the classification representation of historical power audit text data, which can more accurately capture the characteristics of text data and reduce information loss and misleading in the classification process;

[0045] 2. Evaluating the misclassification degree of classification representation between different categories helps to identify potential classification errors and confusion points, so as to make targeted improvements;

[0046] 3. Correcting the initial matching degree of real-time power audit text data based on classification misleadingness can eliminate or reduce classification bias caused by factors such as data differences and noise, and improve the accuracy of real-time data processing;

[0047] 4. Realizing text classification of real-time power audit text data based on the final matching degree can greatly improve the degree of automation of audit work, reduce manual intervention and errors, and improve audit efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0049] Figure 1 A method flow chart of a method for classifying power audit text based on a large language model provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0050] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the specific implementation method, features and effects of a power audit text classification method based on a large language model proposed by the present invention in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.

[0051] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.

[0052] The specific scheme of the power audit text classification method based on the large language model provided by the present invention is described in detail below with reference to the accompanying drawings.

[0053] See also Figure 1 , which shows a method flow chart of a method for classifying power audit text based on a large language model provided by an embodiment of the present invention, the method comprising:

[0054] Step S1, obtaining classified historical power audit text data.

[0055] Specifically, the classification categories involved in step S1 include at least one of: internal control audit, economic responsibility audit, asset disposal and financial revenue and expenditure audit.

[0056] In one of the embodiments, the historical power audit text data obtained in step S1 undergoes a preprocessing operation called text data cleaning to improve data quality by removing irrelevant words and redundant information in the data.

[0057] Step S2, constructing and optimizing the classification representation of the historical power audit text data, and evaluating the classification misleadingness of these representations between different categories.

[0058] Specifically, for different categories of historical power audit text data, data dictionaries containing target key words will be created respectively. These data dictionaries provide basic vocabulary sets for each category. Afterwards, a list of paragraphs related to audit opinions is extracted from the historical power audit text data, and the audit opinions are divided into different categories according to the content of these paragraphs. For each audit opinion category, the target key words in the corresponding data dictionary are converted into multi-dimensional vocabulary vectors using the semantic features, positional features, and contextual paragraph features of the vocabulary. Subsequently, the overlap between the two vectors is matched. When the overlap exceeds the preset threshold, the relevant vocabulary vectors are merged to simplify and optimize the data representation, and finally generate data vector dictionaries for each category. Finally, for the vocabulary vectors in the data vector dictionary of each category, their maximum similarity relative to the vocabulary vectors in the data vector dictionary of other categories is calculated, and the mean of these maximum similarities is calculated. Based on this mean, the classification misleading degree of each vocabulary vector relative to other categories is evaluated, so as to understand which vocabulary or features may cause confusion or misleading between different categories.

[0059] Step S3, acquiring real-time power audit text data, and correcting the initial matching degree of the real-time power audit text data relative to the selected type based on the classification misleading degree to obtain a final matching degree.

[0060] Specifically, the present application first collects text data related to power audit in real time, and then calculates the maximum similarity between the words in the real-time power audit text and the words in the selected type data dictionary, and calculates the mean of these similarities, thereby obtaining the initial matching degree of the real-time power audit text data relative to the selected type. This process takes into account the semantic, positional and contextual features of the words, and utilizes the reference information of historical data. Afterwards, the initial matching degree is corrected based on the classification misleading degree obtained in step S2 to obtain the final matching degree.

[0061] Step S4, implementing text classification of the real-time power audit text data based on the final matching degree.

[0062] From the above, it can be seen that the electric power audit text classification method based on the large language model disclosed in the present application constructs and optimizes the classification representation of historical electric power audit text data, which can more accurately capture the characteristics of text data and reduce information loss and misleading in the classification process; evaluating the classification misleading degree of the classification representation between different categories is helpful to identify potential classification errors and confusion points, so as to make targeted improvements; correcting the initial matching degree of real-time electric power audit text data based on the classification misleading degree can eliminate or reduce the classification bias caused by data differences, noise and other factors, and improve the accuracy of real-time data processing; realizing text classification of real-time electric power audit text data based on the final matching degree can greatly improve the degree of automation of audit work, reduce manual intervention and errors, and improve audit efficiency.

[0063] In one embodiment, in step S2, constructing and optimizing the classification representation of the historical power audit text data and evaluating the classification misleadingness of these representations between different categories include:

[0064] Step S21 : creating data dictionaries containing target key words for different categories of historical power audit text data.

[0065] Specifically, given that various types of historical power audit text data are filled with many audit professional terms and vocabulary specific to the power industry, and within a certain type of report, some words appear more frequently and have obvious tendencies. Therefore, in order to more accurately reveal the category characteristics of historical power audit text data, it is necessary to construct a data dictionary containing target key words for each category of historical power audit text data. The target key words here can be understood as words that are relatively important to historical power audit text data and are related to audit findings, compliance, risk assessment, etc.

[0066] Step S22, obtaining a list of audit opinion paragraphs related to the historical power audit text data, and dividing the audit opinion categories based on the list of audit opinion paragraphs.

[0067] Specifically, this application will determine the audit opinion paragraphs covered by each power audit document based on the historical power audit text data, and build a corresponding audit opinion paragraph list based on the determined audit opinion paragraphs. After that, each audit opinion paragraph is analyzed and the audit opinion category is divided according to whether there are any problems with the audit results.

[0068] Step S23, for the data dictionary corresponding to the same audit opinion category, each target key word contained in the data dictionary is converted into a corresponding multi-dimensional vocabulary vector according to the semantic features, position features, and context paragraph features of the vocabulary, and the overlap between the two vectors is matched, and when the overlap is greater than a preset threshold, the vocabulary vectors are merged to obtain the corresponding data vector dictionary. The merging of vocabulary vectors can be performed by taking the average of two or more vectors.

[0069] Specifically, the present application converts each target key word in the data dictionary into a multi-dimensional word vector representation through semantic analysis and context paragraph analysis. These vectors combine the semantic features and context features of the words and provide a comprehensive description of the words. Subsequently, the cosine similarity between these multi-dimensional word vectors is used to match the key words to evaluate the overlap or similarity between them.

[0070] Step S24, for each word vector included in each category data vector dictionary, the classification misleadingness is evaluated based on the maximum vector similarity average relative to the different category data vector dictionaries.

[0071] It should be noted that although the matching data bias problem caused by sample imbalance is alleviated to a certain extent by matching the overlap of the original data dictionary, in the feature matching process, for categories with a small number of samples, if similar features exist in other categories of data dictionaries, this may mislead the actual matching. Therefore, for each category of data vector dictionary, this application believes that when there is a vocabulary vector with a high degree of overlap with a vector in the dictionary of other different categories of data vectors, the classification misleading degree of the vocabulary vector is considered to be high. This is because there may be fuzzy boundaries between different categories, that is, there are no obvious distinguishing features between them. If a vocabulary vector happens to be located on such a fuzzy boundary, it may have a high similarity with vectors of multiple categories at the same time, thereby increasing the difficulty and misleadingness of classification. Therefore, based on the above principles, this application evaluates the classification misleading degree.

[0072] Specifically, for each category of data vector dictionary, this application will extract each word vector contained therein, and calculate its similarity with the word vectors in other categories of data vector dictionaries, and find the maximum similarity. Among them, this maximum similarity reflects the degree of similarity between the word vector and the most similar words in the corresponding other category data vector dictionary. Afterwards, the maximum similarities obtained are summarized (if the total number of categories in the data vector dictionary is 4, then 3 maximum similarities will be summarized here), and the average calculation is performed to obtain the classification misleading degree of the word vector relative to other categories of data vector dictionaries.

[0073] In the above embodiments, on the one hand, by merging and streamlining the vocabulary vectors, the redundancy and complexity of data processing are reduced, and the speed and efficiency of data processing are improved. On the other hand, by evaluating the classification misleading degree of the vocabulary vector relative to other categories, those words or features that are likely to cause confusion or misleading between different categories can be identified. This helps to further improve the data dictionary and classification algorithm, reduce classification errors and misleading, and improve the overall classification performance.

[0074] In one embodiment, in step S21, for the historical power audit text data of the corresponding category, a data dictionary containing target key words is created by the following steps:

[0075] Step S211, obtaining all text strings covered by the historical power audit text data of the corresponding category, and performing word splitting and non-keyword filtering based on these text strings to obtain corresponding candidate key words.

[0076] It should be noted that the above-mentioned non-key words include stop words (such as prepositions, conjunctions, auxiliary words, etc., as well as some highly frequent but meaningless words), and irrelevant general words (such as some common daily expressions, Internet buzzwords, and non-professional terms, etc.). The candidate key words include professional terms related to the power industry and key audit terms.

[0077] For example, for this text string: "Management is responsible for preparing financial statements in accordance with the provisions of enterprise accounting standards so that they are fairly reflected, and designing, implementing and maintaining necessary internal controls so that the financial statements are free from material misstatements due to fraud or error", after word splitting and filtering of non-key words, the candidate key words obtained include: management, responsible, prepare, financial statements, fairly reflected, design, implement, maintain, internal control, fraud, error, material misstatement.

[0078] Step S212: Calculate the relative importance of each candidate keyword.

[0079] Specifically, for each candidate keyword, this application calculates the relative importance based on the TF-IDF (Term Frequency-Inverse Document Frequency) method. It should be noted that TF-IDF is a statistical method used to evaluate the importance of a word to a document set or one of the documents in a corpus. Since the calculation of relative importance based on TF-IDF belongs to the scope of the prior art, this application does not elaborate on it.

[0080] Step S213 , selecting a preset proportion of target key words from the candidate key words according to their relative importance, and creating a corresponding data dictionary based on the target key words.

[0081] Specifically, the present application will sort the candidate key words from high to low according to their relative importance, and select the target key words from the sorted word list according to a preset ratio (the specific value of the ratio is not currently limited, and the value can be set according to specific application requirements in different embodiments). Finally, a data dictionary can be created based on the selected target key words.

[0082] In the above embodiment, on the one hand, by splitting the vocabulary and filtering the non-keywords, irrelevant information in the text can be removed, thereby retaining the vocabulary that is valuable for the power audit analysis. This helps to reduce the amount of calculation for subsequent processing and improve the accuracy of keyword extraction. On the other hand, by calculating the relative importance of each candidate key word, the importance of the vocabulary can be quantified. This quantitative evaluation provides an objective basis for the subsequent screening of target key words and avoids the interference of subjective judgment. Finally, by screening out a preset proportion of target key words according to their relative importance, it can be ensured that the final keyword collection is both representative and not too large to be managed. This optimization selection is helpful for subsequent data analysis and can improve computing efficiency.

[0083] In one embodiment, in step S22, the classifying of audit opinions based on the audit opinion paragraph list includes:

[0084] Step S221 , input each audit opinion paragraph in the audit opinion paragraph list into the Doc2Vec model for processing to obtain a corresponding audit opinion vector.

[0085] Specifically, Doc2Vec is a model for document embedding, which can convert the entire document into a vector form, thereby facilitating similarity calculation or cluster analysis. Furthermore, this application will input each audit opinion paragraph obtained into the trained Doc2Vec model to obtain its vector representation.

[0086] Step S222: Perform cluster analysis based on the obtained audit opinion vectors, and classify the audit opinion categories according to the obtained clustering results.

[0087] Specifically, this application performs cluster analysis based on the k-means clustering algorithm. It should be noted that this application specifies the number of clusters (i.e., the k value) as 2 based on whether there are problems with the audit results, so as to divide the audit opinions into two categories. Since this application does not involve improvements to the k-means clustering algorithm, the specific clustering process is not currently described in detail.

[0088] In the above embodiment, by inputting the audit opinion paragraph into the Doc2Vec model and obtaining its vector representation, this process realizes the automation of audit opinion processing, greatly reducing the time and effort required for manual reading and analysis of audit opinions. In addition, since cluster analysis can quickly process a large number of audit opinion vectors and group them into several categories, this efficiency makes it possible to process large-scale audit data sets.

[0089] In one embodiment, in step S23, the target key words contained in the data dictionary are converted into corresponding multi-dimensional word vectors according to the semantic features, position features, and context paragraph features of the words, and the overlap degree matching between the two vectors is performed, including:

[0090] Step S231 , for each target key word included in the data dictionary, semantic analysis is performed, and context paragraph analysis is performed according to position features to obtain a corresponding word vector and multiple paragraph vectors.

[0091] Specifically, this application performs semantic analysis on each target keyword based on the Word2vec model to obtain a word vector that matches the corresponding target keyword. It should be noted that the Word2vec model generates a vector of fixed dimension for each target keyword in the data dictionary. These vectors can capture the semantic relationship between words, so that semantically similar words are close to each other in the vector space.

[0092] Furthermore, when performing context paragraph analysis based on position features, this application will put the paragraph where the word appears in the document into the EF-Doc2VecC model to obtain a paragraph vector that matches the paragraph. It should be noted that the EF-Doc2VecC model is an enhanced version of the Doc2Vec model. By introducing a context-aware mechanism, the generated paragraph vector can reflect the position and relationship of the word in a wider context.

[0093] Step S232: construct a multi-dimensional vocabulary vector for each target keyword based on the corresponding word vector and multiple paragraph vectors.

[0094] Specifically, for i target key words, given their word vectors ch , and multiple paragraph vectors (in, l Indicates i The number of times the target keyword appears in the document) is used to calculate the word vector ch , and these multiple paragraph vectors Construct the corresponding multi-dimensional vocabulary vector .

[0095] Step S233, when performing overlap matching between two vectors based on the obtained multi-dimensional vocabulary vectors, the overlap between the vocabulary is reflected based on the cosine similarity between the corresponding multi-dimensional vectors.

[0096] Specifically, i Target keywords and j The calculation formula for the overlap between target keywords includes:

[0097] ;

[0098] in, Indicates i Multi-dimensional vocabulary vector of target keywords With j Multi-dimensional vocabulary vector of target keywords The cosine similarity between them, that is, the degree of overlap, Indicates i word vectors of target keywords, Indicates j word vectors of target keywords, Represents the dot product symbol between vectors, Indicates i The mean of multiple paragraph vectors corresponding to the target keyword, Indicates j The mean of multiple paragraph vectors corresponding to the target keyword.

[0099] In the above embodiment, a multi-dimensional vocabulary vector of each target keyword is constructed based on the combination of word vectors and paragraph vectors. This vector representation not only contains the semantic information of the vocabulary itself, but also incorporates the positional features and paragraph information of the vocabulary in the context, making the vocabulary vector more accurate and comprehensive. When matching the overlap between two vectors based on the obtained multi-dimensional vocabulary vector, cosine similarity is used to measure the similarity and overlap between words. Cosine similarity is an effective vector space similarity measurement method that can accurately reflect the angle relationship between vectors, thereby accurately judging the similarity and overlap between words.

[0100] In one embodiment, in step S24, for thev The first type of data vector dictionary i Word vectors , the maximum vector similarity mean relative to the vector dictionary of different categories of data Calculated by the following formula:

[0101] ;

[0102] in, Indicates the number of categories covered by the current data vector dictionary, Indicates A dictionary of data vectors of types, Indicates the calculation v The first type of data vector dictionary i Word vectors With Dictionary of data vectors of type The similarity of all vocabulary vectors in , which can be the cosine similarity between vectors, and find the maximum similarity.

[0103] In one embodiment, in step S3, the initial matching degree of the real-time power audit text data relative to the selected type is corrected based on the classification misleading degree to obtain a final matching degree, including:

[0104] Step S31, constructing a first multidimensional vector set of the real-time power audit text data and a second multidimensional vector set of the historical power audit text data based on the semantic features, position features, and context paragraph features of the segmented vocabulary.

[0105] Specifically, taking the real-time power audit text data as an example, this application will first perform vocabulary splitting based on the real-time power audit text data to obtain corresponding split vocabulary; then, determine the multidimensional information of the split vocabulary, the multidimensional information includes word vectors, position vectors, and paragraph vectors; finally, construct the multidimensional vector of the split vocabulary based on the multidimensional information. It should be noted that when multiple split vocabulary are obtained by splitting, the multidimensional vectors of each split vocabulary are combined to obtain the first multidimensional vector set of the real-time power audit text data.

[0106] In one embodiment, the present application will perform vocabulary segmentation based on the word segmentation tool THULAC (THU Lexical Analyzer for Chinese). It should be noted that THULAC is an efficient Chinese lexical analysis toolkit that integrates two major functions: Chinese word segmentation and part-of-speech tagging.

[0107] In one of the embodiments, the present application processes the split vocabulary based on the Word2Vec model to generate corresponding word vectors.

[0108] In one of the embodiments, the present application obtains the position information of the split words and processes the position information using discrete position coding to generate a corresponding position vector.

[0109] In one of the embodiments, the present application obtains context information of the split vocabulary and puts the context information into the EF-Doc2VecC model to generate the corresponding paragraph vector.

[0110] Step S32, obtaining various types of data dictionaries corresponding to the historical power audit text data.

[0111] Specifically, since we have already explained how the data dictionary is constructed, no additional statement is made here.

[0112] Step S33, for each split word in the real-time power audit text data, calculate its maximum similarity with respect to each word in the selected type data dictionary based on the first and second multidimensional vector sets respectively, and after performing mean calculation based on the obtained maximum similarities, obtain the initial matching degree of the real-time power audit text data with respect to the selected type.

[0113] Specifically, for the first i The first multidimensional vector of the split vocabulary , and the corresponding v In the data dictionary of the type j The second multidimensional vector of the vocabulary , this application will be through the formula Calculate the similarity between two words. They all represent the corresponding generated word vectors. , both represent the corresponding generated position vectors, All represent the corresponding generated paragraph vectors, Represents the dot product symbol between vectors. Indicates the first i Split words, relative to the corresponding v In the data dictionary of the type j The cosine similarity of two words can further reflect the similarity between two words.

[0114] Furthermore, for each split word in the real-time power audit text data, the present application will calculate its maximum similarity with respect to each word in the selected type data dictionary based on the first and second multidimensional vector sets, respectively, and perform mean calculation based on the obtained maximum similarities. The corresponding calculation process can be understood by the following formula:

[0115] ;

[0116] in, Represents the real-time power audit text data relative to the selected type v The initial matching degree, MX represents the total number of words covered in the real-time power audit text data, Indicates the first i Split words relative to the selected type v Data dictionary The maximum similarity of each word in . It indicates that the maximum similarities corresponding to each split word in the real-time power audit text data will be summed up.

[0117] Step S34, based on the classification misleading degree, the initial matching degree is corrected to obtain the final matching degree of the real-time power audit text data relative to the selected type.

[0118] Specifically, this application will first comprehensively evaluate and calculate a correction coefficient by analyzing the relative proportion of samples of the selected power audit report type in the overall sample, as well as the average classification misleading degree of all relevant words in this type. This correction coefficient is intended to reflect the representativeness of the selected type in the overall power audit text and the reliability of its vocabulary classification, providing a basis for subsequent adjustments to the matching degree. This correction coefficient is then used to correct the matching degree between the initial power audit text and the selected type. By adjusting the initial matching degree to more accurately reflect the actual degree of correlation between the real-time power audit text data and the selected type, the final matching result is obtained. This process helps to improve the accuracy and reliability of power audit text classification.

[0119] In the above embodiment, the initial matching degree is corrected based on the classification misleading degree, which can further reduce the classification error caused by data bias, noise or the limitations of the classification algorithm itself. By introducing the correction coefficient, the initial matching degree is appropriately adjusted so that the final matching degree is closer to the actual situation, thereby improving the accuracy and reliability of the classification result.

[0120] In one embodiment, in step S34, the initial matching degree is corrected based on the classification misleading degree to obtain the final matching degree of the real-time power audit text data relative to the selected type, including:

[0121] Step S341, obtaining the relative proportion of the power audit report samples corresponding to the selected type in all samples, and combining the relative proportion and the average classification misleading degree of all matching words in the selected type to obtain the correction coefficient of the power audit text of the selected type.

[0122] Specifically, the relative proportion of the selected type of power audit report samples in all samples reflects the importance or representativeness of the selected type of samples in the overall sample data set. If the number of power audit text samples of the selected type is large, then this ratio will be close to 1; if it is small, it will be close to 0. For the average classification misleading degree of all matching words in the selected type, this application will sum up the classification misleading degrees of each matching word in the selected type and divide it by the total number of these matching words to obtain the average classification misleading degree. The higher this value is, the more serious the classification misleading of these matching words in the selected type. Combining the above two parts, it is possible to consider both the importance of the selected type in the overall data set (reflected by its sample proportion) and the average misleading degree of the matching words in the category. By evaluating the degree of misleading that may be caused by vocabulary matching problems in different categories in classification tasks, it helps to improve the text classification effect to reduce the occurrence of such misleading.

[0123] Step S342, after correcting the initial matching degree based on the correction coefficient, obtain the final matching degree of the real-time power audit text data relative to the selected type.

[0124] Specifically, the present application applies the correction coefficient to the initial matching degree for correction calculation. The specific method of correction is to multiply the initial matching degree by the complement of the correction coefficient (i.e., 1 minus the correction coefficient). The purpose of this is to make appropriate adjustments based on the size of the correction coefficient on the basis of the initial matching degree to obtain a final matching degree that is closer to the actual situation.

[0125] In the above embodiment, the introduction of the correction coefficient enables the classification algorithm to better adapt to the differences of different types of power audit report samples. Even if the initial matching degree of certain types of samples is high, if their classification misleading degree is also high, the final matching degree can be reduced by adjusting the correction coefficient to avoid excessive impact on the overall classification result. This mechanism enhances the robustness of the classification algorithm, so that it can maintain good classification performance on different types of samples.

[0126] In one embodiment, in step S341, the selected Correction factors for power audit texts of categories , which is calculated by the following formula:

[0127] ;

[0128] in, Indicates the selected Number of power audit text samples by category, represents the total number of samples in all samples, Indicates the selected The number of words that match the category. Indicates the selected Category data dictionary The classification misleading degree of the matching words, norm () represents the normalization function 。

[0129] Based on the above formula, it should be noted that when the relative proportion of the selected type of power audit report sample in all samples Too large, and the average classification misleadingness of all matching words in the selected type When it is higher, we consider the currently calculated correction factor Higher. On the contrary, the corresponding correction index Lower.

[0130] In one embodiment, in step S342, the final matching degree is calculated by the following formula:

[0131] ;

[0132] in, Indicates that the real-time power audit text data is relative to the selected The final matching degree of the category, Indicates that the real-time power audit text data is relative to the selected The initial matching degree of the category, Indicates the selected Correction factor for power audit text of category.

[0133] It should be noted that when the correction factor Near 0 o'clock, Close to 1, the final matching degree Will be close to the initial matching , that is, it is considered that no large correction is needed at present. When the correction coefficient Near 1 o'clock, will be close to 0, and the final matching degree It will also be close to 0, which means that the current initial matching degree Due to the large deviation, it needs to be greatly reduced. Based on the above formula, the final matching degree is flexibly adjusted according to the size of the correction coefficient to make it more in line with the actual situation.

[0134] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0135] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.

Claims

1. A power audit text classification method based on a large language model, characterized in that: The method comprises: S1. Obtain classified historical power audit text data; S2. construct and optimize classification representations of the historical power audit text data, and evaluate the classification misleadingness of these representations among different categories; S3, obtaining real-time power audit text data, and correcting the initial matching degree of the real-time power audit text data relative to the selected type based on the classification misleading degree to obtain a final matching degree; S4, implementing text classification of the real-time power audit text data based on the final matching degree; In step S2, the construction and optimization of the classification representation of the historical power audit text data and the evaluation of the classification misleading degree of these representations between different categories include: S21. Create data dictionaries containing target key words for different categories of historical power audit text data; S22, obtaining a list of audit opinion paragraphs related to the historical power audit text data, and dividing the audit opinion categories based on the list of audit opinion paragraphs; S23, for the data dictionary corresponding to the same audit opinion category, each target key word contained in the data dictionary is converted into a corresponding multi-dimensional vocabulary vector according to the semantic features, position features, and context paragraph features of the vocabulary, and the overlap between the two vectors is matched, and when the overlap is greater than a preset threshold, the vocabulary vectors are merged to obtain a corresponding data vector dictionary; S24, for each word vector included in each category data vector dictionary, based on the maximum vector similarity mean relative to the different category data vector dictionaries, perform classification misleading evaluation; In step S3, the initial matching degree of the real-time power audit text data relative to the selected type is corrected based on the classification misleading degree to obtain a final matching degree, including: S31, constructing a first multidimensional vector set of the real-time power audit text data and a second multidimensional vector set of the historical power audit text data based on the semantic features, position features, and context paragraph features of the segmented vocabulary; S32, obtaining various types of data dictionaries corresponding to the historical power audit text data; S33, for each split word in the real-time power audit text data, respectively calculate its maximum similarity with respect to each word in the selected type data dictionary based on the first and second multidimensional vector sets, and after performing mean calculation based on the obtained maximum similarities, obtain the initial matching degree of the real-time power audit text data with respect to the selected type; S34, based on the classification misleading degree, after correcting the initial matching degree, obtain the final matching degree of the real-time power audit text data relative to the selected type; In step S34, the initial matching degree is corrected based on the classification misleading degree to obtain the final matching degree of the real-time power audit text data relative to the selected type, including: S341, obtaining the relative proportion of the power audit report samples corresponding to the selected type in all samples, and combining the relative proportion and the average classification misleading degree of all matching words in the selected type to obtain the correction coefficient of the power audit text of the selected type; S342. After correcting the initial matching degree based on the correction coefficient, a final matching degree of the real-time power audit text data relative to the selected type is obtained.

2. The power audit text classification method based on a large language model according to claim 1 is characterized in that: In step S21, for the historical power audit text data of the corresponding category, a data dictionary containing target key words is created through the following steps: S211, obtaining all text strings covered by the historical power audit text data of the corresponding category, and performing word splitting and non-keyword filtering based on these text strings to obtain corresponding candidate key words; S212, calculating the relative importance of each candidate keyword; S213: Filter out a preset proportion of target key words from each candidate key word according to relative importance, and create a corresponding data dictionary based on the target key words.

3. The power audit text classification method based on a large language model according to claim 1 is characterized in that: In step S22, the classifying of audit opinions based on the audit opinion paragraph list includes: S221, inputting each audit opinion paragraph in the audit opinion paragraph list into the Doc2Vec model for processing to obtain a corresponding audit opinion vector; S222. Perform cluster analysis based on the audit opinion vectors obtained, and classify the audit opinions into categories according to the clustering results obtained.

4. The power audit text classification method based on a large language model according to claim 1 is characterized in that: In step S23, the target key words contained in the data dictionary are converted into corresponding multi-dimensional word vectors according to the semantic features, position features, and context paragraph features of the words, and the overlap degree matching between the two vectors is performed, including: S231, for each target key word included in the data dictionary, respectively, perform semantic analysis and context paragraph analysis according to position features to obtain a corresponding word vector and multiple paragraph vectors; S232, constructing a multi-dimensional vocabulary vector for each target key word based on the corresponding word vector and multiple paragraph vectors; S233: When performing overlap matching between two vectors based on the obtained multi-dimensional vocabulary vectors, the overlap between the vocabulary is reflected based on the cosine similarity between the corresponding multi-dimensional vectors.

5. The power audit text classification method based on a large language model according to claim 1 is characterized in that: In step S24, for the i-th vocabulary vector under the v-th type data vector dictionary , the maximum vector similarity mean relative to the vector dictionary of different categories of data Calculated by the following formula: ; in, Indicates the number of categories covered by the current data vector dictionary, Indicates A dictionary of data vectors of types, Indicates calculating the i-th vocabulary vector under the v-th type data vector dictionary With Dictionary of data vectors of type The similarity of all word vectors in , and find the maximum similarity.

6. The power audit text classification method based on a large language model according to claim 1 is characterized in that: In step S341, the selected Correction factors for power audit texts of categories , which is calculated by the following formula: ; in, Indicates the selected Number of power audit text samples by category, represents the total number of samples in all samples, Indicates the selected The number of words that match the category. Indicates the selected Category data dictionary The classification misleading degree of a matching word, norm() represents the normalization function.

7. The power audit text classification method based on a large language model according to claim 1 is characterized in that: In step S342, the final matching degree is calculated by the following formula: ; in, Indicates that the real-time power audit text data is relative to the selected The final matching degree of the category, Indicates that the real-time power audit text data is relative to the selected The initial matching degree of the category, Indicates the selected Correction factor for power audit text of category.

Citation Information

Patent Citations

  • Automatic evaluation method for text style

    CN114861629A

  • Word granularity Chinese form approximate confrontation sample generation method

    CN115311660A