A knowledge base-based large model question answering method and system

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.

CN120929576BActive Publication Date: 2026-02-06ZHONGNAN INFORMATION TECH (SHENZHEN) CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In existing technologies, fixed-weight models cannot adapt to the differences in complexity among different question types, resulting in inaccurate setting of the K value for the amount of information retrieved, 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, provides appropriate contextual information, and generates high-quality answers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120929576B_ABST
    Figure CN120929576B_ABST
Patent Text Reader

Abstract

The application 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, which comprises the following steps: receiving a user question and extracting a plurality of basic linguistic features; constructing a two-dimensional query essence space and mapping the user question into a query point in the space; in the query essence space, nonlinearly calculating dynamic weights of the basic linguistic features based on geometric distances between the query point and a plurality of preset characteristic ideal anchor points; calculating a dynamic question complexity index according to the dynamic weights and the basic linguistic features, and determining a retrieval quantity of the knowledge base; retrieving knowledge fragments from the knowledge base according to the retrieval quantity, and generating an answer in combination with the user question. The application realizes accurate self-adaptation of a retrieval range by dynamically evaluating a question essence, can provide appropriate context information for a large language model, and thus improves the accuracy and reliability of large model question and answer.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing. More particularly, the present application relates to a knowledge base-based large model question and answer method and system. BACKGROUND

[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 fields has become a research focus in the industry. Retrieval-enhanced generation is the current mainstream technical paradigm. The standard process is as follows: when a user asks a question, the system first finds a set of context knowledge fragments related to the question from the knowledge base through information retrieval technology, then the system concatenates the retrieved knowledge fragments with the user's original question as input and submits it to the large language model, and finally the large language model generates an answer based on the provided context information.

[0003] Currently, how to determine the optimal amount of retrieval information, i.e., the number K of retrieved knowledge fragments, is a crucial technical challenge. If K is set too small, for complex questions, the large model may not be able to form a comprehensive judgment due to insufficient information input, which may lead to a one-sided answer. 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 the large model, but also possibly interfering with the model's attention due to information overload, resulting in logically chaotic answers. Existing technologies often use a fixed weighted summation method to fuse the linguistic features of user questions into a question complexity index, and determine K based on the index.

[0004] However, the weight coefficient used to fuse the features is pre-set and remains unchanged during operation, which cannot adapt to the changing types of problems in the real world. Some technical problems often have their complexity mainly reflected in the density of professional terms, while the complexity of some operational process problems is more reflected in the steps and logical levels of the operational process. Fixed weights cannot capture such differences in problems, leading to incorrect complexity assessment on some types of problems, resulting in too many or too few K values for retrieval, seriously affecting the accuracy and reliability of the question and answer system. SUMMARY

[0005] To solve the technical problem of inaccurate retrieval range caused by the fixed weight model in existing technologies, the present application provides solutions in the following aspects.

[0006] In a first aspect, the present application provides a knowledge base-based large model question answering method, comprising: receiving a user question and extracting a plurality of basic linguistic features of the user question; constructing a two-dimensional query essence space and mapping the user question into a query point in the query essence space; in the query essence space, based on the geometric distance between the query point and a plurality of preset characteristic ideal anchor points, nonlinearly calculating the dynamic weight of each basic linguistic feature; calculating a dynamic question complexity index according to the dynamic weight and the basic linguistic feature, and determining the retrieval number of the knowledge base to realize dynamic optimization of the information retrieval range.

[0007] The present application realizes accurate self-adaptation of the retrieval range by dynamically evaluating the question essence, can provide appropriate context information for the large language model, thereby improving the accuracy and reliability of the large model question answering.

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

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

[0010] Preferably, the query essence space is composed of a technical professional degree axis and a process complexity axis, and mapping the user question into a query point in the query essence space comprises: calculating a technical term tendency index as the coordinate of the query point on the technical professional degree axis according to the proportion of technical terms in the user question; calculating a process inquiry tendency index as the coordinate of the query point on the process complexity axis according to the semantic similarity between the user question and a preset process keyword set.

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

[0012] Preferably, the technical term tendency index satisfies the relationship: ; wherein, is the technical term tendency index, Q is the user question, w is a word in the user question, is a preset technical term dictionary, is an indicator function, which is 1 when w is in the technical term dictionary and 0 when w is not in the technical term dictionary, is the total number of words in the user question.

[0013] Preferably, the process inquiry tendency index satisfies the relationship: ; wherein, is a process query tendency indicator, Q is a user question, is a preset process keyword set, k is a keyword in the process keyword set, is a semantic similarity calculation function.

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

[0015] By setting the ideal anchor point, the importance of different features is defined for the most suitable ideal question type, and a reference is provided for subsequent dynamic calculation of weights based on geometric relationships, so that the weight distribution has a clear physical meaning and direction.

[0016] Preferably, the non-linear calculation of the dynamic weight of each basic linguistic feature is obtained by Gaussian radial basis function, according to the Euclidean distance between the query point and each feature ideal anchor point, to obtain the original weight of each basic linguistic feature, and the original weight is normalized to obtain the dynamic weight, wherein the closer the Euclidean distance, the higher the corresponding original weight.

[0017] Preferably, the original weight satisfies the relationship: ; wherein, is the original weight of the basic linguistic feature i, is the query point, is the feature ideal anchor point corresponding to the basic linguistic feature i, is the square of the Euclidean distance between the query point and the feature ideal anchor point, is a positive adjustment factor for controlling the sensitivity of the weight to the distance.

[0018] The present application can convert the small difference between the query point and the anchor point into significant weight difference, so that the weight distribution can accurately focus on the features most related to the current question essence, avoiding the rigidity and evaluation deviation of the linear model.

[0019] Preferably, the method further comprises: retrieving K knowledge fragments with the highest relevance from the knowledge base according to the retrieval quantity; taking the K knowledge fragments as the context, constructing the prompt word together with the user question, and inputting to the large language model to generate the final answer.

[0020] In a second aspect, the present application provides a knowledge base-based large model question answering system, comprising a processor and a memory, and the memory stores computer program instructions, which, when executed by the processor, implement the above-mentioned knowledge base-based large model question answering method.

[0021] By adopting the above technical solution, the above-mentioned knowledge base-based large model question answering method generates a computer program and is stored in the memory to be loaded and executed by the processor, so as to manufacture a terminal device according to the memory and the processor, and facilitate use.

[0022] The present application can capture the nonlinear interaction between different linguistic features by introducing the query essence space and nonlinear weight adaptive calculation based on geometric relations, and discards simple linear weighting. The final weight distribution is a reflection of the overall image of the problem, rather than a simple superposition of independent contributions of each feature, so that the internal logic of complexity evaluation is more profound and reasonable.

[0023] Further, in the query essence space, small changes in the problem type will be reflected in the smooth movement of the query point, which will in turn trigger smooth nonlinear adjustment of all weights. This makes the weight distribution mechanism less sensitive to subtle changes in the user's questioning method, and the evaluation result is more stable and robust, avoiding the dramatic fluctuation of weights caused by the mutation of a single feature value in the linear model, thereby greatly enhancing the adaptive ability and robustness of the model. BRIEF DESCRIPTION OF DRAWINGS

[0024] The above and other objects, features and advantages of the exemplary embodiments of the present application will be more apparent from the following detailed description taken in conjunction with the accompanying drawings, in which:

[0025] Figure 1 is a flowchart schematically showing a knowledge base-based large model question answering method in the present application;

[0026] Figure 2 is an effect diagram schematically showing a process flow for a technology-intensive problem in an embodiment of the present application;

[0027] Figure 3 is an effect diagram schematically showing a process flow for a process-intensive problem in an embodiment of the present application. DETAILED DESCRIPTION

[0028] With reference to the drawings of the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of the present application.

[0029] The specific implementation of the present application will be described in detail below with reference to the drawings.

[0030] The embodiments of the present application disclose a knowledge base-based large model question answering method, referring to Figure 1 , comprising steps S1-S4:

[0031] S1, receiving a user question, and extracting a plurality of basic linguistic features of the user question.

[0032] In an optional embodiment, when the system receives a user input question Q, it first performs a series of standardized natural language processing preprocessing operations, including word segmentation, part-of-speech tagging, and removing stop words, to obtain structured text information. Subsequently, the system extracts a plurality of basic linguistic features for evaluating the inherent properties of the question text from multiple dimensions.

[0033] 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, which is calculated by the total number of words after preprocessing, and then linearly normalized according to the preset empirical range to map the value to the [0, 1] interval. For example, the empirical range is 5 for the minimum length and 50 for the maximum length.

[0034] The normalized entity density feature is used to evaluate the degree of professional knowledge concentration in the question. The system first uses named entity recognition technology to identify and count the number of entities such as professional terms and proper nouns in the question by comparing with a highly relevant technical term dictionary in the knowledge base field, and then divides the entity number by the total number of words in the question to obtain the entity density.

[0035] The normalized syntactic complexity feature is used to measure the language structure complexity of the question. Through a syntactic analysis tool, for example, a dependency syntactic analysis, a syntactic tree of the question 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 combined into a comprehensive syntactic score by weighting, and are also normalized to obtain.

[0036] Thus, by multi-dimensional feature extraction and standardization processing of user problems, comprehensive and standardized input data are provided for subsequent construction of an accurate adaptive complexity evaluation model, ensuring the reliability and consistency of subsequent calculations.

[0037] S2, a two-dimensional query essence space is constructed, and the user problem is mapped into a query point in the query essence space.

[0038] In an optional embodiment, a two-dimensional Cartesian coordinate space can be defined as a query essence space, which is composed of two mutually orthogonal dimensions: the X-axis represents the technical professional degree, and the actual value range is [0, 1], the higher the axis value, the higher the problem knowledge intensive degree; the Y-axis represents the process complexity, and the actual value range is [0, 1], the higher the axis value, the stronger the problem operation guidance.

[0039] In this optional embodiment, in order to map any problem Q into the query essence space, two query domain identification indicators can be calculated as the (x, y) coordinates of the problem Q in the space, including the technical term tendency indicator Itech as the abscissa and the process inquiry tendency indicator Iproc as the ordinate.

[0040] Specifically, the technical term tendency indicator satisfies the relationship:

[0041]

[0042] Wherein, Q is the user problem, w is a word in the user problem, is a preset technical term dictionary, is an indicator function, which is 1 when w is in the technical term dictionary, and 0 when it is not, is the total number of words in the user problem.

[0043] The process inquiry tendency indicator satisfies the relationship:

[0044]

[0045] Wherein, is a preset process keyword set, for example, {"how", "how", "step",...}; k is a keyword in the process keyword set, is a semantic similarity calculation function, for example, a cosine similarity function based on word vectors can be used.

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

[0047] Thus, by mapping the abstract problem attributes to the concretized coordinate space, the intrinsic nature of the problem can be accurately mathematically described, providing a basis for subsequent dynamic weight calculation based on geometric relationships.

[0048] S3、In the query essence space, based on the geometric distance between the query point and the preset plurality of characteristic ideal anchor points, the dynamic weight of each basic linguistic feature is calculated non-linearly.

[0049] In an optional embodiment, in the query essence space, based on the geometric distance between the query point and the preset plurality of characteristic ideal anchor points, the dynamic weight of each basic linguistic feature is calculated non-linearly.

[0050] Specifically, the entity density feature anchor point represents a pure technical knowledge exploration question, which has the highest technical professional degree and the lowest process complexity, so its anchor point is set at AE=(1, 0); the syntactic complexity feature anchor point represents a pure operation process inquiry question, which has the highest process complexity and the lowest technical professional degree, so its anchor point is set at AS=(0, 1).

[0051] Further, non-linear dynamic weight calculation can be performed based on spatial distance, and the maximum weight of a feature depends on the geometric proximity of the current query point to the characteristic ideal anchor point. A Gaussian radial basis function (RBF) is used for non-linear modeling, and the original weight satisfies the relationship:

[0052]

[0053] wherein, is the original weight of the basic linguistic feature i, is the query point, is the characteristic ideal anchor point corresponding to the basic linguistic feature i, is the square of the Euclidean distance between the query point and the characteristic ideal anchor point, is a positive adjustment factor for controlling the sensitivity of the weight to the distance, and an exemplary value is 2; for the length feature, a fixed basic influence value is assigned , and an exemplary value is 0.25; finally, the three original weights are normalized to obtain the final dynamic weight .

[0054] For example, for a technology-intensive problem, assuming that the technology-intensive problem Q1 has a query point coordinate of =(0.27, 0.00), the distance square of the query point to each anchor point is calculated as ; ; the original weights are respectively ; ; ; the sum of the maximum weights is 0.711, so the dynamic weights after final normalization are 0.35, 0.49 and 0.16 respectively.

[0055] For example, for the flow-intensive problem Q2, the designed query point coordinates are (0.14, 1.00), and the square of the distance from the query point to each anchor point is calculated as ; ; the original weights are 0.14, 0.49 and 0.15 respectively. ; ; ; the sum of the maximum weights is 1.243, so the dynamic weights after final normalization are 0.20, 0.03 and 0.77 respectively.

[0056] In this way, the geometric relationship between the problem point and the ideal anchor point is converted into the allocation ratio of the weight by the nonlinear function, which can match the most suitable combination of feature importance for different nature problems, and realize the dynamic self-adaptation of the weight.

[0057] S4, calculate the dynamic problem complexity index according to the dynamic weight and the basic linguistic feature, and determine the number of knowledge base retrieval to realize the dynamic optimization of information retrieval range.

[0058] In an optional embodiment, after obtaining the dynamic weight for the current problem, the obtained basic linguistic features are weighted to calculate the final dynamic problem complexity index, which satisfies the relationship:

[0059]

[0060] Further, through a preset linear mapping function, it is converted into the number of knowledge fragments K that need to be finally retrieved:

[0061]

[0062] wherein, and are the minimum and maximum retrieval numbers allowed by the system, for example, , and round() is the rounding function.

[0063] For example, suppose the user problem Q1 received is: "Please explain in detail the relationship between quantum entanglement and EPR paradox in microservice architecture", and the extracted basic linguistic feature values are: FL = 0.047, FE = 0.35, FS = 0.15, since the dynamic weight​​​​ 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.

[0064] 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.

[0065] 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.

[0066] 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.

[0067] The system also comprises other components well known to those skilled in the art such as a communication bus and a communication interface, the arrangement and function of which are known in the art and will therefore not be described in more detail here.

[0068] In the description of the present specification, the meaning of "a plurality of" or "several" is at least two, for example, two, three or more, and the like, unless explicitly specifically defined otherwise.

[0069] While the present specification has shown and described a number of embodiments of the application, it is to be understood that such embodiments are merely illustrative of the many possible embodiments thereof. Numerous modifications, adaptations, and variations will be apparent to those skilled in the art in view of the foregoing description. It is to be understood that, in the course of practicing the present application, embodiments of the application described herein can be adopted to employ each of the alternatives, modifications and variations.

Claims

1. A knowledge base-based large model question and answer method, characterized in that, The method comprises: receiving a user question and extracting a plurality of basic linguistic features of the user question; constructing a two-dimensional query essence space composed of a technical expertise axis and a process complexity axis; mapping the user question into a query point in the query essence space, comprising: calculating a technical term tendency index as the coordinate of the query point on the technical expertise axis according to the proportion of technical terms in the user question, satisfying the relationship: wherein, is a technical term tendency indicator, Q is a user question, w is a word in the user question, is a pre-defined technical term dictionary, is an indicator function, which takes the value 1 if w is in the technical term dictionary and 0 otherwise, is the total number of words in the user question; calculating a process inquiry tendency index as the coordinate of the query point on the process complexity axis according to the semantic similarity between the user question and a preset process keyword set, satisfying the relationship: wherein, is a process inquiry tendency indicator, Q is a user question, is a pre-set process keyword set, k is a keyword in the process keyword set, is a semantic similarity calculation function; in the query essence space, nonlinearly calculating the dynamic weight of each basic linguistic feature based on the geometric distance between the query point and a plurality of preset characteristic ideal anchor points; calculating a dynamic question complexity index according to the dynamic weight and the basic linguistic features, and determining the retrieval number of the knowledge base to achieve dynamic optimization of the information retrieval range.

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

3. The knowledge base-based large model question answering method according to claim 2, characterized in that, The characteristic ideal anchor points include: entity density feature anchor points corresponding to the normalized entity density feature, and syntax complexity feature anchor points corresponding to the normalized syntax complexity feature; The coordinates of the entity density feature anchor points in the query essence space are (1, 0); The coordinates of the syntax complexity feature anchor points in the query essence space are (0, 1).

4. The knowledge base-based large model question answering method according to claim 1, characterized in that, The nonlinear calculation of the dynamic weight of each basic linguistic feature is obtained by Gaussian radial basis function, the original weight of each basic linguistic feature is calculated according to the Euclidean distance between the query point and each characteristic ideal anchor point, and the original weight of each basic linguistic feature is normalized to obtain the dynamic weight, wherein the closer the Euclidean distance, the higher the corresponding original weight.

5. The knowledge base-based large model question answering method according to claim 4, characterized in that, The original weight satisfies the relationship: wherein, is the original weight of the base linguistic feature i, is the query point, is the feature ideal anchor point corresponding to the base linguistic feature i, is the square of the Euclidean distance between the query point and the feature ideal anchor point, is a positive adjustment factor for controlling the sensitivity of the weight to the distance.

6. The knowledge base-based large model question answering method according to claim 1, characterized in that, The method further comprises: retrieving the top K relevant knowledge fragments from the knowledge base according to the retrieval number; taking the K knowledge fragments as the context, constructing prompt words with the user question, and inputting them into a large language model to generate a final answer.

7. A knowledge base based large model question answering system, characterized in that, The method comprises: a processor and a memory, the memory storing computer program instructions, when the computer program instructions are executed by the processor, realizing a large model question and answer method based on a knowledge base according to any one of claims 1-6.

Citation Information

Patent Citations

  • 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