Large model question and answer method and system based on knowledge base

By constructing a two-dimensional query essence space and nonlinear weight calculation, the complexity of the problem is dynamically evaluated, which solves the problem of inaccurate retrieval caused by the fixed weight model and improves the accuracy and reliability of large model question answering.

CN120929576AActive Publication Date: 2025-11-11ZHONGNAN INFORMATION TECH (SHENZHEN) CO LTD +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202511447566.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-11
Publication Date
2025-11-11
Estimated Expiration
2045-10-11

AI Technical Summary

Technical Problem

In existing technologies, fixed-weight models cannot adapt to the complexity differences of different question types, resulting in insufficient or excessive retrieval of information, which affects the accuracy and reliability of the question-answering system.

Method used

By constructing a two-dimensional query essence space, based on multiple fundamental linguistic features of user questions, and employing non-linear calculation of dynamic weights, the complexity index of the question is dynamically evaluated to optimize the scope of information retrieval.

Benefits of technology

It achieves accurate adaptive evaluation of questions, improves the accuracy and reliability of large model question answering, and provides appropriate contextual information support.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120929576A_ABST
    Figure CN120929576A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of data processing, and particularly relates to a large model question and answer method and system based on a knowledge base, and the method comprises the steps: receiving a user question, and extracting a plurality of basic linguistic features; constructing a two-dimensional query essential space, and mapping a user question into a query point in the space; in the query essential space, non-linearly calculating the dynamic weight of each basic linguistic feature based on the geometric distance between the query point and a plurality of preset feature ideal anchor points; according to the dynamic weight and the basic linguistic features, calculating a dynamic problem complexity index, and determining the retrieval number of the knowledge base; and retrieving the knowledge fragments from the knowledge base according to the retrieval quantity, and generating answers in combination with the user questions. According to the method, accurate self-adaption of the retrieval range is achieved by dynamically evaluating the question essence, appropriate context information can be provided for a large language model, and therefore the accuracy and reliability of large model question answering are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology. More specifically, this invention relates to a large-scale question-answering method and system based on a knowledge base. Background Technology

[0002] With the rapid development of large language model technology, combining its powerful natural language understanding and generation capabilities with private knowledge bases in specific domains has become a research focus in the industry. Retrieval-enhanced generation is the current mainstream technical paradigm. Its standard process is as follows: when a user asks a question, the system first uses information retrieval technology to find a set of contextual knowledge fragments related to the question from the knowledge base. Then, the system concatenates the retrieved knowledge fragments with the user's original question and submits them as input to the large language model. Finally, the language model generates an answer based on the provided contextual information.

[0003] Currently, determining the optimal amount of information to retrieve, i.e., the number of knowledge fragments to retrieve, K, is a crucial technical challenge. If K is set too small, large models may be unable to form a comprehensive judgment for complex problems due to insufficient information input, potentially leading to one-sided answers. If K is set too large, the retrieved information will contain a large amount of noise or redundant content, not only increasing the computational burden of large models but also potentially interfering with the model's attention due to information overload, resulting in logically confused answers. Existing technologies often use a fixed weighted summation method to fuse the linguistic features of the user's question into a problem complexity index, and then use this index to determine the K value.

[0004] However, the weighting coefficients used for feature fusion are pre-set and remain unchanged during operation, making them unsuitable for the diverse types of questions in the real world. The complexity of some technical problems often lies primarily in the density of technical terminology, while the complexity of some operational process problems is more reflected in the steps and logical layers of the operational process. Fixed weights cannot capture these differences in problems, leading to incorrect complexity assessments for certain types of questions. This results in either too high or too low a K-value for retrieval, severely impacting the accuracy and reliability of the question-answering system. Summary of the Invention

[0005] To address the technical problem of inaccurate retrieval scope caused by the use of fixed weight models in existing technologies, this invention provides solutions in the following aspects.

[0006] In a first aspect, the present invention provides a large-scale question-answering method based on a knowledge base, comprising: receiving a user question and extracting multiple basic linguistic features of the user question; constructing a two-dimensional query essence space and mapping the user question to a query point in the query essence space; nonlinearly calculating the dynamic weights of each basic linguistic feature in the query essence space based on the geometric distance between the query point and multiple preset ideal feature anchor points; calculating a dynamic question complexity index based on the dynamic weights and the basic linguistic features, and determining the number of retrievals in the knowledge base to achieve dynamic optimization of the information retrieval scope.

[0007] This invention achieves precise adaptive retrieval scope by dynamically evaluating the nature of the question, providing appropriate contextual information for large language models, thereby improving the accuracy and reliability of large model question answering.

[0008] Preferably, the basic linguistic features include at least: normalized length features, normalized entity density features, and normalized syntactic complexity features.

[0009] By extracting features from these three dimensions, the basic attributes of a problem can be comprehensively evaluated from three aspects: text length, knowledge density, and structural complexity, providing comprehensive and standardized basic data for subsequent complexity analysis.

[0010] Preferably, the query essence space consists of a technical expertise axis and a process complexity axis. Mapping the user question to a query point in the query essence space includes: calculating a technical terminology tendency index as the coordinate of the query point on the technical expertise axis based on the proportion of technical terms in the user question; and calculating a process inquiry tendency index as the coordinate of the query point on the process complexity axis based on the semantic similarity between the user question and a preset set of process keywords.

[0011] By constructing a two-dimensional space, the essence of a problem can be visualized and expressed in a computable way. Compared with the traditional one-dimensional linear complexity evaluation model, it is more accurate in classifying and understanding the problem.

[0012] Preferably, the technical terminology preference index satisfies the following relationship: ;in, This is a technical terminology preference indicator; Q represents the user problem, and w represents a word within the user problem. A pre-built technical terminology dictionary, This is an indicator function; w has a value of 1 when it is in the dictionary of technical terms and a value of 0 when it is not. The total number of words in the user's question.

[0013] Preferably, the propensity index for process inquiry satisfies the following relationship: ;in, This is a propensity indicator for process-related inquiries; Q represents user questions. Let k be a pre-defined set of process keywords. This is a function for calculating semantic similarity.

[0014] Preferably, the ideal feature anchor points include: an entity density feature anchor point corresponding to the normalized entity density feature, and a syntactic complexity feature anchor point corresponding to the normalized syntactic complexity feature; the coordinates of the entity density feature anchor point in the query essential space are (1,0); the coordinates of the syntactic complexity feature anchor point in the query essential space are (0,1).

[0015] By establishing ideal anchor points, the most suitable ideal problem type is defined for the importance of different features, providing a benchmark reference for subsequent dynamic weight calculation based on geometric relationships, thus giving the weight allocation clear physical meaning and guidance.

[0016] Preferably, the nonlinear calculation of the dynamic weights of each basic linguistic feature is achieved by using Gaussian radial basis functions to calculate the original weights of each basic linguistic feature based on the Euclidean distance between the query point and the ideal anchor point of each feature, and then normalizing the original weights to obtain the dynamic weights. The closer the Euclidean distance, the higher the corresponding original weight.

[0017] Preferably, the original weights satisfy the following relation: ;in, The original weights of basic linguistic feature i, For query point, The ideal anchor point for feature i in basic linguistics The square of the Euclidean distance between the query point and the ideal feature anchor point is given. It is a positive adjustment factor used to control the sensitivity of the weights to distance.

[0018] This invention can transform the minute differences between query points and anchor points into significant weight differences, enabling weight allocation to accurately focus on the features most relevant to the essence of the current problem, thus avoiding the rigidity and evaluation bias of linear models.

[0019] Preferably, the method further includes: retrieving the top K knowledge fragments in terms of relevance from the knowledge base based on the number of searches; using the K knowledge fragments as context, constructing prompt words together with the user question, and inputting them into a large language model to generate the final answer.

[0020] Secondly, the present invention provides a large-scale question-answering system based on a knowledge base, including a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the above-mentioned large-scale question-answering method based on a knowledge base is implemented.

[0021] By adopting the above technical solution, a computer program is generated from the above-mentioned knowledge base-based large model question-answering method and stored in the memory so that it can be loaded and executed by the processor. In this way, a terminal device can be made based on the memory and the processor for convenient use.

[0022] This invention introduces a query essence space and adaptive calculation of nonlinear weights based on geometric relationships, abandoning simple linear weighting. It can capture the nonlinear interaction between different linguistic features. The final weight allocation reflects the overall picture of the problem, rather than a simple superposition of the independent contributions of each feature, making the internal logic of complexity assessment more profound and reasonable.

[0023] Furthermore, in the query essence space, subtle changes in question type will be reflected in the smooth movement of query points, thereby triggering a smooth nonlinear adjustment of all weights. This makes the weight allocation mechanism less sensitive to subtle changes in the way users ask questions, resulting in more stable and robust evaluation results. It avoids the drastic fluctuations in weights that may be caused by a sudden change in a single feature value in a linear model, thus greatly enhancing the model's adaptability and robustness. Attached Figure Description

[0024] The above and other objects, features, and advantages of exemplary embodiments of the present invention will become readily apparent upon reading the following detailed description with reference to the accompanying drawings. In the drawings, several embodiments of the invention are illustrated by way of example and not limitation, and like or corresponding reference numerals denote like or corresponding parts, wherein: Figure 1 This is a flowchart illustrating a large-scale question-answering method based on a knowledge base according to the present invention; Figure 2 This is a schematic diagram illustrating the effect of the process for handling technology-intensive problems in an embodiment of the present invention; Figure 3 This is a schematic diagram illustrating the effect of the process for handling process-intensive problems in an embodiment of the present invention. Detailed Implementation

[0025] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0026] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0027] This invention discloses a large-scale question-answering method based on a knowledge base, referring to... Figure 1 This includes steps S1-S4: S1. Receive user questions and extract multiple basic linguistic features of the user questions.

[0028] In an optional embodiment, when the system receives a question Q input by a user, it first performs a series of standardized natural language processing preprocessing operations on it, including word segmentation, part-of-speech tagging, and stop word removal, to obtain structured text information. Subsequently, the system extracts multiple basic linguistic features from multiple dimensions to evaluate the inherent attributes of the question text.

[0029] Specifically, the basic linguistic features include, but are not limited to, normalized length feature (FL), normalized entity density feature (FE), and normalized syntactic complexity feature (FS). Among them, the normalized length feature reflects the text length of the question. It is calculated by counting the total number of words in the question text after preprocessing, and then performing linear normalization according to a preset empirical range, mapping the value to the interval [0,1]. For example, the empirical range is a minimum length of 5 and a maximum length of 50.

[0030] Normalized entity density features are used to assess the degree of professional knowledge intensity in a problem. The system first uses named entity recognition technology to identify and count the number of professional terms, proper nouns, and other entities contained in the problem by referring to a dictionary of technical terms that are highly relevant to the knowledge base domain. Then, the entity density is obtained by dividing the number of entities by the total number of words in the problem.

[0031] Normalized syntactic complexity features are used to measure the linguistic structural complexity of a problem. Using syntactic analysis tools, such as dependency parsing, a syntactic tree of the problem is constructed, and complexity indicators such as the maximum depth of the syntactic tree, the number of clauses, and the average dependency distance are extracted. These indicators are then weighted and combined into a comprehensive syntactic score, which is then normalized as well.

[0032] In this way, by extracting and standardizing the features of user problems from multiple dimensions, comprehensive and standardized input data is provided for building an accurate and adaptive complexity evaluation model, ensuring the reliability and consistency of subsequent calculations.

[0033] S2. Construct a two-dimensional query essence space and map user questions to query points in the query essence space.

[0034] In an optional embodiment, a two-dimensional Cartesian coordinate space can be defined as the query essence space, which consists of two mutually orthogonal dimensions: the X-axis represents the technical expertise, with an actual value range of [0,1]. The higher the value of this axis, the higher the knowledge density of the problem; the Y-axis represents the process complexity, with an actual value range of [0,1]. The higher the value of this axis, the stronger the operational guidance of the problem.

[0035] In this optional embodiment, in order to map any question Q to the query essence space, two query domain identification indicators can be calculated as the (x,y) coordinates of question Q in the space. The query domain identification indicators include the technical terminology preference indicator Itech as the horizontal axis and the process inquiry preference indicator Iproc as the vertical axis.

[0036] Specifically, the technical terminology preference index satisfies the following relation:

[0037] Where Q represents the user question, and w represents a word within the user question. A pre-built technical terminology dictionary, This is an indicator function; its value is 1 when w is in the technical terminology dictionary and 0 when it is not. The total number of words in the user's question.

[0038] The propensity index for process inquiry satisfies the following relation:

[0039] in, This is a pre-defined set of process keywords, for example, such as {"how", "how", "steps", ...}; k is a keyword in the set of process keywords. For semantic similarity calculation, a cosine similarity function based on word vectors can be used as an example.

[0040] In this way, any user question Q can be uniquely mapped to a query point PQ=(Itech, Iproc) in the query essence space.

[0041] In this way, by mapping abstract problem attributes to a concrete coordinate space, the intrinsic nature of the problem can be accurately described mathematically, providing a foundation for subsequent dynamic weight calculation based on geometric relationships.

[0042] S3. In the query essence space, based on the geometric distance between the query point and multiple preset ideal feature anchor points, the dynamic weights of each basic linguistic feature are calculated nonlinearly.

[0043] In an optional embodiment, the dynamic weights of each basic linguistic feature can be nonlinearly calculated in the query essence space based on the geometric distance between the query point and a plurality of preset ideal feature anchor points.

[0044] Specifically, the entity density feature anchor point represents a purely technical knowledge inquiry question, which has the highest technical expertise and the lowest process complexity. Therefore, its anchor point is set at AE=(1,0); the syntactic complexity feature anchor point represents a purely operational process inquiry question, which has the highest process complexity and the lowest technical expertise. Therefore, its anchor point is set at AS=(0,1).

[0045] Furthermore, nonlinear dynamic weight calculations can be performed based on spatial distance. The final weight of a feature depends on the geometric proximity of the current query point to the ideal anchor point of that feature. Nonlinear modeling is performed using the Gaussian radial basis function (RBF), and its original weights satisfy the following relationship:

[0046] in, The original weights of basic linguistic feature i, For query point, The ideal anchor point for feature i in basic linguistics The square of the Euclidean distance between the query point and the ideal anchor point of the feature is given. This is a positive adjustment factor used to control the sensitivity of the weights to distance; for example, a value of 2 is used. For length features, a fixed base influence value is assigned to them. For example, the value is 0.25; finally, the three original weights are normalized to obtain the final dynamic weights. .

[0047] For example, for a technology-intensive problem, let's say it's problem Q1, and the coordinates of its query point are... =(0.27, 0.00), then the squared distance from the query point to each anchor point is calculated as follows: ; The original weights are respectively ; ; The final total weight is 0.711, therefore the final normalized dynamic weight is... The values ​​are 0.35, 0.49, and 0.16, respectively.

[0048] For example, for the process-intensive problem Q2, the calculated coordinates of the query point are: =(0.14,1.00), then the squared distance from the query point to each anchor point is calculated as follows: ; The original weights are respectively ; ; The final total weight is 1.243, therefore the final normalized dynamic weight is... The values ​​are 0.20, 0.03, and 0.77, respectively.

[0049] In this way, by transforming the geometric relationship between the problem point and the ideal anchor point into a weight allocation ratio through a nonlinear function, the most suitable combination of feature importance can be matched for problems of different natures, thus realizing dynamic adaptation of weights.

[0050] S4. Calculate the dynamic problem complexity index based on dynamic weights and basic linguistic features, and determine the number of retrievals in the knowledge base to achieve dynamic optimization of the information retrieval scope.

[0051] In an optional embodiment, after obtaining the dynamic weights for the current problem, the acquired basic linguistic features can be weighted to calculate the final dynamic problem complexity index. Satisfying the relation:

[0052] Furthermore, using a pre-defined linear mapping function, it is transformed into the final number K of knowledge fragments to be retrieved:

[0053] in, and These are the minimum and maximum number of searches allowed by the system, for example. round() is the rounding function.

[0054] For example, suppose the received user question Q1 is: "Please explain in detail the relationship between quantum entanglement and the EPR paradox in microservice architecture." The extracted basic linguistic features are: FL = 0.047, FE = 0.35, FS = 0.15. Due to dynamic weights... Given values ​​of 0.35, 0.49, and 0.16 respectively, the following can be calculated: The value is 0.212, and the final number of knowledge fragments to be retrieved, K, is 4. Similarly, assuming the user question Q2 is: "How to deploy a Docker container and Kubernetes cluster step by step, including detailed steps and precautions", the extracted basic linguistic features are: FL = 0.215, FE = 0.1, FS = 0.6, due to dynamic weights. Given values ​​of 0.20, 0.03, and 0.77 respectively, the following can be calculated: The value is 0.508, therefore the final number of knowledge fragments K to be retrieved is 6.

[0055] like Figure 2 and Figure 3 The figures shown are schematic diagrams illustrating the processing flow for technology-intensive problems and the processing flow for process-intensive problems, respectively, in embodiments of the present invention. As can be seen, Figure 2 Chinese user question Q1 query point The coordinates (0.27, 0.00) are more inclined towards a physical anchor point. After being calculated by a nonlinear exponential function, its influence is amplified dramatically, thus giving its corresponding feature the highest weight. Figure 3 Chinese user question Q2 query point The coordinates (0.17, 1.00) indicate that the problem has almost no technical expertise but extremely high procedural complexity, hence the query point. Geometrically, it is clearly biased towards syntactic anchors. As can be seen, the weight of the syntax (S) feature is amplified and marked in red, becoming the highest among the three features. Since procedural problems are usually more complex and require reference to more steps and contextual information, the basic feature value and dynamic weight are both higher, so the mapped K value will be larger.

[0056] In this way, by combining dynamic weights with basic features, an index that accurately reflects the complexity of the problem can be generated, and the optimal number of retrievals can be determined accordingly. This provides just the right amount of information input for the subsequent generation of high-quality answers by the large model, thereby achieving dynamic optimization of the information retrieval scope.

[0057] This invention also discloses a knowledge base-based large model question answering system, including a processor and a memory. The memory stores computer program instructions, which, when executed by the processor, implement a knowledge base-based large model question answering method according to this invention.

[0058] The system also includes other components well known to those skilled in the art, such as communication buses and communication interfaces, the settings and functions of which are known in the art and will not be described in detail here.

[0059] In the description of this specification, "multiple" or "several" means at least two, such as two, three or more, unless otherwise expressly and specifically defined.

[0060] While this specification has shown and described numerous embodiments of the invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Many modifications, alterations, and alternatives will occur to those skilled in the art without departing from the spirit and essence of the invention. It should be understood that various alternatives to the embodiments of the invention described herein may be employed in the practice of this invention.

Claims

1. A large-scale question-answering method based on a knowledge base, characterized in that, include: Receive user questions and extract multiple basic linguistic features of the user questions; Construct a two-dimensional query essence space and map the user question to query points in the query essence space; In the query essence space, the dynamic weights of each basic linguistic feature are nonlinearly calculated based on the geometric distance between the query point and multiple preset ideal feature anchor points. The dynamic problem complexity index is calculated based on the dynamic weights and the basic linguistic features, and the number of retrievals in the knowledge base is determined to achieve dynamic optimization of the information retrieval scope.

2. The knowledge base-based large-scale question-answering method according to claim 1, characterized in that, The basic linguistic features include at least: normalized length features, normalized entity density features, and normalized syntactic complexity features.

3. The knowledge base-based large-scale question-answering method according to claim 1, characterized in that, The query essence space consists of a technical expertise axis and a process complexity axis, mapping the user's question to query points in the query essence space, including: Based on the proportion of technical terms in the user questions, a technical terminology tendency index is calculated as the coordinate of the query point on the technical expertise axis; Based on the semantic similarity between the user's question and the preset set of process keywords, a process query tendency index is calculated as the coordinate of the query point on the process complexity axis.

4. The knowledge base-based large-scale question-answering method according to claim 3, characterized in that, The technical terminology preference index satisfies the following relation: in, This is a technical terminology preference indicator; Q represents the user problem, and w represents a word within the user problem. A pre-built technical terminology dictionary, This is an indicator function; w has a value of 1 when it is in the dictionary of technical terms and a value of 0 when it is not. The total number of words in the user's question.

5. The knowledge base-based large-scale question-answering method according to claim 3, characterized in that, The process of inquiring about propensity indicators satisfies the following relationship: in, This is a propensity indicator for process-related inquiries; Q represents user questions. Let k be a pre-defined set of process keywords. This is a function for calculating semantic similarity.

6. A large-scale question-answering method based on a knowledge base according to claim 2 or 3, characterized in that, The ideal anchor points include: The entity density feature anchor point corresponding to the normalized entity density feature, and the syntactic complexity feature anchor point corresponding to the normalized syntactic complexity feature; The coordinates of the entity density feature anchor point in the query essence space are (1,0); The coordinates of the syntactic complexity feature anchor point in the query essence space are (0, 1).

7. The knowledge base-based large-scale question-answering method according to claim 1, characterized in that, The nonlinear calculation of the dynamic weights of each basic linguistic feature is achieved by using Gaussian radial basis functions to calculate the original weights of each basic linguistic feature based on the Euclidean distance between the query point and the ideal anchor point of each feature. The original weights are then normalized to obtain the dynamic weights. The closer the Euclidean distance, the higher the corresponding original weight.

8. The knowledge base-based large-scale question-answering method according to claim 7, characterized in that, The original weights satisfy the following relation: in, The original weights of basic linguistic feature i, For query point, The ideal anchor point for feature i in basic linguistics The square of the Euclidean distance between the query point and the ideal feature anchor point is given. It is a positive adjustment factor used to control the sensitivity of the weights to distance.

9. The knowledge base-based large-scale question-answering method according to claim 1, characterized in that, The method further includes: Based on the number of searches, retrieve the top K most relevant knowledge fragments from the knowledge base; K knowledge fragments are used as context, and together with the user question, prompt words are constructed and input into a large language model to generate the final answer.

10. A large-scale question-answering system based on a knowledge base, characterized in that, include: A processor and a memory, the memory storing computer program instructions that, when executed by the processor, implement a large model question-answering method based on a knowledge base according to any one of claims 1-9.

Citation Information

Patent Citations

  • Low-altitude intelligent question and answer construction method and system based on dynamic parameters

    CN120632055A

  • Multi-agent collaborative question and answer enhancement method and system based on heterogeneous data knowledge

    CN120705277A

  • Large language model-based silk path knowledge base intelligent question-answering system

    CN120764676A