A scenario-based supply-demand docking method based on neural network-based knowledge graph cutting

The method of tailoring knowledge graphs through neural networks solves the problems of redundant knowledge graphs and low query efficiency, achieves accurate matching of data supply and demand and improves transaction efficiency, and promotes the development of the data element market.

CN118332137BActive Publication Date: 2024-08-27SICHUAN YILI DIGITAL CITY TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410750383.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-12
Publication Date
2024-08-27
Estimated Expiration
2044-06-12

AI Technical Summary

Technical Problem

In the existing technology, the knowledge graph structure is redundant and the query efficiency is low, resulting in the inability of data providers and demanders to establish an effective supply and demand docking mechanism, which limits the efficiency and accuracy of data transaction circulation.

Method used

Using a neural network-based cutting method, the ChatGLM large language model is used to extract keywords and establish a keyword-relationship-keyword knowledge graph. The custom BERT language model is used to crop the graph, remove redundant and irrelevant content, and adapt to specific needs. Data requirements for the scenario.

Benefits of technology

It improves the efficiency and accuracy of data processing, ensures the matching of data supply and demand, enhances the efficiency and success rate of data transactions, provides reliable decision support for data transactions, and promotes the development of the data element market.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118332137B
    Figure CN118332137B
Patent Text Reader

Abstract

The present invention discloses a scenario-based supply and demand docking method based on a neural network-based knowledge graph, which belongs to the field of data mining technology, including: obtaining text data and preprocessing, extracting keywords using the text data preprocessed by the ChatGLM large language model, and classifying according to predefined relationships to obtain a knowledge graph of keywords-relationships-keywords; using a custom BERT language model to crop the knowledge graph according to input query keywords, to obtain a streamlined knowledge graph, and to complete the scenario-based supply and demand docking of the knowledge graph. The present invention uses the ChatGLM large language model and the custom BERT language model to create a knowledge graph and crop it, which can effectively filter out redundant or irrelevant content, ensure the relevance and accuracy of data, improve data processing efficiency and the accuracy of data elements, provide reliable decision support for data transactions, and achieve accurate matching between data supply and demand.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of data mining technology, and specifically designs a scenario-based supply and demand docking method based on neural network clipping knowledge graph. Background Art

[0002] The need to achieve scenario-based supply and demand docking of data elements stems from the explosive growth of data volume and the diversification of data types in modern society. In different application scenarios, such as finance, medical care, education, logistics, etc., there is a large amount of data production and consumption. However, these data often exist in a decentralized and heterogeneous manner, resulting in data silos, which seriously limits the potential value of data. Therefore, how to efficiently organize, process and dock these data elements has become a problem that needs to be solved urgently.

[0003] With the advent of the big data era, data has become an important production factor, and how to effectively explore the supply and demand relationship of this data is the key to promoting the development of the data factor market. By deeply analyzing the data demand and supply in different scenarios, we can establish an effective supply and demand docking mechanism to solve the source problem of data factor transaction circulation. Use neural network technology to cut and process knowledge graphs to adapt to data needs in specific scenarios, and achieve effective matching of resources or services by docking supply and demand parties; provide a scientific basis for data transactions. Summary of the invention

[0004] In response to the above-mentioned deficiencies in the prior art, the present invention provides a scenario-based supply and demand docking method based on neural network-cut knowledge graph, which solves the problems of structural redundancy and low query efficiency after the knowledge graph is constructed, and the problem that data providers and demanders are unable to establish an effective supply and demand docking mechanism.

[0005] In order to achieve the above-mentioned invention object, the technical solution adopted by the present invention is: a scenario-based supply and demand docking method based on neural network clipping knowledge graph, comprising the following steps:

[0006] S1: Obtain text data and preprocess it to obtain a preprocessed text dataset;

[0007] S2: Based on the preprocessed text dataset, the ChatGLM large language model is used to extract keywords to obtain the keyword set of the preprocessed text dataset;

[0008] S3: Based on the keyword set of the preprocessed text dataset, the ChatGLM large language model is used to perform classification processing according to the predefined relationships to obtain a knowledge graph of keyword-relationship-keyword;

[0009] S4: Input the query keyword into the pre-trained custom BERT language model, and use the pre-trained custom BERT language model to trim the keyword-relationship-keyword knowledge graph to obtain a streamlined knowledge graph, completing the scenario-based supply and demand docking of the knowledge graph.

[0010] The beneficial effects of the present invention are as follows: the present invention utilizes the ChatGLM large language model to establish a keyword-relationship-keyword knowledge graph, and utilizes a custom BERT language model to tailor the keyword-relationship-keyword knowledge graph according to query keywords, thereby streamlining the knowledge graph, effectively filtering out redundant or irrelevant content, ensuring the relevance and accuracy of the data, and specifically meeting the actual needs of the scenario. At the same time, it improves data processing efficiency, improves the accuracy of data elements, and can accurately grasp the demand and supply status of data, provide reliable decision-making support for data transactions, achieve accurate matching of data supply and demand, improve the efficiency and success rate of data transactions, and promote the development of the data element market.

[0011] Furthermore: the preprocessing in S1 includes: removing irrelevant characters, reducing noise and redundant information.

[0012] The beneficial effects of the above further scheme are: through preprocessing, the quality of data can be improved, the accuracy and stability of the model output results can be enhanced, and the data processing speed can be improved.

[0013] Further: the specific steps of S2 are as follows:

[0014] S201: Convert the preprocessed text dataset into the standard input format of the ChatGLM large language model;

[0015] S202: Creating an HTTP POST request, wherein the HTTP POST request includes header information and a request body, wherein the request body includes a text data set;

[0016] S203: Send the HTTP POST request to the ChatGLM large language model;

[0017] S204: Receive the response returned by the ChatGLM large language model according to the HTTP POST request, parse and remove duplicates, and obtain a keyword set.

[0018] The beneficial effects of the above further scheme are: using the ChatGLM large language model to extract keywords from text data sets has higher data processing efficiency and keyword extraction accuracy, and can flexibly extract keywords from text data sets to meet the needs of different application scenarios.

[0019] Further: the specific steps of S3 are as follows:

[0020] S301: Classify the keyword set of the preprocessed text data set using the ChatGLM large language model and store them in different sets to obtain different scene-type keywords;

[0021] S302: According to the predefined relationship, the ChatGLM large language model is used for processing to obtain the relationship between different scenario-type keywords;

[0022] S303: Create a keyword-relationship-keyword knowledge graph based on the relationship between different scenario-type keywords.

[0023] The beneficial effects of the above further scheme are: using the ChatGLM large language model to classify the keyword set of the text data set, and determining the relationship between the keywords according to the predefined relationship, it can accurately identify the complex relationship between the keywords and improve the depth and accuracy of the knowledge graph.

[0024] Furthermore: the predefined relationships include: hierarchical relationship, association relationship, ownership relationship, geographical relationship, time relationship, causal relationship, attribute relationship, branch relationship, similarity relationship, comparison relationship and no relationship.

[0025] The beneficial effect of the above further solution is that, through the predefined relationships, the originally chaotic keyword set can be converted into structured data, thereby improving the value of the data and the depth of data analysis.

[0026] Further: The specific method of pre-training the pre-trained custom BERT language model is:

[0027] The two entities of each pair of triples in the known knowledge graph are used as the input of the custom BERT language model, and the relationship between the two entities of each pair of triples in the known knowledge graph is used as the output of the custom BERT language model. The custom BERT language model is trained to obtain a pre-trained custom BERT language model.

[0028] The beneficial effect of the above further scheme is: using the known knowledge graph to train the custom BERT language model, so that the custom BERT language model can output the relationship between keywords based on the two input keywords, which facilitates the subsequent cropping of the knowledge graph.

[0029] Further: the custom BERT language model includes: a word embedding layer, a BERT language model, a fully connected layer, an output layer, and a cropping layer connected in sequence;

[0030] The word embedding layer is used to encode each keyword in the input query keyword and the keyword-relationship-keyword knowledge graph to obtain a word vector representation of each keyword;

[0031] The BERT language model is used to process the word vector representation of each keyword to obtain the relationship representation between the query keyword and each keyword in the keyword-relationship-keyword knowledge graph;

[0032] The fully connected layer is used to learn the mapping relationship between the query keyword and each keyword in the keyword-relationship-keyword knowledge graph;

[0033] The output layer is used to output the predicted relationship between the query keyword and each keyword in the keyword-relationship-keyword knowledge graph, and classify using the softmax function to obtain the final relationship prediction result;

[0034] The clipping layer is used to delete keywords that have no relationship with the currently input query keywords to obtain a simplified knowledge graph.

[0035] The beneficial effect of the above further scheme is: using the custom BERT language model to tailor the knowledge graph can reduce unnecessary calculations, speed up data processing, remove redundant or irrelevant content, retain information that is useful for the current scenario, and improve the accuracy of data elements. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 This is a flow chart of a scenario-based supply and demand docking method based on neural network-based knowledge graph cutting;

[0037] Figure 2 It is a relationship graph between the query keyword and the scene-type keywords associated with fire protection and the keywords. DETAILED DESCRIPTION

[0038] The specific implementation modes of the present invention are described below so that those skilled in the art can understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific implementation modes. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations utilizing the concept of the present invention are protected.

[0039] like Figure 1 As shown, the present invention provides a scenario-based supply and demand docking method based on neural network clipping knowledge graph, comprising the following steps:

[0040] S1: Obtain text data and preprocess it to obtain a preprocessed text dataset;

[0041] S2: Based on the preprocessed text dataset, the ChatGLM large language model is used to extract keywords to obtain the keyword set of the preprocessed text dataset;

[0042] S3: Based on the keyword set of the preprocessed text dataset, the ChatGLM large language model is used to perform classification processing according to the predefined relationships to obtain a knowledge graph of keyword-relationship-keyword;

[0043] S4: Input the query keyword into the pre-trained custom BERT language model, and use the pre-trained custom BERT language model to trim the keyword-relationship-keyword knowledge graph to obtain a streamlined knowledge graph, completing the scenario-based supply and demand docking of the knowledge graph.

[0044] In this embodiment, text data can be obtained and preprocessed through open data sets and Internet crawlers, among which, open data sets: many organizations and institutions provide free open data sets, covering text data of various topics and fields; Internet crawlers: use web crawler tools to crawl text data on the Internet and ensure that no copyright is infringed; preprocessing: mainly remove irrelevant characters, reduce noise and redundant information, such as removing HTML tags, special characters and punctuation marks, stop words, and unnecessary spaces.

[0045] In this embodiment, the conversation mode of the ChatGLM large language model is used to extract keywords from the preprocessed text dataset to obtain the keywords of the preprocessed text dataset. The specific implementation method is as follows:

[0046] S201: Convert the preprocessed text dataset into the standard input format of the ChatGLM large language model;

[0047] S202: Create an HTTP POST request, the HTTP POST request includes header information and a request body, and the request body includes a text data set;

[0048] S203: Sending the HTTP POST request to the ChatGLM large language model;

[0049] S204: receiving a response returned by the ChatGLM large language model according to the HTTP POST request, parsing and removing duplicates to obtain a keyword set, each keyword in the keyword set is unique; wherein the response returned by the ChatGLM large language model is in JSON format.

[0050] In a specific embodiment, using the conversation mode of the ChatGLM large language model, the user input of the conversation is: "What are the keywords extracted from this paragraph?", and the ChatGLM large language model of the conversation replies: keyword set; this keyword set is the set including all the keywords obtained in S204.

[0051] In this embodiment, the conversation mode of the ChatGLM large language model is used to classify the keyword set according to the predefined relationship to obtain a knowledge graph of keyword-relationship-keyword. The specific implementation method is as follows:

[0052] S301: Classify the keyword set of the preprocessed text data set using the ChatGLM large language model and store them in different sets to obtain different scene-type keywords;

[0053] S302: According to the predefined relationship, the ChatGLM large language model is used for processing to obtain the relationship between different scenario-type keywords;

[0054] S303: Create a keyword-relationship-keyword knowledge graph based on the relationship between different scenario-type keywords.

[0055] In a specific embodiment, the conversation mode of the ChatGLM large language model is used, and the user input of the conversation is: "Extract the following keywords that belong to scenario-type keywords?", and the ChatGLM large language model of the conversation replies: "Scenario-type keywords, extracted and stored in set C"; wherein scenario-type keywords are a type of keyword classification, for example: "Extract the following keywords that belong to fire prevention and treatment?", the reply of the ChatGLM large language model is the keywords that belong to fire prevention and treatment, and these keywords are stored in set C, and this set C includes all keywords that belong to fire prevention and treatment.

[0056] In a specific embodiment, the predefined relationships include: hierarchical relationship, association relationship, ownership relationship, geographical relationship, time relationship, causal relationship, attribute relationship, branch relationship, similarity relationship, comparison relationship and no relationship;

[0057] Hierarchical relationship: There is a parent-child or superior-subordinate relationship between entities, such as the classification relationship in species classification, the relationship between folders and files in the file system, etc.

[0058] Relationship: There is a direct relationship between two entities, such as author and paper, city and country, etc.

[0059] Ownership relationship: one entity owns another entity, such as people and property, companies and products, etc.

[0060] Geographical relationship: describes the relationship between geographical locations, such as the distance between cities, the relative positions between geographical locations, etc.

[0061] Temporal relations: describe the temporal order or time period relationship between entities, such as the order of events, the association on the historical timeline, etc.

[0062] Causation: One entity affects the generation, development, or state of another entity, such as disease and symptoms, cause and effect, etc.

[0063] Attribute relations: attributes or characteristics of an entity, such as a person’s height, weight, color, etc.;

[0064] Branch relationship: one entity branches out from another or multiple entities, such as a company's branches, biological evolutionary branches, etc.

[0065] Similarity relationship: entities are similar in some aspects, such as similar products, similar people, etc.

[0066] Contrasting relationship: Entities are contrasting in some aspects, such as opposite concepts, competitive relationships, etc.

[0067] No relationship: There are no any of the above 10 relationships between entities, indicating that there is no relationship between the two entities.

[0068] Specifically, using the dialogue mode of the ChatGLM large language model, the user input of the dialogue is: "Select a relationship from hierarchical relationship, association relationship, ownership relationship, geographical relationship, time relationship, causal relationship, attribute relationship, branch relationship, similarity relationship, contrast relationship, and no relationship to represent the relationship between two different scene-type keywords?" The ChatGLM large language model of the dialogue responds: one of these 11 relationships. Among them, the two different scene-type keywords are the keywords of two different scene-types whose relationship needs to be confirmed.

[0069] In this embodiment, the query keyword is input into the custom BERT language model, and the custom BERT language model is used to trim the keyword-relationship-keyword knowledge graph to obtain a streamlined knowledge graph, thereby completing the scenario-based supply and demand docking.

[0070] The custom BERT language model includes: a word embedding layer, a BERT language model, a fully connected layer, an output layer, and a cropping layer connected in sequence;

[0071] The word embedding layer is used to encode the input query keyword and each keyword in the keyword-relation-keyword knowledge graph to obtain the word vector representation of each keyword;

[0072] BERT language model: used to process the word vector representation of each keyword to obtain the relationship representation between the query keyword and each keyword in the keyword-relationship-keyword knowledge graph. The BERT language model was proposed by Google and is a known technology.

[0073] The fully connected layer is used to learn the mapping relationship between query keywords and each keyword in the keyword-relation-keyword knowledge graph;

[0074] The output layer is used to output the predicted relationship between the query keyword and each keyword in the keyword-relationship-keyword knowledge graph, and classify it using the softmax function to obtain the final relationship prediction result;

[0075] The cropping layer is used to delete keywords that have no relationship with the currently input query keywords to obtain a streamlined knowledge graph.

[0076] The specific method of pre-training the pre-trained custom BERT language model is as follows: taking the two entities of each pair of triples in the known knowledge graph as the input of the custom BERT language model, taking the relationship between the two entities of each pair of triples in the known knowledge graph as the output of the custom BERT language model, training the custom BERT language model to obtain the pre-trained custom BERT language model; wherein, query keywords and scene keywords are input into the pre-trained custom BERT language model, and the pre-trained custom BERT language model will output the relationship between the query keywords and the scene keywords.

[0077] In a specific embodiment, "firefighting" is input as a query keyword into the custom BERT language model. The custom BERT language model cuts the keyword-relationship-keyword knowledge graph output by the ChatGLM large language model to obtain a simplified knowledge graph that has a relationship with the query keyword. The specific implementation method is as follows:

[0078] S1: Acquire text data and preprocess it to obtain a preprocessed text data set, wherein in this embodiment, the text data is acquired through open data sets and Internet crawlers;

[0079] S2: Based on the preprocessed text dataset, the ChatGLM large language model is used to extract keywords to obtain the keyword set of the preprocessed text dataset;

[0080] S3: Based on the keyword set of the preprocessed text dataset, the ChatGLM large language model is used to perform classification processing according to the predefined relationships to obtain a knowledge graph of keyword-relationship-keyword;

[0081] S4: Input the query keyword into the pre-trained custom BERT language model, and use the pre-trained custom BERT language model to trim the keyword-relationship-keyword knowledge graph to obtain a streamlined knowledge graph, completing the scenario-based supply and demand docking of the knowledge graph.

[0082] In this embodiment, a keyword-relationship-keyword knowledge graph is obtained in S3, which includes keywords of various scenario categories. However, the user only needs keywords related to fire protection. Therefore, the query keyword "fire protection" is entered in S4, and the pre-trained custom BERT language model is used to trim the keyword-relationship-keyword knowledge graph, and a concise knowledge graph related to fire protection is obtained from a large amount of data, so as to achieve accurate docking and matching between data supply and demand sides and meet the scenario-based supply and demand docking of the knowledge graph.

[0083] like Figure 2 As shown, the query keyword "firefighting" and the scenario keywords associated with firefighting and the relationship between the keywords can be obtained, which are: fire safety education, fire prevention and treatment, firefighting facility maintenance and management, fire brigade construction, firefighting publicity and training, firefighting emergency command and dispatch, firefighting scientific research and innovation and the relationship between them, among which firefighting and fire brigade construction are branch relationships, firefighting and firefighting publicity and training are association relationships, firefighting and firefighting emergency command and dispatch are association relationships, firefighting and fire safety education are causal relationships, firefighting and fire prevention and treatment are causal relationships, firefighting and firefighting facility maintenance and management are association relationships, and firefighting and firefighting scientific research and innovation are association relationships. The remaining keywords that have no relationship with the query keyword "firefighting" are trimmed to obtain a streamlined knowledge graph, realizing the scenario-based supply and demand docking of data elements.

[0084] The beneficial effects of the present invention are as follows: the present invention utilizes the ChatGLM large language model to establish a keyword-relationship-keyword knowledge graph, and utilizes a custom BERT language model to tailor the keyword-relationship-keyword knowledge graph according to query keywords, thereby achieving the simplification of the knowledge graph, effectively filtering out redundant or irrelevant content, ensuring the relevance and accuracy of the data, and specifically meeting the actual needs of the scenario. At the same time, it improves data processing efficiency and the accuracy of data elements. By accurately grasping the demand and supply status of data, it provides reliable decision-making support for data transactions, achieves accurate matching of data supply and demand, improves the efficiency and success rate of data transactions, and promotes the development of the data element market.

Claims

1. A scenario-based supply and demand docking method based on neural network tailoring knowledge graph, characterized in that: The following steps are involved: S1: Obtain text data and preprocess it to obtain a preprocessed text dataset; S2: Based on the preprocessed text dataset, the ChatGLM large language model is used to extract keywords to obtain the keyword set of the preprocessed text dataset; S3: Based on the keyword set of the preprocessed text dataset, the ChatGLM large language model is used to perform classification processing according to the predefined relationships to obtain a knowledge graph of keyword-relationship-keyword; S4: Input the query keyword into the pre-trained custom BERT language model, use the pre-trained custom BERT language model to trim the keyword-relationship-keyword knowledge graph, obtain a streamlined knowledge graph, and complete the scenario-based supply and demand docking of the knowledge graph; The specific steps of S2 are as follows: S201: Convert the preprocessed text dataset into the standard input format of the ChatGLM large language model; S202: Creating an HTTP POST request, wherein the HTTP POST request includes header information and a request body, wherein the request body includes a text data set; S203: Send the HTTP POST request to the ChatGLM large language model; S204: Receive the response returned by the ChatGLM large language model according to the HTTP POST request, parse and remove duplicates, and obtain a keyword set.

2. The scenario-based supply and demand docking method based on neural network tailoring knowledge graph according to claim 1 is characterized in that: The preprocessing in S1 includes: removing irrelevant characters, reducing noise and redundant information.

3. The scenario-based supply and demand docking method based on neural network tailoring knowledge graph according to claim 1 is characterized in that: The specific steps of S3 are as follows: S301: Classify the keyword set of the preprocessed text data set using the ChatGLM large language model and store them in different sets to obtain different scene-type keywords; S302: According to the predefined relationship, the ChatGLM large language model is used for processing to obtain the relationship between different scenario-type keywords; S303: Create a keyword-relationship-keyword knowledge graph based on the relationship between different scenario-type keywords.

4. The scenario-based supply and demand docking method based on neural network tailoring knowledge graph according to claim 3 is characterized in that: The predefined relationships include: hierarchical relationship, association relationship, ownership relationship, geographical relationship, time relationship, causal relationship, attribute relationship, branch relationship, similarity relationship, comparison relationship and no relationship.

5. The scenario-based supply and demand docking method based on neural network tailoring knowledge graph according to claim 1 is characterized in that: The specific method of pre-training the pre-trained custom BERT language model is as follows: The two entities of each pair of triples in the known knowledge graph are used as the input of the custom BERT language model, and the relationship between the two entities of each pair of triples in the known knowledge graph is used as the output of the custom BERT language model. The custom BERT language model is trained to obtain a pre-trained custom BERT language model.

6. The scenario-based supply and demand docking method based on neural network tailored knowledge graph according to claim 5 is characterized in that: The custom BERT language model includes: a word embedding layer, a BERT language model, a fully connected layer, an output layer, and a cropping layer connected in sequence; The word embedding layer is used to encode each keyword in the input query keyword and the keyword-relationship-keyword knowledge graph to obtain a word vector representation of each keyword; The BERT language model is used to process the word vector representation of each keyword to obtain the relationship representation between the query keyword and each keyword in the keyword-relationship-keyword knowledge graph; The fully connected layer is used to learn the mapping relationship between the query keyword and each keyword in the keyword-relationship-keyword knowledge graph; The output layer is used to output the predicted relationship between the query keyword and each keyword in the keyword-relationship-keyword knowledge graph, and classify using the softmax function to obtain the final relationship prediction result; The clipping layer is used to delete keywords that have no relationship with the currently input query keywords to obtain a simplified knowledge graph.