A structured data classification method and device based on knowledge graph

Through knowledge graph technology, entity information and relationships in structured data in public domain are extracted, topic categories are automatically identified and appropriate classification models are selected, which solves the problem of low accuracy in public data classification and realizes efficient classification and intelligent management of data.

CN118964623BActive Publication Date: 2024-12-27CETC BIGDATA RES INST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411433653.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-15
Publication Date
2024-12-27
Estimated Expiration
2044-10-15

AI Technical Summary

Technical Problem

The classification accuracy of structured library table data in the public domain is low. In the existing technology, there are few label data and many data crossovers, which cannot effectively support data sharing, and the classification standards are not unified.

Method used

Using a structured data classification method based on knowledge graph, by obtaining the core vocabulary library of the public domain, using word segmentation models to extract entity information, construct knowledge graphs, automatically identify subject word categories, and select suitable classification models (such as KG-BERT, KG-STopic , TF-IDF) to classify data.

Benefits of technology

It improves the classification accuracy and efficiency of structured data in the public domain, realizes the intelligent organization, management and utilization of data, and improves the basis of data sharing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118964623B_ABST
    Figure CN118964623B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a method and device for classifying structured data based on a knowledge graph, which can improve the classification accuracy of structured database table data in the public domain. The method of the embodiment of the present application includes: obtaining a core vocabulary library in the public domain; extracting entity information from the core vocabulary library in the public domain using a word segmentation model to obtain multiple entities and relationship information between the multiple entities; constructing a knowledge graph based on the multiple entities and the relationship information; inputting the data to be classified into the word segmentation model to obtain a first word segmentation result, wherein the data to be classified is data in a structured database table; inputting the first word segmentation result into the knowledge graph to obtain a subject word category; determining a classification model based on the subject word category; inputting the first word segmentation result into the classification model to obtain a classification result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of government service technology, and in particular, to a method and device for classifying structured data based on a knowledge graph. Background Art

[0002] The open sharing of public data resources is the key to the vigorous development of the big data industry. A sound data classification system is the foundation for the open sharing of public data. At present, many regions are facing the problem that the public data classification system is not perfect, the classification standards are not unified, and they cannot effectively support data sharing. In the existing technology, the characteristics of structured database data in the public domain are that there are few labeled data and many data intersections. When such data is processed by traditional text classification models and deep learning models, the classification accuracy is very low. Summary of the invention

[0003] The embodiments of the present application provide a method and device for classifying structured data based on a knowledge graph, which can improve the classification accuracy of structured library table data in the public domain.

[0004] The first aspect of the embodiment of the present application provides a structured data classification method based on a knowledge graph, including:

[0005] Access to core public domain vocabulary;

[0006] Using a word segmentation model to extract entity information from the public domain core vocabulary library, and obtaining multiple entities and relationship information between the multiple entities;

[0007] Construct a knowledge graph according to the multiple entities and the relationship information;

[0008] Inputting the data to be classified into the word segmentation model to obtain a first word segmentation result, wherein the data to be classified is data in a structured database table;

[0009] Inputting the first word segmentation result into the knowledge graph to obtain a subject word category;

[0010] Determine a classification model according to the subject word category;

[0011] The first word segmentation result is input into the classification model to obtain a classification result.

[0012] Optionally, the keyword categories include single topic, multiple topics and no topic.

[0013] Optionally, determining a classification model according to the subject word category includes:

[0014] When the subject word category is characterized as no subject, determining that the corresponding classification model is a KG-BERT model;

[0015] When the subject word category is characterized as a single topic, determining the corresponding classification model as a KG-STopic model;

[0016] When the subject word category is characterized as multiple topics, the corresponding classification model is determined to be a TF-IDF model.

[0017] Optionally, before determining the classification model according to the subject word category, the method further includes:

[0018] The original data set is processed by using the word segmentation model and the knowledge graph to obtain a first data set, wherein the first data set only includes data characterized as a single topic by a subject word category;

[0019] Correcting the first data set by using a common data matching rule to obtain a second data set;

[0020] Using the knowledge graph and the LDA model to perform data expansion on the first data set to obtain a third data set;

[0021] combining the second data set and the third data set into a fourth data set;

[0022] The pre-trained BERT model is iteratively trained using the fourth data set, and when the training completion condition is met, a KG-BERT model is obtained.

[0023] Optionally, the step of performing data expansion on the first data set using the knowledge graph and the LDA model to obtain a third data set includes:

[0024] Using the LDA model to perform topic distribution analysis on each piece of data in the first data set, and extracting the topic words with the highest probability;

[0025] Input the extracted subject words into the knowledge graph to match entities and associations related to the subject words;

[0026] When the subject words have an association relationship in the knowledge graph, replace or supplement the words in the first data set based on the related entities in the association relationship to generate expanded data;

[0027] The above steps are repeated until a preset expansion stop condition is reached to obtain an expanded third data set.

[0028] Optionally, if the subject word category is characterized as multiple topics, inputting the first word segmentation result into the classification model to obtain a classification result includes:

[0029] Inputting the first word segmentation result into the feature calculation module of the classification model to calculate the TF-IDF vector;

[0030] Performing singular value decomposition on the TF-IDF vector to obtain a reduced-dimensional vector;

[0031] Processing the reduced-dimensionality vector using a self-attention mechanism to obtain a global vector;

[0032] Performing weighted fusion on the dimension reduction vector and the global vector to obtain a fusion vector;

[0033] Processing the fusion vector using a random slice hash classifier to obtain a first classification result;

[0034] Processing the fusion vector using a self-organizing map classifier to obtain a second classification result;

[0035] A weighted vote is performed on the first classification result and the second classification result to obtain a classification result.

[0036] Optionally, the using a random slice hash classifier to process the fusion vector to obtain a first classification result includes:

[0037] Calculate the hash value corresponding to the fusion vector respectively through at least two hash tables of the random slice hash classifier;

[0038] Combine all hash values ​​according to the preset combination rules to obtain a combined hash value;

[0039] A first classification result is determined according to the combined hash value.

[0040] A second aspect of an embodiment of the present application provides a structured data classification device based on a knowledge graph, comprising:

[0041] An acquisition unit, used to acquire a core vocabulary of the public domain;

[0042] An extraction unit, configured to extract entity information from the public domain core vocabulary library using a word segmentation model to obtain multiple entities and relationship information between the multiple entities;

[0043] A construction unit, configured to construct a knowledge graph according to the plurality of entities and the relationship information;

[0044] A first input unit, used to input the data to be classified into the word segmentation model to obtain a first word segmentation result, wherein the data to be classified is data in a structured database table;

[0045] A second input unit is used to input the first word segmentation result into the knowledge graph to obtain a subject word category;

[0046] A determination unit, used to determine a classification model according to the subject word category;

[0047] The third input unit is used to input the first word segmentation result into the classification model to obtain a classification result.

[0048] Optionally, the determining unit is specifically configured to:

[0049] When the subject word category is characterized as no subject, determining that the corresponding classification model is a KG-BERT model;

[0050] When the subject word category is characterized as a single topic, determining the corresponding classification model as a KG-STopic model;

[0051] When the subject word category is characterized as multiple topics, the corresponding classification model is determined to be a TF-IDF model.

[0052] Optionally, the device further comprises:

[0053] A processing unit, configured to process the original data set using the word segmentation model and the knowledge graph to obtain a first data set, wherein the first data set only includes data characterized as a single topic by a subject word category;

[0054] A correction unit, configured to correct the first data set by using a common data matching rule to obtain a second data set;

[0055] An expansion unit, used to perform data expansion on the first data set using the knowledge graph and the LDA model to obtain a third data set;

[0056] a merging unit, configured to merge the second data set and the third data set into a fourth data set;

[0057] A training unit is used to iteratively train the pre-trained BERT model using the fourth data set, and obtain the KG-BERT model when the training completion condition is met.

[0058] Optionally, the expansion unit is specifically used for:

[0059] Using the LDA model to perform topic distribution analysis on each piece of data in the first data set, and extracting the topic words with the highest probability;

[0060] Input the extracted subject words into the knowledge graph to match entities and associations related to the subject words;

[0061] When the subject words have an association relationship in the knowledge graph, replace or supplement the words in the first data set based on the related entities in the association relationship to generate expanded data;

[0062] The above steps are repeated until a preset expansion stop condition is reached to obtain an expanded third data set.

[0063] Optionally, the third input unit includes:

[0064] A calculation module, used for inputting the first word segmentation result into the feature calculation module of the classification model to calculate the TF-IDF vector;

[0065] A decomposition module, used for performing singular value decomposition on the TF-IDF vector to obtain a reduced dimension vector;

[0066] A processing module, used for processing the reduced-dimensional vector using a self-attention mechanism to obtain a global vector;

[0067] A fusion module, used for performing weighted fusion on the dimension reduction vector and the global vector to obtain a fusion vector;

[0068] A first classification module, used for processing the fusion vector by using a random slice hash classifier to obtain a first classification result;

[0069] A second classification module, used for processing the fusion vector using a self-organizing map classifier to obtain a second classification result;

[0070] The voting module is used to perform weighted voting on the first classification result and the second classification result to obtain a classification result.

[0071] Optionally, the first classification module is specifically used for:

[0072] Calculate the hash value corresponding to the fusion vector respectively through at least two hash tables of the random slice hash classifier;

[0073] Combine all hash values ​​according to the preset combination rules to obtain a combined hash value;

[0074] A first classification result is determined according to the combined hash value.

[0075] A third aspect of the embodiments of the present application provides an electronic device, including:

[0076] Processor, memory, input-output unit, and bus;

[0077] The processor is connected to the memory, the input and output unit, and the bus;

[0078] A program is stored in the memory, and the processor calls the program to execute the method in the first aspect and any possible implementation manner of the first aspect.

[0079] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, on which a program is stored. When the program is executed on a computer, the computer executes the method in the first aspect and any possible implementation of the first aspect.

[0080] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:

[0081] The method provided in the embodiment of the present application, through the combination of word segmentation model and knowledge graph, the server can accurately extract entities and their relationships from structured data, build a rich knowledge graph, and apply the knowledge graph to data classification. Through this process, the server can automatically identify the subject category of the data and select a suitable classification model to ensure the accuracy and efficiency of the classification results. Ultimately, based on the multiple collaborations of knowledge graphs and classification models, the system can effectively process complex public data, improve the ability to organize, manage and utilize data, and realize intelligent data classification and reasoning. BRIEF DESCRIPTION OF THE DRAWINGS

[0082] Figure 1 This is a flow chart of an embodiment of a structured data classification method based on a knowledge graph in an embodiment of the present application;

[0083] Figure 2 A schematic diagram of a process for obtaining a trained KG-BERT model in an embodiment of the present application;

[0084] Figure 3 A schematic diagram of a process of performing data expansion on a first data set in an embodiment of the present application;

[0085] Figure 4 This is a flow chart of an embodiment of inputting the first word segmentation result into a classification model in the embodiment of the present application;

[0086] Figure 5 This is a flow chart of an embodiment of processing the fusion vector using a random slice hash classifier in an embodiment of the present application;

[0087] Figure 6 This is a schematic diagram of the structure of an embodiment of a structured data classification device based on a knowledge graph in an embodiment of the present application;

[0088] Figure 7 It is a schematic diagram of the structure of an embodiment of an electronic device in the embodiments of the present application. DETAILED DESCRIPTION

[0089] The embodiments of the present application provide a method and device for classifying structured data based on a knowledge graph, which are used to improve the classification accuracy of structured library table data in the public domain.

[0090] The method of the present application can be applied to a server, a terminal or other devices with logic processing capabilities, and the present application does not limit this. For the convenience of description, the following description is made by taking the execution subject as a server as an example.

[0091] The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0092] See also Figure 1 In the embodiment of the present application, an embodiment of the structured data classification method based on the knowledge graph includes:

[0093] 101. Obtain the core vocabulary of the public domain;

[0094] The server can crawl and organize core vocabulary from various open resources (such as academic databases, open data sets, etc.) through automated scripts or applications. The server systematically extracts important professional terms and common vocabulary through web crawlers or API requests. These vocabulary will be stored in a database or file system to form a comprehensive vocabulary library to ensure that key knowledge and information in a specific field are covered, providing a basis for subsequent text analysis and processing.

[0095] 102. Use the word segmentation model to extract entity information from the core vocabulary library in the public domain to obtain the relationship information between multiple entities and multiple entities;

[0096] The server will run a word segmentation model (such as Jieba or other natural language processing tools) to analyze the core vocabulary library obtained in step 101. The server will input the core vocabulary into the word segmentation model, perform word segmentation and entity recognition operations, and extract multiple entities (such as names, places, institutions, etc.) and their relationship information. The extracted entity and relationship information will be stored in a structured manner to facilitate the subsequent construction of the knowledge graph and data analysis.

[0097] The relationship between entities is a "contains" and "is contained" relationship. The server will set the associations between entities based on these relationships, thereby gradually building an entity network.

[0098] 103. Build a knowledge graph based on multiple entities and relationship information;

[0099] The server constructs a network of knowledge graphs based on the hierarchical relationships in the category table, extracting entities and their inclusion relationships. This graph shows the hierarchy and interrelationships between keywords in the public domain, ensuring that relevant topics can be accurately matched in the subsequent classification process.

[0100] 104. Input the data to be classified into the word segmentation model to obtain a first word segmentation result, where the data to be classified is data in a structured database table;

[0101] The server obtains the data to be classified from the structured database table and calls the word segmentation model for processing. The word segmentation model will segment the description or content in the database based on the previously built core vocabulary library and generate the word segmentation results.

[0102] Among them, the word segmentation model is a Chinese word segmentation model, which is used to segment Chinese texts without clear boundaries into independent words. Common methods include dictionary-based matching, statistical models, and machine learning methods. It can determine word boundaries based on word frequency, context, or pre-trained data. Dictionary-based word segmentation is simple and efficient; statistical models and machine learning models can identify complex contexts and new words through large-scale corpus training. For example, the jieba word segmentation model combines dictionary matching and hidden Markov model (HMM) for new word discovery; and Harbin Institute of Technology LTP is a word segmentation model based on deep learning that can handle complex contexts and perform semantic understanding. The word segmentation model in the embodiment of the present application can be either a dictionary-based match, a statistical model, or a machine learning model, and this application does not limit this.

[0103] 105. Input the first word segmentation result into the knowledge graph to obtain the subject word category;

[0104] The server matches the word segmentation results with the knowledge graph, and identifies the subject categories corresponding to these word segmentation results through the entities and hierarchical structures in the knowledge graph. The multi-hierarchical structure of the knowledge graph helps the server accurately locate the appropriate subject category.

[0105] Furthermore, the subject word category can include three categories: single subject, multiple subjects and no subject. Single subject means that the first segmentation result matches the same subject word in the knowledge graph, multiple subjects means that the first segmentation result matches multiple subject words in the knowledge graph, and no subject means that the first segmentation result does not match the subject word in the knowledge graph.

[0106] 106. Determine the classification model according to the subject word category;

[0107] The server selects the corresponding classification model based on the identified subject word categories. Different subject categories may require different classification algorithms, so the server will select the most suitable data classification model based on the recognition results.

[0108] 107. Input the first word segmentation result into the classification model to obtain a classification result.

[0109] The server inputs the word segmentation results into the classification model and performs classification processing based on the identified topic categories. Finally, the server generates the classification results and feeds them back to the system to complete the classification task of the data.

[0110] In this embodiment, through the combination of word segmentation model and knowledge graph, the server can accurately extract entities and their relationships from structured data, build a rich knowledge graph, and apply the knowledge graph to data classification. Through this process, the server can automatically identify the subject category of the data and select a suitable classification model to ensure the accuracy and efficiency of the classification results. Ultimately, based on the multiple collaborations of knowledge graphs and classification models, the system can effectively process complex public data, improve the ability to organize, manage and utilize data, and realize intelligent data classification and reasoning.

[0111] Furthermore, when the server determines the classification model according to the subject word category, it may specifically include:

[0112] When the subject word category is represented as no topic, the corresponding classification model is determined to be the KG-BERT model; when the subject word category is represented as a single topic, the corresponding classification model is determined to be the KG-STopic model; when the subject word category is represented as multiple topics, the corresponding classification model is determined to be the TF-IDF model.

[0113] Among them, the KG-STopic model is a single-topic text classification method that combines knowledge graphs with topic modeling. It uses the entity and relationship information in the knowledge graph to accurately identify key concepts related to a specific topic, thereby effectively classifying the text into the corresponding topic.

[0114] Among them, the TF-IDF model is a text classification technology that evaluates the importance of words in a text by calculating the term frequency (TF) and the inverse document frequency (IDF). It can identify keywords in multi-topic texts in order to accurately classify the texts, and is widely used in information retrieval and text analysis scenarios.

[0115] See also Figure 2 In some embodiments of the present application, before step 106 in the above embodiment determines the classification model according to the subject word category, the structured data classification method based on the knowledge graph may further include the following steps 201-205.

[0116] 201. Processing the original data set using the word segmentation model and the knowledge graph to obtain a first data set, wherein the first data set only includes data represented by a single topic in the subject word category;

[0117] The server extracts information from the original data set and processes the data using the word segmentation model and knowledge graph. First, the word segmentation model is responsible for breaking down the content in the data into words, and the knowledge graph helps the server identify the subject categories in the data. The server uses these two tools to filter out data belonging to a single subject and stores it as the first data set.

[0118] 202. Correct the first data set by using a public data matching rule to obtain a second data set;

[0119] The server modifies the first data set according to the preset public data matching rules. The matching rules may include detailed rule constraints in the fields of policies, regulations, etc. to ensure the accuracy of the data. The modified data is stored as the second data set.

[0120] The redress process may include correcting mismatches or inconsistencies in the data to ensure that all data complies with relevant standards and regulations in the public domain.

[0121] 203. Use the knowledge graph and the LDA model to perform data expansion on the first data set to obtain a third data set;

[0122] The server uses the knowledge graph and the LDA (Latent Dirichlet Allocation) model to expand the first dataset. The LDA model generates more relevant data through topic distribution, while the knowledge graph enriches the data content through entities and their associations. Through the combination of the two, the server generates a more diverse third dataset.

[0123] 204. Merge the second data set and the third data set into a fourth data set;

[0124] The server merges the second dataset (corrected single-topic data) with the third dataset (expanded data) to generate the fourth dataset. This step ensures that the data is both accurately corrected and contains rich extended information, providing a high-quality data foundation for subsequent model training.

[0125] 205. Perform iterative training on the pre-trained BERT model using the fourth data set, and obtain a KG-BERT model when the training completion condition is met.

[0126] The server uses the merged fourth dataset to further train the pre-trained BERT model. The BERT model uses natural language processing (NLP) technology to perform deep learning on text, and the server continuously optimizes the model through multiple rounds of iterative training. The training process will continue until the preset completion conditions are met, and finally the server generates a hybrid model based on the knowledge graph and BERT, namely the KG-BERT model.

[0127] In this example, multiple advanced natural language processing technologies and data expansion strategies are combined. The server ensures the accuracy, scalability and diversity of the data through automated means at each step, and finally trains a KG-BERT model with deep learning capabilities and combined with knowledge graphs. This model can classify, reason and predict more intelligently and efficiently when processing public domain data.

[0128] See also Figure 3 In some embodiments of the present application, step 203 in the above embodiment uses the knowledge graph and the LDA model to perform data expansion on the first data set to obtain a third data set, which may include the following steps 301-304:

[0129] 301. Perform topic distribution analysis on each piece of data in the first data set using an LDA model, and extract topic words with the highest probability;

[0130] The server uses the LDA (Latent Dirichlet Allocation) model to perform topic distribution analysis on each piece of data in the first data set. The LDA model performs topic probability analysis on the words in the data and generates a topic distribution corresponding to each piece of data. The server extracts the topic words with the highest probability from each piece of data, which represent the most relevant topics for the data. For example: If the topic distribution of a piece of data is 30% "policy", 40% "regulations", and 30% "budget", the server will extract the topic word "regulations" with the highest probability.

[0131] 302. Input the extracted subject words into the knowledge graph to match entities and associations related to the subject words;

[0132] The server will input the extracted keywords into the constructed knowledge graph for matching. The knowledge graph contains entities and their relationships. The server will find related entities and their relationships in the graph based on the keywords.

[0133] Matching process: The server finds the location of the subject term in the graph and identifies other entities (such as policies, projects, budgets, etc.) and relationships (such as inclusion, subordination, dependency, etc.) directly associated with the subject term.

[0134] 303. When the subject words have an association relationship in the knowledge graph, replace or supplement the words in the first data set based on the related entities in the association relationship to generate expanded data;

[0135] If the knowledge graph shows that there is an association between the subject word and other entities, the server will replace or supplement the relevant data in the first data set based on these associations. This operation will enrich the original data content and enhance the diversity and representativeness of the data. For example:

[0136] Word replacement: If the original data contains "regulations" and the knowledge graph shows that "regulations" are closely related to "policies", the server may replace "regulations" with "policies" to generate new data.

[0137] Supplement: The server may also add new entity information based on the association relationship in the graph, such as adding relevant "project funding" information after "budget".

[0138] 304. Repeat the above steps 301-303 until a preset expansion stop condition is reached to obtain an expanded third data set.

[0139] The server will loop through steps 301 to 303, continuing to expand the data until a preset expansion stop condition is reached. The expansion stop condition may be a specific number of expansions, a certain amount of expanded data, or the subject words and associated entities in the knowledge graph have reached a set coverage range. At this point, the server generates an expanded third data set, which is more diverse than the original data set and contains more associated information.

[0140] In this embodiment, the server performs topic distribution analysis through the LDA model, combines entities and associations in the knowledge graph, and continuously expands the first data set. This process enriches the information in the original data set and provides more diverse and hierarchical input data for subsequent model training.

[0141] See also Figure 4 In some embodiments of the present application, step 107 in the above embodiment inputs the first word segmentation result into the classification model to obtain the classification result, which may include the following steps 401-407:

[0142] 401. Input the first word segmentation result into a feature calculation module of a classification model to calculate a TF-IDF vector;

[0143] The server inputs the segmented results into the feature calculation module in the classification model. This module calculates the TF (term frequency) and IDF (inverse document frequency) of each word and generates a TF-IDF vector. This vector reflects the importance of each word in the entire data set and helps to highlight words with high discrimination in the classification.

[0144] 402. Perform singular value decomposition on the TF-IDF vector to obtain a dimension-reduced vector;

[0145] The server performs singular value decomposition (SVD) on the generated TF-IDF vector to reduce the high-dimensional TF-IDF vector to a lower dimension. Dimensionality reduction can reduce data redundancy, maintain key features of information, and improve computing efficiency. The reduced-dimensional vector will be used for subsequent processing.

[0146] 403. Use the self-attention mechanism to process the dimension reduction vector and obtain the global vector;

[0147] The server applies a self-attention mechanism to process the reduced vector. The self-attention mechanism can capture the global dependencies in the data, and the server generates a global vector through this process. The global vector contains important information in the data and takes into account the long-distance dependencies between different words.

[0148] 404. Perform weighted fusion on the dimension reduction vector and the global vector to obtain a fusion vector;

[0149] The server performs weighted fusion of the reduced dimension vector and the global vector. Weighted fusion is to combine local and global information to ensure that the model can capture both local features in the data and reflect the overall structure. Through appropriate weight distribution, the fused vector can better reflect the comprehensive characteristics of the data.

[0150] 405. Process the fusion vector using a random slice hash classifier to obtain a first classification result;

[0151] The server uses the Random Slice Hashing Classifier to classify the fused vector. The classifier divides the data into different slices through a hash function, and classifies each slice to finally generate the first classification result. The Random Slice Hashing Classifier can increase the speed of data processing while maintaining classification accuracy.

[0152] 406. Process the fusion vector using a self-organizing map classifier to obtain a second classification result;

[0153] The server then inputs the same fused vector into the Self-Organizing Map (SOM) classifier. SOM is an unsupervised learning model that classifies input vectors through self-organization, maps data into a two-dimensional space, and generates a second classification result. This model is good at processing the nonlinear structure of complex data.

[0154] 407. Perform weighted voting on the first classification result and the second classification result to obtain a classification result.

[0155] The server combines the results from the random slice hash classifier and the self-organizing map classifier through weighted voting. The server selects the final classification result based on the weight ratio of each classifier. Weighted voting can ensure the robustness of the results and comprehensively classify from the perspective of different models, thereby improving the overall accuracy.

[0156] In this embodiment, the server sequentially uses feature calculation, dimensionality reduction, self-attention mechanism, fusion, and a combination of multiple classification models. Through weighted fusion and weighted voting, the server can generate accurate classification results based on multi-level features. This method not only combines local and global features, but also improves the stability and accuracy of classification through the synergy of multiple classifiers.

[0157] See also Figure 5 In some embodiments of the present application, step 405 in the above embodiment, using a random slice hash classifier to process the fusion vector to obtain a first classification result, may include the following steps 501-503:

[0158] 501. Calculate hash values ​​corresponding to the fusion vector respectively through at least two hash tables of the random slice hash classifier;

[0159] The server processes the fused vector using multiple hash tables in the random slicing hash classifier. The random slicing hash classifier usually divides the data into different hash tables, each of which calculates the hash value of the input vector using a different hash function. The server uses at least two hash tables to ensure multi-perspective hash calculations on the fused vector.

[0160] The role of the hash table: Each hash table divides the data in a different way so that the input fusion vector obtains the corresponding hash value through its own hash function.

[0161] 502. Combining all hash values ​​according to a preset combination rule to obtain a combined hash value;

[0162] The server combines multiple hash values ​​obtained from different hash tables according to preset rules. The preset combination rules can be simple concatenation operations or more complex operations (such as weighted average, bitwise operations, etc.). Through these rules, the server generates a combined hash value, which can represent the overall performance of the fused vector in multiple hash tables.

[0163] Combination rule example: If two hash values ​​are H1 and H2, the server may directly concatenate them into a new hash value H1H2, or perform a weighted merger based on the rules to obtain the final combined hash value.

[0164] 503. Determine a first classification result according to the combined hash value.

[0165] The server uses the generated combined hash value to determine the first classification result. The combined hash value is actually a simplified feature representation. The server will match the hash value with the pre-trained hash value set in the classification model. The server will ultimately determine the classification result of the input data based on the degree of matching.

[0166] Classification process: The server maps the combined hash value to the known category label in the classifier. If the combined hash value is closest to the label of a certain category, the category is selected as the first classification result.

[0167] The server generates the first classification result by calculating multiple hash tables, merging hash values, and matching combined hash values. The random slice hash classifier ensures comprehensive analysis of data in different dimensions by slicing and hashing the input vector multiple times, thereby improving the accuracy of classification.

[0168] See also Figure 6 In the embodiment of the present application, an embodiment of a structured data classification device based on a knowledge graph includes:

[0169] An acquisition unit 601 is used to acquire a core vocabulary library in a public domain;

[0170] An extraction unit 602 is used to extract entity information from a core vocabulary of a public domain using a word segmentation model to obtain information about multiple entities and relationships between multiple entities;

[0171] A construction unit 603, used to construct a knowledge graph based on multiple entities and relationship information;

[0172] A first input unit 604 is used to input the data to be classified into a word segmentation model to obtain a first word segmentation result, wherein the data to be classified is data in a structured database table;

[0173] The second input unit 605 is used to input the first word segmentation result into the knowledge graph to obtain a subject word category;

[0174] A determination unit 606, configured to determine a classification model according to the subject word category;

[0175] The third input unit 607 is used to input the first word segmentation result into the classification model to obtain a classification result.

[0176] In this embodiment, through the combination of word segmentation model and knowledge graph, extraction unit 602 can accurately extract entities and their relationships from structured data, construction unit 603 constructs a rich knowledge graph, and applies the knowledge graph to data classification. Through this process, the server can automatically identify the subject category of the data and select a suitable classification model to ensure the accuracy and efficiency of the classification results. Ultimately, based on the multiple collaborations of knowledge graphs and classification models, the system can effectively process complex public data, improve the ability to organize, manage and utilize data, and realize intelligent data classification and reasoning.

[0177] Optionally, the determining unit 606 is specifically configured to:

[0178] When the topic word category is represented as no topic, the corresponding classification model is determined to be the KG-BERT model;

[0179] When the subject word category is represented as a single topic, the corresponding classification model is determined to be the KG-STopic model;

[0180] When the subject word category is represented as multiple topics, the corresponding classification model is determined to be the TF-IDF model.

[0181] Among them, the KG-STopic model is a single-topic text classification method that combines knowledge graphs with topic modeling. It uses the entity and relationship information in the knowledge graph to accurately identify key concepts related to a specific topic, thereby effectively classifying the text into the corresponding topic.

[0182] Among them, the TF-IDF model is a text classification technology that evaluates the importance of words in a text by calculating the term frequency (TF) and the inverse document frequency (IDF). It can identify keywords in multi-topic texts in order to accurately classify the texts, and is widely used in information retrieval and text analysis scenarios.

[0183] Optionally, the device further comprises:

[0184] A processing unit, configured to process the original data set using the word segmentation model and the knowledge graph to obtain a first data set, wherein the first data set only includes data characterized as a single topic by the subject word category;

[0185] A correction unit, used for correcting the first data set by using a common data matching rule to obtain a second data set;

[0186] An expansion unit, used to perform data expansion on the first data set using the knowledge graph and the LDA model to obtain a third data set;

[0187] a merging unit, used to merge the second data set and the third data set into a fourth data set;

[0188] The training unit is used to iteratively train the pre-trained BERT model using the fourth data set, and obtain the KG-BERT model when the training completion condition is met.

[0189] Optionally, the expansion unit is specifically used for:

[0190] Use the LDA model to perform topic distribution analysis on each piece of data in the first data set and extract the topic words with the highest probability;

[0191] Input the extracted keywords into the knowledge graph to match entities and relationships related to the keywords;

[0192] When the subject words have an association relationship in the knowledge graph, the first data set is replaced or supplemented based on the related entities in the association relationship to generate expanded data;

[0193] The above steps are repeated until a preset expansion stop condition is reached to obtain an expanded third data set.

[0194] Optionally, the third input unit 607 includes:

[0195] A calculation module, used for inputting the first word segmentation result into a feature calculation module of a classification model to calculate a TF-IDF vector;

[0196] Decomposition module, used to perform singular value decomposition on the TF-IDF vector to obtain a reduced-dimensional vector;

[0197] A processing module is used to process the reduced-dimensional vector using a self-attention mechanism to obtain a global vector;

[0198] A fusion module is used to perform weighted fusion on the reduced dimension vector and the global vector to obtain a fusion vector;

[0199] A first classification module, used for processing the fusion vector by using a random slice hash classifier to obtain a first classification result;

[0200] A second classification module is used to process the fusion vector using a self-organizing map classifier to obtain a second classification result;

[0201] The voting module is used to perform weighted voting on the first classification result and the second classification result to obtain a classification result.

[0202] Optionally, the first classification module is specifically used for:

[0203] Calculate hash values ​​corresponding to the fusion vectors respectively through at least two hash tables of the random slice hash classifier;

[0204] Combine all hash values ​​according to the preset combination rules to obtain a combined hash value;

[0205] A first classification result is determined according to the combined hash value.

[0206] In this implementation, the functions of each unit and module are the same as those described above. Figures 1 to 5 The steps in the illustrated embodiments correspond to each other and will not be described again here.

[0207] See also Figure 7 In the embodiments of the present application, an electronic device includes:

[0208] Processor 701, memory 702, input and output unit 703 and bus 704;

[0209] The processor 701 is connected to the memory 702, the input and output unit 703 and the bus 704;

[0210] The memory 702 stores a program, and the processor 701 calls the program to execute Figures 1 to 5 Steps in the illustrated embodiment.

[0211] In this embodiment, the function of the processor 701 is the same as that of the aforementioned Figures 1 to 5 The steps in the illustrated embodiments correspond to each other and will not be described again here.

[0212] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0213] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0214] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0215] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0216] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk and other media that can store program code.

Claims

1. A structured data classification method based on knowledge graph, characterized in that: include: Access to the core vocabulary of the government sector; Using a word segmentation model to extract entity information from the core vocabulary library in the government field, and obtaining multiple entities and relationship information between the multiple entities; Construct a knowledge graph according to the multiple entities and the relationship information; Inputting the data to be classified into the word segmentation model to obtain a first word segmentation result, wherein the data to be classified is data in a structured database table; Inputting the first word segmentation result into the knowledge graph to obtain a subject word category; Determine a classification model according to the subject word category; Inputting the first word segmentation result into the classification model to obtain a classification result; If the subject word category is characterized as multiple topics, the first word segmentation result is input into the classification model to obtain the classification result, including: Inputting the first word segmentation result into the feature calculation module of the classification model to calculate the TF-IDF vector; Performing singular value decomposition on the TF-IDF vector to obtain a reduced-dimensional vector; Processing the reduced-dimensionality vector using a self-attention mechanism to obtain a global vector; Performing weighted fusion on the dimension reduction vector and the global vector to obtain a fusion vector; Processing the fusion vector using a random slice hash classifier to obtain a first classification result; Processing the fusion vector using a self-organizing map classifier to obtain a second classification result; A weighted vote is performed on the first classification result and the second classification result to obtain a classification result.

2. The method according to claim 1, characterized in that The subject heading categories include single subject, multiple subjects and no subject.

3. The method according to claim 2, characterized in that Determining the classification model according to the subject word category includes: When the subject word category is characterized as no subject, determining that the corresponding classification model is a KG-BERT model; When the subject word category is characterized as a single topic, determining the corresponding classification model as a KG-STopic model; When the subject word category is characterized as multiple topics, the corresponding classification model is determined to be a TF-IDF model.

4. The method according to claim 3, characterized in that Before determining the classification model according to the subject word category, the method further includes: The original data set is processed by using the word segmentation model and the knowledge graph to obtain a first data set, wherein the first data set only includes data characterized as a single topic by a subject word category; Correcting the first data set by using government data matching rules to obtain a second data set; Using the knowledge graph and the LDA model to perform data expansion on the first data set to obtain a third data set; combining the second data set and the third data set into a fourth data set; The pre-trained BERT model is iteratively trained using the fourth data set, and when the training completion condition is met, a KG-BERT model is obtained.

5. The method according to claim 4, characterized in that The method of performing data expansion on the first data set by using the knowledge graph and the LDA model to obtain a third data set includes: Using the LDA model to perform topic distribution analysis on each piece of data in the first data set, and extracting the topic words with the highest probability; Input the extracted subject words into the knowledge graph to match entities and associations related to the subject words; When the subject words have an association relationship in the knowledge graph, replace or supplement the words in the first data set based on the related entities in the association relationship to generate expanded data; The above steps are repeated until a preset expansion stop condition is reached to obtain an expanded third data set.

6. The method according to claim 1, characterized in that The process of processing the fusion vector by using a random slice hash classifier to obtain a first classification result includes: Calculate the hash value corresponding to the fusion vector respectively through at least two hash tables of the random slice hash classifier; Combine all hash values ​​according to the preset combination rules to obtain a combined hash value; A first classification result is determined according to the combined hash value.

7. A structured data classification device based on knowledge graph, characterized in that: include: The acquisition unit is used to obtain the core vocabulary library in the government field; An extraction unit, used for extracting entity information from the government domain core vocabulary library using a word segmentation model to obtain multiple entities and relationship information between the multiple entities; A construction unit, configured to construct a knowledge graph according to the plurality of entities and the relationship information; A first input unit, used to input the data to be classified into the word segmentation model to obtain a first word segmentation result, wherein the data to be classified is data in a structured database table; A second input unit is used to input the first word segmentation result into the knowledge graph to obtain a subject word category; A determination unit, used to determine a classification model according to the subject word category; A third input unit, used to input the first word segmentation result into the classification model to obtain a classification result; The third input unit comprises: A calculation module, used for inputting the first word segmentation result into the feature calculation module of the classification model to calculate the TF-IDF vector; A decomposition module, used for performing singular value decomposition on the TF-IDF vector to obtain a reduced dimension vector; A processing module, used for processing the reduced-dimensional vector using a self-attention mechanism to obtain a global vector; A fusion module, used for performing weighted fusion on the dimension reduction vector and the global vector to obtain a fusion vector; A first classification module, used for processing the fusion vector by using a random slice hash classifier to obtain a first classification result; A second classification module, used for processing the fusion vector using a self-organizing map classifier to obtain a second classification result; The voting module is used to perform weighted voting on the first classification result and the second classification result to obtain a classification result.

8. A structured data classification device based on knowledge graph, characterized in that: include: Processor, memory, input-output unit, and bus; The processor is connected to the memory, the input and output unit, and the bus; A program is stored in the memory, and the processor calls the program to execute the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a program stored thereon, wherein when the program is executed on a computer, the computer is caused to execute the method according to any one of claims 1 to 6.