Communication domain knowledge question-answering method and system based on knowledge graph
By constructing a dual knowledge structure based on knowledge graphs and multimodal retrieval, the problems of context fragmentation and insufficient logical reasoning ability in the existing RAG architecture in the field of communication are solved, and efficient and accurate professional knowledge question answering is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-22
- Publication Date
- 2026-04-14
AI Technical Summary
Existing RAG architectures based on dense vector retrieval suffer from several problems when handling knowledge-based question answering in professional fields such as communications. These problems include semantic relevance not being equivalent to answer validity, keyword matching failure, context fragmentation, inability to handle complex logical relationships and computational queries, and low operating efficiency, making it difficult to meet the accuracy and efficiency requirements of professional fields.
We employ a knowledge graph-based approach to construct a dual knowledge structure that combines a document vector library and a triplet vector library. By combining linguistic feature extraction and intent classification, we dynamically select a multimodal retrieval strategy and generate high-quality, interpretable answers through an inverse sorting fusion algorithm and a chain reasoning module.
It significantly improves retrieval accuracy and answer relevance, reduces the LLM illusion phenomenon, enhances the interpretability and user credibility of the system, and can handle complex queries in professional fields and provide logically clear reasoning paths.
Smart Images

Figure CN121860065A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence and natural language processing technology, specifically relating to a knowledge graph-based question answering method and system for the communication field. Background Technology
[0002] In recent years, large language models (LLMs) have achieved remarkable success in natural language processing tasks. However, these models are essentially based on a static snapshot of knowledge from their training datasets, and suffer from two core limitations: "knowledge staleness" and "fact illusion." First, the knowledge of an LLM is "frozen" after training, unable to acquire the latest information, leading to potentially outdated or inaccurate answers. Second, when the model's internal parameters cannot provide definitive answers, it tends to generate seemingly reasonable but actually fabricated and untrue information—the "illusion" phenomenon.
[0003] To overcome these limitations, Retrieval-Augmented Generation (RAG) technology has emerged. The core idea of this framework is to retrieve relevant information from an external knowledge base before the LLM generates a response and provide it as context to the LLM. This transforms the LLM's response from a "closed-book exam" that relies on internal memory into an "open-book exam" that can consult external resources, aiming to improve the accuracy and factuality of the answer.
[0004] Currently, the closest existing technology is the classic RAG architecture based on dense vector retrieval. This architecture typically involves the following three stages in its workflow:
[0005] I. Data and Indexes (Knowledge Base Construction Phase):
[0006] This stage is an offline preprocessing process designed to transform external knowledge sources into a format that can be quickly retrieved.
[0007] 1. Document Chunking: Due to the inherent length limitations of embedding models and LLMs, long original documents (such as technical manuals, research papers, and database records) need to be segmented into smaller text blocks. Existing technologies typically employ a fixed-size mechanical segmentation method, which easily disrupts the contextual connections and logical structure of the original text.
[0008] 2. Vector Embedding: The system uses an embedding model to convert each text block into a high-dimensional vector (i.e., "embedding"). This vector can be regarded as a coordinate point of the text block in a multi-dimensional semantic space, and its position and direction represent the semantic meaning of the text.
[0009] 3. Index Storage: All generated vector embeddings are stored in a vector database specifically designed for efficient similarity search. This database indexes these vectors (e.g., using approximate nearest neighbor algorithms such as HNSW) so that it can find the semantically closest vector in milliseconds when a query is received, without resorting to brute-force traversal.
[0010] II. Retrieval (Information Search Stage During Query):
[0011] When a user submits a query, the system executes it in real time:
[0012] 1. Query Embedding: The user's natural language query will be transformed into a query vector with the same vector dimension as the document chunking through the same embedding model;
[0013] 2. Similarity Search: The system uses the query vector as a reference and performs a semantic similarity search in the vector database. The goal is to find the k text block vectors that are closest to the query vector in the vector space (usually using metrics such as cosine similarity). These found text blocks are considered to be the most relevant content to the user's query.
[0014] III. Generation (Answer Synthesis Stage):
[0015] 1. Augmented Prompt: The most relevant text chunks retrieved in the previous step are integrated with the user's original query to construct a richer "Augmented Prompt." This process utilizes prompting engineering techniques to clearly present retrieved external knowledge as context to the LLM;
[0016] 2. LLM generates response: The enhanced prompts are fed into a large language model, and the LLM generates the final answer based on the provided contextual information.
[0017] While the aforementioned classic RAG framework alleviates the knowledge limitations of LLM to some extent, its core reliance on a single vector similarity retrieval mechanism suffers from a series of profound flaws that restrict the system's performance, reliability, and applicability:
[0018] 1. Semantic relevance does not equal answer validity: Vector retrieval is based on global semantic similarity, but in queries involving precise facts (such as specific numbers, dates, and negative statements), the system is prone to returning document paragraphs that are topic-related but do not contain the key answer, resulting in inaccurate search results. This process lacks interpretability and forms a "black box" operation.
[0019] 2. Vector retrieval mechanism performs poorly when handling queries that strongly depend on keywords: For queries containing terms that must be precisely matched, such as product models, proper nouns, and technical abbreviations (e.g., "QAM", "OFDM"), semantic retrieval may ignore literal matching due to an overemphasis on intent, resulting in failure of key term matching.
[0020] 3. Mechanical document chunking leads to contextual fragmentation: Independent text chunks created to generate embedding vectors often disrupt the logical structure and coherent context of the original text. When answering queries that require integrating information from multiple text chunks, the system is prone to omitting adjacent paragraphs carrying key information, resulting in incomplete context for the input LLM and increasing the risk of generating biased or misleading content.
[0021] 4. Inability to effectively support complex queries involving multi-hop reasoning: For queries that require connecting implicit relationships between multiple entities to answer (e.g., "Who is the main competitor of company C, which collaborates with A to develop technology B?"), existing document fragment-based retrieval mechanisms can only return fragments that are locally related to each entity, and cannot actively construct logical connections between entities. This allows LLM to make inferences in the absence of explicit relationship guidance, significantly increasing the possibility of hallucination.
[0022] 5. Low operational efficiency and high computational costs: Generating high-quality text embeddings typically relies on large-scale GPU computing. Maintaining a high-performance vector database, especially in scenarios with frequent data updates, requires continuous re-indexing, resulting in significant computational and storage overhead. For most enterprise applications, such ongoing operational costs constitute a major obstacle to practical deployment and scaling.
[0023] In summary, the main limitation of existing technologies lies in their use of a uniform semantic retrieval mechanism to handle diverse query types. This mismatch between the retrieval strategy and the nature of the queries is the root cause of the aforementioned problems. Although some studies have attempted to combine keyword and vector retrieval (such as hybrid search), most employ fixed weights or static fusion strategies, failing to dynamically adapt the retrieval method according to the query intent, thus resulting in limited improvement.
[0024] Specifically, when the aforementioned classic RAG framework is applied to engineering fields with high professional barriers and rigorous technical systems, such as communications, its inherent defects are further amplified, resulting in the generated content failing to meet professional requirements in terms of technical depth, accuracy, and reliability.
[0025] 1. Insufficient Precise Understanding of Technical Terms and Abbreviations: The communications field is filled with highly specialized and ambiguous terms, technical standard abbreviations (such as QAM, OFDM, MIMO, BER), and product model codes. Traditional semantic retrieval relies on the "understanding" of the embedded model, but the model may not have fully learned the precise meaning of these technical terms in specific contexts during pre-training. For example, for the query "PDSCH scheduling in 5G NR," the system may return a document that broadly introduces the advantages of 5G, but cannot accurately locate the technical specification section containing "Physical Downlink Shared Channel Scheduling Algorithm," resulting in incomplete search results.
[0026] 2. Difficulty in handling and parsing mathematical models and formulas in communication: Communication theory is built on a rigorous mathematical foundation, involving numerous formulas (such as Shannon's formula and the bit error rate calculation formula). Existing embedding models are typically optimized for natural language text, but have weak semantic encoding capabilities for formulas. When a user queries "how to calculate the bit error rate of BPSK in an AWGN channel," vector retrieval may struggle to effectively match results containing the core formulas. Even if a text block is matched, LLM may not be able to correctly reproduce or interpret the formula due to incomplete context.
[0027] 3. Lack of structured reasoning ability regarding causal chains and logical relationships in communication systems: Communication systems are complex wholes, and their internal mechanisms are often manifested through causal relationships and logical chains between entities. For example, answering the question "Why does higher-order QAM have a higher bit error rate at the same signal-to-noise ratio?" requires a systematic understanding of the complete logical chain: "Increased order → Increased constellation point density → Decreased minimum Euclidean distance between symbols → Increased sensitivity to noise → Increased bit error rate." Traditional document fragment-based retrieval can only return isolated fragments of "QAM definition" and "bit error rate definition," failing to proactively construct and present this crucial causal path, making it difficult for LLM to generate explanations with deep insights.
[0028] 4. Weak support for numerical calculation queries: Communication engineers often need to perform numerical calculations based on specific parameters (such as calculating channel capacity based on bandwidth and signal-to-noise ratio). Existing RAG systems typically treat such queries as ordinary question-and-answer systems, retrieving relevant text and then handing it over to the LLM for "mathematical reasoning." However, the LLM is essentially a language model rather than a computational engine, and it is extremely prone to errors when performing precise numerical calculations, and the process is like a "black box," lacking verifiability.
[0029] Therefore, there is an urgent need for a technical solution that can intelligently identify query intent and dynamically select the optimal retrieval strategy in order to systematically address the key shortcomings of the current RAG framework. Summary of the Invention
[0030] The purpose of this invention is to overcome the above-mentioned defects of the prior art and provide a knowledge graph-based question answering method and system for the communication field. It can systematically solve the problems of accuracy, interpretability and efficiency caused by the single retrieval strategy, context fragmentation and lack of relational reasoning ability in the existing RAG technology.
[0031] This invention is achieved through the following technical solution:
[0032] A knowledge graph-based question-answering system for the communication domain, comprising:
[0033] The knowledge graph database construction module is used to automatically process unstructured raw documents and build a dual knowledge structure with both document vector library and triple vector library. This dual knowledge structure provides a unified data foundation for all subsequent retrieval operations.
[0034] The query analysis module is used to extract linguistic features, identify entities, and classify intents from user queries, and output the intent type and dynamic fusion weights of the query. The intent types of the query include semantic, keyword-specific, relational, and hybrid types. The dynamic fusion weights include dense retrieval weights, sparse retrieval weights, and graph retrieval weights.
[0035] The multimodal retrieval module includes a dense retrieval module, a sparse retrieval module, and a graph retrieval module configured in parallel, and is used to execute the corresponding type of retrieval task according to the instructions of the query analysis module;
[0036] The adaptive fusion module is used to receive the retrieval results returned by each retrieval module, and based on the dynamic fusion weight output by the query analysis module, to reorder and fuse the retrieval results using a reciprocal sorting fusion algorithm, and output a unified context fragment.
[0037] The Communication Calculator module is used to process communication-related calculation problems input by users. It automatically identifies key numerical values, variables, and distribution information parameters in the problem through predefined regular expressions, matches them with corresponding formulas in the field of communication, directly executes the formula derivation, automatically records the step-by-step calculation steps and formula reference process, and outputs the final answer in structured JSON format.
[0038] The Chain Reasoning and Self-Consistency Enhancement Module is used to handle complex logical reasoning problems that are not computationally intensive. By receiving the context output from the Adaptive Fusion Module, it uses a templated structured Prompt to guide a large language model to perform chain reasoning (CoT) and generate a complete step-by-step reasoning process. It also adopts a self-consistency sampling mechanism to generate multiple reasoning samples under the same context. Through JSON fault-tolerant parsing, structure repair, majority voting, and abnormal output removal mechanisms, it finally selects the semantically optimal reasoning chain and its conclusion.
[0039] The suggestion building and generation module is used to integrate the calculator output or CoT inference chain obtained from within the system with the user's original query to build enhanced suggestions and standardize the large language model to generate high-quality, natural language final answers.
[0040] Furthermore, the workflow of the knowledge graph database construction module is to transform unstructured raw documents into a dual knowledge structure consisting of a document vector library and a triplet vector library, specifically including the following:
[0041] Phase 1: Document parsing and intelligent segmentation; transforming the original document into standardized text units suitable for processing by large language models while maintaining semantic integrity;
[0042] A1. Document Loading and Parsing: Load the original document using a document parser (such as PyPDFLoader) and parse it page by page to extract the plain text content and basic structural information, providing a data source for subsequent processing;
[0043] A2. Intelligent text segmentation: Employs a recursive character text segmenter to simulate human reading habits, following a recursive priority of "paragraph → sentence → word" for segmentation;
[0044] A3. Context Preservation: By setting the overlap parameter (chunk_overlap), ensure that adjacent text blocks retain a portion of common content at the boundary;
[0045] Phase Two: Quality Assessment and Prioritization;
[0046] B1. Multidimensional Quality Score:
[0047] B11. Length Fit: Evaluates whether the length of the text block is within the preset optimal range;
[0048] B12. Entity Density: Using named entity recognition technology, statistically analyze the communication-related technical terms contained in text blocks.
[0049] B13. Existence of Relational Verbs: Detects whether a text block contains relational indicative verbs;
[0050] B2. Priority-based batch scheduling;
[0051] All text blocks are sorted in descending order based on their overall quality score, and the system prioritizes the batch with the highest score to enter the subsequent core knowledge extraction process.
[0052] Phase Three: Core Knowledge Extraction;
[0053] C1. Extraction process of structured triple set:
[0054] Text preprocessing: First, the text blocks are cleaned and focused, and sentences with key verbs are selected.
[0055] Accurate parsing based on large language models: Utilizing large language models, few-shot learning is performed through prompts; the prompts clearly state the task instructions, output format specifications, and provide high-quality examples, thereby guiding the model to accurately parse the subject, predicate, and object from the text and generate structured triplet data;
[0056] C2. Parallelized Batch Processing: Pack multiple high-priority text blocks into batches and use ThreadPoolExecutor for parallel batch extraction to make full use of multi-core computing resources;
[0057] Phase Four: Knowledge Integration and Persistence
[0058] D1. Structured Knowledge Storage:
[0059] D11. Remove duplicates from all extracted triples to ensure the uniqueness of the knowledge;
[0060] D12. Store the cleaned set of triples as a structured file or import it directly into a graph database;
[0061] D2, Vectorized storage:
[0062] D21. Use an embedding model to convert the original text block and the extracted triplet text into high-dimensional vectors respectively;
[0063] D22. Store all generated vectors in a vector database;
[0064] D23. Vector databases build indexes by calculating the similarity between vectors, providing semantic similarity search capabilities.
[0065] Furthermore, the query analysis module includes:
[0066] The linguistic feature extraction unit is used to identify interrogative words, phrases within quotation marks, proper nouns, technical terms, abbreviations, or identifiers of a specific format in the user query.
[0067] An entity recognition unit is used to identify and extract entities from the user query using a named entity recognition model.
[0068] The intent classification unit is used to determine the classification result of the user query as semantic, keyword, relational, or mixed query based on the identified linguistic features and entities.
[0069] Furthermore, the semantic query is an open-ended, conceptual question that does not contain specific terms that must be matched precisely;
[0070] The keyword-specific query includes proper nouns, product codes, error messages, or quoted phrases that must be matched exactly;
[0071] The relational query explicitly inquires about the connection, path, or interaction between two or more entities extracted by the entity recognition unit;
[0072] The hybrid query includes both semantic concepts and specific keywords.
[0073] Furthermore, the dense retrieval module includes:
[0074] A document chunker is used to divide a raw document into blocks of text.
[0075] An embedding model is used to convert the text blocks and user queries into vector representations;
[0076] A vector database used to perform semantic similarity searches between user query vectors and text block vectors.
[0077] The sparse retrieval module includes a text indexer that uses the BM25 or TF-IDF algorithm to create an inverted index for the document library. The sparse retrieval submodule is used to receive queries, extract keywords, and perform term frequency and inverse document frequency calculations in the inverted index to return the document with the highest keyword matching degree.
[0078] The graph retrieval module includes a knowledge graph database, where data is stored as nodes representing entities and edges representing relationships between entities. The graph retrieval module receives a relationship query containing entities, converts it into a graph query language, performs path lookup or neighbor expansion traversal operations on the knowledge graph database, and returns structured relationship information.
[0079] Furthermore, the calculation formula for the inverse sorting fusion algorithm is as follows:
[0080]
[0081] Among them: dense retrieval weight Sparse retrieval weights Graph retrieval weight , , , is the rank of document d in the result list returned by each retrieval module; k is a smoothing constant.
[0082] Furthermore, in the communication calculator module, the preset communication domain formula includes:
[0083] Signal-to-noise ratio:
[0084] Channel capacity:
[0085] Bit error rate (BPSK):
[0086] Information entropy:
[0087] Average code length:
[0088] in, Signal power; Noise power; Linear signal-to-noise ratio; Signal-to-noise ratio expressed in decibels (dB); Channel capacity (bit / s); Channel bandwidth (Hz); Bit error rate; Complementary error function; Information entropy (bit); : The probability of the i-th symbol appearing; Average code length (the average code length occupied by each symbol). : The encoding length (bits) of the i-th symbol.
[0089] Furthermore, the chain reasoning and self-consistency enhancement module includes:
[0090] The context building unit is used to select Top-K documents from the multimodal retrieval module to generate summaries and retrieve relevant triples from the triple vector library to jointly build the initial context;
[0091] The context enhancement and filtering unit is used to merge the initial context, sort it by relevance, remove noise, standardize the format and annotate it to form an enhanced context;
[0092] The structured hint building unit adopts a hierarchical hint strategy and templated hints, and forces LLM to output reasoning steps and final answers in a specified JSON format;
[0093] The self-consistent sampling and fault-tolerant parsing unit is used to generate multiple independent inference chains for the same query, determine the final answer through majority voting, and perform JSON fault-tolerant parsing and degradation processing on the LLM output to ensure system robustness.
[0094] On the other hand, the present invention also provides a method for generating a knowledge question-answering system in the communication field based on knowledge graphs, specifically including the following steps:
[0095] S1. Construct a dual knowledge structure;
[0096] Intelligent segmentation and quality screening: The original document is recursively segmented into intelligent blocks to maintain semantic integrity, and the text blocks are subjected to multi-dimensional quality assessment and priority ranking based on length, entity density and relation words;
[0097] Core knowledge structuring: Prioritize the automatic extraction of "subject-verb-object" triples from high-quality text blocks to form machine-readable structured knowledge;
[0098] Dual knowledge construction: The deduplicated triples are imported into a graph database to construct a knowledge graph; at the same time, the text blocks and triple texts are vectorized and stored in a vector database to form a dual knowledge index.
[0099] S2. Query preprocessing and analysis;
[0100] Receive natural language questions from the user and preprocess them, including:
[0101] Perform linguistic feature extraction to identify interrogative words, phrases within quotation marks, and specific format identifiers;
[0102] Extract communication-related entities from the query using a named entity recognition model;
[0103] Based on the extracted features and entities, the query intent is classified as computational or non-computational.
[0104] If it is a computational query, proceed to step S3;
[0105] If the query is not computational, proceed to step S4.
[0106] S3, the communication calculator module will be executed first;
[0107] The system uses regular expressions to match numerical parameters in the query and calls preset communication domain formulas to perform calculations, directly generating a structured output containing reasoning steps and answers, and proceeds to step S6.
[0108] S4, Multimodal Hybrid Retrieval and Fusion;
[0109] For non-computational queries, perform the following operations:
[0110] Parallel retrieval: Based on the intent classification results of step S2, dense retrieval, sparse retrieval, and graph retrieval are invoked in parallel to obtain relevant information from the vector library, inverted index, and knowledge graph, respectively.
[0111] Dynamic weight fusion: The inverse sorting fusion algorithm is adopted, and the weights of each retrieval mode are dynamically allocated according to the query type determined in step S2. The heterogeneous retrieval results are uniformly sorted and fused to output the optimal set of context fragments.
[0112] S5, chain reasoning and enhanced self-consistency;
[0113] Context enhancement: Integrate retrieved document fragments with relevant triple knowledge to construct enhanced contexts with high information density and clear logic;
[0114] Structured reasoning: Guides a large language model with specific prompt templates to output a step-by-step reasoning chain and the final answer in a standardized JSON format;
[0115] Self-consistency verification: Generate multiple independent inference chains for the same query, determine the most reliable final answer through a majority voting mechanism, and perform fault-tolerant parsing on the model output to ensure robustness;
[0116] S6. Answer generation and output;
[0117] The calculation results from step S3 or the reasoning results from step S5 are combined with the original query to form the final prompt, which is then input into a large language model to generate and return to the user.
[0118] Compared with the prior art, the advantages of the present invention are as follows:
[0119] 1. Significantly Improved Retrieval Accuracy and Answer Relevance: This invention accurately identifies user intent through a query analysis module and dynamically selects the most suitable retrieval strategy accordingly, completely overcoming the limitations of traditional RAG systems that rely on a single retrieval mode. The system performs robustly in keyword-specific queries where pure vector retrieval is prone to failure and effectively solves complex relational queries that traditional document retrieval struggles to handle. This "question-driven" retrieval mechanism ensures that the contextual information provided to the Large Language Model (LLM) possesses both semantic breadth and factual depth, thereby guaranteeing the accuracy and high relevance of the final answer from the outset.
[0120] 2. Effective suppression of LLM illusion: Through multimodal retrieval and adaptive fusion, the system can provide LLM with reference information that has higher information density, more accurate facts, and more complete context. This directly "anchors" the LLM generation process to a more reliable knowledge base, significantly reducing the probability of factual errors or fabricated content generated by the model due to internal knowledge limitations or contextual misleading, and greatly improving the authenticity and credibility of the output results.
[0121] 3. Fundamental Enhancement of System Interpretability and User Trust: The introduction of the knowledge graph retrieval module is one of the key innovations of this invention. It enables the system not only to output answers but also to reveal the logical reasoning path behind those answers. For example, when faced with a professional question like "Why is higher-order QAM more prone to errors?", traditional retrieval might only return fragmented conceptual definitions; however, this system can clearly present the complete causal chain of "higher-order QAM → denser constellation points → reduced decision distance → decreased noise resistance → increased bit error rate" through graph retrieval. This structured and verifiable reasoning process greatly enhances the system's reliability and user trust in demanding scenarios such as engineering design and academic research. Attached Figure Description
[0122] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the accompanying drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. In all the drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts are not necessarily drawn to scale.
[0123] Figure 1 This is a schematic diagram of the overall architecture of a knowledge graph-based question-answering system in the field of communication according to the present invention.
[0124] Figure 2 This is a structural block diagram of the knowledge graph database construction module of the present invention;
[0125] Figure 3 This is a structural block diagram of the query analysis module of the present invention;
[0126] Figure 4 This is a structural block diagram of the multimodal retrieval module of the present invention;
[0127] Figure 5 This is a structural block diagram of the adaptive fusion module of the present invention;
[0128] Figure 6 This is a structural block diagram of the chain reasoning and self-consistency enhancement module of the present invention;
[0129] Figure 7 This is a structural block diagram of the communication calculator module of the present invention;
[0130] Figure 8 This is a structural block diagram of the prompt construction and generation module of the present invention. Detailed Implementation
[0131] To clearly and completely describe the technical solution and its specific working process of the present invention, the specific embodiments of the present invention are as follows, in conjunction with the accompanying drawings:
[0132] like Figure 1 As shown, this embodiment provides a knowledge graph-based question-answering system for the communication domain, including:
[0133] Input interface: Receives natural language queries submitted by users, which can take the form of API endpoints, graphical user interface input boxes, or other interactive interfaces;
[0134] The knowledge graph database construction module is used to automatically process unstructured raw documents and build a dual knowledge structure with both document vector library and triple vector library. This dual knowledge structure provides a unified data foundation for all subsequent retrieval operations.
[0135] The query analysis module is used to extract linguistic features, identify entities, and classify intents from user queries, and output the intent type and dynamic fusion weights of the query. The intent types of the query include semantic, keyword-specific, relational, and hybrid types. The dynamic fusion weights include dense retrieval weights, sparse retrieval weights, and graph retrieval weights.
[0136] The multimodal retrieval module includes a dense retrieval module, a sparse retrieval module, and a graph retrieval module configured in parallel, and is used to execute the corresponding type of retrieval task according to the instructions of the query analysis module;
[0137] The adaptive fusion module is used to receive the retrieval results returned by each retrieval module, and based on the dynamic fusion weight output by the query analysis module, to reorder and fuse the retrieval results using a reciprocal sorting fusion algorithm, and output a unified context fragment.
[0138] The communication calculator module processes communication-related calculation problems input by the user. It automatically identifies key numerical values, variables, and distribution information in the problem using predefined regular expressions and matches them with corresponding formulas in the communication field. The system directly executes the formula derivation, automatically records each calculation step and formula reference process, and outputs the final answer in structured JSON format.
[0139] The Chained Reasoning and Self-Consistency Enhancement module is used to handle complex logical reasoning problems that are not computationally intensive. The system receives the context output from the Adaptive Fusion module and uses a templated, structured Prompt to guide a large language model in Chained Reasoning (CoT), generating a complete step-by-step reasoning process. The module employs a self-consistency sampling mechanism, generating multiple reasoning samples within the same context. Through JSON fault-tolerant parsing, structure repair, majority voting, and abnormal output removal mechanisms, it selects the most stable and reasonable reasoning chain and the final answer.
[0140] The prompt building and generation module integrates the calculator output or CoT inference chain obtained internally by the system with the user's original query to build enhanced prompts and calls a large language model to generate the final answer. This module automatically combines the reasoning process, retrieved evidence fragments, formula references, or triple knowledge to ensure that the output content is logically consistent, traceable, and formatted uniformly. This module is the output production engine of the entire system, responsible for encapsulating the results of multiple internal modules into a final response that the user can directly obtain.
[0141] The knowledge graph database construction module of this system is the cornerstone of its efficient retrieval, and its automated construction process is as follows: Figure 2 As shown, the workflow of the knowledge graph database construction module is to transform unstructured raw documents into a dual knowledge structure consisting of a document vector library and a triplet vector library, specifically including the following stages:
[0142] Phase 1: Document Parsing and Intelligent Chunking
[0143] The goal of this stage is to transform the original PDF document into standardized text units suitable for processing by Large Language Models (LLM).
[0144] (1) Document loading and parsing: Load the original document using a document parser (such as PyPDFLoader) and parse it page by page to extract the plain text content and basic structural information, providing a data source for subsequent processing;
[0145] (2) Smart Text Splitting: It adopts a recursive character text splitter to simulate human reading habits and follows the recursive priority of "paragraph → sentence → word" for segmentation;
[0146] (3) Chunking Strategy: This method does not simply divide the text into segments based on a fixed number of words. Instead, it simulates human reading habits and prioritizes segmentation by paragraphs. If the text is still too long after segmentation, it is then segmented by sentences, and so on. This recursive strategy preserves the semantic integrity of the text to the greatest extent possible, ensuring that the definitions and explanations of key concepts such as the "Shannon formula" or the "Nyquist theorem" are not broken during segmentation.
[0147] (4) Context preservation: By setting the chunk_overlap parameter, each text block will contain a small portion of the content at the end of the previous block. This effectively avoids the knowledge points being cut off at the boundaries between blocks and ensures the continuity of the context.
[0148] Phase Two: Quality Assessment and Prioritization
[0149] (1) Text Chunk Quality Score (rate_chunk_quality): The system calculates a quality score for each text chunk. This score is based on a set of heuristic rules, mainly considering three dimensions:
[0150] (2) Appropriate length: Text blocks that are too long or too short (such as headers and footers) usually have limited information content.
[0151] (3) Entity density: Text blocks containing more communication domain terms (such as “modulation”, “channel”, “coding”) are more likely to contain key knowledge.
[0152] (4) Presence of relational words: Sentences containing verbs such as "is", "includes", and "defined as" are very likely to be key sentences that define or describe relationships.
[0153] (5) Priority batch processing: All text batches are sorted from highest to lowest quality score. The system will prioritize processing the text batches with the highest scores. This strategy ensures that the most core and explicit knowledge can be captured quickly, even in the early stages of processing.
[0154] Phase 3: Core Knowledge Extraction
[0155] Accurate parsing based on a large language model: Utilizing a large language model, few-shot learning is performed through prompts; the prompts clearly define task instructions, output format specifications, and provide high-quality examples, thereby guiding the model to accurately parse the subject, predicate, and object from the text, generating structured triplet data; as detailed below:
[0156] (1) Extraction process in the code:
[0157] Text preprocessing: Before asking questions to the model, the code first "cleans" and "focuses" the text, filtering out sentences containing key verbs such as "is," "has," "build," and "create." This is a heuristic optimization because "predicates" are usually verbs, so sentences containing these verbs are more likely to contain a valid relational fact. This helps LLM focus more on information-dense content.
[0158] Precise cueing engineering: This is the core of communication with LLM. The code constructs a very clear set of instructions, telling the LLM the task objective, output format, and providing high-quality examples (e.g., Shannon formula -> defined -> channel capacity). This "few-shot learning" greatly improves the accuracy and format consistency of the model output.
[0159] LLM generation and parsing: The text combined with the prompt words is sent to the locally deployed Ollama model for generation. The plain text string returned by the model (such as "Shannon->proposed->information entropy") is then parsed by a specific function, split by ->, and converted into a structured Python dictionary object, ready for subsequent storage in the database.
[0160] The ultimate goal of extracting triples is to use them to construct a knowledge graph. In the graph structure: the subject and object become nodes, representing independent entities. The predicate becomes a directed edge connecting two nodes, representing a specific relationship. By continuously adding new triples, a complex knowledge network consisting of countless interconnected nodes and edges is formed. This structured knowledge not only records the concepts themselves, but more importantly, it records the relationships between them, making complex relational queries and reasoning possible.
[0161] (2) Parallelized batch processing (process_batches_parallel): Pack multiple high-priority text blocks into batches and use ThreadPoolExecutor for parallel batch extraction to make full use of multi-core computing resources.
[0162] Phase 4: Knowledge Integration and Persistence
[0163] (1) Deduplication and saving: The system first deduplicates all extracted triples to ensure the uniqueness of knowledge, and then saves these clean triples in the triples.json file in JSON format.
[0164] Application: This JSON file serves as a direct data source for knowledge graphs. It can be imported into graph databases such as Neo4j, forming a network of nodes (e.g., "modulation technology," "channel type") and relational edges (e.g., "belongs to," "adopts"), making it ideal for precise relational queries and reasoning.
[0165] (2) Vectorized storage (vector database):
[0166] Embedding generation: The system uses the OllamEmbeddings model to convert both the original text blocks and the extracted triples into high-dimensional mathematical vectors (i.e., "embeds"). These vectors are able to capture the deep semantics of the text.
[0167] (3) Store in ChromaDB: All generated vectors are stored in the Chroma vector database.
[0168] (4) Application: Vector databases support semantic search. For example, when a user queries "limiting factors of signal bandwidth", even if the wording of the query is completely different from the original text, the system can quickly find relevant text blocks about "Nyquist theorem" and "channel bandwidth" by calculating the similarity between vectors.
[0169] The following is combined Figure 3 The query and analysis module of this system is described in detail, including:
[0170] The linguistic feature extraction unit performs basic NLP processing on the query text. It identifies interrogative words (such as "who," "what," "how," and "why") and checks for phrases enclosed in quotation marks, strongly indicating a need for precise string matching. Furthermore, the module identifies proper nouns, technical terms, abbreviations (such as "SOX"), or identifiers with specific formats (such as product codes and error codes), all of which are important clues for keyword retrieval.
[0171] Entity Recognition Unit: Employing a NER model, this unit identifies and labels entities mentioned in the query, such as names ("Shannon"), modulation methods ("FM"), and proper nouns ("bit error rate"). These identified entities are not only important components of the keywords but also the entry nodes for the graph retrieval module to perform graph traversal.
[0172] Intent Classification Unit: Based on the above analysis, the module uses a rule-based heuristic engine to classify queries into predefined intent types; these types and their judgment criteria are as follows:
[0173] Semantic queries are typically open-ended, conceptual questions that do not contain specific terms that must be matched exactly. For example: "Explain what single-sideband modulation is?"
[0174] Keyword-specific queries: These contain proper nouns, product codes, error messages, or quoted phrases that must be matched exactly. For example: "How to demodulate a DSB signal".
[0175] Relational queries explicitly inquire about the relationships, paths, or interactions between two or more identified entities. They typically include patterns such as "What is the relationship between... and...?" or "Who collaborated with...?". For example: "Query to analyze the differences and connections between time-division multiplexing and frequency-division multiplexing technologies?"
[0176] Hybrid queries: Queries that simultaneously contain semantic concepts and specific keywords. This is the most common type of query. For example: "Explain the impact of different channel types on modulation schemes and bit error rates."
[0177] The following is combined Figure 4 The multimodal retrieval module of this system is described in detail. Its execution flow includes: first, receiving structured output from the query analysis module through a retrieval orchestrator; and second, sending requests to the corresponding backend retrieval modules in parallel according to the query category. This parallel design maximizes retrieval efficiency and reduces system latency, as detailed below:
[0178] A1. If the query is classified as semantic, the primary request (or unique request) will be sent to the intensive retrieval module; wherein, the intensive retrieval module includes:
[0179] A document chunker is used to divide a raw document into blocks of text.
[0180] An embedding model is used to convert the text blocks and user queries into vector representations;
[0181] A vector database used to perform semantic similarity searches between user query vectors and text block vectors.
[0182] A2. If it is a keyword-specific request, the primary request will be sent to the sparse search module.
[0183] The sparse retrieval module includes a text indexer that uses the BM25 or TF-IDF algorithm to create an inverted index for the document library. The sparse retrieval submodule is used to receive queries, extract keywords, and perform term frequency and inverse document frequency calculations in the inverted index to return the document with the highest keyword matching degree.
[0184] A3. If it is a relational type, the request will be sent to the graph retrieval module, and the entity extracted from the query will be used as the starting node for graph traversal.
[0185] The graph retrieval module includes a knowledge graph database, where data is stored as nodes representing entities and edges representing relationships between entities. The graph retrieval module receives a relationship query containing entities, converts it into a graph query language, performs path lookup or neighbor expansion traversal operations on the knowledge graph database, and returns structured relationship information.
[0186] A4. If it is a hybrid query, the request will be sent to both the dense and sparse retrieval modules. If the query also contains entity pairs that can be used for graph retrieval, the request may also be sent to the graph retrieval module.
[0187] Finally, the orchestrator asynchronously waits for all invoked retrieval modules to return results. Each module returns a sorted list of documents (or information fragments), with each item in the list containing the content itself and a relevance score calculated by the module's internal algorithm. The orchestrator collects these lists of results (which may come from different sources) and passes them to the adaptive fusion module for further processing.
[0188] like Figure 5 As shown below, the adaptive fusion module of this system is described in detail. This module receives query intent classification results and dynamic fusion weights from the query analysis module. It includes a fusion weight acquisition unit, a search result standardization unit, a weighted fusion unit, and a fusion result sorting unit. The fusion weight acquisition unit receives the query intent classification results and dynamic fusion weights from the query analysis module. This unit matches the query type with a preset weight strategy table to obtain or calculate the weight coefficients of each search module for the current query. The search result standardization unit receives the sorted result lists returned by the dense search, sparse search, and graph search modules. The weighted fusion calculation unit calculates the final fusion score. The fusion result sorting and output unit receives all documents and their fusion scores output by the weighted fusion calculation unit, re-sorts them according to the fusion scores from high to low, and outputs them to the subsequent chained reasoning and self-consistency enhancement modules.
[0189] Specifically, this module employs an extended Reciprocal Rank Fusion (RRF) algorithm; for any document returned from any retrieval module, the final fusion score is calculated using the following formula:
[0190]
[0191] in: This is the rank of document d in the results list returned by the corresponding module (dense, sparse, or graph). If a document does not appear in the results of a module, its rank in that module can be considered infinite, and therefore this contribution is 0. k is a smoothing constant used to reduce the excessive influence of high rankings (especially the first-ranked document); , and These are weighting coefficients. The key innovation of this invention lies in the fact that these weights are not preset fixed values, but are dynamically generated by the query analysis module based on the current query category.
[0192] For example, for a query categorized as "semantic," the weight might be set to... =0.8, =0.2, =0.0. This indicates that the system highly trusts the results of dense searches, while giving smaller weights to sparse search results to capture potentially key terms.
[0193] For a keyword-specific query, the weight may be reversed. =0.1, =0.9, =0.0. This ensures that documents containing precise keywords receive the highest final score.
[0194] For a "relational" query, the weight might be... =0.1, =0.1, =0.8, thus prioritizing the display of structured relationship information extracted from the knowledge graph.
[0195] like Figure 7 As shown below, the communication calculator module of this system is described in detail, including a parameter identification unit, a formula matching unit, a formula derivation unit, a step recording unit, and a result structuring unit; it is used to identify key parameters in the problem using specific regular expressions according to different types of communication calculation problems: the regular expressions allow flexible matching of spaces, colons, and Chinese and English symbols, ensuring that parameters can be accurately extracted from problems of different formats.
[0196] After extracting the parameters, execute the corresponding formula:
[0197] Signal-to-noise ratio:
[0198] Channel capacity:
[0199] Bit error rate (BPSK):
[0200] Information entropy:
[0201] Average code length:
[0202] Each calculation step records the reasoning process, generating interpretable step-by-step reasoning steps and returning a numerical answer. Parameters are extracted using regular expressions, enabling automatic identification and rapid parsing of calculation problems. Unnecessary calls to LLM are avoided, improving efficiency. The output of the reasoning steps ensures that the results are verifiable and traceable.
[0203] The following is combined Figure 6 The chain reasoning and self-consistency enhancement module of this system is described in detail, including:
[0204] (1) Context building unit, used to select Top-K documents from the multimodal retrieval module to generate summaries, and to retrieve relevant triples from the triple vector library to jointly build the initial context; specifically including:
[0205] (11) Document summary generation and processing
[0206] Document selection: For the top-k documents obtained by the hybrid retrieval module (Dense / BM25 / Triple), calculate the final score (final_score) for each document. Sort by score and select the document with the highest score as the context core.
[0207] Summary generation: Extract the first 300-500 words of each document as a summary, retaining the core information. Mark sections of the document containing formulas, data, or key terms to ensure that the LLM can directly reference formulas or values in its reasoning.
[0208] Denoising and text cleaning: Clean up newline characters, extra spaces, and special characters; replace or unify symbols (e.g., ±, ×, →);
[0209] Ensure that the abstract text is concise and clearly structured, making it easy for LLM learners to understand.
[0210] (12) Triple Knowledge Integration
[0211] Vector Retrieval Triples: Using the Triple Vectorstore, top-k relevant triples are retrieved by retrieving the vectors of the question keywords. Triples consist of a {head, relation, tail} structure and can directly represent communication concepts, formulas, or logical relationships.
[0212] Enhanced Precision Matching and Scoring: Performs precise matching on entities or relations in the question; if a triple is highly relevant to the question, its weight is increased by `triple_precise_bonus`. Increases the priority of key knowledge within the context, ensuring that CoT inference references key facts.
[0213] Textualization of triples: Transform structured triples into textual descriptions, such as: entity: {head.name}, relation: {relation.name}, attribute / value: {tail.value}, and add them as context fragments to the LLM Prompt, along with source annotations to ensure traceability.
[0214] (2) Context enhancement and filtering unit, used to merge the initial context, sort by relevance, remove noise, unify the format and annotate, to form an enhanced context; specifically including:
[0215] (21) Context merging: Merge the document summary and triplet text by sorting by score to form a complete context.
[0216] For example:
[0217] Context:
[0218] - Document Summary 1
[0219] - Document Summary 2 ...
[0221] Triple knowledge:
[0222] - triple1 JSON
[0223] - triple2 JSON
[0224] (22) Correlation screening
[0225] Use keyword coverage or vector similarity to perform secondary filtering of the context, removing fragments with low relevance to the question. Ensure that the LLM reasoning process focuses on core information related to the question, avoiding redundant or misleading information. (23) Formatting and annotation
[0226] Formulas, values, and variables are uniformly labeled (e.g., {variable} or LaTeX format) to facilitate correct referencing and calculation in LLM reasoning. Triple references are tagged with hints (e.g., [TRIPLE]) to ensure a clear and traceable reasoning chain. Structured, concise, and highly relevant context is provided to improve the accuracy of LLM reasoning. Triple enhancement ensures factuality and verifiability. Context filtering and labeling strategies ensure that the logical chain generated by CoT is clear and interpretable. To guarantee that CoT generates high-quality, verifiable, and logically clear answers, this invention designs a structured Prompt construction and output specification, specifically including context organization, hint strategies, format constraints, and output parsing methods.
[0227] (24) Context organization methods
[0228] Document summary embedding: Retrieve the top-k documents from the hybrid retrieval module and select the most relevant document based on the final_score.
[0229] Extract a 300-500 word summary from each document, retaining core formulas, key data, and technical terms. Use standardized annotations for formulas and symbols, such as LaTeX or {variable} placeholders, to ensure that LLM can directly recognize and reference them.
[0230] Triple knowledge embedding: Retrieves top-k triples from a triple vector library, prioritizing entities and relations that precisely match the question. The structured triples are then textualized: [TRIPLE] Entity: {head.name}, Relation: {relation.name}, Attribute / Value: {tail.value}. The triple text includes source annotations to ensure traceability.
[0231] Context enhancement strategy: Merge document summaries and triplet texts, sorting them by question relevance. Perform secondary filtering on low-relevance content to avoid redundant information interfering with reasoning. Organize the context in logical order: facts / data → relationships / logic → question focus, ensuring smooth LLM reasoning.
[0232] (3) Structured hint building unit, adopting a hierarchical hint strategy and templated hints, and requiring LLM to output reasoning steps and final answer in a specified JSON format;
[0233] (31) Layered prompting strategy:
[0234] Facilitator role: Clearly instruct the LLM to act as a "communications expert" and enhance the model's professionalism in communication theory, formula calculation, and logical analysis.
[0235] Task instructions: Explicitly require LLM to generate "step-by-step reasoning" and "final answer". List in detail the reasoning logic, formula references, and data calculations for each step. For problems involving formulas or numerical calculations, it is mandatory to reference relevant formulas and data in each step of reasoning to avoid skipping steps to reach a conclusion.
[0236] Formatting constraints: Strict JSON output, no extra text or explanations allowed, ensuring parsability.
[0237] (32) Template-Based Prompt:
[0238] Use placeholder templates to inject the context, triples, and user question into the Prompt:
[0239] For example, if you are a communications expert, please use the following context to reason your way to the answer to the question.
[0240] Context:
[0241] - {Document Summary 1}
[0242] - {Document Summary 2} ...
[0244] Triple knowledge:
[0245] - {Triplet 1 JSON}
[0246] - {Triplet 2 JSON} ...
[0248] Please return the data in JSON format only.
[0249] {
[0250] "reasoning": ["Step-by-step reasoning 1","Step-by-step reasoning 2", "..."], "final_answer": "Final answer"
[0251] }
[0252] No additional text, explanations, or greetings are allowed.
[0253] question:
[0254] {User Issues}
[0255] For questions involving formulas or numerical calculations, the template explicitly states that "formulas and data must be referenced in step-by-step reasoning," avoiding directly presenting conclusions without the reasoning process. Triple references are marked with [TRIPLE], enabling LLM to distinguish between document content and structured knowledge, supporting fact verification. When the Prompt length exceeds the model context limit, context priority filtering or chunked input is performed. When the total Prompt length exceeds the model context limit, context content is filtered according to priority: triples that precisely match the question, core document summaries (containing formulas and key data), and secondary document summaries or auxiliary knowledge.
[0256] (4) Self-consistent sampling and fault-tolerant parsing unit, used to generate multiple independent inference chains for the same query, determine the final answer through majority voting, and perform JSON fault-tolerant parsing and degradation processing on the LLM output to ensure system robustness.
[0257] (41) Perform fault-tolerant parsing of JSON output:
[0258] Automatically replaces Chinese quotation marks (“ ”, ' ’) in the output text with standard English quotation marks (" ") to ensure compliance with JSON syntax specifications. For example, “reasoning”: [“Step 1”, “Step 2”] → "reasoning": ["Step 1", "Step 2"].
[0259] (42) Correct extra commas or incomplete JSON;
[0260] Regular expression replacement is used to replace any extra commas (such as ,} or ,]) that may exist in the LLM output, thus fixing syntax errors.
[0261] Automatic completion is provided for missing closing parentheses, mismatched quotation marks, etc. For example, {"reasoning": ["Step 1", "Step 2",]} → {"reasoning": ["Step 1", "Step 2"]}
[0262] (43) Downgrade processing for unparseable text
[0263] Match the reasoning step from the text, such as matching the content following the "reasoning" or "reasoning" tags.
[0264] Match final_answer from the text, such as matching the content following the tag "answer" or "final_answer".
[0265] The extracted reasoning and final_answer are encapsulated into a CoT output object, allowing for continued processing even if the original JSON is incomplete. This improves the robustness of chained inference output and prevents system interruptions due to LLM format errors. It ensures the usability and interpretability of the inference chain, preserving key reasoning information even if the original output is not standardized. Combined with a self-consistent sampling mechanism, it can eliminate anomalies from diverse samples, ensuring a robust and professional final answer.
[0266] (44) Sample Analysis and Final Answer Selection:
[0267] If the final_answer is the same for most samples, the mode is used.
[0268] If there is a high degree of diversity, multiple candidates should be retained or a weighted rule should be used to select the optimal one.
[0269] like Figure 8As shown, the prompt construction and generation module includes a multi-source input integration unit, a structured prompt construction unit, a prompt optimization unit, and an LLM call and result generation unit. The multi-source input integration unit is used to integrate the calculator output or CoT inference chain obtained from within the system with the user's original query. The structured prompt construction unit and the prompt optimization unit are used to construct enhanced prompts. The LLM call and result generation unit is used to call a large language model to generate the final answer.
[0270] Example 2
[0271] This embodiment provides a method for generating an adaptive multimodal retrieval enhancement generation system, which specifically includes the following steps:
[0272] S1. Construct a dual knowledge structure;
[0273] Intelligent segmentation and quality screening: The original document is recursively segmented into intelligent blocks to maintain semantic integrity, and the text blocks are subjected to multi-dimensional quality assessment and priority ranking based on length, entity density and relation words;
[0274] Core knowledge structuring: Prioritize the automatic extraction of "subject-verb-object" triples from high-quality text blocks to form machine-readable structured knowledge;
[0275] Dual knowledge construction: The deduplicated triples are imported into a graph database to construct a knowledge graph; at the same time, the text blocks and triple texts are vectorized and stored in a vector database to form a dual knowledge index.
[0276] S2. Query preprocessing and analysis;
[0277] Receive natural language questions from the user and preprocess them, including:
[0278] Perform linguistic feature extraction to identify interrogative words, phrases within quotation marks, and specific format identifiers;
[0279] Extract communication-related entities from the query using a named entity recognition model;
[0280] Based on the extracted features and entities, the query intent is classified as computational or non-computational.
[0281] If it is a computational query, proceed to step S3;
[0282] If the query is not computational, proceed to step S4.
[0283] S3, the communication calculator module will be executed first;
[0284] The system uses regular expressions to match numerical parameters in the query and calls preset communication domain formulas to perform calculations, directly generating a structured output containing reasoning steps and answers, and proceeds to step S6.
[0285] S4, Multimodal Hybrid Retrieval and Fusion;
[0286] For non-computational queries, perform the following operations:
[0287] Parallel retrieval: Based on the intent classification results of step S2, dense retrieval, sparse retrieval, and graph retrieval are invoked in parallel to obtain relevant information from the vector library, inverted index, and knowledge graph, respectively.
[0288] Dynamic weight fusion: The inverse sorting fusion algorithm is adopted, and the weights of each retrieval mode are dynamically allocated according to the query type determined in step S2. The heterogeneous retrieval results are uniformly sorted and fused to output the optimal set of context fragments.
[0289] S5, chain reasoning and enhanced self-consistency;
[0290] Context enhancement: Integrate retrieved document fragments with relevant triple knowledge to construct enhanced contexts with high information density and clear logic;
[0291] Structured reasoning: Guides a large language model with specific prompt templates to output a step-by-step reasoning chain and the final answer in a standardized JSON format;
[0292] Self-consistency verification: Generate multiple independent inference chains for the same query, determine the most reliable final answer through a majority voting mechanism, and perform fault-tolerant parsing on the model output to ensure robustness;
[0293] S6. Answer generation and output;
[0294] The calculation results from step S3 or the reasoning results from step S5 are combined with the original query to form the final prompt, which is then input into a large language model to generate and return to the user.
[0295] The preferred embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the specific details of the above embodiments. Within the scope of the technical concept of the present invention, various simple modifications can be made to the technical solution of the present invention, and these simple modifications all fall within the protection scope of the present invention.
[0296] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, the present invention will not describe the various possible combinations separately.
[0297] Furthermore, various different embodiments of the present invention can be combined in any way, as long as they do not violate the spirit of the present invention, they should also be regarded as the content disclosed by the present invention.
Claims
1. A knowledge graph-based question-answering system for the communication domain, characterized in that, include: The knowledge graph database construction module is used to automatically process unstructured raw documents and build a dual knowledge structure with both document vector library and triple vector library. This dual knowledge structure provides a unified data foundation for all subsequent retrieval operations. The query analysis module is used to extract linguistic features, identify entities, and classify intents from user queries, and output the intent type and dynamic fusion weights of the query. The intent types of the query include semantic, keyword-specific, relational, and hybrid types. The dynamic fusion weights include dense retrieval weights, sparse retrieval weights, and graph retrieval weights. The multimodal retrieval module includes a dense retrieval module, a sparse retrieval module, and a graph retrieval module configured in parallel, and is used to execute the corresponding type of retrieval task according to the instructions of the query analysis module; The adaptive fusion module is used to receive the retrieval results returned by each retrieval module, and based on the dynamic fusion weight output by the query analysis module, to reorder and fuse the retrieval results using a reciprocal sorting fusion algorithm, and output a unified context fragment. The Communication Calculator module is used to process communication-related calculation problems input by users. It automatically identifies key numerical values, variables, and distribution information parameters in the problem through predefined regular expressions, matches them with corresponding formulas in the field of communication, directly executes the formula derivation, automatically records the step-by-step calculation steps and formula reference process, and outputs the final answer in structured JSON format. The chained reasoning and self-consistency enhancement module is used to handle complex logical reasoning problems that are not computationally intensive. By receiving the context output by the adaptive fusion module, it uses a templated and structured Prompt to guide a large language model to perform chained reasoning and generate a complete step-by-step reasoning process. It also adopts a self-consistency sampling mechanism to generate multiple reasoning samples under the same context. Through JSON fault-tolerant parsing, structure repair, majority voting and abnormal output removal mechanisms, it finally selects the reasoning chain and its conclusion that is the most semantically stable and logically consistent. The suggestion building and generation module is used to integrate the calculator output or CoT inference chain obtained from within the system with the user's original query to build enhanced suggestions and standardize the large language model to generate high-quality, natural language final answers.
2. The knowledge graph-based question-answering system for the communication domain as described in claim 1, characterized in that, The workflow of the knowledge graph database construction module is to transform unstructured raw documents into a dual knowledge structure consisting of a document vector library and a triplet vector library, specifically including the following: Phase 1: Document parsing and intelligent segmentation; transforming the original document into standardized text units suitable for processing by large language models while maintaining semantic integrity; A1. Document Loading and Parsing: The original document is loaded using a document parser and parsed page by page to extract plain text content and basic structural information, providing a data source for subsequent processing. A2. Intelligent text segmentation: Employs a recursive character text segmenter to simulate human reading habits, following a recursive priority of "paragraph → sentence → word" for segmentation; A3. Context Preservation: By setting the overlap parameter, ensure that adjacent text blocks retain some common content at the boundary; Phase Two: Quality Assessment and Prioritization; B1. Multidimensional Quality Score: B11. Length Fit: Evaluates whether the length of the text block is within the preset optimal range; B12. Entity Density: Using named entity recognition technology, statistically analyze the communication-related technical terms contained in text blocks. B13. Existence of Relational Verbs: Detects whether a text block contains relational indicative verbs; B2. Priority-based batch scheduling; All text blocks are sorted in descending order based on their overall quality score, and the system prioritizes scheduling the batch with the highest score to enter the subsequent core knowledge extraction process. Phase Three: Core Knowledge Extraction; C1. Extraction process of structured triple set: Text preprocessing: First, the text blocks are cleaned and focused, and sentences with key verbs are selected. Accurate parsing based on large language models: Learning from a small number of samples by using large language models with prompts; The prompts clearly state the task instructions, output format specifications, and provide high-quality examples to guide the model to accurately parse the subject, predicate, and object from the text and generate structured triple data. C2. Parallelized Batch Processing: Pack multiple high-priority text blocks into batches and use ThreadPoolExecutor for parallel batch extraction, making full use of multi-core computing resources; Phase Four: Knowledge Integration and Persistence D1. Structured Knowledge Storage: D11. Remove duplicates from all extracted triples to ensure the uniqueness of the knowledge; D12. Store the cleaned set of triples as a structured file or import it directly into a graph database; D2, Vectorized storage: D21. Use an embedding model to convert the original text block and the extracted triplet text into high-dimensional vectors respectively; D22. Store all generated vectors in a vector database; D23. Vector databases build indexes by calculating the similarity between vectors, providing semantic similarity search capabilities.
3. The knowledge graph-based question-answering system for the communication domain as described in claim 1, characterized in that, The query analysis module includes: The linguistic feature extraction unit is used to identify interrogative words, phrases within quotation marks, proper nouns, technical terms, abbreviations, or identifiers of a specific format in the user query. An entity recognition unit is used to identify and extract entities from the user query using a named entity recognition model. The intent classification unit is used to determine the classification result of the user query as semantic, keyword, relational, or mixed query based on the identified linguistic features and entities.
4. The knowledge graph-based question-answering system for the communication domain as described in claim 3, characterized in that, The semantic queries are open-ended, conceptual questions that do not contain specific terms that must be matched precisely. The keyword-specific query includes proper nouns, product codes, error messages, or quoted phrases that must be matched exactly; The relational query explicitly inquires about the connection, path, or interaction between two or more entities extracted by the entity recognition unit; The hybrid query includes both semantic concepts and specific keywords.
5. A knowledge graph-based question-answering system for the communication domain as described in claim 1, characterized in that, The dense retrieval module includes: A document chunker is used to divide a raw document into blocks of text. An embedding model is used to convert the text blocks and user queries into vector representations; A vector database used to perform semantic similarity searches between user query vectors and text block vectors; The sparse retrieval module includes a text indexer, which uses the BM25 or TF-IDF algorithm to create an inverted index for the document library; the sparse retrieval submodule is used to receive a query, extract keywords, and perform term frequency and inverse document frequency calculations in the inverted index to return the document with the highest matching degree with the keywords. The graph retrieval module includes a knowledge graph database, where data is stored as nodes representing entities and edges representing relationships between entities. The graph retrieval module receives a relationship query containing entities, converts it into a graph query language, performs path lookup or neighbor expansion traversal operations on the knowledge graph database, and returns structured relationship information.
6. A knowledge graph-based question-answering system for the communication domain as described in claim 1, characterized in that, The calculation formula for the inverse sorting fusion algorithm is as follows: ; Among them: dense retrieval weight Sparse retrieval weights Graph retrieval weight , , , It is a document Ranking in the results list returned by each search module; This is the smoothing constant.
7. A knowledge graph-based question-answering system for the communication domain as described in claim 1, characterized in that, In the communication calculator module, the preset communication domain formulas include: Signal-to-noise ratio: ; Channel capacity: ; Bit error rate (BPSK): ; Information entropy: ; Average code length: ; in, Signal power; Noise power; Linear signal-to-noise ratio; Signal-to-noise ratio expressed in decibels (dB); Channel capacity; Channel bandwidth; Bit error rate; Complementary error function; Information entropy; : The probability of the i-th symbol appearing; Average code length; : The encoding length of the i-th symbol.
8. A knowledge graph-based question-answering system for the communication domain as described in claim 1, characterized in that, The chain reasoning and self-consistency enhancement module includes: The context building unit is used to select Top-K documents from the multimodal retrieval module to generate summaries and retrieve relevant triples from the triple vector library to jointly build the initial context; The context enhancement and filtering unit is used to merge the initial context, sort it by relevance, remove noise, standardize the format and annotate it to form an enhanced context; The structured hint building unit adopts a hierarchical hint strategy and templated hints, and forces LLM to output reasoning steps and final answers in a specified JSON format; The self-consistent sampling and fault-tolerant parsing unit is used to generate multiple independent inference chains for the same query, determine the final answer through majority voting, and perform JSON fault-tolerant parsing and degradation processing on the LLM output to ensure system robustness.
9. The method for generating a knowledge-based question-answering system in the communication domain as described in claim 1, characterized in that, Specifically, the steps include the following: S1. Construct a dual knowledge structure; Intelligent segmentation and quality screening: The original document is recursively segmented into intelligent blocks to maintain semantic integrity, and the text blocks are subjected to multi-dimensional quality assessment and priority ranking based on length, entity density and relation words; Core knowledge structuring: Prioritize the automatic extraction of "subject-verb-object" triples from high-quality text blocks to form machine-readable structured knowledge; Dual knowledge construction: The deduplicated triples are imported into a graph database to construct a knowledge graph; at the same time, the text blocks and triple texts are vectorized and stored in a vector database to form a dual knowledge index. S2. Query preprocessing and analysis; Receive natural language questions from the user and preprocess them, including: Perform linguistic feature extraction to identify interrogative words, phrases within quotation marks, and specific format identifiers; Extract communication-related entities from the query using a named entity recognition model; Based on the extracted features and entities, the query intent is classified as computational or non-computational. If it is a computational query, proceed to step S3; If the query is not computational, proceed to step S4; S3, the communication calculator module will be executed first; The system uses regular expressions to match numerical parameters in the query and calls preset communication domain formulas to perform calculations, directly generating a structured output containing reasoning steps and answers, and proceeds to step S6. S4, Multimodal Hybrid Retrieval and Fusion; For non-computational queries, perform the following operations: Parallel retrieval: Based on the intent classification results of step S2, dense retrieval, sparse retrieval, and graph retrieval are invoked in parallel to obtain relevant information from the vector library, inverted index, and knowledge graph, respectively. Dynamic weight fusion: The inverse sorting fusion algorithm is adopted, and the weights of each retrieval mode are dynamically allocated according to the query type determined in step S2. The heterogeneous retrieval results are uniformly sorted and fused to output the optimal set of context fragments. S5, chain reasoning and enhanced self-consistency; Context enhancement: Integrate retrieved document fragments with relevant triple knowledge to construct enhanced contexts with high information density and clear logic; Structured reasoning: Guides a large language model with specific prompt templates to output the step-by-step reasoning chain and the final answer in a standardized JSON format; Self-consistency verification: Generate multiple independent inference chains for the same query, determine the most reliable final answer through a majority voting mechanism, and perform fault-tolerant parsing on the model output to ensure robustness; S6. Answer generation and output; The calculation results from step S3 or the reasoning results from step S5 are combined with the original query to form the final prompt, which is then input into a large language model to generate and return to the user.