A fast customizable industry knowledge graph query and retrieval interface system
By constructing an industry-standard knowledge graph and using graph convolutional networks to generate semantic vectors, combined with a hybrid retrieval engine and inference units, the problem of insufficient accuracy of existing search engines in professional industries is solved, achieving efficient semantic association and deep relationship inference, and improving user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ANHUI BIAOXINCHA DATA TECH CO LTD
- Filing Date
- 2025-11-18
- Publication Date
- 2026-04-10
AI Technical Summary
Existing search engines suffer from insufficient accuracy, limited semantic expression capabilities, poor tolerance for user input errors, and weak deep relational reasoning capabilities in highly specialized and semantically complex industry application scenarios.
We construct an industry-standard knowledge graph, generate semantic vectors using a graph convolutional network model, and combine a hybrid retrieval engine with reasoning and optimization units to achieve path-based knowledge reasoning and personalized recommendations. We then deploy the system using a microservice architecture.
It improves search accuracy, automatically associates semantically similar content, enhances user experience and search robustness, and enables the mining of deep semantic connections and the provision of a comprehensive knowledge view.
Smart Images

Figure CN121212366B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of computer software, in particular to a fast customizable industry knowledge graph query and retrieval interface system. BACKGROUND
[0002] With the rapid development of information technology, search engines have become an important tool for users to obtain knowledge and information. Traditional search engines mainly realize information retrieval based on keyword matching mechanism, although they can meet the query requirements in general scenarios to a certain extent, but when facing professional and high semantic complexity industry application scenarios, the retrieval results often have the problem of insufficient precision. Users often need to manually screen and interpret a large number of candidate results returned, resulting in low information acquisition efficiency, which is difficult to meet the needs of industry users for high-precision and structured knowledge services.
[0003] In recent years, knowledge graph technology has been widely applied to the construction of field knowledge system because of its explicit semantic expression ability and entity relationship modeling advantage, and has been used as a core infrastructure to support intelligent retrieval. The search engine based on knowledge graph can organize and present knowledge in a structured way, and improve the relevance and explainability of the retrieval results. However, most of the current knowledge graph retrieval systems still follow the traditional string matching or rule-driven query method, and face the following technical bottlenecks in actual application:
[0004] 1. Limited semantic expression ability. The existing retrieval method highly depends on the literal matching of query keywords and entity or attribute labels in the knowledge base, and lacks effective identification of semantically equivalent or synonymous expressions. For example, "computer" and "computer" have high semantic similarity, but under the character matching mechanism, they are considered as completely different terms, which limits the semantic understanding and generalization ability of the system, and related knowledge cannot be accurately associated and recalled.
[0005] 2. Poor user input fault tolerance. The traditional retrieval model has high requirements for the accuracy of input text. When there are spelling errors, homophonic errors or term variants in user input (such as "artificial intelligence" is misinput as "artificial intelligence"), the system cannot identify the real intention, and returns irrelevant or low-relevance results, which seriously affects the user experience and retrieval robustness.
[0006] 3. Weak deep relationship reasoning ability. Existing systems mostly stay at the level of shallow query based on explicit paths or direct associations, and cannot effectively mine the implicit semantic associations and potential logical relationships in the knowledge graph. For example, when querying "Einstein", the system only returns the attribute information directly associated with him (such as birth date, nationality, etc.), but fails to automatically infer the deep semantic connections between him and concepts such as "relativity", "quantum mechanics", "history of physics development", etc. Therefore, it is difficult to provide a comprehensive and coherent knowledge view, which restricts the ability of knowledge discovery.
[0007] At present, there is no effective solution to the problems in the related art. SUMMARY
[0008] To overcome the above technical problems existing in the prior art, the present application provides a rapidly customizable industry knowledge graph query and retrieval interface system.
[0009] To this end, the specific technical solutions adopted by the present application are as follows:
[0010] A rapidly customizable industry knowledge graph query and retrieval interface system, the system comprising:
[0011] A data and representation unit for structurally processing text data of a target industry, constructing a knowledge graph based on the processing result, generating a semantic vector, and storing the semantic vector in an open source vector database;
[0012] A hybrid retrieval engine for performing word segmentation processing on a user input query sentence, and combining an extended search mechanism in the knowledge graph to obtain search results using a fusion sorting algorithm;
[0013] A reasoning and optimization unit for using path-based knowledge reasoning technology to reason the retrieval results, and combining a meta-learning-based domain adaptive engine to realize adaptation in different industries;
[0014] An interaction and service unit for optimizing user interaction experience through a dynamic hotword recommendation mechanism, and realizing system deployment and customized configuration based on a microservice architecture.
[0015] Further, the data and representation unit comprises:
[0016] A data preparation module for collecting text data of a target industry, constructing an entity relationship extraction model using natural language processing technology, and extracting structured knowledge triples from the text data;
[0017] A knowledge graph and vector storage module for constructing a knowledge graph according to the extracted knowledge triples, processing the knowledge graph, generating a semantic vector, and storing the semantic vector in an open source vector database.
[0018] Further, the knowledge graph and vector storage module comprises:
[0019] a graph storage submodule, configured to store the extracted knowledge triplets in a graph database, and construct a knowledge graph;
[0020] a vectorization representation submodule, configured to train and optimize the knowledge graph by using a graph convolution network model, and generate semantic vectors based on the optimization results;
[0021] a vector storage submodule, configured to store the generated semantic vectors in an open-source vector database, and establish corresponding indexes to support subsequent similarity retrieval.
[0022] Further, the training and optimization of the knowledge graph by using the graph convolution network model, and the generation of semantic vectors based on the optimization results comprise:
[0023] exporting the knowledge graph from the graph database, and initializing the feature vectors of each entity node in the knowledge graph based on the export results;
[0024] establishing an adjacency matrix representing the connection relationship between the entity nodes according to the triplets in the initialized knowledge graph;
[0025] aggregating the feature vectors of the neighbor nodes of each entity node according to the established adjacency matrix, updating the feature vector of the current entity node, and constructing a graph convolution network model by using a propagation rule;
[0026] taking link prediction as a training target, calculating the gradient of the loss function of the graph convolution network model parameters by using a back propagation algorithm, and updating the parameters of the graph convolution network model by using a gradient descent optimizer until the graph convolution network model converges, thereby completing the training and optimization of the graph convolution network model;
[0027] inputting the entity nodes in the knowledge graph into the optimized graph convolution network model, and extracting the feature vectors of the last layer output as the semantic vectors of each entity.
[0028] Further, the hybrid retrieval engine comprises:
[0029] a semantic vector retrieval module, configured to perform word segmentation processing on a query sentence input by a user by using a Chinese word segmentation library, convert the query sentence after the word segmentation processing into a corresponding query vector by using a pre-trained language model, and submit the query vector to an open-source vector database;
[0030] a graph association expansion module, configured to expand the search along the relationship paths between the entity nodes outward in the knowledge graph by taking the query vector as a starting point;
[0031] The multi-source result reordering and fusion module is configured to fuse the query vector and the extended search results by using a fusion ranking algorithm, obtain candidate results, calculate comprehensive scores of the candidate results, rank the candidate results according to the comprehensive scores, and present the candidate result with the highest comprehensive score to the user as the search result.
[0032] Further, the comprehensive score includes a semantic similarity score, a graph structure correlation score, and an importance score.
[0033] Further, the reasoning and optimization unit includes:
[0034] The knowledge reasoning module is configured to query paths satisfying predefined reasoning rules in the graph database, mine and reason about implicit knowledge, and present the implicit knowledge and the search results to the user together.
[0035] The domain adaptation engine module is configured to collect knowledge graphs and corresponding annotation sets of different industries, learn the collected results by using a model-agnostic meta-learning algorithm, obtain meta-model parameters, and perform deployment to achieve adaptation of different industries.
[0036] Further, the domain adaptation engine module includes:
[0037] The meta-training submodule is configured to collect knowledge graphs and corresponding annotation sets of different industries, and perform meta-learning cycles on the collected results to obtain optimal initial meta-model parameters.
[0038] The meta-adaptation submodule is configured to load the initial meta-model parameters, adjust the initial meta-model parameters by using the annotation sets, generate meta-model parameters, and deploy the meta-model parameters to an online service environment to achieve adaptation of different industries.
[0039] Further, the interaction and service unit includes:
[0040] The hotword prompt and user interaction module is configured to mine target entities by using a term frequency and inverse document frequency algorithm according to query logs of the user, construct a global hotword library, generate personalized recommendation results by combining similarity calculation, and show the personalized recommendation results to the user in a preset form.
[0041] The architecture and deployment module is configured to use a microservice architecture, implement containerized deployment of the system based on a preset application container engine and an open-source container orchestration system, and perform customized configuration by using a predefined template.
[0042] Further, the hotword prompt and user interaction module includes:
[0043] The global hot word library construction submodule is configured to periodically analyze all user query logs by using a term frequency and inverse document frequency algorithm, mine target entities in an open source vector database, construct a global hot word library, and cache the global hot word library in a key-value database.
[0044] The personalized recommendation submodule is configured to trigger corresponding similarity calculation according to content input by a user in a search box, reorder global hot words matched from the key-value database and similar entities calculated by the open source vector database, generate a personalized recommendation result, and display the personalized recommendation result to the user in a preset form.
[0045] The present application has the following advantages:
[0046] 1. The present application extracts structured element indicators from corresponding industry files to ensure the accuracy and professionalism of the data source, and the system can directly return accurate matching results based on the structured relationship of the knowledge graph when the user searches, avoiding the answer deviation caused by the uneven quality of web page content in traditional search engines.
[0047] 2. The present application maps text content into semantic vectors through vector retrieval technology, and realizes semantic retrieval by calculating vector similarity, which can not only return accurate matching answers, but also automatically associate content with similar semantics, solving the problem of fixed search results and insufficient coverage in traditional search results.
[0048] 3. The present application stores the knowledge graph in the graph database and constructs the association relationship network between entities, and in the retrieval stage, adopts a path-based reasoning algorithm to perform logical deduction along the relationship path in the graph structure and mine implicit knowledge. BRIEF DESCRIPTION OF DRAWINGS
[0049] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiments will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of these drawings.
[0050] Fig. 1 is a principle block diagram of a fast customizable industry knowledge graph query and retrieval interface system according to an embodiment of the present application;
[0051] Fig. 2 is a flowchart of a vectorization representation submodule in a fast customizable industry knowledge graph query and retrieval interface system according to an embodiment of the present application.
[0052] In the drawings:
[0053] 1, data and representation unit; 2, hybrid search engine; 3, reasoning and optimization unit; 4, interaction and service unit. DETAILED DESCRIPTION
[0054] To further illustrate the embodiments, the present application provides drawings which are part of the disclosure of the present application, mainly used to illustrate the embodiments, and can be explained in conjunction with the related description of the specification to understand the operation principle of the embodiments. With reference to these contents, those skilled in the art should understand other possible implementations and advantages of the present application.
[0055] According to the embodiments of the present application, a fast customizable industry knowledge graph query and retrieval interface system is provided.
[0056] The present application will be further described in conjunction with the drawings and specific embodiments, as shown, according to the fast customizable industry knowledge graph query and retrieval interface system of the embodiments of the present application, the system comprises: Figs. 1-2
[0057] Data and representation unit 1, for structuring the text data of the target industry, constructing the knowledge graph based on the processing result, generating the semantic vector, and storing the semantic vector into the open source vector database.
[0058] It should be noted that the present application constructs the industry standard knowledge graph as the knowledge base for retrieval, which can greatly improve the retrieval efficiency and accuracy.
[0059] In this optional embodiment, the data and representation unit 1 comprises:
[0060] Data preparation module, for collecting text data of the target industry, constructing entity relationship extraction model using natural language processing technology, and extracting structured knowledge triples from the text data.
[0061] Knowledge graph and vector storage module, for constructing the knowledge graph according to the extracted knowledge triples, processing the knowledge graph, generating the semantic vector, and storing the semantic vector into the open source vector database.
[0062] In this optional embodiment, the knowledge graph and vector storage module comprises:
[0063] Graph storage submodule, for storing the extracted knowledge triples into the graph database to construct the knowledge graph.
[0064] Vector representation submodule, for training and optimizing the knowledge graph using the graph convolution network model, and generating the semantic vector based on the optimization result.
[0065] In the optional embodiment, the knowledge graph is trained and optimized by using a graph convolution network model, and the semantic vector is generated based on the optimization result, which includes:
[0066] The knowledge graph is exported from the graph database, and the feature vector of each entity node in the knowledge graph is initialized based on the export result;
[0067] According to the triplets in the initialized knowledge graph, an adjacency matrix representing the connection relationship between entity nodes is established;
[0068] According to the established adjacency matrix, the feature vectors of the neighbor nodes of each entity node are aggregated by using the propagation rule, and the feature vector of the current entity node is updated to construct a graph convolution network model;
[0069] Taking link prediction as the training target, the loss function is calculated by using the back propagation algorithm to calculate the gradient of the parameters of the graph convolution network model, and the parameters of the graph convolution network model are updated by using the gradient descent optimizer until the graph convolution network model converges, completing the training and optimization of the graph convolution network model;
[0070] The entity nodes in the knowledge graph are input into the optimized graph convolution network model, and the feature vector output by the last layer is extracted as the semantic vector of each entity.
[0071] The vector storage submodule is used to store the generated semantic vector into the open source vector database, and the corresponding index is established to support the subsequent similarity retrieval.
[0072] It should be noted that in the specific embodiment, the data and representation unit 1 includes:
[0073] I. Industry standard data preparation:
[0074] Data source: For a specific industry, such as power, finance, and medical care, collect its authoritative standard documents, technical specifications, research reports, and other semi-structured or unstructured texts.
[0075] Triplet extraction: Use natural language processing technology to design an entity-relation extraction model (a joint extraction model based on BERT) to automatically extract structured knowledge triplets (subject-predicate-object) from the text, such as (device A, belongs to, substation B).
[0076] II. Knowledge graph and vector database storage:
[0077] 1. Graph storage: The extracted triplets are stored in Neo4j (a graph database), which stores data in the form of nodes and edges, and is very suitable for efficient complex relationship query and multi-step path traversal.
[0078] 2. Vectorization: Using Deep Graph Library (DGL), learn the knowledge graph in Neo4j; use the Graph Convolutional Network (GCN) model to train each entity (node) and relationship (edge) into a high-dimensional semantic vector, which can capture the deep semantic information of entities in the graph structure.
[0079] (1) Graph data preparation and input:
[0080] Node feature initialization: export the knowledge graph in the Neo4j graph database; initialize the feature vector of each entity node in the graph; a feasible initialization method is to convert the node name or descriptive text into an initial low-dimensional vector using a pre-trained language model (such as BERT); if there is no text description, one-hot encoding or random initialization can also be used.
[0081] Adjacency matrix construction: according to the "subject-predicate-object" triple in the graph, construct the adjacency matrix A of the graph, which represents the direct connection relationship between nodes.
[0082] (2) Graph Convolutional Network model construction:
[0083] Construct a multi-layer graph convolutional network, the core operation of each layer of GCN is to aggregate the neighbor node information to update the current node representation; for any node v in the graph, its vector representation in the l+1 layer is It is calculated by the following propagation rule:
[0084] ;
[0085] where, represents the vector representation of node u in the l layer; represents the set of all neighbor nodes of node v; represents the trainable weight matrix in the l layer; represents the normalization constant, usually takes the value of , to prevent the vector dimension from being greatly different due to the different node degrees; σ represents the nonlinear activation function, such as ReLU (Rectified Linear Unit).
[0086] (3) Model training and optimization:
[0087] Define the training task: use link prediction as the training target of the model; specifically, for an effective triple (head entity, relationship, tail entity) in a knowledge graph, the goal of the model is to make its score higher than an invalid, randomly destroyed triple .
[0088] Define the loss function: use an interval-based loss function; for example, for each positive sample triple, construct a negative sample (such as randomly replacing the head entity or the tail entity), and then minimize the following loss:
[0089] ;
[0090] where, represents the set of all positive sample triples; represents the set of all negative sample triples; represents the scoring function, which measures the rationality of the triple, for example, by calculating the distance between h+r and t vectors; γ represents a hyperparameter representing the expected minimum interval between positive and negative sample scores.
[0091] Parameter optimization: calculate the gradient of the loss function with respect to the model parameters (weight matrices of each layer ) by the backpropagation algorithm, and use the gradient descent optimizer (such as Adam Optimizer) to update the model parameters until the model converges.
[0092] (4) Vector output and storage: after training converges, input all entity nodes in the knowledge graph into the trained GCN model, and the node vectors output by the last layer of the model are the final high-dimensional semantic vectors obtained; store all entities and their corresponding final vectors in the Milvus vector database, and establish efficient indexing for subsequent similarity retrieval.
[0093] 3, Vector storage: store all generated entity and relationship vectors in Milvus (an open-source vector database for efficient similarity retrieval), and establish efficient indexing for these vectors to perform large-scale, millisecond-level similarity retrieval.
[0094] The hybrid retrieval engine 2 is used for processing the query sentence input by the user, and combining the extended search mechanism in the knowledge graph to obtain search results using a fusion sorting algorithm.
[0095] It should be noted that the present application maps the knowledge graph nodes and relationships into high-dimensional semantic vectors and stores them in the Milvus vector database, and combines vector similarity calculation and graph structure query during retrieval, breaking through the semantic limitations of traditional character matching.
[0096] In this optional embodiment, the hybrid retrieval engine 2 includes:
[0097] A semantic vector retrieval module is configured to perform word segmentation on a query sentence input by a user by using a Chinese word segmentation library, and convert the query sentence after word segmentation into a corresponding query vector by using a pre-trained language model, and submit the query vector to an open-source vector database.
[0098] A graph association expansion module is configured to expand the query vector as a starting point and search outward along the relationship paths between entity nodes in a knowledge graph.
[0099] A multi-source result reordering and fusion module is configured to fuse the query vector and the expanded search result by using a fusion sorting algorithm, obtain candidate results, calculate comprehensive scores of the candidate results, reorder the candidate results according to the comprehensive scores, and present the candidate result with the highest comprehensive score to the user as a search result.
[0100] In this optional embodiment, the comprehensive score includes a semantic similarity score, a graph structure relevance score and an importance score.
[0101] It should be noted that, in specific embodiments, the hybrid retrieval engine 2 includes:
[0102] I. Semantic vector retrieval:
[0103] A user inputs a query sentence, for example, “query the fault handling standard related to ‘high-voltage circuit breaker’”; the system performs word segmentation on the query sentence by using jieba (a Chinese word segmentation library), and converts the entire query sentence into a query vector V q by using a pre-trained language model (BERT); the query vector V q is submitted to a Milvus vector database to perform Top-K similarity retrieval; the Milvus vector database returns K entity vectors most similar to the query vector based on cosine similarity or Euclidean distance, and the purpose of this step is to quickly lock the core candidate entities most relevant in semantics; for example, “high-voltage circuit breaker”, “SF6 circuit breaker” and “vacuum circuit breaker” may be retrieved.
[0104] II. Graph association expansion:
[0105] The Top-K core entities retrieved in the previous step are used as “seed nodes” to perform graph traversal in a Neo4j graph database; starting from each seed node, the graph is expanded outward by 1 to 2 hops along the relationship paths in the graph, for example, starting from the “high-voltage circuit breaker” node, “common faults”, “maintenance procedures” and “related components” can be found as first-degree relationship nodes, and more peripheral related information can be found from these nodes, the purpose is to use the structural information of the knowledge graph to find knowledge that is not directly similar in semantics but closely related in logic, and to make up for the defect that pure vector retrieval cannot find deep associations.
[0106] III. Multi-source result reordering and fusion:
[0107] Through semantic vector recall and graph association expansion, two groups of results are obtained, one from vector retrieval (semantic relevance) and the other from graph expansion (logical relevance), and an intelligent fusion strategy is generated; a fusion sorting algorithm is designed to calculate a comprehensive score for each candidate result The score is composed of multiple factors weighted:
[0108] ;
[0109] In the formula, represents the semantic similarity score, that is, the similarity of the candidate entity vector and the query vector calculated in Milvus; represents the graph structure correlation score. It can be calculated based on the shortest path length of the candidate node and the seed node in the graph. The shorter the path, the higher the score; represents the entity popularity or importance score, which can be pre-calculated in Neo4j through graph algorithms such as PageRank; represents the weight coefficient, which can be dynamically adjusted through experiments or the meta-learning engine described below to adapt to different query scenarios; according to the final comprehensive score All candidate results are sorted and the highest ranked result is presented to the user.
[0110] Reasoning and optimization unit 3, for using path-based knowledge reasoning technology to reason about search results, and combining a meta-learning-based domain adaptation engine to achieve adaptation in different industries.
[0111] It should be noted that the present application performs logical deduction through the relationship path in the graph database before outputting the search results, ensuring the comprehensiveness and professionalism of the returned content.
[0112] In this optional embodiment, the reasoning and optimization unit 3 includes:
[0113] A knowledge reasoning module for querying paths that meet predefined reasoning rules in a graph database, mining and reasoning about implicit knowledge, and presenting the implicit knowledge and search results to the user together.
[0114] A domain adaptation engine module for collecting knowledge graphs and corresponding annotation sets in different industries, learning the collected results using a model-independent meta-learning algorithm, obtaining meta-model parameters and performing deployment to achieve adaptation in different industries.
[0115] In this optional embodiment, the domain adaptation engine module includes:
[0116] The meta-training sub-module is configured to collect knowledge graphs of different industries and corresponding annotation sets, and perform a meta-learning cycle on the collection results to obtain optimal initial meta-model parameters.
[0117] The meta-adaptation sub-module is configured to load the initial meta-model parameters, adjust the initial meta-model parameters by using the annotation sets, generate meta-model parameters, and deploy the meta-model parameters to an online service environment to implement adaptation of different industries.
[0118] It should be noted that, in specific embodiments, the reasoning and optimization unit 3 includes:
[0119] I. Path-based knowledge reasoning:
[0120] Before returning the final result, the system will use the reasoning ability of the graph database to complete the logic, and the implementation is to use pre-defined reasoning rules (or rules paths automatically discovered by algorithms); for example, a rule is defined as: "if (device A, is located at, place B) and (place B, occurs, event C), then it can be inferred that (device A, is associated with, event C)"; when the hybrid retrieval engine returns an entity "device A", the reasoning module will actively query the path that meets such rules in Neo4j, and return the inferred implicit knowledge (such as "event C") to the user, so that the result is more comprehensive and deeper.
[0121] II. Domain adaptation engine based on meta-learning:
[0122] Objective: Traditional methods require a large amount of manual parameter tuning and model retraining to adapt to new fields. This engine aims to enable the system to "learn how to learn". When faced with a new industry knowledge graph, it can quickly complete self-adaptation with very little data, and the implementation steps are as follows:
[0123] 1. Use model-agnostic meta-learning (MAML):
[0124] MAML is a cutting-edge meta-learning algorithm. Its core idea is not to learn a universal model that performs well on all tasks, but to learn an optimal "initial parameter". The superiority of this initial parameter is that when faced with a completely new task (i.e., a new industry domain), the model can start from this point and only use a small amount of labeled samples to quickly converge to a state that performs well on the new task through a few simple gradient descent updates.
[0125] In this system, the "model" specifically refers to a series of key parameters that control the behavior of the hybrid retrieval engine, especially the weight coefficients in the multi-source result fusion formula:
[0126] ;
[0127] The meta-learning engine is trained on multiple knowledge graphs from different industries. It learns not the specific knowledge of any one industry, but the more abstract meta-knowledge that is cross-industry; for example, it can learn that for a highly structured knowledge graph, the graph structure relevance score should be given a higher weight ; for cases where the user query intent is ambiguous, the semantic similarity score should be given a higher weight .
[0128] 2. Detailed workflow: The workflow of this engine is divided into two main stages, the offline meta-training stage and the online meta-adaptation stage.
[0129] (1) Stage 1: Meta-training - offline;
[0130] The goal of this stage is to learn an optimal "meta-model", i.e. the best initial parameters θ0=(α0,β0,γ0,...).
[0131] 1) Prepare the meta-training set: Collect multiple (e.g. 5-10) knowledge graphs from different industries, such as finance, electricity, law, manufacturing, etc. These different industry domains constitute multiple "tasks" in meta-learning; for each industry knowledge graph, prepare a small labeled set containing several "query-expected answer" pairs.
[0132] 2) Execute the meta-learning loop: The system will iterate multiple times, and in each iteration;
[0133] a, task sampling: randomly select a "task" from the multiple industry knowledge graphs, for example, this time select the "finance domain".
[0134] b, inner loop: simulate rapid adaptation, copy the current learned meta-model parameters θ0 to form a temporary model; use a small part of the "standard domain" labeled set (called the support set) to perform 1 or several gradient descent updates on this temporary model, obtaining a model parameter θ 标准 ′ that is preliminarily adapted to the finance domain. This step simulates how the system will learn when a new task arrives.
[0135] c, outer loop: evaluate the adaptation effect and optimize the meta-model; use another part of the "standard domain" labeled set (called the query set, which is not seen in the inner loop) to evaluate the performance of the temporary model θ 标准 ′ obtained in the last step, and calculate its loss; this loss reflects the effectiveness of the rapid adaptation from θ0; according to the loss, calculate the gradient and update the initial meta-model parameters θ0, the optimization goal is not to let θ标准 Instead, let θ0 itself be a better "starting point", so that the "adaptation" process (inner loop) starting from it can produce better results.
[0136] In addition, the gradient is calculated according to the loss backpropagation, and the initial meta-model parameter θ0 is updated with it, which specifically includes:
[0137] Loss calculation: the system evaluates the performance of the temporarily updated model parameters on the query set extracted from the labeled set in a specific industry (task), and calculates the loss value, denoted as , where , and represents the current task (for example, "financial field").
[0138] Meta-gradient calculation: the goal of optimization is to update the meta-model parameter θ, not the temporary parameter ; the direction in which θ is updated is the direction that can make the subsequent "inner loop" (single or several gradient descent) produce better results; therefore, the gradient of the loss with respect to the meta parameter θ, that is, , needs to be calculated; since is calculated by θ , this step involves re-derivation of the gradient calculation process, that is, the second-order derivative, whose calculation can be expanded by chain rule:
[0139] ;
[0140] In actual calculation, modern deep learning frameworks such as TensorFlow and PyTorch can automatically complete the calculation of this second-order gradient through the calculation graph.
[0141] Meta-parameter update: in a single iteration, the system will sample a batch of tasks from multiple different industries; for each task in this batch, the above steps are performed to obtain the respective meta-gradient, and then the gradients are accumulated or averaged to obtain the final comprehensive gradient, which is used to update the meta-model parameter θ, and the update rule is as follows:
[0142] ;
[0143] In the formula, denotes the meta-learning rate, an independent hyperparameter that controls the step size of the meta-model parameter update; denotes the temporary parameter obtained after the meta-model is fine-tuned on the specific task ; is the accumulation of the meta-gradient calculated for all tasks in a batch.
[0144] Iteration and convergence: repeat the complete process of "task sampling, internal loop update, external loop evaluation, meta-parameter update" until the meta-model parameter theta on the comprehensive performance of each task reaches the convergence standard; the resulting theta is an optimal "initial parameter" with strong generalization ability and rapid adaptation ability, which can be used for rapid customization of new industries.
[0145] (2) Phase two: meta-adaptation - online customization for new industries;
[0146] When the system needs to be deployed in a completely new industry, such as "aerospace field", this phase is executed.
[0147] 1) Prepare new field data: build the basic knowledge graph and vector index of "aerospace field"; prepare a very small scale labeled set (e.g. only 10-50 "query-answer" pairs), much less than the number required by traditional training.
[0148] 2) Load meta-model: when the system is initialized, directly load the best initial parameter theta0 produced by the offline meta-training phase.
[0149] 3) Fast fine-tuning: use these 10-50 samples of the new field to perform several gradient descent updates (similar to the internal loop of meta-training) on the model; due to the excellent starting point theta0, the model can quickly adjust the parameters to perfectly match the data characteristics and query patterns of "aerospace field".
[0150] 4) Deployment online: after fine-tuning, the final model parameters adapted to the new field are obtained , and the retrieval system with these parameters can be deployed online to provide high-performance query services for new fields; compared with the traditional method which requires thousands or even tens of thousands of samples and long training time, the adaptation based on meta-learning reduces the adaptation cost by several orders of magnitude, truly realizing "fast, low-resource" customization.
[0151] Interaction and service unit 4 is used to optimize user interaction experience through dynamic hotword recommendation mechanism, and realize system deployment and customized configuration based on micro-service architecture.
[0152] It needs to be supplemented that the present application designs a hotword collection module, a statistical database, and an analysis of user input behavior to generate a high-frequency query word library. When the user inputs the retrieval word, the system recommends relevant hotwords based on vector similarity, improving interaction efficiency and retrieval accuracy. In addition, the present application can replace the database as needed, and only needs to be retrained to realize query and retrieval.
[0153] In this optional embodiment, the interaction and service unit 4 includes:
[0154] The hot word suggestion and user interaction module is used to mine target entities based on the user's query logs using word frequency and inverse document frequency algorithms, build a global hot word library, and generate personalized recommendation results by combining similarity calculations, which are then displayed to the user in a preset format.
[0155] In this optional embodiment, the hot word suggestion and user interaction module includes:
[0156] The global hot word library construction submodule is used to periodically analyze all users' query logs using word frequency and inverse document frequency algorithms, mine target entities in the open-source vector database, build a global hot word library, and cache the global hot word library in a key-value database;
[0157] The personalized recommendation submodule is used to trigger the corresponding similarity calculation based on the content entered by the user in the search box. It reorders the global hot words matched from the key-value database with similar entities calculated from the open-source vector database, generates personalized recommendation results, and displays the personalized recommendation results to the user in a preset format.
[0158] The architecture and deployment module is used to implement containerized deployment of the system using a microservice architecture, based on a preset application container engine and an open-source container orchestration system, and to perform customized configuration through predefined templates.
[0159] It should be further noted that, in a specific embodiment, the interaction and service unit 4 includes:
[0160] I. Dynamic Hot Word Prompts and User Interaction:
[0161] 1. Offline Global Hot Topic Library Construction: The system backend will periodically (e.g., daily) analyze the query logs of all users, and use the TF-IDF (Term Frequency-Inverse Document Frequency) algorithm or simple term frequency statistics to mine entities or concepts that are frequently queried in the entire knowledge base, forming a global hot topic library, which is cached in Redis (high-performance key-value database) for fast access.
[0162] 2. Real-time personalized recommendations: When a user enters content in the search box, the following real-time calculations are triggered:
[0163] (1) Input vectorization: Convert the incomplete string currently input by the user (such as "artificial intelligence") into a query vector in real time. .
[0164] (2) Similarity calculation: Submit the input to Milvus, which will retrieve the semantically most similar entities. For example, if you input "artificial intelligence", Milvus can immediately match entities such as "artificial intelligence" and "intelligent computing".
[0165] (3) Formula basis: The similarity calculation here mainly uses cosine similarity:
[0166] ;
[0167] wherein, represents the query vector input by the user; represents the vector of the entity in the database, and the formula calculates the cosine value of the angle between the two vectors. The closer the value is to 1, the more similar the semantics is.
[0168] (4) Result fusion and display: The global hot words matched from Redis and the similar entities calculated in real time by Milvus are merged, deduplicated, and sorted, and finally recommended to the user in the form of a pull-down list, such as "artificial intelligence", "history of artificial intelligence development", "artificial intelligence (correction)", etc.
[0169] II. Distributed architecture and rapid deployment:
[0170] 1. Architecture design:
[0171] The overall system adopts a microservice architecture, and the main functional modules are split into independent services; knowledge graph service: encapsulates Neo4j and provides graph query API; vector service: encapsulates Milvus and provides vector retrieval API; data access and processing service: responsible for extracting, cleaning, and storing new data; hybrid retrieval gateway: as the total entrance, orchestrates the complete process of the above hybrid retrieval; meta-learning training service: responsible for executing offline meta-learning model training.
[0172] 2. Deployment method:
[0173] Containerization: all microservices are packaged using Docker (application container engine), which encapsulates the service and all its dependencies into an independent, portable container image; orchestration and deployment: use Kubernetes (K8s, open source container orchestration system) for cluster deployment and management; quick customization process: when a new industry needs to be customized, the administrator only needs to:
[0174] (1) Prepare the configuration file of the new industry (such as database connection, data source path, etc.).
[0175] (2) Use Kubernetes' Helm and other tools to pull up a new microservice instance specially configured for the industry on the server cluster in one click based on the standardized deployment template.
[0176] (3) Trigger the data access service to start building the knowledge graph of the new industry.
[0177] To sum up, the application maps data such as text and images into high-dimensional semantic vectors through vector retrieval technology, so that semantically similar contents are automatically clustered in the vector space, and deep semantic association of cross-vocabulary expression is realized; for input error or synonym replacement scenarios, for example, "artificial intelligence" is replaced by "artificial intelligence", and "mobile phone" and "smart terminal" are interchanged, the system can automatically identify the real intention of the user through vector similarity calculation, improve the fault tolerance of the query, and avoid retrieval failure caused by input errors; relying on the optimized index structure of the vector database, the application can maintain a millisecond-level retrieval response under a million-level vector scale, and the retrieval efficiency is high compared with the full-scan or fuzzy matching of the traditional database; the system adopts modular design, and for different industry standard databases, the knowledge graph data source can be replaced and the vector representation model can be retrained, so that cross-field migration can be quickly realized.
[0178] The above merely describes preferred embodiments of the application and is not intended to limit the application, and any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the application shall be included in the protection scope of the application.
Claims
1. A fast customizable industry knowledge graph query and retrieval interface system, characterized in that, The system comprises: a data and representation unit configured to perform structural processing on text data of a target industry, construct a knowledge graph based on a processing result, generate a semantic vector, and store the semantic vector in an open-source vector database; a hybrid retrieval engine configured to perform word segmentation processing on a query sentence input by a user, combine an extended search mechanism in the knowledge graph, and obtain a search result by using a fusion sorting algorithm; an inference and optimization unit configured to use a path-based knowledge inference technology to perform inference on the search result, and realize adaptation to different industries by combining a meta-learning-based domain adaptation engine; an interaction and service unit configured to optimize a user interaction experience by using a dynamic hotword recommendation mechanism, and realize system deployment and customized configuration according to a micro-service architecture; the hybrid retrieval engine comprises: a semantic vector recall module configured to perform word segmentation processing on the query sentence input by the user by using a Chinese word segmentation library, convert the query sentence processed by word segmentation into a corresponding query vector by using a pre-trained language model, and submit the query vector to the open-source vector database; a graph association expansion module configured to expand search outward along a relationship path between entity nodes in the knowledge graph by taking the query vector as a starting point; a multi-source result reordering and fusion module configured to fuse the query vector and the expanded search result by using the fusion sorting algorithm, obtain a candidate result, calculate a comprehensive score of the candidate result, reorder the candidate result according to the comprehensive score, and present the candidate result with the highest comprehensive score to the user as the search result; the inference and optimization unit comprises: a knowledge inference module configured to query a path satisfying a predefined inference rule in a graph database, mine and infer implicit knowledge, and present the implicit knowledge and the search result to the user together; a domain adaptation engine module configured to collect knowledge graphs of different industries and corresponding annotation sets, learn the collection results by using a model-independent meta-learning algorithm, obtain meta-model parameters, and perform deployment to realize adaptation to different industries. 2.The fast customizable industry knowledge graph query and retrieval interface system of claim 1, wherein, the data and representation unit comprises: a data preparation module configured to collect text data of a target industry, construct an entity relationship extraction model by using a natural language processing technology, and extract structured knowledge triples from the text data; a knowledge graph and vector storage module configured to construct a knowledge graph according to the extracted knowledge triples, process the knowledge graph, generate a semantic vector, and store the semantic vector in an open-source vector database. 3.The fast customizable industry knowledge graph query and retrieval interface system of claim 2, wherein, the knowledge graph and vector storage module comprises: a graph storage submodule configured to store the extracted knowledge triples in a graph database to construct a knowledge graph; a vector representation submodule configured to train and optimize the knowledge graph by using a graph convolution network model, and generate a semantic vector based on an optimization result; a vector storage submodule configured to store the generated semantic vector in an open-source vector database, and establish an index to support subsequent similarity retrieval. 4.The industry knowledge graph query and retrieval interface system with quick customization according to claim 3, wherein, the training and optimization of the knowledge graph by using the graph convolution network model, and the generation of the semantic vector based on the optimization result comprise: exporting the knowledge graph from the graph database, and initializing a feature vector of each entity node in the knowledge graph based on an export result; According to the triples in the knowledge graph after initialization, an adjacency matrix representing the connection relationship between entity nodes is established; According to the established adjacency matrix, the feature vectors of the neighbor nodes of each entity node are aggregated using a propagation rule to update the feature vector of the current entity node, so as to construct a graph convolution network model; Taking link prediction as a training target, the loss function is calculated by using a back propagation algorithm to calculate the gradient of the parameters of the graph convolution network model, and the parameters of the graph convolution network model are updated by using a gradient descent optimizer until the graph convolution network model converges, thereby completing the training and optimization of the graph convolution network model; The entity nodes in the knowledge graph are input into the optimized graph convolution network model, and the feature vector output by the last layer is extracted as the semantic vector of each entity.
5. The rapidly customizable industry knowledge graph query and retrieval interface system of claim 1, wherein, The comprehensive score includes a semantic similarity score, a graph structure correlation score and an importance score.
6. The rapidly customizable industry knowledge graph query and retrieval interface system of claim 1, wherein, The domain adaptation engine module includes: A meta-training submodule is configured to collect knowledge graphs of different industries and corresponding annotation sets, and perform a meta-learning cycle on the collected results to obtain optimal initial meta-model parameters; A meta-adaptation submodule is configured to load the initial meta-model parameters, adjust the initial meta-model parameters using the annotation sets to generate meta-model parameters, and deploy the meta-model parameters to an online service environment to realize adaptation of different industries.
7. The rapidly customizable industry knowledge graph query and retrieval interface system of claim 1, wherein, The interaction and service unit includes: A hotword prompt and user interaction module is configured to mine target entities using a term frequency and inverse document frequency algorithm based on query logs of users, construct a global hotword library, and generate personalized recommendation results by combining similarity calculation, and show the personalized recommendation results to the users in a preset form; An architecture and deployment module is configured to use a microservice architecture, implement containerized deployment of the system based on a preset application container engine and an open source container orchestration system, and perform customized configuration through a predefined template. 8.The fast customizable industry knowledge graph query and retrieval interface system of claim 7, wherein, The hotword prompt and user interaction module includes: A global hotword library construction submodule is configured to periodically analyze query logs of all users using a term frequency and inverse document frequency algorithm, mine target entities in an open source vector database, construct a global hotword library, and cache the global hotword library in a key-value database; A personalized recommendation submodule is configured to trigger corresponding similarity calculation based on content input by a user in a search box, reorder global hotwords matched from the key-value database and similar entities calculated through the open source vector database, generate personalized recommendation results, and show the personalized recommendation results to the user in a preset form.
Citation Information
Patent Citations
Knowledge graph system based on graph algorithm and text search engine
CN117763158A
Medical knowledge graph construction and reasoning method and system, medium and equipment
CN119272861A