Question and answer method for graph-driven fusion retrieval in field of computer networks

By constructing structured knowledge graphs and multi-channel fusion retrieval, combined with intention-driven hierarchical semantic matching and Prompt generation, the problem of professional term matching and knowledge graph incompleteness of existing question-and-answer systems in the field of computer networks is solved, and high-quality, interpretable answer generation and knowledge traceability are achieved.

CN120336477APending Publication Date: 2025-07-18JIANGSU UNIV OF SCI & TECH
View PDF 0 Cites 19 Cited by

Patent Information

Application Number
CN202510419265.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-03
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

In the field of computer networks, existing question-and-answer systems have problems such as insufficient professional term matching and semantic recall capabilities, incomplete knowledge graphs, and poor targeted answer generation and insufficient credibility due to single search mode.

Method used

The graph-driven fusion search and question-answer method is adopted to improve the accuracy and interpretability of the question-answer system by building a structured knowledge graph, combining intention-driven multi-channel fusion search, hierarchical semantic matching, and Prompt generation and answer traceability mechanism.

Benefits of technology

It significantly improves the professionalism and interpretability of Q&A systems in the field of computer networks, can generate high-quality and credible answers, and provides traceability of knowledge sources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120336477A_ABST
    Figure CN120336477A_ABST
Patent Text Reader

Abstract

The invention discloses a question answering method for graph-driven fusion retrieval in the field of computer networks, and relates to technologies such as intention recognition, multi-channel fusion retrieval, hierarchical semantic matching and answer traceable generation. Aiming at the problems of professional term matching, incomplete knowledge, single retrieval and low answer credibility of an existing question-answering system, a dual-channel fusion retrieval and hierarchical semantic matching mechanism based on a knowledge graph is provided, a retrieval strategy is dynamically controlled through intention recognition, accurate matching of structured knowledge is realized by adopting phrase preliminary screening and triple fine matching, and the accuracy of the structured knowledge is improved. In combination with graph subgraph dynamic construction and Prompt generation, a large language model is guided to output high-quality answers, traceable knowledge sources are attached, and the accuracy and credibility of the answers are improved. The method is widely applicable to computer network professional question and answer scenes such as network protocols, configuration management and troubleshooting.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer networks, and specifically to a question - answering method based on graph - driven fusion retrieval. This method combines an intention - driven retrieval strategy, knowledge graph enhancement, and large - model generation technology, and is mainly applied to intelligent question - answering systems in professional fields such as computer network protocols, data transmission, network security, and fault troubleshooting. By optimizing the knowledge retrieval and question - answering generation processes, the present invention aims to improve the accuracy, stability, and interpretability of complex questions in the field of computer networks. Background Art

[0002] With the rapid development of computer network technology, the knowledge systems in fields such as network protocols, data transmission, and fault troubleshooting have become increasingly complex. Existing question - answering systems have significant deficiencies in dealing with professional questions. Traditional question - answering systems mostly rely on keyword retrieval or vector retrieval, but when dealing with polysemous words, synonyms, and complex terms, they often have low retrieval relevance due to insufficient matching ability, and it is difficult to meet the high - quality question - answering requirements in professional scenarios.

[0003] The existing technologies mainly have the following problems: First, the ability of professional term matching and semantic recall is insufficient, and it is difficult to accurately identify complex protocols, transmission mechanisms, and troubleshooting knowledge in the field of computer networks; second, the knowledge graph has fragmentation and information loss phenomena, lacking task - oriented structured and in - depth knowledge support, and the generated answers have poor pertinence and low credibility; third, most adopt a single retrieval mode, lacking the fusion of keyword and semantic information, unable to make full use of graph knowledge, and severely restricting the answering efficiency and accuracy of complex questions.

[0004] To address the above problems, the present invention proposes a retrieval and question - answering method combining graph enhancement and multi - channel fusion. Through intention recognition, hierarchical matching, and graph knowledge injection, it effectively improves the accuracy, professionalism, and interpretability of the question - answering system in the field of computer networks. Summary of the Invention

[0005] The purpose of the present invention is to provide a graph - driven fusion retrieval and question - answering method applicable to the field of computer networks to solve problems such as insufficient professional term matching, incomplete knowledge graph, limitations of a single retrieval mechanism, and insufficient credibility of answers in existing question - answering systems. By constructing a structured graph based on computer - network - related data sets, combining intention - driven multi - channel fusion retrieval, hierarchical semantic matching, and Prompt generation and answer traceability mechanisms, it significantly improves the accuracy, professionalism, and interpretability of the question - answering system in the field of computer networks.

[0006] The core solution of the present invention includes seven steps: graph construction, two - channel fusion retrieval, hierarchical semantic matching, sub - graph construction of the graph, Prompt generation, and answer traceability, which are specifically as follows:

[0007] 1. Knowledge Graph Construction Method

[0008] The present invention proposes a method for constructing a structured knowledge graph in the field of computer networks, including data preprocessing, triple extraction, and graph modeling.

[0009] The system first standardizes textbooks, standards, and technical documents using Microsoft's Markitdown tool, retaining basic structures such as document titles and paragraphs. Subsequently, the text is chunked in a sliding window manner based on the LangChain framework, and a unique identifier section_id is assigned to each chunk. The system uses a locally deployed large language model, guided by Prompts, to extract triples in the format of "(head,relation,tail)", extracting entities and their semantic relationships in the network domain.

[0010] Finally, a knowledge graph is constructed based on the Neo4j graph database. The chunks are used as Knowledge_section nodes, and the triples are used as Knowledge_node nodes, connected by the HAS_TRIPLE relationship to form an explicit graph for tasks such as network protocols, configuration, and troubleshooting, providing support for subsequent fusion retrieval and question answering.

[0011] 2. Keyword Extraction and Vectorization Processing

[0012] To support subsequent fusion retrieval and hierarchical matching, the present invention designs a keyword extraction and vectorization processing mechanism based on chunks and triples. The system extracts a keyword set based on the chunks and triples in the knowledge graph using methods such as TF-IDF, TextRank, or BERT as features for keyword retrieval. At the same time, information such as section_id is written into the inverted index, and a keyword index library is constructed based on Elasticsearch. To achieve semantic similarity retrieval, the system uses SentenceTransformer to vectorize the chunks and triples, and the generated vectors and their corresponding meta-information such as section_id and vector ID are uniformly stored in the Faiss vector retrieval library. Through this method, the system completes the retrieval index for the keyword and semantic dual channels, providing efficient support for fusion retrieval and hierarchical matching.

[0013] 3. Intent Recognition and Task-Driven Analysis Method

[0014] The present invention designs a task-driven analysis method based on intent recognition as the core control mechanism for multi-channel fusion retrieval and answer generation. The system adopts an intent classification model based on XLM-RoBERTa, combines SentencePiece tokenization and VocabTransform mapping to complete context encoding for the user input question, and discriminates the question intent through a multi-classification classification head. The system divides common questions in the field of computer networks into 14 categories, including task types such as definition, configuration, troubleshooting, principle, comparison, etc., comprehensively covering network professional scenarios. The model is trained with an artificially labeled intent classification dataset, combined with cross-entropy loss and AdamW optimization strategy to achieve high-precision intent recognition. In practical applications, the system dynamically controls fusion retrieval, hierarchical matching, graph subgraph construction, and Prompt template selection based on the predicted intent labels to ensure that the system can achieve professional and accurate task-driven processing for different questions.

[0015] 4. Fusion Retrieval Mechanism

[0016] The present invention proposes a dual-channel fusion retrieval mechanism based on keyword retrieval and semantic vector retrieval, which effectively improves the retrieval accuracy and coverage of complex problems in the field of computer networks. In the keyword channel, the system uses tokenization and a domain term dictionary to extract high-value keywords and obtains Top-N candidate chunks based on inverted index and BM25 ranking. In the vector channel, the system uses SentenceTransformer to perform semantic encoding on the question, calculates its similarity with chunks and triples in the Faiss vector library, and forms Top-M semantic candidate chunks. To fuse the results of the two channels, the system normalizes the BM25 score and the semantic similarity score, and dynamically assigns fusion weights according to the user intent to calculate the comprehensive score. After the candidate set is de-duplicated by section_id, it is sorted by the fusion score to generate Top-K fusion candidates as the input for hierarchical semantic matching, taking into account both term recall and semantic understanding capabilities.

[0017] 5. Hierarchical Semantic Matching Mechanism

[0018] The present invention proposes a hierarchical semantic matching mechanism composed of paragraph-level preliminary screening and triple refinement, which realizes accurate positioning from coarse-grained text to fine-grained knowledge units. First, the system calculates the similarity based on the semantic vector of the user question for the candidate chunks obtained by fusion retrieval and selects Top-K chunks as the candidates for subsequent refinement, effectively compressing the matching scale. Subsequently, the system extracts the triples in the candidate chunks, uniformly converts them into vectors and compares them with the user question, and combines a dynamic similarity threshold to screen out highly relevant triples as the final matching result. This mechanism significantly improves the accuracy and interpretability of knowledge matching through the double-layer filtering of "paragraph preliminary screening + triple refinement", especially suitable for structured knowledge screening under multi-meaning, complex or multi-hop questions in the field of computer networks.

[0019] 6. Construction of Atlas Subgraphs

[0020] For user questions, the system dynamically constructs local subgraphs based on the refined matching results, specifically including:

[0021] Starting from highly relevant triples, combined with intent tags, perform path expansion with a controllable expansion range;

[0022] Adopt rules such as entity type constraints, relationship screening, and hop count limits to generate an atlas subgraph containing core knowledge;

[0023] The accuracy and scale of the subgraph can be dynamically adjusted according to task requirements, avoiding redundant expansion and ensuring the accuracy and effectiveness of the knowledge injected into the Prompt.

[0024] 7. Prompt Generation and Answer Tracing

[0025] To generate professional and trustworthy answers, the present invention designs a Prompt automatic generation and tracing mechanism:

[0026] Automatic template adaptation: Select a matching Prompt template according to the intent type. The system pre-sets multiple types of templates such as definitions, configurations, troubleshooting, and comparisons;

[0027] Injection of subgraph knowledge: Dynamically fill the highly relevant triples and their section_id in the atlas subgraph into the Prompt;

[0028] Answer generation: Vectorize the Prompt and the user question and input them into the large language model to output an answer that conforms to domain knowledge and is interpretable;

[0029] Answer tracing: The answer is accompanied by the relevant triple ID and the text block section_id, allowing users to trace back to the original sources of the atlas and literature to ensure the credibility of the answer.

[0030] The present invention can significantly improve the retrieval and answering capabilities of the question-answering system in the field of computer networks. By integrating the retrieval and hierarchical matching mechanisms, it effectively enhances the recall and matching capabilities of professional terms and improves the overall retrieval accuracy. Based on the intent-based atlas subgraph construction strategy, it realizes the pertinence of knowledge injection and avoids interference from redundant information. The generated answers have good traceability, can accurately label relevant knowledge nodes, and enhance the credibility and interpretability of the answers. The overall solution is fully adapted to tasks such as protocols, configurations, and troubleshooting in the field of computer networks and can provide high-quality professional answers for complex questions. Description of the Drawings

[0031] Figure 1 It is the overall system architecture diagram of the present invention

[0032] Figure 2It is a flow chart for knowledge graph construction

[0033] Figure 3 It is a flow chart for intention-driven fusion retrieval

[0034] Figure 4 It is a flow chart for hierarchical semantic matching

[0035] Figure 5 It is a flow chart for dynamic Prompt generation and answer generation Detailed implementation manner

[0036] The graph-driven fusion retrieval and question-answering system of the present invention generally includes modules such as text data processing, knowledge graph construction, intention recognition, multi-channel fusion retrieval, hierarchical semantic matching, graph sub-graph construction, Prompt generation and answer generation. Each module works together to achieve efficient retrieval, precise matching and generation of trustworthy and interpretable answers for professional questions in the field of computer networks

[0037] Example 1: Knowledge graph construction

[0038] Based on typical computer network professional literatures such as the textbook "Computer Networks" and RFC documents, this embodiment details the specific implementation process of graph construction and knowledge storage in the present invention, including steps such as preprocessing of literature data, triple extraction, knowledge graph construction, establishment of keyword and vector indexes, etc

[0039] In the data preprocessing stage, the system selects multiple professional textbooks and standard specifications such as the 7th edition of the textbook "Computer Networks", RFC793, and RFC1122 as the basic corpus of the knowledge graph and uniformly organizes them into PDF format for input. The Markitdown tool is used to standardize the format of the original PDF literature, remove format noises such as headers, footers, page numbers, and symbol redundancies, and retain semantic structures such as titles, chapters, paragraphs, and lists in the original document to ensure the logic and integrity of the subsequent chunking and information extraction

[0040] After completing the format standardization, the system performs chunking processing on the standardized document based on the LangChain framework. The sliding window strategy is adopted, and each sliding window contains 500 - 700 characters to ensure the continuity and integrity of semantics. For the chunked content, the system automatically assigns a unique number section_id as the primary key identifier of the chunk, providing structured support for subsequent knowledge graph mapping, retrieval indexing, semantic positioning, etc. For example, the content about the TCP three-way handshake in the textbook can be chunked and generated in the following format

[0041] section_id:section_00015

[0042] Content: The TCP three-way handshake consists of three phases: SYN, SYN-ACK, and ACK, which are used to establish a reliable transmission connection.

[0043] In the triple extraction phase, the system uses the locally deployed Deepseek-R1 large language model and combines it with a custom Prompt template to perform triple extraction tasks on each chunk. The design of the Prompt template is shown in Table 1:

[0044] Table 1 Example of triple extraction

[0045]

[0046] The model outputs triples with a standardized format according to the Prompt. For example, for the above chunk, the model can output:

[0047] ("TCP three-way handshake", "contains", "SYN, SYN-ACK, ACK")

[0048] After completing triple extraction, the system uses the Neo4j graph database to build a knowledge graph based on the chunks and triples. The chunks are constructed as Knowledge_section nodes, and the triples are constructed as Knowledge_node nodes. The two are connected by HAS_TRIPLE edges to form a sub-graph of the graph with an explicit structure.

[0049] The information such as section_id, original text, entity, relationship, and tail entity is retained in the graph node information, providing a basis for the retrievability and interpretability of the graph.

[0050] During the keyword extraction and index establishment process, the system uses the TF-IDF and BERT-based methods to extract keyword sets from the chunk and triple content respectively. For example, for section_00015, the system can extract the keyword set: ["TCP", "three-way handshake", "SYN", "ACK", "transmission connection"]. Subsequently, the system stores the keywords of the chunks and triples and the section_id in the Elasticsearch inverted index library to build an inverted index table, providing support for subsequent keyword retrieval channels.

[0051] At the same time, the system uses the SentenceTransformer model to perform vector quantization encoding on the chunk and triple texts, obtaining 768-dimensional semantic vectors, and uniformly stores them in the Faiss vector retrieval library to form a vector index that supports efficient vector similarity retrieval. The keyword, section_id, vector ID, etc. index information of the chunk and triple nodes is retained in the graph.

[0052] Through a complete text processing, knowledge extraction, and structured storage process, this embodiment realizes the construction of a structured knowledge graph for the field of computer networks. Professional knowledge such as network protocols, configurations, performance, and faults is explicitly modeled in the graph, providing a reusable high-quality knowledge base for subsequent multi-channel fusion retrieval, hierarchical matching, and answer generation.

[0053] Embodiment 2: An Intention-Driven Fusion Retrieval Question-Answering System

[0054] Based on the knowledge graph and index system constructed in Embodiment 1, this embodiment details the complete process of how the system sequentially completes intention recognition, fusion retrieval, hierarchical matching, subgraph construction, Prompt generation, and answer tracing after the user inputs a question.

[0055] In the user question input and preprocessing stage, the user inputs a question in natural language. First, the system tokenizes the question through the SentencePiece tokenization model and uses the VocabTransform of TorchText to complete the vocabulary mapping, generating a Token ID sequence. BOS and EOS tags are added to the sequence, and the maximum length is controlled not to exceed 256 to form a standardized input, which serves as the unified input format for subsequent intention recognition and retrieval.

[0056] In the intention recognition stage, for the natural language question input by the user, an intention classification method based on the XLM-RoBERTa model is designed to achieve high-precision task intention discrimination, providing task-oriented information for subsequent retrieval strategies, hierarchical matching, and answer generation.

[0057] (1) Model Structure

[0058] The overall framework of the intention recognition model adopted in this embodiment includes:

[0059] Underlying encoder: Using XLM-RoBERTa as the basic language model, it is responsible for modeling the context representation of the user input question;

[0060] Intention classification head: Based on the last output hidden state of XLM-RoBERTa, connect the RobertaClassificationHead as a multi-class classification head;

[0061] Number of categories: In this embodiment, the intention categories are divided into 14 categories, including but not limited to: definition category, configuration category, troubleshooting category, principle category, comparison category, application category, scenario category, etc., to cover common problem types in the field of computer networks.

[0062] (2) Input Encoding

[0063] Word Segmentation and Encoding: In this embodiment, the pre-trained SentencePiece word segmentation model is used to segment the natural language questions input by the user, and after segmentation, they are mapped to word list IDs through the VocabTransform of TorchText;

[0064] Sequence Specification: Truncation and addition of BOS (beginning-of-sentence marker) and EOS (end-of-sentence marker) to the sequence are completed through Truncate and AddToken to ensure that the length of the input sequence does not exceed 256;

[0065] Input Format: The final input is a sequence of Token IDs with BOS and EOS, which is used to input into the XLM-RoBERTa model.

[0066] (3) Data Preprocessing

[0067] The training and test samples are from the manually annotated intent classification dataset, and the sample format is:

User question text

Intent label

[0068] The system reads, parses, shuffles, and divides the training set and test set into batches based on TorchData;

[0069] Each sample forms a sequence of Token IDs after word segmentation and ID conversion, and the intent label is converted into an integer form as the supervision signal.

[0070] (4) Model Training

[0071] In this embodiment, the cross-entropy loss function is used to calculate the classification loss;

[0072] The AdamW optimizer is used, the learning rate is set to 1e-5, and the training cycle is 20 rounds;

[0073] During the model training process, the system evaluates on the validation set at the end of each round, calculates the loss and accuracy, and saves the training results.

[0074] (5) Inference Process

[0075] The question input by the user is input into the XLM-RoBERTa model after word segmentation and encoding;

[0076] The classification probability distribution output by the model is output by the classification head;

[0077] The category with the highest probability is taken as the predicted intent to obtain the corresponding intent label;

[0078] The intent label is directly used as the core control condition for subsequent multi-channel fusion retrieval, graph subgraph construction, and Prompt template selection.

[0079] In the fusion retrieval stage, to improve the matching effect between the question and the knowledge content, the system designs a dual-channel retrieval mechanism that combines keyword matching and semantic vector similarity, which complements each other at the two levels of term recognition and semantic understanding.

[0080] In the keyword channel, the system uses the jieba tokenization tool to parse the user's question into terms, extracts high-value keywords in combination with the domain term dictionary, and constructs a query request to input into Elasticsearch. Based on the constructed inverted index structure and the BM25 ranking algorithm, the system recalls text blocks with a high keyword matching degree to form an initial candidate set of Top-N.

[0081] In the semantic channel, the system uses SentenceTransformer to encode the user's question and calculates the cosine similarity with the text vectors in the Faiss vector index library to generate a Top-M candidate set based on semantic relevance, which has strong semantic generalization ability.

[0082] To improve the quality of the overall retrieval results, the system normalizes the scores of the two channels, maps the BM25 score and the cosine similarity value to the [0,1] interval uniformly, so that the results under different scales are comparable. Subsequently, a weighted fusion scoring function is introduced:

[0083] Score 融合 (D,Q) = α·Score BM25 (D,Q) + (1 - α)·Score 向量 (D,Q)

[0084] In the fusion stage, the candidate sets of the two channels are merged and de-duplicated by section_id, only the item with the highest score is retained, and then sorted by the fusion score to generate the final fusion candidate set, which is used as the input for subsequent semantic matching and knowledge screening.

[0085] In the hierarchical semantic matching stage, first, the semantically relevant text is quickly compressed at the paragraph level, and then the structured entity relationships are precisely matched at the triple level to achieve multi-level semantic focus. Its core idea can be formally expressed as:

[0086]

[0087] where B top is the set of candidate chunks, T j is the triple instance, and τ is the dynamic similarity threshold.

[0088] The system uses the SentenceTransformer model to perform unified semantic vector encoding on user questions, candidate text chunks, and knowledge triples. With the cosine similarity as the matching metric, it evaluates the relevance between each unit in the semantic space and the query. The triple representation constructs semantic short sentences in the way of concatenating head, relation, and tail to ensure the integrity of its structural expression.

[0089] The candidate text chunks returned by the fusion retrieval module first enter the paragraph-level preliminary screening module for the first-stage screening. The system calculates the semantic similarity between these candidate paragraphs and the user question, sorts them in descending order according to the scores, and selects the Top-K text chunks for subsequent processing. The formula is as follows:

[0090]

[0091] In the formula, B represents the set of all document chunks, and B top represents the Top-K document chunks most relevant to the query. As the first step of semantic compression, the main purpose of this module is to quickly eliminate low-relevant content, reduce the computational cost, and at the same time retain high-potential texts for knowledge extraction. The system calls the Faiss vector indexing tool at this stage to ensure high response speed and retrieval performance.

[0092] After entering the fine matching stage, the system extracts all triples from the preselected text chunks, converts them into natural language form, encodes them into semantic vectors again through SentenceTransformer, and compares them with the user question vector one by one. To improve the robustness of the matching results, the system introduces a dynamic threshold mechanism, and only retains the triples with similarity higher than the set boundary as the final semantic matching results. The matching formula at this stage is as follows:

[0093] T rel ={T j |∈B top ,sim(q,T j )>τ}

[0094] In the formula, T rel represents the set of triples highly relevant to the query question, B top represents the relevant text chunks screened by the paragraph-level preliminary screening module, and τ is the similarity threshold.

[0095] This "paragraph preliminary screening + fine matching extraction" double-layer strategy can effectively achieve the semantic activation of structured knowledge, make up for the deficiencies of traditional retrieval methods in knowledge granularity control and reasoning depth. Especially in complex and multi-hop question scenarios, the system shows stronger stability and interpretability.

[0096] In the atlas subgraph construction stage, the system dynamically constructs a local atlas subgraph related to the user's question based on the high-confidence triples screened by the hierarchical semantic matching module and in combination with the intent tags of the user's question. The core design of this stage is to implement a small-scale, low-redundancy subgraph structure for specific tasks for subsequent Prompt injection.

[0097] Specifically, the system first uses the high-confidence triples screened in the semantic matching stage as the core entities and initial relationships of the subgraph. The system determines the expansion strategy of the subgraph according to the intent tags corresponding to the user's question. For example, when the intent of the user's question is determined to be "configuration type", the system tends to expand entities and relationships related to the configuration process; when the intent is determined to be "troubleshooting type", it preferentially expands relationship chains related to causes, impacts, solutions, etc.

[0098] During the expansion process, the system starts from the current highly relevant triples in the atlas and performs intent-based path expansion, adopting the following strategies:

[0099] Entity type constraint: Restrict the expansion to only specific types of entities, such as protocols, processes, configuration items, etc.;

[0100] Relationship type screening: Retain specified types of relationships according to the intent tags, such as "dependency", "containment", "cause", "impact", etc.;

[0101] Expansion hop limit: The system generally sets the expansion hop limit to no more than 2 hops to avoid excessive subgraph scale and knowledge generalization.

[0102] For example, if the user's question is "How to restore the connection after TCP retransmission timeout?", and in the triple refinement stage, the system has obtained: "(TCP retransmission, may cause, connection timeout)", then based on the "troubleshooting type" intent, the system automatically expands triples related to "connection restoration" and "timeout retransmission" to form the following subgraph:

[0103] TCP retransmission—may cause—connection timeout

[0104] Connection timeout—solution—fast retransmission mechanism

[0105] Fast retransmission mechanism—belongs to—TCP

[0106] Finally, the system outputs a local subgraph containing the core entities and their adjacency relationships to support subsequent Prompt template filling.

[0107] In the Prompt generation and answer output stage, the system automatically selects a predefined Prompt template according to the intent type of the user's question, and injects the structured knowledge in the subgraph of the knowledge graph into the Prompt to generate a highly task-adaptive prompt, so as to guide the large language model to generate high-quality and interpretable answers.

[0108] Multiple Prompt templates are preset inside the system, which are designed for common intent categories respectively, such as definition category, principle category, configuration category, troubleshooting category, comparison category, application category, etc. For example, if the intent of the user's question is recognized as the "troubleshooting category", the system selects a special Prompt template for troubleshooting:

[0109] You are an expert in computer networks. Please combine the following knowledge and answer the user's question about troubleshooting and solutions for {question}.

[0110]

Knowledge content

[0111] {Set of triples in the subgraph of the knowledge graph}

[0112] In the Prompt knowledge injection link, the system fills the highly relevant triples filtered from the subgraph of the knowledge graph into the

Knowledge content

[0113] After the Prompt is generated, the system inputs the Prompt and the user's question into the large language model together. The model generates answers based on the provided structured knowledge and the user's question. The generated answers not only contain professional expressions and solutions in the network field, but also the system automatically attaches traceability information related to the answers at the end of the answers, including triple IDs and section numbers.

[0114] Through the Prompt-driven and traceability mechanism, the system realizes the professionalism, pertinence and interpretability of the answer generation process in the field of computer networks. Users can directly trace back to the knowledge graph nodes and the original literature sources according to the traceability information provided by the system to verify the reliability of the answers.

Claims

1. A graph-driven fusion retrieval and question-answering method in the field of computer networks, characterized in that It includes the following steps: S1. Text data preprocessing: Normalize the format of professional materials from the field of computer networks, use a PDF parsing tool to remove redundant symbols and retain the semantic structure, then use a semantic framework to perform sliding window chunking on the text content according to paragraph semantics, and assign a unique number to each text chunk; S2. Triple extraction and knowledge graph construction: Call a local large language model through a preset prompt template to extract semantic information from each text chunk and generate structured triples; write the triples into the knowledge graph database in the form of nodes to construct a knowledge graph; S3. Vectorization and index establishment: Semantically vectorize the text chunks and triples respectively and store them uniformly in a vector retrieval library to support subsequent semantic retrieval; S4. Intent recognition and retrieval strategy setting: Perform intent recognition on the user's input question to obtain intent tags; set the fusion weights of keyword retrieval and vector retrieval according to the intent tags, and retrieve the document library and vector library respectively; S5. Hierarchical semantic matching: Perform paragraph-level semantic preliminary screening based on the fusion retrieval results, and perform triple-level fine-grained matching operations on the preliminary screening results to obtain highly semantically relevant knowledge fragments; S6. Knowledge graph subgraph construction: Based on the question intent tags, perform multi-hop path expansion starting from the preliminary screening triples in the knowledge graph to construct a knowledge graph subgraph containing the target knowledge; S7. Prompt generation and answer generation: Select an appropriate Prompt template according to the question intent, dynamically fill in the triple information in the knowledge graph subgraph to generate a structured Prompt; input the Prompt into the large language model to generate an answer, and attach the corresponding triple ID and section number to achieve traceability.

2. The method according to claim 1, wherein Among them, the open-source tool Markitdown is used for PDF content parsing in text normalization processing, and the LangChain framework is used for paragraph chunking, combined with a sliding window strategy to maintain semantic continuity.

3. The method according to claim 1, characterized in that, Among them, the large language model used for triple extraction is a locally deployed model, and the prompt template structure includes: input block, extraction target, format requirements, and screening criteria.

4. The method according to claim 1, characterized in that The fusion weight in the dual-channel fusion retrieval is dynamically adjusted according to the intent tags, and the weight adjustment is based on factors such as task complexity, term density, and query target, which can optimize the retrieval accuracy under different intents.

5. The method according to claim 1, characterized in that, The similarity threshold in the hierarchical semantic matching mechanism is dynamically adjusted according to the question type, and when performing triple fine-grained matching, short sentences are transformed, vectorized, and then the similarity is calculated to dynamically screen highly relevant triples.

6. The method according to claim 1, wherein During the construction of the knowledge graph subgraph, the depth of graph path expansion, relationship type screening, and entity selection range are controlled according to the intent tags, and the subgraph is used to provide accurate knowledge support for generating professional answers.

7. A large model Q&A system based on the method according to any one of claims 1 to 6, characterized in that, It includes: A data preprocessing module for performing text format parsing, text chunking, and numbering; A triple extraction module for extracting structured triple information from text chunks; A knowledge graph construction module for organizing triple and text chunk nodes and forming a graph structure; A semantic vectorization and indexing module for generating and storing semantic vectors of text chunks and triples; The intention recognition and fusion retrieval module is used to analyze the user's intention and perform keyword and vector fusion retrieval; The hierarchical matching module is used to perform paragraph-level preliminary screening and triple-level matching; The Prompt generation module is used to generate structured Prompts and input them into the language model to generate answers; The traceability marking module is used to embed the graph node ID into the answer content to enhance the interpretability of the results.

Citation Information

Cited By

  • Dynamic knowledge retrieval enhancement method based on large language model

    CN120407570A

  • Psychological medical map retrieval method based on enhanced large model

    CN120611069A

  • A mental health atlas retrieval method based on an enhanced large model

    CN120611069B

  • Retrieval enhancement generation method and device of power system, medium and equipment

    CN120723879A

  • Tin smelting knowledge question-answering method based on knowledge graph and large language model

    CN120744066A