Retrieval enhancement generation, question answering method and system based on intention recognition

By applying intention recognition and thinking chain technology on large language models, combined with step back prompt strategy, the problem of semantic understanding deviation in the existing technology is solved, and a more accurate and comprehensive large language model retrieval enhancement effect is achieved.

CN119149676BActive Publication Date: 2025-05-23NANJING XINGYE HUIJIE NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411668924.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-21
Publication Date
2025-05-23
Estimated Expiration
2044-11-21

AI Technical Summary

Technical Problem

In the actual use of existing semantic understanding technologies based on large language models, there are often problems that the semantic understanding results are biased from the actual intention of users, resulting in poor retrieval enhancement generation.

Method used

The search enhancement generation method based on intent recognition is adopted, and user input is analyzed through the thinking chain of the large language model, the problem type is determined, and the corresponding prompt rewrite model is selected to step back and prompt strategy, which is abstracted into a more general second prompt text pointing to the preset business type, so as to perform accurate information retrieval and enhanced generation.

Benefits of technology

Through accurate intention recognition and prompt rewriting, the accuracy and comprehensiveness of the generated results are improved, the downstream task needs can be better matched, and the quality of the answers is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119149676B_ABST
    Figure CN119149676B_ABST
Patent Text Reader

Abstract

The present invention proposes a retrieval enhancement generation, question-answering method and system based on intent recognition. The method uses thought chain analysis technology to perform intent analysis on the first prompt text input by the user, and can more accurately identify the intent of the first prompt text. On this basis, a multi-model collaborative architecture is adopted, and based on the intent recognition result of the first prompt text, the corresponding prompt rewriting model is accurately selected to further correct the first prompt text. The advantages of the rewriting models of different question types are utilized to improve the effect and quality of question rewriting, so that the rewritten second prompt text can accurately point to the preset business type, so that downstream tasks can be flexibly matched. Finally, the step-back prompt method is adopted to allow the large language model to start from a higher level of abstract problems, and can find clues to the answer from a wider range of information, thereby improving the comprehensiveness and accuracy of the answer.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a retrieval enhancement generation and question answering method and system based on intent recognition. Background Art

[0002] Retrieval-Augmented Generation (RAG) is a technology that combines information retrieval with a generative model, aiming to improve the accuracy and richness of generated text. At present, the industry usually uses language models to semantically understand the original input and then perform retrieval. For example, patent CN117909466A proposes a domain question-answering system that only uses a small language model to identify the user's input intent and rewrite the question, and directly retrieves based on the rewritten question. However, due to the limitations of the generalization ability of the language model, in actual use, there is often a large deviation between the semantic understanding results of the language model and the actual intention of the user, and the effect of directly enhancing retrieval based on the semantic understanding results of the language model is not good. Summary of the invention

[0003] Purpose of the invention: The present invention aims to propose a retrieval enhancement generation, question-answering method and system based on intent recognition, which can accurately rewrite prompt information according to specific downstream business scenarios, thereby improving the accuracy of retrieval enhancement generation results.

[0004] Invention content: To achieve the above objectives, the present invention proposes the following technical solutions:

[0005] In a first aspect, a retrieval enhancement generation method based on intent recognition is provided, comprising:

[0006] Get the first prompt text entered by the user;

[0007] Using the thinking chain of the large language model to perform chain reasoning based on intent recognition on the first prompt text to determine the question type of the first prompt text;

[0008] According to the question type of the first prompt text, a corresponding prompt rewriting model is selected, and the prompt rewriting model is used to adopt a step-back prompt strategy to abstract the first prompt text into a more general second prompt text pointing to a preset business type;

[0009] Retrieving relevant information from an information source based on the second prompt text;

[0010] The first prompt text is enhanced using the relevant information to generate response information of the first prompt text.

[0011] As an optional implementation of the method of the first aspect, using the thinking chain of the large language model to perform chain reasoning based on intent recognition on the first prompt text to determine the question type of the first prompt text specifically includes:

[0012] Construct prompts based on pre-set role tasks and pre-built question types;

[0013] Decomposing the first prompt text into a plurality of sub-questions in a logical order;

[0014] According to the logical order of the plurality of sub-problems, the plurality of sub-problems are reasoned step by step, and in the reasoning process of each step, an enhanced search is performed based on the reasoning result of the previous step and the current sub-problem, and the reasoning result of the current step is obtained based on the search result, the prompt information, the reasoning result of the previous step and the current sub-problem;

[0015] Integrate the reasoning results of the several sub-problems to obtain an overall reasoning result;

[0016] The question type corresponding to the first prompt text is determined according to the overall reasoning result.

[0017] As an optional implementation manner of the method described in the first aspect, the prompt rewriting model corresponding to each question type is trained for the question type and the business type corresponding to the question type.

[0018] In a second aspect, a question-answering method is provided, comprising:

[0019] Get the target question;

[0020] The above-mentioned retrieval enhancement generation method based on intent recognition is used to perform retrieval enhancement generation on the target question to obtain an answer to the target question.

[0021] In a third aspect, a retrieval enhancement generation system based on intent recognition is provided, comprising:

[0022] A first data acquisition module is configured to acquire a first prompt text input by a user;

[0023] an intention recognition module, configured to use a thinking chain of a large language model to perform chain reasoning based on intention recognition on the first prompt text to determine a question type of the first prompt text;

[0024] a prompt rewriting module configured to select a corresponding prompt rewriting model according to the question type of the first prompt text, and use the prompt rewriting model to adopt a step-back prompt strategy to abstract the first prompt text into a more general second prompt text pointing to a preset business type;

[0025] A retrieval enhancement module, configured to retrieve relevant information in an information source based on the second prompt text; and enhance the first prompt text by using the relevant information to generate response information for the first prompt text.

[0026] As an optional implementation manner of the system described in the third aspect, the intent recognition module is specifically configured to:

[0027] Construct prompt information according to preset role tasks and pre - constructed question types;

[0028] Decompose the first prompt text into several sub - questions with a logical order;

[0029] Step - by - step reason about the several sub - questions according to the logical order of the several sub - questions, and in the reasoning process of each step, perform enhanced retrieval based on the reasoning result of the previous step and the current sub - question, and obtain the reasoning result of the current step based on the retrieval result, the prompt information, the reasoning result of the previous step, and the current sub - question;

[0030] Integrate the reasoning results of the several sub - questions to obtain a total reasoning result;

[0031] Determine the question type corresponding to the first prompt text according to the total reasoning result.

[0032] As an optional implementation manner of the system described in the third aspect, the system further includes a pre - training module, and the pre - training module is configured to pre - train a prompt rewriting model corresponding to each preset question type and the business type corresponding to the question type.

[0033] In a fourth aspect, a question - answering system is provided, including:

[0034] A second data acquisition module, configured to acquire a target question;

[0035] A reply generation module, configured to perform retrieval - enhanced generation on the target question by using the above - mentioned retrieval - enhanced generation method based on intent recognition to obtain a reply to the target question.

[0036] In a fifth aspect, a computer - readable storage medium is provided, characterized in that the computer - readable storage medium stores a computer program, and when the computer program runs on an electronic device, the electronic device is enabled to execute the above - mentioned retrieval - enhanced generation method based on intent recognition, or execute the above - mentioned question - answering method.

[0037] In a sixth aspect, an electronic device is provided, including:

[0038] at least one memory for storing a program;

[0039] At least one processor is used to execute the program stored in the memory. When the program stored in the memory is executed, the processor is used to execute the above-mentioned retrieval enhancement generation method based on intent recognition, or to execute the above-mentioned question and answer method.

[0040] Beneficial effect: The beneficial effect of the retrieval enhancement generation method based on intent recognition described in the embodiment of this specification is that the method uses the thought chain analysis technology to perform intent analysis on the first prompt text input by the user, and can more accurately identify the intent of the first prompt text. On this basis, a multi-model collaborative architecture is adopted, and based on the intent recognition result of the first prompt text, the corresponding prompt rewriting model is accurately selected to further correct the first prompt text, and the advantages of the rewriting models of different question types are utilized to improve the effect and quality of question rewriting, so that the rewritten second prompt text can accurately point to the preset business type, so that downstream tasks can be flexibly matched. Finally, the step-back prompt method is adopted to allow the large language model to start from a higher level of abstract problems, and can find clues to the answer from a wider range of information, thereby improving the comprehensiveness and accuracy of the answer.

[0041] The retrieval enhancement generation system, question-answering method and system based on intent recognition described in the embodiments of this specification also have the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 A flowchart of a retrieval enhancement generation method based on intent recognition according to an embodiment;

[0043] Figure 2 A schematic diagram of the structure of a retrieval enhancement generation system based on intent recognition according to an embodiment;

[0044] Figure 3 A flowchart of a question-and-answer method according to an embodiment of the present invention;

[0045] Figure 4 The figure is a schematic diagram of the structure of a question-answering system involved in the embodiment. DETAILED DESCRIPTION

[0046] First of all, it should be noted that the terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "the" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates otherwise.

[0047] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Therefore, it should be recognized by those skilled in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0048] It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for description in other embodiments.

[0049] This embodiment aims to address the technical problems of insufficient accuracy and poor flexibility of existing retrieval enhancement generation solutions based on semantic understanding of large language models, and to provide a retrieval enhancement generation, question-answering method and system based on intent recognition.

[0050] The intent recognition-based retrieval enhancement generation, question-answering method and system described in one or more embodiments of this specification will be further described in detail below in conjunction with the drawings and specific embodiments of the specification, but this detailed description does not constitute a limitation on the embodiments of this specification.

[0051] Please refer to Figure 1 , Figure 1 Flow chart of a search enhancement generation method based on intent recognition proposed in one or more embodiments of this specification. Figure 1 As shown, the method may include steps S100 to S108.

[0052] S100: Acquire a first prompt text input by a user.

[0053] The first prompt text mentioned above refers to the original prompt input by the user to the large language model.

[0054] S102: Use the thinking chain of the large language model to perform chain reasoning based on intent recognition on the first prompt text to determine the question type of the first prompt text.

[0055] The main principle of the CoT (Chain of Thought) thinking chain is to gradually decompose complex problems and use chain reasoning to enable the large language model to gradually think and summarize. The core of this method is to break down complex problems into multiple simple sub-problems, and through step-by-step reasoning and solving, each step is based on the result of the previous step, and finally get the solution to the whole problem. This step-by-step reasoning process can help the large language model better understand the context and details of the problem, avoid errors in the intermediate steps, and thus improve the accuracy and reliability of the overall answer.

[0056] In terms of technical implementation, the CoT (Chain of Thought) thinking chain guides the large language model to perform chain reasoning through prompts. Prompts usually contain multiple steps, each of which requires the model to perform specific reasoning or calculations and use the results for the next step of reasoning. In this way, the large language model can clearly understand the current task at each step and connect it to the overall problem. In addition, the CoT thinking chain can also be combined with other technologies, such as retrieval-augmented generation (RAG), to retrieve relevant information in each reasoning step, further improving the accuracy and comprehensiveness of the answer. Through iterative optimization and feedback adjustment, the thinking chain technology can continuously improve the performance of the model in complex tasks, thereby demonstrating wide applicability and efficiency in a variety of application scenarios.

[0057] In order to enable the above-mentioned large language model to have the ability of thinking chain, the large language model can be trained in advance. The specific training process mainly includes training set construction and model training.

[0058] Training set construction: First, determine the problem type based on the specific downstream tasks of the large language model, such as encountering a certain problem or the reason for an event. The problem type here can be adaptively set according to the specific downstream tasks of the large language model, and this embodiment does not limit this.

[0059] For the identified question types, collect corpora of complex reasoning and decision-making involving the corresponding business scenarios. These corpus samples can include question-answering dialogues, reasoning, and discussions. Specialized annotation tools and frameworks, such as Brat or Prodigy, can be used to annotate the collected corpus samples to ensure the consistency and accuracy of the annotations. The logical order and final conclusion of the intermediate reasoning steps of each corpus sample are determined through annotation (in this step, the final conclusion here refers to the preset question type). In addition, the corpus samples can be cleaned and preprocessed to remove noise and redundant information in the corpus samples. Finally, the corpus samples are formatted into a form suitable for large language model training (such as JSON, CSV, etc.), that is, a reasoning link training sample with a logical sequence relationship is obtained.

[0060] Model training: You can choose a pre-trained large language model (such as qwen2-7b-instruct) as the basic model, and use the above-mentioned reasoning link training samples to fine-tune the large language model to obtain a large language model with the above-mentioned thinking chain function.

[0061] After fine-tuning, the large language model can perform chain reasoning based on intent recognition on the first prompt text through the thought chain to determine the question type of the first prompt text. Specifically, the reasoning process using the thought chain of the large language model includes steps S1020 to S1024.

[0062] S1020: First, construct prompt information according to the pre-set role tasks and pre-constructed question types.

[0063] Then, change the first prompt text P Decompose into several sub-problems with a logical order:

[0064] ;

[0065] to Indicates the first prompt text P Decomposed into logical order n A sub-question, Represents the logical decomposition algorithm.

[0066] S1022: Reasoning the sub-problems step by step according to the logical order of the above-mentioned sub-problems, and in the reasoning process of each step, performing enhanced retrieval based on the reasoning result of the previous step and the current sub-problem, and obtaining the reasoning result of the current step based on the retrieval result, the prompt information, the reasoning result of the previous step and the current sub-problem.

[0067] That is to say, first perform initialization reasoning and use the prompt information And the first sub-problem Guide the model to perform the first inference. The expression of the first inference is:

[0068] ;

[0069] in, represents the inference algorithm, Represents the inference result of the first inference.

[0070] Next, we perform chain reasoning: It will be used as one of the inputs for the next step of reasoning, combined with the prompt information and possible search results Proceed to the next step of reasoning. The expression of chain reasoning is:

[0071] .

[0072] Among them, search information It can be expressed by the following formula:

[0073] .

[0074] S1024: Integrate the inference results of the multiple sub-questions to obtain a total inference result. Determine the question type corresponding to the first prompt text according to the total inference result.

[0075] ;

[0076] in, Represents the overall inference result, Represents the integration algorithm.

[0077] The following is a specific example of thought chain reasoning to demonstrate the analysis process of the thought chain of the large language model for a specific problem.

[0078] The first prompt text entered by the user is "My network signal is always poor, how can I solve it?".

[0079] The thinking chain analysis process of the large language model:

[0080] (1) Problem decomposition

[0081] Extract key information:

[0082] - User mentioned "network signal".

[0083] - Users are concerned about "the signal is always poor".

[0084] - Questions end with "How do I solve it?", indicating that the user is looking for a solution.

[0085] (2) Preliminary classification

[0086] Based on the extracted information, we preliminarily categorized the issues:

[0087] - This question is asking how to fix a poor network signal, indicating that the user is experiencing difficulties.

[0088] (3) Step-by-step reasoning

[0089] Step 1: Determine the type of problem

[0090] - The question form is "how to solve it", which is typically used to explore how to deal with difficulties.

[0091] - Related keywords: "network signal", "very poor", "how to solve".

[0092] Reasoning results:

[0093] This is consistent with "encountering some difficulties".

[0094] Step 2: Supporting Argument

[0095] - The question explicitly mentions "poor network signal", indicating that the user is experiencing actual difficulties.

[0096] - The user is asking for a solution, which is typical of a person who is experiencing difficulty.

[0097] - Other categories are excluded because there is no inquiry into reasons, business names, or small talk.

[0098] (4) Final Result

[0099] Problem classification: encountered a certain difficulty

[0100] evidence:

[0101] - The question ends with "how to solve it" to clearly ask for a solution.

[0102] - The mention of "poor network signal" is consistent with the actual difficulties encountered by users.

[0103] - Other categories were excluded because there was no mention of event cause, business name, or small talk.

[0104] From the above examples, we can see that through the gradual decomposition and reasoning of the thought chain, the large language model can accurately classify the questions input by the user and provide sufficient evidence to support its classification results. This method of step-by-step decomposition and reasoning can help the large language model better understand the needs of users and provide targeted solutions, thereby effectively improving the performance of the large language model in complex tasks, making it widely applicable and efficient in a variety of application scenarios.

[0105] S104: According to the question type of the first prompt text, a corresponding prompt rewriting model is selected, and the prompt rewriting model is used to adopt a step-back prompt strategy to abstract the first prompt text into a more general second prompt text pointing to a preset business type.

[0106] This step is mainly used to rewrite the first prompt text. This is because the semantics of the user's real intention identified by the large language model may not be consistent with the business knowledge semantic understanding of the specific downstream business. Therefore, in this step, based on the identified intention of the first prompt text, the first prompt text is rewritten more accurately so that the rewritten text is more consistent with the knowledge understanding of the specific downstream business.

[0107] On the other hand, due to the complexity and details of many tasks, large language models often have difficulties in finding relevant information needed to solve the problem. In order to help large language models solve these complex problems more effectively, the step-back prompting method is introduced in this step. The step-back question is a higher-level abstract question derived from the original question. By asking a higher-level abstract question, the large language model can find clues to answer the original question from a wider range of information. For example, for a question about a specific time period and event, you can first ask for more general background information. The step-back prompting method contains two main steps: the first is abstraction, which prompts the large language model to ask a general question about a higher-level concept or principle and retrieve relevant information instead of directly answering the original question. The next is reasoning. After obtaining information about high-level concepts or principles, use this information to reason and answer the original question in detail.

[0108] Specifically, in this step, the steps of the abstract stage are executed. That is, the first prompt text is used as the original question , and then abstract it into a higher level of abstract problem .set up represents an abstract operation, then we have:

[0109] .

[0110] For example, the first prompt text is "What should I do if I don't have data traffic abroad?", and the second prompt text obtained by rewriting it with the fallback prompt strategy is "International data traffic service". The first prompt text is "What should I do if I can't get through because of arrears in phone bills?", and the second prompt text obtained by rewriting it with the fallback prompt strategy is "Phone recharge service". The first prompt text is "How to check the cancellation status of user's corporate ringback tone?", and the second prompt text obtained by rewriting it with the fallback prompt strategy is "Corporate video ringback tone service".

[0111] It should be noted that the above-mentioned service types can be adaptively set according to specific service requirements, and this embodiment does not limit this.

[0112] Based on the purpose of the above prompt rewriting, in this step, a prompt rewriting model is trained for each question type, that is, the prompt rewriting model corresponding to each question type is trained for the question type and the business type corresponding to the question type.

[0113] After training, each prompt rewriting model becomes an expert in the corresponding business field and can rewrite the first prompt text of the corresponding question type into an accurate expression of the business field. This step uses different rewriting models to process the first prompt text of different question types, so that each prompt rewriting model only processes the prompt rewriting of its own private domain, which greatly increases the reliability of the rewritten prompts, thereby ensuring that different types of questions can be effectively handled.

[0114] The above-mentioned prompt rewriting model can be implemented by a large language model. The specific training process is as follows:

[0115] A training sample is obtained, the training sample including the prompt information before rewriting. For each business private domain corresponding to the question type, the training sample is labeled, that is, the training sample is rewritten into prompt information that conforms to the business knowledge of the business private domain, and the rewritten prompt information is used as a label.

[0116] The training sample is input into the large language model to obtain the rewritten prompt information output by the large language model. According to the rewritten prompt information output by the large language model and the label of the training sample, a loss function is constructed, and the large language model is updated using the loss function until a prompt rewriting model that meets the requirements is obtained.

[0117] The trained prompt rewriting model can realize the prompt rewriting function for the first prompt text. In the specific application process, a prompt template can be designed to generate prompt information for inputting the prompt rewriting model according to the first prompt text, thereby guiding the prompt rewriting model to rewrite the first prompt text to obtain the second prompt text. The following schematically shows a prompt template for rewriting the first prompt text with the problem type of encountering some difficulties into a specific business problem. The content of the prompt template is as follows:

[0118] Analysis difficulty prompt example:

[0119] Analyze the difficulties encountered by users

[0120] <Mission>

[0121] You are an expert in analyzing users' questions about a certain service at China Mobile. Your task is to answer the questions based on the given questions and the existing information.

[0122] <User Input>

[0123] ({keyword}

[0124] <Category entered by user>

[0125] 1. The reason why something happened

[0126] 2. Encountered a difficulty

[0127] 3. Name of a business

[0128] 4. Small talk (does not fit into any of the above categories)

[0129] <Analysis of user input>

[0130] {analysis}

[0131] <command>

[0132] Based on the analysis of the user's input, what business did the user encounter difficulties in? Just answer with the formal name of the business, retain the user's target amount (if any), and do not include any prefixes or suffixes. If the user's language is not industry jargon, formalize it before answering, and the answer cannot be colloquial.

[0133] The business related to the difficulties encountered by users is:

[0134] In this prompt template, by filling in the task information (analyzing the difficulties encountered by the user), role-playing information (as an expert of China Mobile analyzing the user's questions about a certain service), the first prompt text (user input), the question type, and the analysis instructions, the prompt rewriting model is guided to rewrite the first prompt text into the second prompt text related to the specific service.

[0135] S106: Retrieve relevant information from the information source based on the second prompt text.

[0136] The principle of the information retrieval stage is: for abstract questions , from a knowledge base or information source Retrieve relevant information from .set up represents an information retrieval operation, then:

[0137] .

[0138] The above-mentioned knowledge base or information source can be selected according to needs, and this embodiment does not limit this.

[0139] S108: enhancing the first prompt text by using relevant information to generate response information of the first prompt text.

[0140] In this step, the retrieved information is used , for the original question Make inferences and get the final answer .set up represents the inference operation, then we have:

[0141] .

[0142] Combining the above steps, the overall process of the above-mentioned step-back prompt strategy can be expressed as:

[0143] ;

[0144] in, is the original question. is an abstract operation used to convert the original problem Transformed into an abstract problem . is an information retrieval operation, from the knowledge base Search and abstraction issues Related Information . is an inference operation, using information To the original question Make inferences and get the final answer .

[0145] Corresponding to the above-mentioned search enhancement generation method based on intent recognition, this embodiment also provides a search enhancement generation system based on intent recognition, which is used to implement the above-mentioned search enhancement generation method based on intent recognition. Figure 2 As shown, including:

[0146] The first data acquisition module 201 is configured to acquire a first prompt text input by a user.

[0147] The intention recognition module 202 is configured to use the thinking chain of the large language model to perform chain reasoning based on intention recognition on the first prompt text to determine the question type of the first prompt text.

[0148] The prompt rewriting module 203 is configured to select a corresponding prompt rewriting model according to the question type of the first prompt text, and use the prompt rewriting model to adopt a step-back prompt strategy to abstract the first prompt text into a more general second prompt text pointing to a preset business type.

[0149] The search enhancement module 204 is configured to search for relevant information in the information source based on the second prompt text; and enhance the first prompt text using the relevant information to generate response information of the first prompt text.

[0150] Optionally, the above-mentioned intention recognition module is specifically used for:

[0151] Construct prompts based on pre-set role tasks and pre-built question types;

[0152] Decompose the first prompt text into several sub-questions with a logical order;

[0153] According to the logical order of several sub-problems, several sub-problems are reasoned step by step, and in the reasoning process of each step, enhanced retrieval is performed based on the reasoning result of the previous step and the current sub-problem, and the reasoning result of the current step is obtained based on the retrieval result, prompt information, the reasoning result of the previous step and the current sub-problem;

[0154] Integrate the reasoning results of several sub-problems to obtain the overall reasoning result;

[0155] The question type corresponding to the first prompt text is determined according to the overall reasoning result.

[0156] Optionally, the above-mentioned retrieval enhancement generation system based on intent recognition may also include a pre-training module, which is configured to pre-train a prompt rewriting model corresponding to the question type for each preset question type and the business type corresponding to the question type.

[0157] For the above-mentioned retrieval enhancement generation system based on intent recognition, taking a module as an example of a software functional unit, the first data acquisition module 201 may include code running on a computing instance. Among them, the computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Further, the above-mentioned computing instance may be one or more. For example, the first data acquisition module 201 may include code running on multiple hosts / virtual machines / containers. The multiple hosts / virtual machines / containers used to run the code may be distributed in the same region (region) or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including a data center or multiple data centers with close geographical locations. Among them, usually a region may include multiple AZs.

[0158] Similarly, multiple hosts / virtual machines / containers used to run the code can be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Usually, a VPC is set up in a region. For cross-region communication between two VPCs in the same region and between VPCs in different regions, a communication gateway needs to be set up in each VPC to achieve interconnection between VPCs through the communication gateway.

[0159] As an example of a hardware functional unit, the first data acquisition module 201 may include at least one computing device, such as a server, etc. Alternatively, the first data acquisition module 201 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.

[0160] The multiple computing devices included in the first data acquisition module 201 can be distributed in the same region or in different regions. The multiple computing devices included in the first data acquisition module 201 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the first data acquisition module 201 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.

[0161] In other embodiments, the first data acquisition module 201 can be used to execute any step in the above-mentioned retrieval enhancement generation method based on intent recognition, the intent recognition module 202 can be used to execute any step in the above-mentioned retrieval enhancement generation method based on intent recognition, the prompt rewriting module 203 can be used to execute any step in the above-mentioned retrieval enhancement generation method based on intent recognition, and the retrieval enhancement module 204 can be used to execute any step in the above-mentioned retrieval enhancement generation method based on intent recognition. The steps that the first data acquisition module 201, the intent recognition module 202, the prompt rewriting module 203 and the retrieval enhancement module 204 are responsible for implementing can be specified as needed, and the first data acquisition module 201, the intent recognition module 202, the prompt rewriting module 203 and the retrieval enhancement module 204 respectively implement different steps in the above-mentioned retrieval enhancement generation method based on intent recognition to realize all the functions of the above-mentioned retrieval enhancement generation system based on intent recognition.

[0162] In this implementation, the retrieval enhancement generation system based on intent recognition can also be applied to computing devices such as computers and servers, or to a computing device cluster including at least one computing device, to implement the retrieval enhancement generation function based on intent recognition.

[0163] Corresponding to the above-mentioned retrieval enhancement generation method based on intent recognition, this embodiment also provides a question-answering method, please refer to Figure 3 , the method comprises steps S300 to S302:

[0164] S300: Obtain a target question.

[0165] S302: Perform retrieval enhancement generation on the target question using a retrieval enhancement generation method based on intent recognition to obtain an answer to the target question.

[0166] It can be seen from the above-mentioned question-answering method that the above-mentioned retrieval enhancement generation method based on intent recognition can be applied to question-answering business scenarios, for example, as a customer service agent to answer questions input by users.

[0167] Corresponding to the above-mentioned question-answering method, this embodiment also provides a question-answering system. Figure 4 , the question-answering system includes:

[0168] The second data acquisition module 401 is configured to acquire a target question.

[0169] The answer generation module 402 is configured to perform retrieval enhancement generation on the target question using a retrieval enhancement generation method based on intent recognition to obtain an answer to the target question.

[0170] For the above-mentioned question-and-answer system, taking a module as an example of a software functional unit, the second data acquisition module 401 may include code running on a computing instance. Among them, the computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Further, the above-mentioned computing instance may be one or more. For example, the second data acquisition module 401 may include code running on multiple hosts / virtual machines / containers. The multiple hosts / virtual machines / containers used to run the code may be distributed in the same region (region) or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including one data center or multiple data centers with close geographical locations. Among them, usually a region may include multiple AZs.

[0171] Similarly, multiple hosts / virtual machines / containers used to run the code can be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Usually, a VPC is set up in a region. For cross-region communication between two VPCs in the same region and between VPCs in different regions, a communication gateway needs to be set up in each VPC to achieve interconnection between VPCs through the communication gateway.

[0172] As an example of a hardware functional unit, the second data acquisition module 401 may include at least one computing device, such as a server, etc. Alternatively, the second data acquisition module 401 may also be a device implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.

[0173] The multiple computing devices included in the second data acquisition module 401 can be distributed in the same region or in different regions. The multiple computing devices included in the second data acquisition module 401 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the second data acquisition module 401 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.

[0174] In other embodiments, the second data acquisition module 401 can be used to execute any step in the above-mentioned question-answering method, and the answer generation module 402 can be used to execute any step in the above-mentioned question-answering method. The steps that the second data acquisition module 401 and the answer generation module 402 are responsible for implementing can be specified as needed, and the second data acquisition module 401 and the answer generation module 402 respectively implement different steps in the above-mentioned question-answering method to implement all the functions of the above-mentioned question-answering system.

[0175] In this implementation, the question-and-answer system can also be applied to computing devices such as computers and servers, or to a computing device cluster including at least one computing device, to implement the question-and-answer function.

[0176] Corresponding to the above method, this embodiment also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, it implements the above-mentioned retrieval enhancement generation method based on intent recognition, or executes the above-mentioned question and answer method.

[0177] In a typical configuration, a computer includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0178] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0179] Computer readable media include permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, modules of programs or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0180] Corresponding to the above method, this embodiment also provides an electronic device, including: one or more processors; and a memory associated with the one or more processors, the memory being used to store program instructions, and when the program instructions are read and executed by the one or more processors, executing the specific steps of the above-mentioned intent recognition-based retrieval enhancement generation method, or executing the specific steps of the above-mentioned question and answer method.

[0181] At the hardware level, the electronic device includes a processor, a computer-readable storage medium, a memory, a data interface, a network interface, and of course may also include hardware required for other services. One or more embodiments of this specification can be implemented based on software, such as a processor reading a corresponding computer program from a computer-readable storage medium into a memory and then running it. Of course, in addition to software implementation, one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the above processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0182] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0183] The above-mentioned embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.

Claims

1. A retrieval enhancement generation method based on intent recognition, characterized in that: include: Get the first prompt text entered by the user; Using the thinking chain of the large language model to perform chain reasoning based on intent recognition on the first prompt text to determine the question type of the first prompt text; According to the question type of the first prompt text, a corresponding prompt rewriting model is selected, and the prompt rewriting model is used to adopt a step-back prompt strategy to abstract the first prompt text into a more general second prompt text pointing to a preset business type; the prompt rewriting model corresponding to each question type is trained for the question type and the business type corresponding to the question type; Retrieving relevant information from an information source based on the second prompt text; The first prompt text is enhanced using the relevant information to generate response information of the first prompt text.

2. The method according to claim 1, characterized in that: The first prompt text is subjected to chain reasoning based on intent recognition using the thinking chain of the large language model to determine the question type of the first prompt text, specifically including: Construct prompts based on pre-set role tasks and pre-built question types; Decomposing the first prompt text into a plurality of sub-questions in a logical order; According to the logical order of the plurality of sub-problems, the plurality of sub-problems are reasoned step by step, and in the reasoning process of each step, an enhanced search is performed based on the reasoning result of the previous step and the current sub-problem, and the reasoning result of the current step is obtained based on the search result, the prompt information, the reasoning result of the previous step and the current sub-problem; Integrate the reasoning results of the several sub-problems to obtain an overall reasoning result; The question type corresponding to the first prompt text is determined according to the overall reasoning result.

3. A question-answering method, characterized in that: include: Get the target question; The method described in any one of claims 1 to 2 is used to perform retrieval enhancement generation on the target question to obtain an answer to the target question.

4. A retrieval enhancement generation system based on intent recognition, characterized in that: include: A first data acquisition module is configured to acquire a first prompt text input by a user; an intention recognition module, configured to use a thinking chain of a large language model to perform chain reasoning based on intention recognition on the first prompt text to determine a question type of the first prompt text; The prompt rewriting module is configured to select a corresponding prompt rewriting model according to the question type of the first prompt text, and use the prompt rewriting model to adopt a step-back prompt strategy to abstract the first prompt text into a more general second prompt text pointing to a preset business type; the prompt rewriting model corresponding to each question type is trained for the question type and the business type corresponding to the question type; A search enhancement module, configured to search for relevant information in an information source based on the second prompt text; The first prompt text is enhanced using the relevant information to generate response information of the first prompt text.

5. The system according to claim 4, characterized in that The intention recognition module is specifically used for: Construct prompts based on pre-set role tasks and pre-built question types; Decomposing the first prompt text into a plurality of sub-questions in a logical order; According to the logical order of the plurality of sub-problems, the plurality of sub-problems are reasoned step by step, and in the reasoning process of each step, an enhanced search is performed based on the reasoning result of the previous step and the current sub-problem, and the reasoning result of the current step is obtained based on the search result, the prompt information, the reasoning result of the previous step and the current sub-problem; Integrate the reasoning results of the several sub-problems to obtain an overall reasoning result; The question type corresponding to the first prompt text is determined according to the overall reasoning result.

6. The system according to claim 4, characterized in that The system further includes a pre-training module, which is configured to pre-train a prompt rewriting model corresponding to each preset question type and the business type corresponding to the question type.

7. A question-answering system, characterized in that: include: A second data acquisition module is configured to acquire a target question; The answer generation module is configured to use the method described in any one of claims 1 to 2 to perform retrieval enhancement generation on the target question to obtain an answer to the target question.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program runs on an electronic device, the electronic device executes the method according to any one of claims 1 to 2, or executes the method according to claim 3.

9. An electronic device, comprising: at least one memory for storing a program; At least one processor is used to execute the program stored in the memory. When the program stored in the memory is executed, the processor is used to execute the method according to any one of claims 1 to 2, or execute the method according to claim 3.

Citation Information

Patent Citations

  • Knowledge question and answer method, device and equipment and storage medium

    CN116561278A

  • Text intention recognition method and related equipment

    CN118861278A