Government affair text data classification processing system and method based on knowledge graph

By using knowledge graph technology in the classification and processing of government text data, identifying and dividing entities and building multi-level knowledge graphs, the shortcomings of the existing technology in capturing complex entity relationships and the importance of global entities are solved, and accurate classification and efficient storage management of government text data are realized.

CN119807420AActive Publication Date: 2025-04-11YOUQIAN SOFTLINK (BEIJING) INFORMATION TECH CO LTD

Patent Information

Application Number
CN202510288377.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-12
Publication Date
2025-04-11
Estimated Expiration
2045-03-12

AI Technical Summary

Technical Problem

Existing government text data classification processing methods are difficult to accurately evaluate and distinguish high and low key entities in the text, and they are inadequate in capturing the importance of complex entity relationships and global entities, which affects the accuracy of classification results.

Method used

The government text data classification and processing system based on knowledge graph is adopted to identify and divide entities through data acquisition and processing units, and the entity importance dual weight division algorithm is used to divide entities into high-key entities and low-key entities, and a multi-level transparent knowledge graph is constructed, and a depth graph convolutional graph construction algorithm and a cross-graph embedding alignment inference algorithm are used to construct graphs and relationship alignment.

Benefits of technology

It realizes the accurate assessment and distinction of entities in government text data, improves the accuracy of key entity recognition, can dynamically handle complex entity relationships, and provides accurate classification and efficient storage management of government text data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119807420A_ABST
    Figure CN119807420A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data classification processing, in particular to a government affair text data classification processing system and method based on a knowledge graph, and the method comprises the steps: a data collection processing unit collects and cleans government affair text data, and divides a key entity into a high key entity and a low key entity by using an entity importance dual weight division algorithm; the first-level knowledge graph unit constructs a first-level government affair knowledge graph by using a depth map convolution graph construction algorithm based on the high-critical entities and the high-critical entity relationship; the second-level knowledge graph unit constructs a plurality of second-level government affair knowledge graphs by using a cross-graph embedding alignment reasoning algorithm based on the low-key entities and the low-key entity relationship; and the horizontal and vertical classification query unit is used for data query. According to the government affair text data classification processing system and method based on the knowledge graph, dynamic storage processing and cross-graph transverse and longitudinal query are carried out on complex government affair text data by constructing a multi-level knowledge graph and applying a cross-graph embedding alignment reasoning algorithm.
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 classification and processing, and in particular, to a system and method for classifying and processing government text data based on a knowledge graph. Background Art

[0002] The government text data classification and processing system and method based on knowledge graph aims to improve the accuracy of government text data classification and enhance the flexibility and efficiency of the system in processing complex government information. By combining the dual weight division algorithm of entity importance and the cross-graph embedding alignment reasoning algorithm, a multi-level transparent knowledge graph is constructed to control the accurate identification of high and low key entities and the relationship alignment between graphs, so as to realize the precise horizontal and vertical classification and efficient storage management of multi-level and multi-dimensional government text data.

[0003] Existing government text data classification and processing methods usually find it difficult to accurately evaluate and distinguish high and low critical entities in the text. In addition, due to the objective reasons that government text data has complex and dynamic entity relationships and contextual information, traditional methods are insufficient in capturing the importance of complex relationships and global entities, which in turn affects the accuracy of classification results. Therefore, a government text data classification and processing system and method based on knowledge graph is provided. Summary of the invention

[0004] The purpose of the present invention is to provide a government text data classification and processing system and method based on a knowledge graph, so as to solve the problem raised in the above background technology that due to the objective reasons that government text data has complex and dynamic entity relationships and contextual information, traditional methods are insufficient in capturing the importance of complex relationships and global entities, thereby affecting the accuracy of classification results.

[0005] To achieve the above-mentioned object, the present invention aims to provide a government text data classification processing system based on knowledge graph, comprising: a data acquisition processing unit, wherein the data acquisition processing unit acquires and cleans government text data, uses a named entity recognition model to identify entities in the government text data, and uses an entity importance dual weight division algorithm to divide key entities into high-key entities and low-key entities, and uses Stanford OpenIE technology to extract entity relationships; The entity importance dual weight division algorithm is implemented based on TF-IDF technology and PageRank algorithm technology, and is used to evaluate the criticality of entities in government text data and divide entities into high-criticality entities and low-criticality entities; It also includes a first-level knowledge graph unit, which uses a deep graph convolutional graph construction algorithm to construct a first-level government knowledge graph based on high-key entities and high-key entity relationships, and is used to store and manage high-key government data and their data relationships; It also includes a secondary knowledge graph unit, which is based on low-key entities and low-key entity relationships, takes the entity nodes of the primary government knowledge graph as the center, uses a cross-graph embedding alignment reasoning algorithm to construct multiple secondary government knowledge graphs, and calculates the correlation between two secondary government knowledge graphs, which are used to store and manage low-key government data and their data relationships; It also includes a horizontal and vertical classification query unit, which provides a query interface for performing horizontal and vertical data queries across nodes and graphs.

[0006] As a further improvement of the technical solution, the data acquisition and processing unit includes a data acquisition and cleaning module, an entity recognition and division module, and an entity relationship extraction module; The data collection and cleaning module is used to collect government text data from the data source and pre-process and clean the government text data; The entity recognition and division module uses a named entity recognition model to identify entities in government text data, and uses an entity importance dual weight division algorithm to divide key entities into high-key entities and low-key entities; The entity relationship extraction module uses Stanford OpenIE technology to extract entity relationships from text.

[0007] As a further improvement of the technical solution, the entity recognition and division module uses a named entity recognition model to identify entities in government text data, and uses an entity importance dual weight division algorithm to divide key entities into high-key entities and low-key entities. The specific method is as follows: S1.2.1. Use the named entity recognition model to identify entities in government text data and calculate the local importance weight and global importance weight of each entity: ; ; in, It is a collection of government text data; The amount of government text data; Indexing of government text data; is the i-th government text data; is a collection of entities; is the total number of entities; Index for the entity; is the jth entity; Calculate entity local weight: ; in, For Entity Local weight; Operate for TF-IDF technology; For Entity In government text data The number of times it appears in To contain entities The amount of government text data; Calculate the entity global weight: ; in, For Entity Global weight; is the damping coefficient; Index for the entity; is the kth entity; For Entity The out-degree of For Entity Global weight; S1.2.2. For each entity, calculate the comprehensive score of each entity based on the entity local weight and entity global weight: ; in, For Entity The comprehensive score of is the weighting coefficient of the entity local weight; S1.2.3. Based on the comprehensive score of each entity, each entity is divided into high-key entity and low-key entity: ; in, is the average comprehensive score of the entity; is the set of all entities; For entities ,like , then the entity is a high-key entity; otherwise, it is a low-key entity; Finally, we get a set of high-key entities: ; Low key entity collection: ; in, is the total number of high-key entities; Index for high-key entities; For the High-key entities; is the total number of low-key entities; Index for low-key entities; For the A low-key entity.

[0008] As a further improvement of this technical solution, the deep graph convolutional graph construction algorithm is implemented based on the dynamic graph convolutional network and the Louvain community discovery algorithm, and is used to construct a first-level government affairs knowledge graph; The first-level knowledge graph unit constructs a first-level government knowledge graph based on high-key entities and high-key entity relationships using a deep graph convolutional graph construction algorithm. The specific method steps are as follows: S2.1. Construct an initial first-level knowledge graph based on high-key entity sets and high-key entity relationships; S2.2. Based on the initial level 1 knowledge graph, dynamic weights and time decay factors are introduced to construct an improved adjacency matrix. The dynamic graph convolutional network is used to update the node embedding of each layer, and the node relationship is weighted through the improved adjacency matrix. S2.3, calculate node similarity based on node embedding of dynamic graph convolutional network, divide nodes into communities based on Louvain community discovery algorithm, optimize graph structure, calculate modularity of community division, and dynamically merge related communities based on node similarity; S2.4. Repeatedly iterate S2.2 and S2.3 until the modularity change is less than the predetermined threshold, and finally obtain the first-level government affairs knowledge graph.

[0009] As a further improvement of the technical solution, in S2.1, an initial first-level knowledge graph is constructed according to a set of high-key entities and high-key entity relationships. The specific method is as follows: Group high-key entities Define a node set to set high-key entity relationships Defined as an edge set : ; in, is the edge set; is a set of high-key entity relationships; For the High-key entities; For the High-key entities; High key entity and high-key entities strength of relationship; Calculate the edge weight of each edge based on the comprehensive score of high-key entities: ; in, High key entity and high-key entities The edge weight of High key entity The comprehensive score of High key entity The comprehensive score of The set of edge weights between all high-key entities is ; Generate the initial first-level knowledge graph: ; in, is the initial level one knowledge graph; In S2.2, based on the initial level 1 knowledge graph, dynamic weights and time decay factors are introduced to construct an improved adjacency matrix, and each layer of node embedding is updated using a dynamic graph convolutional network. The node relationship is weighted by the improved adjacency matrix. The specific steps are as follows: The adjacency matrix of the initial level knowledge graph is defined as , and the adjacency matrix Elements in ; Introducing the time decay factor Improved adjacency matrix : ; in, is the improved adjacency matrix; is the time decay factor; is the current time; High key entity and high-key entities Relationship Strength The time of last update; Based on the improved adjacency matrix , using a dynamic graph convolutional network to update each layer of node embedding: ; in, For the Node embedding of layers; is the ReLU activation function; is the degree matrix of the improved adjacency matrix; For the Node embedding of layers; is the learnable parameter matrix.

[0010] As a further improvement of the technical solution, in S2.3, node similarity is calculated based on node embedding of a dynamic graph convolutional network, and nodes are divided into communities based on the Louvain community discovery algorithm, the graph structure is optimized, the modularity of the community division is calculated, and related communities are dynamically merged according to the node similarity. The specific method steps are as follows: Calculate high-key entities and high-key entities Node similarity: ; in, High key entity and high-key entities Node similarity of It is the final layer of the convolutional layer of the dynamic graph convolutional network; High key entities The node embedding of the final layer L; High key entities The node embedding of the final layer L; Based on the Louvain community discovery algorithm, the nodes are divided into communities, the graph structure is optimized, and the modularity of the community division is calculated: ; ; in, is modularity; is the sum of the edge weights of the initial first-level knowledge graph; is the expected connection strength; High key entity The community where you live; High key entity The community where you live; is the Kronecker delta function; Setting the merge threshold If two communities and The similarity satisfies the following equation: ; Merge the two communities and for a separate community; in, is the merge threshold; For community a; for community b; In S2.4, S2.2 and S2.3 are repeatedly iterated until the modularity change is less than a predetermined threshold, and finally a first-level government affairs knowledge graph is obtained. .

[0011] As a further improvement of this technical solution, the cross-graph embedding alignment reasoning algorithm is implemented based on knowledge graph embedding technology and cross-graph alignment technology, and is used to construct multiple secondary government knowledge graphs and align reasoning entities and entity relationships; The secondary knowledge graph unit includes a secondary graph construction module and a secondary graph optimization module; The secondary graph construction module is based on low-key entities and low-key entity relationships, takes the entity nodes of the primary government knowledge graph as the center, and uses a cross-graph embedding alignment reasoning algorithm to construct multiple secondary government knowledge graphs; The secondary graph optimization module calculates the correlation between two secondary government knowledge graphs to eliminate redundant secondary government knowledge graphs.

[0012] As a further improvement of this technical solution, the secondary graph construction module is based on low-key entities and low-key entity relationships, takes the entity nodes of the primary government knowledge graph as the center, and uses a cross-graph embedding alignment reasoning algorithm to construct multiple secondary government knowledge graphs. The specific method steps are as follows: S3.1.1. First-level government knowledge graph With each high-key entity node as the center, construct the initial secondary government knowledge graph: For high-critical entity nodes , will be associated with high-key entity nodes The related low-key entity definition set is the low-key entity node set , the low-key entity relationship set Defined as a set of low-key entity edges ; in, Index for high-key entities; , indicating that the entity nodes with high key A collection of related low-key entities; , which represents the relationship between low-key entities; Calculate the edge weight of each edge based on the combined score of the low-key entities: ; in, , Both are related to high-key entity nodes Related low-key entity indexes; For low critical entities and low critical entities The edge weight of For low critical entities The comprehensive score of For low critical entities The comprehensive score of All entity nodes with high key The set of edge weights between related low-key entities is ; Generate high-key entity nodes The initial secondary knowledge graph of: ; in, is the initial secondary knowledge graph; S3.1.2. Use the node embedding of the primary government knowledge graph to guide the semantic alignment of the initial secondary knowledge graph: Get high-key entity nodes from the first-level government knowledge graph The embedding vector of the aligned high-key entity node is calculated by defining the projection matrix: ; in, High key entity nodes after alignment The embedding vector of is the embedding vector of high-key entity nodes; is the projection matrix; Defining low-key entities in the initial secondary knowledge graph The initial embedding vector of ; In the initial secondary knowledge graph, the attention weight of each low-key entity and its corresponding high-key entity node in the primary government knowledge graph is calculated based on the initial embedding vector of the low-key entity: ; in, Low-key entity node Nodes with high criticality The attention weight of is the cosine similarity; Based on the embedding vector and attention weight of the aligned high-key entity node, the initial embedding vector of the low-key entity is aligned with the aligned high-key entity node, and the aligned embedding vector of the low-key entity is calculated: ; in, For low critical entities The aligned embedding vector of Lower key entities The aligned embedding vector is updated to the initial secondary knowledge graph to obtain the secondary government knowledge graph .

[0013] As a further improvement of the technical solution, the secondary graph optimization module calculates the correlation between two secondary government knowledge graphs to eliminate redundant secondary government knowledge graphs. The specific method steps are as follows: Calculate the correlation between two secondary government knowledge graphs: ; in, For high-key entity nodes The secondary government affairs knowledge graph built by the center; Index for high-key entities; , indicating that the entity nodes with high key A collection of related low-key entities; For high-key entity nodes The secondary government affairs knowledge graph built by the center; Secondary government knowledge graph and degree of relevance; Set the secondary graph merging threshold , determine whether the two secondary government knowledge graphs need to be merged, as follows: like , then the secondary government knowledge graph and Execute and merge into a secondary government knowledge graph .

[0014] On the other hand, the present invention provides a government text data classification processing method based on a knowledge graph, which is used in any one of the government text data classification processing systems based on a knowledge graph described above, and comprises the following steps: S10.1. Collect and clean government text data, use named entity recognition model to identify entities in government text data, and use entity importance dual weight partitioning algorithm to divide key entities into high key entities and low key entities, and use Stanford OpenIE technology to extract entity relationships; S10.2. Based on high-key entities and high-key entity relationships, a deep graph convolutional graph construction algorithm is used to construct a first-level government knowledge graph; S10.3. Based on low-key entities and low-key entity relationships, with the entity nodes of the first-level government knowledge graph as the center, use the cross-graph embedding alignment reasoning algorithm to construct multiple second-level government knowledge graphs, and calculate the correlation between two second-level government knowledge graphs; S10.4. Use the query interface to perform horizontal and vertical data queries across nodes and graphs.

[0015] Compared with the prior art, the present invention has the following beneficial effects: 1. In the government text data classification and processing system and method based on knowledge graph, the combination of the dual weight division algorithm based on entity importance and TF-IDF technology can accurately evaluate and distinguish the importance of entities in government text data. By dividing entities into high and low criticality, the accuracy of key entity recognition in government texts is effectively improved.

[0016] 2. In the government text data classification and processing system and method based on knowledge graph, by introducing the construction of multi-level knowledge graphs and cross-graph embedding alignment reasoning algorithms, hierarchical management of high and low key entities and dynamic relationship adjustment between multiple graphs are realized. Based on the high key entities of the primary knowledge graph and the low key entities of the secondary knowledge graph, the system can dynamically process the complex entity relationships in the government text data, and can provide on-demand classification of government text data and on-demand horizontal and vertical query and storage. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 It is the overall flow chart of the present invention; The meaning of each number in the figure is: 1. Data acquisition and processing unit; 11. Data acquisition and cleaning module; 12. Entity recognition and division module; 13. Entity relationship extraction module; 2. First-level knowledge graph unit; 3. Second-level knowledge graph unit; 31. Second-level graph construction module; 32. Second-level graph optimization module; 4. Horizontal and vertical classification query unit. DETAILED DESCRIPTION

[0018] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0019] Example 1: Please refer to Figure 1 As shown, a government text data classification processing system based on knowledge graph is provided, including: A data collection and processing unit 1, wherein the data collection and processing unit 1 collects and cleans government text data, uses a named entity recognition model to identify entities in the government text data, and uses an entity importance dual weight partitioning algorithm to divide key entities into high-key entities and low-key entities, and uses Stanford OpenIE technology to extract entity relationships; The entity importance dual weight division algorithm is implemented based on TF-IDF technology and PageRank algorithm technology, and is used to evaluate the criticality of entities in government text data and divide entities into high-criticality entities and low-criticality entities; In this embodiment, the data acquisition and processing unit 1 includes a data acquisition and cleaning module 11, an entity recognition and division module 12, and an entity relationship extraction module 13; The data collection and cleaning module 11 is used to collect government text data from the data source and pre-process and clean the government text data; In this embodiment, government affair text data is collected from data sources, and the data sources include: government websites, government announcements / government affair press releases, government official documents, policy documents, government affair social media, news media news websites, and government databases, etc.; The preprocessing and cleaning of government affair text data are to ensure that the collected government affair text data can be effectively utilized in subsequent text analysis, entity recognition, relationship extraction, etc. Specifically as follows: Use an HTML parser to remove advertisements, irrelevant text, and HTML tags in the web page; unify the date formats in the text; unify different spelling formats: "government agency" and "government organ" are unified as "government agency"; use a Chinese word segmentation tool to segment the text, splitting long texts into independent words or phrases; use sentence segmentation technology to split long paragraphs into smaller sentences; Use a text similarity calculation method to identify and remove duplicate text content; filter out noise words and stop words, such as common words that are irrelevant to analysis like "de" (的), "shi" (是), "le" (了), etc.; The entity recognition and division module 12 uses a named entity recognition model to identify entities in the government affair text data, and uses an entity importance dual-weight division algorithm to divide key entities into high-key entities and low-key entities; In this embodiment, the named entity recognition model is based on BERT technology. The named entity recognition model belongs to an information extraction technology in the field of natural language processing, which is used for efficient entity recognition of government affair texts, accurately extracting key entities in the text. And due to its strong context understanding ability, it can correctly identify different types of entities in complex government affair texts. Taking the collected government affair text data as input and passing it into the named entity recognition model, the named entity recognition model will identify the named entities in the text and mark the categories of the entities according to the language structure and entity relationships learned during training. The recognized entities will be processed subsequently by the entity importance dual-weight division algorithm to determine which entities belong to high-key entities and which belong to low-key entities; government agencies, policy-related entities, etc. may be divided into high-key entities, while some relatively minor and auxiliary entities may be divided into low-key entities; The entity relationship extraction module 13 uses Stanford OpenIE technology to extract entity relationships from the text.

[0020] The entity recognition and division module 12 uses a named entity recognition model to identify entities in the government affair text data, and uses an entity importance dual-weight division algorithm to divide key entities into high-key entities and low-key entities. The specific method is as follows: S1.2.1. Use a named entity recognition model to identify entities in the government affair text data, and calculate the local importance weight and global importance weight of each entity: ; ; in, It is a collection of government text data; The amount of government text data; Indexing of government text data; is the i-th government text data; is a collection of entities; is the total number of entities; Index for the entity; is the jth entity; Calculate entity local weight: ; in, For Entity Local weight; Operate for TF-IDF technology; For Entity In government text data The number of times it appears in To contain entities The amount of government text data; Calculate the entity global weight: ; in, For Entity Global weight; is the damping coefficient; Index for the entity; is the kth entity; For Entity The out-degree of For Entity Global weight; S1.2.2. For each entity, calculate the comprehensive score of each entity based on the entity local weight and entity global weight: ; in, For Entity The comprehensive score of is the weighting coefficient of the entity local weight; S1.2.3. Based on the comprehensive score of each entity, each entity is divided into high-key entity and low-key entity: ; in, is the average comprehensive score of the entity; is the set of all entities; For entities ,like , then the entity is a high-key entity; otherwise, it is a low-key entity; Finally, we get a set of high-key entities: ; Low key entity collection: ; in, is the total number of high-key entities; Index for high-key entities; For the High-key entities; is the total number of low-key entities; Index for low-key entities; For the A low-key entity.

[0021] In this embodiment, a named entity recognition model is first used to identify entities in government text data. Next, an entity importance dual weight partitioning algorithm is used to calculate the local weight and global weight of each entity, and key entities are divided into high-key entities and low-key entities. TF-IDF is a commonly used weight calculation method in text data processing. TF represents the frequency of a word in a text, and IDF represents the rarity of the word in the entire document collection. The local weight of an entity can reflect the importance of the entity in a specific document. The TF-IDF method is used to calculate the local importance of each entity. PageRank calculates the global weight of entities by considering their relationships; The entity importance dual weight partitioning algorithm combines the calculation of local weights and global weights to fully explore the importance of entities in a single document and the entire knowledge graph. By calculating the comprehensive score of each entity and comparing it with the average score, it can divide entities into high-key entities and low-key entities.

[0022] It also includes a first-level knowledge graph unit 2, which uses a deep graph convolutional graph construction algorithm to construct a first-level government affairs knowledge graph based on high-key entities and high-key entity relationships, and is used to store and manage high-key government affairs data and their data relationships; The deep graph convolutional graph construction algorithm is implemented based on the dynamic graph convolutional network and the Louvain community discovery algorithm, and is used to construct a first-level government knowledge graph; In this embodiment, the first-level knowledge graph unit 2 constructs a first-level government knowledge graph based on high-key entities and high-key entity relationships using a deep graph convolutional graph construction algorithm. The specific method steps are as follows: S2.1. Construct an initial first-level knowledge graph based on high-key entity sets and high-key entity relationships; S2.2. Based on the initial level 1 knowledge graph, dynamic weights and time decay factors are introduced to construct an improved adjacency matrix. The dynamic graph convolutional network is used to update the node embedding of each layer, and the node relationship is weighted through the improved adjacency matrix. In this embodiment, dynamic weight means that when constructing a knowledge graph, the weights assigned to different entities or relationships change dynamically according to the actual situation. The dynamic weights will be adjusted with the time, occurrence of events, changes in policies or other external factors. For example, the importance of certain entities such as government departments and policy topics may change with changes in political decisions. At this time, the relative importance of the entities in the graph can be reflected by dynamically adjusting the weights; in a deep graph convolutional network, dynamic weights may involve real-time adjustment of the weights of each edge in the adjacency matrix, so that the connection relationship with high-weight entities is closer, helping the model focus on more important entities and their relationships; The time decay factor refers to a mechanism by which the influence of certain entities or relationships gradually weakens over time. For government text data, the impact of some policies or events is short-term, while the impact of some basic content such as long-term policies and legal provisions is long-lasting. The time decay factor can adjust the weight of an entity or relationship in the graph based on its historical information, ensuring that the graph can reflect the importance of time changes to entities and relationships. The common form of the time decay factor is exponential decay. As time increases, the decay factor makes older entities and relationships contribute less in the calculation. Based on the initial level knowledge graph, the introduction of dynamic weights and time decay factors enables the government knowledge graph to not only adapt to changes in entities and relationships, but also automatically adjust the weights of each entity according to time changes, thus avoiding graph distortion caused by outdated information. S2.3, calculate node similarity based on node embedding of dynamic graph convolutional network, divide nodes into communities based on Louvain community discovery algorithm, optimize graph structure, calculate modularity of community division, and dynamically merge related communities based on node similarity; In this embodiment, the dynamic graph convolutional network is a graph convolutional network model suitable for dynamically changing graph structures and time series data of dynamic graphs. Unlike traditional static graph convolutional networks, the dynamic graph convolutional network can handle dynamic changes in graph structures, such as the addition and deletion of nodes and edges, changes in weights, etc., and is suitable for introducing dynamic weights and time decay factors based on the initial first-level knowledge graph. The Louvain community detection algorithm is a community detection algorithm for graph structures. It aims to discover tightly connected subgraphs in a graph and determine community divisions by optimizing the modularity of the graph. The modularity measures the tightness of connections between nodes in the graph. The goal is to divide nodes into communities with high modularity as much as possible, thereby improving the similarity of nodes within the community. Modularity is an indicator of the quality of graph division. The higher the value, the more reasonable the community division. The Louvain community discovery algorithm optimizes modularity through a greedy algorithm and continuously merges nodes until the optimal modularity is reached. The deep graph convolutional graph construction algorithm combined with the dynamic graph convolutional network and the Louvain community discovery algorithm enables the government knowledge graph to adapt to temporal changes and optimize the graph structure through community discovery.

[0023] S2.4. Repeatedly iterate S2.2 and S2.3 until the modularity change is less than the predetermined threshold, and finally obtain the first-level government affairs knowledge graph.

[0024] In this embodiment, the first-level knowledge graph unit 2 constructs a centralized and dynamically updated knowledge graph through high-key entities and their relationships, which is used to store and manage the core entities and their relationships of government data, and generate a graph that can represent entities and entity relationships, which is subsequently used to support data query, relationship reasoning, information fusion and classification processing across entities. By constructing a first-level government knowledge graph, important entities in government texts such as government departments, policy clauses, key events, etc. and their relationships are structured into a graph form. The graph can not only effectively save data, but also be dynamically adjusted and updated according to the relationship between nodes.

[0025] In this embodiment S2.1, an initial first-level knowledge graph is constructed based on a set of high-key entities and high-key entity relationships. The specific method is as follows: Group high-key entities Define a node set to set high-key entity relationships Defined as an edge set : ; in, is the edge set; is a set of high-key entity relationships; For the High-key entities; For the High-key entities; High key entity and high-key entities strength of relationship; Calculate the edge weight of each edge based on the comprehensive score of high-key entities: ; in, High key entity and high-key entities The edge weight of High key entity The comprehensive score of High key entity The comprehensive score of The set of edge weights between all high-key entities is ; Generate the initial first-level knowledge graph: ; in, is the initial level one knowledge graph; In this embodiment S2.2, on the basis of the initial level one knowledge graph, dynamic weights and time decay factors are introduced to construct an improved adjacency matrix, and each layer of node embedding is updated using a dynamic graph convolutional network. The node relationship is weighted by the improved adjacency matrix. The specific method steps are as follows: The adjacency matrix of the initial level knowledge graph is defined as , and the adjacency matrix Elements in ; Introducing the time decay factor Improved adjacency matrix : ; in, is the improved adjacency matrix; is the time decay factor; is the current time; High key entity and high-key entities Relationship Strength The time of last update; Based on the improved adjacency matrix , using a dynamic graph convolutional network to update each layer of node embedding: ; in, For the Node embedding of layers; is the ReLU activation function; is the degree matrix of the improved adjacency matrix; For the Node embedding of layers; is the learnable parameter matrix.

[0026] In this embodiment S2.3, node similarity is calculated based on node embedding of a dynamic graph convolutional network, and nodes are divided into communities based on the Louvain community discovery algorithm, the graph structure is optimized, the modularity of the community division is calculated, and related communities are dynamically merged according to the node similarity. The specific method steps are as follows: Calculate high-key entities and high-key entities Node similarity: ; in, High key entity and high-key entities Node similarity of It is the final layer of the convolutional layer of the dynamic graph convolutional network; High key entities The node embedding of the final layer L; High key entities The node embedding of the final layer L; Based on the Louvain community discovery algorithm, the nodes are divided into communities, the graph structure is optimized, and the modularity of the community division is calculated: ; ; in, is modularity; is the sum of the edge weights of the initial first-level knowledge graph; is the expected connection strength; High key entity The community where you live; High key entity The community where you live; is the Kronecker delta function; Kronecker delta function The calculation logic is: and When they belong to the same community, the value is 1, otherwise it is 0; Setting the merge threshold If two communities and The similarity satisfies the following equation: ; Merge the two communities and for a separate community; in, is the merge threshold; For community a; for community b; In S2.4 of this embodiment, S2.2 and S2.3 are iterated repeatedly until the modularity change is less than the predetermined threshold, and finally a first-level government affairs knowledge graph is obtained. .

[0027] In this implementation, when the module The rate of change ΔQ is less than the set threshold When , the iteration stops and the final first-level government affairs knowledge graph is obtained .

[0028] It also includes a secondary knowledge graph unit 3, which is based on low-key entities and low-key entity relationships, takes the entity nodes of the primary government knowledge graph as the center, uses a cross-graph embedding alignment reasoning algorithm to construct multiple secondary government knowledge graphs, and calculates the correlation between two secondary government knowledge graphs, which are used to store and manage low-key government data and their data relationships; The cross-graph embedding alignment reasoning algorithm is implemented based on knowledge graph embedding technology and cross-graph alignment technology, and is used to construct multiple secondary government knowledge graphs and align reasoning entities and entity relationships; In this embodiment, the secondary knowledge graph unit 3 includes a secondary graph construction module 31 and a secondary graph optimization module 32; The secondary graph construction module 31 is based on low-key entities and low-key entity relationships, takes the entity nodes of the primary government knowledge graph as the center, and uses a cross-graph embedding alignment reasoning algorithm to construct multiple secondary government knowledge graphs; In this embodiment, low-key entities usually have less direct influence in government texts. By focusing on low-key entities and their relationships, the secondary graph can mine potential information from a wider context, thereby supplementing the main relationships between high-key entities and ensuring a more comprehensive knowledge graph. The relationships and interactions between low-key entities usually involve less conflict or competition, so more details can be provided for the graph. Taking the entity nodes of the primary knowledge graph as the center of constructing the secondary graph can ensure the contextual consistency of the secondary graph, avoid starting from a completely different graph structure, and maintain the integrity of the knowledge structure. The cross-graph embedding alignment inference algorithm can embed and map data from different graphs into the same space through cross-graph alignment, and can handle data differences between different graphs and establish connections in knowledge graphs at different levels. By taking the low-key entities and the relationship between low-key entities as the core of the secondary graph, while keeping the high-key entity nodes in the primary graph unchanged, it is possible to provide multi-level support for the classification and processing of government text data; the first and second levels of knowledge graphs at different levels respectively process and classify information at different levels; through the construction of multi-level graphs, government data can be classified more finely; the first-level graph provides an overview of high-key entities, and the second-level graph goes deep into the specific connections of low-key entities. The combination of the two can provide richer and more comprehensive feature information for the classification model.

[0029] The secondary graph optimization module 32 calculates the correlation between two secondary government knowledge graphs to eliminate redundant secondary government knowledge graphs.

[0030] In this embodiment, the secondary graph construction module 31 is based on low-key entities and low-key entity relationships, takes the entity nodes of the primary government knowledge graph as the center, and uses a cross-graph embedding alignment reasoning algorithm to construct multiple secondary government knowledge graphs. The specific method steps are as follows: S3.1.1. First-level government knowledge graph With each high-key entity node as the center, construct the initial secondary government knowledge graph: For high-critical entity nodes , will be associated with high-key entity nodes The related low-key entity definition set is the low-key entity node set , the low-key entity relationship set Defined as a set of low-key entity edges ; in, Index for high-key entities; , indicating that the entity nodes with high key A collection of related low-key entities; , which represents the relationship between low-key entities; Calculate the edge weight of each edge based on the combined score of the low-key entities: ; in, , Both are related to high-key entity nodes Related low-key entity indexes; For low critical entities and low critical entities The edge weight of For low critical entities The comprehensive score of For low critical entities The comprehensive score of All entity nodes with high key The set of edge weights between related low-key entities is ; Generate high-key entity nodes The initial secondary knowledge graph of: ; in, is the initial secondary knowledge graph; S3.1.2. Use the node embedding of the primary government knowledge graph to guide the semantic alignment of the initial secondary knowledge graph: Get high-key entity nodes from the first-level government knowledge graph The embedding vector of the aligned high-key entity node is calculated by defining the projection matrix: ; in, High key entity nodes after alignment The embedding vector of is the embedding vector of high-key entity nodes; is the projection matrix; In this embodiment, the projection matrix is ​​used to map the embedding vectors of high-key entity nodes in the primary government knowledge graph to the adapted semantic space in the secondary knowledge graph to achieve the goal of semantic alignment; the projection matrix P is a transformation matrix, which adjusts the dimension or structure of the embedding vector by multiplying it with the embedding vector of the high-key entity node so that it has a more appropriate representation in the semantic space of the secondary knowledge graph, thereby achieving semantic consistency between the primary and secondary knowledge graphs. Through the operation of the projection matrix P, the semantic features of the high-key entity nodes in the primary knowledge graph can be corresponded and mapped in the secondary knowledge graph, so that the node embeddings of the two knowledge graphs have good semantic compatibility; Defining low-key entities in the initial secondary knowledge graph The initial embedding vector of ; In the initial secondary knowledge graph, the attention weight of each low-key entity and its corresponding high-key entity node in the primary government knowledge graph is calculated based on the initial embedding vector of the low-key entity: ; in, Low-key entity node Nodes with high criticality The attention weight of is the cosine similarity; Based on the embedding vector and attention weight of the aligned high-key entity node, the initial embedding vector of the low-key entity is aligned with the aligned high-key entity node, and the aligned embedding vector of the low-key entity is calculated: ; in, For low critical entities The aligned embedding vector of Lower key entities The aligned embedding vector is updated to the initial secondary knowledge graph to obtain the secondary government knowledge graph .

[0031] In this embodiment, all secondary government affairs knowledge graphs centered on all nodes of the primary government affairs knowledge graph can be obtained in the same way according to the operating steps of the secondary graph construction module 31.

[0032] The secondary graph optimization module 32 calculates the correlation between two secondary government knowledge graphs to eliminate redundant secondary government knowledge graphs. The specific method steps are as follows: Calculate the correlation between two secondary government knowledge graphs: ; in, For high-key entity nodes The secondary government affairs knowledge graph built by the center; Index for high-key entities; , indicating that the entity nodes with high key A collection of related low-key entities; For high-key entity nodes The secondary government affairs knowledge graph built by the center; Secondary government knowledge graph and degree of relevance; Set the secondary graph merging threshold , determine whether the two secondary government knowledge graphs need to be merged, as follows: like , then the secondary government knowledge graph and Execute and merge into a secondary government knowledge graph .

[0033] It also includes a horizontal and vertical classification query unit 4, which provides a query interface for performing horizontal and vertical data queries across nodes and graphs. Example 2

[0034] A government text data classification processing method based on knowledge graph, used in any of the above-mentioned government text data classification processing systems based on knowledge graph, comprises the following steps: S10.1. Collect and clean government text data, use named entity recognition model to identify entities in government text data, and use entity importance dual weight partitioning algorithm to divide key entities into high key entities and low key entities, and use Stanford OpenIE technology to extract entity relationships; S10.2. Based on high-key entities and high-key entity relationships, a deep graph convolutional graph construction algorithm is used to construct a first-level government knowledge graph; S10.3. Based on low-key entities and low-key entity relationships, with the entity nodes of the first-level government knowledge graph as the center, use the cross-graph embedding alignment reasoning algorithm to construct multiple second-level government knowledge graphs, and calculate the correlation between two second-level government knowledge graphs; S10.4, use the query interface to perform horizontal and vertical data queries across nodes and graphs. The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments, and the above embodiments and descriptions are only preferred examples of the present invention and are not intended to limit the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, and these changes and improvements fall within the scope of the present invention to be protected.

Claims

1. The government text data classification processing system based on knowledge graph is characterized by: include: A data collection and processing unit (1), wherein the data collection and processing unit (1) collects and cleans government text data, identifies entities in the government text data using a named entity recognition model, divides key entities into high-key entities and low-key entities using an entity importance dual-weight division algorithm, and extracts entity relationships using Stanford OpenIE technology; The entity importance dual weight division algorithm is implemented based on TF-IDF technology and PageRank algorithm technology, and is used to evaluate the criticality of entities in government text data and divide entities into high-criticality entities and low-criticality entities; A first-level knowledge graph unit (2), wherein the first-level knowledge graph unit (2) constructs a first-level government affairs knowledge graph based on high-key entities and high-key entity relationships using a deep graph convolutional graph construction algorithm, and is used to store and manage high-key government affairs data and their data relationships; A secondary knowledge graph unit (3), wherein the secondary knowledge graph unit (3) is based on low-key entities and low-key entity relationships, takes the entity nodes of the primary government knowledge graph as the center, uses a cross-graph embedding alignment reasoning algorithm to construct multiple secondary government knowledge graphs, and calculates the correlation between two secondary government knowledge graphs, so as to store and manage low-key government data and their data relationships; A horizontal and vertical classification query unit (4), wherein the horizontal and vertical classification query unit (4) provides a query interface for performing horizontal and vertical data queries across nodes and graphs.

2. The government text data classification processing system based on knowledge graph according to claim 1 is characterized by: The data acquisition and processing unit (1) comprises a data acquisition and cleaning module (11), an entity recognition and division module (12) and an entity relationship extraction module (13); The data collection and cleaning module (11) is used to collect government text data from a data source, and to pre-process and clean the government text data; The entity recognition and classification module (12) uses a named entity recognition model to recognize entities in government text data, and uses an entity importance dual weight classification algorithm to classify key entities into high-key entities and low-key entities; The entity relationship extraction module (13) uses Stanford OpenIE technology to extract entity relationships from text.

3. The government text data classification processing system based on knowledge graph according to claim 2 is characterized by: The entity recognition and classification module (12) uses a named entity recognition model to recognize entities in government text data, and uses an entity importance dual weight classification algorithm to classify key entities into high-key entities and low-key entities. The specific method is as follows: S1.2.

1. Use the named entity recognition model to identify entities in government text data and calculate the local importance weight and global importance weight of each entity: ; ; in, It is a collection of government text data; The amount of government text data; Indexing of government text data; For the Government text data; is a collection of entities; is the total number of entities; Index for the entity; is the jth entity; Calculate entity local weight: ; in, For Entity Local weight; Operate for TF-IDF technology; For Entity In government text data The number of times it appears in To contain entities The amount of government text data; Calculate the entity global weight: ; in, For Entity Global weight; is the damping coefficient; Index for the entity; is the kth entity; For Entity The out-degree of For Entity Global weight; S1.2.

2. For each entity, calculate the comprehensive score of each entity based on the entity local weight and entity global weight: ; in, For Entity The comprehensive score of is the weighting coefficient of the entity local weight; S1.2.

3. Based on the comprehensive score of each entity, each entity is divided into high-key entity and low-key entity: ; in, is the average comprehensive score of the entity; is the set of all entities; For entities ,like , then the entity is a high-key entity; otherwise, it is a low-key entity; Finally, we get a set of high-key entities: ; Low key entity collection: ; in, is the total number of high-key entities; Index for high-key entities; For the High-key entities; is the total number of low-key entities; Index for low-key entities; For the A low-key entity.

4. The government text data classification processing system based on knowledge graph according to claim 3 is characterized by: The deep graph convolutional graph construction algorithm is implemented based on the dynamic graph convolutional network and the Louvain community discovery algorithm, and is used to construct a first-level government knowledge graph; The first-level knowledge graph unit (2) constructs a first-level government affairs knowledge graph based on high-key entities and high-key entity relationships using a deep graph convolutional graph construction algorithm. The specific method steps are as follows: S2.

1. Construct an initial first-level knowledge graph based on high-key entity sets and high-key entity relationships; S2.

2. Based on the initial level 1 knowledge graph, dynamic weights and time decay factors are introduced to construct an improved adjacency matrix. The dynamic graph convolutional network is used to update the node embedding of each layer, and the node relationship is weighted through the improved adjacency matrix. S2.3, calculate node similarity based on node embedding of dynamic graph convolutional network, divide nodes into communities based on Louvain community discovery algorithm, optimize graph structure, calculate modularity of community division, and dynamically merge related communities based on node similarity; S2.

4. Repeatedly iterate S2.2 and S2.3 until the modularity change is less than the predetermined threshold, and finally obtain the first-level government affairs knowledge graph.

5. The government text data classification processing system based on knowledge graph according to claim 4 is characterized by: In S2.1, an initial first-level knowledge graph is constructed based on a set of high-key entities and high-key entity relationships. The specific method is as follows: Group high-key entities Define a node set to set high-key entity relationships Defined as an edge set : ; in, is the edge set; is a set of high-key entity relationships; For the High-key entities; For the High-key entities; High key entity and high-key entities The strength of the relationship; Calculate the edge weight of each edge based on the comprehensive score of high-key entities: ; in, High key entity and high-key entities The edge weight of High key entity The comprehensive score of High key entity The comprehensive score of The set of edge weights between all high-key entities is ; Generate the initial level 1 knowledge graph: ; in, is the initial level one knowledge graph; In S2.2, based on the initial level 1 knowledge graph, dynamic weights and time decay factors are introduced to construct an improved adjacency matrix, and each layer of node embedding is updated using a dynamic graph convolutional network. The node relationship is weighted by the improved adjacency matrix. The specific steps are as follows: The adjacency matrix of the initial level knowledge graph is defined as , and the adjacency matrix Elements in ; Introducing the time decay factor Improved adjacency matrix : ; in, is the improved adjacency matrix; is the time decay factor; is the current time; High key entity and high-key entities Relationship Strength The last update time of Based on the improved adjacency matrix , using a dynamic graph convolutional network to update each layer of node embedding: ; in, For the Node embedding of layers; is the ReLU activation function; is the degree matrix of the improved adjacency matrix; For the Node embedding of layers; is the learnable parameter matrix.

6. The government text data classification processing system based on knowledge graph according to claim 5 is characterized by: In S2.3, node similarity is calculated based on node embedding of a dynamic graph convolutional network, and nodes are divided into communities based on the Louvain community discovery algorithm, the graph structure is optimized, the modularity of the community division is calculated, and related communities are dynamically merged according to the node similarity. The specific method steps are as follows: Calculate high-key entities and high-key entities Node similarity: ; in, High key entity and high-key entities Node similarity of It is the final layer of the convolutional layer of the dynamic graph convolutional network; High key entities The node embedding of the final layer L; High key entities The node embedding of the final layer L; Based on the Louvain community discovery algorithm, the nodes are divided into communities, the graph structure is optimized, and the modularity of the community division is calculated: ; ; in, is modularity; is the sum of the edge weights of the initial first-level knowledge graph; is the expected connection strength; High key entity The community where you live; High key entity The community where you live; is the Kronecker delta function; Setting the merge threshold If two communities and The similarity satisfies the following equation: ; Merge the two communities and for a separate community; in, is the merge threshold; For community a; for community b; In S2.4, S2.2 and S2.3 are repeatedly iterated until the modularity change is less than a predetermined threshold, and finally a first-level government affairs knowledge graph is obtained. .

7. The government text data classification processing system based on knowledge graph according to claim 6 is characterized by: The secondary knowledge graph unit (3) includes a secondary graph construction module (31) and a secondary graph optimization module (32); The secondary graph construction module (31) is based on low-key entities and low-key entity relationships, takes the entity nodes of the primary government knowledge graph as the center, and uses a cross-graph embedding alignment reasoning algorithm to construct multiple secondary government knowledge graphs; The secondary graph optimization module (32) calculates the correlation between two secondary government knowledge graphs to eliminate redundant secondary government knowledge graphs.

8. The government text data classification processing system based on knowledge graph according to claim 7 is characterized by: The secondary graph construction module (31) is based on low-key entities and low-key entity relationships, takes the entity nodes of the primary government knowledge graph as the center, and uses a cross-graph embedding alignment reasoning algorithm to construct multiple secondary government knowledge graphs. The specific method steps are as follows: S3.1.

1. First-level government knowledge graph With each high-key entity node as the center, construct the initial secondary government knowledge graph: For high-critical entity nodes , will be associated with high-key entity nodes The related low-key entity definition set is the low-key entity node set , the low-key entity relationship set Defined as a set of low-key entity edges ; in, Index for high-key entities; , indicating that the entity nodes with high key A collection of related low-key entities; , which represents the relationship between low-key entities; Calculate the edge weight of each edge based on the combined score of the low-key entities: ; in, , Both are related to high-key entity nodes Related low-key entity indexes; For low critical entities and low critical entities The edge weight of For low critical entities The comprehensive score of For low critical entities The comprehensive score of All entity nodes with high key The set of edge weights between related low-key entities is ; Generate high-key entity nodes The initial secondary knowledge graph of: ; in, is the initial secondary knowledge graph; S3.1.

2. Use the node embedding of the primary government knowledge graph to guide the semantic alignment of the initial secondary knowledge graph: Get high-key entity nodes from the first-level government knowledge graph The embedding vector of the aligned high-key entity node is calculated by defining the projection matrix: ; in, High key entity nodes after alignment The embedding vector of is the embedding vector of high-key entity nodes; is the projection matrix; Defining low-key entities in the initial secondary knowledge graph The initial embedding vector of ; In the initial secondary knowledge graph, the attention weight of each low-key entity and its corresponding high-key entity node in the primary government knowledge graph is calculated based on the initial embedding vector of the low-key entity: ; in, Low-key entity node Nodes with high criticality The attention weight of is the cosine similarity; Based on the embedding vector and attention weight of the aligned high-key entity node, the initial embedding vector of the low-key entity is aligned with the aligned high-key entity node, and the aligned embedding vector of the low-key entity is calculated: ; in, For low critical entities The aligned embedding vector of Lower key entities The aligned embedding vector is updated to the initial secondary knowledge graph to obtain the secondary government knowledge graph .

9. The government text data classification processing system based on knowledge graph according to claim 8 is characterized by: The secondary graph optimization module (32) calculates the correlation between two secondary government knowledge graphs to eliminate redundant secondary government knowledge graphs. The specific method steps are as follows: Calculate the correlation between two secondary government knowledge graphs: ; in, For high-key entity nodes The secondary government affairs knowledge graph built by the center; Index for high-key entities; , indicating that the entity nodes with high key A collection of related low-key entities; For high-key entity nodes The secondary government affairs knowledge graph built by the center; Secondary government knowledge graph and degree of relevance; Set the secondary graph merging threshold , determine whether the two secondary government knowledge graphs need to be merged, as follows: like , then the secondary government knowledge graph and Execute and merge into a secondary government knowledge graph .

10. A government text data classification processing method based on knowledge graph, used in a government text data classification processing system based on knowledge graph as claimed in any one of claims 1 to 9, characterized in that: The steps include: S10.

1. Collect and clean government text data, use named entity recognition model to identify entities in government text data, and use entity importance dual weight partitioning algorithm to divide key entities into high key entities and low key entities, and use Stanford OpenIE technology to extract entity relationships; S10.

2. Based on high-key entities and high-key entity relationships, a deep graph convolutional graph construction algorithm is used to construct a first-level government knowledge graph; S10.

3. Based on low-key entities and low-key entity relationships, with the entity nodes of the first-level government knowledge graph as the center, use the cross-graph embedding alignment reasoning algorithm to construct multiple second-level government knowledge graphs, and calculate the correlation between two second-level government knowledge graphs; S10.

4. Use the query interface to perform horizontal and vertical data queries across nodes and graphs.

Citation Information

Patent Citations

  • Data processing method and device based on knowledge graph and computer equipment

    CN111061859A

  • Knowledge graph construction method and system for online education classroom teaching resources

    CN112069327A

  • Knowledge graph construction method and system, information processing system, terminal and medium

    CN112966057A

  • Domain knowledge graph updating method and system based on power grid equipment

    CN117574898A

  • Knowledge graph and rule constraint combined data intelligent analysis method and system

    CN118606440A

Cited By

  • Government affair intelligent management system based on knowledge graph

    CN120764978A