Policy document classification method and system fusing metadata and label relevance

By constructing a hypergraph representation of the text, metadata, and label correlation of policy documents, and combining it with BERT and a hypergraph neural network, the problem of low classification accuracy of policy documents is solved, achieving higher classification accuracy and resource utilization.

CN117216010BActive Publication Date: 2025-10-10SHANDONG COMP SCI CENTNAT SUPERCOMP CENT IN JINAN +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311040591.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-17
Publication Date
2025-10-10
Estimated Expiration
2043-08-17

AI Technical Summary

Technical Problem

The classification method of policy documents in existing technologies relies on traditional manual labeling or general deep learning methods, resulting in low classification accuracy, low resource utilization, and an inconsistent classification system, making it difficult to efficiently obtain and find relevant policy information.

Method used

The method of fusing metadata and label relevance is adopted. By constructing a hypergraph representation of text-metadata and label relevance, BERT is combined to obtain semantic information, a hypergraph neural network is used to extract high-order structural information, and feature fusion is performed to improve classification accuracy.

Benefits of technology

The classification accuracy of policy documents has been improved from 70% to 85%, which has enhanced the utilization of data resources and classification efficiency, reduced the complexity of the graph structure and enhanced interpretability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117216010B_ABST
    Figure CN117216010B_ABST
Patent Text Reader

Abstract

The application discloses a policy file classification method and system fusing metadata and label correlation, wherein the method comprises the following steps: obtaining a policy file to be classified; preprocessing the policy file to be classified; constructing a text-metadata hypergraph based on the text and metadata of the policy file to be classified; constructing a label correlation hypergraph based on the label of the policy file to be classified; classifying the title of the policy file to be classified by using a trained title classification model to obtain a first classification result; inputting the text-metadata hypergraph into a trained first hypergraph neural network to output a first hypergraph feature representation; inputting the label correlation hypergraph into a trained second hypergraph neural network to output a second hypergraph feature representation; fusing the first hypergraph feature representation and the second hypergraph feature representation to obtain a second classification result; and performing weighted summation on the first classification result and the second classification result to obtain a final classification result of the policy file to be classified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of document classification, and in particular to a policy document classification method and system integrating metadata and tag relevance. Background Art

[0002] The statements in this section merely mention background art related to the present invention and do not necessarily constitute prior art.

[0003] Policy documents include official documents such as laws, regulations, and departmental rules. The chaotic distribution of policy documents has brought inconvenience to the public in obtaining and finding relevant policy information. The inconsistent classification system has led to difficulties in the classification and retrieval of policy documents.

[0004] The content covered by policies suffers from diverse and heterogeneous information, as well as inconsistent descriptions and expressions, which undoubtedly increases the difficulty of text analysis. Previous approaches to classifying policy documents relied on traditional manual annotation or general deep learning classification methods, resulting in low utilization and classification accuracy, often only around 70%. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this paper provides a policy document classification method and system that integrates metadata and tag relevance. By analyzing the characteristics of policy documents, a dual hypergraph representation of the text, metadata, and tag relevance is constructed. A hypergraph neural network is then used to capture the complex and high-order structural information of the hypergraph structured data relevance. BERT is also used to obtain semantic information about the corresponding policy document title. Finally, these two aspects are integrated into higher-level semantic information for classification and annotation of policy documents, addressing the low resource utilization and classification efficiency issues of existing methods.

[0006] On the one hand, a policy document classification method integrating metadata and label correlation is provided;

[0007] The policy document classification method that integrates metadata and label correlation includes:

[0008] Obtaining policy documents to be classified; pre-processing the policy documents to be classified;

[0009] Based on the text and metadata of the policy document to be classified, a text-metadata hypergraph is constructed; based on the labels of the policy document to be classified, a label correlation hypergraph is constructed;

[0010] The titles of the policy documents to be classified are classified using the trained title classification model to obtain a first classification result; the text-metadata hypergraph is input into the trained first hypergraph neural network to output a first hypergraph feature representation; the label correlation hypergraph is input into the trained second hypergraph neural network to output a second hypergraph feature representation; the first hypergraph feature representation and the second hypergraph feature representation are fused to obtain a second classification result;

[0011] The first classification result and the second classification result are weightedly summed to obtain the final classification result of the policy document to be classified.

[0012] On the other hand, a policy document classification system integrating metadata and tag relevance is provided;

[0013] A policy document classification system that integrates metadata and tag correlation, including:

[0014] An acquisition module is configured to: acquire a policy document to be classified; and pre-process the policy document to be classified;

[0015] A construction module is configured to: construct a text-metadata hypergraph based on the text and metadata of the policy document to be classified; and construct a label correlation hypergraph based on the labels of the policy document to be classified;

[0016] The classification module is configured to: classify the title of the policy document to be classified using a trained title classification model to obtain a first classification result; input the text-metadata hypergraph into the trained first hypergraph neural network to output a first hypergraph feature representation; input the label correlation hypergraph into the trained second hypergraph neural network to output a second hypergraph feature representation; and perform feature fusion on the first hypergraph feature representation and the second hypergraph feature representation to obtain a second classification result;

[0017] The output module is configured to perform weighted summation on the first classification result and the second classification result to obtain a final classification result of the policy document to be classified.

[0018] In another aspect, an electronic device is provided, comprising:

[0019] a memory for non-transitory storage of computer-readable instructions; and

[0020] a processor for executing said computer-readable instructions,

[0021] When the computer-readable instructions are executed by the processor, the method described in the first aspect is executed.

[0022] On the other hand, a storage medium is provided, which non-temporarily stores computer-readable instructions, wherein when the non-temporary computer-readable instructions are executed by a computer, the instructions of the method described in the first aspect are executed.

[0023] On the other hand, a computer program product is provided, comprising a computer program, wherein the computer program is configured to implement the method described in the first aspect when running on one or more processors.

[0024] One of the above technical solutions has the following advantages or beneficial effects:

[0025] 1. Analyze the characteristics of policy documents and divide them into multiple fields to improve the utilization of data resources and the accuracy of policy document classification.

[0026] 2. Encode the title and body of the policy document separately, and classify the policy documents based on the semantic features of the policy document title and the high-level data relevance of the policy document body.

[0027] 3. Construct a dual hypergraph representation of text-metadata and label correlation, formulate complex high-order data associations by connecting multiple nodes through hyperedges, reduce the complexity of the graph structure and enhance interpretability.

[0028] 4. Integrate the semantic information of policy document titles output by BERT and the dual hypergraph structure information output by the hypergraph neural network, and adjust the classification features of the two outputs through dynamic weights to make the classification semantics of each policy document clearer. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] The accompanying drawings, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0030] Figure 1 This is a flow chart of the method of embodiment 1;

[0031] Figure 2 This is a schematic diagram of the network structure of Example 1. DETAILED DESCRIPTION

[0032] It should be noted that the following detailed descriptions are exemplary and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which the present invention belongs.

[0033] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present invention. 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 the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0034] Example 1

[0035] This embodiment provides a policy document classification method that integrates metadata and tag relevance;

[0036] like Figure 1 and Figure 2 As shown in FIG, the policy document classification method integrating metadata and label correlation includes:

[0037] S101: Obtaining a policy document to be classified; pre-processing the policy document to be classified;

[0038] S102: constructing a text-metadata hypergraph based on the text and metadata of the policy document to be classified; constructing a label correlation hypergraph based on the labels of the policy document to be classified;

[0039] S103: Classify the title of the policy document to be classified using the trained title classification model to obtain a first classification result; input the text-metadata hypergraph into the trained first hypergraph neural network to output a first hypergraph feature representation; input the label correlation hypergraph into the trained second hypergraph neural network to output a second hypergraph feature representation; perform feature fusion on the first hypergraph feature representation and the second hypergraph feature representation to obtain a second classification result;

[0040] S104: Perform weighted summation on the first classification result and the second classification result to obtain a final classification result of the policy document to be classified.

[0041] Furthermore, the S101: obtaining policy documents to be classified, specifically using the Scrapy framework to collect policy document contents from major government websites; wherein, the policy documents to be classified include: policy title, policy text, policy metadata and policy tags; the policy metadata include: release time, release location, issuing authority, user group, support type, policy classification, and policy type.

[0042] Furthermore, the step S101: pre-processing the policy documents to be classified specifically includes:

[0043] The policy title and policy text are cleaned using regular expressions to remove html hypertext information, numbers, English characters, garbled characters and spaces;

[0044] The policy text is segmented, and a word list of the policy text is obtained by deleting words with a frequency below a set threshold.

[0045] It should be understood that in most cases, the policy document title and the content of the text contain special symbols, links and reference mentions that are not important or even confused with keywords, which will have a greater impact on classification performance, so the data needs to be preprocessed.

[0046] The policy title and policy text are cleaned using regular expressions in Python remodule to remove html hypertext information, numbers, English characters, garbled characters and spaces generated by crawling web pages. Since the title of the policy document is a short text, it is usually a high-level summary of the policy document, so in order to preserve its semantic integrity, no further preprocessing operations are performed. The content of the policy document is a long text, in order to make its semantics more clear, further preprocessing operations are performed. First, the cleaned policy text is segmented using the jieba.cut() function, then the word frequency is counted, and finally the stop words and low-frequency words with a frequency less than 5 are deleted.

[0047] Further, the S102: based on the text and metadata of the policy document to be classified, a text-metadata hypergraph is constructed, specifically including:

[0048] Each word in the word list of the policy text is regarded as a node in the hypergraph, each sentence is regarded as an edge, and all word nodes in the sentence are connected in order to construct a sequential hyperedge;

[0049] The metadata is inserted into the tail of the word list, each type of metadata is regarded as an edge, and all words of the current type of metadata are connected to construct a metadata hyperedge, and a text-metadata hypergraph is obtained.

[0050] Further, the text-metadata hypergraph is represented as ; wherein is the association matrix of the text-metadata hypergraph, defined as:

[0051]

[0052] = is the feature matrix of the text-metadata hypergraph, and the features of each node are initialized using Glove word embedding, is the size of the word list of a policy document after adding the corresponding metadata, The number of sentences in the text plus the number of metadata types, is the dimension of the feature vector of each node, represents the i-th node in the hypergraph, represents the jth hyperedge in the hypergraph.

[0053] It should be understood that considering that the main body of the policy is long, the long text structure needs to be encoded, and there is basically no fixed word limit and the fluctuation is large. Therefore, the use of a graph structure is more suitable for this situation.

[0054] Since different policy documents have some of the same metadata, it indicates that they are likely to be derived or supplementary policies within the same field. Therefore, metadata adds more interpretability and data relevance to policy documents (policies related to the digital economy label will be more biased towards certain economically highly developed cities, so when making classification predictions, policies issued in these locations will be more biased).

[0055] Since the hypergraph structure is more flexible than the general graph structure in processing heterogeneous data and has stronger high-order associations between data samples, the use of hypergraphs can better represent the data correlation between the body of the policy document and its corresponding metadata.

[0056] To maximize the preservation of the sentence structure of each policy document and facilitate the extraction of its content features, the words in each policy document's vocabulary are treated as nodes in a hypergraph, each sentence as a hyperedge, and all word nodes in that sentence are connected to form sequential hyperedges. To improve the data relevance between words and alleviate the semantic ambiguity caused by excessive and redundant information in the policy document, the metadata of each policy document is inserted into its vocabulary. Each type of metadata is treated as a hyperedge, and all words of that type of metadata are connected to form metadata hyperedges.

[0057] Furthermore, the step S102: constructing a tag correlation hypergraph based on the tags of the policy documents to be classified, specifically includes:

[0058] Each label in the policy document is regarded as a node, and multiple label nodes that appear in different policy documents are connected by edges to obtain a label correlation hypergraph.

[0059] Furthermore, the label correlation hypergraph is represented as ,in , is the association matrix of the label correlation hypergraph,

[0060]

[0061] = is the feature matrix of the label correlation hypergraph, and uses one-hot to initialize each node feature. c is the number of labels in the policy file, and multiple labels that appear simultaneously are defined as label groups. is the number of tag groups in the policy file.

[0062] It should be understood that since the subject of a policy document is not single but multi-label, and multiple labels appear simultaneously in different policy documents, they have strong correlations. Therefore, the dependency between the labels that appear simultaneously helps improve classification accuracy and increase the data relevance of the policy.

[0063] Since the flexible hyperedges in the hypergraph can connect multiple nodes that appear at the same time, it is more concise and clear than the general graph structure and has stronger interpretability. Therefore, the use of hypergraphs can better represent the relationship between multiple labels.

[0064] By constructing a dual hypergraph representation as described above, we can not only fully utilize the characteristics of policy documents so that each field can become a key reference for classification and labeling, but also the hypergraph structure can model multiple related data and use flexible hyperedges to easily construct heterogeneous data representations.

[0065] Furthermore, the training process of the trained title classification model, the trained first hypergraph neural network, and the trained second hypergraph neural network includes:

[0066] Constructing a training set, wherein the training set is a policy document with known classification labels;

[0067] Constructing a policy document classification model, the policy document classification model includes three parallel branches: a first branch, a second branch, and a third branch. The first branch is a title classification model. The network structure of the title classification model includes: a BERT model and a linear classifier connected in sequence; the linear classifier is such as a support vector machine; the BERT model is used to input the policy title; the linear classifier outputs a first classification result;

[0068] The second branch is a first hypergraph neural network and a pooling layer connected to each other, wherein the first hypergraph neural network is used to input the text-metadata hypergraph; the pooling layer is used to output the first hypergraph feature representation;

[0069] The third branch is a second hypergraph neural network, which is used to input a label correlation hypergraph and output a second hypergraph feature representation.

[0070] The output end of the pooling layer and the output end of the second hypergraph neural network are both connected to the input end of the feature fusion module. The feature fusion module fuses the first hypergraph features and the second hypergraph features to obtain a second classification result.

[0071] The output of the linear classifier and the output of the feature fusion module are both connected to the input of the weighted sum module, and the output of the weighted sum module outputs the final classification result;

[0072] The training set is input into the policy document classification model to train the model. When the total loss function value of the model no longer decreases, the training is stopped to obtain the trained policy document classification model, that is, the trained title classification model, the trained first hypergraph neural network and the trained second hypergraph neural network are obtained.

[0073] Furthermore, the total loss function of the model uses binary cross entropy loss. When the loss no longer decreases, training is stopped to obtain the trained model. The binary cross entropy loss formula is as follows:

[0074]

[0075] Where σ is the sigmoid activation function.

[0076] It should be understood that the internal structures of the first hypergraph neural network and the second hypergraph neural network are consistent, wherein the hypergraph neural network refers to a network used to perform embedding learning and representation learning on nodes and hyperedges using a hypergraph structure. Compared with traditional graph neural networks, hypergraph neural networks can handle multivariate and high-order relationships and exhibit better performance.

[0077] Furthermore, S103: the titles of the policy documents to be classified are classified using the trained title classification model to obtain a first classification result, which specifically includes:

[0078] The policy title is input into the Chinese BERT, which contains 12 hidden layers, each layer consists of 768 units, and the corresponding word embedding is obtained. Then the first token of the policy document title generated by the Chinese BERT is Features of the last layer as semantic features of the policy document titles and input them into the linear classifier:

[0079]

[0080] in, It is a semantic feature representation of a policy document title after passing through Chinese BERT and linear classifier. is a trainable parameter matrix, is the bias, where c is the number of labels in the policy document.

[0081] Furthermore, the text-metadata hypergraph is input into the trained first hypergraph neural network to output a first hypergraph feature representation, and the label correlation hypergraph is input into the trained second hypergraph neural network to output a second hypergraph feature representation, specifically including:

[0082] The text-metadata hypergraph association matrix and its characteristic matrix and multi-label correlation hypergraph association matrix and its characteristic matrix Input into the first hypergraph neural network and the second hypergraph neural network respectively, the formula is as follows:

[0083]

[0084]

[0085] in, The text-metadata hypergraph representation is passed through a first hypergraph neural network, aggregating word node features and metadata node features onto sequential hyperedges and metadata hyperedges. Sequential hyperedge features and metadata hyperedge features are then aggregated onto word nodes and metadata nodes. This ensures that all nodes in the text-metadata hypergraph after passing through the first hypergraph neural network are a collection of metadata-specific word representations and word-specific metadata representations. This overcomes the heterogeneity of multiple node types while also capturing rich data relevance across multiple node types. is the trainable parameter matrix, σ is the ReLU activation function, is the hyperedge weight matrix of the text-metadata hypergraph, and are the node degree matrix and hyperedge degree matrix of the text-metadata hypergraph respectively, and the calculation formula is as follows:

[0086]

[0087]

[0088] The label correlation hypergraph represents that the label features are aggregated onto the label hyperedge through the second hypergraph neural network, and then the label hyperedge features are aggregated onto the label node, so that the label correlation hypergraph obtains the node relationship within the label group and the group relationship between the label groups after passing through the second hypergraph neural network, and has rich multi-node data correlation. is the trainable parameter matrix, σ is the ReLU activation function, is the hyperedge weight matrix of the label correlation hypergraph, and are the node degree matrix and hyperedge degree matrix of the label correlation hypergraph respectively, and the calculation formula is as follows:

[0089]

[0090]

[0091] On the one hand, since policy document classification belongs to text-level classification, that is, graph classification, it is necessary to transform the node classification problem into a whole graph classification problem. On the other hand, in order to facilitate the policy title features output by BERT Fusion, enriching the features of policy documents. Therefore, a pooling function is used, which is the sum of the mean pooling function and the maximum pooling function:

[0092]

[0093] in This is the final feature representation of a text-metadata hypergraph after it has been pooled. The mean pooling function averages the features of words and metadata nodes, while the max pooling function selects the features of words and metadata that contribute most to classification. The two are summed to form a complete information graph.

[0094] Further, S103: performing feature fusion on the first hypergraph feature representation and the second hypergraph feature representation to obtain a second classification result;

[0095] Obtain policy text-metadata features through the first hypergraph neural network and pooling operation And the second graph neural network obtains policy label correlation features Then we start the dual hypergraph feature merging operation so that each node in the graph has rich features of words, metadata, and label relevance. The formula is as follows:

[0096]

[0097] in, is the merged dual hypergraph feature.

[0098] Furthermore, S104: performing weighted summation on the first classification result and the second classification result to obtain a final classification result of the policy document to be classified, specifically including:

[0099] By integrating the semantic information of policy document titles output by BERT and the dual hypergraph structure information output by the hypergraph neural network, and adjusting the classification features of the two outputs through dynamic weighting, the classification semantics of each policy document is made clearer. The formula is as follows:

[0100]

[0101]

[0102]

[0103] in, and is a dynamic weight used to adjust whether the final output focuses more on the semantic information of the policy title or the relationship between the dual hypergraph structures. and is the trainable parameter matrix, The sigmoid activation function ensures that the weights are between 0 and 1. The final prediction score for each label.

[0104] Constructing a dual hypergraph structure allows for the establishment of dependencies between multiple relationships through flexible hyperedges within the hypergraph, making it easier to build data correlations, reducing the complexity of general graph structures and enhancing interpretability. For the text-metadata hypergraph, it not only adapts to the varying lengths and large fluctuations in policy document content, but also builds relationships between multiple types of nodes, making the content and structure of policy document text more consistent and improving accuracy to approximately 80%. For the label correlation hypergraph, the presence of hyperedges can represent not only the relationships between label pairs but also the relationships between label groups, increasing accuracy to approximately 80%. Therefore, combining the above dual hypergraph structure can increase the final accuracy to approximately 85%, a nearly 15% improvement over the general model.

[0105] Example 2

[0106] This embodiment provides a policy document classification system that integrates metadata and tag relevance;

[0107] A policy document classification system that integrates metadata and tag correlation, including:

[0108] An acquisition module is configured to: acquire a policy document to be classified; and pre-process the policy document to be classified;

[0109] A construction module is configured to: construct a text-metadata hypergraph based on the text and metadata of the policy document to be classified; and construct a label correlation hypergraph based on the labels of the policy document to be classified;

[0110] The classification module is configured to: classify the title of the policy document to be classified using a trained title classification model to obtain a first classification result; input the text-metadata hypergraph into the trained first hypergraph neural network to output a first hypergraph feature representation; input the label correlation hypergraph into the trained second hypergraph neural network to output a second hypergraph feature representation; and perform feature fusion on the first hypergraph feature representation and the second hypergraph feature representation to obtain a second classification result;

[0111] The output module is configured to perform weighted summation on the first classification result and the second classification result to obtain a final classification result of the policy document to be classified.

[0112] It should be noted that the acquisition module, construction module, classification module, and output module described above correspond to steps S101 to S104 in Example 1. The examples and application scenarios implemented by the modules and the corresponding steps are the same, but are not limited to the contents disclosed in Example 1. It should be noted that the modules described above, as part of a system, can be executed in a computer system, such as a set of computer-executable instructions.

[0113] The descriptions of the various embodiments in the above embodiments have different focuses. For parts not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0114] The proposed system can be implemented in other ways. For example, the system embodiment described above is merely illustrative. For example, the above module division is only a logical function division. In actual implementation, other division methods may be used. For example, multiple modules can be combined or integrated into another system, or some features can be ignored or not implemented.

[0115] Example 3

[0116] This embodiment also provides an electronic device, comprising: one or more processors, one or more memories, and one or more computer programs; wherein the processor is connected to the memory, and the one or more computer programs are stored in the memory. When the electronic device is running, the processor executes the one or more computer programs stored in the memory, so that the electronic device executes the method described in the above embodiment one.

[0117] It should be understood that in this embodiment, the processor may be a central processing unit (CPU), or may be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), off-the-shelf field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.

[0118] The memory may include a read-only memory and a random access memory, and provides instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type.

[0119] During implementation, each step of the above method may be completed by an integrated logic circuit of hardware in a processor or by instructions in the form of software.

[0120] The method in Example 1 can be directly implemented as being executed by a hardware processor, or by a combination of hardware and software modules within the processor. The software module can be located in a storage medium well-established in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. The storage medium is located in the memory, and the processor reads the information in the memory and, in conjunction with its hardware, completes the steps of the above method. To avoid repetition, a detailed description is not given here.

[0121] Those skilled in the art will appreciate that the units and algorithm steps of the various examples described in conjunction with this embodiment can be implemented using electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.

[0122] Example 4

[0123] This embodiment further provides a computer-readable storage medium for storing computer instructions. When the computer instructions are executed by a processor, the method described in the first embodiment is performed.

[0124] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.

Claims

1. A policy document classification method that integrates metadata and label correlation, characterized by: include: Obtain policy documents to be classified; Pre-process the policy documents to be classified; Based on the text and metadata of the policy documents to be classified, a text-metadata hypergraph is constructed; Based on the labels of the policy documents to be classified, a label correlation hypergraph is constructed; The titles of the policy documents to be classified are classified using the trained title classification model to obtain a first classification result; the text-metadata hypergraph is input into the trained first hypergraph neural network to output a first hypergraph feature representation; the label correlation hypergraph is input into the trained second hypergraph neural network to output a second hypergraph feature representation; Perform feature fusion on the first hypergraph feature representation and the second hypergraph feature representation to obtain a second classification result; Perform weighted summation of the first classification result and the second classification result to obtain the final classification result of the policy document to be classified; Based on the text and metadata of the policy document to be classified, a text-metadata hypergraph is constructed, which includes: Treat each word in the vocabulary of the policy text as a node in the hypergraph, treat each sentence as an edge, and connect all word nodes in the sentence in sequence to construct sequential hyperedges; Insert metadata to the end of the vocabulary, treat each type of metadata as an edge, connect all words of the current type of metadata, construct metadata hyperedges, and obtain the text-metadata hypergraph; The text-metadata hypergraph is represented as ;in is the incidence matrix of the text-metadata hypergraph, defined as: ; = is the feature matrix of the text-metadata hypergraph, and uses Glove word embedding to initialize each node feature. The vocabulary size after adding the corresponding metadata for a policy document, The number of sentences in the text plus the number of metadata types, is the dimension of the feature vector of each node, represents the i-th node in the hypergraph, represents the jth hyperedge in the hypergraph; Based on the labels of the policy documents to be classified, a label correlation hypergraph is constructed, which includes: Treat each label in the policy document as a node, and connect multiple label nodes that appear in different policy documents simultaneously with edges to obtain a label correlation hypergraph; The label correlation hypergraph is represented as ,in , is the association matrix of the label correlation hypergraph, = is the feature matrix of the label correlation hypergraph, and uses one-hot to initialize each node feature. c is the number of labels in the policy file, and multiple labels that appear simultaneously are defined as label groups. is the number of tag groups in the policy file; represents the i-th node in the hypergraph, represents the jth hyperedge in the hypergraph.

2. The policy document classification method integrating metadata and tag relevance as claimed in claim 1 is characterized in that: The trained title classification model, the trained first hypergraph neural network, and the trained second hypergraph neural network. The training process includes: Constructing a training set, wherein the training set is a policy document with known classification labels; Construct a policy document classification model, the policy document classification model includes three parallel branches: a first branch, a second branch, and a third branch. The first branch is a title classification model. The network structure of the title classification model includes: a BERT model and a linear classifier connected in sequence; the BERT model is used to input the policy title; the linear classifier outputs a first classification result; The second branch is a first hypergraph neural network and a pooling layer connected to each other, wherein the first hypergraph neural network is used to input the text-metadata hypergraph; the pooling layer is used to output the first hypergraph feature representation; The third branch is a second hypergraph neural network, which is used to input a label correlation hypergraph and output a second hypergraph feature representation. The output end of the pooling layer and the output end of the second hypergraph neural network are both connected to the input end of the feature fusion module. The feature fusion module fuses the first hypergraph features and the second hypergraph features to obtain a second classification result. The output of the linear classifier and the output of the feature fusion module are both connected to the input of the weighted sum module, and the output of the weighted sum module outputs the final classification result; The training set is input into the policy document classification model to train the model. When the total loss function value of the model no longer decreases, the training is stopped to obtain the trained policy document classification model, that is, the trained title classification model, the trained first hypergraph neural network and the trained second hypergraph neural network are obtained.

3. The policy document classification method integrating metadata and tag correlation as claimed in claim 2 is characterized in that: The total loss function of the model uses binary cross entropy loss. When the loss no longer decreases, training is stopped to obtain the trained model. The binary cross entropy loss formula is as follows: Where σ is the sigmoid activation function.

4. The policy document classification method integrating metadata and tag relevance according to claim 1, characterized in that: Input the text-metadata hypergraph into the trained first hypergraph neural network to output the first hypergraph feature representation, and input the label correlation hypergraph into the trained second hypergraph neural network to output the second hypergraph feature representation, specifically including: The text-metadata hypergraph association matrix and its characteristic matrix and multi-label correlation hypergraph association matrix and its characteristic matrix Input into the first hypergraph neural network and the second hypergraph neural network respectively, the formula is as follows: in, The text-metadata hypergraph representation is aggregating word node features and metadata node features onto sequential hyperedges and metadata hyperedges through a first hypergraph neural network, and then aggregating sequential hyperedge features and metadata hyperedge features onto word nodes and metadata nodes, so that the nodes of the text-metadata hypergraph after passing through the first hypergraph neural network are all sets of word representations corresponding to the metadata and metadata representations corresponding to the words; is the trainable parameter matrix, σ is the ReLU activation function, is the hyperedge weight matrix of the text-metadata hypergraph, and are the node degree matrix and hyperedge degree matrix of the text-metadata hypergraph respectively, and the calculation formula is as follows: The label correlation hypergraph represents that the label features are aggregated onto the label hyperedge through the second hypergraph neural network, and then the label hyperedge features are aggregated onto the label node, so that the label correlation hypergraph obtains both the node relationship within the label group and the group relationship between the label groups after passing through the second hypergraph neural network. is the trainable parameter matrix, σ is the ReLU activation function, is the hyperedge weight matrix of the label correlation hypergraph, and are the node degree matrix and hyperedge degree matrix of the label correlation hypergraph respectively, and the calculation formula is as follows: Use a pooling function that is the sum of mean pooling and max pooling: in, It is the final feature representation of a text-metadata hypergraph after the pooling function. The mean pooling function is used to average the features of words and metadata nodes, and the maximum pooling function is used to select the features of words and metadata that contribute most to the classification; the two are added together to fuse them into a complete information graph.

5. The policy document classification method integrating metadata and tag relevance as claimed in claim 1 is characterized in that: Perform feature fusion on the first hypergraph feature representation and the second hypergraph feature representation to obtain a second classification result; Obtain policy text-metadata features through the first hypergraph neural network and pooling operation And the second graph neural network obtains the policy label correlation features Then we start the dual hypergraph feature merging operation, so that each node in the graph has rich features of words, metadata and label correlation. The formula is as follows: in, is the merged dual hypergraph feature; The first classification result and the second classification result are weighted and summed to obtain the final classification result of the policy document to be classified, which specifically includes: By integrating the semantic information of policy document titles output by BERT and the dual hypergraph structure information output by the hypergraph neural network, and adjusting the classification features of the two outputs through dynamic weighting, the classification semantics of each policy document is made clearer. The formula is as follows: in, and is a dynamic weight used to adjust whether the final output focuses more on the semantic information of the policy title or the relationship between the dual hypergraph structures. and is the trainable parameter matrix, The sigmoid activation function ensures that the weights are between 0 and 1. The final prediction score for each label; It is the semantic feature representation of a policy document title after passing through Chinese BERT and linear classifier.

6. A policy document classification system integrating metadata and tag relevance, adopting a policy document classification method integrating metadata and tag relevance as claimed in any one of claims 1 to 5, characterized in that: include: An acquisition module is configured to: acquire a policy document to be classified; Pre-process the policy documents to be classified; A construction module is configured to: construct a text-metadata hypergraph based on the text and metadata of the policy document to be classified; Based on the labels of the policy documents to be classified, a label correlation hypergraph is constructed; The classification module is configured to: classify the title of the policy document to be classified using a trained title classification model to obtain a first classification result; input the text-metadata hypergraph into the trained first hypergraph neural network to output a first hypergraph feature representation; input the label correlation hypergraph into the trained second hypergraph neural network to output a second hypergraph feature representation; and perform feature fusion on the first hypergraph feature representation and the second hypergraph feature representation to obtain a second classification result; The output module is configured to perform weighted summation on the first classification result and the second classification result to obtain a final classification result of the policy document to be classified.

7. An electronic device, comprising: a memory for non-transitory storage of computer-readable instructions; as well as a processor for executing said computer-readable instructions, When the computer-readable instructions are executed by the processor, the method according to any one of claims 1 to 5 is executed.

8. A storage medium, characterized in that: Computer-readable instructions are non-transitory stored, wherein when the non-transitory computer-readable instructions are executed by a computer, the instructions of the method according to any one of claims 1 to 5 are executed.

Citation Information

Patent Citations

  • Text multi-label classification method and system based on attention mechanism and GCN

    CN112711953A

  • Paper classification method and system based on hypergraph neural network

    CN112862015A