Question response method and device, computer readable storage medium and electronic equipment

By determining the type of problem entered by the user and selecting the corresponding response strategy, the large language model is responded to the problem of insufficient flexibility caused by relying on a single processing strategy in the prior art, and a more flexible and personalized response result is achieved.

CN119538940AInactive Publication Date: 2025-02-28CHINA TELECOM CORP LTD TECHNOLOGY INNOVATION CENTER +1
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411586725.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-07
Publication Date
2025-02-28
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the prior art, large language models rely on a single processing strategy, resulting in insufficient flexibility and difficulty in adapting to different scenario requirements, especially in complex semantic understanding and cross-domain information processing.

Method used

After receiving the original question input by the user, determine the question type, and determine the target response strategy based on the mapping relationship between the pre-configured different question types and their response strategy, respond to the original question, and generate the response result.

Benefits of technology

It realizes selecting different response strategies according to different question types to generate more flexible and personalized response results, improves the flexibility of response and user satisfaction, and optimizes resource utilization efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119538940A_ABST
    Figure CN119538940A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of artificial intelligence, and provides a question answering method, a question answering device, a computer readable storage medium and electronic device.The question answering method comprises the steps that after an original question input by a user is received, the question type to which the original question belongs is judged; determining a target response strategy associated with the question type according to a pre-configured mapping relationship between different question types and response strategies thereof; and performing response processing on the original question according to the target response strategy to obtain a response result corresponding to the original question. According to the method disclosed by the invention, different response strategies can be selected according to different question types, so that personalized responses which are more flexible and can adapt to various different scene requirements are generated.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] A large language model is a deep learning model trained with a large amount of text data that can generate natural language text or understand the meaning of language text. Large language models can handle a variety of natural language tasks, such as text classification, question answering, and dialogue, and are an important path to artificial intelligence.

[0003] Large language models combined with retrieval-enhanced generation technology can introduce external knowledge bases or real-time information before generating results to enhance the generation capabilities of the model. However, traditional solutions usually rely on a single processing strategy, which is not flexible enough and difficult to adapt to different scenario requirements.

[0004] In view of this, there is an urgent need in the art to develop a new question answering method and device.

[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure. Summary of the invention

[0006] The purpose of the present disclosure is to provide a question answering method, a question answering device, a computer-readable storage medium and an electronic device, thereby at least to a certain extent overcoming the technical problem of insufficient flexibility caused by reliance on a single processing strategy in related technologies.

[0007] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.

[0008] According to a first aspect of the present disclosure, a question answering method is provided, comprising:

[0009] After receiving the original question input by the user, determining the question type to which the original question belongs;

[0010] Determining a target answering strategy associated with the question type according to a pre-configured mapping relationship between different question types and their answering strategies;

[0011] The original question is answered according to the target answering strategy to obtain an answer result corresponding to the original question.

[0012] In an exemplary embodiment of the present disclosure, after receiving the original question from the user, the method further includes:

[0013] Preprocessing the original problem to obtain a preprocessed problem;

[0014] The preprocessing includes at least one of the following: denoising, word segmentation and semantic analysis.

[0015] In an exemplary embodiment of the present disclosure, determining the type of question to which the original question belongs includes:

[0016] The current resource occupancy situation is obtained, and the problem type to which the original problem belongs is determined according to the current resource occupancy situation.

[0017] In an exemplary embodiment of the present disclosure, determining the type of problem to which the original problem belongs according to the current resource occupancy situation includes:

[0018] When the resource occupancy is greater than a preset resource occupancy threshold, determining that the problem type to which the original problem belongs is a first problem type;

[0019] When the resource occupancy is less than the preset resource occupancy threshold, the problem complexity corresponding to the original problem is calculated, and the problem type to which the original problem belongs is determined according to the problem complexity.

[0020] In an exemplary embodiment of the present disclosure, the calculating the problem complexity corresponding to the original problem includes:

[0021] Extracting keywords from the original question and counting the number of the keywords;

[0022] Performing syntactic analysis on the original question to obtain the syntactic complexity corresponding to the original question;

[0023] Performing sentiment analysis on the original question to obtain the sentiment intensity corresponding to the original question;

[0024] The question complexity corresponding to the original question is determined according to the number of the keywords, the syntactic complexity and the sentiment intensity corresponding to the original question.

[0025] In an exemplary embodiment of the present disclosure, determining the type of question to which the original question belongs according to the question complexity includes:

[0026] In response to the complexity of the question being less than or equal to a preset complexity threshold, determining that the question type to which the original question belongs is the first question type;

[0027] In response to the question complexity being greater than the preset complexity threshold, determining the question type to which the original question belongs according to the query scenario associated with the original question.

[0028] In an exemplary embodiment of the present disclosure, determining the question type to which the original question belongs according to the query scenario associated with the original question includes:

[0029] In response to the query scenario not belonging to the specific query scenario, determining that the question type to which the original question belongs is a second question type;

[0030] In response to the query scenario belonging to the specific query scenario, it is determined that the question type to which the original question belongs is a third question type.

[0031] In an exemplary embodiment of the present disclosure, when the original question belongs to the first question type, the target answering strategy is the first answering strategy;

[0032] When the target answering strategy is the first answering strategy, answering the original question according to the target answering strategy to obtain an answer result corresponding to the original question includes:

[0033] Perform word embedding encoding on the original question to obtain a question vector corresponding to the original question;

[0034] Retrieving auxiliary answer documents related to the question vector in the knowledge corpus;

[0035] A pre-trained large language model is called, and the question vector and its related auxiliary answer documents are integrated by the large language model according to the question context of the original question to obtain an answer result corresponding to the original question.

[0036] In an exemplary embodiment of the present disclosure, when the original question belongs to the second question type, the target answering strategy is the second answering strategy;

[0037] When the target answering strategy is the second answering strategy, answering the original question according to the target answering strategy to obtain an answer result corresponding to the original question includes:

[0038] The original problem is split into M sub-problems, where M is an integer greater than 1;

[0039] Perform word embedding encoding on each sub-problem to obtain the problem sub-vector corresponding to each sub-problem;

[0040] Retrieving auxiliary answer documents related to each of the question sub-vectors in the corpus knowledge base respectively;

[0041] Calling a pre-trained large language model, and generating each initial answer result according to each of the question sub-vectors and each of the auxiliary answer documents through the large language model;

[0042] The initial answer results are integrated based on the question context of the original question to obtain the answer result corresponding to the original question.

[0043] In an exemplary embodiment of the present disclosure, when the original question belongs to the third question type, the target answering strategy is the third answering strategy;

[0044] When the target answering strategy is the third answering strategy, answering the original question according to the target answering strategy to obtain an answer result corresponding to the original question includes:

[0045] Perform word embedding encoding on the original question to obtain a question vector corresponding to the original question;

[0046] Retrieving auxiliary answer documents related to the question vector in the knowledge corpus;

[0047] Calling N pre-trained large language models, and generating each initial answer result according to the question vector and each auxiliary answer document through each of the large language models; N is an integer greater than 1;

[0048] The initial answer results are integrated based on the question context of the original question to obtain the answer result corresponding to the original question.

[0049] According to a second aspect of the present disclosure, there is provided a question answering device, comprising:

[0050] A question type determination module, configured to determine the question type to which the original question belongs after receiving the original question input by the user;

[0051] An answer strategy determination module, used to determine a target answer strategy associated with the question type according to a pre-configured mapping relationship between different question types and their answer strategies;

[0052] The answering module is used to answer the original question according to the target answering strategy to obtain the answer result corresponding to the original question.

[0053] According to a third aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the question answering method described in the first aspect is implemented.

[0054] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the question answering method described in the first aspect above by executing the executable instructions.

[0055] It can be seen from the above technical solutions that the question answering method, question answering device, computer-readable storage medium and electronic device in the exemplary embodiments of the present disclosure have at least the following advantages and positive effects:

[0056] In the technical solutions provided in some embodiments of the present disclosure, after receiving the original question input by the user, the question type to which the original question belongs is determined, and the target answer strategy associated with the question type is determined according to the pre-configured mapping relationship between different question types and their answer strategies. The original question is answered according to the target answer strategy to obtain the answer result corresponding to the original question. On the one hand, based on the determined question type, the user's needs and question intentions can be understood more accurately; further, through the pre-configured mapping relationship between the question type and the answer strategy, the answer strategy can be quickly determined, the processing time can be reduced, manual intervention can be reduced, and the processing speed can be improved; on the other hand, different answer strategies can be selected according to different question types, so as to generate more flexible and personalized answers that are adaptable to a variety of different scenarios, solve the problem of insufficient answer flexibility caused by relying on a single model and a fixed retrieval path in related technologies, improve user satisfaction, and help to reasonably allocate resources according to question types and improve resource utilization efficiency.

[0057] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.

[0059] Figure 1 A schematic diagram showing a flow chart of a question answering method in an embodiment of the present disclosure;

[0060] Figure 2 A flowchart showing how to determine the type of question to which the original question belongs according to the current resource occupancy situation in an embodiment of the present disclosure;

[0061] Figure 3 A schematic diagram showing a flow chart of how to calculate the problem complexity corresponding to the original problem in an embodiment of the present disclosure;

[0062] Figure 4 A flowchart showing how to determine the type of question to which the original question belongs according to the complexity of the question in an embodiment of the present disclosure;

[0063] Figure 5 A flowchart showing how to determine the question type to which the original question belongs according to the query scenario associated with the original question in an embodiment of the present disclosure;

[0064] Figure 6 A flow chart showing how to answer the original question according to the target answer strategy to obtain the answer result corresponding to the original question when the target answer strategy is the first answer strategy in the embodiment of the present disclosure;

[0065] Figure 7 A flow chart showing how to answer the original question according to the target answer strategy to obtain the answer result corresponding to the original question when the target answer strategy is the second answer strategy in the embodiment of the present disclosure;

[0066] Figure 8 A flow chart showing how to perform answer processing on the original question according to the target answer strategy to obtain an answer result corresponding to the original question when the target answer strategy is the third answer strategy in the embodiment of the present disclosure;

[0067] Fig. 9 The overall architecture diagram of the question answering method in the embodiment of the present disclosure is shown;

[0068] Fig.10 A schematic diagram showing the structure of a question answering device in an exemplary embodiment of the present disclosure is shown;

[0069] Fig.11 A schematic structural diagram of an electronic device in an exemplary embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0070] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.

[0071] The terms "a", "an", "the" and "said" are used in this specification to indicate the presence of one or more elements / components / etc.; the terms "including" and "having" are used to express an open-ended inclusion and mean that additional elements / components / etc. may exist in addition to the listed elements / components / etc.; the terms "first" and "second" etc. are used only as labels and are not intended to limit the quantity of their objects.

[0072] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings represent the same or similar parts, and their repeated descriptions will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities.

[0073] A large language model (LLM) is a deep learning model trained with a large amount of text data that can generate natural language text or understand the meaning of language text. Large language models can handle a variety of natural language tasks, such as text classification, question answering, and dialogue, and are an important path to artificial intelligence.

[0074] Retrieval-Augmented Generation (RAG) is a deep learning technology that combines the two capabilities of retrieval and generation. It belongs to the category of large model technology, which aims to enhance the generation capability of the model by introducing external knowledge bases or data sets, so that it can generate more accurate, more contextual, and more factual text content.

[0075] Large models combined with retrieval-enhanced generation technology can introduce external knowledge bases or real-time information before generating results, enhance the model's generation capabilities, and solve the problem of delayed knowledge updates or inaccurate generated content that may result from relying solely on parameter memory. Significant progress has been made in question-and-answer systems, document generation, content recommendation and other fields.

[0076] However, the above solution still has the following problems:

[0077] First, it cannot meet the requirements of complex semantic understanding and cross-domain information processing, and cannot provide personalized results;

[0078] Second, the ability of multi-model collaboration and the optimal use of computing resources;

[0079] Therefore, the present disclosure aims to provide a new question answering solution to solve the problem that the related solutions are limited by their specific architecture and training data, are difficult to flexibly adapt to the needs of various scenarios, and cannot well meet the application scenarios such as solving complex problems and integrating cross-domain information.

[0080] In the embodiments of the present disclosure, a question answering method is first provided, which at least to some extent overcomes the defect of insufficient flexibility in the related art.

[0081] Figure 1 A flow chart of a question answering method in an embodiment of the present disclosure is shown. The execution subject of the question answering method may be a server that answers questions.

[0082] refer to Figure 1According to an embodiment of the present disclosure, a question answering method comprises the following steps:

[0083] Step S110, after receiving the original question input by the user, determining the question type to which the original question belongs;

[0084] Step S120, determining a target answering strategy associated with a question type according to a pre-configured mapping relationship between different question types and their answering strategies;

[0085] Step S130, answering the original question according to the target answering strategy to obtain an answer result corresponding to the original question.

[0086] exist Figure 1 In the technical solution provided by the illustrated embodiment, after receiving the original question input by the user, the question type to which the original question belongs is determined, and the target answer strategy associated with the question type is determined according to the pre-configured mapping relationship between different question types and their answer strategies. The original question is answered according to the target answer strategy to obtain the answer result corresponding to the original question. On the one hand, the user's needs and question intentions can be understood more accurately based on the determined question type; further, through the pre-configured mapping relationship between the question type and the answer strategy, the answer strategy can be quickly determined, the processing time can be reduced, manual intervention can be reduced, and the processing speed can be improved; on the other hand, different answer strategies can be selected according to different question types, so as to generate more flexible and personalized answers that are adaptable to a variety of different scenarios, solve the problem of insufficient answer flexibility caused by relying on a single model and a fixed retrieval path in the related technology, improve user satisfaction, and help to reasonably allocate resources according to the question type and improve resource utilization efficiency.

[0087] The following Figure 1 The specific implementation process of each step is described in detail:

[0088] In step S110 , after receiving the original question input by the user, the question type to which the original question belongs is determined.

[0089] In this step, after receiving the original question input by the user, the original question can be preprocessed to obtain the preprocessed question; wherein the preprocessing process can include at least one of the following: denoising processing, word segmentation processing and semantic analysis processing.

[0090] De-noising refers to the process of removing irrelevant or interfering information from the original text, with the goal of retaining useful information and improving the accuracy and efficiency of subsequent processing. Word segmentation refers to the process of dividing continuous text into independent vocabulary units (words), which is an especially important step in Chinese processing because Chinese does not have obvious word boundary markers. Semantic parsing refers to the process of converting text into structured data, with the goal of understanding the deep meaning and logical structure of the text.

[0091] By preprocessing the original question, we can remove irrelevant information contained in the original question and retain its core content. We can also decompose the original question into independent vocabulary units, which makes it easier to understand the deep meaning and structure of the question, and helps to quickly and accurately determine the type of question to which the question belongs.

[0092] After preprocessing the original question, the question type to which the original question belongs can be determined. Exemplarily, the question type may include: a first question type (which may be called a simple question), a second question type (which may be called a complex question), and a third question type (which may be called a multi-generator question).

[0093] First, the current resource occupancy situation R may be obtained, and the problem type to which the original problem belongs may be determined according to the current resource occupancy situation R.

[0094] Among them, the above-mentioned resource occupancy can be the occupancy of computing resources required for system operation, such as: CPU (Central Processing Unit) utilization rate, GPU (Graphics Processing Unit) utilization rate, video memory occupancy rate, etc., which can be set according to actual conditions, and the present disclosure does not make any special limitations on this.

[0095] For details, please refer to Figure 2 , Figure 2 A flowchart showing how to determine the type of question to which the original question belongs according to the current resource occupancy in an embodiment of the present disclosure includes steps S201 to S202:

[0096] In step S201, when the resource occupation situation is greater than a preset resource occupation threshold, it is determined that the question type to which the original question belongs is the first question type.

[0097] In this step, when the above resource occupancy is greater than the preset resource occupancy threshold T1 (for example: 80%, and the specific value can be set or changed according to the actual situation, and the present disclosure makes no special limitation thereto), it can be determined that the problem type to which the original problem belongs is the first problem type (i.e., a simple problem). Thus, the present disclosure can determine the problem as a simple problem when the resource occupancy is relatively high, and then quickly process the problem according to a simple logic in the subsequent process, thereby being able to save the problem processing time and reduce the system burden.

[0098] In step S202, when the resource occupancy is less than the preset resource occupancy threshold, calculate the problem complexity corresponding to the original problem, and determine the problem type to which the original problem belongs according to the problem complexity.

[0099] In this step, when the resource occupancy is less than the preset resource occupancy threshold T1, the problem complexity corresponding to the above original problem can be calculated, and the problem type to which the original problem belongs can be determined according to the problem complexity.

[0100] Reference Figure 3 , Figure 3 shows a flowchart of how to calculate the problem complexity corresponding to the original problem in an embodiment of the present disclosure, including step S301-step S304:

[0101] In step S301, extract the keywords in the original problem and count the number of keywords.

[0102] In this step, the keywords in the above original problem can be extracted, and the number of keywords K(Q) can be counted. Keywords refer to the words with important semantic information in the text, which can summarize the main content and intention of the text. Keywords usually include nouns, verbs, adjectives, etc., but do not include common stop words (such as "of", "is", "in", etc.).

[0103] Exemplarily, the keywords in the original problem can be extracted based on any one or more of the following methods:

[0104] Part-of-speech tagging: Identify the parts of speech such as nouns, verbs, adjectives, etc. through part-of-speech tagging (POS tagging), and screen out the keywords therefrom;

[0105] Named entity recognition: Identify the named entities (such as person names, place names, organization names, etc.) in the text, which are usually part of the keywords;

[0106] TF-IDF: Evaluate the importance of the words by calculating the term frequency-inverse document frequency (TF-IDF), and screen out the keywords according to the word importance;

[0107] TextRank: A graph-based ranking algorithm similar to PageRank that evaluates the importance of words by building a co-occurrence graph of words to filter keywords based on word importance.

[0108] Supervised learning: Use labeled data to train the model and identify keywords in the text;

[0109] Unsupervised learning: Automatically identify keywords in text through methods such as clustering.

[0110] In step S302, the original question is subjected to syntactic analysis to obtain the syntactic complexity corresponding to the original question.

[0111] In this step, the original question can be parsed to obtain the syntactic complexity S(Q) corresponding to the original question. Syntactic parsing is to convert the text into a tree structure (syntax tree) to show the grammatical relationship between the various components in the sentence. Syntactic complexity can be measured by a variety of indicators, such as sentence length, nesting level, length of dependency relations, number of complex phrases (e.g., clauses, parallel sentences, etc.).

[0112] In step S303, sentiment analysis is performed on the original question to obtain the sentiment intensity corresponding to the original question.

[0113] In this step, sentiment analysis can be performed on the original question to obtain the sentiment intensity E(Q) corresponding to the original question. For example, sentiment analysis aims to identify and extract sentiment information in text, which is usually divided into positive, negative and neutral sentiments, and sentiment intensity further quantifies the degree of sentiment.

[0114] In step S304, the question complexity corresponding to the original question is determined based on the number of keywords, the syntactic complexity and the sentiment intensity corresponding to the original question.

[0115] In this step, the problem complexity C(Q) corresponding to the original problem can be calculated based on the following formula 1:

[0116] C(Q)=α*K(Q)+β*S(Q)+γ*E(Q) Formula 1

[0117] Among them, α, β, and γ are weight coefficients, and the specific values ​​can be set according to actual needs, and the present disclosure does not make any special limitations on this.

[0118] After calculating the problem complexity corresponding to the original problem, refer to Figure 4 , Figure 4A flowchart showing how to determine the type of question to which the original question belongs according to the complexity of the question in the embodiment of the present disclosure includes steps S401 and S402:

[0119] In step S401, in response to the question complexity being less than or equal to a preset complexity threshold, it is determined that the question type to which the original question belongs is a first question type.

[0120] In this step, when the calculated question complexity is less than or equal to the preset complexity threshold T2, it can be determined that the question type to which the original question belongs is the first question type, that is, a simple question.

[0121] In step S402, in response to the question complexity being greater than a preset complexity threshold, the question type to which the original question belongs is determined according to the query scenario associated with the original question.

[0122] In this step, when the calculated question complexity is greater than the above-mentioned preset complexity threshold T2, the question type to which the original question belongs can be determined according to the query scenario associated with the original question.

[0123] Specifically, machine learning or deep learning models can be used to analyze the user's question context and identify specific query scenarios.

[0124] Exemplarily, the query scenario can be characterized by the domain characteristics of the question and the user's intention. The domain characteristics of the question refer to the professional field or subject category to which the question belongs, which reflects the knowledge field or application background involved in the question. Exemplarily, the above-mentioned domain characteristics can be the professional field involved in the question (for example: medicine, law, finance, technology, etc.), and the subject category can be, for example, weather, news, entertainment, education, etc. User intention refers to the goal that the user hopes to achieve or the information expected to be obtained when asking a question, which reflects the user's real needs and motivations. Exemplarily, user intention can include: information query, execution of operation instructions, emotional expression, suggestion request, etc.

[0125] After identifying the query scenario associated with the original question, you can refer to Figure 5 , Figure 5 A flowchart showing how to determine the question type to which the original question belongs according to the query scenario associated with the original question in an embodiment of the present disclosure includes steps S501 and S502:

[0126] In step S501, in response to the query scenario associated with the original question not belonging to the specific query scenario, it is determined that the question type to which the original question belongs is the second question type.

[0127] In this step, when the query scenario associated with the original question does not belong to a specific query scenario (for example, it may be some problem fields with higher professional requirements, such as the medical field), it can be determined that the question type to which the original question belongs is the second question type, that is, a complex question.

[0128] In step S502, in response to the query scenario belonging to a specific query scenario, it is determined that the question type to which the original question belongs is a third question type.

[0129] In this step, when the query scenario associated with the original question belongs to a specific query scenario (for example, it can be some problem fields with higher professional requirements, such as the medical field), it can be determined that the problem type to which the original question belongs is the third problem type. The third problem type is a problem that is more difficult than a complex problem and can be called a multi-generator problem.

[0130] After determining the type of problem to which the original question belongs, you can then refer to Figure 1 In step S120, a target answering strategy associated with a question type is determined according to a pre-configured mapping relationship between different question types and their answering strategies.

[0131] In this step, exemplarily, a mapping relationship between different question types and their answer strategies can be pre-configured. For example, when the question type is a first question type, the associated answer strategy can be a first answer strategy (also referred to as a single-branch retrieval generation strategy); when the question type is a second question type, the associated answer strategy can be a second answer strategy (also referred to as a pre-retrieval multi-branch retrieval generation strategy); when the question type is a third question type, the associated answer strategy can be a third answer strategy (also referred to as a post-retrieval multi-branch retrieval generation strategy).

[0132] In step S130, the original question is answered according to the target answering strategy to obtain an answer result corresponding to the original question.

[0133] In this step, when the original question belongs to the first question type, the target answering strategy associated with it is the first answering strategy. Figure 6 , Figure 6 A flowchart showing how to answer the original question according to the target answer strategy to obtain the answer result corresponding to the original question when the target answer strategy is the first answer strategy in the embodiment of the present disclosure includes steps S601 to S603:

[0134] In step S601, word embedding encoding is performed on the original question to obtain a question vector corresponding to the original question.

[0135] In this step, the original question can be embedded to obtain the question vector corresponding to the original question. Embedding is a technology that converts discrete, high-dimensional data (such as words in text, pixels in images, user behavior, etc.) into low-dimensional, continuous vector representations. These vectors are usually called embedding vectors. Embedding vectors can make data easier to process in mathematical operations and machine learning models while maintaining the semantic information of the original data.

[0136] In step S602, auxiliary answer documents related to the question vector are retrieved from the knowledge corpus.

[0137] In this step, the retriever M_retrieve can be used to retrieve auxiliary answer documents with a high correlation with the question vector in the knowledge corpus. The auxiliary answer documents can be some documents that can provide auxiliary information for answering the question, such as tutorials or guides, technical documents and manuals related to the question.

[0138] In step S603, a pre-trained large language model is called, and the question vector and its related auxiliary answer documents are integrated according to the question context of the original question through the large language model to obtain the answer result corresponding to the original question.

[0139] In this step, a pre-trained large language model LLM can be called to integrate the question vector and its related auxiliary answer documents according to the question context of the original question through the large language model to obtain the answer result corresponding to the original question.

[0140] The role of the large language model is to understand the context of the question, integrate the input question vector and its auxiliary answer documents through the internal multi-layer neural network, and output the answer result corresponding to the original question.

[0141] When the original question belongs to the second question type, the target answering strategy associated with it is the second answering strategy. Figure 7 , Figure 7 A flow chart showing how to answer the original question according to the target answer strategy to obtain the answer result corresponding to the original question when the target answer strategy is the second answer strategy in the embodiment of the present disclosure includes steps S701 to S705:

[0142] In step S701, the original problem is split into M sub-problems.

[0143] In this step, the original problem can be split to obtain M (M can be an integer greater than 1) sub-problems. For example, the key components of the original problem can be identified first, and then the original problem can be split into multiple sub-problems based on the key components. Each sub-problem can be an independent and specific small problem that can be solved separately. By splitting the original problem, multiple independent and specific sub-problems can be obtained, each of which can be solved separately. This method helps to simplify the complexity of the problem and improve the efficiency and accuracy of problem solving.

[0144] In step S702, word embedding encoding is performed on each sub-question to obtain a question sub-vector corresponding to each sub-question.

[0145] In this step, each sub-problem can be embedded and encoded to obtain the problem sub-vector q_i corresponding to each sub-problem.

[0146] In step S703, auxiliary answer documents related to each question sub-vector are retrieved in the corpus knowledge base.

[0147] In this step, the retriever M_retrieve can be used to retrieve each auxiliary answer document d_i_j related to each question sub-vector q_i in the corpus knowledge base.

[0148] In step S704, a pre-trained large language model is called, and each initial response result is generated according to each question sub-vector and each auxiliary answer document through the large language model.

[0149] In this step, a pre-trained large language model can be called to integrate the information of each question sub-vector q_i and each related auxiliary answer document d_i_j through the large language model to generate each initial response result y_i_j.

[0150] In step S705, the initial answer results are integrated based on the question context of the original question to obtain the answer result corresponding to the original question.

[0151] In this step, a merging module M_merge can be used to integrate all the initial answer results obtained based on the question context of the original question to obtain the answer result corresponding to the original question.

[0152] When the original question belongs to the third question type, the target answering strategy associated with it is the third answering strategy. Figure 8 , Figure 8A flow chart showing how to answer the original question according to the target answer strategy to obtain the answer result corresponding to the original question when the target answer strategy is the third answer strategy in the embodiment of the present disclosure, including steps S801 to S805:

[0153] In step S801, word embedding encoding is performed on the original question to obtain a question vector corresponding to the original question.

[0154] In this step, the original question can be embedded and encoded to obtain the question vector q corresponding to the original question.

[0155] In step S802, auxiliary answer documents related to the question vector are retrieved from the knowledge corpus.

[0156] In this step, the retriever M_retrieve can be used to retrieve auxiliary answer documents d_i with a high correlation with the question vector q in the knowledge corpus.

[0157] In step S803, N pre-trained large language models are called, and each initial response result is generated by each large language model according to the question vector and each auxiliary answer document.

[0158] In this step, N (N is an integer greater than 1) pre-trained large language models can be called, and each large language model generates each initial response result y_i_j according to the question vector q and each related auxiliary answer document d_i.

[0159] In step S804, the initial answer results are integrated based on the question context of the original question to obtain the answer result corresponding to the original question.

[0160] In this step, all the initial answer results obtained can be comprehensively generated based on the question context of the original question (for example, information aggregation, information comparison and screening, logical reasoning, information integration, etc.) to obtain the answer result corresponding to the original question.

[0161] refer to Fig. 9 , Fig. 9 The overall architecture diagram of the question answering method in the embodiment of the present disclosure is shown, specifically:

[0162] After receiving the original question input by the user, the determination module can determine the type of question to which the original question belongs (the question types include simple questions, complex questions, and multi-generator questions, which are used to accurately locate the type of question and thus select different processing methods);

[0163] When it is determined that the original question belongs to the first question type (simple question), a single-branch retrieval strategy can be executed. Specifically, the Embedding module can first perform word embedding encoding on the original question to obtain a question vector. After that, the retriever can retrieve auxiliary answer documents related to the question vector in the knowledge corpus. The generator (i.e., the pre-trained large language model) can integrate the question vector and its related auxiliary answer documents based on the question context to obtain the response result corresponding to the original question.

[0164] In the case where it is determined that the original question belongs to the second question type, the pre-retrieval multi-branch retrieval generation strategy can be executed. Specifically, the question splitting module can split the original question to obtain M sub-questions. After that, the Embedding module can perform word embedding encoding on each sub-question to obtain each question sub-vector. Then, for each question sub-vector, the retriever can query and retrieve the auxiliary answer documents related to each question sub-vector in the corpus knowledge base respectively. The generator can generate each initial response result based on each question sub-vector and each auxiliary answer document. The mixer can integrate all the obtained initial response results, and generate the response result Response corresponding to the original question through the final generator based on the integrated information.

[0165] When it is determined that the original question belongs to the third question type, the post-retrieval multi-branch retrieval generation strategy can be executed. Specifically, the Embedding module can perform word embedding encoding on the original question to obtain the question vector corresponding to the original question. After that, the retriever can retrieve the auxiliary answer documents related to the question vector in the knowledge corpus. Furthermore, each generator can generate each initial response result based on the question vector and each auxiliary answer document. The mixer can integrate all the initial response results obtained, and generate the response result Response corresponding to the original question through the final generator based on the integrated information.

[0166] The disclosure breaks through the limitations of traditional retrieval systems that rely on a single model and a fixed retrieval path. By introducing a multi-branch strategy, the system is allowed to dynamically select different retrieval paths according to the complexity of the problem. Each branch can use a different large model or algorithm to explore different solutions in parallel, and finally merge the results of each branch to output the final answer result. Thus, not only the diversity and accuracy of the retrieval are improved, but also the collaborative optimization between multiple models is achieved, so that the system can cope with more complex and diverse query requirements.

[0167] The present disclosure also provides a question answering device, Fig.10 A schematic diagram showing the structure of a question answering device in an exemplary embodiment of the present disclosure is shown; Fig.10As shown, the question answering apparatus 1000 may include a question type determination module 1010 , a answering strategy determination module 1020 and an answering module 1030 .

[0168] in:

[0169] The question type determination module 1010 is used to determine the question type to which the original question belongs after receiving the original question input by the user;

[0170] An answering strategy determination module 1020 is used to determine a target answering strategy associated with the question type according to a pre-configured mapping relationship between different question types and their answering strategies;

[0171] The answering module 1030 is used to answer the original question according to the target answering strategy to obtain an answer result corresponding to the original question.

[0172] In an exemplary embodiment of the present disclosure, after receiving the original question from the user, the question type determination module 1010 is configured to:

[0173] Preprocessing the original problem to obtain a preprocessed problem;

[0174] The preprocessing includes at least one of the following: denoising, word segmentation and semantic analysis.

[0175] In an exemplary embodiment of the present disclosure, the question type determination module 1010 determines the question type to which the original question belongs, including:

[0176] The current resource occupancy situation is obtained, and the problem type to which the original problem belongs is determined according to the current resource occupancy situation.

[0177] In an exemplary embodiment of the present disclosure, determining the type of problem to which the original problem belongs according to the current resource occupancy situation includes:

[0178] When the resource occupancy is greater than a preset resource occupancy threshold, determining that the problem type to which the original problem belongs is a first problem type;

[0179] When the resource occupancy is less than the preset resource occupancy threshold, the problem complexity corresponding to the original problem is calculated, and the problem type to which the original problem belongs is determined according to the problem complexity.

[0180] In an exemplary embodiment of the present disclosure, the question type determination module 1010 calculates the question complexity corresponding to the original question, including:

[0181] Extracting keywords from the original question and counting the number of the keywords;

[0182] Performing syntactic analysis on the original question to obtain the syntactic complexity corresponding to the original question;

[0183] Performing sentiment analysis on the original question to obtain the sentiment intensity corresponding to the original question;

[0184] The question complexity corresponding to the original question is determined according to the number of the keywords, the syntactic complexity and the sentiment intensity corresponding to the original question.

[0185] In an exemplary embodiment of the present disclosure, the question type determination module 1010 determines the question type to which the original question belongs according to the question complexity, including:

[0186] In response to the complexity of the question being less than or equal to a preset complexity threshold, determining that the question type to which the original question belongs is the first question type;

[0187] In response to the question complexity being greater than the preset complexity threshold, determining the question type to which the original question belongs according to the query scenario associated with the original question.

[0188] In an exemplary embodiment of the present disclosure, the question type determination module 1010 determines the question type to which the original question belongs according to the query scenario associated with the original question, including:

[0189] In response to the query scenario not belonging to the specific query scenario, determining that the question type to which the original question belongs is a second question type;

[0190] In response to the query scenario belonging to the specific query scenario, it is determined that the question type to which the original question belongs is a third question type.

[0191] In an exemplary embodiment of the present disclosure, when the original question belongs to the first question type, the target answering strategy is the first answering strategy;

[0192] When the target answering strategy is the first answering strategy, the answering module 1030 performs answering processing on the original question according to the target answering strategy to obtain an answer result corresponding to the original question, including:

[0193] Perform word embedding encoding on the original question to obtain a question vector corresponding to the original question;

[0194] Retrieving auxiliary answer documents related to the question vector in the knowledge corpus;

[0195] A pre-trained large language model is called, and the question vector and its related auxiliary answer documents are integrated by the large language model according to the question context of the original question to obtain an answer result corresponding to the original question.

[0196] In an exemplary embodiment of the present disclosure, when the original question belongs to the second question type, the target answering strategy is the second answering strategy;

[0197] When the target answering strategy is the second answering strategy, the answering module 1030 performs answering processing on the original question according to the target answering strategy to obtain an answer result corresponding to the original question, including:

[0198] The original problem is split into M sub-problems, where M is an integer greater than 1;

[0199] Perform word embedding encoding on each sub-problem to obtain the problem sub-vector corresponding to each sub-problem;

[0200] Retrieving auxiliary answer documents related to each of the question sub-vectors in the corpus knowledge base respectively;

[0201] Calling a pre-trained large language model, and generating each initial answer result according to each of the question sub-vectors and each of the auxiliary answer documents through the large language model;

[0202] The initial answer results are integrated based on the question context of the original question to obtain the answer result corresponding to the original question.

[0203] In an exemplary embodiment of the present disclosure, when the original question belongs to the third question type, the target answering strategy is the third answering strategy;

[0204] When the target answering strategy is the third answering strategy, the answering module 1030 answers the original question according to the target answering strategy to obtain an answer result corresponding to the original question, including:

[0205] Perform word embedding encoding on the original question to obtain a question vector corresponding to the original question;

[0206] Retrieving auxiliary answer documents related to the question vector in the knowledge corpus;

[0207] Calling N pre-trained large language models, and generating each initial answer result according to the question vector and each auxiliary answer document through each of the large language models; N is an integer greater than 1;

[0208] The initial answer results are integrated based on the question context of the original question to obtain the answer result corresponding to the original question.

[0209] The specific details of each module in the above-mentioned question answering device have been described in detail in the corresponding question answering method, so they will not be repeated here.

[0210] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0211] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.

[0212] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0213] The present disclosure also provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiments; or may exist independently without being assembled into the electronic device.

[0214] The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.

[0215] Computer-readable storage media can send, propagate or transmit programs for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable storage medium can be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0216] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by an electronic device, the electronic device implements the method described in the above embodiments.

[0217] In addition, an electronic device capable of implementing the above method is also provided in an embodiment of the present disclosure.

[0218] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".

[0219] Refer to the following Fig.11 1100 according to this embodiment of the present disclosure is described. Fig.11 The electronic device 1100 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0220] like Fig.11 As shown, the electronic device 1100 is in the form of a general computing device. The components of the electronic device 1100 may include, but are not limited to: at least one processor 1110, at least one memory 1120, a bus 1130 connecting different system components (including the memory 1120 and the processor 1110), and a display 1140.

[0221] The memory stores program codes, which can be executed by the processor 1110, so that the processor 1110 executes the steps according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification. For example, the processor 1110 can execute the following steps: Figure 1 As shown in: Step S110, after receiving the original question input by the user, determine the question type to which the original question belongs; Step S120, determine the target answer strategy associated with the question type based on the pre-configured mapping relationship between different question types and their answer strategies; Step S130, answer the original question according to the target answer strategy to obtain an answer result corresponding to the original question.

[0222] The memory 1120 may include a readable medium in the form of a volatile storage, such as a random access memory (RAM) 11201 and / or a cache memory 11202 , and may further include a read-only memory (ROM) 11203 .

[0223] Memory 1120 may also include a program / utility 11204 having a set (at least one) of program modules 11205, such program modules 11205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0224] The bus 1130 may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures.

[0225] The electronic device 1100 may also communicate with one or more external devices 1200 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 1100, and / or communicate with any device that enables the electronic device 1100 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 1150. Furthermore, the electronic device 1100 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 1160. As shown, the network adapter 1160 communicates with other modules of the electronic device 1100 via a bus 1130. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 1100, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0226] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.

Claims

1. A question answering method, characterized in that: include: After receiving the original question input by the user, determining the question type to which the original question belongs; Determining a target answering strategy associated with the question type according to a pre-configured mapping relationship between different question types and their answering strategies; The original question is answered according to the target answering strategy to obtain an answer result corresponding to the original question.

2. The method according to claim 1, characterized in that: After receiving the original question from the user, the method further includes: Preprocessing the original problem to obtain a preprocessed problem; The preprocessing includes at least one of the following: denoising, word segmentation and semantic analysis.

3. The method according to claim 2, characterized in that The determining the type of question to which the original question belongs includes: The current resource occupancy situation is obtained, and the problem type to which the original problem belongs is determined according to the current resource occupancy situation.

4. The method according to claim 3, characterized in that: The determining the type of problem to which the original problem belongs according to the current resource occupation situation includes: When the resource occupancy is greater than a preset resource occupancy threshold, determining that the problem type to which the original problem belongs is a first problem type; When the resource occupancy is less than the preset resource occupancy threshold, the problem complexity corresponding to the original problem is calculated, and the problem type to which the original problem belongs is determined according to the problem complexity.

5. The method according to claim 4, characterized in that The calculating the problem complexity corresponding to the original problem includes: Extracting keywords from the original question and counting the number of the keywords; Performing syntactic analysis on the original question to obtain the syntactic complexity corresponding to the original question; Performing sentiment analysis on the original question to obtain the sentiment intensity corresponding to the original question; The question complexity corresponding to the original question is determined according to the number of the keywords, the syntactic complexity and the sentiment intensity corresponding to the original question.

6. The method according to claim 4, characterized in that The determining the type of question to which the original question belongs according to the complexity of the question includes: In response to the complexity of the question being less than or equal to a preset complexity threshold, determining that the question type to which the original question belongs is the first question type; In response to the question complexity being greater than the preset complexity threshold, determining the question type to which the original question belongs according to the query scenario associated with the original question.

7. The method according to claim 6, characterized in that The determining the question type to which the original question belongs according to the query scenario associated with the original question includes: In response to the query scenario not belonging to the specific query scenario, determining that the question type to which the original question belongs is a second question type; In response to the query scenario belonging to the specific query scenario, it is determined that the question type to which the original question belongs is a third question type.

8. The method according to claim 4 or 6, characterized in that: When the original question belongs to the first question type, the target answering strategy is the first answering strategy; When the target answering strategy is the first answering strategy, answering the original question according to the target answering strategy to obtain an answer result corresponding to the original question includes: Perform word embedding encoding on the original question to obtain a question vector corresponding to the original question; Retrieving auxiliary answer documents related to the question vector in the knowledge corpus; A pre-trained large language model is called, and the question vector and its related auxiliary answer documents are integrated by the large language model according to the question context of the original question to obtain an answer result corresponding to the original question.

9. The method according to claim 7, characterized in that: When the original question belongs to the second question type, the target answering strategy is the second answering strategy; When the target answering strategy is the second answering strategy, answering the original question according to the target answering strategy to obtain an answer result corresponding to the original question includes: The original problem is split into M sub-problems, where M is an integer greater than 1; Perform word embedding encoding on each sub-problem to obtain the problem sub-vector corresponding to each sub-problem; Retrieving auxiliary answer documents related to each of the question sub-vectors in the corpus knowledge base respectively; Calling a pre-trained large language model, and generating each initial answer result according to each of the question sub-vectors and each of the auxiliary answer documents through the large language model; The initial answer results are integrated based on the question context of the original question to obtain the answer result corresponding to the original question.

10. The method according to claim 7, characterized in that When the original question belongs to the third question type, the target answering strategy is the third answering strategy; When the target answering strategy is the third answering strategy, answering the original question according to the target answering strategy to obtain an answer result corresponding to the original question includes: Perform word embedding encoding on the original question to obtain a question vector corresponding to the original question; Retrieving auxiliary answer documents related to the question vector in the knowledge corpus; Calling N pre-trained large language models, and generating each initial answer result according to the question vector and each auxiliary answer document through each of the large language models; N is an integer greater than 1; The initial answer results are integrated based on the question context of the original question to obtain the answer result corresponding to the original question.

11. A question answering device, characterized in that: include: A question type determination module, configured to determine the question type to which the original question belongs after receiving the original question input by the user; An answer strategy determination module, used to determine a target answer strategy associated with the question type according to a pre-configured mapping relationship between different question types and their answer strategies; The answering module is used to answer the original question according to the target answering strategy to obtain the answer result corresponding to the original question.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the question answering method according to any one of claims 1 to 10 is implemented.

13. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to execute the question answering method described in any one of claims 1 to 10 by executing the executable instructions.

Citation Information

Patent Citations

  • Intelligent response method and device

    CN106844400A

  • Visual question and answer implementation method and method based on visual question and answer test model

    CN115221369A

  • Text novelty detection method and device, electronic equipment and readable storage medium

    CN115879441A

  • Language processing question answering system and method based on AIGC large model

    CN118093834A

  • Intelligent question answering method and system based on large model and storage medium

    CN118626627A