Answer generation method and device, electronic equipment and storage medium

Through iteratively extracting and updating search information, the accuracy and efficiency of the automatic question-and-answer system to generate answers is improved, and questions that are not related to answers in the prior art are solved, and a more efficient question-and-answer process is achieved.

CN119106110APending Publication Date: 2024-12-10TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 8 Cited by

Patent Information

Application Number
CN202310678563.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-08
Publication Date
2024-12-10

AI Technical Summary

Technical Problem

The existing automatic question-and-answer system generates answers in a low degree, which causes the questioner to need to ask questions multiple times to obtain relevant information, which reduces the efficiency of question-and-answer.

Method used

By extracting key search information from the target question, iteratively obtaining relevant search result summary information, semantic analysis of matching degree, updating the search information until the preset conditions are met, and the final answer is generated.

Benefits of technology

It improves the accuracy and efficiency of answers, ensures that the generated answers are more consistent with the questions, and improves the Q&A efficiency of the automatic question and answer system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119106110A_ABST
    Figure CN119106110A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of artificial intelligence, in particular to an answer generation method and device, electronic equipment and a storage medium. The method comprises the following steps: obtaining each search result based on key search information extracted from a target question, and extracting summary information of each search result; executing the following operations in an iteration mode until it is determined that the obtained candidate answers meet preset conditions: when it is determined that search results related to the key search information exist based on the latest semantic analysis results of all summary information, obtaining target contents matched with the key search information from the search results; obtaining candidate answers on the basis of the target content, when it is determined that the candidate answers do not meet preset conditions, obtaining new search results on the basis of the updated key search information, and extracting summary information of the new search results; and finally, generating a target answer based on the obtained candidate answers. The answer generation accuracy can be improved, so that the question-answering efficiency of the automatic question-answering system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to an answer generation method, device, electronic device and storage medium. Background Art

[0002] With the development of artificial intelligence technology, more and more artificial intelligence systems are being applied to people's lives, and the automatic question-answering system is one of them. In related technologies, after the questioner inputs the question into the automatic question-answering system, the automatic question-answering system understands and extracts the question, generates a search query, searches the Internet based on the search query, obtains search results, and then summarizes the content of the search results to generate the final answer.

[0003] However, the search results obtained based on the search query usually contain content that is irrelevant to the question. The current automatic question-answering system directly summarizes the content of the search results, and the generated answers may contain some content that is not closely related to the question, resulting in low accuracy of the generated answers.

[0004] For example, if the question is "How to learn to play Frisbee", and the question is input into the automatic question-answering system, the output answer is "Playing Frisbee is an interesting sport that can exercise the body and promote teamwork. The basic movements of playing Frisbee include catching, throwing, sprinting and defending." The content "can exercise the body and promote teamwork" is not very relevant to the question.

[0005] Since the accuracy of the answers generated by the current automatic question-answering system is not high, the questioner may ask the automatic question-answering system the same question multiple times, which reduces the efficiency of question-answering. Therefore, how to improve the accuracy of the answers generated by the automatic question-answering system to improve the efficiency of question-answering is a problem that needs to be solved. Summary of the invention

[0006] The embodiments of the present application provide an answer generation method, device, electronic device and storage medium for improving the accuracy of answers generated by an automatic question and answer system to improve question and answer efficiency.

[0007] On the one hand, an embodiment of the present application provides an answer generation method, comprising:

[0008] Extracting key search information based on the target question, obtaining search results based on the key search information, and extracting summary information of each search result;

[0009] The following operations are performed iteratively until the candidate answer is determined to meet the preset conditions:

[0010] Obtaining the latest semantic analysis results of each summary information, and when determining that there is at least one search result related to the key search information based on the obtained semantic analysis results, obtaining target content matching the key search information from the at least one search result;

[0011] Obtaining the candidate answers based on the target content, and when it is determined that the candidate answers do not satisfy the preset condition, updating the key search information based on the semantic information of the target question and the candidate answers, and obtaining new search results based on the updated key search information, and extracting summary information of each of the new search results;

[0012] A target answer is generated based on the obtained candidate answers.

[0013] On the one hand, an embodiment of the present application provides an answer generation device, comprising:

[0014] A search module, used to extract key search information based on a target question, obtain search results based on the key search information, and extract summary information of each search result;

[0015] The iteration module is used to perform the following operations in an iterative manner until it is determined that the obtained candidate answer meets the preset conditions:

[0016] Obtaining the latest semantic analysis results of each summary information, and when determining that there is at least one search result related to the key search information based on the obtained semantic analysis results, obtaining target content matching the key search information from the at least one search result;

[0017] Obtaining the candidate answers based on the target content, and when it is determined that the candidate answers do not satisfy the preset condition, updating the key search information based on the semantic information of the target question and the candidate answers, and obtaining new search results based on the updated key search information, and extracting summary information of each of the new search results;

[0018] A generating module is used to generate a target answer based on the obtained candidate answers.

[0019] Optionally, when the browsing instruction based on the corresponding search result obtains the target sub-content matching the key search information from the corresponding search result, the iteration module is specifically configured to:

[0020] Based on the browsing instruction of the corresponding search result, selecting at least one candidate text segment from the multiple text segments in a search result according to the text similarity between each of the multiple text segments and the key search information;

[0021] Through the generative language model, the text semantic information of each of the at least one selected candidate text fragment is obtained respectively, and based on the at least one text semantic information, a target text fragment matching the key search information is selected from the at least one candidate text fragment, and the target sub-content is obtained based on the target text fragment.

[0022] Optionally, when selecting at least one candidate text segment from a plurality of text segments in a search result according to the text similarity between each of the plurality of text segments and the key search information, the iteration module is specifically configured to:

[0023] If there is at least one text segment among the multiple text segments in the search result whose text similarity with the key search information satisfies the similarity condition, the at least one text segment is used as a candidate text segment;

[0024] If there is no text segment in the search result whose similarity with the key search information satisfies the similarity condition, each of the multiple text segments is used as a candidate text segment.

[0025] Optionally, when obtaining the target sub-content based on the target text segment, the iteration module is specifically configured to:

[0026] Using the target text segment as the target sub-content; or

[0027] Extract the segment summary information of the target text segment, and use the segment summary information as the target sub-content.

[0028] Optionally, when it is determined that the candidate answer does not satisfy the preset condition, based on the semantic information of the target question and the candidate answer, when the key search information is updated, the iteration module is specifically used to:

[0029] Through the generative language model, the following operations are performed:

[0030] When it is determined that the candidate answer does not satisfy the preset condition, new question requirement information is determined based on the semantic information of the target question, the semantic information of the key search information, and the semantic information of the candidate answer;

[0031] Based on the new question requirement information, the key search information is updated and a search instruction is generated, wherein the search instruction is used to instruct to search based on the updated key search information.

[0032] Optionally, the preset condition includes any one of the following:

[0033] The text length of the candidate answer reaches the upper limit;

[0034] The semantic matching degree between the candidate answer and the target question reaches a preset threshold;

[0035] The number of iterations reaches the upper limit;

[0036] The iteration duration reaches the upper limit;

[0037] Receive answer output instruction.

[0038] Optionally, when obtaining the candidate answer based on the target content, the iteration module is specifically used to:

[0039] When it is determined that there are candidate answers obtained before this iteration, based on the target content obtained in this iteration, the candidate answers obtained before this iteration are updated to obtain updated candidate answers;

[0040] When it is determined that there is no candidate content obtained before this iteration, the candidate answer is obtained based on the target content obtained in this iteration.

[0041] Optionally, the iteration module is further used for:

[0042] When it is determined based on each of the obtained semantic analysis results that there is no at least one search result related to the key search information, the key search information is updated based on the semantic information of the target question and the candidate answer;

[0043] New search results are obtained based on the updated key search information, and summary information of each of the new search results is extracted.

[0044] Optionally, the device further comprises:

[0045] A recording module is used to record the source information of the target content obtained each time, wherein the source information includes at least one of the following:

[0046] The page address information of the search results corresponding to the target content;

[0047] The location information of the target content in the corresponding search results;

[0048] The generation module is specifically used for:

[0049] At least one target content included in the candidate answer and source information of each target content are combined into the target answer.

[0050] An electronic device provided by an embodiment of the present application includes a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of any one of the above-mentioned answer generation methods.

[0051] An embodiment of the present application provides a computer-readable storage medium, which includes a computer program. When the computer program is run on an electronic device, the computer program is used to enable the electronic device to execute the steps of any one of the above-mentioned answer generation methods.

[0052] An embodiment of the present application provides a computer program product, which includes a computer program, and the computer program is stored in a computer-readable storage medium; when a processor of an electronic device reads the computer program from the computer-readable storage medium, the processor executes the computer program, so that the electronic device performs the steps of any one of the above-mentioned answer generation methods.

[0053] The present application adopts the above technical solution, which has at least the following beneficial effects:

[0054] The embodiments of the present application provide an answer generation method, device, electronic device, and storage medium. After extracting key search information from a target question, each search result is searched and then target content related to the key search information is obtained from each search result as a candidate answer. When it is determined that the candidate answer is not sufficient to generate the target answer, the key search information is updated to search for new search results, and the process of obtaining the target content is repeated until it is determined that the obtained candidate answer is sufficient to generate the target answer. Therefore, the embodiments of the present application can progressively obtain candidate answers that better match the target question, and then generate the final target answer based on the candidate answers, which can improve the accuracy of the generated answer to improve the question-answering efficiency of the automatic question-answering system.

[0055] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0057] Figure 1 A schematic diagram of an application scenario of an answer generation method in an embodiment of the present application;

[0058] Figure 2 A flowchart of an answer generation method in an embodiment of the present application;

[0059] Figure 3 A schematic diagram of displaying a target answer in a conversation page in an embodiment of the present application;

[0060] Figure 4 A logical diagram of an answer generation method in an embodiment of the present application;

[0061] Figure 5 A flowchart of an answer display method in an embodiment of the present application;

[0062] Figure 6 A schematic diagram of triggering the display of a reference source in a conversation page in an embodiment of the present application;

[0063] Figure 7 This is another schematic diagram of triggering the display of reference sources in a conversation page in an embodiment of the present application;

[0064] Figure 8 A schematic diagram of triggering the display of reference sources in a conversation page in an embodiment of the present application;

[0065] Fig. 9 This is another schematic diagram of triggering the display of reference sources in a conversation page in an embodiment of the present application;

[0066] Fig.10 This is another schematic diagram of triggering the display of reference sources in a conversation page in an embodiment of the present application;

[0067] Fig.11 A schematic diagram of the architecture of an automatic question-answering system in an embodiment of the present application;

[0068] Fig.12 This is a schematic diagram of the architecture of another automatic question-answering system in an embodiment of the present application;

[0069] Fig.13 A schematic diagram of the structure of an answer generation device in an embodiment of the present application;

[0070] Fig.14 A schematic diagram of the structure of another answer generating device in an embodiment of the present application;

[0071] Fig.15 A schematic diagram of the structure of an electronic device to which the present invention is applied;

[0072] Fig.16 The present invention is a schematic diagram of the structure of an electronic device to which the present invention is applied. DETAILED DESCRIPTION

[0073] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the technical solution of the present application, rather than all of the embodiments. Based on the embodiments recorded in the application documents, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the technical solution of the present application.

[0074] The following is an introduction to some concepts involved in the embodiments of the present application.

[0075] Prompt template: The prompt description format set by the user for a generative language model (such as ChatGPT), that is, taking a task description (which may include a small number of examples) as input, and then allowing the generative language model to generate the output result according to the prompt format.

[0076] ChatGPT: Chat Generative Pre-trained Transformer is a natural language processing tool driven by artificial intelligence technology. It can communicate by understanding and learning human language, and can also interact according to the context of the chat. It can chat and communicate like a human, and can even complete some tasks, such as writing emails, video scripts, copywriting, code, translation, etc.

[0077] The word “exemplary” is used hereinafter to mean “serving as an example, example, or illustration.” Any embodiment described as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.

[0078] The terms "first" and "second" in this document are used for descriptive purposes only and should not be understood as explicitly or implicitly indicating relative importance or implicitly indicating the number of technical features indicated. Therefore, features defined as "first" and "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of this application, unless otherwise specified, "plurality" means two or more.

[0079] The embodiments of the present application relate to artificial intelligence (AI) technology, and are designed based on natural language processing (NLP) in artificial intelligence.

[0080] Artificial intelligence is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.

[0081] Artificial intelligence is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation interaction systems, mechatronics and other technologies; the software technologies of artificial intelligence generally include computer vision technology, natural language processing technology, and machine learning / deep learning and other major directions.

[0082] Natural language processing is an important direction in the fields of computer science and artificial intelligence. It studies various theories and methods that can achieve effective communication between people and computers using natural language. Natural language processing is a science that integrates linguistics, computer science, and mathematics. Therefore, research in this field will involve natural language, that is, the language people use in daily life, so it is closely related to the study of linguistics. Natural language processing technology usually includes text processing, semantic understanding, machine translation, robot question answering, knowledge graph and other technologies.

[0083] Machine Learning (ML) is a multi-disciplinary subject that involves probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and self-learning.

[0084] In an embodiment of the present application, the target question can be analyzed based on natural language processing technology and machine learning technology to generate a corresponding target answer.

[0085] With the development and progress of artificial intelligence, artificial intelligence is being studied and applied in many fields, such as common smart homes, smart customer service, virtual assistants, smart speakers, smart marketing, unmanned driving, automatic driving, robots, smart medical care, etc. I believe that with the further development of future technology, artificial intelligence will be applied in more fields and play an increasingly important role.

[0086] The following is a brief introduction to the design concept of the embodiment of the present application:

[0087] In the related art, the automatic question-answering system understands and extracts the question, generates a search query, searches the Internet based on the search query, obtains search results, and then summarizes the content of the search results to generate the final answer. However, the search results obtained based on the search query usually contain content that is irrelevant to the question. The current automatic question-answering system directly summarizes the content of the search results, and the generated answer may contain some content that is not closely related to the question, making the generated answer less accurate. In this way, the questioner may ask the automatic question-answering system multiple times for the same question, reducing the efficiency of question-answering.

[0088] In view of this, the embodiments of the present application provide an answer generation method, device, electronic device and storage medium. When it is determined that the currently obtained candidate answers are insufficient to generate the target answer, by updating the key search information to search for new search results, candidate answers that better match the target question can be gradually obtained, and then the final target answer is generated based on the candidate answers, which can improve the accuracy of the generated answers and improve the question-answering efficiency of the automatic question-answering system.

[0089] The following is an exemplary introduction to the application scenarios of the embodiments of the present application.

[0090] like Figure 1 As shown, it is a schematic diagram of an application scenario in an embodiment of the present application. The application scenario schematic diagram includes a terminal device 110 and a server 120. The terminal device 110 and the server 120 can communicate with each other through a communication network.

[0091] In an optional implementation, the communication network may be a wired network or a wireless network, and therefore, the terminal device 110 and the server 120 may be directly or indirectly connected via wired or wireless communication, which is not specifically limited in the embodiments of the present application.

[0092] In the embodiment of the present application, the terminal device 110 includes but is not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle terminals, aircraft, etc. A client related to the automatic question-and-answer system may be installed on the terminal device, which may be software, a web page, a small program, etc. The server 120 may be a background server corresponding to the client, or a server specifically used for answer generation, which is not specifically limited in the present application. The server 120 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud storage, cloud functions, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), as well as basic cloud computing services such as big data and artificial intelligence platforms.

[0093] In the embodiment of the present application, the answer generation method can be executed by the server 120 or the terminal device 110 alone, or can be executed by the server 120 or the terminal device 110 in coordination, without limitation.

[0094] In some possible embodiments, taking the server 120 executing alone as an example, the user inputs a target question in the automatic question-and-answer system installed on the terminal device 110, and the terminal device 110 sends the target question to the server 120. The server 120 generates a target answer based on the target question using the answer generation method of the embodiment of the present application, and returns the target answer to the terminal device 110, so that the terminal device 110 outputs the target answer in the automatic question-and-answer system.

[0095] In some other possible embodiments, taking the terminal device 110 executing alone as an example, the user inputs a target question in the automatic question-and-answer system installed on the terminal device 110, and the terminal device 110 generates a target answer based on the target question using the answer generation method of the embodiment of the present application, and outputs the target answer in the automatic question-and-answer system.

[0096] In some other possible embodiments, taking the cooperation of the server 120 or the terminal device 110 as an example, the user inputs the target question in the automatic question-answering system installed on the terminal device 110, the terminal device 110 extracts the key search information of the target question, and sends the key search information to the server 120, and the server 120 executes the subsequent process of the answer generation method of the embodiment of the present application to generate a target answer, and returns the target answer to the terminal device 110, so that the terminal device 110 outputs the target answer in the automatic question-answering system.

[0097] It should be noted that Figure 1This is an exemplary introduction to the application scenarios of the methods in the embodiments of the present application. The actual applicable application scenarios are not limited to these, and in fact, the number of terminal devices and servers is also not limited.

[0098] The preferred embodiments of the present application are described below in conjunction with the drawings in the specification. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application. In addition, the embodiments of the present application and the features in the embodiments may be combined with each other if there is no conflict.

[0099] Reference Figure 2 As shown, it is a flowchart of an answer generation method provided in an embodiment of the present application. Taking the server as the execution subject as an example, the method may include the following steps S201-S203:

[0100] Step S201, extracting key search information based on the target question, obtaining search results based on the key search information, and extracting summary information of each search result;

[0101] Among them, semantic analysis is performed on the target question to obtain key search information, which can be generated based on the semantic information of the target question and is more refined than the target question. Optionally, a pre-trained generative language model can be used to obtain the key search information of the target question. For example, if the target question is "Why are there so many special creatures in area A, but few in area B which is geographically close", the key search information is determined to be "Why are there so many special creatures in area A but few in area B" through semantic analysis.

[0102] After obtaining the key search information, the search engine can be used to search for relevant search results from the network based on the key search information. The search results are the most relevant search results to the key search information. Then, the dynamic summary of each search result can be extracted based on the dynamic summary technology; specifically, the search engine determines the location where the key search information appears in the search results based on the relevance of the key search information to the content in the search results, and selects the location context according to a certain window size to obtain the dynamic summary. The dynamic summary is the part of the search result with the highest text similarity to the key search information. The summary information of each search result can include a dynamic summary. In addition, considering that the title of the search result can reflect the main content, the summary information can include the title, etc. in addition to the dynamic summary.

[0103] In the embodiment of the present application, the search results most relevant to the key search information and the summary information of each search result are used for subsequent answer generation, which can make full use of the search engine's ranking results and is conducive to improving the accuracy of generated answers.

[0104] Step S202, perform the following steps S2021-S2022 in an iterative manner until it is determined that the obtained candidate answer meets the preset conditions.

[0105] Step S2021, obtaining the latest semantic analysis results of each summary information, and based on the obtained semantic analysis results, when it is determined that there is at least one search result related to the key search information, obtaining target content matching the key search information from the at least one search result.

[0106] In the embodiment of the present application, in the first iteration, the latest summary information is the summary information obtained in the above step S201, and semantic analysis is performed on each summary information. Based on the semantic analysis result of each summary information, it can be determined whether the summary information is related to the key search information. For example, when the semantic matching degree between the summary information and the key search information reaches a set threshold, it is considered that the summary information is related to the key search information, and this is not limited. The semantic matching degree can be determined based on the semantic analysis result of the summary information and the semantic analysis result of the key search information.

[0107] If it is determined that a summary information is related to the key search information, a semantic analysis may be performed on the search result corresponding to the summary information, and target content matching the semantics of the key search information may be obtained from the search result. Optionally, in order to improve the matching accuracy, the search results may be segmented, that is, analyzing whether the semantics of each text segment of the search result matches the semantics of the key search information, wherein the division of the text segments in the search results may be set as needed, and may be a text of a set length or a paragraph, and the length of the text segment may have an upper limit.

[0108] Optionally, the embodiment of the present application can perform the above step S2021 through a pre-trained generative language model. For example, the generative language model can be ChatGPT or other models, which is not limited. In a specific implementation, when performing corresponding operations through a generative language model, a preset Prompt template can be input into the generative language model. The Prompt template is used to indicate the operation that the generative language model needs to perform using description information in a preset format. In step S2021, the generative language model is indicated by the Prompt template. After obtaining each search result, it is determined whether there is at least one search result related to the key search information based on the summary information of each search result. If so, the target content matching the key search information is obtained from at least one search result.

[0109] Step S2022, obtain candidate answers based on the target content, and when it is determined that the candidate answers do not meet the preset conditions, update the key search information based on the semantic information of the target question and the candidate answers, obtain new search results based on the updated key search information, and extract summary information of each new search result.

[0110] The candidate answers obtained in each iteration may include the target content obtained in this iteration, or may include the target content obtained in multiple iterations. For example, after obtaining the target content in the first iteration, the target content obtained in this iteration is used as the candidate answer, and after obtaining the target content again in the second iteration, the target content is combined with the target content obtained in the first iteration to obtain an updated candidate answer.

[0111] In some embodiments, when obtaining candidate answers based on the target content in step S2022, it can be determined whether there are candidate answers obtained before this iteration, specifically there are the following two situations:

[0112] In the first case, when it is determined that there are candidate answers obtained before this iteration, the candidate answers obtained before this iteration are updated based on the target content obtained in this iteration to obtain updated candidate answers.

[0113] Among them, the target content obtained in this iteration can be superimposed on the candidate answers obtained before this iteration to obtain updated candidate answers. It can be understood that the target content obtained in each iteration is used as a part of the candidate answer.

[0114] Specifically, after obtaining the target content in each iteration, the latest candidate answer is obtained based on the target content, and the latest candidate answer is saved so that the candidate answer can be continuously updated in subsequent iterations.

[0115] In the second case, when it is determined that there is no candidate answer obtained before this iteration, a candidate answer is obtained based on the target content obtained in this iteration.

[0116] When the target content is obtained for the first time, the target content is used as a candidate answer, and when the target content is obtained again subsequently, it is updated based on the candidate answer.

[0117] In an embodiment of the present application, candidate answers are generated based on target content obtained through multiple iterations, and then target answers are generated based on the candidate answers, which can ensure the accuracy and richness of the generated answers.

[0118] In some embodiments, after obtaining a candidate answer in each iteration, it can be determined whether the candidate answer meets a preset condition, which can include any one of the following 1)-4):

[0119] 1) The text length of the candidate answer reaches the upper limit;

[0120] Among them, the text length of the target answer finally generated may have an upper limit. For example, the text length may be determined by the number of words. The upper limit may be set as needed, such as 200 words, and there is no limit on this.

[0121] 2) The semantic match between the candidate answer and the target question reaches a preset threshold.

[0122] Specifically, based on the semantic information of the candidate answer and the semantic information of the target question, the semantic matching degree between the candidate answer and the target question can be determined, and the preset threshold can be set as needed, for example, to 0.8, which is not limited to this.

[0123] 3) The number of iterations reaches the upper limit.

[0124] Considering that in some cases, the content of the candidate answers obtained may be relatively small, in order to avoid long-term searching, an upper limit on the number of iterations can be set. The upper limit can be set as needed, for example, 10 times, and there is no limit to this.

[0125] 4) The iteration duration reaches the upper limit.

[0126] In order to avoid long-term searching, an upper limit of the iteration duration may also be set. The upper limit may be set as required, for example, 0.1s, which is not limited.

[0127] 5) Receive the answer output instruction.

[0128] In some cases, the server may receive an answer output instruction. For example, after the questioner inputs the target question, he may also input an answer output instruction before obtaining the generated target answer.

[0129] In an embodiment of the present application, after obtaining a candidate answer in each iteration, it is determined whether the candidate answer satisfies any of the above-mentioned preset conditions. If any of the conditions is met, a target answer is generated based on the candidate answer, taking into account a variety of situations in which the target answer needs to be generated, to ensure that the target answer can be successfully generated.

[0130] In some embodiments, during the execution of step S2022, it is possible to determine whether the candidate answer meets the preset condition through a pre-trained generative language model, and when it is determined that the candidate answer does not meet the preset condition, update the key search information, which may specifically include the following steps A1-A2:

[0131] A1. When it is determined that the candidate answer does not meet the preset conditions, the generative language model determines new question requirement information based on the semantic information of the target question, the semantic information of the key search information, and the semantic information of the candidate answer;

[0132] Among them, assuming that this iteration is the first iteration, when the generative language model determines that the candidate answers obtained this time do not meet the preset conditions, it can perform semantic analysis on the target question, the key search information in this iteration, and the candidate answers obtained in this iteration, and update the question demand information of the key search information in this iteration to obtain new question demand information. For example, the target question is "What is worth recommending in xx place", and the key search information of this iteration is "xx place", that is, the question demand information is "xx place". For example, by performing semantic analysis on the candidate answers, it is determined that the candidate answers are all about "delicious food in xx place", then the question demand information can be updated to "attractions in xx place", etc.

[0133] In addition, if this iteration is not the first iteration, the generative language model can be used to perform semantic analysis on the target question, the key search information in this iteration, the key search information before this iteration, and the candidate answers obtained in this iteration to determine new question requirement information, which will not be elaborated here.

[0134] A2. Using a generative language model, based on new question requirement information, the key search information is updated and a search instruction is generated. The search instruction is used to instruct a search based on the updated key search information.

[0135] Among them, according to the new question demand information, new key search information can be determined. For example, if the new question demand information is "attractions in xx place", the new key search information is, for example, "travel guide in xx place", "food, drink and entertainment in xx place" and so on.

[0136] The generative language model can generate a search instruction based on the new key search information so that the search engine can search for new search results based on the new key search information. In a specific implementation, when the above steps A1-A2 are performed by the generative language model, a preset Prompt template can be input into the generative language model so that the generative language model performs corresponding operations according to the Prompt template.

[0137] In an embodiment of the present application, when the candidate answers obtained do not meet the preset conditions, by determining new question requirement information in order to update the key search information, the search can be made more comprehensive and content related to the target question can be more easily obtained, which is conducive to improving the accuracy of generated answers.

[0138] Step S203: Generate a target answer based on the obtained candidate answers.

[0139] Among them, on the one hand, the candidate answer can be directly used as the target answer; on the other hand, the target answer can be jointly generated based on the candidate answer and the source information of the candidate answer.

[0140] When the embodiment of the present application determines that the currently obtained candidate answers are insufficient to generate the target answer, the key search information is updated to search for new search results, so as to progressively obtain candidate answers that better match the target question, and then generate the final target answer based on the candidate answers, thereby improving the accuracy of the generated answers and improving the question-answering efficiency of the automatic question-answering system.

[0141] In some embodiments, after generating the target answer, in order to facilitate viewing the source of the target content in the target answer, after each target content is obtained, the source information of each obtained target content may be recorded, and the source information may include one or both of the following:

[0142] The page address information of the search results corresponding to the target content;

[0143] The location information of the target content in the corresponding search results;

[0144] The target content may include at least one target sub-content, each of which comes from a search result. The source information may include at least the page address information of the search result corresponding to the target content, and may also include the location information of the target content in the corresponding search result, so as to quickly locate the location of the target content in the corresponding search result.

[0145] The above step S203 generates a target answer based on the obtained candidate answers, which may include:

[0146] At least one target content contained in the candidate answer and source information of each target content are combined into a target answer.

[0147] Furthermore, when displaying the target answer, each target content and the source information of each target content can be displayed at the same time, and each target content includes a target sub-content from at least one search result. For example, the source information includes the page address information of the search result corresponding to the target content, and the position information of the target content in the corresponding search result. The page address information and the position information can be used together as the reference source of the target content, and the page address information can be used as the reference source of the target content.

[0148] For example, Figure 3As shown, the user enters the target question "Please introduce Monstera to me" in the dialogue page of the "Souyiso Assistant" applet. After being processed by the server, the generated target answer is returned, and the displayed target answer is "Monstera is a climbing plant, also known as Monstera, Iron Orchid, and Philodendron①. It is native to the tropical rain forests of Mexico. It can be grown outdoors in southern China and generally grown indoors in the north. The leaves of Monstera are rich and diverse and highly ornamental. The flower language of Monstera means longevity, health, and vitality, and the meaning is very beautiful②. In municipal gardens and garden designs, Monstera is also a common matching plant with emerald green color and exotic leaves, which is very ornamental②. Do you want to grow Monstera? Reference sources: 1. Flower Growing Encyclopedia 2. Lao Zhang's Flower Growing", where the corresponding content is marked with the reference source "①" or "②", and the reference source "1. Flower Growing Encyclopedia 2. Lao Zhang's Flower Growing" is marked at the end of the target answer.

[0149] It should be noted that the presentation of the above-mentioned citation sources and reference sources is only exemplary and not limiting.

[0150] In an embodiment of the present application, by recording the source information of the target content obtained each time, the source information can be marked when the target answer is displayed, so that the search result from which the target content comes can be quickly located, making it easier to view more relevant content.

[0151] In some embodiments, the above step S2021 may be performed by a pre-trained generative language model. After semantic analysis is performed on the abstract of each search result, the following steps B1-B2 may be performed for each semantic analysis result obtained:

[0152] B1. When a pre-trained generative language model determines that a corresponding search result is related to key search information based on a semantic analysis result, a browsing instruction for the corresponding search result is generated.

[0153] Among them, the generative language model can determine whether the search result is related to the key search information based on the semantic analysis result of the summary information of a search result. If so, it determines to browse the search result, and specifically generates a browsing instruction for the corresponding search result.

[0154] In a specific implementation, when the above step B1 is performed by a generative language model, a preset Prompt template may be input into the generative language model so that the generative language model performs corresponding operations according to the Prompt template.

[0155] B2. Based on the browsing instruction of the corresponding search result, the target sub-content matching the key search information is obtained from the corresponding search result.

[0156] Among them, the browsing instruction can be used to instruct the segmented browsing of the search results, that is, to browse multiple text fragments of the search results separately, and each time a text fragment is obtained, a semantic analysis is performed on the text fragment through a generative language model to determine whether the text fragment matches the semantics of the key search information. After obtaining at least one matching text fragment, the target sub-content is obtained based on the at least one matching text fragment.

[0157] Finally, after obtaining at least one target sub-content from each search result, the at least one target sub-content is combined into a target content, wherein each target sub-content comes from a search result.

[0158] In an embodiment of the present application, by performing semantic analysis on each search result through a generative language model, target content related to key search information can be accurately matched from each search result, and target answers can be subsequently generated based on the related target content, which can improve the accuracy of the generated answers.

[0159] In some embodiments, in the above step B2, based on the browsing instruction of the corresponding search result, obtaining the target sub-content matching the key search information from the corresponding search result includes the following steps B21-B22:

[0160] B21. Based on the browsing instructions of the corresponding search results, at least one candidate text segment is selected from the multiple text segments according to the text similarities between each of the multiple text segments in a search result and the key search information.

[0161] Among them, a text segment with a high text similarity to the key search information can be selected from the multiple text segments as a candidate text segment, which is conducive to the subsequent rapid matching of target content related to the key search information. In addition, when the text similarity between the multiple text segments and the key search information is not high, each of the multiple text segments can be used as a candidate text segment to further determine whether there is target content related to the key search information.

[0162] In some optional implementations, selecting at least one candidate text segment from multiple text segments in B21 may include the following two possible situations:

[0163] Case 1: if there is at least one text segment among multiple text segments in a search result whose text similarity with the key search information satisfies the similarity condition, then the at least one text segment is used as a candidate text segment.

[0164] The similarity condition may specifically be that the text similarity reaches a similarity threshold, for example, the similarity threshold is 0.7, which is not limited thereto.

[0165] In this case, after selecting candidate text segments with higher text similarity from multiple text segments of the search results, target content related to the key search information can be subsequently obtained from the candidate text segments, which can improve the matching speed.

[0166] Case 2: if there is no text segment whose similarity with the key search information satisfies the similarity condition among the multiple text segments in a search result, each of the multiple text segments is used as a candidate text segment.

[0167] In this case, by taking each text segment of the search result as a candidate text segment, target content related to the key search information can be comprehensively matched from the search results, thereby improving the matching accuracy.

[0168] B22. Using a generative language model, obtain text semantic information of at least one selected candidate text segment respectively, and based on the at least one text semantic information, select a target text segment that matches the key search information from at least one candidate text segment, and obtain the target sub-content based on the target text segment.

[0169] Among them, the semantic matching degree between the candidate text segment and the key search information is determined by the generative language model. When the semantic matching degree reaches a preset threshold, the candidate text segment can be considered to match the key search information. The preset threshold can be set as needed, for example, 0.8, and there is no limitation on this. Further, after obtaining the target sub-content, the generative language model can generate a reference instruction, which is used to instruct to save the target sub-content so as to obtain a candidate answer based on the target sub-content later.

[0170] In a specific implementation, when the above step B22 is performed by a generative language model, a preset Prompt template may be input into the generative language model so that the generative language model performs corresponding operations according to the Prompt template.

[0171] In an embodiment of the present application, when obtaining target sub-content that matches the key search information from the corresponding search results, the search results can be segmented and matched, that is, multiple text fragments of the search results are matched with the key search information respectively, and text fragments with high relevance are selected as target content for generating target answers, which can improve the accuracy of generated answers.

[0172] Optionally, in step B22 of the above embodiment, when obtaining the target sub-content based on the target text segment, the generative language model may select any of the following methods to obtain the target sub-content according to the content of the target text segment:

[0173] Method 1: Use the target text segment as the target sub-content.

[0174] Among them, when the text length of the target text segment is short or the content is relatively refined, the target text segment can be directly quoted. Specifically, the text length of the target text segment can be analyzed through a generative language model to determine whether its content is refined.

[0175] Method 2: extract the fragment summary information of the target text fragment and use the fragment summary information as the target sub-content.

[0176] Among them, the generative language model summarizes the content of the target text segment based on the semantic information of the target text segment to obtain the segment summary information. For example, the target text segment is "Monstera is native to tropical rainforest environments. This climbing shrub is often at the bottom of dense forests and does not require strong light. In home care, it only needs to provide a certain amount of scattered light or early morning light to avoid direct exposure to the sun, which can easily cause sunburn or even death." The generative language model is used to extract the segment summary information of the target text segment, and the result is "Monstera does not need strong light, and should be placed in scattered light or early morning sunlight to avoid direct exposure to the sun."

[0177] In an embodiment of the present application, the target text fragment can be directly referenced as the target sub-content. In addition, considering that the target answer finally generated usually has a text length limit, the fragment summary information of the target text fragment can also be extracted through a generative language model, thereby reducing the text length of the target sub-content, so as to obtain as much content related to the target question as possible.

[0178] In some embodiments, during each iteration, each search result based on the key search information may not obtain target content matching the key search information. In this case, after obtaining the latest semantic analysis results of each summary information in the above step S2021, the following steps C1-C2 may be further performed:

[0179] C1. When it is determined based on each semantic analysis result that there is no at least one search result related to the key search information, the key search information is updated based on the semantic information of the target question and the candidate answer;

[0180] Wherein, based on the semantic analysis result of each summary information, if it is determined that the semantics of the summary information does not match the semantics of the key search information, it can be considered that the search result corresponding to the summary information is irrelevant to the key search information. For example, when the semantic matching degree between the summary information and the key search information is less than a preset threshold, the summary information is considered irrelevant to the key search information.

[0181] Optionally, semantic analysis is performed on each summary information and key search information respectively through the generative language model in the above embodiment to determine whether the summary information is related to the key search information.

[0182] The process of updating the key search information refers to steps A1-A2 in the above embodiment of the present application, which will not be repeated here.

[0183] C2. Obtain new search results based on the updated key search information, and extract summary information of each new search result.

[0184] The implementation process of step C2 is similar to that of step S201 in the above embodiment of the present application, and will not be repeated here.

[0185] In an embodiment of the present application, in each iteration, if it is determined that there are no search results related to the key search information in the search results, the key search information can be updated, and the search can be continued based on the updated key search information until search results related to the key search information are obtained, which is conducive to improving the accuracy of generating answers.

[0186] In an embodiment of the present application, a search engine and a generative language model may be combined to implement an answer generation method. The following takes ChatGPT, a generative language model, as an example to exemplarily introduce the implementation principle of the answer generation method in an embodiment of the present application.

[0187] The embodiment of the present application may design the instructions in Table 1.

[0188] Table 1

[0189]

[0190] ChatGPT is combined with the search engine through the instructions in Table 1. ChatGPT decides the next action based on the target question, the current browsing results of the search results, and the content of the quoted fragment. The next action is implemented through the instructions in Table 1. The instructions in Table 1 are introduced below.

[0191] 1) The next step is to search <query>When searching, ChatGPT determines the search query (which can be understood as the key search information in the above-mentioned embodiment of the present application), making full use of the model understanding ability of ChatGPT.

[0192] ChatGPT issued#search <query>Instruction, that is, to initiate a search for the query and return the search results. We directly use the head result returned by the search engine, including its docid, title, and dynamic summary content. The head result is the result that is most relevant to the search query. The dynamic summary content is selected by the search engine based on the relevance of the search query and the result body according to a certain window size. It is the part of the result body that is most relevant to the search query in terms of text matching. Using the head result and dynamic summary can fully utilize the search engine ranking quality effect.

[0193] 2) When ChatGPT decides to browse a search result, it sends a #read<docid,n> Instructions, get the content of each fragment of the search result, understand it through ChatGPT, and when ChatGPT determines that there is a fragment related to the query, initiate a quote <extract>The instruction is referenced, extract indicates the target content obtained based on the relevant fragments, or when ChatGPT determines that the search result does not contain fragments related to the query, the next step is taken.

[0194] Optionally, in order to quickly determine whether there are fragments related to the fragment query in the search results, you can first select fragments with higher similarity based on the text similarity between the fragment and the query, and then contextually expand the selected fragments to the upper limit of the input token number of ChatGPT, and understand them through ChatGPT to determine whether there are fragments related to the query.

[0195] 3) After ChatGPT browses a search result segment, it can decide to browse the next search result segment, also through #read<docid,n> The instruction was completed.

[0196] 4) When ChatGPT understands and determines that the browsed fragment is relevant to the search query, it returns #quote <extract>instruction, <extract>The content is the target content referenced by ChatGPT from the browsed fragments, or the target content summarized based on the browsed fragments, and is input to ChatGPT as Extracts in subsequent actions.

[0197] 5) Generate the target answer according to ChatGPT's decision, or ask ChatGPT to generate the target answer through the #answer instruction. For example, when Extracts reaches the maximum number of tokens (words), the #answer instruction is initiated.

[0198] In the embodiment of the present application, the answer generation process can be implemented by setting a suitable prompt template and combining the instructions in the above Table 1. The following introduces an example of a prompt template. By inputting the prompt template example into ChatGPT, ChatGPT can be instructed to perform corresponding operations according to the prompt example.

[0199] For example, a possible prompt template example is as follows:

[0200] Let's play a game. The goal of the game is: I (can be the dialogue service module in the server) ask you (ChatGPT) a question, you send me an action command to get information, and when you think the information is enough to answer, you directly summarize the answer, or I send the #answer command, and you answer based on the existing information. The rules of the game are as follows:

[0201] After you issue an action command, I will respond to your action command and provide the information obtained as instructed by the action command, including the target problem, the Extracts I recorded for you, and the current command content. The specific format is as follows:

[0202] $Question

[0203] <question>

[0204] $Extarcts

[0205] <extract1>

[0206] <extract2>

[0207] $Text

[0208] <text>

[0209] --EOF—

[0210] $Next Action

[0211] The action commands you can send me include: #search <query>、#read<docid,n>、#quote <extract>The functions of each instruction are:

[0212] 1)#search <query>

[0213] I will search with the query you provided, and then give the search results of the current query in $Text, including the docid, title and summary of the search results, in the format of

[0214] Docid: <docid>

[0215] Title: <title>< / title>

[0216] Abstract: <abstract>

[0217] 2)#read<docid,n>

[0218] Browse the fragments of the docid results. n means the nth fragment. I will give the content in $Text. If there is no nth fragment, $Text content is empty. Your subsequent action instructions cannot have subsequent fragments of the same docid. If you find a result in the search results that helps answer your question through the title and summary, you can use this command to get the content of the result.

[0219] 3)#quote <extract>

[0220] If you find the result fragment useful for answering the question after browsing it, you can find the paragraphs related to the question from the fragment or summarize a summary yourself and return it to me as an extract, which I will record in $Extracts.

[0221] You can only answer questions based on $Extracts. If you think the Extracts obtained by the current query are not enough to answer the question, you can change the query and retrieve more Extracts. My questions start with [Q].

[0222] During each interaction between the conversation service module in the server and ChatGPT, the interaction content includes:

[0223] $Question

[0224] <question>

[0225] $Extarcts

[0226] <extract1>

[0227] <extract2>

[0228] $Text

[0229] <text>

[0230] --EOF—

[0231] $Next Action

[0232] In the above prompt, there is no need to input all previous interactions with ChatGPT into ChatGPT. You can only keep the Extracts part to minimize the number of tokens input into ChatGPT and improve the execution efficiency of ChatGPT.

[0233] The above embodiments of the present application have at least the following beneficial effects:

[0234] 1) Make progressive decisions on the search query required for the target question, extract relevant text fragments by browsing the search results in segments, and when the next search is required, ChatGPT decides on a new search query to improve the accuracy of the generated answer.

[0235] 2) Through segmented analysis of search results and correlation analysis with target questions, highly relevant text fragments are selected for subsequent answer generation, making full use of the search engine’s summarization capabilities and ChatGPT’s comprehension capabilities to improve the accuracy of the final generated answers.

[0236] 3) Only retaining Extracts as the interactive input of ChatGPT can reduce the number of input tokens of one ChatGPT interaction, and can input as many result fragments as possible into ChatGPT to ensure the richness of the generated result input.

[0237] 4) The embodiment of the present application makes full use of the ranking results of the search engine and can analyze only the search results at the head, thereby improving the speed and accuracy of answer generation.

[0238] Combine the following Figure 4 The overall process of the answer generation method of the embodiment of the present application is exemplarily introduced.

[0239] like Figure 4 As shown, assuming that the target question obtained is "Why is there so much special creatures in area A, while there are so few in geographically close area B", the extracted key search information is "Why are there so many special creatures in area A but so few in area B", a search is performed based on the key search information to obtain each search result and its summary information, for example, search result 1 and its summary information...search result N and its summary information, and the target content "For tens of millions of years, the species of organisms in area A and area B were similar. However, area B later experienced volcanic eruptions and land subsidence, resulting in the extinction of almost all the original organisms. After the ecosystem was re-established, there were very few special organisms" is matched from these search results, and it is judged whether the target content (i.e., the candidate answer) is sufficient to generate the target answer. If it is sufficient to generate the target answer, the target answer is generated based on the target content. If it is not sufficient to generate the target answer, the above key search information is updated to obtain the updated key search information "The reason why there are special organisms in area A", and the search is continued. The above operation is repeated until the target answer is generated.

[0240] When the embodiment of the present application determines that the currently obtained candidate answers are insufficient to generate the target answer, the key search information is updated to search for new search results, so as to progressively obtain candidate answers that better match the target question, and then generate the final target answer based on the candidate answers, thereby improving the accuracy of the generated answers and improving the question-answering efficiency of the automatic question-answering system.

[0241] The following is an exemplary introduction to the application scenarios of the answer generation method of the embodiments of the present application.

[0242] The answer generation method of the embodiment of the present application can be applied to an automatic question-answering system, and specifically can be applied to any dialogue product. The following is an exemplary introduction to the answer display method using the answer generation method of the above embodiment of the present application.

[0243] In some embodiments, taking the server executing the answer generation method of the above embodiment of the present application as an example, the embodiment of the present application also provides an answer display method, which can be executed by a terminal device, such as Figure 5 As shown, the answer display method includes the following steps S501-S502:

[0244] Step S501, in response to a question input operation on a conversation page, displaying a target question on the conversation page, and sending the target question to a server.

[0245] Among them, a client of the dialogue product is installed on the terminal device, and the client can be software, a web page or a small program, etc. The user can enter the target question in the dialogue page of the client, and the terminal device responds to the question input operation and sends the target question to the server of the dialogue product. After obtaining the target question, the server can use the answer generation method of the embodiment of the present application to generate the target answer.

[0246] Step S502, in response to obtaining the target answer returned by the server, the target answer is displayed in the dialogue page, and the target answer includes at least one target content and source information of each marked target content.

[0247] Among them, based on the above embodiments of the present application, it can be known that the target content includes at least one target sub-content, and each target sub-content comes from a search result. The source information may include one or both of a reference source and a reference source, the reference source includes the page address information of the search result referenced by the corresponding target sub-content, and the target text fragment referenced by the target sub-content, the location information in the search result, and the reference source includes the page address information of the search result referenced by the target sub-content.

[0248] Optionally, the source information may be marked in a set manner in the target answer. For example, when marking both the citation source and the reference source, the citation source is marked after the corresponding content in the target answer, and the reference source is marked after the target answer.

[0249] When the reference source of the corresponding content (the above-mentioned target sub-content) in the target answer is triggered, the page of the search result can be displayed based on the page address information of the search result referenced by the corresponding content, and the jump anchor point can be aligned to the position of the text fragment referenced by the corresponding content based on the position information of the target text fragment referenced by the corresponding content, and the referenced target text fragment can also be marked and displayed, such as highlighting, bolding, italicizing, underlining, etc., without limitation. When the reference source is triggered, the page of the search result corresponding to the reference source is displayed based on the page address information in the reference source.

[0250] The triggering operation for the citation source or reference source includes but is not limited to clicking, sliding, pressing, selecting (for example, by mouse), etc., and is not limited to this.

[0251] It should be noted that different terminal devices may display the above-mentioned citation sources and reference sources in different ways. The following is an exemplary introduction to the display methods of citation sources and reference sources.

[0252] In one example, the triggering action is a click action, such as Figure 6 As shown, also in the above embodiment Figure 3 Take the conversation page of for example, the target answer displayed in the conversation page is marked with the citation sources "①" and "②", as well as the reference source "1. Flower cultivation encyclopedia 2. Lao Zhang's flower cultivation". When the user clicks on the citation source "①" of the content "Monstera is a climbing plant, also known as banana, wire orchid, and perforated philodendron", based on the page address information of the search result corresponding to the citation source, the corresponding search result page is displayed above the conversation page, and the jump anchor point is aligned to the position of the text fragment cited in the above content and highlighted, such as Figure 6 When clicking on the reference source "1. Flower Cultivation Encyclopedia" in the target answer, based on the page address information of "1. Flower Cultivation Encyclopedia", the page of "1. Flower Cultivation Encyclopedia" can be displayed above the dialogue page, and the content of "1. Flower Cultivation Encyclopedia" is displayed from beginning to end on this page.

[0253] In another example, Figure 7 As shown, the user Figure 6 Based on the output target answer, the target question "Yes, how about Monstera" is input again, and the output target answer is "The maintenance methods of Monstera are as follows: 1. Light: Monstera does not need strong light, and should be placed in scattered light or morning sunlight, avoiding direct sunlight①......5. Fertilization: Monstera needs sufficient nutrients to support its growth, maintain an appropriate amount of nutrient liquid fertilizer once every half a month, and increase the amount of slow-release fertilizer in the soil①. Reference source: 1. Flowers and Trees Say", which is marked with multiple reference sources "①", and the reference source "1. Flowers and Trees Say", when the user clicks on any of the marked reference sources "①" in the target answer, the search result page corresponding to the reference source is displayed above the dialogue page, and the anchor point jumps to the position of the quoted text fragment and highlights it, such as Figure 7 The text snippet in the dashed box.

[0254] like Figure 8 As shown, when the reference source "1. Hua Mu Shuo" in the target answer is clicked, the page of "1. Hua Mu Shuo" can be displayed above the dialogue page based on the page address information of "1. Hua Mu Shuo", and the content of "1. Hua Mu Shuo" is displayed from beginning to end on this page.

[0255] In other examples, when a citation source is triggered, the corresponding content in the target answer can also be selected, for example, by selecting the corresponding content with a mouse, and when a citation source or a reference source is triggered, summary information of the search results corresponding to the citation source or the reference source can be displayed in a summary card, and the full text can be displayed after the corresponding control is triggered.

[0256] For example, Fig. 9 As shown, in the target answer output on the dialogue page, the user selects "Originally from the tropical rain forest of Mexico, it can be grown outdoors in the south of China and is generally grown indoors in the north. The leaves of Monstera are rich and diverse and highly ornamental. Monstera has the flower language of longevity, health, and vitality, and the meaning is very beautiful." After this content, a summary card is displayed on the right side of the dialogue page. The summary card displays the summary information of the reference source of the above selected content "[Plant Culture] Monstera is related to "turtle" because of its name, and it grows vigorously and greenly, with the meaning of longevity, health, vitality, etc." When the "Show Full Text" control is triggered, all the content corresponding to the reference source can be displayed. In addition, when the triggered reference source includes multiple different reference sources, the summary card can also turn pages, which can be achieved by triggering the page turning control, and displaying the serial number of the reference source in the summary card, such as "1", "2", etc. In addition, multimedia resources such as pictures and videos can also be displayed in the summary card.

[0257] For example, Fig.10 As shown, there is only one citation source in the target answer. After selecting any content in the target answer, a summary card is displayed on the right side of the conversation page. The summary card displays the citation source of the selected content. Part of the citation source can be displayed first, and when the "Show full text" control is triggered, all the content corresponding to the citation source can be displayed.

[0258] In some embodiments, while displaying the target answer, extended questions can also be asked to the user based on the target question raised by the user and the target answer obtained. For example, the target question raised by the user is "Please introduce me to Monstera deliciosa". While displaying the target answer, an extended question "Do you want to grow Monstera deliciosa?" can also be displayed to enhance the user's conversation experience.

[0259] Optionally, while displaying the extended question, the extended answer to the extended question can also be displayed. When the user triggers the extended answer, the extended answer can be displayed as a reply. For example, for the extended question "Do you want to grow Monstera?", the extended answer given can be "Yes, how to grow Monstera?", "What are the benefits of growing Monstera?", "Is Monstera poisonous?", etc., thereby further improving the user's conversation experience. Among them, the display position of the extended answer can be set as needed, such as above the input box, etc., so that the user can select the extended answer.

[0260] Combine the following Fig.11 and Fig.12 An exemplary introduction is given to the interaction process between the user and the above-mentioned dialogue product.

[0261] During the interaction between the user and the client on the terminal device, since the overall process takes a long time, after the user enters the target question on the dialogue page of the dialogue client, the server triggers the entire answer generation process. At the same time, the dialogue client and the server can query whether the target answer has been generated through asynchronous polling.

[0262] For example, Fig.11 As shown, after the user enters the target question in the dialogue page of the client, the terminal device sends the target question to the server, and the dialogue processing communication interface of the server inputs the target question to the dialogue service module, and the dialogue service module combines the search engine and ChatGPT to generate the target answer. Specifically, the search engine searches for each search result corresponding to the key search information, and ChatGPT obtains the relevant target content based on each search result to generate the target answer, and stores the target answer (which may also include source information) in the database. For example, when the database is a KV (Key-value) database,<user,questionid> As the key, the target answer is written into the KV database as the value. The client can call the page communication interface, such as WebCGI (Web Common Gateway Interface), through the key at a certain time interval to obtain the corresponding target answer in an asynchronous polling manner. The page communication interface calls the database to obtain the generated target answer.

[0263] like Fig.12 As shown in the figure, the dialogue service module combines the search engine and ChatGPT to generate the target answer. After the dialogue service module obtains the target question, it can receive the instruction issued by ChatGPT, such as the search instruction (such as #search in the above embodiment). <query>), segment browsing instructions (such as the #read<docid,n> ), quoting instructions (such as the #quote in the above example) <extract>). When the dialogue service module outputs a search instruction, the key search information (query) can be obtained, and then the search engine is called to search, each search result is obtained and the summary information is extracted; when the dialogue service module outputs a segmented browsing instruction, multiple segments of a search result can be obtained for browsing through ChatGPT; when the dialogue service module outputs a reference instruction, the target content in the search result is recorded for reference.

[0264] Based on the same inventive concept as the above-mentioned method embodiment, an answer generating device is also provided in the embodiment of the present application. The principle of solving the problem by the device is similar to the product defect detection method of the above-mentioned embodiment. Therefore, the implementation of the device can refer to the implementation of the above-mentioned method, and the repeated parts will not be repeated.

[0265] like Fig.13 As shown, it is a schematic diagram of the structure of the answer generation device, which may include:

[0266] A search module 131 is used to extract key search information based on the target question, obtain search results based on the key search information, and extract summary information of each search result;

[0267] The iteration module 132 is used to perform the following operations in an iterative manner until it is determined that the obtained candidate answer meets the preset condition:

[0268] Obtaining the latest semantic analysis results of each summary information, and when determining that there is at least one search result related to the key search information based on the obtained semantic analysis results, obtaining target content matching the key search information from the at least one search result;

[0269] Obtain candidate answers based on the target content, and when it is determined that the candidate answers do not meet the preset conditions, update the key search information based on the semantic information of the target question and the candidate answers, obtain new search results based on the updated key search information, and extract summary information of each new search result;

[0270] The generating module 133 is used to generate a target answer based on the obtained candidate answers.

[0271] In an embodiment of the present application, when it is determined that the currently obtained candidate answers are insufficient to generate the target answer, by updating the key search information to search for new search results, candidate answers that better match the target question can be gradually obtained, and then the final target answer is generated based on the candidate answers, which can improve the accuracy of the generated answers and improve the question-answering efficiency of the automatic question-answering system.

[0272] Optionally, when it is determined based on each obtained semantic analysis result that there is at least one search result related to the key search information, when obtaining target content matching the key search information from the at least one search result, the iteration module 132 is specifically configured to:

[0273] For each semantic analysis result obtained, perform the following operations respectively:

[0274] When a corresponding search result is determined to be related to key search information based on a semantic analysis result through a pre-trained generative language model, a browsing instruction for the corresponding search result is generated;

[0275] Based on the browsing instruction of the corresponding search result, obtaining the target sub-content matching the key search information from the corresponding search result;

[0276] Based on the acquired at least one target sub-content, target content is obtained.

[0277] Optionally, when acquiring target sub-contents matching the key search information from the corresponding search results based on the browsing instructions of the corresponding search results, the iteration module 132 is specifically configured to:

[0278] Based on the browsing instructions of the corresponding search results, selecting at least one candidate text segment from the multiple text segments according to the text similarity between each of the multiple text segments in the search results and the key search information;

[0279] Through the generative language model, the text semantic information of each of the at least one selected candidate text fragment is obtained respectively, and based on the at least one text semantic information, a target text fragment matching the key search information is selected from the at least one candidate text fragment, and the target sub-content is obtained based on the target text fragment.

[0280] Optionally, when selecting at least one candidate text segment from multiple text segments according to the text similarity between each of multiple text segments in a search result and the key search information, the iteration module is specifically configured to:

[0281] If there is at least one text segment among the multiple text segments in a search result whose text similarity with the key search information satisfies the similarity condition, then the at least one text segment is used as a candidate text segment;

[0282] If there is no text segment whose similarity with the key search information satisfies the similarity condition among the multiple text segments in a search result, each of the multiple text segments is used as a candidate text segment.

[0283] Optionally, when obtaining the target sub-content based on the target text segment, the iteration module 132 is specifically used to:

[0284] Use the target text fragment as the target subcontent; or

[0285] Extract the fragment summary information of the target text fragment and use the fragment summary information as the target sub-content.

[0286] Optionally, when it is determined that the candidate answer does not meet the preset condition, when the key search information is updated, the iteration module 132 is specifically used to:

[0287] With a generative language model, we can do the following:

[0288] When it is determined that the candidate answer does not meet the preset condition, new question requirement information is determined based on the semantic information of the target question, the semantic information of the key search information, and the semantic information of the candidate answer;

[0289] Based on the new problem requirement information, the key search information is updated, and a search instruction is generated, wherein the search instruction is used to instruct to search based on the updated key search information.

[0290] Optionally, the preset condition includes any of the following:

[0291] The text length of the candidate answer reaches the upper limit;

[0292] The semantic match between the candidate answer and the target question reaches the preset threshold;

[0293] The number of iterations reaches the upper limit;

[0294] The iteration duration reaches the upper limit;

[0295] Receive answer output instruction.

[0296] Optionally, when obtaining candidate answers based on the target content, the iteration module 132 is specifically used to:

[0297] When it is determined that there are candidate answers obtained before this iteration, based on the target content obtained in this iteration, the candidate answers obtained before this iteration are updated to obtain updated candidate answers;

[0298] When it is determined that there is no candidate content obtained before this iteration, a candidate answer is obtained based on the target content obtained in this iteration.

[0299] Optionally, the iteration module 132 is further configured to:

[0300] When it is determined based on each of the obtained semantic analysis results that there is no at least one search result related to the key search information, the key search information is updated based on the semantic information of the target question and the candidate answer;

[0301] New search results are obtained based on the updated key search information, and summary information of each new search result is extracted.

[0302] Optional, such as Fig.14 As shown, the device also includes:

[0303] The recording module 134 is used to record the source information of the target content obtained each time, and the source information includes at least one of the following:

[0304] The page address information of the search results corresponding to the target content;

[0305] The location information of the target content in the corresponding search results;

[0306] The generation module 133 is specifically used for:

[0307] At least one target content contained in the candidate answer and source information of each target content are combined into a target answer.

[0308] After introducing the answer generation method and device according to the exemplary embodiment of the present application, next, an electronic device according to another exemplary embodiment of the present application is introduced.

[0309] Based on the same inventive concept as the above method embodiment, an electronic device is also provided in the embodiment of the present application. In one embodiment, the electronic device may be a server, such as Figure 1 In this embodiment, the structure of the electronic device can be as follows: Fig.15 As shown, it includes a memory 1501 , a communication module 1503 and one or more processors 1502 .

[0310] The memory 1501 is used to store computer programs executed by the processor 1502. The memory 1501 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and programs required for running the instant messaging function, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc.

[0311] The memory 1501 may be a volatile memory, such as a random-access memory (RAM); the memory 1501 may also be a non-volatile memory, such as a read-only memory, a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); or the memory 1501 may be any other medium that can be used to carry or store a desired computer program in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 1501 may be a combination of the above memories.

[0312] The processor 1502 may include one or more central processing units (CPU) or a digital processing unit, etc. The processor 1502 is used to implement the above-mentioned answer generation method when calling the computer program stored in the memory 1501 .

[0313] The communication module 1503 is used to communicate with terminal devices and other servers.

[0314] The specific connection medium between the memory 1501, the communication module 1503 and the processor 1502 is not limited in the embodiment of the present application. Fig.15 In the embodiment, the memory 1501 and the processor 1502 are connected via a bus 1504. The bus 1504 is connected to the processor 1502 via a bus 1504. Fig.15 The connections between the other components are described with bold lines, which are only for illustration and are not intended to be limiting. The bus 1504 can be divided into an address bus, a data bus, a control bus, etc. For ease of description, Fig.15 The diagram shows that only one thick line is used, but this does not mean that there is only one bus or only one type of bus.

[0315] In an exemplary embodiment, the present application further provides a storage medium including a computer program, such as a memory 1501 including a computer program, and the computer program can be executed by a processor 1502 of an electronic device to complete the above-mentioned answer generation method. Optionally, the storage medium can be a non-temporary computer-readable storage medium, for example, the non-temporary computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0316] In another embodiment, the electronic device may also be other electronic devices, such as Figure 1 The terminal device 110 shown in FIG. 1 is a terminal device 110 shown in FIG. 1 . In this embodiment, the structure of the electronic device can be as follows: Fig.16 As shown, it includes: a communication component 1610, a memory 1620, a display unit 1630, a camera 1640, a sensor 1650, an audio circuit 1660, a Bluetooth module 1670, a processor 1680 and other components.

[0317] The communication component 1610 is used to communicate with the server. In some embodiments, a circuit wireless fidelity (Wireless Fidelity, WiFi) module may be included. The WiFi module belongs to a short-range wireless transmission technology. The electronic device can help the user to send and receive information through the WiFi module.

[0318] The memory 1620 can be used to store software programs and data. The processor 1680 executes various functions and data processing of the terminal device 110 by running the software programs or data stored in the memory 1620. The memory 1620 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device. The memory 1620 stores an operating system that enables the terminal device 110 to run. In the present application, the memory 1620 can store an operating system and various application programs, and can also store a computer program for executing the answer generation method of the embodiment of the present application.

[0319] The display unit 1630 can also be used to display information input by the user or information provided to the user and a graphical user interface (GUI) of various menus of the terminal device 110. Specifically, the display unit 1630 may include a display screen 1632 disposed on the front of the terminal device 110. The display screen 1632 may be configured in the form of a liquid crystal display, a light emitting diode, etc. The display unit 1630 may be used to display the automatic question and answer interface in the embodiment of the present application, etc.

[0320] The display unit 1630 can also be used to receive input digital or character information and generate signal input related to user settings and function control of the terminal device 110. Specifically, the display unit 1630 may include a touch screen 1631 arranged on the front of the terminal device 110, which can collect user touch operations on or near it, such as clicking a button, dragging a scroll box, etc.

[0321] The touch screen 1631 can be covered on the display screen 1632, or the touch screen 1631 and the display screen 1632 can be integrated to realize the input and output functions of the terminal device 110. The integrated touch screen can be referred to as a touch display screen. In this application, the display unit 1630 can display the application and the corresponding operation steps.

[0322] The camera 1640 can be used to capture still images, and the user can publish the images taken by the camera 1640 through the application. The camera 1640 can be one or more. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then passes the electrical signal to the processor 1680 to convert it into a digital image signal.

[0323] The terminal device may further include at least one sensor 1650, such as an acceleration sensor 1651, a distance sensor 1652, a fingerprint sensor 1653, and a temperature sensor 1654. The terminal device may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, a light sensor, and a motion sensor.

[0324] The audio circuit 1660, the speaker 1661, and the microphone 1662 can provide an audio interface between the user and the terminal device 110. The audio circuit 1660 can transmit the electrical signal converted from the received audio data to the speaker 1661, which is converted into a sound signal for output. The terminal device 110 can also be configured with a volume button for adjusting the volume of the sound signal. On the other hand, the microphone 1662 converts the collected sound signal into an electrical signal, which is received by the audio circuit 1660 and converted into audio data, and then the audio data is output to the communication component 1610 to be sent to, for example, another terminal device 110, or the audio data is output to the memory 1620 for further processing.

[0325] The Bluetooth module 1670 is used to exchange information with other Bluetooth devices having Bluetooth modules through the Bluetooth protocol. For example, the terminal device can establish a Bluetooth connection with a wearable electronic device (such as a smart watch) that also has a Bluetooth module through the Bluetooth module 1670 to exchange data.

[0326] The processor 1680 is the control center of the terminal device. It uses various interfaces and lines to connect various parts of the entire terminal. It executes various functions of the terminal device and processes data by running or executing software programs stored in the memory 1620 and calling data stored in the memory 1620. In some embodiments, the processor 1680 may include one or more processing units; the processor 1680 may also integrate an application processor and a baseband processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the baseband processor mainly processes wireless communications. It is understandable that the above-mentioned baseband processor may not be integrated into the processor 1680. In the present application, the processor 1680 can run the operating system, application programs, user interface display and touch response, as well as the answer generation method of the embodiment of the present application. In addition, the processor 1680 is coupled to the display unit 1630.

[0327] In some possible implementations, various aspects of the answer generation method provided by the present application may also be implemented in the form of a computer program product, which includes a computer program. When the computer program product is run on an electronic device, the computer program is used to enable the electronic device to execute the steps of the answer generation method according to various exemplary implementations of the present application described above in this specification. For example, the electronic device may execute the following steps: Figure 2 Follow the steps shown in .

[0328] The computer program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more conductors, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0329] The computer program product of the embodiment of the present application may adopt a portable compact disk read-only memory (CD-ROM) and include a computer program, and can be run on an electronic device. However, the computer program product of the present application is not limited thereto, and in this document, a readable storage medium may be any tangible medium containing or storing a program, which can be used by or in combination with a command execution system, apparatus, or device.

[0330] A readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, wherein a readable computer program is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with a command execution system, apparatus, or device.

[0331] The computer program embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0332] The computer program for performing the operation of the present application can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and also conventional procedural programming languages ​​such as "C" language or similar programming languages. The computer program can be executed entirely on the user electronic device, partially on the user electronic device, as a separate software package, partially on the user electronic device and partially on a remote electronic device, or entirely on a remote electronic device or server. In the case of a remote electronic device, the remote electronic device can be connected to the user electronic device through any type of network including a local area network (LAN) or a wide area network (WAN), or can be connected to an external electronic device (for example, using an Internet service provider to connect through the Internet).

[0333] It should be noted that, although several modules or submodules of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules described above can be embodied in one unit. Conversely, the features and functions of one module described above can be further divided into multiple modules to be embodied.

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

[0335] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain a computer-usable computer program.

[0336] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0337] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.< / extract> < / query> < / text> < / extract1> < / question> < / extract> < / abstract> < / docid> < / query> < / extract> < / query> < / text> < / extract1> < / question> < / extract> < / extract> < / extract> < / query> < / query>

Claims

1. A method for generating an answer, It is characterized in that The method comprises: Extracting key search information based on the target question, obtaining search results based on the key search information, and extracting summary information of each search result; The following operations are performed iteratively until the candidate answer is determined to meet the preset conditions: Obtaining the latest semantic analysis results of each summary information, and when determining that there is at least one search result related to the key search information based on the obtained semantic analysis results, obtaining target content matching the key search information from the at least one search result; The candidate answer is obtained based on the target content, and when it is determined that the candidate answer does not meet the preset condition, the key search information is updated based on the semantic information of the target question and the candidate answer, and new search results are obtained based on the updated key search information. and extracting summary information of each of the new search results; A target answer is generated based on the obtained candidate answers.

2. The method according to claim 1, It is characterized in that When it is determined based on each obtained semantic analysis result that there is at least one search result related to the key search information, obtaining target content matching the key search information from the at least one search result includes: For each semantic analysis result obtained, perform the following operations respectively: When determining, through a pre-trained generative language model, that a corresponding search result is related to the key search information based on a semantic analysis result, generating a browsing instruction for the corresponding search result; Based on the browsing instruction of the corresponding search result, acquiring target sub-content matching the key search information from the corresponding search result; The target content is obtained based on the acquired at least one target sub-content.

3. The method according to claim 2, It is characterized in that The step of acquiring target sub-content matching the key search information from the corresponding search results based on the browsing instruction of the corresponding search results includes: Based on the browsing instruction of the corresponding search result, selecting at least one candidate text segment from the multiple text segments in a search result according to the text similarity between each of the multiple text segments and the key search information; Through the generative language model, the text semantic information of each of the at least one selected candidate text fragment is obtained respectively, and based on the at least one text semantic information, a target text fragment matching the key search information is selected from the at least one candidate text fragment, and the target sub-content is obtained based on the target text fragment.

4. The method according to claim 3, It is characterized in that The selecting at least one candidate text segment from the multiple text segments according to the text similarity between each of the multiple text segments in a search result and the key search information comprises: If there is at least one text segment among the multiple text segments in the search result whose text similarity with the key search information satisfies the similarity condition, the at least one text segment is used as a candidate text segment; If there is no text segment in the search result whose similarity with the key search information satisfies the similarity condition, each of the multiple text segments is used as a candidate text segment.

5. The method according to claim 3, It is characterized in that The obtaining the target sub-content based on the target text segment includes: Using the target text segment as the target sub-content; or Extract the segment summary information of the target text segment, and use the segment summary information as the target sub-content.

6. The method according to claim 2, It is characterized in that When it is determined that the candidate answer does not satisfy the preset condition, updating the key search information based on the semantic information of the target question and the candidate answer, includes: Through the generative language model, the following operations are performed: When it is determined that the candidate answer does not satisfy the preset condition, new question requirement information is determined based on the semantic information of the target question, the semantic information of the key search information, and the semantic information of the candidate answer; Based on the new question requirement information, the key search information is updated and a search instruction is generated, wherein the search instruction is used to instruct to search based on the updated key search information.

7. The method according to any one of claims 1 to 5, It is characterized in that The preset condition includes any one of the following: The text length of the candidate answer reaches the upper limit; The semantic matching degree between the candidate answer and the target question reaches a preset threshold; The number of iterations reaches the upper limit; The iteration duration reaches the upper limit; Receive answer output instruction.

8. The method according to any one of claims 1 to 5, It is characterized in that The obtaining the candidate answer based on the target content includes: When it is determined that there are candidate answers obtained before this iteration, based on the target content obtained in this iteration, the candidate answers obtained before this iteration are updated to obtain updated candidate answers; When it is determined that there is no candidate content obtained before this iteration, the candidate answer is obtained based on the target content obtained in this iteration.

9. The method according to any one of claims 1 to 5, It is characterized in that In each iteration, it also includes: When it is determined based on each of the obtained semantic analysis results that there is no at least one search result related to the key search information, the key search information is updated based on the semantic information of the target question and the candidate answer; New search results are obtained based on the updated key search information, and summary information of each of the new search results is extracted.

10. The method according to any one of claims 1 to 5, It is characterized in that The method further comprises: Record the source information of the target content obtained each time, where the source information includes at least one of the following: The page address information of the search results corresponding to the target content; The location information of the target content in the corresponding search results; Generating a target answer based on the obtained candidate answers includes: At least one target content included in the candidate answer and source information of each target content are combined into the target answer.

11. An answer generating device, It is characterized in that The device comprises: A search module, used to extract key search information based on a target question, obtain search results based on the key search information, and extract summary information of each search result; The iteration module is used to perform the following operations in an iterative manner until it is determined that the obtained candidate answer meets the preset conditions: Obtaining the latest semantic analysis results of each summary information, and when determining that there is at least one search result related to the key search information based on the obtained semantic analysis results, obtaining target content matching the key search information from the at least one search result; The candidate answer is obtained based on the target content, and when it is determined that the candidate answer does not meet the preset condition, the key search information is updated based on the semantic information of the target question and the candidate answer, and new search results are obtained based on the updated key search information. and extracting summary information of each of the new search results; A generating module is used to generate a target answer based on the obtained candidate answers.

12. The device according to claim 11, It is characterized in that When it is determined based on each obtained semantic analysis result that there is at least one search result related to the key search information, when obtaining target content matching the key search information from the at least one search result, the iteration module is specifically used to: For each semantic analysis result obtained, perform the following operations respectively: When determining, through a pre-trained generative language model, that a corresponding search result is related to the key search information based on a semantic analysis result, generating a browsing instruction for the corresponding search result; Based on the browsing instruction of the corresponding search result, acquiring target sub-content matching the key search information from the corresponding search result; The target content is obtained based on the acquired at least one target sub-content.

13. An electronic device, It is characterized in that The method comprises a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of any one of the methods of claims 1 to 10.

14. A computer-readable storage medium, It is characterized in that The method comprises a computer program. When the computer program is run on an electronic device, the computer program is used to enable the electronic device to execute the steps of any one of the methods of claims 1 to 10.

15. A computer program product, It is characterized in that The method comprises a computer program stored in a computer-readable storage medium; when a processor of an electronic device reads the computer program from the computer-readable storage medium, the processor executes the computer program, so that the electronic device executes the steps of any one of the methods described in claims 1 to 10.

Citation Information

Cited By

  • Question and answer processing method and device

    CN119323262A

  • Searching method and device and arbitration problem searching method

    CN119719313A

  • Text generation method and device based on intelligent agent, equipment and storage medium

    CN119740669A

  • Agent-based text generation method, device, equipment, and storage medium

    CN119740669B

  • Response information generation method, question answering system and electronic equipment

    CN120780817A