An intelligent question and answer method and system for an artificial intelligence large model
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-19
- Publication Date
- 2026-08-11
AI Technical Summary
[0004]第一,现有技术在问题理解阶段缺乏深度语义分析,难以准确把握复杂问题的真实意图,特别是当用户提出含有多层语义、隐含条件的复杂问题时,系统往往无法全面理解问题的各个方面,导致检索到的知识片段与问题实际需求不匹配,影响答案质量;
[0063]1、本发明通过多层次的问题预处理机制,包括分词处理、句法分析和语义理解,能够深入理解问题的完整语义和真实意图,准确提取问题关键词和问题类型,为后续的知识检索和答案生成奠定良好基础,有效解决了现有技术中问题理解不准确的技术问题。
Smart Images

Figure CN121808007B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of natural language processing technology, specifically to an intelligent question-answering method and system for large-scale artificial intelligence models. Background Technology
[0002] With the rapid development of artificial intelligence technology, large-scale pre-trained language models have made significant progress in the field of natural language processing. These large models have powerful language understanding and generation capabilities and are widely used in intelligent question answering systems. Intelligent question answering systems aim to understand the natural language questions raised by users, retrieve relevant information from the knowledge base, and generate accurate and complete answers.
[0003] Existing intelligent question-answering systems mainly suffer from the following technical problems:
[0004] First, existing technologies lack in-depth semantic analysis during the problem understanding stage, making it difficult to accurately grasp the true intent of complex problems. In particular, when users raise complex problems with multiple semantic layers and implicit conditions, the system often fails to fully understand all aspects of the problem, resulting in a mismatch between the retrieved knowledge fragments and the actual needs of the problem, which affects the quality of the answer.
[0005] Second, existing technologies mainly rely on a single similarity measurement method in the knowledge retrieval process, failing to comprehensively consider multiple dimensions such as semantic similarity, keyword matching degree, and position ranking. This single retrieval strategy is prone to resulting in inaccurate retrieval results, which may miss important relevant knowledge and reduce the accuracy and completeness of the answers.
[0006] Third, existing technologies lack effective quality assessment and optimization mechanisms after answer generation. The initial answers generated by large models may have problems such as missing information, redundant expression, and unclear logic. However, existing systems often directly output the initial answers without conducting multi-dimensional assessment and targeted optimization of the answer quality, which affects the user experience.
[0007] Fourth, existing technologies lack effective context management mechanisms when dealing with multi-turn dialogue scenarios. In practical applications, users often need to engage in multiple rounds of interaction, and subsequent questions often depend on the content of previous dialogues. However, existing systems struggle to accurately understand the relationships between questions and cannot achieve coherent and natural multi-turn dialogues.
[0008] Therefore, an improved intelligent question-answering method and system is needed to solve the above-mentioned technical problems. Summary of the Invention
[0009] The purpose of this invention is to provide an intelligent question-answering method and system for large-scale artificial intelligence models.
[0010] An intelligent question-answering method for large-scale artificial intelligence models includes the following steps:
[0011] Receive the question text input by the user, preprocess the question text, and extract question keywords and question type;
[0012] A query vector is constructed based on the keywords of the question, relevant knowledge fragments are retrieved in the knowledge base, and a set of candidate knowledge fragments is obtained based on similarity calculation.
[0013] Each knowledge fragment in the candidate knowledge fragment set is scored for relevance, and knowledge fragments with relevance scores exceeding a preset threshold are selected as reference knowledge.
[0014] Input the question text and the reference knowledge into the large model to generate the initial answer text;
[0015] The initial answer text is evaluated for quality, and the answer is optimized and adjusted based on the evaluation results to output the final answer;
[0016] The relevance score is calculated in the following way:
[0017] ;
[0018] in, Indicates the relevance score. Indicates semantic similarity score, This indicates the keyword matching score. This indicates the score based on positional ranking.
[0019] Furthermore, the preprocessing of the question text input by the user includes:
[0020] The question text is segmented to identify entity words and keywords in the question;
[0021] Perform syntactic analysis on the question text to determine the grammatical structure and question type of the question;
[0022] Semantic understanding is performed on the question text to extract the core intent and constraints of the question.
[0023] Furthermore, the process of constructing the query vector in the question keyword query vector construction includes:
[0024] The question text is encoded using a pre-trained language model to generate a fixed-dimensional vector representation;
[0025] The vector representation is normalized to obtain the query vector;
[0026] The query vector is used to perform an approximate nearest neighbor search in the vector index of the knowledge base to retrieve the top N knowledge fragments with the highest similarity, where N is an integer value between 50 and 200.
[0027] Furthermore, the quality assessment of the initial answer text includes the following dimensions:
[0028] Answer completeness assessment: Determines whether the answer fully addresses all aspects of the question;
[0029] Answer accuracy assessment: Verify the consistency between the answer content and the reference knowledge;
[0030] Answer fluency assessment: Evaluates the quality of language expression in the answer text;
[0031] Answer relevance assessment: Assess the degree of direct relevance between the answer and the question.
[0032] Furthermore, intelligent question-answering methods also include multi-turn dialogue management steps:
[0033] Record the questions and answers from each round of historical dialogue to construct the dialogue context;
[0034] When a new question text is received, the complete semantics of the current question are understood by combining the dialogue context.
[0035] Identify the referential relationships in the problem and replace the pronouns with specific entities;
[0036] Adjust the answer generation strategy based on the dialogue context.
[0037] This invention also provides an intelligent question-answering system for large-scale artificial intelligence models, comprising:
[0038] The problem processing module is used to receive the problem text input by the user, preprocess the problem text, and extract problem keywords and problem type;
[0039] The knowledge retrieval module is used to construct a query vector based on the question keywords, retrieve relevant knowledge fragments in the knowledge base, and obtain a set of candidate knowledge fragments based on similarity calculation.
[0040] The knowledge scoring module is used to score the relevance of each knowledge fragment in the candidate knowledge fragment set and select knowledge fragments with a relevance score exceeding a preset threshold as reference knowledge.
[0041] The answer generation module is used to input the question text and the reference knowledge into the large model to generate the initial answer text;
[0042] The answer optimization module is used to evaluate the quality of the initial answer text, optimize and adjust the answer based on the evaluation results, and output the final answer.
[0043] The knowledge scoring module calculates scores based on relevance.
[0044] Furthermore, the problem handling module includes:
[0045] The word segmentation unit is used to segment the question text into words and identify entity words and keywords in the question;
[0046] The syntactic analysis unit is used to perform syntactic analysis on the question text to determine the grammatical structure and question type of the question.
[0047] The semantic understanding unit is used to perform semantic understanding on the question text and extract the core intent and constraints of the question.
[0048] Furthermore, the knowledge retrieval module includes:
[0049] A vector encoding unit is used to encode the question text using a pre-trained language model to generate a fixed-dimensional vector representation;
[0050] A vector processing unit is used to normalize the vector representation to obtain the query vector.
[0051] The retrieval unit is used to perform an approximate nearest neighbor search in the vector index of the knowledge base using the query vector, and retrieve the top N knowledge fragments with the highest similarity, where N is an integer value between 50 and 200.
[0052] Furthermore, the answer optimization module includes:
[0053] The completeness assessment unit is used to determine whether the answer fully addresses all aspects of the question.
[0054] Accuracy assessment unit, used to verify the consistency between the answer content and the reference knowledge;
[0055] The fluency assessment unit is used to evaluate the quality of language expression in the answer text.
[0056] The relevance assessment unit is used to evaluate the direct relevance of the answer to the question.
[0057] Furthermore, the intelligent question-answering system also includes a dialogue management module, used for:
[0058] Record the questions and answers from each round of historical dialogue to construct the dialogue context;
[0059] When a new question text is received, the complete semantics of the current question are understood by combining the dialogue context.
[0060] Identify the referential relationships in the problem and replace the pronouns with specific entities;
[0061] Adjust the answer generation strategy based on the dialogue context.
[0062] Compared with the prior art, the beneficial effects of the present invention by adopting the above technical solution are as follows:
[0063] 1. This invention employs a multi-layered question preprocessing mechanism, including word segmentation, syntactic analysis, and semantic understanding, to deeply understand the complete semantics and true intent of a question, accurately extract question keywords and question types, lay a solid foundation for subsequent knowledge retrieval and answer generation, and effectively solve the technical problem of inaccurate question understanding in existing technologies.
[0064] 2. This invention employs a comprehensive scoring mechanism for knowledge retrieval and evaluation, combining three dimensions—semantic similarity, keyword matching, and position ranking—with a weighted combination. Semantic similarity has a weight of 0.4, keyword matching has a weight of 0.3, and position ranking has a weight of 0.3. This multi-dimensional comprehensive evaluation method can more accurately filter out knowledge fragments that are truly relevant to the question, improve the quality of retrieval results, and solve the technical problem of inaccurate knowledge retrieval in existing technologies.
[0065] 3. This invention designs a complete answer quality assessment system, which comprehensively evaluates the generated answers from four dimensions: completeness, accuracy, fluency, and relevance. Based on the assessment results, the answers are optimized in a targeted manner to ensure that the output answers are of high quality, effectively solving the technical problem of insufficient answer quality assessment in the prior art.
[0066] 4. This invention establishes a comprehensive multi-turn dialogue management mechanism, which can record and analyze the historical dialogue context, understand the relationship between questions, correctly handle the referential relationship, and realize coherent and natural multi-turn interaction, thus solving the technical problem of the lack of multi-turn dialogue management in the prior art. Attached Figure Description
[0067] Figure 1 This is a schematic diagram of the overall process of the intelligent question-answering method of the present invention;
[0068] Figure 2 This is a detailed flowchart illustrating the preprocessing steps for the problems in this invention.
[0069] Figure 3 This is a schematic diagram of the knowledge retrieval and scoring process of this invention;
[0070] Figure 4 This is a schematic diagram of the process for generating and optimizing the answer in this invention;
[0071] Figure 5This is a schematic diagram of the intelligent question-answering system of the present invention;
[0072] Figure 6 This is a flowchart illustrating the multi-turn dialogue management process of the present invention. Detailed Implementation
[0073] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments.
[0074] Example 1
[0075] like Figure 1 As shown, this embodiment provides an intelligent question-answering method for large-scale artificial intelligence models, including the following steps:
[0076] Receive the question text input by the user, preprocess the question text, and extract question keywords and question type.
[0077] Specifically, users input question text in natural language form through the client. After receiving the question text, the system performs preprocessing. Preprocessing is a key step in understanding the semantics of the question and directly affects the quality of subsequent knowledge retrieval and answer generation.
[0078] like Figure 2 As shown, the preprocessing of the question text input by the user includes:
[0079] The question text is segmented to identify entity words and keywords.
[0080] The word segmentation process employs a deep learning-based word segmentation model to divide the question text into independent word units. During the word segmentation process, the system pays special attention to identifying named entities (such as personal names, place names, and organization names) and professional terms. These entity words and keywords are important clues for understanding the core content of the question.
[0081] For example, for the question "What are the applications of artificial intelligence in medical diagnosis?", the word segmentation identified keywords including "artificial intelligence", "medical diagnosis", and "applications".
[0082] Perform syntactic analysis on the question text to determine the grammatical structure and question type of the question.
[0083] Syntactic analysis constructs a syntactic tree to parse the grammatical structure of the question, including subject-verb-object relations, modification relations, and coordinate relations. At the same time, the system identifies the question type. Common question types include: factual questions (asking for specific facts), definitional questions (asking for the definition of a concept), methodological questions (asking for solutions), cause-related questions (asking for explanations of causes), and comparison questions (asking for comparisons between things).
[0084] Question type identification is achieved by analyzing question words (such as "what", "which", "how", "why") and sentence structure. In the example question above, the question word "which" combined with the question structure is determined to be an enumeration question, and the expected answer is to list multiple application scenarios.
[0085] Perform semantic understanding on the question text to extract the core intent and constraints of the question.
[0086] Semantic understanding is a deeper level of processing based on syntactic analysis. Its purpose is to extract the core intent and implicit constraints of the question. The core intent is the information that the question really wants to obtain, while the constraints are restrictions on the scope and form of the answer.
[0087] For example, the core intent of the above question is to obtain "specific application cases of artificial intelligence technology in the field of medical diagnosis", with constraints including: the field is limited to "medical diagnosis", and the answer format is "application list".
[0088] A query vector is constructed based on the question keywords, relevant knowledge fragments are retrieved from the knowledge base, and a set of candidate knowledge fragments is obtained based on similarity calculation.
[0089] like Figure 3 As shown, the process of constructing a query vector in the question keyword query vector construction includes:
[0090] The problem text is encoded using a pre-trained language model to generate a fixed-dimensional vector representation. In this embodiment, the pre-trained language model used is the BERT model, which has been pre-trained on a large-scale text corpus and has powerful semantic representation capabilities.
[0091] Specifically, the question text is input into the BERT model, and the vector representation of the question is obtained through the model's encoding layer. This vector representation is a 768-dimensional real number vector, and the value of each dimension reflects the characteristics of the question in the semantic space.
[0092] The vector representation is normalized to obtain the query vector. The normalization process uses the L2 norm normalization method, and the calculation formula is as follows:
[0093] ;
[0094] in, Represents the original vector. This represents the normalized query vector. Representing vectors The L2 norm is calculated as the square root of the sum of the squares of the vector's components.
[0095] The query vector is used to perform an approximate nearest neighbor search in the vector index of the knowledge base to retrieve the top N knowledge fragments with the highest similarity, where N is an integer value between 50 and 200, and in this embodiment, N is 100.
[0096] The knowledge base pre-vectorizes all knowledge fragments and establishes a vector index. The vector index is constructed using the HNSW (Hierarchical Navigable Small World) algorithm, which can efficiently perform approximate nearest neighbor search.
[0097] Approximate nearest neighbor search is achieved by calculating the cosine similarity between the query vector and the knowledge fragment vectors in the knowledge base. The formula for calculating the cosine similarity is:
[0098] ;
[0099] in, This represents the cosine similarity, with a value ranging from -1 to 1.
[0100] Represents the query vector;
[0101] Represents a knowledge fragment vector;
[0102] Represents the dot product of two vectors;
[0103] and These represent the magnitudes of the two vectors, respectively.
[0104] Since both the query vector and the knowledge fragment vector have been normalized and have a magnitude of 1, the cosine similarity is simplified to the dot product of the two vectors. The system retrieves the top 100 knowledge fragments with the highest cosine similarity values, forming a candidate knowledge fragment set.
[0105] Each knowledge fragment in the candidate knowledge fragment set is scored for relevance, and knowledge fragments with relevance scores exceeding a preset threshold are selected as reference knowledge.
[0106] The relevance score is calculated as follows:
[0107] ;
[0108] in, This represents the relevance score, with a value ranging from 0 to 1;
[0109] The semantic similarity score, ranging from 0 to 1, is obtained by calculating the cosine similarity between the query vector and the knowledge fragment vector. Specifically, the cosine similarity value calculated from the query vector constructed from the question keywords is normalized, mapping the value range from -1 to 1 to 0 to 1. The mapping formula is as follows:
[0110] ;
[0111] This represents the keyword matching score, ranging from 0 to 1, and is obtained by calculating the overlap ratio between the question keywords and the knowledge fragment keywords. The specific calculation method is as follows:
[0112] Extract the set of keywords from the question text, denoted as . ;
[0113] Extract the set of keywords from the knowledge fragment, denoted as ;
[0114] Calculate the ratio of the intersection size of two keyword sets to the size of the question keyword set:
[0115] ;
[0116] in, This indicates the number of elements in the intersection of two keyword sets. This indicates the number of elements in the set of question keywords.
[0117] The ranking score, ranging from 0 to 1, is calculated by normalizing the ranking of the knowledge fragment in the search results. The ranking score reflects the relative importance of the knowledge fragment in the initial search; knowledge fragments ranked higher are considered more relevant. The calculation formula is:
[0118] ;
[0119] in, This indicates the ranking position of the knowledge fragment in the search results, with a value ranging from 1 to N;
[0120] N is the total number of candidate knowledge fragments, and in this embodiment, N is 100.
[0121] After calculating the relevance score of each knowledge segment, the system sets a preset threshold of 0.6 and selects knowledge segments with a relevance score of more than 0.6 as reference knowledge. Typically, 5 to 15 reference knowledge segments will be selected.
[0122] Input the question text and reference knowledge into the large model to generate the initial answer text.
[0123] like Figure 4 As shown, the large model adopts a generative language model based on the GPT architecture. This model has powerful natural language generation capabilities. During the answer generation process, the system organizes the question text and reference knowledge into an input prompt according to a specific format.
[0124] The input prompt should be organized in the following format:
[0125] First, the question text is given: "Question: [User Question]";
[0126] Then, the reference knowledge is listed as follows: "Reference knowledge: [Knowledge fragment 1] [Knowledge fragment 2] ... [Knowledge fragment n]";
[0127] Finally, add the following command: "Please answer the questions in detail based on the above reference information."
[0128] After receiving input prompts, the large model generates answer words one by one through autoregression until an end marker is generated. During the generation process, the model comprehensively considers the semantics of the question, the content of reference knowledge, and its own learned language knowledge to generate coherent and accurate answer text.
[0129] The initial answer text is evaluated for quality. Based on the evaluation results, the answer is optimized and adjusted, and the final answer is output.
[0130] The quality assessment of the initial answer text includes the following dimensions:
[0131] Answer completeness assessment: This determines whether the answer fully addresses all aspects of the question. Completeness assessment is achieved by checking whether the answer covers all sub-questions and constraints raised in the question. For example, if the question asks "What are the applications of artificial intelligence in medical diagnosis?", the answer should list multiple specific application scenarios rather than just describing one scenario.
[0132] Answer accuracy assessment: Verify the consistency between the answer content and the reference knowledge. Accuracy assessment is conducted by comparing the key facts in the answer with the corresponding content in the reference knowledge to check for factual errors, data errors, and logical errors.
[0133] Answer fluency assessment: This assesses the quality of language expression in the answer text. Fluency assessment checks whether the sentence structure of the answer is complete, whether the grammar is correct, whether the expression is fluent, and whether there is any repetitive or redundant content.
[0134] Answer relevance assessment: This assesses the direct relevance of the answer to the question. The relevance assessment checks whether the answer content is closely related to the question topic and whether it contains irrelevant information.
[0135] For each evaluation dimension, the system uses a scoring standard of 0 to 1. When the score of a certain dimension is lower than 0.7, the system determines that there is a problem with that dimension and it needs to be optimized and adjusted.
[0136] The specific methods of optimization and adjustment include:
[0137] If the completeness score is too low, the system analyzes the aspects that the answer is missing, extracts supplementary information from the reference knowledge, and regenerates an answer that includes the missing content.
[0138] If the accuracy score is too low, the system will identify the incorrect factual statement and replace the incorrect content with the correct information from the reference knowledge.
[0139] If the fluency score is too low, the system will reorganize and simplify the answer text, remove redundant expressions, and improve sentence structure.
[0140] If the relevance score is too low, the system will delete irrelevant content from the answer and retain the core information that is directly related to the question.
[0141] After optimization and adjustment, the system will evaluate the quality of the answer again. If the score of all dimensions reaches 0.7 or above, the answer will be output as the final answer.
[0142] If any dimension still has a low score, a second round of optimization and adjustment will be carried out, with a maximum of three rounds of optimization.
[0143] This embodiment also includes multi-turn dialogue management steps, such as... Figure 6 As shown:
[0144] Record the questions and answers of historical dialogue rounds, construct the dialogue context, and maintain a dialogue history list. Whenever a user asks a new question and receives an answer, the question and answer of that round are added to the history list. The dialogue context includes the dialogue content of the most recent 3 to 5 rounds.
[0145] When a new question text is received, the system understands the complete semantics of the current question by combining the dialogue context. If the content of the current question is relatively short or ambiguous, the system infers the complete intent of the question by analyzing the dialogue context. For example, if the previous question was "What are the applications of artificial intelligence in medical diagnosis?", and the current question is "What are its advantages?", the system understands from the context that "it" refers to "the application of artificial intelligence in medical diagnosis".
[0146] The system identifies referential relationships in questions and replaces referential words with specific entities. It identifies referential words in questions (such as "it", "this", "those"), determines the referent by analyzing entities in the dialogue history, and replaces the referential words with specific entities. The replaced questions are clearer and more explicit, which is beneficial for subsequent knowledge retrieval and answer generation.
[0147] The system adjusts the answer generation strategy based on the dialogue context. When generating answers, the system inputs the dialogue context information, the current question, and reference knowledge into the large model, so that the model can generate answers that are coherent and logically consistent with the context. For example, if a user keeps asking about a certain topic in multiple rounds of dialogue, the answer should remain focused on that topic and avoid repeating content that has already been answered.
[0148] Example 2
[0149] like Figure 5 As shown, this embodiment provides an intelligent question-answering system for large-scale artificial intelligence models, including:
[0150] The problem handling module is used to receive the problem text input by the user, preprocess the problem text, and extract problem keywords and problem type.
[0151] The problem handling module specifically includes:
[0152] The word segmentation unit is used to segment the question text, identify entity words and keywords in the question, and integrates a deep learning-based word segmentation model, which can accurately segment the question text and identify named entities and technical terms.
[0153] The syntactic analysis unit is used to perform syntactic analysis on the question text to determine the grammatical structure and question type of the question. The syntactic analysis unit uses dependency parsing technology to construct the syntactic dependency tree of the question and identify the grammatical relationships between words and the question type.
[0154] The semantic understanding unit is used to perform semantic understanding on the question text, extract the core intent and constraints of the question, and comprehensively utilize syntactic information, lexical semantic information and contextual information to deeply understand the true intent of the question.
[0155] The knowledge retrieval module is used to construct query vectors based on question keywords, retrieve relevant knowledge fragments from the knowledge base, and obtain a set of candidate knowledge fragments based on similarity calculations.
[0156] The knowledge retrieval module specifically includes:
[0157] The Vector Encoding Unit (VEN) is used to encode the question text using a pre-trained language model, generating a fixed-dimensional vector representation. The VEN integrates the BERT pre-trained model, converting the question text into a 768-dimensional vector representation.
[0158] The vector processing unit is used to normalize the vector representation to obtain the query vector. The vector processing unit uses the L2 norm normalization method to ensure that the magnitude of the vector is 1.
[0159] The retrieval unit is used to perform an approximate nearest neighbor search in the vector index of the knowledge base using the query vector, and retrieve the top N knowledge fragments with the highest similarity, where N is an integer value between 50 and 200. The retrieval unit uses the HNSW algorithm for efficient vector retrieval, and in this embodiment, N is set to 100.
[0160] The knowledge scoring module is used to score the relevance of each knowledge fragment in the candidate knowledge fragment set and select knowledge fragments with a relevance score exceeding a preset threshold as reference knowledge.
[0161] The relevance score in the knowledge scoring module is calculated in the following way:
[0162] ;
[0163] in, This represents the relevance score, with a value ranging from 0 to 1;
[0164] This represents the semantic similarity score, with a value ranging from 0 to 1;
[0165] This represents the keyword matching score, with a value ranging from 0 to 1.
[0166] This represents the positional sort score, with a value ranging from 0 to 1.
[0167] After calculating the relevance score of each knowledge segment, the knowledge segment with a score exceeding a preset threshold (0.6 in this embodiment) is selected as reference knowledge.
[0168] The answer generation module is used to input the question text and reference knowledge into the large model and generate the initial answer text.
[0169] The answer generation module integrates a generative language model based on the GPT architecture. This model has been pre-trained and fine-tuned on a large-scale text corpus and has powerful natural language generation capabilities. The answer generation module organizes the question text and reference knowledge into input prompts, which are then input into the large model to generate the answer.
[0170] The answer optimization module is used to evaluate the quality of the initial answer text, optimize and adjust the answer based on the evaluation results, and output the final answer.
[0171] The answer optimization module specifically includes:
[0172] The completeness assessment unit is used to determine whether the answer fully addresses all aspects of the question. The completeness assessment unit provides a completeness score by analyzing the coverage of the answer content with the requirements of the question.
[0173] The accuracy assessment unit is used to verify the consistency between the answer content and the reference knowledge. The accuracy assessment unit checks the accuracy of facts by comparing the key facts in the answer and the reference knowledge, and gives an accuracy score.
[0174] The fluency assessment unit is used to evaluate the language quality of the answer text. The fluency assessment unit gives a fluency score by analyzing the sentence structure, grammatical correctness, and expressive fluency of the answer.
[0175] The relevance assessment unit is used to evaluate the direct relevance of the answer to the question. The relevance assessment unit gives a relevance score by checking whether the content of the answer is closely related to the topic of the question.
[0176] The answer optimization module optimizes the dimensions with low scores based on the scoring results of each assessment unit, including supplementing missing content, correcting errors, improving language expression, and deleting irrelevant content.
[0177] The dialogue management module is used for:
[0178] The system records questions and answers from historical dialogue rounds, constructs dialogue contexts, and maintains a dialogue history database to store information from the most recent dialogue rounds.
[0179] When a new question text is received, the dialogue management module analyzes the relationship between the current question and historical dialogues to infer the complete intent of the question by combining the dialogue context to understand the complete semantics of the current question.
[0180] The dialogue management module identifies referential relationships in the question and replaces referential words with specific entities through referential resolution technology. It also locates the referential objects from the dialogue history and completes the referential replacement.
[0181] The answer generation strategy is adjusted based on the dialogue context. The dialogue management module passes the dialogue context information to the answer generation module to ensure that the generated answer is consistent with the context.
[0182] The intelligent question-answering system in this embodiment achieves high-quality intelligent question-answering function through the collaborative work of various modules, and the question processing module accurately understands the semantics of the question;
[0183] The knowledge retrieval module accurately retrieves relevant knowledge;
[0184] The knowledge scoring module comprehensively evaluates the relevance of knowledge.
[0185] The answer generation module generates accurate and complete answers;
[0186] The answer optimization module ensures answer quality;
[0187] The dialogue management module supports multi-turn coherent dialogues.
[0188] Example 3
[0189] This embodiment further illustrates the technical solution in Embodiment 1, focusing on a specific application scenario.
[0190] A medical consultation platform uses the intelligent question-and-answer system of this invention to provide users with medical and health consultation services. The system's knowledge base contains a large amount of professional medical and health-related knowledge, including disease information, treatment methods, drug instructions, and health guidance.
[0191] The user's first question was: "What is high blood pressure?"
[0192] After the system receives the problem, the problem handling module performs preprocessing:
[0193] The word segmentation unit divides the question into three words: "what", "is", and "hypertension", and identifies the keyword "hypertension".
[0194] The syntactic analysis unit analyzes the question structure, identifies the interrogative word "what," and determines the question type to be a definition-type question.
[0195] The semantic understanding unit extracts the core intent: to obtain the definition and explanation of "hypertension".
[0196] The knowledge retrieval module constructs a query vector and retrieves knowledge fragments related to "hypertension" from the medical knowledge base, resulting in 100 candidate knowledge fragments.
[0197] The knowledge scoring module scores the relevance of candidate knowledge fragments. For example, a knowledge fragment that reads "Hypertension is a chronic disease in which blood pressure remains at a high level, usually defined as systolic blood pressure greater than 140 mmHg or diastolic blood pressure greater than 90 mmHg" has a high semantic similarity to the question, completely matches the keyword "hypertension", ranks high in the search results, and has a comprehensive score of 0.85, which exceeds the threshold of 0.6, and is therefore selected as reference knowledge.
[0198] The answer generation module inputs the question and reference knowledge into the large model and generates an initial answer: "Hypertension is a common chronic disease, referring to a persistently high level of blood pressure. Medically, hypertension is usually defined as a systolic blood pressure greater than 140 mmHg or a diastolic blood pressure greater than 90 mmHg. Long-term hypertension can damage organs such as the heart, blood vessels, and kidneys."
[0199] The answer optimization module performs a quality assessment on the initial answer:
[0200] Completeness assessment: The answer included the definition, diagnostic criteria, and health impacts of hypertension, and the content was relatively complete, scoring 0.85;
[0201] Accuracy assessment: The factual information in the answer is consistent with the reference knowledge, the data is accurate, and the score is 0.9;
[0202] Fluency assessment: The answer is fluent and logically clear, scoring 0.9;
[0203] Relevance assessment: The answer closely relates to the question "What is hypertension", and is highly relevant, with a score of 0.95.
[0204] If all dimensions score above 0.7, the system will directly output this answer as the final answer.
[0205] The user's second question: "What are its symptoms?"
[0206] The dialogue management module records the questions and answers from the first round, constructing a dialogue context. When the second round of questions is received, the system identifies the pronoun "it," and by analyzing the dialogue context, determines that "it" refers to "hypertension" from the first round of questions. The dialogue management module then expands the question to its full form: "What are the symptoms of hypertension?"
[0207] The problem processing module preprocesses the expanded problem, extracts the keywords "hypertension" and "symptoms", and determines the problem type as an enumeration problem.
[0208] The knowledge retrieval module constructs a query vector to retrieve knowledge fragments related to "hypertension symptoms". The knowledge scoring module filters out highly relevant reference knowledge, including content such as "common symptoms of hypertension include headache, dizziness, palpitations, fatigue, and blurred vision".
[0209] The answer generation module combines the dialogue context and reference knowledge to generate the answer: "Common symptoms of hypertension include headache, dizziness, palpitations, fatigue, and blurred vision. However, it is important to note that many hypertension patients may not have obvious symptoms in the early stages of the disease, which is why hypertension is called the 'silent killer.' Therefore, regular blood pressure monitoring is very important."
[0210] The answer optimization module evaluates the quality of the answer. If all dimensions of the score meet the standard, the final answer is output.
[0211] Through two rounds of dialogue, the system accurately understood the user's continuous questions and provided coherent and accurate answers based on the dialogue context, demonstrating the excellent performance of this invention in multi-round dialogue scenarios.
[0212] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. An intelligent question-answering method for large-scale artificial intelligence models, characterized in that: Includes the following steps: Receive the question text input by the user, preprocess the question text, and extract question keywords and question type; The preprocessing includes: segmenting the question text to identify entity words and keywords in the question; performing syntactic analysis on the question text to determine the grammatical structure and question type of the question; and performing semantic understanding on the question text to extract the core intent and constraints of the question. A query vector is constructed based on the keywords of the question, relevant knowledge fragments are retrieved in the knowledge base, and a set of candidate knowledge fragments is obtained based on similarity calculation. Each knowledge fragment in the candidate knowledge fragment set is scored for relevance, and knowledge fragments with relevance scores exceeding a preset threshold are selected as reference knowledge. Input the question text and the reference knowledge into the large model to generate the initial answer text; The initial answer text is subjected to quality assessment. Based on the assessment results, the answer is optimized and adjusted, and the final answer is output. The quality assessment includes the following dimensions: answer completeness assessment: determining whether the answer fully answers all aspects of the question; answer accuracy assessment: verifying the consistency between the answer content and the reference knowledge; answer fluency assessment: assessing the language expression quality of the answer text; answer relevance assessment: assessing the degree of direct relevance between the answer and the question. The relevance score is calculated based on three dimensions: semantic similarity, keyword matching degree, and position ranking. The calculation formula is as follows: ; in, Indicates the relevance score. Indicates semantic similarity score, This indicates the keyword matching score. The position ranking score represents the ranking score; knowledge fragments with higher ranking positions have higher ranking scores, which characterize the relative importance of the knowledge fragment in the initial search results; the formula for calculating the position ranking score is: ,in, This indicates the ranking position of the knowledge fragment in the search results, with a value ranging from 1 to N.
2. The intelligent question-answering method for large-scale artificial intelligence models according to claim 1, characterized in that: The process of constructing query vectors in the question keyword query vector construction includes: The question text is encoded using a pre-trained language model to generate a fixed-dimensional vector representation; The vector representation is normalized to obtain the query vector; The query vector is used to perform an approximate nearest neighbor search in the vector index of the knowledge base to retrieve the top N knowledge fragments with the highest similarity, where N is an integer value between 50 and 200.
3. The intelligent question-answering method for large-scale artificial intelligence models according to claim 1, characterized in that: Intelligent question answering methods also include multi-turn dialogue management steps: Record the questions and answers from each round of historical dialogue to construct the dialogue context; When a new question text is received, the complete semantics of the current question are understood by combining the dialogue context. Identify the referential relationships in the problem and replace the pronouns with specific entities; Adjust the answer generation strategy based on the dialogue context.
4. An intelligent question-answering system for large-scale artificial intelligence models, used to implement the method described in any one of claims 1-3, characterized in that: include: The problem processing module is used to receive the problem text input by the user, preprocess the problem text, and extract problem keywords and problem type; The problem processing module includes: a word segmentation unit for segmenting the problem text and identifying entity words and keywords in the problem; a syntactic analysis unit for performing syntactic analysis on the problem text to determine the grammatical structure and question type of the problem; and a semantic understanding unit for performing semantic understanding on the problem text to extract the core intent and constraints of the problem. The knowledge retrieval module is used to construct a query vector based on the question keywords, retrieve relevant knowledge fragments in the knowledge base, and obtain a set of candidate knowledge fragments based on similarity calculation. The knowledge scoring module is used to score the relevance of each knowledge fragment in the candidate knowledge fragment set, and select knowledge fragments with a relevance score exceeding a preset threshold as reference knowledge; the knowledge scoring module calculates the relevance score using the following formula: ; in, Indicates the relevance score. Indicates semantic similarity score, This indicates the keyword matching score. This represents the positional ranking score, specifically the positional ranking score of the knowledge segment. The calculation method is as follows: the ranking position of the knowledge fragment in the search results is normalized to obtain a ranking score ranging from 0 to 1; among them, knowledge fragments with higher ranking positions have higher ranking scores, which are used to characterize the relative importance of the knowledge fragment in the initial search results; the calculation formula for the ranking score is: ,in, This indicates the ranking position of the knowledge fragment in the search results, with a value ranging from 1 to N; The answer generation module is used to input the question text and the reference knowledge into the large model to generate the initial answer text; The answer optimization module is used to evaluate the quality of the initial answer text, optimize and adjust the answer based on the evaluation results, and output the final answer. The answer optimization module includes: a completeness evaluation unit, used to determine whether the answer fully answers all aspects of the question; an accuracy evaluation unit, used to verify the consistency between the answer content and the reference knowledge; a fluency evaluation unit, used to evaluate the language expression quality of the answer text; and a relevance evaluation unit, used to evaluate the direct relevance of the answer to the question.
5. The intelligent question-answering system for large-scale artificial intelligence models according to claim 4, characterized in that: The knowledge retrieval module includes: A vector encoding unit is used to encode the question text using a pre-trained language model to generate a fixed-dimensional vector representation; A vector processing unit is used to normalize the vector representation to obtain the query vector. The retrieval unit is used to perform an approximate nearest neighbor search in the vector index of the knowledge base using the query vector, and retrieve the top N knowledge fragments with the highest similarity, where N is an integer value between 50 and 200.
6. The intelligent question-answering system for large-scale artificial intelligence models according to claim 4, characterized in that: The intelligent question-answering system also includes a dialogue management module, used for: Record the questions and answers from each round of historical dialogue to construct the dialogue context; When a new question text is received, the complete semantics of the current question are understood by combining the dialogue context. Identify the referential relationships in the problem and replace the pronouns with specific entities; Adjust the answer generation strategy based on the dialogue context.
Citation Information
Patent Citations
Knowledge base question and answer platform construction method based on large language model
CN120973958A
Intelligent dialogue knowledge base optimization method based on multi-path recall fusion and self-updating
CN121071084A