Automatic annotation method and system for government data based on attention-dependent graph convolution
Through an automatic annotation method of government data based on attention graph convolution, the word frequency, part of speech and dependency features of the government corpus are extracted, and the node features are generated by combining the graph convolution network, which solves the problem of strong data dependence and complex context understanding in the existing technology. It solves the problem of deficiencies, achieves high-quality government data annotation, and improves the accuracy and efficiency of automatic annotation.
Patent Information
- Application Number
- CN202411109891.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-14
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-08-14
AI Technical Summary
Existing intelligent annotation methods have strong data dependence in government data annotation, ignore data associations and potential characteristics, lack the ability to understand complex contexts, and cannot effectively handle data that does not comply with rules or abnormal situations, resulting in high costs, low efficiency, and poor quality. Poor and unable to meet the data scale and quality requirements of large government models.
An automatic annotation method for government affairs data based on attention-dependent graph convolution is adopted. By obtaining government affairs corpus data, extracting word frequency, part of speech, word form and dependent syntactic attributes, designing a feature representation structure, and using graph convolution network to generate node features with government affairs characteristics. Combined with the attention mechanism for feature fusion, a high-quality data set is constructed, and the annotation strategy is optimized through preset evaluation indicators.
Effectively capture the topic distribution and importance of government data, reveal the grammatical functions and morphological changes of words, enhance the robustness of the annotation model, improve the accuracy and efficiency of automatic annotation, improve the quality of automatic annotation of government data, and ensure the accuracy of automatic annotation in different scenarios. Stable and efficient performance.
Smart Images

Figure CN118627471B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of data annotation, and in particular to a method and system for automatic annotation of government data based on attention-dependent graph convolution. Background Art
[0002] The statements in this section merely provide background information related to the present disclosure and do not necessarily constitute prior art.
[0003] With the rapid development of big data and artificial intelligence technology, how to manage and utilize government data has become the key to digital transformation and improving the quality and efficiency of government services. Traditional data annotation methods often rely on a large amount of manual operations, which is not only time-consuming and labor-intensive, but also difficult to ensure the consistency and accuracy of data when faced with complex and changeable government data. Therefore, most of the annotations for government data now use systematic, automated and intelligent methods.
[0004] Existing intelligent labeling methods include manual labeling and semi-automatic labeling. Most of them use algorithms, semantic segmentation, key point labeling and other methods, and use machine learning to assist labeling, natural language processing technology, automated rule engines, etc. to preliminarily label the data, and then manually review and correct them. However, these methods have a strong dependence on data, and only use surface features of the data for labeling, ignoring the associations between data and their potential features (such as part of speech, word form, etc.), and lack the ability to understand complex contexts and fault tolerance mechanisms, and cannot effectively handle data that does not conform to the rules or abnormal situations. In addition, in the field of government data, pre-processing links such as data labeling and manual sampling cannot currently be fully intelligent, with high costs, low efficiency, and poor quality, and often cannot meet the data scale and data quality requirements required for pre-training of large government models. Summary of the invention
[0005] In order to solve the above problems, the present invention proposes an automatic annotation method and system for government data based on attention-dependent graph convolution. According to the word frequency, part of speech, root and dependent syntactic attributes of the government corpus, a feature representation structure is designed. The government dependencies in the corpus are mined based on attention, so that the graph convolution network generates node features with government characteristics, which can construct a high-quality dataset in the field of government services.
[0006] According to some embodiments, the present disclosure adopts the following technical solutions:
[0007] The automatic annotation method of government data based on attention-dependent graph convolution includes:
[0008] Acquire corpus data of government services and preprocess the corpus data;
[0009] Extract the government words in the preprocessed corpus data, calculate the importance of each government word in the corpus, obtain the government weighted TF-IDF feature value of each government word in each corpus, and construct the government weighted TF-IDF feature matrix;
[0010] Extract the part-of-speech feature, word form feature, phonetic feature and dependency feature of each corpus data, and use the attention mechanism to fuse the weighted TF-IDF feature value, part-of-speech feature, word form feature, phonetic feature and dependency feature of the government affairs to obtain the node feature;
[0011] The dependency matrix of each corpus data is used as the adjacency matrix of each node of the graph convolutional network, the node features are input, and the classification results of the government corpus are output;
[0012] Evaluation indicators are preset to evaluate each type of data in the classification results, and automatic labeling of government corpus data is achieved based on the evaluation results.
[0013] According to some embodiments, the present disclosure adopts the following technical solutions:
[0014] The automatic annotation system for government data based on attention-based graph convolution includes:
[0015] A data acquisition module, used to acquire corpus data of government services and pre-process the corpus data;
[0016] The feature extraction module is used to extract government terms from the preprocessed corpus data, calculate the importance of each government term in the corpus, obtain the government weighted TF-IDF feature value of each government term in each corpus, and construct a government weighted TF-IDF feature matrix; extract the part-of-speech feature, word form feature, phonetic feature, and dependency feature of each corpus data;
[0017] A feature fusion module is used to fuse the weighted TF-IDF feature value, part-of-speech feature, word form feature, phonetic feature and dependency feature of the government affairs by using an attention mechanism to obtain a node feature;
[0018] The corpus classification module is used to use the dependency matrix of each corpus data as the adjacency matrix of each node of the graph convolutional network, input node features, and output the classification results of the government corpus;
[0019] The evaluation and annotation module is used to preset evaluation indicators, evaluate each type of data in the classification results, and realize automatic annotation of government affairs corpus data based on the evaluation results.
[0020] Compared with the prior art, the present invention has the following beneficial effects:
[0021] The disclosed automatic annotation method for government data based on attention-dependent graph convolution calculates the importance of each government word in the corpus, obtains the government weighted TF-IDF feature value of each government word in each corpus, and constructs a government weighted TF-IDF feature matrix. The matrix can effectively capture the topic distribution and significance of government data, reflecting the importance of government words in a specific context.
[0022] The disclosed automatic annotation method for government data based on attention-dependent graph convolution extracts the part-of-speech features, word form features, phonetic features and dependency features of each corpus data, reveals the unique grammatical functions, morphological changes, pronunciation information and syntactic relationships of government vocabulary, comprehensively describes the characteristics of government data from different dimensions, and provides rich information features for subsequent annotation tasks.
[0023] The disclosed automatic labeling method for government data based on attention-dependent graph convolution utilizes the attention mechanism to fuse the weighted TF-IDF feature values, part-of-speech features, word form features, phonetic features, and dependent features of the government data to obtain node features, thereby enhancing the robustness of the labeling model and reducing the problem of labeling errors caused by insufficient single features.
[0024] The disclosed automatic annotation method for government data based on attention graph convolution presets evaluation indicators, evaluates each type of data in the classification results, and realizes automatic annotation of government corpus data according to the evaluation results. By evaluating the model results, the model annotation strategy and feature extraction sensitivity can be continuously optimized, the accuracy and efficiency of automatic annotation can be improved, and the quality of automatic annotation of government data can be improved, so that it can maintain stable and efficient annotation performance in different scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The accompanying drawings constituting a part of the present disclosure are used to provide a further understanding of the present disclosure. The illustrative embodiments of the present disclosure and their descriptions are used to explain the present disclosure and do not constitute an improper limitation on the present disclosure.
[0026] Figure 1 is a method flow chart of an embodiment of the present disclosure;
[0027] Figure 2 A system flow chart of an embodiment of the present disclosure. DETAILED DESCRIPTION
[0028] The present disclosure is further described below in conjunction with the accompanying drawings and embodiments.
[0029] It should be noted that the following detailed descriptions are all illustrative and are intended to provide further explanation of the present disclosure. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present disclosure belongs.
[0030] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present disclosure. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0031] Example 1
[0032] In one embodiment of the present disclosure, a method for automatically labeling government data based on attention-dependent graph convolution is provided, comprising the following steps:
[0033] Step 1: Obtain corpus data of government services and pre-process the corpus data;
[0034] Step 2: Extract the government words in the preprocessed corpus data, calculate the importance of each government word in the corpus, obtain the government weighted TF-IDF feature value of each government word in each corpus, and construct the government weighted TF-IDF feature matrix;
[0035] Step 3: extract the part-of-speech feature, word form feature, pinyin feature and dependency feature of each corpus data, and use the attention mechanism to fuse the weighted TF-IDF feature value, part-of-speech feature, word form feature, pinyin feature and dependency feature of the government affairs to obtain the node feature;
[0036] Step 4: Use the dependency matrix of each corpus data as the adjacency matrix of each node in the graph convolutional network, input the node features, and output the classification results of the government affairs corpus;
[0037] Step 5: Preset evaluation indicators, evaluate each type of data in the classification results, and automatically label the government affairs corpus data based on the evaluation results.
[0038] As an embodiment, the present invention discloses an automatic annotation method for government data based on dependent attention graph convolution. According to the word frequency, part of speech, root and dependent syntactic attributes of the government corpus, a feature representation structure is designed, and the government dependency in the corpus is mined based on attention, so that the graph convolution network generates node features with government features. The specific implementation process is as follows:
[0039] Step 1: Obtain corpus data of government services and preprocess the corpus data;
[0040] Specifically, obtaining corpus data of government services and preprocessing the corpus data include:
[0041] Step 1: Obtain corpus data of government services including business regulations, business processes, business hotline question and answer data and other government service corpus data from relevant websites.
[0042] Step 2: Preprocessing includes: using regular expressions to verify the format of the corpus data to ensure that the corpus data meets the regulatory requirements in the government affairs field.
[0043] In step 2, according to the characteristics of government data, foreign characters and special characters in the corpus data are deleted, and the following method is designed to determine the minimum characters contained in the government data:
[0044] (1) Obtain the length set of government corpus data samples, which includes the number of characters in each corpus;
[0045] (2) Calculate the average, median, and minimum corpus length of the corpus data;
[0046] (3) If the mean-median value is greater than the minimum corpus length, it is considered that corpus data exists and the corpus data whose length is greater than the sum of the mean and median values is deleted;
[0047] (4) If the mean-median ratio is less than the minimum corpus length, it is considered that there is a large amount of hyperphrase corpus data, and the corpus data with a corpus length less than the median is deleted.
[0048] Step 3: Use big model technology to complete data deduplication, format conversion, and nomenclature disambiguation of government data.
[0049] In step 3, we use open source big model technology to identify common sense errors in government knowledge, and manually verify the accuracy of the corrected data. The following is an example of common sense knowledge correction:
[0050] Table 1 Common sense knowledge correction examples
[0051]
[0052] Step 2: TF-IDF feature extraction based on government vocabulary;
[0053] Furthermore, TF-IDF feature extraction based on government vocabulary includes:
[0054] Extract the government affairs vocabulary from the preprocessed corpus data, calculate the importance of each government affairs vocabulary in the corpus, obtain the government affairs weighted TF-IDF feature value of each government affairs vocabulary in each corpus, and construct the government affairs weighted TF-IDF feature matrix.
[0055] Specifically, based on the statistical analysis of government affairs corpus and combined with expert opinions, high-frequency words in the government affairs field such as business regulations and business processes are selected as government affairs vocabulary to construct a government affairs vocabulary set.
[0056] Furthermore, the government vocabulary in the preprocessed corpus data is extracted, the importance of each government vocabulary in the corpus is calculated, and the TF frequency calculation is performed based on the government vocabulary, including:
[0057] For the preprocessed government affairs corpus data, count the number of occurrences of each word in the corpus. When a word is a government affairs vocabulary, give it an additional government affairs weight. , highlighting the importance of the word in this corpus, as follows,
[0058]
[0059] in, Indicates The first word value, Indicates The word The number of times it appears in the corpus, It is All corpora The sum of the number of occurrences of words, It is The weight of a word. Indicates The first word value,
[0060] Furthermore, the government affairs weighted TF-IDF feature matrix is constructed, and the government affairs weighted TF-IDF feature value is calculated using the following formula:
[0061]
[0062] in, j Represents the total number of documents, Indicates that it contains The total number of documents with the word, +1 to avoid the risk of dividing by zero.
[0063] Finally, a feature matrix is constructed based on the weighted TF-IDF feature value of each word in each corpus, where each row represents a document and each column represents a word. An example of the feature matrix is shown in Table 2 below.
[0064] Table 2 Feature matrix representation
[0065]
[0066] Step 3: Extract the part-of-speech features, word form features, phonetic features, and dependency features of each corpus data;
[0067] Specifically, part-of-speech features, word form features, pinyin features and dependency features are extracted based on Hanlp.
[0068] Among them, 1) extracting the word form features of each corpus data, including:
[0069] Extract the part-of-speech features from each piece of corpus data, and assign a corresponding digital code to each part-of-speech to form a part-of-speech feature vector.
[0070] Specifically, the implementation is as follows:
[0071] from pyhanlp import HanLP # Processing text
[0072] term_list = HanLP.segment(text) # Output part of speech
[0073] for term in term_list:
[0074] word = term.word # Get the word
[0075] nature = term.nature # Get part of speech
[0076] nature_name = nature.toString() # Get the part of speech name.
[0077] 2) Extract the word form features of each corpus data, including:
[0078] Based on Hanlp, the word form features in each corpus data are extracted, the sum of the strokes of each word is counted, and the word form feature vector is composed by the sum of the strokes of different words.
[0079] Specifically, the implementation is as follows:
[0080] def get_stroke_count(char): # Use HanLP converter
[0081] from pyhanlp import Stroke
[0082] stroke_converter = Stroke()
[0083] return stroke_converter.getStrokeCount(char).
[0084] 3) Extract the phonetic features of each corpus data, including:
[0085] Based on Hanlp, the pinyin features in each corpus data are extracted, the pinyin of each word is counted, and numerical codes are assigned according to the different vowels and finals. The pinyin feature vector is composed of different vowels and finals.
[0086] Specifically, the implementation is as follows:
[0087] def get_pinyin(char): # Use HanLP converter
[0088] from pyhanlp import Pinyin
[0089] pinyin_converter = Pinyin()
[0090] return pinyin_converter.convertToPinyinString(char, "", True)
[0091] 4) Extract the dependent features of each corpus data, including:
[0092] Based on Hanlp, we extract the dependency features in each corpus data and design the dependency matrix The dependency relationships (subject-predicate, verb-object, parallel, preposition-object, etc.) between the corpus data of each government affairs are saved, and the dependency matrix is compressed into a dependency feature vector using matrix compression.
[0093] Specifically, the implementation is as follows:
[0094] CoNLLSentence = HanLP.parseDependency(text)
[0095] for word in CoNLLSentence:
[0096] print(f"Dependency: {word.DEPREL}, parent node ID: {word.HEAD}").
[0097] Step 4: Using the attention mechanism, the weighted TF-IDF feature value, part-of-speech feature, word form feature, pinyin feature and dependency feature of the government affairs are integrated to obtain node features;
[0098] Specifically, the TF-IDF feature value, part-of-speech feature, word form feature, phonetic feature and dependent feature vector are integrated based on the attention mechanism, including:
[0099] set up , , , , They are TF-IDF feature value, part-of-speech feature vector, word form feature vector, pinyin feature vector and dependency feature vector, and the attention weight of each feature is calculated according to the following formula:
[0100]
[0101] in, The function is an attention layer, which receives all feature vectors as input and outputs the weight of each feature. The weight should satisfy the normalization condition and the sum is 1. , , , , They are TF-IDF feature value, part-of-speech feature vector, word form feature vector, pinyin feature vector and dependency feature vector.
[0102] Then, use the above weights to perform feature fusion:
[0103]
[0104] in, is the fused feature vector, i.e., the node feature.
[0105] Step 5: Use the dependency matrix of each corpus data as the adjacency matrix of each node in the graph convolutional network, input the node features, and output the classification results of the government corpus. In the graph convolutional network, each node updates its own feature representation by aggregating the features of its neighboring nodes:
[0106]
[0107] in, It is The node feature matrix of the layer, is a learnable weight matrix, is a nonlinear activation function, is the degree matrix, is the adjacency matrix.
[0108] Specifically, the automatic classification of government data is completed through the prediction function of the trained graph convolutional network.
[0109] This includes the training of graph convolutional networks. In order to make the graph convolutional networks have better prediction effects, the present invention manually identifies labels for a small amount of data, defines clear and non-overlapping business categories based on the actual content and business needs of the government corpus data, and has domain experts with professional knowledge and experience label the selected samples to ensure the consistency and accuracy of the labeling process.
[0110] Select government corpus data samples as label data, use the label data as the training set of the graph convolutional network, use the dependency matrix of the label data as the adjacency matrix of each node of the graph convolutional network, and use As node features, in the graph structure, using the network structure and graph convolution method of the graph convolution network, Adam is selected as the optimization algorithm and cross entropy as the loss function to realize the training of the graph and network. The cross entropy loss function is as follows:
[0111]
[0112] in, is the average cross entropy loss value, is the sample size, It is The true labels of samples, The model is The predicted probability of a sample.
[0113] The present invention uses a trained graph convolutional network to take the dependency matrix of each corpus data as the adjacency matrix of each node of the graph convolutional network, input node features, output the classification results of the government corpus, complete the self-classification of government data, manually review the category items containing a small amount of knowledge, distinguish potential erroneous knowledge and contradictory knowledge as low-quality data, and other data as high-quality data, and perform high-quality data warehousing operations.
[0114] For low-quality data, further analyze the causes and propose corresponding optimization measures. Feed the processed low-quality data back to the feature extraction process and check the processing results of the low-quality data again. After multiple iterations, if the low-quality data cannot be converted into high-quality data, abandon this data.
[0115] Step 6: Preset evaluation indicators, evaluate each type of data in the classification results, and automatically label the government corpus data based on the evaluation results.
[0116] Through the preset evaluation indicators, combined with the basic features of the annotation data (part of speech features, word form features, phonetic features, and dependency features), the accuracy, completeness, and matching of each type of annotation data are evaluated to obtain the evaluation results, and data is stored or parameters are adjusted according to the results, including:
[0117] Step 1: Randomly select a certain proportion of labeled data from each category of labeled data as a test set. The number of test sets should be no less than 100 or 10% of the total amount of data in this category.
[0118] Step 2: Use regular expressions to desensitize the labeled data, that is, hide the data source and annotation source in the test set.
[0119] Step 3: Evaluate the effect of each labeled data according to the evaluation indicators, evaluation criteria and scoring rules.
[0120] Step 3-1: If the evaluation result of labeling a certain type of data is poor (total score is less than 6 points), optimize this type of data and improve the quality of this type of government data by optimizing the parameters in the labeling method.
[0121] Step 3-2: If the evaluation result of a certain type of data labeling is good (total score is greater than 6 points), the labeled data of this type will be stored in the database to supplement the knowledge base in the field of government services.
[0122] Among them, the preset evaluation indicators and evaluation criteria are shown in Table 3 and Table 4 respectively;
[0123] Table 3 Preset evaluation indicators
[0124]
[0125] Table 4 Evaluation criteria
[0126]
[0127] Furthermore, the knowledge base effect evaluation of the prompt word template is improved based on the business question-answering rules;
[0128] Step 1: Prompt word template design
[0129] Combined with the knowledge question and answer assistants on relevant websites, we sorted out the business question patterns, summarized the rules and designed prompt word templates based on the question patterns to ensure that the big model can accurately understand the semantics and structure of service domain knowledge and reduce inaccurate answers from the big model knowledge base due to inappropriate questions.
[0130] Based on the business question and answer rules, the prompt word template designed contains the following structure.
[0131] 1. Question type: used to identify the category of the question, such as business consultation, business guide, business process, etc.
[0132] 2. Key information extraction: used to guide the large model to focus on key information in the question, such as name, contact information, etc.
[0133] 3. Answer guidance: Provide clues or formulas to answer questions, such as how to handle a certain business based on the business processing flow.
[0134] 4. Supplementary explanation: Supplementary explanation of the problem to help the big model better understand the problem.
[0135] Design prompt word templates according to individual problems and their characteristics, including: business item name, business location, business time limit, required materials list, business process steps, etc.
[0136] Step 2: Knowledge base effect evaluation
[0137] Based on the actual usage of the knowledge base, write a periodic usage report based on the following four dimensions, and execute the optimization process based on the report feedback.
[0138] 1. Readiness Assessment
[0139] After the questions are corrected by the prompt word template, the big model is counted to see whether it correctly extracts and uses the key information in the question in the answer, such as the correct reference and processing of sensitive information such as names.
[0140] 2. Semantic Understanding Depth Evaluation
[0141] Combined with multi-round dialogues or context-dependent questions, the ability of the large model to correctly identify question types (such as business consultation, business guidance, etc.) is evaluated.
[0142] 3. Personalized problem-solving ability
[0143] For different types of personalized questions, evaluate whether the large model can flexibly apply the corresponding prompt word templates to give accurate answers.
[0144] 4. Comparative analysis
[0145] Directly compare the answer accuracy, user satisfaction and other indicators before and after using the prompt word template to quantify the improvement brought by the template.
[0146] Furthermore, data annotation parameter optimization is performed based on result feedback. By evaluating result feedback and using result feedback on the knowledge base effect, the parameters of the data annotation method are further optimized to improve the quality of data annotation.
[0147] On the one hand, we obtain feedback on a certain category of labeled data with poor evaluation results. On the other hand, we design a knowledge base effect evaluation, allowing and suggesting users to evaluate the use of the large model answers and obtain usage feedback. Then we analyze the preset indicator evaluation results and the knowledge base effect evaluation results, classify the evaluation results according to the field and type of the labeled data, and use manual review to analyze the reasons for poor labeling quality and poor large model answer results. According to the cause analysis results, we perform the following debugging:
[0148] 1. Adjust the rule set when the big model answers are inappropriate or beyond the scope of the service area.
[0149] 2. When the large model answers missing relevant key items, adjust the format check data screening threshold, and adjust hyperparameters such as neural layers, learning rate, and number of iterations in the graph convolutional neural network.
[0150] Example 2
[0151] In one embodiment of the present disclosure, a government data automatic labeling system based on attention-dependent graph convolution is provided, including:
[0152] A data acquisition module, used to acquire corpus data of government services and pre-process the corpus data;
[0153] The feature extraction module is used to extract government terms from the preprocessed corpus data, calculate the importance of each government term in the corpus, obtain the government weighted TF-IDF feature value of each government term in each corpus, and construct a government weighted TF-IDF feature matrix; extract the part-of-speech feature, word form feature, phonetic feature, and dependency feature of each corpus data;
[0154] A feature fusion module is used to fuse the weighted TF-IDF feature value, part-of-speech feature, word form feature, phonetic feature and dependency feature of the government affairs by using an attention mechanism to obtain a node feature;
[0155] The corpus classification module is used to use the dependency matrix of each corpus data as the adjacency matrix of each node of the graph convolutional network, input node features, and output the classification results of the government corpus;
[0156] The evaluation and annotation module is used to preset evaluation indicators, evaluate each type of data in the classification results, and realize automatic annotation of government affairs corpus data based on the evaluation results.
[0157] The present disclosure is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present disclosure. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0158] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0159] Although the above describes the specific implementation methods of the present disclosure in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present disclosure. Technical personnel in the relevant field should understand that on the basis of the technical solution of the present disclosure, various modifications or variations that can be made by those skilled in the art without creative work are still within the scope of protection of the present disclosure.
Claims
1. An automatic annotation method for government data based on attention-dependent graph convolution, characterized in that: include: Acquire corpus data of government services and preprocess the corpus data; Extract the government words in the preprocessed corpus data, calculate the importance of each government word in each corpus, obtain the government weighted TF-IDF feature value of each government word in each corpus, and construct the government weighted TF-IDF feature matrix; Extract the government vocabulary from the preprocessed corpus data and calculate the importance of each government vocabulary in the corpus, including: The number of times a word appears in each piece of corpus data is counted. When a word is a government vocabulary, the word is given additional government weighting to highlight the importance of the word in this piece of corpus data. Specifically: ; in, Indicates The word in The number of times it appears in the corpus, It is The sum of the occurrences of all words in a corpus, It is The weight of the word; Extract the part-of-speech feature, word form feature, phonetic feature and dependency feature of each corpus data, and use the attention mechanism to fuse the weighted TF-IDF feature value, part-of-speech feature, word form feature, phonetic feature and dependency feature of the government affairs to obtain the node feature; Construct the government affairs weighted TF-IDF feature matrix, including: The weighted TF-IDF feature value of government affairs is calculated as follows: ; in, Represents the total number of documents, Indicates that it contains The total number of documents with words is calculated, and +1 is added to avoid the risk of dividing by zero. Then, a feature matrix is constructed based on the government-weighted TF-IDF feature value of each word in each corpus, where each row represents a document and each column represents a word. The attention mechanism is used to fuse the weighted TF-IDF feature value, part-of-speech feature, word form feature, pinyin feature and dependency feature of the government affairs to obtain node features, including: Based on the attention mechanism, TF-IDF feature values, part-of-speech feature vectors, word form feature vectors, pinyin feature vectors and dependency feature vectors are integrated to calculate the attention weight of each feature vector. ; in, The function is an attention layer, which receives all feature vectors as input and outputs the weight of each feature. The weight should meet the normalization condition and sum to 1. , , , , They are TF-IDF feature value, part-of-speech feature vector, word form feature vector, pinyin feature vector and dependency feature vector respectively; the obtained weights are used for feature fusion: ; in, is the fused feature vector; The dependency matrix of each corpus data is used as the adjacency matrix of each node of the graph convolutional network, the node features are input, and the classification results of the government corpus are output; Evaluation indicators are preset to evaluate each type of data in the classification results, and automatic labeling of government corpus data is achieved based on the evaluation results.
2. The automatic government data labeling method based on attention-dependent graph convolution as claimed in claim 1 is characterized in that: Acquiring corpus data of government services and preprocessing the corpus data include: Obtain government affairs corpus data on business regulations, business processes, and business hotline questions and answers from relevant websites, use regular expressions to verify the format of government affairs corpus data, and use big model technology to deduplicate data, convert formats, and eliminate nomenclature ambiguity for government affairs corpus data.
3. The automatic annotation method for government data based on attention-dependent graph convolution as claimed in claim 1 is characterized in that: Extract the part-of-speech features of each corpus data, including: Based on Hanlp, the part-of-speech features in each corpus data are extracted, and a corresponding numerical code is assigned to each part-of-speech to form a part-of-speech feature vector.
4. The automatic annotation method for government data based on attention-dependent graph convolution as claimed in claim 1 is characterized in that: Extract the word form features of each corpus data, including: Based on Hanlp, the word form features in each corpus data are extracted, the sum of the strokes of each word is counted, and the word form feature vector is composed by the sum of the strokes of different words.
5. The automatic annotation method for government data based on attention-dependent graph convolution as claimed in claim 1 is characterized in that: Extract the pinyin features of each corpus data, including: Based on Hanlp, the pinyin features in each corpus data are extracted, the pinyin of each word is counted, and numerical codes are assigned according to the different vowels and finals. The pinyin feature vector is composed of different vowels and finals.
6. The automatic annotation method for government data based on attention-dependent graph convolution as claimed in claim 1, characterized in that: Extract the dependent features of each corpus data, including: Based on Hanlp, the dependency features in each corpus data are extracted, and a dependency matrix is designed to save the dependency relationship between the corpus data of each government affairs. Matrix compression is used to compress the dependency matrix into a dependency feature vector.
7. The automatic annotation system of government data based on attention-dependent graph convolution is characterized by: include: A data acquisition module, used to acquire corpus data of government services and pre-process the corpus data; The feature extraction module is used to extract government terms from the preprocessed corpus data, calculate the importance of each government term in each corpus, obtain the government weighted TF-IDF feature value of each government term in each corpus, and construct a government weighted TF-IDF feature matrix; Extract the part-of-speech features, word form features, phonetic features, and dependency features of each corpus data; Extract the government vocabulary from the preprocessed corpus data and calculate the importance of each government vocabulary in the corpus, including: The number of times a word appears in each piece of corpus data is counted. When a word is a government vocabulary, the word is given additional government weighting to highlight the importance of the word in this piece of corpus data. Specifically: ; in, Indicates The word The number of times it appears in the corpus, It is The sum of the occurrences of all words in a corpus, It is The weight of the word; A feature fusion module is used to fuse the weighted TF-IDF feature value, part-of-speech feature, word form feature, phonetic feature and dependency feature of the government affairs by using an attention mechanism to obtain a node feature; Construct the government affairs weighted TF-IDF feature matrix, including: The weighted TF-IDF feature value of government affairs is calculated as follows: ; in, Represents the total number of documents, Indicates that it contains The total number of documents with words is calculated, and +1 is added to avoid the risk of dividing by zero. Then, a feature matrix is constructed based on the government-weighted TF-IDF feature value of each word in each corpus, where each row represents a document and each column represents a word. The attention mechanism is used to fuse the weighted TF-IDF feature value, part-of-speech feature, word form feature, pinyin feature and dependency feature of the government affairs to obtain node features, including: Based on the attention mechanism, TF-IDF feature values, part-of-speech feature vectors, word form feature vectors, pinyin feature vectors and dependency feature vectors are integrated to calculate the attention weight of each feature vector. ; in, The function is an attention layer, which receives all feature vectors as input and outputs the weight of each feature. The weight should meet the normalization condition and sum to 1. , , , , They are TF-IDF feature value, part-of-speech feature vector, word form feature vector, pinyin feature vector and dependency feature vector respectively; the obtained weights are used for feature fusion: ; in, is the fused feature vector; The corpus classification module is used to use the dependency matrix of each corpus data as the adjacency matrix of each node of the graph convolutional network, input node features, and output the classification results of the government corpus; The evaluation and annotation module is used to preset evaluation indicators, evaluate each type of data in the classification results, and realize automatic annotation of government affairs corpus data based on the evaluation results.
Citation Information
Patent Citations
Pathological image prognosis feature weight calculation method and system
CN112434172A
Chinese word sense disambiguation method based on graph convolutional neural network
CN113095087A
Government affair evaluation text classification management method based on big data
CN115587179A
Urban waterlogging-prone point information recommendation method based on government affair user portraits
CN117149859A
Government affair data automatic labeling method and system based on dependency attention graph convolution
CN118627471A
