Construction method and device of knowledge base question-answering system, equipment and storage medium
Through text part-of-speech annotation, semantic embedding and logic mining technologies, the logical association and semantic context recognition difficulties of the knowledge base question-and-answer system when dealing with complex natural language problems are solved, the accuracy and relevance of the search results are improved, and the intelligence of the system is enhanced ability to handle complex problems.
Patent Information
- Application Number
- CN202411321421.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2025-01-10
AI Technical Summary
When the existing knowledge base question and answer system deals with complex natural language problems, it is difficult to accurately identify the logical association and semantic context between keywords, resulting in low accuracy and correlation of search results, especially when multi-layer logical relationship problems. It is impossible to build a reasonable semantic reasoning chain.
By obtaining user problems, text part-of-speech annotation and keyword vectorization are performed, semantic linear embedding and semantic spatial projection are performed, the logical connection between words is mined, the search text logic is generated, and semantic vector matching search is performed based on keyword semantic vectors, combined with coherent logic search is searched Generate answers.
It improves the system's semantic understanding and logical processing capabilities of user problems, ensures the relevance and accuracy of search results, and enhances the complex problem processing capabilities and intelligence level of the question-and-answer system.
Smart Images

Figure CN119293164A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of database construction, and in particular to a construction method, device, equipment and storage medium of a knowledge base question and answer system. Background Art
[0002] Knowledge base question answering system is an important application in the field of information retrieval and natural language processing in recent years. It aims to achieve efficient matching between user questions and data in the knowledge base through understanding and analysis of natural language text. Traditional information retrieval methods usually rely on keyword matching, but this method often fails to capture information at the semantic level when dealing with complex natural language problems, resulting in low accuracy and relevance of retrieval results. To solve this problem, researchers have begun to introduce semantic embedding technology in recent years to improve the retrieval system's ability to understand and match language meanings by converting keywords into semantic representations in vector space. However, existing systems still face many challenges when dealing with multi-layer logical relationships and semantic reasoning. During the construction process, the existing knowledge base question answering system can perform basic vectorization processing on keywords and achieve a certain degree of semantic matching through semantic space projection. However, in actual applications, due to the complexity and diversity of natural language expression, the system often ignores the logical association between keywords and the coherence of semantic context. Most systems cannot accurately identify the potential logical connection between words. Especially when dealing with problems involving multi-layer logical relationships, the system often cannot build a reasonable semantic reasoning chain, which affects the accuracy of the final retrieval results. Summary of the invention
[0003] Based on this, it is necessary to provide a method for constructing a knowledge base question answering system to solve at least one of the above technical problems.
[0004] To achieve the above purpose, a method for constructing a knowledge base question answering system includes the following steps:
[0005] Step S1: Obtain user question instructions; perform part-of-speech tagging on the user question instructions, and perform keyword vectorization to obtain a search text keyword vector;
[0006] Step S2: Perform semantic linear embedding processing on the search text keyword vector and perform semantic space projection to generate a keyword semantic vector;
[0007] Step S3: Perform word-to-word logic mining on the keyword vectors of the search text to obtain a set of logical connections between keywords; perform text logic recognition processing on the user's question instructions based on the set of logical connections between keywords to generate search text logic;
[0008] Step S4: performing semantic vector matching retrieval on the knowledge base based on the keyword semantic vector to obtain a candidate semantic query data set;
[0009] Step S5: Perform a coherent logical search on the candidate semantic query data set according to the search text logic and the search text keyword vector to generate a search target answer.
[0010] The present invention ensures that important information and keywords in user questions are accurately extracted and represented through text part-of-speech tagging and keyword vectorization, forms a retrieval text keyword vector, improves the accuracy of subsequent processing, and the keyword semantic vector generated by semantic linear embedding and semantic space projection processing can capture the deep semantic relationship of vocabulary, enhance the system's understanding ability of user question semantics, and ensure that the retrieval process can handle more complex semantic information. The logical connection set between keywords generated by inter-word logic mining and the text logic recognition processing based on this can analyze the relationship between keywords and the logical structure of user questions in detail, and improve the retrieval system's comprehensive understanding and accurate processing of question logic. Semantic vector matching retrieval based on keyword semantic vectors can accurately screen out candidate query data sets that are consistent with the semantics of user questions from the knowledge base, ensuring that the retrieval results are more relevant to user needs. Coherent logic retrieval combines retrieval text logic and keyword vectors, can comprehensively consider the logical structure of the problem and keyword information, generate more accurate and logically coherent retrieval target answers, and improve the question-answering system's ability to answer complex questions and accuracy.
[0011] Preferably, step S1 comprises the following steps:
[0012] Step S11: Obtain user question instructions;
[0013] Step S12: Perform multi-level word segmentation processing on the user's question instruction to obtain a word segmentation result set;
[0014] Step S13: performing deep part-of-speech tagging processing on the user question instruction according to the word segmentation result set to generate a part-of-speech tagging result;
[0015] Step S14: extract keywords from the part-of-speech tagging results to obtain keyword text data;
[0016] Step S15: Perform vector space encoding processing on the keyword text data to obtain the search text keyword vector.
[0017] The present invention improves the accuracy and granularity of text segmentation by performing multi-level word segmentation processing on user question instructions, effectively distinguishes different semantic units in the text, and lays a solid foundation for subsequent part-of-speech tagging and keyword extraction. Through deep part-of-speech tagging, detailed part-of-speech tagging results are generated, the grammatical role of each word in the text is accurately identified, the ability to understand the text structure and semantics is improved, and more accurate grammatical information is provided for subsequent keyword extraction and vectorization processing. Keyword extraction based on part-of-speech tagging results can identify keywords with important semantic information from the text, extract core information from complex texts, and improve the attention and relevance of user question instructions, thereby optimizing data processing in subsequent retrieval processes. Vector space encoding is performed on keyword text data to generate retrieval text keyword vectors. By converting keywords into vector form, the semantic relationship between words can be captured in the vector space, providing efficient numerical representation for subsequent semantic matching and retrieval, thereby improving the system's retrieval accuracy. Through the full process from multi-level word segmentation to vector space encoding, the ability to understand and process knowledge base texts can be systematically improved, the preprocessing process of text data is optimized, the system's ability to process complex queries and generate accurate answers is enhanced, and the intelligence level of the question-answering system is improved.
[0018] Preferably, step S2 comprises the following steps:
[0019] Step S21: performing spectral clustering analysis on the search text keyword vectors to obtain a semantic subspace set;
[0020] Step S22: performing local linear embedding processing on the search text keyword vector based on the semantic subspace set to generate keyword semantic representation;
[0021] Step S23: Initialize the separation matrix of the keyword semantic representation to obtain semantically independent features;
[0022] Step S24: Project the semantically independent features into feature space to generate keyword semantic vectors.
[0023] The present invention processes the search text keyword vectors through spectral clustering analysis, which can effectively divide the keyword vectors into multiple subspace sets with similar semantics, identify keyword groups with common semantic features in high-dimensional vector space, thereby improving the ability to understand the text semantic structure, and perform local linear embedding processing on the search text keyword vectors based on the semantic subspace set, which can generate more accurate keyword semantic representation, and use local linear features to retain the local structural information of the data, so that the generated semantic representation is more consistent with the actual semantic relationship, thereby enhancing the expression ability of the keywords, and obtain semantically independent features through separation matrix initialization, which can effectively separate and identify keywords in the feature space. Identify independent features of each semantic dimension, reduce redundant information between features, and improve the independence of features, thereby improving the robustness and accuracy of the system in processing complex semantics. Project the semantically independent features into feature space to generate keyword semantic vectors. By mapping independent semantic features into low-dimensional feature space, accurate keyword semantic vectors can be generated, making the system more efficient and accurate in the semantic matching and retrieval process. Through multi-level processing from spectral clustering to feature projection, the semantic representation and feature space structure of keywords can be systematically optimized, which significantly improves the system's ability to process complex semantic information and enhances the intelligence level and practical application effect of the question-answering system in different query scenarios.
[0024] Preferably, step S3 comprises the following steps:
[0025] Step S31: performing adjacency matrix conversion on the search text keyword vector to obtain a word relationship matrix;
[0026] Step S32: constructing an undirected graph of the inter-word relationship matrix to generate an undirected graph of inter-word relationship;
[0027] Step S33: extracting topological features from the undirected graph of inter-word relations to obtain an initial inter-word relation network;
[0028] Step S34: constructing a multi-layer graph convolutional network for the initial inter-word relationship network to obtain an inter-word semantic propagation model;
[0029] Step S35: performing conditional random field inference on the inter-word semantic propagation model to generate an inter-word probability dependency tree;
[0030] Step S36: mining the inter-word dependency pattern on the inter-word probability dependency tree to obtain a set of logical connections between keywords;
[0031] Step S37: performing feature vectorization on the logical relationship set between keywords to obtain a logical relationship feature vector;
[0032] Step S38: Perform text logic recognition processing on the user's question instructions according to the logical connection feature vector to generate retrieval text logic.
[0033] The present invention converts the search text keyword vectors into an adjacency matrix to obtain an inter-word relationship matrix, which can systematically capture the relationship information between keywords, provide accurate basic data for subsequent graph construction and feature extraction, ensure the comprehensiveness and accuracy of inter-word relationships, construct the inter-word relationship matrix as an undirected graph, generate an inter-word relationship undirected graph, can intuitively represent the relationship between keywords, and provide a clear structural view for subsequent topological feature extraction and model construction, understand the association pattern between words, perform topological feature extraction on the inter-word relationship undirected graph, obtain an initial inter-word relationship network, can mine the complex relationship pattern between keywords, and provide valuable topological information for subsequent graph convolutional networks and semantic propagation models, improve the understanding of inter-word dependency relationships, and obtain an inter-word semantic propagation model by constructing a multi-layer graph convolutional network, which can effectively capture and propagate semantic information between keywords, thereby improving the modeling ability of complex semantic relationships and enhancing the semantic understanding and processing of the system. It improves the ability of logical connection mining, performs conditional random field inference on the semantic propagation model between words, generates a probabilistic dependency tree between words, and can accurately calculate the probability of dependency between keywords, thereby providing a reliable probabilistic basis for logical connection mining and improving the accuracy of dependency analysis. It mines the inter-word dependency pattern on the probabilistic dependency tree between words to obtain the set of logical connections between keywords, which can systematically identify the logical connections between keywords and improve the accuracy of text logic recognition. It provides a detailed logical basis for generating retrieval text logic, quantizes the set of logical connections between keywords, generates a logical connection feature vector, and can convert complex logical connections into easy-to-process numerical features, which simplifies the subsequent logic recognition process and improves the processing efficiency of the system. It performs text logic recognition processing on user question instructions according to the logical connection feature vector and generates retrieval text logic, ensuring that the generation of retrieval text logic can fully consider the logical connections between keywords, thereby improving the relevance and accuracy of the retrieval results.
[0034] Preferably, step S4 comprises the following steps:
[0035] Step S41: performing semantic hierarchical analysis on the keyword semantic vector to obtain a multi-layer semantic structure;
[0036] Step S42: performing logical hierarchical matching on the search text logic according to the multi-layer semantic structure to generate semantic logic interaction data;
[0037] Step S43: construct a multi-dimensional composite search of the knowledge base based on the semantic logic interaction data to obtain an initial joint search framework;
[0038] Step S44: partitioning the initial joint retrieval framework into semantic units according to the multi-layer semantic structure to generate a distributed retrieval framework.
[0039] The present invention generates a multi-layer semantic structure by performing semantic hierarchical analysis on keyword semantic vectors, which can more finely characterize the relationship between different semantic levels, realize deep semantic understanding of complex question instructions, ensure that the retrieval system can capture more detailed information, perform logical hierarchical matching based on the multi-layer semantic structure, make the semantic logic of the retrieval text clearer, and can disassemble the questions input by users layer by layer and match the corresponding semantics, ensure the accurate docking of logic and semantics, improve the relevance and consistency of retrieval, construct multi-dimensional composite retrieval in the knowledge base, integrate multiple semantic levels and logical relationships through semantic logic interaction data, expand the retrieval dimension, thereby achieving wider data coverage and faster result generation, and construct a distributed retrieval framework by partitioning the initial joint retrieval framework into semantic units, which can effectively disperse the computing load of the system, improve the retrieval ability of the system on large-scale data sets, and enhance the parallel processing ability of the system for different semantic areas, ensure efficient response to multi-user and multi-query environments, and the semantic unit partitioning process ensures that the logical and semantic associations between different semantic units are effectively classified and distinguished, so that the retrieval strategy can be adjusted more flexibly in different query scenarios, and the overall retrieval accuracy and flexibility of the system can be improved.
[0040] Preferably, step S5 comprises the following steps:
[0041] Step S51: Map the distributed retrieval framework to the knowledge base to obtain an intelligent question-answering framework;
[0042] Step S52: performing hierarchical graph convolutional network processing on the intelligent question answering framework to obtain a dynamic knowledge graph;
[0043] Step S53: performing iterative command retrieval on the user's question command according to the dynamic knowledge graph to generate multiple retrieval results;
[0044] Step S54: performing deep learning mining on the multiple search results to obtain context-aware representations;
[0045] Step S55: Perform transfer learning fine-tuning on the intelligent question-answering framework based on context-aware representation to generate an adaptive question-answering engine to execute the construction of the knowledge base question-answering system.
[0046] The present invention maps the distributed retrieval framework to the knowledge base, so that the intelligent question-answering framework can effectively integrate and utilize distributed data resources, ensure that the system can efficiently respond to large-scale, multi-source data query tasks, and enhance the processing ability of the intelligent question-answering system for complex query scenarios. The intelligent question-answering framework is processed by a hierarchical graph convolutional network to generate a dynamic knowledge graph, so that the knowledge structure in the knowledge base can be dynamically updated according to new inputs and changing user questions, ensuring that the knowledge in the knowledge base always remains the latest and most relevant. Iterative instruction retrieval based on the dynamic knowledge graph can achieve multiple accurate matches of user questions, ensure that the information interaction in the question retrieval process is sufficient and accurate, effectively improve the relevance of the query results, and reduce the occurrence rate of invalid retrieval results. Deep learning and mining are performed on multiple retrieval results to generate context-aware representations, so that the system can perform more sophisticated semantic understanding and adjustment of query results based on context information, ensuring that the question-answering system responds to user questions more flexibly and accurately. Through transfer learning, the intelligent question-answering framework is fine-tuned to generate an adaptive question-answering engine, ensuring that the system can continuously optimize the performance of the question-answering engine by learning new contextual information and question structure, enhancing the adaptive and continuous learning capabilities of the question-answering system, and adapting to different user needs and changing knowledge backgrounds.
[0047] Preferably, step S53 includes the following steps:
[0048] Calculate the semantic similarity of the dynamic knowledge graph and user question instructions to obtain a semantic similarity matrix;
[0049] Perform similar semantic retrieval on the dynamic knowledge graph based on the semantic similarity matrix to generate a candidate semantic query dataset;
[0050] Based on the user's question instructions, multi-level logical matching is performed on the candidate semantic query data set to generate multiple retrieval results.
[0051] The present invention calculates the semantic similarity of the dynamic knowledge graph and the user question instruction, generates a semantic similarity matrix, ensures that the system can carefully capture the similarity between the user question and the semantic structure in the knowledge graph, thereby achieving more accurate semantic alignment and matching, and generates a candidate semantic query data set by performing similar semantic retrieval on the dynamic knowledge graph based on the semantic similarity matrix, ensuring that the retrieval process can focus on the knowledge nodes that are semantically close to the user question, reducing the interference of irrelevant information, speeding up the retrieval speed and improving the accuracy of the results. Based on the user question instruction, the candidate semantic query data set is matched at multiple levels of logic, and the system can comprehensively analyze the query results from different semantic levels and logical relationships, ensuring that the retrieval results can cover multiple dimensions and logical structures of the user's questions, and increasing the ability of the question-answering system to cope with complex problems. By generating multiple retrieval results through multi-level logical matching, the system can provide multiple potential answer paths according to the complexity and diversity of the user's questions, ensuring that the final generated results can cover the different needs of the user, and can accurately point to the core answer to the problem.
[0052] In this embodiment, a knowledge base question and answer device is provided, which is used to execute the method for constructing the knowledge base question and answer system as described above, including:
[0053] The data acquisition module is used to obtain user question instructions; perform part-of-speech tagging on the user question instructions, and perform keyword vectorization to obtain the search text keyword vector;
[0054] The semantic analysis module is used to perform semantic linear embedding processing on the search text keyword vector and perform semantic space projection to generate keyword semantic vector;
[0055] The logic analysis module is used to perform word-to-word logic mining on the keyword vectors of the search text to obtain a set of logical connections between keywords; based on the set of logical connections between keywords, the user's question instructions are processed for text logic recognition to generate search text logic;
[0056] A framework module is set up to perform hierarchical mapping of the knowledge base according to keyword semantic vectors and retrieval text logic, and to construct a composite retrieval framework to obtain a distributed retrieval framework;
[0057] The engine construction module is used to perform iterative instruction retrieval on user question instructions based on a distributed retrieval framework, and conduct deep learning mining to generate an intelligent question-answering engine to execute the construction of a knowledge base question-answering system.
[0058] In this embodiment, a knowledge base question and answer device is also provided, including a processor and a memory, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps of the method for constructing a knowledge base question and answer system as described in any one of the above are implemented.
[0059] In this embodiment, a computer-readable storage medium is further provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for constructing a knowledge base question and answer system as described in any one of the above are implemented.
[0060] The present invention uses a data acquisition module to perform text part-of-speech tagging and keyword vectorization, so that the system can accurately extract the core keywords in the user's questions and perform vectorization processing, thereby ensuring the accuracy and relevance of the retrieval process. The semantic analysis module performs semantic linear embedding and semantic space projection on the keyword vector, so that the system can convert the keyword into a semantic vector with deeper meaning, thereby strengthening the system's ability to understand semantic information and multi-dimensional matching. The logic analysis module uses inter-word logic mining and text logic recognition, so that the system can deeply analyze the logical connection between keywords, ensure a comprehensive analysis at the logical structure and semantic logic level of the user's questions, and then generate accurate retrieval text logic. The framework building module can create a distributed retrieval framework by performing hierarchical mapping of the knowledge base and constructing a composite retrieval framework, thereby ensuring the hierarchical data organization structure in the knowledge base, thereby achieving more efficient distributed retrieval and accurate matching. The engine construction module generates an intelligent question-answering engine through deep learning mining and iterative instruction retrieval, thereby ensuring that the system has adaptive learning and optimization capabilities when facing complex queries, and continuously improving the quality of question-answering and the accuracy of question matching. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] Figure 1 A schematic diagram of the steps of a method for constructing a knowledge base question answering system;
[0062] Figure 2 for Figure 1 Detailed implementation steps of step S2 in the flowchart;
[0063] Figure 3 for Figure 1 Detailed implementation steps of step S3 in FIG.
[0064] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0065] The technical method of the present invention is described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by technicians in this field without creative work are within the scope of protection of the present invention.
[0066] In addition, the accompanying drawings are only schematic illustrations of the present invention and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. The functional entities are implemented in software form, or in one or more hardware modules or integrated circuits, or in different network and / or processor methods and / or microcontroller methods.
[0067] It should be understood that, although the terms "first", "second", etc. may be used herein to describe various units, these units should not be limited by these terms. These terms are used only to distinguish one unit from another unit. For example, without departing from the scope of the exemplary embodiments, the first unit may be referred to as the second unit, and similarly the second unit may be referred to as the first unit. The term "and / or" used herein includes any and all combinations of one or more of the listed associated items.
[0068] To achieve the above purpose, see Figures 1 to 3 , a method for constructing a knowledge base question answering system, comprising the following steps:
[0069] Step S1: Obtain user question instructions; perform part-of-speech tagging on the user question instructions, and perform keyword vectorization to obtain a search text keyword vector;
[0070] Step S2: Perform semantic linear embedding processing on the search text keyword vector and perform semantic space projection to generate a keyword semantic vector;
[0071] Step S3: Perform word-to-word logic mining on the keyword vectors of the search text to obtain a set of logical connections between keywords; perform text logic recognition processing on the user's question instructions based on the set of logical connections between keywords to generate search text logic;
[0072] Step S4: performing hierarchical mapping processing on the knowledge base according to the keyword semantic vector and the search text logic, and constructing a composite search framework to obtain a distributed search framework;
[0073] Step S5: Perform iterative instruction retrieval on user question instructions based on a distributed retrieval framework, and perform deep learning mining to generate an intelligent question-answering engine to execute the construction of a knowledge base question-answering system.
[0074] In the embodiment of the present invention, refer to Figure 1 FIG. 1 is a schematic diagram of a step flow of a method for constructing a knowledge base question answering system according to the present invention. In this example, the method for constructing a knowledge base question answering system includes the following steps:
[0075] Step S1: Obtain user question instructions; perform part-of-speech tagging on the user question instructions, and perform keyword vectorization to obtain a search text keyword vector;
[0076] In this embodiment, the user's natural language question instruction is received from the input end. The question instruction can be a paragraph of text. The system processes it as input data. Then, the part-of-speech tagging algorithm in the natural language processing (NLP) technology is used to tag each word in the user's question instruction, and the noun, verb, adjective and other parts thereof are identified. Commonly used part-of-speech tagging algorithms include HMM models or CRF (conditional random field) models. The user's natural language question instruction is received from the input end. The question instruction can be a paragraph of text. The system processes it as input data. The part-of-speech tagging algorithm in the natural language processing (NLP) technology is used to tag each word in the user's question instruction, and the noun, verb, adjective and other parts thereof are identified. Commonly used part-of-speech tagging algorithms include HMM models or CRF (conditional random field) models.
[0077] Step S2: Perform semantic linear embedding processing on the search text keyword vector and perform semantic space projection to generate a keyword semantic vector;
[0078] In this embodiment, the keyword vector is further processed by semantic linear embedding. The purpose of semantic embedding is to rearrange words in a continuous semantic space so that words with similar semantics are closer in the vector space. The process is implemented through a deep neural network model, such as a Transformer model based on the BERT or GPT architecture. These models can capture the semantic relationship between words and generate more accurate keyword semantic vectors through multi-layer neural network embedding, projecting the keyword vectors into a high-dimensional semantic space. The purpose of semantic space projection is to map these vectors into a global vector space for subsequent semantic matching and logical analysis. Each keyword semantic vector represents its semantic similarity and semantic relationship with other words in this space. For example, after the embedding process, the vectors of "deep learning" and "machine learning" in the semantic space will be very close, while the distance between "image classification" and "data analysis" will be slightly farther.
[0079] Step S3: Perform word-to-word logic mining on the keyword vectors of the search text to obtain a set of logical connections between keywords; perform text logic recognition processing on the user's question instructions based on the set of logical connections between keywords to generate search text logic;
[0080] In this embodiment, the word-to-word logic mining is performed on the keyword vector of the retrieval text. First, the word-to-word relationship matrix is constructed, and the relationship between the words is analyzed using statistical methods or deep learning models (such as convolutional networks). By calculating the co-occurrence frequency of each pair of words or building a model using a semantic network, the logical connection between the keywords is identified. For example, the correlation of keywords is modeled using a co-occurrence matrix to obtain a set of logical connections between keywords. Based on these logical connections, the user question instructions are further processed for text logic recognition. This involves applying logical rules or algorithms (such as conditional random fields) to analyze the dependencies between keywords, generate the final retrieval text logic, and help understand and extract the core information and structure in the text.
[0081] Step S4: performing hierarchical mapping processing on the knowledge base according to the keyword semantic vector and the search text logic, and constructing a composite search framework to obtain a distributed search framework;
[0082] In this embodiment, the keyword semantic vector and the retrieval text logic are combined to perform hierarchical mapping processing on the content in the knowledge base. Based on the entity, concept, relationship and other structures of the knowledge base, the semantic vector of the retrieval text is mapped with the entities of each level in the knowledge base. This process adopts a hierarchical retrieval algorithm to perform semantic matching and mapping on the knowledge base layer by layer. The entities in the knowledge base are organized in a hierarchical structure, including a basic data layer, a semantic layer and a reasoning layer. The keyword semantic vector is projected into the knowledge base layer by layer to ensure the accuracy of the semantic matching. During the mapping process, a composite retrieval framework is constructed, which integrates the functions of semantic matching, logical reasoning and multi-layer retrieval to ensure efficient retrieval of the knowledge base through multi-dimensional semantics and logical connections. The bottom layer of the retrieval framework relies on a distributed retrieval engine, allowing parallel processing and distributed computing to accelerate the retrieval process of large-scale knowledge bases.
[0083] Step S5: Perform iterative instruction retrieval on user question instructions based on a distributed retrieval framework, and perform deep learning mining to generate an intelligent question-answering engine to execute the construction of a knowledge base question-answering system.
[0084] In this embodiment, based on the distributed retrieval framework, iterative instruction retrieval of user question instructions is started. Through the distributed retrieval framework, a recursive iterative method is used to repeatedly search and process user questions. The results of each round of retrieval will be used as input to optimize and guide the next round of retrieval operations. The iterative process ensures the accuracy and coverage of the retrieval results. In the iterative retrieval process, deep learning models (such as Transformer or LSTM networks) are used for semantic mining. These models automatically generate more accurate answers or reasoning results by learning complex semantic relationships in the knowledge base. The deep learning model can further improve the intelligence level of the question-answering system and ensure that the generated answers can meet the semantic requirements. Through multiple iterations and semantic mining of the deep learning model, an intelligent question-answering engine is generated. The engine can efficiently retrieve information in the knowledge base according to user questions and generate accurate answers. The core functions of the intelligent question-answering engine include semantic understanding, semantic matching, knowledge reasoning and answer generation.
[0085] Preferably, step S1 comprises the following steps:
[0086] Step S11: Obtain user question instructions;
[0087] Step S12: Perform multi-level word segmentation processing on the user's question instruction to obtain a word segmentation result set;
[0088] Step S13: performing deep part-of-speech tagging processing on the user question instruction according to the word segmentation result set to generate a part-of-speech tagging result;
[0089] Step S14: extract keywords from the part-of-speech tagging results to obtain keyword text data;
[0090] Step S15: Perform vector space encoding processing on the keyword text data to obtain the search text keyword vector.
[0091] In this embodiment, a receiving module is first set to capture user question instructions from an external input end. The user question instructions are input in the form of natural language text. The input data is received through a graphical user interface (GUI) or a command line interface. The input natural language text will be stored in a memory buffer for subsequent processing. The receiving module captures the user instructions by real-time monitoring. The system uses a language recognition tool to perform preliminary preprocessing on the input text data to remove stop words and irrelevant punctuation marks to ensure the validity of the instructions. The input text instructions such as "How to use deep learning to improve the accuracy of image classification" will be used as raw data for subsequent analysis. At each stage of the processing, all input texts will be automatically saved as log files for tracing and error troubleshooting, and the captured user problem instruction text will be input into the word segmentation processing module. This module uses a multi-level word segmentation algorithm. Commonly used word segmentation tools such as Jieba word segmentation library, HanLP or SpaCy are combined with rule-based word segmentation and statistical model-based word segmentation for hierarchical processing. The first level of word segmentation uses the dictionary rule matching method to roughly segment common words to identify clear vocabulary and phrases. The second level of word segmentation uses machine learning methods such as CRF or HMM (Hidden Markov Model) to subdivide irregular phrases, terms and new words to ensure that complex structures and uncommon words can be correctly identified. The word segmentation result set is stored in the order of words and represented in an array structure. Each word segmentation result is accompanied by information such as the position, length, and word segmentation confidence of the word to facilitate subsequent processing. For example, the question "How to use deep learning to improve the accuracy of image classification" obtains the following results after word segmentation "How to use deep learning to improve the accuracy of image classification" inputs the word segmentation result set into the part-of-speech tagging processing module. The system uses part-of-speech tagging algorithms such as CRF (conditional random field) or LSTM (long short-term memory network) and other sequence tagging models to perform deep part-of-speech tagging on the word segmentation results. Part-of-speech tagging tools such as NLTK and HanLP are often used for such tasks. Through dependency grammar and context analysis, the grammatical role of each word in the sentence is identified. Specific part-of-speech tags include noun (NN), verb (VV), adjective (JJ), preposition (IN), etc. The part-of-speech tagging process will generate a part-of-speech tagging result with the part-of-speech tag of each segmented word, and correct the unclear part of speech in combination with the context information. By setting keyword extraction rules, keywords with important semantics are screened out from the part-of-speech tagging results.Keyword extraction combines the TF-IDF algorithm (term frequency-inverse document frequency) or the TextRank algorithm to calculate the importance score of a word and determine whether it is a keyword based on its part of speech and context. The system usually extracts key words such as nouns, verbs, and adjectives and adverbs with important semantic contributions. It excludes unnecessary function words and stop words by performing grammatical analysis and context association on the sentences. For complex user question instructions, such as "How to use deep learning to improve the accuracy of image classification", the system extracts "deep learning", "image classification" and "accuracy" as keywords, and removes functional words such as "how" and "use". Keyword text data is saved in a data list, presented in the form of keywords and their context information, and the position of the keywords in the sentence is marked. Keyword vectorization uses word embedding Technologies such as Word2Vec, GloVe or BERT models are used to convert each keyword into a high-dimensional vector. The specific implementation of vector space encoding includes loading pre-trained word embedding models and using the semantic vectors generated by these models to represent the semantic information of keywords. For example, when using the BERT model, the system projects each keyword into a predefined high-dimensional space by processing the input keyword at the word embedding layer. The vector of each keyword captures its context-related information in the semantic space. For keywords such as "deep learning" and "image classification", vectors with similar semantics are generated according to the pre-trained models, and their distance in the vector space will be closer, while the vectors of "improvement" and "accuracy" have different semantic positions from them. The final generated keyword vector set contains the semantic features of the keywords.
[0092] Preferably, step S2 comprises the following steps:
[0093] Step S21: performing spectral clustering analysis on the search text keyword vectors to obtain a semantic subspace set;
[0094] Step S22: performing local linear embedding processing on the search text keyword vector based on the semantic subspace set to generate keyword semantic representation;
[0095] Step S23: Initialize the separation matrix of the keyword semantic representation to obtain semantically independent features;
[0096] Step S24: Project the semantically independent features into feature space to generate keyword semantic vectors.
[0097] As an example of the present invention, see Figure 2 As shown, in this example, step S2 includes:
[0098] Step S21: performing spectral clustering analysis on the search text keyword vectors to obtain a semantic subspace set;
[0099] In this embodiment, spectral clustering analysis is performed on the keyword vectors of the search text, and the similarity between each pair of keyword vectors in the search text is calculated. For example, a similarity matrix is constructed using cosine similarity or Euclidean distance. Assuming that there are keyword vectors A, B and C, a symmetric matrix is generated by calculating their similarity, in which each element represents the similarity of two keyword vectors. A Laplace matrix is constructed from the similarity matrix, and the Laplace matrix is obtained by subtracting the similarity matrix from the diagonal matrix. The diagonal matrix is a matrix whose diagonal elements are the sum of each row of the similarity matrix. The Laplace matrix is eigen-decomposed, and the eigenvectors corresponding to its first k smallest eigenvalues are calculated. These eigenvectors are used to represent the main structural features of the data. These eigenvectors are used as new feature representations and clustered using the k-means clustering algorithm. Each cluster obtained represents a semantic subspace, and the keyword vectors in each cluster have similar semantic features, thereby forming a semantic subspace set.
[0100] Step S22: performing local linear embedding processing on the search text keyword vector based on the semantic subspace set to generate keyword semantic representation;
[0101] In this embodiment, local linear embedding processing is performed on the keyword vectors of the retrieved text based on the semantic subspace set. Local linear embedding (LLE) is a nonlinear dimensionality reduction technology used to capture the local geometric structure of data, including: for each keyword vector, select its k nearest neighbors in the semantic subspace, based on cosine similarity or Euclidean distance, calculate the reconstruction weight of each keyword vector in its neighborhood, for each keyword vector, calculate its reconstruction weight in the neighborhood by minimizing the reconstruction error, and the reconstruction weight matrix represents how each keyword vector is linearly reconstructed by other vectors in its neighborhood. The reconstruction weight matrix is used to construct an objective function, and a low-dimensional embedding representation is obtained through an optimization process. The objective function is usually a function that minimizes the reconstruction error by preserving the local geometric structure, and the obtained low-dimensional embedding representation is used as the semantic representation of the keyword. These representations retain the local structural information of the keyword at a lower dimension.
[0102] Step S23: Initialize the separation matrix of the keyword semantic representation to obtain semantically independent features;
[0103] In this embodiment, a suitable separation matrix initialization method is selected, such as using random initialization or an initialization method based on principal component analysis (PCA). The separation matrix is used to decompose the semantic representation into different independent features. The semantic representation matrix is multiplied by the initialized separation matrix to obtain a preliminary feature representation. An independent feature matrix is generated by linear transformation of the semantic representation. An optimization algorithm such as gradient descent or quasi-Newton method is applied to adjust the separation matrix to improve the quality of independent features. The optimization process aims to enable the feature matrix to achieve feature independence while retaining semantic information. The semantic representation is converted into independent features by optimizing the separation matrix. These independent features can better capture the semantic information of keywords. For example, for the semantic representation of "machine learning" and "deep learning", the independent features obtained by initializing and optimizing the separation matrix include features related to "learning algorithm" and "data processing", thereby enhancing the independence and interpretability of the features.
[0104] Step S24: Project the semantically independent features into feature space to generate keyword semantic vectors.
[0105] In this embodiment, according to a specific projection method (such as principal component analysis PCA or linear discriminant analysis LDA), a suitable projection matrix is selected, and the projection matrix is used to map independent features to a new feature space. The semantic independent feature matrix is multiplied by the projection matrix, and the independent features are converted to the target feature space to generate new feature representations. These representations usually have higher discrimination and expression capabilities. During the projection process, the coordinates of each feature in the target space are calculated. These coordinates represent the position of the feature in the new feature space. The projected feature results are organized into semantic vectors of keywords. These semantic vectors represent the position of the keywords in the feature space and are used for subsequent semantic analysis and matching. For example, for the keywords of "deep learning" and "machine learning", they are converted to a new feature space through feature space projection to better reflect their positions and relationships in the new feature space.
[0106] Preferably, step S3 comprises the following steps:
[0107] Step S31: performing adjacency matrix conversion on the search text keyword vector to obtain a word relationship matrix;
[0108] Step S32: constructing an undirected graph of the inter-word relationship matrix to generate an undirected graph of inter-word relationship;
[0109] Step S33: extracting topological features from the undirected graph of inter-word relations to obtain an initial inter-word relation network;
[0110] Step S34: constructing a multi-layer graph convolutional network for the initial inter-word relationship network to obtain an inter-word semantic propagation model;
[0111] Step S35: performing conditional random field inference on the inter-word semantic propagation model to generate an inter-word probability dependency tree;
[0112] Step S36: mining the inter-word dependency pattern on the inter-word probability dependency tree to obtain a set of logical connections between keywords;
[0113] Step S37: performing feature vectorization on the logical relationship set between keywords to obtain a logical relationship feature vector;
[0114] Step S38: Perform text logic recognition processing on the user's question instructions according to the logical connection feature vector to generate retrieval text logic.
[0115] As an example of the present invention, see Figure 3 As shown, in this example, step S3 includes:
[0116] Step S31: performing adjacency matrix conversion on the search text keyword vector to obtain a word relationship matrix;
[0117] In this embodiment, cosine similarity or Euclidean distance is used to calculate the similarity between each pair of keyword vectors in the search text. Each element in the similarity matrix represents the degree of similarity between two keyword vectors. For example, for the keywords "artificial intelligence" and "machine learning", their similarities are calculated and filled in the corresponding positions of the matrix. A similarity threshold is set, and keyword pairs with similarities higher than the threshold are screened out, and these high-similarity keyword pairs are marked as adjacency relationships. The selection of the threshold is based on statistical analysis of the data or domain knowledge, and an adjacency matrix is created, in which the elements of the matrix represent the adjacency relationship between keyword pairs. If the similarity of the two keyword pairs is higher than the set threshold, the corresponding position in the adjacency matrix is assigned a value of 1, otherwise it is assigned a value of 0. For example, the element A{i,j} in the adjacency matrix is 1, indicating that keyword i has an adjacency relationship with keyword j. The adjacency matrix is a word relationship matrix, which is used to represent the relationship between each keyword in the search text.
[0118] Step S32: constructing an undirected graph of the inter-word relationship matrix to generate an undirected graph of inter-word relationship;
[0119] In this embodiment, based on the inter-word relationship matrix, the data structure of the undirected graph is initialized, wherein each keyword is regarded as a node in the graph, and the adjacency relationship between keywords is regarded as an edge in the graph. According to the non-zero elements in the inter-word relationship matrix, the corresponding nodes and edges are added to the undirected graph. For example, if the element A{i,j} in the adjacency matrix is 1, an edge connecting node i and node j is added to the undirected graph, and the weight of the edge is set to the similarity value to reflect the similarity between the keywords. For example, the weight of the edge is the value A{i,j} in the inter-word similarity matrix. The construction of the undirected graph is completed, including the setting of all nodes and edges. Each edge of the undirected graph has no directionality, indicating a bidirectional relationship between keywords.
[0120] Step S33: extracting topological features from the undirected graph of inter-word relations to obtain an initial inter-word relation network;
[0121] In this embodiment, the degree of each node is calculated, that is, the number of edges connected to each node. According to the degree or other topological features of the node, the core nodes in the network are identified. The core nodes are usually connected to more edges, indicating their importance in the inter-word relationship network. The network density of the undirected graph is calculated, that is, the ratio of the actual number of edges to the maximum number of edges. Including calculating the connected components, average path length and clustering coefficient of the network, these features are used to describe the overall structure and properties of the network. For example, in the constructed undirected graph, the degrees of the "deep learning" and "neural network" nodes are 3 and 2 respectively. If the degree of the "deep learning" node is higher, it is identified as a core node. The topological feature extraction results will construct an initial inter-word relationship network based on these features.
[0122] Step S34: constructing a multi-layer graph convolutional network for the initial inter-word relationship network to obtain an inter-word semantic propagation model;
[0123] In this embodiment, a multi-layer graph convolutional network (GCN) is applied to the initial inter-word relationship network to construct an inter-word semantic propagation model, and a suitable multi-layer graph convolutional network architecture is selected, such as stacking multiple graph convolutional layers, each layer processing node features and adjacency relationships in the graph, and for each layer of the graph convolutional network, the feature representation of the node is updated through a convolution operation, and the graph convolution operation involves weighted aggregation of the feature vector of each node with the feature vector of its neighboring nodes. At each layer, the neighbor information of the node is aggregated into the feature representation of the current node by weighted average or weighted sum, that is, by the product of the convolution matrix and the adjacency matrix. The graph convolutional network is trained using training data, and the model parameters are optimized to improve the performance of the inter-word semantic propagation model.
[0124] Step S35: performing conditional random field inference on the inter-word semantic propagation model to generate an inter-word probability dependency tree;
[0125] In this embodiment, conditional random field (CRF) reasoning is applied to the semantic propagation model between words to generate a probabilistic dependency tree between words. A conditional random field model is constructed, and the output of the semantic propagation model between words is used as the input feature. The CRF model is used to model the dependency relationship between words and generate a probabilistic dependency tree between words. A feature function is defined to calculate the feature value of a given node and edge. The feature function includes node features, edge features and their combination. The CRF model is trained using training data, and the model parameters are optimized to improve the accuracy of prediction. The training process includes estimating the model parameters by maximizing the log-likelihood function, and using the trained CRF model for reasoning to generate a probabilistic dependency tree between words. The tree represents the probabilistic dependency relationship between words and reflects the dependency structure between words. For example, in the "deep learning" and "neural network" models, the CRF model will use the features of the semantic propagation model for reasoning to generate a probabilistic tree of the dependency relationship between the two words, showing their dependency structure in the text.
[0126] Step S36: mining the inter-word dependency pattern on the inter-word probability dependency tree to obtain a set of logical connections between keywords;
[0127] In this embodiment, each node and edge in the word-to-word probability dependency tree is analyzed to identify dependency relationship patterns, for example, subject-predicate relationships, modifier relationships, etc., and dependency patterns between keywords are extracted based on the structure of the dependency tree. These patterns include different types of word-to-word relationships, such as subject-object relationships, attributive-predicate relationships, etc. The extracted dependency patterns are organized into a logical connection set. Each dependency pattern represents a specific logical relationship between words, which is used for subsequent text logic recognition. The characteristics of each dependency pattern are recorded, including the type of pattern, frequency, and its position in the dependency tree.
[0128] Step S37: performing feature vectorization on the logical relationship set between keywords to obtain a logical relationship feature vector;
[0129] In this embodiment, a suitable feature vectorization method is selected, such as the bag-of-words model, TF-IDF or word embedding, to convert the logical connection set into a feature vector, extract the dependency features between keywords from the logical connection set, and represent them as numerical feature vectors, each logical connection pattern is converted into an eigenvalue, and all the extracted feature vectors are combined into a feature matrix, in which each row in the matrix represents a feature vector of a logical relationship. The final logical connection feature vector is generated through the feature matrix for further text logic recognition processing. For example, for the "Computer Science-Machine Learning" pattern in the logical connection set, it is converted into a feature vector, such as [0.8, 0.6, 0.4], which represents the eigenvalue of the pattern.
[0130] Step S38: Perform text logic recognition processing on the user's question instructions according to the logical connection feature vector to generate retrieval text logic.
[0131] In this embodiment, the generated logical connection feature vector is loaded and matched with the features in the user question instruction, the similarity between the logical connection feature vector and the user question instruction feature vector is calculated, and a similarity measurement method (such as cosine similarity or Euclidean distance) is used. According to the calculated similarity, the user question instruction is logically identified, the text is logically classified into a logical pattern that matches the feature vector, and the identified text logic result is output to represent the logical structure of the retrieved text. For example, the logical connection feature vector [0.8, 0.6, 0.4] is compared with the features in the user question instruction, and the text logic category is obtained as "technology-application", and the retrieval text logic result is generated.
[0132] Preferably, step S4 comprises the following steps:
[0133] Step S41: performing semantic hierarchical analysis on the keyword semantic vector to obtain a multi-layer semantic structure;
[0134] Step S42: performing logical hierarchical matching on the search text logic according to the multi-layer semantic structure to generate semantic logic interaction data;
[0135] Step S43: construct a multi-dimensional composite search of the knowledge base based on the semantic logic interaction data to obtain an initial joint search framework;
[0136] Step S44: partitioning the initial joint retrieval framework into semantic units according to the multi-layer semantic structure to generate a distributed retrieval framework.
[0137] In this embodiment, a semantic model such as BERT or Transformer is used to perform contextual association analysis on each keyword vector, and a multi-head self-attention mechanism is used to analyze the context of each keyword vector. The system calculates the interdependence between semantics. The parsing module extracts semantic features layer by layer, separates semantic information at different levels and constructs a multi-layer semantic structure. The structure usually includes multiple levels such as word-level semantics, phrase-level semantics and sentence-level semantics. The semantic structure at each level generates aggregation results at different semantic levels through the allocation of semantic feature weights and clustering algorithms, such as K-Means, to ensure that semantic features of different granularities are captured in complex semantic relationships. The system generates a multi-layer semantic structure graph. The semantic nodes at each level represent corresponding semantic units. These nodes retain their respective semantic weights and hierarchical relationships in the multi-layer semantic structure graph. The system stores the multi-layer semantic structure as tree-structured data to support semantic matching and retrieval operations in subsequent steps. The matching module is based on a logical hierarchical framework and associates semantic hierarchical information with text logical structures through a semantic-logical mapping mechanism. The specific operations include analyzing logical relationships in the text, such as causal relationships, contrast relationships and sequential relationships, at different semantic levels. During the matching process, the system uses graph matching-based algorithms, such as the shortest path algorithm (Shortest Path Algorithm) or a logical matching method based on topological sorting to match each node in the multi-layer semantic structure with the logical node.The matching results are weighted according to the degree of semantic and logical association to form a semantic and logical interaction data set. The semantic and logical interaction data is stored in a table, which includes the matching relationship between each semantic hierarchical node and the corresponding logical node and its weight distribution. The retrieval module loads multimodal data in the knowledge base, including text, images, videos, etc., and uses semantic and logical interaction data as retrieval conditions. The retrieval process combines vector retrieval technology and logical rule retrieval technology. The system first uses a vectorized model to vectorize the data in the knowledge base and generates a semantic vector representation for each entry in the knowledge base. The system is based on a multi-dimensional composite retrieval method, combined with Boolean logic rules, fuzzy logic matching and graph-based similarity calculation, to match the semantic nodes and logical nodes in the semantic and logical interaction data with the knowledge base entries. Technologies such as LSH (locally sensitive hashing) are used to improve the retrieval speed and ensure efficient comparison of high-dimensional semantic vectors. The initial joint The retrieval framework is constructed through this series of operations. The framework includes the mapping relationship between retrieval keywords and knowledge base data, as well as the corresponding logical and semantic weight information. The semantic partitioning algorithm is used to classify the retrieval items in the initial joint retrieval framework according to the semantic hierarchy. The semantic unit partitioning uses clustering algorithms such as K-Means or density-based clustering methods (DBSCAN) to partition the nodes in the semantic hierarchy. Each semantic unit represents a semantic class. The partitioning is based on the similarity of semantic nodes and the association of logical nodes, ensuring that the items in the same partition have highly relevant semantic information. Each partition is assigned to a distributed storage module to generate a distributed retrieval framework. The semantic units stored in each distributed node are optimized through vector indexing technology to ensure that relevant items can be quickly located during the retrieval process. The distributed retrieval framework is completed and deployed in the distributed computing cluster of the knowledge base.
[0138] Preferably, step S5 comprises the following steps:
[0139] Step S51: Map the distributed retrieval framework to the knowledge base to obtain an intelligent question-answering framework;
[0140] Step S52: performing hierarchical graph convolutional network processing on the intelligent question answering framework to obtain a dynamic knowledge graph;
[0141] Step S53: performing iterative command retrieval on the user's question command according to the dynamic knowledge graph to generate multiple retrieval results;
[0142] Step S54: performing deep learning mining on the multiple search results to obtain context-aware representations;
[0143] Step S55: Perform transfer learning fine-tuning on the intelligent question-answering framework based on context-aware representation to generate an adaptive question-answering engine to execute the construction of the knowledge base question-answering system.
[0144] In this embodiment, a distributed retrieval framework is loaded and mapped to an existing knowledge base. The knowledge base contains multimodal data sources, covering multiple data types such as text, pictures, and audio. The mapping operation is implemented through a one-to-many mapping algorithm. First, an index mechanism is used to dock each semantic unit in the distributed retrieval framework with the relevant data entries in the knowledge base. The inverted index technology is used to generate a unique identifier for each data entry in the knowledge base, and the keywords and semantic features in the semantic unit are mapped and docked. The mapped data entries are distributed to different nodes using distributed storage technology to ensure that the retrieval framework can perform operations quickly and in parallel in the knowledge base, and finally complete the fusion of the distributed retrieval framework and the knowledge base, generate an intelligent question-and-answer framework, and establish a node representation for each semantic unit and knowledge base entry in the intelligent question-and-answer framework. The structural representation of the generated graph, each node in the graph represents a semantic unit or knowledge entry, and the edges between nodes represent semantic associations and logical relationships. The graph convolutional network updates the feature vector of each node through a recursive convolution operation. This operation propagates layer by layer, so that the features of each node can aggregate the information of its neighboring nodes, and gradually form a multi-level feature expression.Each layer of convolution operation is based on the sparse representation of the adjacency matrix to ensure the efficient operation of the convolution process. After multiple rounds of convolution processing, the system obtains a dynamic knowledge graph. Each node in the graph not only retains its own feature information, but also integrates the contextual information of the surrounding nodes, thereby comprehensively characterizing the semantics and logical relationships in the knowledge base at the overall level of the graph. The user's question instructions are vectorized and used as input. The hierarchical semantic structure in the graph convolution network is used to match the nodes in the dynamic knowledge graph. The degree of association between the user instructions and the nodes in the knowledge graph is determined by semantic similarity calculations, such as cosine similarity or Euclidean distance. During the matching process, the system adopts an iterative retrieval mechanism. In each retrieval, the graph structure is deepened layer by layer to expand the retrieval scope. Through recursive calculations, the weight and priority of each node are adjusted to ensure that the retrieval results are gradually accurate. After each round of iterative retrieval, the system records the current retrieval results and uses them as the input conditions for the next round of retrieval until multiple retrieval results related to the user's question instructions are generated. All retrieval results are input into the deep neural network. Through the network (such as LSTM, GRU or Transformer models), the contextual semantic relationship is captured through hierarchical analysis. First, semantic features are extracted at the word level, sentence level and document level for each retrieval result. Through the back-propagation algorithm, the system gradually optimizes the model parameters so that the semantic features of each retrieval result more accurately reflect its contextual association. The context-aware model uses a multi-head attention mechanism (Multi-headAttention) to capture the global semantic dependencies in the retrieval results, ensuring that key information can be accurately extracted in long texts or complex semantic environments. Finally, a context-aware representation of each retrieval result is generated and embedded and encoded as the input for the next step of transfer learning. A pre-trained model, such as BERT or GPT, is used to load the context-aware representation as the input for transfer learning. During the transfer learning process, the system fine-tunes the model parameters so that the intelligent question-answering framework can better adapt to the needs of specific fields or specific types of questions. The gradient descent method is used to optimize the model parameters to ensure that the model can gradually adapt to the new data distribution and semantic environment. During the fine-tuning process, the system will conduct multiple rounds of training and verification, select the best model parameters through cross-validation, and finally generate an adaptive question-answering engine.
[0145] Preferably, step S53 includes the following steps:
[0146] Calculate the semantic similarity of the dynamic knowledge graph and user question instructions to obtain a semantic similarity matrix;
[0147] Perform similar semantic retrieval on the dynamic knowledge graph based on the semantic similarity matrix to generate a candidate semantic query dataset;
[0148] Based on user question instructions, multi-level logical matching is performed on candidate semantic query data sets to generate multiple retrieval results.
[0149] In this embodiment, the semantic features of each node are extracted from the dynamic knowledge graph. These nodes correspond to relevant information entries in the knowledge base, and their semantic associations are displayed through the hierarchical structure of the knowledge graph. The user question instructions need to undergo deep natural language processing (NLP) to perform word segmentation, part-of-speech tagging and vector representation. The vector representation of the user question instruction is calculated similarity with each node vector in the knowledge graph. Commonly used similarity calculation methods include cosine similarity, Euclidean distance or Mahalanobis distance, etc. The purpose of the similarity calculation is to evaluate the semantic relevance between the user question and each node in the knowledge graph through the angle or distance between the vectors. During the calculation process, the system traverses each node in the graph, compares the vector of each node with the question vector one by one, and generates a semantic similarity matrix. Each element in the matrix represents the semantic similarity between the question instruction and a node in the graph. After the semantic similarity matrix is generated, the system analyzes the matrix and filters out nodes with high similarity according to the set threshold. The similarity threshold is set by expert experience or training data. Common methods include determining the screening criteria by standardization or adaptive adjustment based on the similarity distribution in the matrix. The system will select several nodes with high similarity to the user's question from the matrix. These nodes will be used as candidate semantic units. The system uses graph traversal algorithms (such as depth-first search or breadth-first search) based on the graph structure where these nodes are located to expand related nodes to the surrounding areas. Point set, forming a similar semantic search range. By traversing the semantic links of adjacent nodes, the system gradually expands the search range to ensure that it covers the multi-dimensional semantic information related to the user's question, and finally generates a candidate semantic query data set containing several candidate nodes and their associated semantic information. The data set contains all the information related to the question in the knowledge base. According to the semantic structure of the user's question instruction, it is decomposed into multiple levels, including main questions, secondary questions, modifiers, etc. Then, a multi-level matching algorithm (such as a matching method based on hierarchical clustering) is used to match the semantic information in the candidate semantic query data set layer by layer according to the semantic hierarchy of the user's question. Each layer of matching process evaluates the relevance of the semantic unit of this layer with each node in the candidate data set by calculating the semantic similarity and logical dependency. The system starts to match step by step from the deepest semantic structure to ensure that the matching results of each layer of semantics can be recursively integrated into the upper layer matching. After multiple rounds of matching, the system selects the node set most relevant to the user's question instruction from the candidate semantic query data set and generates multiple search results. Each search result contains the corresponding knowledge entry and its associated information, which are sorted by similarity and logical relationship as the final result output by the system.
[0150] In this embodiment, a knowledge base question and answer device is provided, which is used to execute the method for constructing the knowledge base question and answer system as described above, including:
[0151] The data acquisition module is used to obtain user question instructions; perform part-of-speech tagging on the user question instructions, and perform keyword vectorization to obtain the search text keyword vector;
[0152] The semantic analysis module is used to perform semantic linear embedding processing on the search text keyword vector and perform semantic space projection to generate keyword semantic vector;
[0153] The logic analysis module is used to perform word-to-word logic mining on the keyword vectors of the search text to obtain a set of logical connections between keywords; based on the set of logical connections between keywords, the user's question instructions are processed for text logic recognition to generate search text logic;
[0154] A framework module is set up to perform hierarchical mapping of the knowledge base according to keyword semantic vectors and retrieval text logic, and to construct a composite retrieval framework to obtain a distributed retrieval framework;
[0155] The engine construction module is used to perform iterative instruction retrieval on user question instructions based on a distributed retrieval framework, and conduct deep learning mining to generate an intelligent question-answering engine to execute the construction of a knowledge base question-answering system.
[0156] In this embodiment, a knowledge base question and answer device is also provided, including a processor and a memory, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps of the method for constructing a knowledge base question and answer system as described in any one of the above are implemented.
[0157] In this embodiment, a computer-readable storage medium is further provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for constructing a knowledge base question and answer system as described in any one of the above are implemented.
[0158] The present invention uses a data acquisition module to perform text part-of-speech tagging and keyword vectorization, so that the system can accurately extract the core keywords in the user's questions and perform vectorization processing, thereby ensuring the accuracy and relevance of the retrieval process. The semantic analysis module performs semantic linear embedding and semantic space projection on the keyword vector, so that the system can convert the keyword into a semantic vector with deeper meaning, thereby strengthening the system's ability to understand semantic information and multi-dimensional matching. The logic analysis module uses inter-word logic mining and text logic recognition, so that the system can deeply analyze the logical connection between keywords, ensure a comprehensive analysis at the logical structure and semantic logic level of the user's questions, and then generate accurate retrieval text logic. The framework building module can create a distributed retrieval framework by performing hierarchical mapping of the knowledge base and constructing a composite retrieval framework, thereby ensuring the hierarchical data organization structure in the knowledge base, thereby achieving more efficient distributed retrieval and accurate matching. The engine construction module generates an intelligent question-answering engine through deep learning mining and iterative instruction retrieval, thereby ensuring that the system has adaptive learning and optimization capabilities when facing complex queries, and continuously improving the quality of question-answering and the accuracy of question matching.
[0159] Those skilled in the art clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems, systems and units refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0160] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it is stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or partly or all or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media for storing program codes such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0161] Therefore, the embodiments should be regarded as illustrative and non-restrictive from all points, and the scope of the present invention is limited by the appended claims rather than the above description, and it is therefore intended that all changes falling within the meaning and range of equivalent elements of the application documents are included in the present invention.
[0162] The above description is only a specific embodiment of the present invention, so that those skilled in the art can understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but should conform to the widest scope consistent with the principles and novel features invented herein.
Claims
1. A method for constructing a knowledge base question answering system, characterized in that: The following steps are involved: Step S1: Obtain user question instructions; perform part-of-speech tagging on the user question instructions, and perform keyword vectorization to obtain a search text keyword vector; Step S2: Perform semantic linear embedding processing on the search text keyword vector and perform semantic space projection to generate a keyword semantic vector; Step S3: Perform word-to-word logic mining on the keyword vectors of the search text to obtain a set of logical connections between keywords; perform text logic recognition processing on the user's question instructions based on the set of logical connections between keywords to generate search text logic; Step S4: performing hierarchical mapping processing on the knowledge base according to the keyword semantic vector and the search text logic, and constructing a composite search framework to obtain a distributed search framework; Step S5: Perform iterative instruction retrieval on user question instructions based on a distributed retrieval framework, and perform deep learning mining to generate an intelligent question-answering engine to execute the construction of a knowledge base question-answering system.
2. The method for constructing a knowledge base question-answering system according to claim 1, characterized in that: Step S1 includes the following steps: Step S11: Obtain user question instructions; Step S12: Perform multi-level word segmentation processing on the user's question instruction to obtain a word segmentation result set; Step S13: performing deep part-of-speech tagging processing on the user question instruction according to the word segmentation result set to generate a part-of-speech tagging result; Step S14: extract keywords from the part-of-speech tagging results to obtain keyword text data; Step S15: Perform vector space encoding processing on the keyword text data to obtain the search text keyword vector.
3. The method for constructing a knowledge base question-answering system according to claim 1, characterized in that: Step S2 includes the following steps: Step S21: performing spectral clustering analysis on the search text keyword vectors to obtain a semantic subspace set; Step S22: performing local linear embedding processing on the search text keyword vector based on the semantic subspace set to generate keyword semantic representation; Step S23: Initialize the separation matrix of the keyword semantic representation to obtain semantically independent features; Step S24: Project the semantically independent features into feature space to generate keyword semantic vectors.
4. The method for constructing a knowledge base question-answering system according to claim 1, characterized in that: Step S3 includes the following steps: Step S31: performing adjacency matrix conversion on the search text keyword vector to obtain a word relationship matrix; Step S32: constructing an undirected graph of the inter-word relationship matrix to generate an undirected graph of inter-word relationship; Step S33: extracting topological features from the undirected graph of inter-word relations to obtain an initial inter-word relation network; Step S34: constructing a multi-layer graph convolutional network for the initial inter-word relationship network to obtain an inter-word semantic propagation model; Step S35: performing conditional random field inference on the inter-word semantic propagation model to generate an inter-word probability dependency tree; Step S36: mining the inter-word dependency pattern on the inter-word probability dependency tree to obtain a set of logical connections between keywords; Step S37: performing feature vectorization on the logical relationship set between keywords to obtain a logical relationship feature vector; Step S38: Perform text logic recognition processing on the user's question instructions according to the logical connection feature vector to generate retrieval text logic.
5. The method for constructing a knowledge base question-answering system according to claim 1, characterized in that: Step S4 includes the following steps: Step S41: performing semantic hierarchical analysis on the keyword semantic vector to obtain a multi-layer semantic structure; Step S42: performing logical hierarchical matching on the search text logic according to the multi-layer semantic structure to generate semantic logic interaction data; Step S43: construct a multi-dimensional composite search of the knowledge base based on the semantic logic interaction data to obtain an initial joint search framework; Step S44: partitioning the initial joint retrieval framework into semantic units according to the multi-layer semantic structure to generate a distributed retrieval framework.
6. The method for constructing a knowledge base question-answering system according to claim 1, characterized in that: Step S5 includes the following steps: Step S51: Map the distributed retrieval framework to the knowledge base to obtain an intelligent question-answering framework; Step S52: performing hierarchical graph convolutional network processing on the intelligent question-answering framework to obtain a dynamic knowledge graph; Step S53: performing iterative command retrieval on the user's question command according to the dynamic knowledge graph to generate multiple retrieval results; Step S54: performing deep learning mining on the multiple search results to obtain context-aware representations; Step S55: Perform transfer learning fine-tuning on the intelligent question-answering framework based on context-aware representation to generate an adaptive question-answering engine to execute the construction of the knowledge base question-answering system.
7. The method for constructing a knowledge base question-answering system according to claim 6, characterized in that: Step S53 includes the following steps: Calculate the semantic similarity of the dynamic knowledge graph and user question instructions to obtain a semantic similarity matrix; Perform similar semantic retrieval on the dynamic knowledge graph based on the semantic similarity matrix to generate a candidate semantic query dataset; Based on the user's question instructions, multi-level logical matching is performed on the candidate semantic query data set to generate multiple retrieval results.
8. A knowledge base question and answer device, characterized in that: A method for constructing a knowledge base question-answering system for executing claim 1, comprising: The data acquisition module is used to obtain user question instructions; perform part-of-speech tagging on the user question instructions, and perform keyword vectorization to obtain the search text keyword vector; The semantic analysis module is used to perform semantic linear embedding processing on the search text keyword vector and perform semantic space projection to generate keyword semantic vector; The logic analysis module is used to perform word-to-word logic mining on the keyword vectors of the search text to obtain a set of logical connections between keywords; based on the set of logical connections between keywords, the user's question instructions are processed for text logic recognition to generate search text logic; A framework module is set up to perform hierarchical mapping of the knowledge base according to keyword semantic vectors and retrieval text logic, and to construct a composite retrieval framework to obtain a distributed retrieval framework; The engine construction module is used to perform iterative instruction retrieval on user question instructions based on a distributed retrieval framework, and conduct deep learning mining to generate an intelligent question-answering engine to execute the construction of a knowledge base question-answering system.
9. A knowledge base question-answering device, comprising a processor and a memory, wherein a computer program is stored in the memory, characterized in that: When the processor executes the computer program, the steps of the method for constructing a knowledge base question-answering system according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for constructing a knowledge base question-answering system as described in any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Method and system for generating chart through question and answer dialogue and storage medium
CN119578392A
Construction site inspection method based on data processing
CN119648202A
Human-computer interaction method and device based on AI intelligent pen container
CN119782487A
A Human-Computer Interaction Method and Device Based on an AI Intelligent Pen Holder
CN119782487B
Method for searching content creation object
CN119782578A