An Adaptive Retrieval Enhancement Question Answering Method and System
Patent Information
- Application Number
- CN202610868214.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-16
- Publication Date
- 2026-09-11
AI Technical Summary
[0004]由于进行多轮次对话时需要调取所有的历史对话并拼接后再进行理解后再生成答复,当对话的轮次过多时,会直接截断早期的内容,导致丢失早期细节,从而导致答复内容偏差增大,质量降低
1.对当前问题进行意图识别以得到问题关键词及问题类型,再对历史会话数据库中的历史问题及历史答复进行选取,从而得到关联问题与关联答复并合并形成相关综合内容,再将当前问题与相关综合内容输入至预设的大语言模型以输出当前答复,从而筛选出有效的历史问答内容以进行检索,有效缓解模型记忆衰减问题,提高多轮次对话的答复内容质量;
Smart Images

Figure CN122734005A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent question answering technology, and in particular to an adaptive retrieval-enhanced question answering method and system. Background Technology
[0002] Intelligent question answering is a human-computer interaction method that uses artificial intelligence technology to enable machines to understand questions posed by users in natural language and provide accurate answers directly.
[0003] Currently, in intelligent question answering, the agent typically first filters out invalid / inappropriate content and deconstructs the question intent. Then, it matches the corresponding response content to the question intent using training data and a general knowledge base. Finally, combining rules and expression habits, it reformatts, simplifies, or deepens the response to form a coherent answer before outputting it. When multiple rounds of dialogue are required, all saved historical dialogues are generally retrieved and pieced together chronologically. The complete context is then understood to generate a response.
[0004] Because multi-round dialogues require retrieving all historical dialogues, piecing them together, understanding them, and then generating responses, when there are too many rounds of dialogue, earlier content will be directly truncated, resulting in the loss of early details. This leads to greater deviations in the response content and a decrease in quality. Summary of the Invention
[0005] To improve the quality of responses in multi-turn dialogues, this invention provides an adaptive retrieval-enhanced question-answering method and system.
[0006] In a first aspect, the present invention provides an adaptive retrieval-enhanced question-answering method, which adopts the following technical solution: An adaptive retrieval-enhanced question-answering method includes: Collect user input of current questions and historical conversation databases; Intent recognition is performed based on the current question to obtain question keywords and question type; Retrieve historical questions and answers from the historical conversation database; Historical questions are selected based on keywords and used as the selected questions. The historical answers corresponding to the selected questions are then used as the selected answers. Determine the type relevance by combining the question type with the selected response; The selected responses are chosen based on their type relevance and designated as related responses. The selected questions corresponding to the related responses are then designated as related questions. The related questions and answers are merged to form relevant comprehensive content; The current question and related comprehensive content are input into a preset large language model to output the current answer.
[0007] By adopting the above technical solution, the intent of the current question is identified to obtain the question keywords and question type. Then, historical questions and answers are selected from the historical conversation database to obtain related questions and answers, which are then merged to form relevant comprehensive content. The current question and related comprehensive content are then input into a preset large language model to output the current answer, thereby filtering out effective historical question and answer content for retrieval. This effectively alleviates the problem of model memory decay and improves the quality of response content in multi-turn dialogues.
[0008] Optionally, the methods for selecting the problem include: Word segmentation based on historical issues to obtain individual historical terms; Determine the matching degree of individual words by combining the keywords of the question with historical individual words; Determine related words based on historical individual words; Determine the matching degree of the associated words by combining the question keywords with related words; The overall matching degree of the problem words is determined based on the matching degree of individual words and the matching degree of associated words; The questions are sorted from highest to lowest based on their overall matching degree, and then historical questions are selected based on the sorting results to obtain matching questions, which are then used as the selected questions.
[0009] By adopting the above technical solution, historical questions are segmented to obtain individual historical words, and the matching degree of individual words is determined in combination with the question keywords. Then, related words are determined to obtain the matching degree of related words, thereby determining the comprehensive matching degree of the question words. Finally, historical questions are selected to obtain matching questions and used as selection questions. This not only considers the literal matching of question keywords, but also mines potential semantic associations through related words, which significantly improves the recall rate and accuracy of historical question retrieval and avoids missing key historical information due to differences in word choice.
[0010] Optional methods for determining related vocabulary include: Identify relevant topics, events, and figures based on individual historical terms; Retrieve relevant vocabulary based on the topic; Retrieve relevant vocabulary based on related events; Retrieve relevant vocabulary based on the individuals in question; By combining topic-related, event-related, and person-related vocabulary, relevant overlapping words are identified, and these overlapping words are used as related words for association.
[0011] By adopting the above technical solution, relevant topics, events, and figures are determined based on historical individual words. Then, topic-related words, event-related words, and figure-related words are retrieved separately. The topic-related words, event-related words, and figure-related words are combined to determine relevant overlapping words and used as associated words. Thus, related words are extracted based on the three dimensions of topic, event, and figure, and the most core associated words are obtained by taking the overlapping parts. This can effectively expand the search scope and avoid introducing too many noisy words, thereby achieving accurate semantic expansion in matching degree calculation.
[0012] Optional methods for determining relevant overlapping words include: Based on the overlap between topic-related words, event-related words, and person-related words, the initial overlapping words are determined; Retrieve topic time points, event time points, and character time points based on overlapping initial words; Calculate the time difference between the topic time point, event time point, and person time point and use it as the time deviation value; Based on the time deviation value, the initial overlapping words are selected to obtain the overlapping selected words and used as the relevant overlapping words.
[0013] By adopting the above technical solution, the initial overlapping words are determined and the time points of topics, events, and people are retrieved. Then, the time deviation value is calculated to select overlapping words as related overlapping words. The time dimension is introduced as a filtering condition to eliminate false overlapping words with inconsistent time, ensuring that the associated related words are reasonable in terms of time logic. This avoids the incorrect association of irrelevant content from different time periods and improves the temporal accuracy of historical retrieval.
[0014] Optional methods for selecting overlapping words include: The larger and smaller deviation values were selected based on the time deviation values. Calculate the ratio between the smaller deviation and the larger deviation and use it as the deviation ratio. The deviation ratio is determined by combining the initial overlapping vocabulary with historical individual vocabulary. Select the initial overlapping words whose deviation ratio is less than the selected deviation ratio value and use them as the overlapping selected words.
[0015] By adopting the above technical solution, the larger and smaller deviation values are selected and the deviation ratio is calculated. Then, the deviation ratio selection value is determined. The overlapping initial words corresponding to the deviation ratio values that are less than the deviation ratio selection value are selected as overlapping words. Overlapping words with relatively large time deviations are automatically filtered out, and words with higher time consistency are retained. Thus, adaptive filtering granularity is achieved in the time dimension, effectively balancing recall and precision.
[0016] Optional methods for determining the deviation ratio include: Retrieve the initial word values based on overlapping initial words; Retrieve individual values for a single word based on historical data; Calculate the ratio between the number of individual words and the initial number of words, and use this ratio as the number proportion. Calculate the product between the number ratio and the preset ratio adjustment coefficient, and use it as the deviation ratio selection value.
[0017] By adopting the above technical solution, the number of individual words and the initial number of words are retrieved and the ratio is calculated. Then, the product of the ratio and the preset ratio adjustment coefficient is calculated and used as the deviation ratio selection value. The screening threshold is dynamically adjusted by the ratio between the total number of words in the current historical dialogue and the number of overlapping initial words, so that the screening strictness is adapted to the data scale.
[0018] Optionally, after forming the relevant comprehensive content, it may also include: The amount of content data retrieved based on relevant comprehensive content; Determine the required timeframe based on the type of problem; The allowable amount of data to be processed is determined based on the type of requirement time and the preset data unit processing volume. Determine if the amount of content data is less than the allowable amount of data to be processed; If so, continue outputting relevant comprehensive content; If not, retrieve the relevant time points based on the correlation issue; Sort the data according to the associated time points, and determine the associated sorting value based on the sorting results; The content to be retained is determined by combining the correlation ranking value and the correlation degree of the type, and the relevant comprehensive content is updated and replaced based on the retained content.
[0019] By adopting the above technical solution, the amount of content data is retrieved, and the allowable amount of data to be processed is determined by the problem type. Then, it is judged whether the amount of content data is less than the allowable amount of data to be processed. If it is less, the relevant comprehensive content continues to be output. If it is not less, the relevant time point is retrieved and the relevant ranking value is determined. Then, the content to be retained is determined by combining the type correlation and the relevant comprehensive content is updated and replaced. Thus, when the relevant comprehensive content exceeds the processing capacity, the comprehensive time sequence and type correlation are intelligently filtered, which maximizes the retention of high-value historical information and meets the response time requirements.
[0020] Optional methods for determining the content to be retained include: Determine retention reference values by combining correlation ranking values and type correlation. Calculate the average of the retention reference values and use it as the retention average; Related questions and answers with retention reference values greater than the average retention value are treated as time-related content, while related questions and answers with retention reference values not greater than the average retention value are treated as content-related content. Determine the time adjustment content by combining time-related content and content-related content; The content is adjusted based on time and combined with related content, and then retained as such.
[0021] By adopting the above technical solution, a retention reference value is determined and the average retention value is calculated. Then, time-related content and content-related content are selected separately, and time-adjusted content is determined and combined with content-related content as retention content. The average value is used as a dynamic dividing point to automatically divide candidate content into two categories: time-driven and content-driven. After processing them separately, they are merged again. This ensures that recent or highly relevant content is retained first, while avoiding the simple discarding of low-scoring content, thus achieving multi-objective optimization of content retention.
[0022] Optional methods for determining the time adjustment content include: Retrieve content-related data based on content association; Calculate the difference between the allowable amount of data and the amount of content-related data, and use this as the additional data amount; Retrieve time-related data based on time-related content; Calculate the ratio between the additional data volume and the time-related data volume, and use this as the data reduction ratio. Adjust the time-related content based on the data reduction ratio to obtain the time-adjusted content.
[0023] By adopting the above technical solution, the amount of content-related data is retrieved and the additional data volume is calculated. Then, the amount of time-related data is retrieved and the data reduction ratio is calculated. The time-related content is then adjusted according to the data reduction ratio to obtain the time-adjusted content. Thus, when the data volume exceeds the limit, the content-related content is retained first, and the time-related content is reduced proportionally according to the remaining available data volume. This achieves differentiated processing of the two types of content, ensuring the integrity of the core content while incorporating as much time-related content as possible within the limited capacity, achieving the optimal balance of resource allocation.
[0024] Secondly, the present invention provides an adaptive retrieval-enhanced question-answering system, which adopts the following technical solution: An adaptive retrieval-enhanced question-answering system includes: The data collection module is used to collect user input for the current question and historical conversation database; The memory stores a program for implementing an adaptive retrieval enhancement question-answering method as described in any one of the first aspects; The processor loads and executes programs stored in memory.
[0025] In summary, the present invention has at least one of the following beneficial technical effects: 1. The intent of the current question is identified to obtain the question keywords and question type. Then, historical questions and answers are selected from the historical conversation database to obtain related questions and answers and merge them to form relevant comprehensive content. The current question and related comprehensive content are then input into the preset large language model to output the current answer, thereby filtering out effective historical question and answer content for retrieval, effectively alleviating the model memory decay problem and improving the quality of response content in multi-turn dialogues. 2. By segmenting historical questions into individual historical words and combining them with question keywords to determine the matching degree of each individual word, and then determining related related words to obtain the matching degree of related words, the overall matching degree of the question words is determined. Then, historical questions are selected to obtain matching questions and used as selection questions. This not only considers the literal matching of question keywords, but also mines potential semantic associations through related related words, which significantly improves the recall and precision of historical question retrieval and avoids missing key historical information due to differences in word choice. 3. The system retrieves the amount of content data and determines the allowable data volume based on the question type. It then checks whether the amount of content data is less than the allowable data volume. If it is less, it continues to output relevant comprehensive content. If it is not less, it retrieves the associated time points and determines the associated sorting value. It then combines the type correlation to determine the content to be retained and updates and replaces the relevant comprehensive content. Thus, when the relevant comprehensive content exceeds the processing capacity, the system intelligently filters based on the comprehensive time sequence and type correlation, maximizing the retention of high-value historical information while meeting the response time requirements. Attached Figure Description
[0026] Figure 1 This is a flowchart of an adaptive retrieval-enhanced question-answering method; Figure 2 This is a flowchart illustrating the selection method for the chosen problem; Figure 3 It is a flowchart of the process after forming the relevant comprehensive content. Detailed Implementation
[0027] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments.
[0028] An adaptive retrieval-enhanced question-answering method identifies the user's intent in the current question, obtaining question keywords and question type. Then, from a historical conversation database, it uses word segmentation and matching, along with topic, event, and person-based vocabulary expansion, and incorporates time deviation verification to calculate the comprehensive matching degree of the question vocabulary, filtering out relevant historical questions and answers, and merging them to form relevant comprehensive content. Next, it dynamically determines the allowable amount of data to be processed based on the question type. When the comprehensive content exceeds the limit, it intelligently retains and optimizes the relevant comprehensive content based on the time sequence and type relevance. Finally, it inputs the current question and the optimized comprehensive content into a large language model to generate a response, thereby filtering out effective historical question-answer content for retrieval, effectively alleviating the model's memory decay problem and improving the quality of responses in multi-turn dialogues.
[0029] Reference Figure 1 This invention discloses an adaptive retrieval enhancement question-answering method, which includes: S100: Collects user input of current questions and historical conversation database.
[0030] The current question refers to a natural language query actively submitted by the user through text, voice, or other means. The system listens for user input events through the front-end interactive interface (such as a chat window or voice input component). When the user submits input (such as clicking the send button or pressing the enter key), the system captures the raw data of the input content and uses it as the current question. When the user input is voice input, the input audio also needs to be converted into text by the speech recognition module and used as the current question.
[0031] A historical conversation database is a structured collection of data that stores all past dialogue records between a user and a question-and-answer system. It is formed by the question-and-answer system storing each round of questions and their corresponding answers in real time. The historical conversation database is retrieved by querying the question-and-answer system.
[0032] S101: Perform intent recognition based on the current question to obtain question keywords and question type.
[0033] Intent recognition refers to a classification task in natural language processing, aiming to automatically determine the purpose or need category behind a user's input question. Question keywords refer to words or phrases that represent the core semantics and key information of the question. Question type refers to the category into which the user's current question is classified according to different dimensions (such as the reasoning complexity required for the answer, the expected output format, the relevant business domain, etc.). Question types include factual questions (e.g., "How high is Mount Everest?"), list questions (e.g., "List all Android phone brands"), definition questions (e.g., "What is blockchain?"), comparison questions (e.g., "Which is better, A or B?"), causal questions (e.g., "Why is the sky blue?"), and instructional questions (e.g., "How to install software?").
[0034] The text of the current question is split into words, and the classification model performs intent recognition to filter out invalid words such as auxiliary words and conjunctions, and extract the question keywords. Then, the text in the current question is matched according to the preset classification categories to determine the category and generate the question type for easy use later.
[0035] The preset categories pre-store different words and their corresponding question types. For example, texts such as "what," "which," and "who" correspond to factual / list-type questions; texts such as "why" and "reason" correspond to causal questions; and texts such as "how" and "how" correspond to instruction-type questions.
[0036] S102: Retrieve historical questions and answers from the historical conversation database.
[0037] Here, "historical questions" refers to all natural language queries that a user has asked during interactions with the question-and-answer system prior to the current session. "Historical responses" refers to the responses given by the system or human customer service to each historical question in past conversations. The historical conversation database stores both historical questions and responses.
[0038] By retrieving historical questions and answers from the historical conversation database, it is convenient to use them later.
[0039] S103: Select historical questions based on the keywords of the questions and use them as selected questions, and use the historical answers corresponding to the selected questions as selected answers.
[0040] Here, "selected questions" refers to one or more historical questions chosen from the entire set of historical questions based on specific screening criteria. "Selected answers" refers to the historical answers corresponding to the selected questions.
[0041] The system allows for the selection and definition of questions and answers using keywords, facilitating future use.
[0042] S104: Determine the type relevance by combining the question type with the selected response.
[0043] Among them, type relevance refers to the degree of matching or fit between the historical questions and answers corresponding to each selected answer and the current question type.
[0044] By recognizing the text in the selected responses to obtain the corresponding response type, the question type and response type are matched. When the question type and response type are consistent, the corresponding type correlation degree is 1. When the question type and response type are inconsistent, the corresponding type correlation degree is determined based on the similarity between the question type and response type, which facilitates subsequent use.
[0045] Response types include factual responses (corresponding text such as "for"), list responses (corresponding text such as "including"), definitional responses (corresponding text such as "is" or "for"), comparative responses (corresponding text such as "than"), causal responses (corresponding text such as "because"), and instructional responses (corresponding text such as "step X"). Similarity between question types and response types can be determined by inputting the question type and response type into a pre-defined type database to obtain the type correlation. The type database contains pre-set lookup tables for different question types, response types, and their corresponding type correlations; the type database is pre-configured by the operator.
[0046] For example, the type database can be set as follows: the type correlation between factual responses and definitional responses is set to 0.8, the type correlation between instructional responses and causal responses is set to 0.7, and the type correlation between all other remaining types is set to 0.4.
[0047] S105: Select the responses based on type relevance and use them as related responses, and use the selected questions corresponding to the related responses as related questions.
[0048] In this context, a related response refers to one or more related responses selected from all the selected responses. A related question refers to the selected question corresponding to a related response.
[0049] By selecting responses corresponding to type relevance values greater than the preset baseline relevance value and using them as related responses, and then defining related questions, it is convenient to use them later.
[0050] The baseline correlation degree refers to the baseline correlation degree when types are related. For example, the baseline correlation degree can be set to 0.5.
[0051] S106: Merge related questions and related answers to form related comprehensive content.
[0052] Among them, related comprehensive content refers to a whole text block formed by organizing and splicing multiple related questions and related answers according to a certain structure or order.
[0053] By sorting the related questions in the original chronological order of their occurrence in the historical dialogue, and inserting and merging the corresponding related answers below the corresponding related questions, a complete text block is obtained and used as related comprehensive content for convenient subsequent use.
[0054] S107: Input the current question and related comprehensive content into the preset large language model to output the current answer.
[0055] Large language models refer to pre-selected and deployed deep learning models with a large number of parameters and the ability to understand and generate natural language. Examples of large language models include GPT-4, DeepSeek, Claude, and LLaMA. The current response refers to the natural language answer text to the user's current question.
[0056] By inputting the current question and related comprehensive content into a pre-set large language model, the pre-set large language model cleans the current question and related comprehensive content, performs reasoning, and outputs the current answer, thereby filtering out effective historical question and answer content for retrieval, effectively alleviating the model memory decay problem and improving the quality of response content in multi-turn dialogues.
[0057] To further ensure the rationality of the selected problem, it is necessary to perform further separate analysis and calculation on the selected problem, which will be explained in detail through the steps shown below.
[0058] Reference Figure 2 The method for selecting a problem includes the following steps: S200: Segment words based on historical issues to obtain individual historical words.
[0059] Among them, a single historical word refers to the smallest independent word unit that is obtained after performing word segmentation on the text of historical issues.
[0060] By calling a word segmentation tool to segment historical issues and removing punctuation marks, individual historical words can be obtained for later use.
[0061] S201: Determine the matching degree of a single word by combining the question keywords with historical single words.
[0062] Among them, the single word matching degree refers to the degree of literal or semantic similarity between each question keyword and a historical single word.
[0063] By comparing the question keywords with historical individual words, when the comparison is completely consistent, 1 is directly used as the matching degree of the individual word. When the comparison is inconsistent, the corresponding key similar meaning words are retrieved based on the question keywords, and the key similar meaning words are matched with historical individual words. When the matching is consistent, the cosine similarity between the word vectors of the matching key similar meaning words and historical individual words is calculated and used as the matching degree of the individual word.
[0064] S202: Determine related words for association based on historical individual words.
[0065] Among them, related words refer to words obtained by associating and reasoning with individual historical words.
[0066] By analyzing individual historical words, related words can be identified for easier use later.
[0067] S203: Determine the matching degree of the associated words by combining the question keywords with related words.
[0068] Among them, the matching degree of associated words refers to the degree of similarity between the question keywords and the associated related words in terms of literal or semantic meaning.
[0069] By comparing the question keywords with related related words, when the comparison is completely consistent, 1 is directly used as the matching degree of a single word. When the comparison is inconsistent, the corresponding key similar meaning words are retrieved based on the question keywords, and the key similar meaning words are matched with related related words. When the matching is consistent, the cosine similarity between the word vectors of the key similar meaning words and the related related words is calculated and used as the matching degree of the related words.
[0070] S204: Determine the overall matching degree of the problem words based on the matching degree of individual words and the matching degree of associated words.
[0071] Among them, the comprehensive matching degree of the problem words refers to the overall relevance of a single historical word in the current problem keyword matching task.
[0072] By assigning weights to the matching degree of individual words and the matching degree of associated words, and performing a weighted calculation, the calculation result is used as the comprehensive matching degree of the question words, which is convenient for subsequent use.
[0073] The weights of individual word matching and associated word matching are preset by the operator according to actual needs.
[0074] For example, the weight of a single word match can be set to 0.6, and the weight of the associated word match can be set to 0.4.
[0075] S205: Sort the questions from highest to lowest based on the comprehensive matching degree of the question words, and select matching questions from the historical questions according to the sorting results, and use the matching questions as the selected questions.
[0076] Among them, the matching question refers to the historical questions selected that have a high degree of matching with the question keywords.
[0077] By sorting the comprehensive matching degree of the question words from largest to smallest, the historical questions corresponding to the highest-ranked words based on the sorting results are selected as matching questions for easy use in the future.
[0078] To further ensure the rationality of the related terms, it is necessary to conduct further separate analysis and calculation on the related terms, which will be explained in detail through the steps shown below.
[0079] The method for selecting related keywords includes the following steps: S300: Identify relevant topics, events, and figures based on individual historical terms.
[0080] Among them, "related topics" refer to discussion topics or category labels that are abstracted from the thematic areas implied by individual historical terms and have a certain degree of generality. "Related events" refer to specific behaviors, changes, or states that occurred at a certain point in time or within a certain period of time, identified from individual historical terms. "Related figures" refer to specific names, roles (such as "customer service" or "manager"), or pronouns referring to users / systems, extracted from individual historical terms.
[0081] By inputting individual historical terms into a pre-defined question-and-answer scenario database, relevant topics, events, and figures can be matched for easy use later.
[0082] The question-and-answer scenario database is obtained by extracting people, events, topics, and corresponding paragraph vocabulary from all content in the historical conversation database, organizing them, and storing them according to the categories of people, events, and topics.
[0083] S301: Retrieve topic-related vocabulary based on relevant topics.
[0084] Among them, topic-related vocabulary refers to a set of words that are closely related to the relevant topic in terms of semantics, theme, or domain.
[0085] By retrieving relevant vocabulary from the question-and-answer scenario database and using it as topic-related vocabulary, it becomes easier to use later.
[0086] S302: Retrieve event-related vocabulary based on relevant events.
[0087] Among them, event-related vocabulary refers to the set of words that are closely related to the relevant event in terms of semantics, theme, or domain.
[0088] By retrieving relevant vocabulary from the question-and-answer scenario database and using it as event-related vocabulary, it becomes easier to use later.
[0089] S303: Retrieve relevant vocabulary based on the relevant person.
[0090] Among them, vocabulary related to people refers to a set of words that are closely related to the relevant people in terms of semantics, theme or field.
[0091] By retrieving relevant vocabulary from the question-and-answer scenario database and using it as related vocabulary for subsequent use, it becomes easier to use.
[0092] S304: Combine topic-related words, event-related words, and person-related words to determine relevant overlapping words, and use these overlapping words as related words for association.
[0093] Among them, related overlapping words refer to two or more related words that exist simultaneously in topics, events, and people.
[0094] By combining topic-related, event-related, and person-related vocabulary, relevant overlapping words are identified and used as associative vocabulary, thereby improving the accuracy of the acquired associative vocabulary.
[0095] To further ensure the rationality of the related overlapping words, it is necessary to conduct further separate analysis and calculation on the related overlapping words, which will be explained in detail through the steps shown below.
[0096] The method for identifying related overlapping words includes the following steps: S400: Determine the initial overlapping words based on the overlap between topic-related words, event-related words, and person-related words.
[0097] Among them, overlapping initial words refer to the words that are consistent when any two or more of the topic-related words, event-related words, and person-related words are the same.
[0098] By comparing vocabulary related to topics, events, and people, and identifying overlapping words, we can use these as initial overlapping words for easier use later.
[0099] S401: Retrieve topic time points, event time points, and person time points based on overlapping initial words.
[0100] Among them, the topic time point refers to the time point at which the overlapping initial words appear in the topic dimension. The event time point refers to the time point at which the overlapping initial words appear in the event dimension. The person time point refers to the time point at which the overlapping initial words appear in the person dimension.
[0101] By retrieving the initial vocabulary, the time points of the topic, events, and people can be retrieved for convenient subsequent use.
[0102] If the topic time point, event time point, or person time point does not exist, the preset empty time point will be used as the topic time point, event time point, or person time point.
[0103] S402: Calculate the time difference between topic time points, event time points, and person time points and use it as the time deviation value.
[0104] The time deviation value refers to the time difference between the topic time point, the event time point, and the person time point.
[0105] By calculating the time difference between two or more actual time points among topic time points, event time points, and person time points, and using the calculation result as the time deviation value, it is convenient for subsequent use.
[0106] S403: Select overlapping initial words based on time deviation values, obtain overlapping selected words and use them as related overlapping words.
[0107] Among them, the overlapping selected words refer to the words that are selected after the initial overlapping words are selected.
[0108] By selecting initial overlapping words based on time deviation values, overlapping selected words are obtained and used as relevant overlapping words, thereby improving the accuracy of obtaining relevant overlapping words.
[0109] To further ensure the rationality of the overlapping word selection, it is necessary to conduct further separate analysis and calculation on the overlapping word selection, which will be explained in detail through the steps shown below.
[0110] The method for selecting overlapping words includes the following steps: S500: Based on the time deviation value, the larger deviation value and the smaller deviation value are selected.
[0111] The larger deviation value refers to the maximum value among the time deviation values. The smaller deviation value refers to the minimum value among the time deviation values.
[0112] By comparing the time deviation values, the maximum value is selected as the larger deviation value, and the minimum value is selected as the smaller deviation value, which facilitates subsequent use.
[0113] When there is only one time deviation value, then that time deviation value is directly used as the larger deviation value and the smaller deviation value respectively.
[0114] S501: Calculate the ratio between the smaller deviation and the larger deviation and use it as the deviation ratio.
[0115] The deviation ratio refers to the ratio between the smaller deviation value and the larger deviation value.
[0116] Calculating the deviation ratio facilitates subsequent use.
[0117] S502: Determine the deviation ratio selection value by combining the overlapping initial vocabulary and historical individual vocabulary.
[0118] The deviation ratio selection value refers to the benchmark ratio value corresponding to the selection.
[0119] By combining the initial overlapping words with historical individual words, the deviation ratio can be determined to facilitate subsequent use.
[0120] S503: Select the initial overlapping words whose deviation ratio is less than the deviation ratio selection value and use them as the overlapping selection words.
[0121] Specifically, by selecting initial overlapping words whose deviation ratio is less than the selected deviation ratio value, and using these initial overlapping words as the selected overlapping words, the accuracy of the obtained overlapping words is improved.
[0122] To further ensure the rationality of the selected deviation ratio value, it is necessary to perform a further separate analysis and calculation on the selected deviation ratio value, which will be explained in detail through the steps shown below.
[0123] The method for determining the deviation ratio includes the following steps: S600: Retrieves the initial word count based on overlapping initial words.
[0124] The initial word count refers to the number of overlapping initial words.
[0125] By counting the initial overlapping words and using the count as the initial word count, it is convenient to use them later.
[0126] S601: Retrieve the numerical values of a single word based on historical single words.
[0127] Among them, the number of individual words refers to the number of historical individual words.
[0128] By counting the number of values for each individual word and using the count result as the number of values for each word, it is convenient to use later.
[0129] S602: Calculate the ratio between the number of individual words and the initial number of words, and use it as the number ratio.
[0130] The ratio of the number of words refers to the ratio between the number of individual words and the initial number of words.
[0131] Calculating the proportion of each item makes it easier to use later.
[0132] S603: Calculate the product between the number ratio and the preset ratio adjustment coefficient, and use it as the deviation ratio selection value.
[0133] The ratio adjustment coefficient refers to the coefficient used to adjust the proportion of items. A larger ratio adjustment coefficient results in a larger deviation ratio and more lenient screening conditions; a smaller ratio adjustment coefficient results in stricter screening. The ratio adjustment coefficient is set by the operator according to actual needs, and its value generally ranges from 0.5 to 2.0. In this embodiment, the ratio adjustment coefficient can be set to 0.8.
[0134] By calculating the product between the number ratio and the preset ratio adjustment coefficient, and using the calculation result as the deviation ratio selection value, the accuracy of the obtained deviation ratio selection value is improved.
[0135] To further ensure the rationality of the resulting comprehensive content, it is necessary to conduct further separate analysis and calculations, which will be explained in detail through the steps shown below.
[0136] Reference Figure 3 After forming the relevant comprehensive content, the following steps are also included: S700: Retrieves content data volume based on relevant comprehensive content.
[0137] Among them, content data volume refers to the quantitative measure of the scale of information contained in the relevant comprehensive content.
[0138] The total number of all text characters in the relevant comprehensive content is counted and retrieved as the content data volume for convenient subsequent use.
[0139] S701: Determine the required time based on the problem type.
[0140] Among them, type-required time refers to the expected time required to respond to a question type.
[0141] Different question types correspond to different time requirements. By inputting the question type into a preset time-type mapping table, the required time can be matched and used later.
[0142] The type-time mapping table pre-stores different problem types and their corresponding time requirements. The type-time mapping table is obtained after the operator pre-inputs the information.
[0143] For example, the required time is 500 milliseconds for a factual question type, 800 milliseconds for a list question type, 1200 milliseconds for a cause question type, and 1500 milliseconds for a directive question type.
[0144] S702: Determine the allowable amount of data to be processed based on the type of required time and the preset data unit processing volume.
[0145] Here, "data unit processing capacity" refers to the amount of data that a large language model can process per unit of time. The data unit processing capacity is preset by the operator. "Permissible data processing capacity" refers to the amount of data that a large language model can process within the required timeframe for a given type of data.
[0146] The product of the required time for a given type and the preset data unit processing volume is calculated, and the result is used as the allowable amount of data to be processed, which is convenient for subsequent use.
[0147] S703: Determine whether the amount of content data is less than the allowable amount of data to be processed. If yes, proceed to S704; if no, proceed to S705.
[0148] Specifically, the system determines whether adjustments to the relevant comprehensive content are needed by checking whether the amount of content data is less than the allowable amount of data to be processed.
[0149] S704: Continue to output relevant comprehensive content.
[0150] When the amount of content data is less than the allowable amount of data to be processed, it means that no adjustment is needed to the relevant comprehensive content, so the relevant comprehensive content continues to be output.
[0151] S705: Retrieve related time points based on correlation issues.
[0152] Among them, the associated time point refers to the specific time point in the related question's historical dialogue.
[0153] When the amount of content data is not less than the allowable amount of data to be processed, it means that the relevant comprehensive content needs to be adjusted. Therefore, the relevant time points are retrieved for convenient use later.
[0154] S706: Sort according to the associated time points and determine the associated sorting value based on the sorting results.
[0155] Among them, the associated sorting value refers to the sorting result parameter corresponding to the sequential sorting of associated time points.
[0156] By sorting the associated time points sequentially and using the sorting results as the associated sorting values, it is convenient to use them later.
[0157] S707: Determine the content to be retained by combining the association ranking value and the type association degree, and update and replace the relevant comprehensive content based on the retained content.
[0158] Among them, the retained content refers to the portion of historical Q&A information that has been filtered from the currently available relevant comprehensive content.
[0159] By combining the analysis of correlation ranking values and type correlation, the retained content is determined, the original related comprehensive content is deleted, and the retained content is used as the new related comprehensive content, thereby improving the accuracy of the obtained related comprehensive content.
[0160] To further ensure the rationality of the retained content, it is necessary to perform further separate analysis and calculation on the retained content, which will be explained in detail through the steps shown below.
[0161] The method for determining the content to be retained includes the following steps: S800: Determine the retention reference value by combining the association ranking value and the type association degree.
[0162] The retention reference value refers to the priority used to measure the retention of each related question and related answer in subsequent content filtering.
[0163] The product of the association ranking value and the type association degree is calculated, and the calculation result is used as a reference value for future use.
[0164] S801: Calculate the average of the retention reference values and use it as the retention average.
[0165] The retention average refers to the average of the retention reference values.
[0166] Calculating the average retention rate makes it easier to use later.
[0167] S802: Treat related questions and answers with retention reference values greater than the retention average as time-related content, and treat related questions and answers with retention reference values not greater than the retention average as content-related content.
[0168] In particular, defining time-related content and content-related content facilitates subsequent use.
[0169] S803: Determine the time adjustment content by combining time-related content and content-related content.
[0170] Among them, time-adjusted content refers to the historical Q&A information corresponding to the time-related content after adjustments.
[0171] By combining and analyzing time-related content with content-related content, the time adjustment content can be determined to facilitate subsequent use.
[0172] S804: Based on time, combine the content with related content and retain it as retained content.
[0173] In this way, by merging time-adjusted content with related content to form a complete text and using it as retained content, the accuracy of the acquired retained content is improved.
[0174] To further ensure the rationality of the time adjustment, it is necessary to conduct a more detailed separate analysis and calculation of the time adjustment content, which will be explained in detail through the steps shown below.
[0175] The method for determining the content of the time adjustment includes the following steps: S900: Retrieves content-related data based on content association.
[0176] Among them, the amount of content-related data refers to a quantitative measure of the size of the information contained in the content-related content.
[0177] The content-related data can be retrieved by associating content with other content, making it convenient for subsequent use.
[0178] S901: Calculate the difference between the allowable amount of data and the content-related data and use it as an additional amount of data.
[0179] The additional data volume refers to the difference between the allowable data volume and the content-related data volume.
[0180] The additional data volume is calculated to facilitate subsequent use.
[0181] S902: Retrieve time-related data based on time-related content.
[0182] Among them, the amount of time-related data refers to a quantitative measure of the scale of information contained in time-related content.
[0183] The time-related data can be retrieved by using time-related content, making it convenient for subsequent use.
[0184] S903: Calculate the ratio between the additional data volume and the time-related data volume and use it as the data reduction ratio.
[0185] The data reduction ratio refers to the ratio between the additional amount of data and the amount of time-related data.
[0186] The calculation of the data reduction ratio facilitates subsequent use.
[0187] S904: Adjust the time-related content based on the data reduction ratio to obtain the time-adjusted content.
[0188] Specifically, the product of the data reduction ratio and the maximum value of the associated sorting value is calculated and used as the number of retained entries. Then, all questions and answers in the time-related content are sorted from smallest to largest according to the associated sorting value (most recent time takes priority). The content corresponding to the top-ranked retained entries is then retained as the time-adjusted content, thereby improving the accuracy of the obtained time-adjusted content.
[0189] Based on the same inventive concept, embodiments of the present invention provide an adaptive retrieval-enhanced question-answering system, comprising: The data collection module is used to collect user input for the current question and historical conversation database; The memory stores a program for implementing an adaptive retrieval enhancement question-answering method as described above; The processor loads and executes programs stored in memory.
[0190] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device, and unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0191] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should also be considered within the scope of protection of the present invention.
Claims
1. An adaptive retrieval-enhanced question-answering method, characterized in that, include: Collect user input of current questions and historical conversation databases; Intent recognition is performed based on the current question to obtain question keywords and question type; Retrieve historical questions and answers from the historical conversation database; Historical questions are selected based on keywords and used as the selected questions. The historical answers corresponding to the selected questions are then used as the selected answers. Determine the type relevance by combining the question type with the selected response; The selected responses are chosen based on their type relevance and designated as related responses. The selected questions corresponding to the related responses are then designated as related questions. The related questions and answers are merged to form relevant comprehensive content; The current question and related comprehensive content are input into a preset large language model to output the current answer.
2. The adaptive retrieval enhancement question-answering method according to claim 1, characterized in that, The methods for selecting questions include: Word segmentation based on historical issues to obtain individual historical terms; Determine the matching degree of individual words by combining the keywords of the question with historical individual words; Determine related words based on historical individual words; Determine the matching degree of the associated words by combining the question keywords with related words; The overall matching degree of the problem words is determined based on the matching degree of individual words and the matching degree of associated words; The questions are sorted from highest to lowest based on their overall matching degree, and then historical questions are selected based on the sorting results to obtain matching questions, which are then used as the selected questions.
3. The adaptive retrieval enhancement question-answering method according to claim 2, characterized in that, Methods for identifying related vocabulary include: Identify relevant topics, events, and figures based on individual historical terms; Retrieve relevant vocabulary based on the topic; Retrieve relevant vocabulary based on related events; Retrieve relevant vocabulary based on the individuals in question; By combining topic-related, event-related, and person-related vocabulary, relevant overlapping words are identified, and these overlapping words are used as related words for association.
4. The adaptive retrieval enhancement question-answering method according to claim 3, characterized in that, Methods for identifying related overlapping words include: Based on the overlap between topic-related words, event-related words, and person-related words, the initial overlapping words are determined; Retrieve topic time points, event time points, and character time points based on overlapping initial words; Calculate the time difference between the topic time point, event time point, and person time point and use it as the time deviation value; Based on the time deviation value, the initial overlapping words are selected to obtain the overlapping selected words and used as the relevant overlapping words.
5. The adaptive retrieval enhancement question-answering method according to claim 4, characterized in that, Methods for selecting overlapping words include: The larger and smaller deviation values were selected based on the time deviation values. Calculate the ratio between the smaller deviation and the larger deviation and use it as the deviation ratio. The deviation ratio is determined by combining the initial overlapping vocabulary with historical individual vocabulary. Select the initial overlapping words whose deviation ratio is less than the selected deviation ratio value and use them as the overlapping selected words.
6. The adaptive retrieval enhancement question-answering method according to claim 5, characterized in that, The methods for determining the deviation ratio include: Retrieve the initial word values based on overlapping initial words; Retrieve individual values for a single word based on historical data; Calculate the ratio between the number of individual words and the initial number of words, and use this ratio as the number proportion. Calculate the product between the number ratio and the preset ratio adjustment coefficient, and use it as the deviation ratio selection value.
7. The adaptive retrieval enhancement question-answering method according to claim 1, characterized in that, After forming the relevant comprehensive content, it also includes: The amount of content data retrieved based on relevant comprehensive content; Determine the required timeframe based on the type of problem; The allowable amount of data to be processed is determined based on the type of requirement time and the preset data unit processing volume. Determine if the amount of content data is less than the allowable amount of data to be processed; If so, continue outputting relevant comprehensive content; If not, retrieve the relevant time points based on the correlation issue; Sort the data according to the associated time points, and determine the associated sorting value based on the sorting results; The content to be retained is determined by combining the correlation ranking value and the correlation degree of the type, and the relevant comprehensive content is updated and replaced based on the retained content.
8. The adaptive retrieval enhancement question-answering method according to claim 7, characterized in that, Methods for determining the content to be retained include: Determine retention reference values by combining correlation ranking values and type correlation. Calculate the average of the retention reference values and use it as the retention average; Related questions and answers with retention reference values greater than the average retention value are treated as time-related content, while related questions and answers with retention reference values not greater than the average retention value are treated as content-related content. Determine the time adjustment content by combining time-related content and content-related content; The content is adjusted based on time and combined with related content, and then retained as such.
9. The adaptive retrieval enhancement question-answering method according to claim 8, characterized in that, The methods for determining the content of time adjustments include: Retrieve content-related data based on content association; Calculate the difference between the allowable amount of data and the amount of content-related data, and use this as the additional data amount; Retrieve time-related data based on time-related content; Calculate the ratio between the additional data volume and the time-related data volume, and use this as the data reduction ratio. Adjust the time-related content based on the data reduction ratio to obtain the time-adjusted content.
10. An adaptive retrieval-enhanced question-answering system, characterized in that, include: The data collection module is used to collect user input for the current question and historical conversation database; The memory stores a program for implementing an adaptive retrieval enhancement question-answering method as described in any one of claims 1 to 9; The processor loads and executes programs stored in memory.