Question and answer retrieval method and device, storage medium and terminal

By combining large language models and external knowledge bases, using a hybrid search process to identify Q&A intentions and select adaptive search solutions, the problem of poor retrieval results of generative large models in vertical field Q&A scenarios is solved, and efficient and accurate information positioning and user experience improvement are achieved.

CN120353920APending Publication Date: 2025-07-22ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202510495015.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-18
Publication Date
2025-07-22

AI Technical Summary

Technical Problem

The existing generative large models have professional depth limitations in professional Q&A scenarios in vertical fields. The traditional search method based on single vector similarity is difficult to meet the knowledge service needs in complex scenarios, resulting in poor retrieval results.

Method used

By introducing RAG technology, a large language model is combined with an external knowledge base, an intent recognition prompt word is generated to identify the target intent category of the question-and-answer request, and an adaptive target search scheme is selected from multiple search schemes. A hybrid search process is adopted, including character search, pinyin search and vector search, etc., to ensure that the search results match the user's intention.

Benefits of technology

It improves the accuracy and efficiency of Q&A search, improves the user experience, and can efficiently locate the information required by users, and meets the complex scenario needs of different Q&A intentions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120353920A_ABST
    Figure CN120353920A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a question and answer retrieval method and device, a storage medium and a terminal. Receiving input data corresponding to the question and answer request, and generating an intention recognition cue word according to the input data; inputting the intention recognition cue word into a large language model, and controlling the large language model to recognize a target intention category corresponding to the question and answer request based on the intention recognition cue word; and determining a target retrieval scheme corresponding to the target intention category from the at least one retrieval scheme, performing retrieval on the input data according to the target retrieval scheme to obtain a corresponding retrieval result, and outputting the retrieval result as answer content corresponding to the question and answer request. During query, prompt words are generated for input data and input into the large language model, and the large language model identifies a target intention category implied in the input data. And after the intention category of the query is identified, a matched retrieval scheme is determined according to the information, and after retrieval is executed according to the determined retrieval scheme, a retrieval result conforming to the query intention of the user is obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this specification relate to the field of computer technology, and particularly to a question-and-answer retrieval method, device, storage medium, and terminal. Background Art

[0002] Currently, generative large models have shown amazing capabilities in the field of general knowledge Q&A. However, in professional Q&A scenarios in vertical fields, their limitations in professional depth are becoming increasingly apparent. Therefore, by introducing the Retrieval-Augmented Generation (RAG) technology, combining an external knowledge base with a generative model provides an effective way to improve the Q&A effect of large models. However, in practical applications, we found that knowledge Q&A in different fields and with different Q&A intentions poses different requirements for the retrieval system, and the traditional retrieval method based on single vector similarity is difficult to meet the knowledge service requirements in complex scenarios. Summary of the Invention

[0003] The embodiments of this specification provide a question-and-answer retrieval method, device, storage medium, and terminal, which can solve the technical problem of poor retrieval effect in related technologies.

[0004] In a first aspect, the embodiments of this specification provide a question-and-answer retrieval method, which includes:

[0005] Receiving input data corresponding to a question-and-answer request, and generating an intention recognition prompt word according to the input data;

[0006] Inputting the intention recognition prompt word into a large language model, and controlling the large language model to identify the target intention category corresponding to the question-and-answer request based on the intention recognition prompt word;

[0007] Determining a target retrieval scheme corresponding to the target intention category from at least one retrieval scheme, performing a retrieval on the input data according to the target retrieval scheme to obtain a corresponding retrieval result, and outputting the retrieval result as the answer content corresponding to the question-and-answer request.

[0008] In a possible implementation manner, generating the intention recognition prompt word according to the input data includes: adding the input data to a preset prompt word template to generate an intention recognition prompt word, where the preset prompt word template is used to specify at least two preset intention categories that the large language model can output; controlling the large language model to identify the target intention category corresponding to the question-and-answer request based on the intention recognition prompt word includes: controlling the large language model to identify the input data in the intention recognition prompt word and output the target intention category to which the input data belongs in the at least two preset intention categories.

[0009] In a possible implementation, after controlling the large language model to identify the target intent category corresponding to the Q&A request based on the above-mentioned intent recognition prompt words, the following steps are further included: generating a content parsing prompt word according to the above input data; inputting the content parsing prompt word into the large language model, and controlling the large language model to extract at least one key data from the above input data based on the content parsing prompt word and output each key data in a preset format.

[0010] In a possible implementation, the performing a retrieval on the above input data according to the above target retrieval scheme to obtain a corresponding retrieval result includes: constructing a knowledge Q&A prompt word corresponding to the above input data according to the above target retrieval scheme; inputting the knowledge Q&A prompt word into the large language model, and controlling the large language model to perform a retrieval in a preset knowledge base based on the content parsing prompt word to obtain a corresponding retrieval result.

[0011] In a possible implementation, the above retrieval scheme is at least used to specify the construction operation of the knowledge Q&A prompt word corresponding to its own intent category; the construction operation includes at least one of question rewriting, context information extraction, and historical dialogue data extraction.

[0012] In a possible implementation, the performing a retrieval on the above input data according to the above target retrieval scheme to obtain a corresponding retrieval result includes: performing a hybrid retrieval process on the above input data according to the above target retrieval scheme to obtain a corresponding retrieval result; at least two retrieval strategies are included in the hybrid retrieval process.

[0013] In a possible implementation, when the above retrieval result is a Chinese identifier, the performing a hybrid retrieval process on the above input data according to the above target retrieval scheme to obtain a corresponding retrieval result and outputting the retrieval result as the answer content corresponding to the Q&A request includes: performing a Chinese character retrieval on the above input data according to the above target retrieval scheme; if a Chinese character retrieval result is obtained, outputting the Chinese character retrieval result as the answer content corresponding to the Q&A request, if the Chinese character retrieval result is not obtained, performing a pinyin retrieval query on the above input data; if a pinyin retrieval result is obtained, outputting the pinyin retrieval result as the answer content corresponding to the Q&A request, if the pinyin retrieval result is not obtained, performing a vector retrieval query on the above input data; if a vector retrieval result is obtained, outputting the vector retrieval result as the answer content corresponding to the Q&A request, if the vector retrieval result is not obtained, outputting a query failure result.

[0014] In one possible implementation, the above method further includes: obtaining the original data to be summarized, and connecting the original data to the inductive summary prompt; inputting the inductive summary prompt into the large language model, controlling the large language model to perform inductive summary on the original data based on the inductive summary prompt and outputting inductive knowledge data; performing vector representation on the inductive knowledge data and storing it in a preset knowledge base.

[0015] In one possible implementation, the above question-and-answer request is triggered when the user actively inputs a question or is automatically triggered by the system based on the currently monitored status.

[0016] In a second aspect, an embodiment of this specification provides a question-and-answer retrieval device, which includes:

[0017] An input receiving module, configured to receive input data corresponding to a question-and-answer request, and generate an intention recognition prompt according to the input data;

[0018] An intention recognition module, configured to input the intention recognition prompt into a large language model, and control the large language model to recognize the target intention category corresponding to the question-and-answer request based on the intention recognition prompt;

[0019] An answer output module, configured to determine a target retrieval scheme corresponding to the target intention category from at least one retrieval scheme, perform retrieval on the input data according to the target retrieval scheme to obtain a corresponding retrieval result, and output the retrieval result as the answer content corresponding to the question-and-answer request.

[0020] In a third aspect, an embodiment of this specification provides a computer program product containing instructions. When the computer program product runs on a computer or a processor, the computer or the processor is enabled to execute the steps of the above method.

[0021] In a fourth aspect, an embodiment of this specification provides a computer storage medium. The computer storage medium stores multiple instructions, and the instructions are suitable for being loaded and executed by a processor to execute the steps of the above method.

[0022] In a fifth aspect, an embodiment of this specification provides a terminal, including a memory, a processor, and a computer program stored on the memory and executable on the processor. The computer program is suitable for being loaded and executed by the processor to execute the steps of the above method.

[0023] The beneficial effects brought by the technical solutions provided by some embodiments of this specification at least include:

[0024] The embodiment of this specification provides a question-answering retrieval method, receiving input data corresponding to a question-answering request, generating an intent recognition prompt word according to the input data; inputting the intent recognition prompt word into a large language model, controlling the large language model to recognize the target intent category corresponding to the question-answering request based on the intent recognition prompt word; determining a target retrieval scheme corresponding to the target intent category from at least one retrieval scheme, and performing a search on the input data according to the target retrieval scheme to obtain the corresponding retrieval result, and outputting the retrieval result as the answer content corresponding to the question-answering request. In the process of processing user queries, prompt words for the input data are first generated, and then the prompt words are input into a preset large language model. The large language model, with its natural language processing capabilities and deep learning algorithms, efficiently analyzes and identifies the target intent category implied in the input data, and realizes deep mining and precise positioning of user intent. Different query intent categories often correspond to different answer content requirements. Therefore, after identifying the intent category of this query, a matching retrieval scheme is further determined based on this information to ensure that the retrieval process can efficiently and accurately locate the information required by the user. After performing the retrieval according to the determined retrieval scheme, a retrieval result that meets the user's query intent can be obtained. Through such a processing flow, not only the accuracy and efficiency of query retrieval can be improved, but also the user experience can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.

[0026] Figure 1 An exemplary system architecture diagram of a question-answer retrieval method provided in an embodiment of this specification;

[0027] Figure 2 A flowchart of a question-answer retrieval method provided in an embodiment of this specification;

[0028] Figure 3 A flowchart of a question-answer retrieval method provided in an embodiment of this specification;

[0029] Figure 4 A logical flow chart of a question-answer retrieval method provided in an embodiment of this specification;

[0030] Figure 5 A structural block diagram of a question-answer retrieval device provided in an embodiment of this specification;

[0031] Figure 6A schematic structural diagram of a terminal provided by an embodiment of this specification. Detailed implementation manners

[0032] To make the features and advantages of the embodiments of this specification more obvious and understandable, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings in the embodiments of this specification. Obviously, the described embodiments are only some of the embodiments of this specification, rather than all embodiments. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative efforts fall within the protection scope of the embodiments of this specification.

[0033] When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the embodiments of this specification. On the contrary, they are merely examples of devices and methods consistent with some aspects of the embodiments of this specification as detailed in the appended claims. And in the description of the embodiments of this specification, unless otherwise stated, " / " means "or". For example, A / B may represent A or B. The "and / or" in the text is merely a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of this specification, "a plurality" means two or more than two.

[0034] Hereinafter, the terms "first" and "second" are only used for descriptive purposes and cannot be understood as implying or suggesting relative importance or implicitly indicating the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features.

[0035] In the application scenario of large-scale knowledge Q&A, especially when the question involves professional knowledge in a specific field, the retrieval augmented generation (RAG) technology is generally adopted to address this challenge currently. The core of the RAG technology lies in the ability to combine the generation model with the retrieval mechanism, so as to provide more accurate and detailed answers when facing complex or highly professional Q&A requests. Generally, the operation process of the RAG technology is as follows: First, the vector retrieval technology is used to quickly locate the documents or paragraphs related to the question in a huge knowledge base, and then the retrieved content is used as the prompt words or context information of the generation model to guide the model to generate the final answer.

[0036] However, in the process of actual application, different question-and-answer intents often have very different requirements for retrieval results. For example, in fact-checking question-and-answer, it is required that the retrieval system can quickly lock in and return the most accurate data or factual statements, and the retrieval results should have accurate source tracing and authority verification (such as medical diagnosis, legal provisions); in comprehensive analysis question-and-answer, cross-document association reasoning ability is required (such as cross-analysis of market data in financial investment decisions); in operation guidance question-and-answer, the integrity of steps and temporal logic need to be emphasized (such as the processing flow steps in case of network anomalies). Based on this phenomenon, it can be seen that there are certain limitations in simply relying on vector retrieval technology to meet the needs of all types of question-and-answer. Although vector retrieval is efficient and can capture semantic similarity to a certain extent, it is difficult to comprehensively understand the deep intention of the question and cannot fully consider the context dependence and diversity in the question-and-answer scenario.

[0037] Therefore, an embodiment of this specification provides a question-and-answer retrieval method to solve the above technical problem of poor retrieval effect.

[0038] Please refer to Figure 1 , Figure 1 which is an exemplary system architecture diagram of a question-and-answer retrieval method provided by an embodiment of this specification.

[0039] As Figure 1 shown, the system architecture may include a terminal 101, a network 102, and a server 103. The network 102 is used to provide a medium for a communication link between the terminal 101 and the server 103. The network 102 may include various types of wired communication links or wireless communication links. For example, the wired communication links include optical fibers, twisted pairs, or coaxial cables, and the wireless communication links include Bluetooth communication links, Wireless-Fidelity (Wi-Fi) communication links, or microwave communication links, etc.

[0040] The terminal 101 can interact with the server 103 through the network 102 to receive messages from the server 103 or send messages to the server 103. Alternatively, the terminal 101 can interact with the server 103 through the network 102, and then receive messages or data sent by other users to the server 103. The terminal 101 can be hardware or software. When the terminal 101 is hardware, it can be various electronic devices, including but not limited to smart watches, smart phones, tablet computers, laptop portable computers, and desktop computers, etc. When the terminal 101 is software, it can be installed in the above-listed electronic devices, which can be implemented as multiple software or software modules (for example, used to provide distributed services), or can be implemented as a single software or software module, and no specific limitation is made here.

[0041] In the embodiments of this specification, the terminal 101 first receives the input data corresponding to the question-and-answer request, and generates an intention recognition prompt word according to the input data; then, the terminal 101 inputs the intention recognition prompt word into the large language model, and controls the large language model to recognize the target intention category corresponding to the question-and-answer request based on the intention recognition prompt word; further, the terminal 101 determines the target retrieval scheme corresponding to the target intention category from at least one retrieval scheme, performs a retrieval on the input data according to the target retrieval scheme to obtain the corresponding retrieval result, and outputs the retrieval result as the answer content corresponding to the question-and-answer request.

[0042] The server 103 can be a business server that provides various services. It should be noted that the server 103 can be hardware or software. When the server 103 is hardware, it can be implemented as a distributed server cluster composed of multiple servers, or as a single server. When the server 103 is software, it can be implemented as multiple software or software modules (for example, used to provide distributed services), or as a single software or software module, which is not specifically limited here.

[0043] Alternatively, the system architecture may not include the server 103. In other words, the server 103 can be an optional device in the embodiments of this specification. That is, the method provided in the embodiments of this specification can be applied to a system structure that only includes the terminal 101, and this specification does not limit this.

[0044] It should be understood that Figure 1 the numbers of terminals, networks, and servers in

[0045] Please refer to Figure 2 Figure 2 which is a schematic flowchart of a question-and-answer retrieval method provided by the embodiments of this specification. The execution subject of the embodiments of this specification can be the terminal that executes the question-and-answer retrieval, or the processor in the terminal that executes the question-and-answer retrieval method, or the question-and-answer retrieval service in the terminal that executes the question-and-answer retrieval method. For the convenience of description, the following takes the execution subject as the processor in the terminal as an example to introduce the specific execution process of the question-and-answer retrieval method.

[0046] As Figure 2 shown, the question-and-answer retrieval method can at least include:

[0047] S202. Receive the input data corresponding to the question-and-answer request, and generate an intention recognition prompt word according to the input data.

[0048] Optionally, in traditional query methods such as retrieving through a search engine or retrieving by actively looking up tables, users need to adjust the input question statements by themselves and select the target data they need from a large amount of data. To improve the retrieval efficiency, large language models and chatbots have been widely used in the retrieval process to achieve retrieval through conversations and responses. For example, in the emergency troubleshooting scenario of application problems, when technicians are troubleshooting applications with problems on the platform, they can trigger a question-and-answer request by asking questions related to the application to be troubleshot to the chatbot. The chatbot will receive the question data input by the question-and-answer initiator in the question-and-answer request, retrieve in the knowledge base according to the input data, and thus provide the retrieval result data corresponding to the application to be troubleshot to the conversation initiator in the output answer content.

[0049] Optionally, during the question-and-answer process, different question-and-answer intents often have very different requirements for retrieval results. The core of the current vector retrieval method is to perform similarity matching between the vector representation of the input data and the vector representations of each data in the knowledge base. Therefore, if solely relying on vector retrieval technology, it will lead to ignoring the deep intent of the question during retrieval and outputting homogeneous answer content for questions with different intents but the same words and sentences. Based on this, in the embodiments of this specification, the intent of the input data is recognized, and an adaptive retrieval scheme is adopted for different question-and-answer intents, so as to control the output of answer content that conforms to the question-and-answer intent and improve the efficiency of retrieval question-and-answer and the user's retrieval question-and-answer experience.

[0050] Specifically, the question-and-answer request can be triggered when the user actively inputs a question, or can also be automatically triggered by the system based on the currently monitored state. Then the terminal will first receive the question-and-answer request from the user or the system, and capture and parse the input data corresponding to these requests. The form of the input data can be diverse, which may include text strings, the text transcribed from voice signals, or the text obtained by converting images through OCR (Optical Character Recognition) technology, etc. Next, it is necessary to recognize the question-and-answer intent of the input data. When recognizing the question-and-answer intent, it can be achieved through a large language model (such as Tongyi Qianwen, etc.). Based on its superior natural language processing ability and deep learning algorithm, the large language model can deeply analyze and understand the intent information hidden in the input data, and the user can also provide prompt words to the large language model to standardize the output format of the large model. Then in the embodiments of this specification, intent recognition prompt words are generated according to the input data in the question-and-answer request. These prompt words are intended to explain to the large model the intent recognition task to be performed this time, as well as the object of this intent recognition task - the input data, providing accurate guidance for subsequent intent recognition.

[0051] S204. Input the intention recognition prompt words into the large language model, and control the large language model to recognize the target intention category corresponding to the question and answer request based on the intention recognition prompt words.

[0052] Optionally, subsequently input the generated intention recognition prompt words into the pre-trained large language model. The large language model can deeply analyze and recognize the specific target intention category corresponding to the question and answer request according to these prompt words. This process involves complex semantic matching, context reasoning, and pattern recognition technologies to ensure the accuracy and robustness of intention recognition. It should be noted that the target intention category output by the large language model will not be output to the user as the answer content of the dialogue robot, but will only be used by the large language model and the dialogue robot in the retrieval process to determine the corresponding target retrieval scheme.

[0053] S206. Determine the target retrieval scheme corresponding to the target intention category from at least one retrieval scheme, perform a retrieval on the input data according to the target retrieval scheme to obtain the corresponding retrieval result, and output the retrieval result as the answer content corresponding to the question and answer request.

[0054] Optionally, after identifying the target intention category, it is possible to further intelligently select the most suitable target retrieval scheme from a preset number of retrieval schemes according to the characteristics and requirements of the target intention category. These retrieval schemes include but are not limited to information indicating query means, query data sources, etc. The matching process of the retrieval schemes will consider factors such as retrieval efficiency, accuracy, and user experience to ensure a high degree of matching between the retrieval results obtained based on the retrieval scheme and the target intention category. Finally, according to the selected target retrieval scheme, perform a specific retrieval operation on the input data to retrieve information closely related to the input data from the massive data in the knowledge base. The retrieval result may be a series of documents, IDs, web links, log records, or directly generated answer texts. After obtaining the retrieval result, it may be necessary to adaptively organize and optimize the retrieval result to make it conform to the natural language law, and then output it to the user as the answer content corresponding to the question and answer request, thus completing the entire question and answer process. In this way, the system can efficiently and accurately respond to the user's query needs and provide valuable information and services.

[0055] Specifically, when performing retrieval, it can also be achieved through a large language model. The large language model can quickly and efficiently retrieve information related to the question-and-answer request from the prepared data sources (such as databases, knowledge bases, the Internet, etc.). During retrieval, the retrieval results are screened and sorted according to indicators such as the relevance, timeliness, and similarity between the input data and the retrieved data, and a large amount of irrelevant information is automatically filtered out. On the other hand, for complex questions, multiple retrieval results may be combined to generate a comprehensive answer, or provide further explanations and supplementary information. Finally, the large language model will convert the optimized retrieval results into user-friendly answer content and output it in an appropriate form.

[0056] Optionally, there can be multiple output forms for the answer content, including but not limited to directly generating a concise and clear text answer to meet the user's query needs. For example, "To fix the problem of a white screen on the web page, you can try the following steps: 1. Restart the application; 2. Check the hardware connection; 3. Update the application version."; or presenting the information in a structured form, such as presenting the retrieval results in the form of lists, tables, charts, etc., to facilitate the user to quickly obtain key information; it can also combine multiple forms such as text, pictures, and videos to display information through multimodal content and provide richer answer content. Through the above process, by leveraging the powerful semantic understanding ability of the large language model, it can accurately identify the user's intention, avoid the limitations of traditional direct vector retrieval; dynamically adjust the retrieval strategy according to different intention categories to ensure that the retrieval results are more in line with the user's needs; and help the user quickly obtain the required information through optimizing the retrieval process and result output, achieving a more intelligent interaction experience.

[0057] In an embodiment of the present specification, a question-answering retrieval method is provided, which receives input data corresponding to a question-answering request, generates an intent recognition prompt word according to the input data; inputs the intent recognition prompt word into a large language model, and controls the large language model to recognize the target intent category corresponding to the question-answering request based on the intent recognition prompt word; determines a target retrieval scheme corresponding to the target intent category from at least one retrieval scheme, and performs a search on the input data according to the target retrieval scheme to obtain the corresponding retrieval result, and outputs the retrieval result as the answer content corresponding to the question-answering request. In the process of processing user queries, prompt words for the input data are first generated, and then the prompt words are input into a preset large language model. The large language model, with its natural language processing capabilities and deep learning algorithms, efficiently analyzes and identifies the target intent category implied in the input data, and realizes deep mining and precise positioning of user intent. Different query intent categories often correspond to different answer content requirements. Therefore, after identifying the intent category of this query, a matching retrieval scheme is further determined based on this information to ensure that the retrieval process can efficiently and accurately locate the information required by the user. After performing the retrieval according to the determined retrieval scheme, a retrieval result that meets the user's query intent can be obtained. Through such a processing flow, not only the accuracy and efficiency of query retrieval can be improved, but also the user experience can be enhanced.

[0058] See also Figure 3 , Figure 3 A flowchart of a question-and-answer retrieval method provided in an embodiment of this specification.

[0059] like Figure 3 As shown, the question-answer retrieval method may at least include:

[0060] S302: Receive input data corresponding to the question and answer request, add the input data to a preset prompt word template, and generate an intent recognition prompt word. The preset prompt word template is used to specify at least two preset intent categories that can be output by the large language model.

[0061] In an embodiment of the present specification, when a user needs to conduct a retrieval question and answer or the system automatically triggers the retrieval question and answer process, the dialogue robot receives input data corresponding to the question and answer request, and generates intent recognition prompt words based on the input data to instruct the large language model to identify the intent category implied by the input data based on the intent recognition prompt words.

[0062] Specifically, see Figure 4 , Figure 4It is a logic flowchart of a question-and-answer retrieval method provided by an embodiment of this specification. For the input data corresponding to a question-and-answer request, a template of intention recognition prompt words can be preset. The preset prompt word template stipulates at least two preset intention categories that the large language model needs to classify, so as to inform the role that the large language model needs to play and the tasks that need to be completed. For example, "Please act as an expert in the monitoring field. Based on the query content input in the question, identify the intention of this query and classify this question into the following preset intention categories. The output only needs to answer the target intention category it belongs to; Preset Intention Categories 1. Ask about reasons or solutions; 2. Ask about the person in charge (BD); 3. State content; 4. Log analysis; 5. Uid query; 6. APPid query; 7. Ask about other content. The content to be classified is: "(input data)". In this way, the large language model can analyze the semantic relationships of each word in the input data through its pre-trained knowledge base and context understanding ability, infer the potential intention of the user, and classify the input data into the predefined intention categories.

[0063] S304. Input the intention recognition prompt words into the large language model, control the large language model to recognize the input data in the intention recognition prompt words, and output the target intention category to which the input data belongs in at least two preset intention categories.

[0064] Optionally, please continue to refer to Figure 4 , after assembling the intention recognition prompt words, the intention recognition prompt words can be input into the large language model, so as to control the large language model to recognize the input data in the intention recognition prompt words, and output the target intention category to which the input data belongs in at least two preset intention categories. Finally, the large language model will directly output the target intention category to which the input data belongs for subsequent matching and retrieval schemes.

[0065] S306. Generate content parsing prompt words according to the input data; input the content parsing prompt words into the large language model, and control the large language model to extract at least one key data from the input data based on the content parsing prompt words and output each key data in a preset format.

[0066] Optionally, for the convenience of the large language model's retrieval, after outputting the target intention category, content parsing prompt words can be further generated according to the input data, so that the large language model can convert the input data into a data format (such as JSON format) that is convenient for the computer to run and calculate, facilitating subsequent retrieval calculations. Specifically, please continue to refer to Figure 4, it is still possible to directly add the input data to be parsed to the preset content parsing prompt template in the form of a prompt template to obtain the content parsing prompt. The content parsing prompt is input into the large language model to control the large language model to extract at least one key data from the input data based on the content parsing prompt and output each key data in a preset format.

[0067] S308. Determine the target retrieval scheme corresponding to the target intent category from at least one retrieval scheme.

[0068] Optionally, after parsing and formatting the content of the input data, the target retrieval scheme can be determined from at least one retrieval scheme according to the target intent category corresponding to this query.

[0069] S310. Construct the knowledge Q&A prompt corresponding to the input data according to the target retrieval scheme; input the knowledge Q&A prompt into the large language model, control the large language model to perform retrieval in the preset knowledge base based on the content parsing prompt, and obtain the corresponding retrieval result; output the retrieval result as the answer content corresponding to the Q&A request.

[0070] Optionally, please continue to refer to Figure 4 , considering that the large language model is also used to implement the retrieval during the retrieval process, so it is also possible to set the template of the knowledge Q&A prompt for the large language model during the knowledge retrieval stage, and the template of the knowledge Q&A prompt can be specified in the retrieval schemes of each intent category. That is, in the retrieval scheme, at least the construction operation of the knowledge Q&A prompt corresponding to its own intent category can be specified. Therefore, the construction operation includes at least one of question rewriting, context information extraction, and historical dialogue data extraction. For example, for the intent of "asking for reasons or solutions", it may be necessary to rewrite the user input to facilitate the model's retrieval calculation, so the construction operation needs to include the question rewriting operation; if the same user ID asks questions continuously in the conversation, the relevance of the content asked by this user may be relatively high. In this case, the historical dialogue data extraction operation can be added to the construction operation to obtain the historical dialogue data of this user in the current query scenario. Then, in the retrieval scheme, the template of the knowledge Q&A prompt can be configured according to the retrieval operations required by its own intent category, so that after determining the target intent category, the knowledge Q&A prompt corresponding to the input data can be constructed according to the target retrieval scheme. Further, the knowledge Q&A prompt is input into the large language model, controlling the large language model to perform retrieval in the preset knowledge base based on the content parsing prompt, and obtaining the corresponding retrieval result; outputting the retrieval result as the answer content corresponding to the Q&A request.

[0071] Furthermore, to facilitate retrieval by large language models, when preparing the knowledge base, the original data to be summarized is first obtained. For example, in the application of emergency monitoring scenarios, the original data can be "monitoring guarantee experience documents", "duty experience documents", "follow-up work order data", etc. The original data is then connected to the inductive summary prompt words, which inform the large language model of which data needs to be summarized and how to summarize it. Next, the inductive summary prompt words are input into the large language model to control the large language model to summarize the original data based on the inductive summary prompt words and output the inductive knowledge data. In this process, the large language model can summarize the original data into structured knowledge. Finally, the large language model will represent the inductive knowledge data in vector form and store it in a preset knowledge base for subsequent retrieval.

[0072] On the other hand, in the embodiments of this specification, considering that vector retrieval refers to the process of quickly finding the closest set of vectors to a given query vector in a large set of candidate vectors, where "closeness" is usually measured according to a certain metric (such as Euclidean distance or cosine similarity, etc.). Therefore, single vector retrieval faces some challenges in practical applications, including (1) the curse of dimensionality: as the data dimension increases, not only does the storage overhead increase, but traditional distance calculations become ineffective, resulting in performance degradation; (2) dynamic update problems: when elements need to be frequently added or deleted, the cost of maintaining the index structure can be very high; (3) memory consumption: some efficient algorithms may require a large amount of RAM resources, which is unacceptable for resource-constrained environments.

[0073] Therefore, the embodiments of this specification adopt a hybrid retrieval process during retrieval. The hybrid retrieval process includes at least two retrieval strategies, that is, when performing retrieval, the large language model will execute the hybrid retrieval process on the input data according to the target retrieval scheme to obtain the corresponding retrieval result. Taking the retrieval result with Chinese identifiers as an example, the embodiments of this specification provide a hybrid retrieval process composed of multiple retrieval methods such as character retrieval, pinyin retrieval, and vector retrieval, thus effectively solving the problem of retrieval accuracy.

[0074] Optionally, when the question-and-answer request needs to query the information of the person in charge of the APP according to the "APP name identifier" in the input data, the input data can be first subjected to Chinese character retrieval. If the Chinese character retrieval result is obtained, the Chinese character retrieval result is output as the answer content corresponding to the question-and-answer request. If the Chinese character retrieval result is not obtained, the input data is subjected to pinyin retrieval query. During the pinyin retrieval process, it can be further divided into first performing pinyin retrieval with tones. If not retrieved, further perform pinyin retrieval without tones; if the pinyin retrieval result is obtained, the pinyin retrieval result is output as the answer content corresponding to the question-and-answer request. If the pinyin retrieval result is not obtained, the input data is subjected to vector retrieval query; if the vector retrieval result is obtained, the vector retrieval result is output as the answer content corresponding to the question-and-answer request. If the vector retrieval result is not obtained, the query failure result is output.

[0075] In the embodiments of this specification, a question-and-answer retrieval method is provided. The input data corresponding to the question-and-answer request is received, and the input data is added to a preset prompt word template to generate an intention recognition prompt word. The preset prompt word template is used to specify at least two preset intention categories that the large language model can output. In this way, the large language model can analyze the semantic relationships of the words in the input data through its pre-trained knowledge base and context understanding ability, infer the potential intention of the user, and classify the input data into the predefined intention categories. The intention recognition prompt word is input into the large language model to control the large language model to recognize the input data in the intention recognition prompt word and output the target intention category to which the input data belongs in at least two preset intention categories; a content analysis prompt word is generated according to the input data; the content analysis prompt word is input into the large language model to control the large language model to extract at least one key data from the input data based on the content analysis prompt word and output each key data in a preset format, so that the large language model converts the input data into a data format convenient for the computer to operate and calculate, facilitating subsequent retrieval calculations. Through a hybrid retrieval process including multiple retrieval methods, the problem of retrieval accuracy is effectively solved.

[0076] Please refer to Figure 5 , Figure 5 which is the structural block diagram of a question-and-answer retrieval device provided by the embodiments of this specification. As Figure 5 shown, the question-and-answer retrieval device 500 includes:

[0077] An input receiving module 510, configured to receive the input data corresponding to the question-and-answer request and generate an intention recognition prompt word according to the input data;

[0078] An intention recognition module 520, configured to input the intention recognition prompt word into the large language model and control the large language model to recognize the target intention category corresponding to the question-and-answer request based on the intention recognition prompt word;

[0079] An answer output module 530 is configured to determine a target retrieval scheme corresponding to a target intent category from at least one retrieval scheme, perform a retrieval on input data according to the target retrieval scheme to obtain a corresponding retrieval result, and output the retrieval result as the answer content corresponding to the question-and-answer request.

[0080] Optionally, the input receiving module 510 is further configured to add the input data to a preset prompt template to generate an intent recognition prompt. The preset prompt template is used to specify at least two preset intent categories that the large language model can output; the intent recognition module 520 is further configured to control the large language model to recognize the input data in the intent recognition prompt, and output the target intent category to which the input data belongs among at least two preset intent categories.

[0081] Optionally, the question-and-answer retrieval device 500 further includes: a content analysis module, configured to generate a content analysis prompt according to the input data; input the content analysis prompt into the large language model, and control the large language model to extract at least one key data from the input data based on the content analysis prompt and output each key data in a preset format.

[0082] Optionally, the answer output module 530 is further configured to construct a knowledge question-and-answer prompt corresponding to the input data according to the target retrieval scheme; input the knowledge question-and-answer prompt into the large language model, and control the large language model to perform a retrieval in a preset knowledge base based on the content analysis prompt to obtain a corresponding retrieval result.

[0083] Optionally, the retrieval scheme is at least used to specify the construction operation of the knowledge question-and-answer prompt corresponding to its own intent category; the construction operation includes at least one of question rewriting, context information extraction, and historical conversation data extraction.

[0084] Optionally, the answer output module 530 is further configured to perform a hybrid retrieval process on the input data according to the target retrieval scheme to obtain a corresponding retrieval result; the hybrid retrieval process includes at least two retrieval strategies.

[0085] Optionally, when the retrieval result is in Chinese identification, the answer output module 530 is further configured to perform a Chinese character retrieval on the input data according to the target retrieval scheme; if a Chinese character retrieval result is obtained, the Chinese character retrieval result is output as the answer content corresponding to the question-and-answer request, if no Chinese character retrieval result is obtained, a pinyin retrieval query is performed on the input data; if a pinyin retrieval result is obtained, the pinyin retrieval result is output as the answer content corresponding to the question-and-answer request, if no pinyin retrieval result is obtained, a vector retrieval query is performed on the input data; if a vector retrieval result is obtained, the vector retrieval result is output as the answer content corresponding to the question-and-answer request, if no vector retrieval result is obtained, a query failure result is output.

[0086] Optionally, the question-answer retrieval device 500 also includes: a knowledge base preprocessing module, which is used to obtain the original data to be summarized, and connect the original data to the summary prompt words; input the summary prompt words into the large language model, control the large language model to summarize the original data based on the summary prompt words and output the summarized knowledge data; vectorize the summarized knowledge data and store it in a preset knowledge base.

[0087] Optionally, the question-and-answer request is triggered when the user actively inputs a question or is automatically triggered by the system based on a currently monitored status.

[0088] In an embodiment of the present specification, a question-answering retrieval device is provided, wherein an input receiving module is used to receive input data corresponding to a question-answering request and generate an intent recognition prompt word according to the input data; an intent recognition module is used to input the intent recognition prompt word into a large language model and control the large language model to recognize the target intent category corresponding to the question-answering request based on the intent recognition prompt word; an answer output module is used to determine a target retrieval scheme corresponding to the target intent category from at least one retrieval scheme, and perform a search on the input data according to the target retrieval scheme to obtain the corresponding retrieval result, and output the retrieval result as the answer content corresponding to the question-answering request. In the process of processing user queries, prompt words for the input data are first generated, and then the prompt words are input into a preset large language model. The large language model, with its natural language processing capabilities and deep learning algorithms, efficiently analyzes and identifies the target intent category implied in the input data, and realizes deep mining and precise positioning of user intent. Different query intent categories often correspond to different answer content requirements. Therefore, after identifying the intent category of this query, a matching retrieval scheme is further determined based on this information to ensure that the retrieval process can efficiently and accurately locate the information required by the user. After executing the search according to the determined search scheme, the search results that meet the user's query intention can be obtained. Through such a processing flow, not only the accuracy and efficiency of query retrieval can be improved, but also the user experience can be improved.

[0089] The embodiments of this specification provide a computer program product including instructions. When the computer program product is executed on a computer or a processor, the computer or the processor executes the steps of any one of the methods in the above embodiments.

[0090] The embodiments of this specification also provide a computer storage medium, which can store multiple instructions, and the instructions are suitable for being loaded by a processor and executing the steps of any method in the above embodiments.

[0091] See also Figure 6 , Figure 6 This is a schematic diagram of the structure of a terminal provided in an embodiment of this specification. Figure 6As shown in the figure, the terminal 600 may include: at least one terminal processor 601, at least one network interface 604, a user interface 603, a memory 605, and at least one communication bus 602.

[0092] Among them, the communication bus 602 is used to realize the connection and communication between these components.

[0093] Among them, the user interface 603 may include a display screen and a camera. Optionally, the user interface 603 may further include a standard wired interface and a wireless interface.

[0094] Among them, the network interface 604 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).

[0095] Among them, the terminal processor 601 may include one or more processing cores. The terminal processor 601 connects various parts within the entire terminal 600 through various interfaces and lines. By running or executing instructions, programs, code sets, or instruction sets stored in the memory 605, and by calling the data stored in the memory 605, it executes various functions of the terminal 600 and processes data. Optionally, the terminal processor 601 may be implemented in at least one of the following hardware forms: Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The terminal processor 601 may integrate one or several combinations of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), and a modem, etc. Among them, the CPU mainly processes the operating system, user interface, and application programs, etc.; the GPU is responsible for the rendering and drawing of the content to be displayed on the display screen; the modem is used to process wireless communication. It can be understood that the above-mentioned modem may not be integrated into the terminal processor 601 and may be implemented separately by a single chip.

[0096] Among them, the memory 605 may include a Random Access Memory (RAM), or may also include a Read-Only Memory (ROM). Optionally, the memory 605 includes a non-transitory computer-readable storage medium. The memory 605 can be used to store instructions, programs, code, code sets or instruction sets. The memory 605 may include a program storage area and a data storage area. Among them, the program storage area can store instructions for implementing the operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above method embodiments, etc.; the data storage area can store the data involved in the above method embodiments. Optionally, the memory 605 may also be at least one storage device located far from the aforementioned terminal processor 601. As Figure 6 shown, the memory 605 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a question and answer retrieval program.

[0097] In Figure 6 the terminal 600 shown, the user interface 603 is mainly used to provide an input interface for the user to obtain the data input by the user; while the terminal processor 601 can be used to call the question and answer retrieval program stored in the memory 605 and specifically perform the following operations:

[0098] Receive the input data corresponding to the question and answer request, and generate an intention recognition prompt word according to the input data;

[0099] Input the intention recognition prompt word into the large language model, and control the large language model to identify the target intention category corresponding to the question and answer request based on the intention recognition prompt word;

[0100] Determine the target retrieval scheme corresponding to the target intention category from at least one retrieval scheme, perform a retrieval on the input data according to the target retrieval scheme to obtain the corresponding retrieval result, and output the retrieval result as the answer content corresponding to the question and answer request.

[0101] In some embodiments, when the terminal processor 601 executes to generate an intention recognition prompt word according to the input data, it specifically performs the following steps: Add the input data to a preset prompt word template to generate an intention recognition prompt word, and the preset prompt word template is used to specify at least two preset intention categories that the large language model can output; when the terminal processor 601 executes to control the large language model to identify the target intention category corresponding to the question and answer request based on the intention recognition prompt word, it specifically performs the following steps: Control the large language model to identify the input data in the intention recognition prompt word, and output the target intention category to which the input data belongs among at least two preset intention categories.

[0102] In some embodiments, after the terminal processor 601 executes to identify the target intent category corresponding to the Q&A request based on the large language model according to the intent recognition prompt words, the following steps are further specifically executed: generating content parsing prompt words according to the input data; inputting the content parsing prompt words into the large language model, and controlling the large language model to extract at least one key data from the input data based on the content parsing prompt words and output each key data in a preset format.

[0103] In some embodiments, when the terminal processor 601 executes to perform a retrieval on the input data according to the target retrieval scheme to obtain the corresponding retrieval result, the following steps are specifically executed: constructing a knowledge Q&A prompt word corresponding to the input data according to the target retrieval scheme; inputting the knowledge Q&A prompt word into the large language model, and controlling the large language model to perform a retrieval in the preset knowledge base based on the content parsing prompt word to obtain the corresponding retrieval result.

[0104] In some embodiments, the retrieval scheme is at least used to specify the construction operation of the knowledge Q&A prompt word corresponding to its own intent category; the construction operation includes at least one of question rewriting, context information extraction, and historical dialogue data extraction.

[0105] In some embodiments, when the terminal processor 601 executes to perform a retrieval on the input data according to the target retrieval scheme to obtain the corresponding retrieval result, the following steps are specifically executed: performing a hybrid retrieval process on the input data according to the target retrieval scheme to obtain the corresponding retrieval result; the hybrid retrieval process includes at least two retrieval strategies.

[0106] In some embodiments, when the retrieval result is a Chinese identifier, when the terminal processor 601 executes to perform a hybrid retrieval process on the input data according to the target retrieval scheme to obtain the corresponding retrieval result and output the retrieval result as the answer content corresponding to the Q&A request, the following steps are specifically executed: performing a Chinese character retrieval on the input data according to the target retrieval scheme; if the Chinese character retrieval result is obtained, then output the Chinese character retrieval result as the answer content corresponding to the Q&A request, if the Chinese character retrieval result is not obtained, then perform a pinyin retrieval query on the input data; if the pinyin retrieval result is obtained, then output the pinyin retrieval result as the answer content corresponding to the Q&A request, if the pinyin retrieval result is not obtained, then perform a vector retrieval query on the input data; if the vector retrieval result is obtained, then output the vector retrieval result as the answer content corresponding to the Q&A request, if the vector retrieval result is not obtained, then output a query failure result.

[0107] In some embodiments, the terminal processor 601 further specifically performs the following steps: obtaining the original data to be summarized, and accessing the original data to the inductive summary prompt; inputting the inductive summary prompt into the large language model, controlling the large language model to perform inductive summary on the original data based on the inductive summary prompt and outputting the inductive knowledge data; performing vector representation on the inductive knowledge data and storing it in a preset knowledge base.

[0108] In some embodiments, the question-and-answer request is triggered when the user actively inputs a question or is automatically triggered by the system based on the currently monitored status.

[0109] In several embodiments provided in this specification, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of modules is only a logical function division. In actual implementation, there may be other division methods. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of devices or modules can be in electrical, mechanical or other forms.

[0110] The modules described as separate components may or may not be physically separated. The components shown as modules may or may not be physical modules, that is, they may be located in one place, or may be distributed to multiple network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0111] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The above computer program product includes one or more computer instructions. When the above computer program instructions are loaded and executed on a computer, the processes or functions described above in the embodiments of this specification are generated in whole or in part. The above computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The above computer instructions can be stored in a computer-readable storage medium or transmitted through the above computer-readable storage medium. The above computer instructions can be transmitted from a website, computer, server, or data center to another website, computer, server, or data center in a wired manner (such as coaxial cable, optical fiber, Digital Subscriber Line (DSL)) or wirelessly (such as infrared, wireless, microwave, etc.). The above computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The above available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a Digital Versatile Disc (DVD)), or a semiconductor medium (such as a Solid State Disk (SSD)), etc.

[0112] It should be noted that for the foregoing method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the embodiments of this specification are not limited by the described action sequence, because according to the embodiments of this specification, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential for the embodiments of this specification.

[0113] In addition, it should also be noted that the information (including but not limited to user equipment information, user personal information, etc.), data (including but not limited to data for analysis, stored data, displayed data, etc.), and signals involved in the embodiments of this specification are all authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of relevant countries and regions. For example, the traffic, etc. involved in this specification are obtained under full authorization.

[0114] The above description is of specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve the desired result. Additionally, the processes depicted in the drawings do not necessarily require the particular order or sequential order shown to achieve the desired result. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0115] In the above embodiments, the descriptions of the various embodiments have their own emphases. For parts not detailed in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.

[0116] The above is a description of a question and answer retrieval method, apparatus, storage medium, and terminal provided by the embodiments of this specification. For those skilled in the art, based on the ideas of the embodiments of this specification, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation on the embodiments of this specification.

Claims

1. A question-and-answer retrieval method, the method comprising: Receiving input data corresponding to a question-and-answer request, and generating an intent recognition prompt word according to the input data; Inputting the intent recognition prompt word into a large language model, and controlling the large language model to recognize a target intent category corresponding to the question-and-answer request based on the intent recognition prompt word; Determining a target retrieval scheme corresponding to the target intent category from at least one retrieval scheme, performing a retrieval on the input data according to the target retrieval scheme to obtain a corresponding retrieval result, and outputting the retrieval result as an answer content corresponding to the question-and-answer request.

2. The method according to claim 1, wherein generating the intent recognition prompt word according to the input data comprises: Adding the input data to a preset prompt word template to generate an intent recognition prompt word, and the preset prompt word template is used to define at least two preset intent categories that the large language model can output; The controlling the large language model to recognize a target intent category corresponding to the question-and-answer request based on the intent recognition prompt word comprises: Controlling the large language model to recognize the input data in the intent recognition prompt word, and outputting a target intent category to which the input data belongs among the at least two preset intent categories.

3. The method according to claim 1, after controlling the large language model to recognize a target intent category corresponding to the question-and-answer request based on the intent recognition prompt word, further comprising: Generating a content analysis prompt word according to the input data; Inputting the content analysis prompt word into the large language model, and controlling the large language model to extract at least one key data from the input data based on the content analysis prompt word and output each key data in a preset format.

4. The method according to claim 1, wherein performing a retrieval on the input data according to the target retrieval scheme to obtain a corresponding retrieval result comprises: Constructing a knowledge question-and-answer prompt word corresponding to the input data according to the target retrieval scheme; Inputting the knowledge question-and-answer prompt word into the large language model, and controlling the large language model to perform a retrieval in a preset knowledge base based on the content analysis prompt word to obtain a corresponding retrieval result.

5. The method according to claim 4, wherein the retrieval scheme is at least used to define a construction operation of a knowledge question-and-answer prompt word corresponding to its own intent category; the construction operation comprises at least one of question rewriting, context information extraction, and historical dialogue data extraction.

6. The method according to claim 1, wherein performing a retrieval on the input data according to the target retrieval scheme to obtain a corresponding retrieval result comprises: Performing a hybrid retrieval process on the input data according to the target retrieval scheme to obtain a corresponding retrieval result; The hybrid retrieval process includes at least two retrieval strategies.

7. The method according to claim 6, when the retrieval result is a Chinese identifier, performing a hybrid retrieval process on the input data according to the target retrieval scheme to obtain a corresponding retrieval result, and outputting the retrieval result as an answer content corresponding to the question-and-answer request, comprising: Perform Chinese character retrieval on the input data according to the target retrieval scheme; If a Chinese character retrieval result is obtained, output the Chinese character retrieval result as the answer content corresponding to the Q&A request. If the Chinese character retrieval result is not obtained, perform a pinyin retrieval query on the input data; If a pinyin retrieval result is obtained, output the pinyin retrieval result as the answer content corresponding to the Q&A request. If the pinyin retrieval result is not obtained, perform a vector retrieval query on the input data; If a vector retrieval result is obtained, output the vector retrieval result as the answer content corresponding to the Q&A request. If the vector retrieval result is not obtained, output a query failure result.

8. The method according to claim 1, wherein the method further comprises: Obtain the original data to be summarized, and connect the original data to the induction and summary prompt; Input the induction and summary prompt into the large language model, and control the large language model to perform induction and summary on the original data based on the induction and summary prompt and output the induction knowledge data; Perform vector representation on the induction knowledge data and store it in a preset knowledge base.

9. The method according to claim 1, wherein the Q&A request is triggered when a user actively inputs a question or is automatically triggered by the system based on the currently monitored state.

10. A Q&A retrieval device, the device comprising: An input receiving module, configured to receive the input data corresponding to the Q&A request, and generate an intention recognition prompt according to the input data; An intention recognition module, configured to input the intention recognition prompt into the large language model, and control the large language model to recognize the target intention category corresponding to the Q&A request based on the intention recognition prompt; An answer output module, configured to determine the target retrieval scheme corresponding to the target intention category from at least one retrieval scheme, perform retrieval on the input data according to the target retrieval scheme to obtain the corresponding retrieval result, and output the retrieval result as the answer content corresponding to the Q&A request.

11. A computer program product containing instructions, when the computer program product runs on a computer or a processor, enabling the computer or the processor to execute the steps of the method according to any one of claims 1 to 9.

12. A computer storage medium, the computer storage medium stores multiple instructions, and the instructions are adapted to be loaded and executed by a processor to execute the steps of the method according to any one of claims 1 to 9.

13. A terminal, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the method according to any one of claims 1 to 9 are implemented.

Citation Information

Cited By

  • Water environment pollution analysis method, device and equipment based on large language model

    CN121351976A

  • Vector retrieval and structured retrieval fusion method and device, equipment and medium

    CN121636510A

  • A method, apparatus, device and medium for fusing vector retrieval and structured retrieval

    CN121636510B