Large model-based question and answer method and device, electronic equipment, storage medium, intelligent agent and program product
By using a large model to uniformly process multiple tasks in answer generation and prompting, the system solves the problem of unintended consequences in multi-task execution in existing search enhancement systems, thereby improving the accuracy of answer generation and the overall processing efficiency of the system.
Patent Information
- Application Number
- CN202411132084.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-16
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2044-08-16
AI Technical Summary
Existing retrieval enhancement systems lack overall system consideration when executing multiple related tasks, resulting in unexpected execution results. Furthermore, the small model capabilities of each sub-module are limited, with poor generalization and transferability.
A large model is used to uniformly process multiple tasks integrated into the answer generation prompts. By inputting the question, the search content set, and the answer generation prompts into the large model together, end-to-end unified processing is achieved, improving the accuracy of answer generation.
This improved the accuracy of answer generation, reduced the problem of illusions when large models perform multiple tasks, and improved the overall processing efficiency and accuracy of the system.
Smart Images

Figure CN118981527B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of artificial intelligence, in particular to the technical fields of large models, intelligent search, information processing, etc., and specifically relates to a large model-based question answering method and device, an electronic device, a storage medium, an agent and a program product. BACKGROUND
[0002] With the rapid development of computers and information technology, the application of artificial intelligence has made great progress. For example, based on large models, natural language processing technology can understand user questions and provide corresponding answers. However, how to further improve the accuracy of large model-generated answers is still a problem. SUMMARY
[0003] The present disclosure provides a large model-based question answering method, device, electronic device, storage medium, agent and program product.
[0004] According to an aspect of the present disclosure, a large model-based question answering method is provided, including: in response to a search content set retrieved based on a question, inputting the question, the search content set and answer generation prompt information to a large model, causing the large model to perform the following operations: based on a current to-be-executed task in the answer generation prompt information and the question, processing a current text corresponding to the search content set to obtain a processed text, wherein the current to-be-executed task is determined based on a task execution order in the answer generation prompt information; and in a case where it is determined that the processed text meets a preset condition, obtaining an answer to the question based on the processed text.
[0005] According to another aspect of the present disclosure, a large model-based question answering device is provided, including: a processing module configured to, in response to a search content set retrieved based on a question, input the question, the search content set and answer generation prompt information to a large model, causing the large model to perform the following operations: based on a current to-be-executed task in the answer generation prompt information and the question, processing a current text corresponding to the search content set to obtain a processed text, wherein the current to-be-executed task is determined based on a task execution order in the answer generation prompt information; and a generation module configured to, in a case where it is determined that the processed text meets a preset condition, obtain an answer to the question based on the processed text.
[0006] According to another aspect of the present disclosure, an electronic device is provided, including: at least one processor; and a memory communicatively connected with the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method described above.
[0007] According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to perform the method as described above.
[0008] According to another aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the method as described above.
[0009] According to another aspect of the present disclosure, there is provided an agent configured to perform the method as described above.
[0010] It should be understood that the contents described in this part are not intended to identify key or important features of the embodiments of the present disclosure, nor to limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0011] The accompanying drawings are used to better understand the present scheme, and do not limit the present disclosure. Among them:
[0012] Figure 1 An exemplary system architecture to which the large model-based question answering method and device according to embodiments of the present disclosure can be applied is schematically shown;
[0013] Figure 2 A flowchart of the large model-based question answering method according to embodiments of the present disclosure is schematically shown;
[0014] Figure 3 A module diagram of a conventional question answering system according to related examples is schematically shown;
[0015] Figure 4 A module diagram of a large model-based question answering system according to embodiments of the present disclosure is schematically shown;
[0016] Figure 5 A template schematic diagram of question analysis prompt information according to embodiments of the present disclosure is schematically shown;
[0017] Figure 6 A template schematic diagram of answer generation prompt information according to another embodiment of the present disclosure is schematically shown;
[0018] Figure 7 An effect schematic diagram of an answer according to embodiments of the present disclosure is schematically shown;
[0019] Figure 8 A schematic diagram of an agent according to embodiments of the present disclosure is schematically shown;
[0020] Figure 9A block diagram of a large model-based question answering device is illustratively shown according to an embodiment of the present disclosure; and
[0021] Figure 10 A block diagram of an electronic device is illustratively shown according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0022] Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, which include various details of the embodiments of the present disclosure to assist in understanding, which should be considered in a descriptive sense only. It will thus be appreciated that various modifications and changes can be made to the embodiments described herein without departing from the scope and spirit of the disclosure. Likewise, the description and the illustrations are not intended to limit the scope of the disclosure to particular embodiments described, but the scope of the disclosure will be established by the appended claims.
[0023] The retrieval enhancement system is a relatively mature technical solution in current applications, which has wide application in search engine optimization, virtual assistants, intelligent customer service, knowledge Q&A, etc. It helps large models solve problems in knowledge acquisition and updating by using information in external knowledge bases.
[0024] However, the existing retrieval enhancement system connects multiple sub-modules in function, and each sub-module needs to make its own internal data construction, training and optimization, and parameter adaptation. The output of each step needs to be set manually. This method lacks overall system consideration among the sub-modules, and the small models involved in each sub-module have limited capabilities. When performing a single task, it can have good results, but when performing multiple related tasks, it may not meet the expected execution result.
[0025] The large model-based question answering method provided by the present disclosure includes: in response to a retrieved content set based on a question, inputting the question, the retrieved content set, and answer generation prompt information into a large model, and making the large model perform the following operations: processing a current text corresponding to the retrieved content set based on a current to-be-executed task in the answer generation prompt information and the question, to obtain a processed text, wherein the current to-be-executed task is determined based on a task execution order in the answer generation prompt information; and in a case where the processed text meets a preset condition, obtaining an answer to the question based on the processed text. By inputting the answer generation prompt information, the question, and the retrieved content set into the large model together, the high processing capability of the large model can be utilized to uniformly execute multiple to-be-executed tasks integrated in the answer generation prompt information to process the current text, realizing end-to-end unified processing, improving the accuracy of answer generation, and reducing the problem of hallucination of the large model.
[0026] Figure 1 An exemplary system architecture to which the large model-based question answering method and device can be applied is illustratively shown according to an embodiment of the present disclosure.
[0027] It should be noted that Figure 1 The system architecture shown is only an example of a system architecture to which the embodiments of the present disclosure can be applied, to help those skilled in the art understand the technical content of the present disclosure, but does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios. For example, in another embodiment, an exemplary system architecture to which the large model-based question and answer method and device can be applied can include terminal devices, but the terminal devices can not need to interact with the server to implement the large model-based question and answer method and device provided by the embodiments of the present disclosure.
[0028] As Figure 1 shown, the system architecture 100 according to the embodiment can include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is a medium for providing a communication link between the terminal devices 101, 102, 103 and the server 105. The network 104 can include various connection types, such as wired and / or wireless communication links, etc.
[0029] A user can use the terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 101, 102, 103, such as knowledge reading applications, web browser applications, search applications, instant messaging tools, email clients and / or social platform software, etc. (only as examples).
[0030] The terminal devices 101, 102, 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smartphones, tablet computers, laptop computers and desktop computers, etc.
[0031] The server 105 can be a server providing various services, such as a background management server providing support for content browsed by a user using the terminal devices 101, 102, 103 (only as an example). The background management server can analyze and process received user requests, etc. containing questions, and feed back the processing results (such as web pages, information, answers or data, etc. obtained or generated according to user requests) to the terminal devices.
[0032] Optionally, the server 105 can run one or more services or software applications that enable an agent to be executed. A user can use the terminal devices 101, 102, 103 to interact with the agent.
[0033] It should be noted that the question and answer method provided by the embodiments of the present disclosure can generally be executed by the terminal device 101, 102, or 103. Accordingly, the question and answer device provided by the embodiments of the present disclosure can also be arranged in the terminal device 101, 102, or 103.
[0034] Alternatively, the question and answer method provided by the embodiments of the present disclosure can also be generally executed by the server 105. Accordingly, the question and answer device provided by the embodiments of the present disclosure can be generally arranged in the server 105. The question and answer method provided by the embodiments of the present disclosure can also be executed by a server or server cluster different from the server 105 and capable of communicating with the terminal device 101, 102, 103 and / or the server 105. Accordingly, the question and answer device provided by the embodiments of the present disclosure can also be arranged in a server or server cluster different from the server 105 and capable of communicating with the terminal device 101, 102, 103 and / or the server 105.
[0035] For example, when the user inputs a question through the text box, the terminal device 101, 102, 103 can acquire the input question, and then send the acquired question to the server 105, so that the server 105 analyzes the question and determines a search content set; inputs the search content set, the question, and answer generation prompt information into a large model to obtain an answer to the question. Alternatively, a server or server cluster capable of communicating with the terminal device 101, 102, 103 and / or the server 105 can analyze the question and ultimately obtain an answer to the question. The answer to the question can be transmitted to the terminal device 101, 102, 103 to be displayed to the user, thereby completing the question and answer interaction.
[0036] It should be understood that Figure 1 The number of terminal devices, networks, and servers in the above-mentioned system is only illustrative. According to the needs of implementation, there can be any number of terminal devices, networks, and servers.
[0037] In the technical solutions of the present disclosure, the collection, storage, use, processing, transmission, provision, disclosure, and application of user personal information comply with relevant laws and regulations, necessary security measures are taken, and public order and good customs are not violated.
[0038] In the technical solutions of the present disclosure, the authorization or consent of the user is obtained before the user personal information is acquired or collected.
[0039] Figure 2 is a flowchart of the question and answer method based on a large model according to the embodiments of the present disclosure.
[0040] As shown in Figure 2 The question and answer method can include operations S210-S230.
[0041] At operation S210, in response to the retrieved content set based on the question, the question, the retrieved content set, and the answer generation prompt information are input to the large model.
[0042] At operation S220, based on the current to-be-executed task in the answer generation prompt information and the question, the current text corresponding to the retrieved content set is processed to obtain a processed text.
[0043] At operation S230, in a case where it is determined that the processed text meets a preset condition, an answer to the question is obtained based on the processed text.
[0044] According to an embodiment of the present disclosure, the large model-based question and answer method can be executed by a server, but is not limited thereto, and can also be executed by a terminal device or an intelligent agent.
[0045] According to an embodiment of the present disclosure, the retrieved content set can be a set of relevant information retrieved from a plurality of data sources, such as the Internet, a database, a text collection, social media, etc., based on the question. It can include videos, articles, web pages, paragraphs, sentences, or other forms of data, without limitation, as long as it is related to the question raised.
[0046] According to an embodiment of the present disclosure, the answer generation prompt information can be used to indicate how the large model generates an answer based on the provided question and the retrieved content set. The answer prompt information can help the large model understand the task requirements to be executed and guide the large model to perform specific operations to generate an answer.
[0047] The elements contained in the answer generation prompt information include but are not limited to task roles, task descriptions, task rules, answer generation rules, and output formats, etc.
[0048] According to some embodiments of the present disclosure, in response to a question provided by a user, a retrieved content set can be obtained by searching a plurality of data sources. The to-be-executed task in the answer prompt information is executed by using a large model, and the current text corresponding to the retrieved content set is processed according to the to-be-executed task to obtain a processed text meeting a preset condition. It can be understood that if the question is a text content, it can be directly input to the large model, and if it is a voice content or a video content, the voice content or the video content can be converted into corresponding text content for subsequent processing.
[0049] The current text corresponding to the retrieved content set can include the retrieved content set, but is not limited thereto, and can also include content processed from the retrieved content set. For example, content obtained by processing the retrieved content set using a large model.
[0050] According to an embodiment of the present disclosure, the current to-be-executed task is determined based on the task execution order in the answer generation prompt information.
[0051] According to an embodiment of the present disclosure, the task to be performed can be a task of performing a specific operation on the current text to generate or extract text information in a specific form.
[0052] According to an embodiment of the present disclosure, multiple tasks to be performed can be included in the answer generation prompt information, and the order of task execution in the answer generation prompt information determines the order in which the tasks to be performed should be executed to ensure the logic and effectiveness of the entire processing process. When all the tasks to be performed are executed, the processed text can be obtained.
[0053] According to an embodiment of the present disclosure, the preset condition can be one or more. The preset can be based on the requirements for the answer, or multiple preset conditions corresponding to multiple tasks to be processed can be set according to the tasks to be processed.
[0054] According to an embodiment of the present disclosure, in a case where it is determined that the processed text meets the preset condition, the processed text can be taken as the answer to the question. However, it is not limited thereto. The answer can also be directly extracted from the processed text or obtained through certain logical reasoning, or the answer can be obtained by formatting the processed text.
[0055] According to an embodiment of the present disclosure, by inputting the answer generation prompt information, the question, and the retrieved content together into the large model, the high processing capability of the large model can be utilized to uniformly execute the multiple tasks to be performed integrated in the answer generation prompt information to process the current text, realizing end-to-end unified processing, improving the accuracy of answer generation, and reducing the problem of hallucination of the large model when executing multiple tasks to be performed.
[0056] The method shown in Figures 3-7 will be further described below with reference to specific embodiments. Figure 2
[0057] Figure 3 A block diagram of a conventional question answering system according to related examples is schematically shown.
[0058] As shown in Figure 3 , the question answering system includes an input module 310, an analysis module 320, a retrieval module 330, a generation module 340, and an output module 350. The input module 310 is configured to receive a question input by a user. The analysis module 320 is configured to perform retrieval triggering and rewriting of the question. The retrieval module 330 is configured to retrieve from a retrieval library, generate an abstract, and reorder the retrieved content. The generation module 340 is configured to summarize the retrieved content and generate a result. The output module 350 is configured to output the answer. Each module is relatively independent and is responsible for different functions, and the input and output of multiple modules are connected through a pipeline.
[0059] The above-mentioned mode needs to make respective internal data construction, training optimization and parameter adaptation for each module, and the output of each step needs to set rules and thresholds artificially, and has poor generalization. The summary generation and retrieval rearrangement model are both small models, and are weak in content integrity and understanding, which not only loses the key information of the retrieved content, but also makes poor retrieval resources better than high-quality resources input generation model, resulting in that the correct information that the generation model can refer to is less, and the quality of the reply generated by the generation module is poor. When new consideration features need to be added (such as time features, authority features, etc.), multiple sub-modules need to be adjusted again, and the thresholds of each sub-module need to be regressed and set again, which has low migration and cannot be quickly migrated.
[0060] Figure 4 A module diagram of a question and answer system according to an embodiment of the present disclosure is schematically shown.
[0061] As shown in Figure 4 , the question and answer system includes an input module 410, a processing module 420 and an output module 430. The question input by the user is received through the input module 410, and the whole processing process is uniformly processed through the processing module 420. Specifically, a large model is used for question understanding and retrieval trigger judgment, and when retrieval is performed, a large model is used for question rewriting. And use multiple rewritten questions to retrieve, and input the retrieval content set into the large model at one time, use the large model to arrange the content of the retrieval content set, and generate the processed text. The answer is output through the output module 430. The large model is realized end-to-end uniform processing, so that the question and answer system is greatly improved as a whole.
[0062] According to an embodiment of the present disclosure, before operation S210 shown in Figure 2 is performed, the question and answer method can further include: acquiring a retrieval content set.
[0063] The retrieval content set can be acquired from multiple data sources based on the question. However, it is not limited thereto. The question can also be rewritten to obtain multiple rewritten questions. The retrieval content set is acquired from multiple data sources based on the multiple rewritten questions.
[0064] Optionally, the large model can be used to perform the content of rewriting the question.
[0065] The question analysis and rewriting task performed by the large model will be described in detail below.
[0066] According to an embodiment of the present disclosure, in response to receiving a question, the question and question analysis prompt information are input to the large model, so that the large model performs the following operations: based on the retrieval trigger identification task in the question analysis prompt information, the question is analyzed for retrieval trigger analysis, and a retrieval trigger analysis result is obtained. In the case where the retrieval trigger analysis result represents that the retrieval operation needs to be triggered, the question is rewritten based on the question rewriting task in the question analysis prompt information, and a plurality of rewritten questions are obtained, so that a retrieval content set is obtained based on the plurality of rewritten questions.
[0067] According to an embodiment of the present disclosure, the question prompt information can be a preset prompt template, which contains a series of rules, prompts or instructions, etc., to form a retrieval trigger identification task. It can be used to guide the large model to understand and analyze the question, for example, to help the large model determine whether the user's question has timeliness, whether it is objective knowledge or whether it is beyond the knowledge boundary of the large model, etc., to determine whether the question needs to be retrieved.
[0068] For example, the user's question is "How is the weather today?" The question contains a specific timeliness requirement of "today", and "How is the weather" also exceeds the knowledge boundary of the large model, and the latest weather information needs to be obtained through an external weather information platform. At this time, only the large model can answer after retrieval.
[0069] According to some embodiments of the present disclosure, since some questions of the user can be complex, it is difficult to directly query the ideal knowledge in the traditional retrieval system based on semantic matching, and it is necessary to understand the semantics of the original question and rewrite the original question, so as to obtain better retrieval results in the retrieval system. The overall principle of question rewriting is to first retain complete information and not to lose any details that may affect the accuracy of the answer. Further, the question is divided into key parts, and core terms or keywords are extracted as the basis for understanding the question and retrieving related answers.
[0070] For questions with timeliness requirements, the question containing corresponding time information needs to be rewritten first. If the original question contains timeliness requirements, a question containing specific time information is first constructed to obtain the latest related information. Then, the question without explicit time words is rewritten. If the original question does not have explicit time words, a question without time words is constructed to expand the retrieval range and prevent missing possible related answers.
[0071] For example, the user's question is "How much is the sales of product A in the past five months and the past year in China?" The question contains two explicit time words. After rewriting the question by the large model, the following questions are obtained: "How much is the sales of product A in the past five months in China?", "How much is the sales of product A in the past five months in China in July 2024?", "How much is the sales of product A in the past year in China?", and "How much is the sales of product A in the past year in China in 2024". Through semantic splitting of the question and expansion of the time information, the user's intention can be more completely captured. If the rewriting method based on the small model is used, the original question will usually be split into "How much is the sales of product A in the past five months in China?" and "How much is the sales of product A in the past year in China?". This way lacks expansion of the time information, and the retrieved results may be too broad to accurately capture the user's intention.
[0072] According to an embodiment of the present disclosure, by using the question analysis prompt information, the large model can more effectively process various complex questions. Through retrieval trigger analysis and question rewriting, the diversity and coverage of the retrieved information can be increased, and information omission can be reduced, so that the user's demand can be more accurately located and understood, and more accurate answers can be provided.
[0073] According to an embodiment of the present disclosure, in the case where the retrieval trigger analysis result represents that the retrieval operation does not need to be triggered, an answer to the question is generated based on the question.
[0074] Specifically, if it is judged that the user's question involves objective knowledge and does not exceed the knowledge boundary of the large model itself, the question can be directly answered by the built-in knowledge base of the large model, and in this case, external retrieval is not needed, and the large model can also provide accurate, relevant and useful answers.
[0075] For example, if the user's question is "What is the diameter of the Earth?", in this case, no additional retrieval operation is needed, and the question can be directly answered by the built-in knowledge base of the large model.
[0076] According to an embodiment of the present disclosure, by analyzing the question, when the large model is directly used to answer without external retrieval, the answering speed can be accelerated, and a faster response time can be provided.
[0077] According to an embodiment of the present disclosure, based on the question rewriting task in the question analysis prompt information, the question is rewritten to obtain a plurality of rewritten questions, including: rewriting the question based on a rewriting rule in the question rewriting task that matches the question type of the question to obtain a plurality of rewritten questions.
[0078] According to an embodiment of the present disclosure, when different types of questions are processed, specific processing principles or strategies need to be adopted according to the specific scene or type to which the question belongs.
[0079] For example, for the rewriting of prediction type questions, the specific object of prediction, the time range of prediction, the geographical range, etc. need to be specified. The rewritten question should be clearly directed to the future and focus on events, trends or results that are about to happen or may happen. For subjective type rewriting, the rewritten question should focus on personal opinions, feelings or evaluations. Specify the specific object of subjective evaluation, such as products, services, events, etc. For multilingual rewriting, it is necessary to ensure that the rewritten question maintains the original meaning and context of the original question. Consider the cultural background and habits of the target language to ensure that the rewritten question is natural and fluent in the target language.
[0080] According to an embodiment of the present disclosure, by explicitly mapping the rewriting rules and question types in the question analysis prompt information, the large model can be guided to perform the question rewriting task, and the rewriting rules matched with the question types are used to rewrite the question, which can ensure that the rewritten question accurately reflects the user's intention and improves the accuracy and efficiency of retrieval.
[0081] According to an embodiment of the present disclosure, based on the question rewriting task in the question analysis prompt information, the question is rewritten to obtain a plurality of rewritten questions, including: based on the question rewriting task, the question is rewritten to obtain a plurality of initial rewritten questions. In the case where the correlation between each of the plurality of initial rewritten questions and the question satisfies the correlation threshold in the question rewriting task, based on the plurality of initial rewritten questions, a plurality of rewritten questions are obtained.
[0082] According to an embodiment of the present disclosure, the correlation between each initial rewritten question and the question is an important indicator of rewriting quality. It can calculate the semantic similarity of the question and the initial rewritten question using natural language processing technology. Whether the initial rewritten question retains the key information of the question can be determined by analyzing the keywords of the question and the initial rewritten question.
[0083] According to an embodiment of the present disclosure, by setting the correlation threshold in the question analysis prompt information, the large model can determine whether the initial rewritten question after rewriting meets the expectation, so as to filter the plurality of initial rewritten questions by itself, and further ensure that the question for retrieval can accurately reflect the core intention and query requirements of the original question, thereby improving the accuracy of retrieval and the stability of the large model in end-to-end question answering.
[0084] According to embodiments of this disclosure, metrics for measuring rewriting quality may also include rewriting availability and the impact on the quality of end-to-end generated results. Rewriting availability represents the effective proportion of rewrites that can be successfully understood by search engines and used for retrieval. It can reflect the stability and practicality of large-scale model rewriting. End-to-end generated results refer to the entire process from problem input to final result output. As the rewriting understanding of the problem is part of this entire process, rewriting quality directly affects the accuracy and relevance of the final results. Therefore, these two metrics can be used to evaluate the quality of the rewriting.
[0085] Figure 5 The illustration shows a template diagram of problem analysis prompt information according to an embodiment of the present disclosure.
[0086] like Figure 5 As shown, the problem analysis prompts, from top to bottom, include task role 510, problem rewriting task 520, problem rewriting example 530, and problem preset position 540. Task role 510 defines the role played by the large model. Problem rewriting task 520 contains multiple rewriting principles, also known as rewriting rules, including principles for ensuring problem integrity, timeliness, predictive rewriting, subjective rewriting, and output principles. It is understood that other principles can be deleted or added as needed, and this disclosure is not limited to these. Problem rewriting example 530 clearly displays examples of each task. Problem preset position 540 is located at the bottom, where user-inputted questions can be filled in to form complete information as input data for the large model.
[0087] The rewriting rules in the problem rewriting task can be used to clarify the execution criteria of the large model, thereby improving the execution standardization of the large model. Furthermore, using problem rewriting examples or relevance thresholds as evaluation information for the large model in executing the problem rewriting task serves as another execution standard, enabling the large model to clearly determine whether the output rewritten problem meets the expected results. Based on this, by using the rewriting rules in the problem rewriting task included in the problem analysis prompts and the evaluation information used to assess whether the rewritten problem meets the requirements, execution criteria can be provided to the large model from multiple stages, ensuring end-to-end processing of the large model while reducing the problem of illusions.
[0088] According to embodiments of this disclosure, inputting a problem and problem analysis prompts into a large model includes: filling the problem into a preset position in the problem analysis prompts and inputting it into the large model. Sequence identifiers are added to the retrieval-triggered identification task and the problem rewriting task in the problem analysis prompts to indicate the task execution order.
[0089] According to an embodiment of the present disclosure, in the question analysis prompt information, a plurality of tasks can be arranged in a structured manner, and a sequence identifier can be added to indicate the execution sequence of the tasks, thereby helping the large model to execute the tasks in the correct sequence.
[0090] According to an embodiment of the present disclosure, in the question analysis prompt information, a position can be preset for filling in the question input by the user to combine the question with the question analysis prompt information to form a complete input.
[0091] According to an embodiment of the present disclosure, by filling the question into the preset position in the question analysis prompt information to form a complete input, the large model is facilitated to understand, and by setting the sequence identifiers of the retrieval trigger identification task and the question rewriting task, the large model can execute the corresponding retrieval trigger identification and question rewriting operations according to the determined tasks and sequence, thereby improving the execution efficiency and controllability of the large model in the retrieval trigger identification and question rewriting operations.
[0092] The above describes in detail the retrieval trigger identification and question rewriting tasks executed by the large model. The following explains the answer generation task executed by the large model.
[0093] According to an embodiment of the present disclosure, inputting the question, the retrieval content set, and the answer generation prompt information into the large model includes: filling the question and the retrieval content set into preset positions of the answer generation prompt information, respectively, and inputting into the large model. The prompt information includes a plurality of tasks, and the tasks are added with sequence identifiers for indicating the execution sequence of the tasks.
[0094] According to an embodiment of the present disclosure, in the answer generation prompt information, a plurality of tasks can be arranged in a structured manner, and a sequence identifier can be added to indicate the execution sequence of the tasks, thereby helping the large model to execute the tasks in the correct sequence. In the answer generation prompt information, positions of the question and the retrieval content set can be respectively preset to combine the question, the retrieval content set, and the task to be executed to form a complete input.
[0095] According to an embodiment of the present disclosure, by filling the question and the retrieval content set into the preset positions in the answer generation prompt information to form a complete input, and setting the sequence identifiers of the tasks to be executed, the large model can execute the corresponding text processing tasks according to the determined tasks and sequence, thereby improving the execution efficiency and controllability of the large model in the answer generation.
[0096] According to an embodiment of the present disclosure, the current to-be-executed task can include a content arrangement task. Based on the current to-be-executed answer generation task in the answer generation prompt information, the current text corresponding to the retrieved content set is processed to obtain a processed text, including: based on the content arrangement task, the current text is processed to obtain a content-enhanced processed text.
[0097] According to an embodiment of the present disclosure, the content arrangement task can be a series of optimization processing on the current text, including but not limited to optimization processing on the content, order, semantics, etc. of the current text, so as to obtain a content-enhanced processed text. The content-enhanced processed text has improved content quality, information quantity or readability.
[0098] According to an embodiment of the present disclosure, by processing the current text through the content arrangement task, the processed text can be more focused on core information, reducing redundant or irrelevant content and improving readability.
[0099] According to an embodiment of the present disclosure, the content arrangement task includes a content screening task. Based on the content arrangement task, the current text corresponding to the retrieved content set is processed to obtain a content-enhanced processed text, including: based on the content matching degree of each of the plurality of subtexts in the current text and the attribute matching degree of each of the plurality of subtexts in the current text, a predetermined number of target subtexts are determined from the current text as the content-enhanced processed text. The content matching degree can be determined based on the similarity between the subtext and the question. The attribute matching degree can be determined based on the provenance information of the subtext. The provenance information of the subtext is determined based on the retrieved content set, and the predetermined number is determined based on the content screening task.
[0100] According to an embodiment of the present disclosure, the plurality of subtexts can be generated from different data sources respectively. The plurality of subtexts can also be generated from different results retrieved from the same data source. Each subtext can correspond to a search result. For example, the plurality of subtexts can correspond one-to-one to the plurality of search contents in the retrieved content set.
[0101] According to an embodiment of the present disclosure, the content matching degree can implicitly associate the question and the plurality of subtexts through the internal vector of the large model. Thus, the subtexts are sorted according to the content matching degree, and the top-ranked plurality of subtexts are taken as the predetermined number of target subtexts. The similarity calculation method used by the large model is not limited here, as long as it is used to judge the content matching degree between the question and the subtext.
[0102] According to an embodiment of the present disclosure, the provenance information of the subtext represents information related to the source of the subtext. This includes but is not limited to information such as the publishing site of the subtext content, the publisher, the publishing time, the authority of the publishing site or the publisher, and the relevance, etc. According to the provenance information, subtexts with questionable sources can be removed. Subtexts that do not meet the time limit requirement of the current question can also be removed. This makes the filtered subtexts more authoritative and authentic.
[0103] For example, the current question is "climate change trends in a certain region in recent years", and one of the retrieved content sets contains a subtext from an unverified personal blog that often publishes unverified information, so its source is questionable. When performing the content screening task, this subtext can be selected to be removed to avoid introducing inaccurate or misleading information. Another included subtext comes from a reliable news agency, but its publishing time is 10 years ago, which obviously does not meet the time limit requirement of "recent years". Therefore, when performing the content screening task, this subtext can be selected to be removed to ensure compliance with the time limit requirement of the current question.
[0104] The provenance information of the subtext can be scored according to one or more of the preset rules, such as credibility rules, effectiveness rules, and authority rules. However, it is not limited to this. The provenance information of the subtext can also be identified by a large model to obtain the attribute matching degree.
[0105] The attribute matching degree and the content matching degree can be weighted and summed to obtain a target matching degree. Based on the target matching degree, a predetermined number of target subtexts are determined from the plurality of subtexts.
[0106] According to an embodiment of the present disclosure, based on the content matching degree and the attribute matching degree of the plurality of subtexts, the content screening task in the content arrangement task is performed on the current text, which ensures that the processed text obtained is strongly associated with the question, and is also more authentic and authoritative.
[0107] According to an embodiment of the present disclosure, the content arrangement task includes a content extraction task. Based on the content arrangement task, the current text is processed to obtain a content-enhanced processed text, including: based on the content extraction task, the current text is processed to obtain a noise-reduced text. The noise-reduced text is extracted to obtain a plurality of text segments with enhanced hierarchical relationships as the content-enhanced processed text.
[0108] According to an embodiment of the present disclosure, the denoising processing on the current text can include cleaning the current text, removing spaces, line breaks, notes, URLs, tags and other unnecessary contents. Identifying and deleting duplicate text lines or paragraphs to avoid processing the same information repeatedly. Removing stop words, repeated words, irrelevant words, and eliminating or replacing ambiguous words. Repairing grammatical errors, fixing spelling errors. Updating the format of the text data so that the text meets the specific format requirements, etc. The denoising processing on the current text helps to improve the quality and readability of the processed text after content enhancement.
[0109] According to an embodiment of the present disclosure, the content extraction on the denoised text includes extracting entities, keywords, events and relationships in the text content.
[0110] Specifically, the large model can be pre-trained by training the data in the database, so that the large model identifies entity information such as names, places, organization names, times, and dates from the current text. Identify events in the current text, such as meetings, transactions, natural disasters, etc., and extract the type, time, location, participants, etc. Key information of the event. Identify the relationship between entities in the text, such as “A is a subsidiary of B”, “C cooperates with D”, etc., and extract the type and participating entities of the relationship. Organize and output the extracted entities, keywords, events, and relationships, etc. Key information according to a certain structure.
[0111] According to an embodiment of the present disclosure, the plurality of target subtexts after the content screening task can be used as the current text. The plurality of target subtexts can be combined to obtain the current text. Each target subtext in the current text is one or more text segments of the current text. However, it is not limited to this. The content extraction task can also be performed directly without going through the content screening task. The plurality of retrieval contents in the retrieval content set can be combined to obtain the current text. Each retrieval content is one or more text segments in the current text.
[0112] According to an embodiment of the present disclosure, since the plurality of text segments of the current text can have the same knowledge points, they can also have different dimensions of knowledge points. By denoising the current text, redundant and repetitive information can be removed, and different information related to the problem can be retained. When extracting the content of the text segment, relevant information about the problem in different dimensions or fine-grained can be obtained from different text segments, so that the quality of the extracted text content is higher.
[0113] According to an embodiment of the present disclosure, by denoising the current text first, irrelevant information and noise in the current text can be effectively removed, so that the subsequent content extraction is more focused on key information, improving the accuracy and efficiency of content extraction.
[0114] According to an embodiment of the present disclosure, after the current text is processed by the noise reduction, and the repeated part is removed, the processed text can still have multiple text segments. When the number of the processed text segments is greater than a predetermined text segment threshold, such as greater than 2, the entire text segment can be rearranged first, and then the sentences in the text segment can be rearranged.
[0115] According to an embodiment of the present disclosure, after the current text is processed by the noise reduction, and the repeated part is removed, the processed text can still have multiple text segments. When the number of the processed text segments is greater than a predetermined text segment threshold, such as greater than 2, the entire text segment can be rearranged first, and then the sentences in the text segment can be rearranged.
[0116] According to an embodiment of the present disclosure, the context relationship between the multiple text segments includes logical order, cause-effect relationship, total-part relationship, etc. between the text segments. According to the logical order, cause-effect relationship, and total-part relationship between the text segments, identification information for identifying the respective context relationships of the multiple text segments can be generated, such as a paragraph number. The multiple text segments can be rearranged according to the paragraph number, so that the order is more in line with logic and reading habits.
[0117] According to an embodiment of the present disclosure, the text segments in the processed text with enhanced paragraph-level relationship are split into multiple sentences for more fine-grained analysis. The context relationship between the multiple sentences includes logical order, cause-effect relationship, transition relationship, etc. between the sentences. According to the logical order, cause-effect relationship, and transition relationship between the multiple sentences, identification information for identifying the respective context relationships of the multiple sentences can be generated, such as a sentence number. The multiple sentences can be rearranged according to the sentence number, so that the order is more in line with logic and expression habits.
[0118] According to another embodiment of the present disclosure, after the current text is processed by the noise reduction, and the repeated part is removed, the processed text can still have multiple text segments. When the number of the processed text segments is greater than a predetermined text segment threshold, such as greater than 2, the entire text segment can be rearranged first, and then the sentences in the text segment can be rearranged.
[0119] According to an embodiment of the present disclosure, after the current text is denoised, when the number of text segments after processing is less than a predetermined text segment threshold, such as less than or equal to 2, all text segments can be split into multiple sentences. The context relationship of the multiple sentences is determined according to the logical order, cause-effect relationship and transition relationship between the multiple sentences, and a sentence number is generated to identify the respective context relationship of the multiple sentences. The multiple sentences are rearranged according to the sentence number, so that their order is more in line with logic and expression habits.
[0120] According to an embodiment of the present disclosure, the text content is rearranged according to the context relationship between the text segments and the sentences, so that the processed text has a clearer and more organized structure while retaining the original text information.
[0121] According to an embodiment of the present disclosure, based on the summary generation task in the prompt information generated according to the answer, the retrieval content set is processed to generate a summary, and a summary set is obtained as the current text.
[0122] According to an embodiment of the present disclosure, the summary generation technology, such as deep learning-based summary generation technology, can be used to process each retrieval content in the retrieval content set. By analyzing the main content, key information and structure of each retrieval content, and then removing redundant and secondary information, a refined summary is generated. After the summary generation processing, each retrieval content corresponds to a text segment, and these summaries are combined to form a summary set. The summary set is a summary of the original retrieval content set, containing the most relevant information to the question.
[0123] Exemplarily, the summary set can be combined as the current text. The multiple subtexts in the current text correspond to the multiple summaries in the summary set. The content filtering task and the content execution content are sequentially performed on the current text.
[0124] According to an embodiment of the present disclosure, by performing summary generation processing on the retrieval content set, a highly summarized summary set is obtained as the current text, so that the overall information amount of the current text is greatly simplified, thereby improving the efficiency of subsequent information processing.
[0125] According to an embodiment of the present disclosure, the current task to be executed includes a structure arrangement task. Based on the current task to be executed, the current text corresponding to the retrieval content set is processed to obtain a processed text, including: based on the structure arrangement task, the current text is structured to obtain a structure-enhanced processed text.
[0126] According to an embodiment of the present disclosure, the structure arrangement task is to convert unstructured text content into text content with a clear structure and organized information format.
[0127] The embodiments of the present disclosure fundamentally disclose a method for structuring a current text, including determining a basic structural framework of the current text according to the content of the text. The structural elements to be used, such as titles, subtitles, lists, etc., are determined according to the basic structural framework of the current text. The content of the current text is redistributed into the structured framework. The information can be organized using titles and subtitles to ensure that the organized information is clear and easy to understand. Similar or related information points can be sorted using lists.
[0128] According to the embodiments of the present disclosure, the structuring of the current text can also include checking the structured text, removing redundant and repetitive information, ensuring the accuracy and completeness of the information, and ensuring the consistent and logical use of the structured elements. The readability of the text can also be enhanced by applying appropriate formatting and layout. For example, using clear fonts and font sizes to ensure that the text is easy to read. Proper indentation, alignment, identifiers, spaces, etc. can also be used to enhance the structure of the text.
[0129] According to the embodiments of the present disclosure, by structuring the current text, the text content can be made clearer and easier to understand, greatly improving readability.
[0130] According to the embodiments of the present disclosure, based on the structure arrangement task, the current text is structured to obtain a structure-enhanced processed text, including: performing structural identification on the current text to obtain structural identification information of each text segment in the current text. Based on the structure format in the structure arrangement task and the structural identification information of each text segment, the format of the current text is updated to obtain the structure-enhanced processed text.
[0131] According to the embodiments of the present disclosure, the structural identification of the current text includes identification of the identification and position of the title, subtitle, list, table, etc. of the current text. The structural identification information describes the position and role of the text segment in the text structure, such as whether it is a title, whether it belongs to a certain subtitle or list, etc.
[0132] According to the embodiments of the present disclosure, the format updating of the current text includes applying the target structure format to the corresponding text segment according to the structural identification information of each text segment. For example, applying the title to a specific font and size, and applying the list to a specific indentation and numbering style. The updated text is optimized and checked for consistency. Ensure that the format of all text segments meets the requirements of the target structure format, and the overall text style is consistent.
[0133] According to the embodiments of the present disclosure, by structuring the identification and updating the predetermined format according to the structure format in the structure arrangement task, the information extraction efficiency can be improved and the text structure consistency can be ensured.
[0134] Figure 6 A template diagram of the answer generation prompt information is shown schematically according to an embodiment of the present disclosure.
[0135] As shown in Figure 6 The answer generation prompt information includes a task role 610, a task description 620, a task example 630, a retrieval content set preset position 640, and a question preset position 650, and the like. The task role 610 is used to define the role of the large model as a question and answer expert. The large model can perform the task in the task description 620 to process the current text obtained by retrieving the retrieval content set according to the question filled in the question preset position 650, and output an answer meeting a preset condition according to the reference example 630.
[0136] Specifically, the large model can first perform summary generation processing on the retrieval content set obtained by retrieving the question to obtain a summary set as the current text. The current text is sorted and filtered to obtain a sorted text, and the sorted text includes multiple target subtexts. The sorted text is denoised to obtain a denoised text including multiple text segments. The multiple text segments in the denoised text are content-organized to obtain a content-enhanced text. Finally, the content-enhanced text is structurally organized according to the output format requirement to output the final answer. It can be understood that the above order is schematic, and the above task can be appropriately deleted or a new processing task can be added, and the present disclosure is not limited thereto.
[0137] Figure 7 An effect diagram of the processed text according to an embodiment of the present disclosure is shown schematically.
[0138] As shown in Figure 7 The processed text obtained based on the answer generation method of the present disclosure has a title, a sub-title, and related information, rich content, multiple information points, clear structure, and distinct hierarchy.
[0139] According to an embodiment of the present disclosure, the processed text is evaluated based on the evaluation information in the prompt information to obtain an evaluation result indicating whether the processed text meets the preset condition.
[0140] According to an embodiment of the present disclosure, the evaluation information in the answer generation prompt information can be a set of pre-defined reference information, such as a reference text sample, representing a text format and content meeting a specific requirement or standard. However, it is not limited thereto. It can also be a set of pre-defined evaluation indicators, such as an evaluation indicator for meeting the format of the processed text, an evaluation indicator for meeting the richness of the content, an evaluation indicator for meeting the depth of the content, and the like. The evaluation indicators and the reference information can also be used as evaluation information together. As long as it can be used to judge whether the processed text meets the expectation and can be used as a judgment standard for feeding back the answer to the user.
[0141] The preset condition can correspond to the evaluation information. In a case where the evaluation information includes reference information, the preset condition can include a matching degree threshold. The processed text can be matched with the reference information to determine a matching degree therebetween. In a case where the matching degree is greater than the matching degree threshold, an evaluation result that the preset condition is met is obtained. In a case where the matching degree is less than or equal to the matching degree threshold, an evaluation result that the preset condition is not met is obtained.
[0142] In a case where the evaluation information includes evaluation indexes, the preset condition can include an evaluation value. The processed text can be evaluated by using the preset plurality of evaluation indexes to obtain sub evaluation values corresponding to the plurality of evaluation indexes, and the plurality of sub evaluation values are weighted and summed to obtain the evaluation value. In a case where the evaluation value is greater than an evaluation value threshold, an evaluation result that the preset condition is met is obtained. In a case where the evaluation value is less than or equal to the evaluation value threshold, an evaluation result that the preset condition is not met is obtained.
[0143] The processed text that meets both the evaluation value threshold and the matching degree threshold can be output as an answer. In a case where one of them does not meet, the content arrangement task and the structure arrangement task can be repeatedly performed based on the question, the answer generation prompt information, and the retrieved content set, so as to obtain an expected answer.
[0144] According to an embodiment of the present disclosure, by taking the evaluation information as a benchmark for evaluation, it can be ensured that the large model generates the processed text that meets the preset condition, thereby guiding controllability from the output result by the evaluation information.
[0145] Optionally, the evaluation indexes in the evaluation information can be set in each to-be-executed task, so as to evaluate the execution of each task and determine whether the preset condition is met. If the preset condition is not met, the operation of repeating the task can be performed. The reference information in the evaluation information is set as the last to-be-executed task, which is used to evaluate the processed text by using the final version of the reference information, so as to ensure the integrity and uniformity of the finally output answer.
[0146] According to an embodiment of the present disclosure, in the process of executing the large model-based question and answer method, the sequence identifier indicating the task execution order is added, so that the task execution order of the large model is controllable in the process of processing the plurality of tasks by the large model. In addition, the evaluation information is added in the answer generation prompt information, so that the large model can correctly evaluate the result after executing the task, and avoid generating illusory answers.
[0147] According to an embodiment of the present disclosure, an agent configured to execute the large model-based question and answer method as shown in Figure 2
[0148] An agent is an advanced artificial intelligence system that uses a large model as the core reasoning engine. It not only has the language understanding and generation capabilities of a large model, but also can efficiently and flexibly solve various complex problems, further releasing the machine intelligence contained in a large language model, thereby providing more accurate and personalized services for users.
[0149] Figure 8 A schematic diagram of an agent according to an embodiment of the present disclosure is shown schematically.
[0150] As shown in Figure 8 , the agent 800 can include an input unit 810, a control unit 820, a storage unit 830, a calculation unit 840, and an output unit 850.
[0151] The input unit 810 can be responsible for receiving or perceiving queries, requests, instructions, questions, signals, or data from the outside world, such as users or external environments, and converting them into format information that the agent can understand and process. The input unit 810 is the first step for the agent 800 to interact with the outside world. The input unit 810 enables the agent 800 to efficiently and accurately obtain necessary "sensory" information from the outside world and respond to it.
[0152] In an example, the input unit 810 can perform the operation of obtaining a question involved in the method as shown in Figure 2 .
[0153] The control unit 820 is the core support for the agent 800 to process complex tasks. The control capability of the control unit 820 can include the following four aspects: planning capability, action capability, evaluation capability, and reflection capability. In an example, the control unit can use the planning capability to determine the current task to be executed. The action capability can be used to perform operations S220 and S230 as shown in Figure 2 to process the current text and obtain the processed text. The evaluation capability is used to evaluate the output processed document based on the evaluation information to determine whether the processed text can be used as the answer to the question. The reflection capability can be used to re-execute operations S220 and S230 in the case where it is determined that the processed text does not meet the preset conditions. In an example, the control unit 820 will constantly interact with the storage unit 830, the calculation unit 840, and / or the output unit 850 during operation. However, it should be noted that in the embodiments of the present disclosure, the control unit 820 initiates communication with the storage unit 830, the calculation unit 840, and / or the output unit 850 as a single initiator, and there is no communication coupling between the storage unit 830, the calculation unit 840, and / or the output unit 850.
[0154] In an example, the performance of the control unit 820 can be closely related to the large model on which the agent 800 is based. In order to fully exploit the capabilities of the large model, the internal structure of the control unit 820 can be designed to be highly configurable and scalable in order to cope with various different types of tasks and requirements in real scenarios.
[0155] The storage unit 830 can be responsible for memorizing information such as historical dialogues, event streams, etc. The memorized information can be stored in the storage unit 830.
[0156] In an example, after the agent 800 obtains input information such as a question, it can determine whether a retrieval operation needs to be triggered. In the case where it is determined that the retrieval operation does not need to be triggered, the agent 800 can obtain an answer corresponding to the question from the storage unit 830 and feed it back to the control unit 820. The control unit 820 can utilize the fed-back answer and pass it to the output unit 850.
[0157] The operation unit 840 can be regarded as a library of predefined tools. As mentioned before, the plug-in tool, the function tool, the interface tool, and the model tool can be included in the operation unit 840.
[0158] In an example, in the case where the agent 800 determines that the execution information includes tool information, the relevant tool information can be called from the operation unit 840 and fed back to the control unit 820. The control unit 820 can utilize the fed-back tool information such as a search engine to retrieve a plurality of rewritten questions, obtain a set of retrieval contents, and generate prompt information based on the set of retrieval contents, the question, and the answer obtained from the storage unit 830, perform the operation as shown in Figure 2 Although the large model has excellent language understanding and generation capabilities, it, like a human, can only solve a limited number of tasks without the aid of any tools. When the agent 800 is endowed with the ability to call tools, it can implement tasks such as completing mathematical operations with the aid of a calculator, completing data analysis with the aid of data analysis software, and completing weather forecasting with the aid of a search engine.
[0159] The agent 800 according to the embodiments of the present disclosure can simply and effectively improve the intelligent degree and improve the flexibility and versatility.
[0160] Figure 9 A block diagram of a question-answering device according to an embodiment of the present disclosure is schematically shown.
[0161] As shown in Figure 9 The question-answering device 900 includes an input module 910, an input module 920, and a processing module 930.
[0162] The input module 910 is configured to input the question, the set of retrieved content, and the answer generation prompt information to the large model in response to the set of retrieved content retrieved based on the question.
[0163] The processing module 920 is configured to process the current text corresponding to the set of retrieved content based on the current to-be-executed task in the answer generation prompt information and the question, to obtain processed text.
[0164] The first generation module 930 is configured to obtain an answer to the question based on the processed text in a case where the processed text meets a preset condition.
[0165] According to an embodiment of the present disclosure, the processing module includes a content processing sub-module.
[0166] The content processing sub-module is configured to perform content processing on the current text based on a content organization task, to obtain content-enhanced processed text.
[0167] According to an embodiment of the present disclosure, the content processing sub-module includes a content screening unit.
[0168] The content screening unit is configured to determine a predetermined number of target text segments from the current text as the content-enhanced processed text based on a content matching degree of each of the text segments in the current text and an attribute matching degree of each of the text segments in the current text, wherein the content matching degree is determined based on a similarity between the text segment and the question, the attribute matching degree is determined based on provenance information of the text segment, the provenance information of the text segment is determined based on the set of retrieved content, and the predetermined number is determined based on a content screening task.
[0169] According to an embodiment of the present disclosure, the content processing sub-module further includes a noise reduction unit and an extraction unit.
[0170] The noise reduction unit is configured to perform noise reduction processing on the current text based on a content extraction task, to obtain noise-reduced text.
[0171] The extraction unit is configured to perform content extraction on the noise-reduced text, to obtain a plurality of text segments with enhanced hierarchical relationships as the content-enhanced processed text.
[0172] According to an embodiment of the present disclosure, the extraction unit includes a text segment processing sub-unit and a first sentence processing sub-unit.
[0173] The text segment processing sub-unit is configured to rearrange the plurality of text segments based on a context relationship between the plurality of text segments in the noise-reduced text, and generate identification information for identifying a respective context relationship of the plurality of text segments, to obtain processed text with enhanced paragraph hierarchical relationships.
[0174] The first sentence processing subunit is configured to rearrange the plurality of sentences based on the context relationship between the plurality of sentences, and generate identification information for identifying the context relationship of each of the plurality of sentences, to obtain the hierarchical relationship enhanced processed text.
[0175] According to an embodiment of the present disclosure, the extraction unit further includes a second sentence processing subunit.
[0176] The second sentence processing subunit is configured to rearrange the plurality of sentences based on the context relationship between the plurality of sentences obtained by splitting the de-noised text, and generate identification information for identifying the context relationship of each of the plurality of sentences, to obtain the hierarchical relationship enhanced processed text.
[0177] According to an embodiment of the present disclosure, the question and answer device 900 further includes an abstract processing module.
[0178] The abstract processing module is configured to perform abstract generation processing on the retrieved content set based on the abstract generation task in the prompt information, to obtain an abstract set as the current text.
[0179] According to an embodiment of the present disclosure, the processing module 920 further includes a structure processing sub-module.
[0180] The structure processing sub-module is configured to perform structural processing on the current text based on the structure arrangement task, to obtain the structure enhanced processed text.
[0181] According to an embodiment of the present disclosure, the structure processing sub-module includes a structure identification unit and a structure updating unit.
[0182] The structure identification unit is configured to perform structural identification on the current text, to obtain the structure identification information of each of the plurality of text segments in the current text.
[0183] The structure updating unit is configured to perform format updating on the current text based on the structure format in the structure arrangement task and the structure identification information of each of the plurality of text segments, to obtain the structure enhanced processed text.
[0184] According to an embodiment of the present disclosure, the question and answer device 900 further includes an evaluation module.
[0185] The evaluation module is configured to evaluate the processed text based on the evaluation information in the prompt information, to obtain an evaluation result for indicating whether the processed text meets the preset condition.
[0186] According to an embodiment of the present disclosure, the evaluation information can include at least one of the following: an evaluation index, reference information.
[0187] According to an embodiment of the present disclosure, the input module 910 further includes a first input sub-module
[0188] The first input sub-module is configured to fill the question and the search content set into preset positions of the answer generation prompt information respectively, and input into the large model, where the prompt information includes a plurality of tasks, and the tasks are added with sequence identifiers for indicating the execution sequence of the tasks.
[0189] According to an embodiment of the present disclosure, the question and answer device further includes an analysis module and a question rewriting module.
[0190] The analysis module is configured to perform search trigger analysis on the question based on the search trigger identification task in the prompt information, and obtain a search trigger analysis result.
[0191] The question rewriting module is configured to, in a case where the search trigger analysis result indicates that the search operation needs to be triggered, perform rewriting on the question based on the question rewriting task in the prompt information, and obtain a plurality of rewritten questions, so as to obtain the search content set based on the plurality of rewritten questions.
[0192] According to an embodiment of the present disclosure, the question and answer device 900 further includes a second generation module.
[0193] The second generation module is configured to, in a case where the search trigger analysis result indicates that the search operation does not need to be triggered, generate an answer to the question based on the question.
[0194] According to an embodiment of the present disclosure, the question rewriting module includes a question rewriting sub-module.
[0195] The question rewriting sub-module is configured to perform rewriting on the question based on a rewriting rule in the question rewriting task that matches a question type of the question, and obtain a plurality of rewritten questions.
[0196] According to an embodiment of the present disclosure, the question rewriting module further includes a first rewriting unit and a second rewriting unit.
[0197] The first rewriting unit is configured to perform rewriting on the question based on the question rewriting task, and obtain a plurality of initial rewritten questions.
[0198] The second rewriting unit is configured to, in a case where a relevance between each of the plurality of initial rewritten questions and the question satisfies a relevance threshold in the question rewriting task, obtain a plurality of rewritten questions based on the plurality of initial rewritten questions.
[0199] According to an embodiment of the present disclosure, the input module further includes a second input sub-module.
[0200] The second input sub-module is configured to fill the question into a preset position in the question analysis prompt information, and input into the large model, where the search trigger identification task and the question rewriting task in the question analysis prompt information are respectively added with sequence identifiers for indicating the execution sequence of the tasks.
[0201] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0202] According to an embodiment of the present disclosure, an electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method described above.
[0203] According to embodiments of the present disclosure, a non-transitory computer-readable storage medium stores computer instructions, wherein the computer instructions are used to cause a computer to perform the methods described above.
[0204] According to an embodiment of this disclosure, a computer program product includes a computer program that, when executed by a processor, implements the method described above.
[0205] Figure 10 A schematic block diagram of an electronic device 1000 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0206] like Figure 10 As shown, device 1000 includes a computing unit 1001, which can perform various appropriate actions and processes according to a computer program stored in read-only memory (ROM) 1002 or a computer program loaded into random access memory (RAM) 1003 from storage unit 1008. The RAM 1003 may also store various programs and data required for the operation of device 1000. The computing unit 1001, ROM 1002, and RAM 1003 are interconnected via bus 1004. Input / output (I / O) interface 1005 is also connected to bus 1004.
[0207] A number of the components in the device 1000 are connected to the input / output (I / O) interface 1005, including: an input unit 1006, such as a keyboard, a mouse, etc.; an output unit 1007, such as various types of displays, speakers, etc.; a storage unit 1008, such as a magnetic disk, a magneto-optical disk, etc.; and a communication unit 1009, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1009 allows the device 1000 to exchange information / data with other devices over a computer network, such as the Internet, and / or various telecommunication networks.
[0208] The computing unit 1001 can be various general and / or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 1001 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 1001 performs various methods and processes described above, such as the question-answering method. For example, in some embodiments, the question-answering method can be implemented as a computer software program, which is tangibly embodied in a machine-readable medium, such as the storage unit 1008. In some embodiments, part or all of the computer program can be loaded and / or installed onto the device 1000 via the ROM 1002 and / or the communication unit 1009. When the computer program is loaded onto the RAM 1003 and executed by the computing unit 1001, one or more steps of the question-answering method described above can be performed. Alternatively, in other embodiments, the computing unit 1001 can be configured to perform the question-answering method by any other appropriate means, such as by means of firmware.
[0209] Various implementations of the systems and techniques described above herein can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a complex programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
[0210] Program code for carrying out methods of the present disclosure can be written in any combination of one or more programming languages. The program code can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the program code, when executed by the processor or controller, produces the functions / operations specified in the flowcharts and / or block diagrams. The program code can be executed entirely on a machine, partially on a machine, partially on a machine as a standalone software package, or entirely on a remote machine or server.
[0211] In the context of the present disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium will include one or more lines of electrical connections, portable computer disks, hard disk drives, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), optical fibers, portable compact disc read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0212] To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
[0213] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.
[0214] The computer system can include clients and servers. This relationship can be. The servers are typically remote from the clients with the interactions between them occurring over a communication network. The relationship between a client and a server is one of client-server. The server can be a cloud server, a server of a distributed system, or a server incorporating a blockchain.
[0215] It should be understood that the various forms of flow shown above can be re-ordered, added to, or deleted from without departing from the scope of the present disclosure. For example, the steps recited in the present disclosure can be executed in parallel, executed in series, or executed in different orders, as long as the desired results of the technical solutions of the present disclosure are achieved, and the present disclosure is not limited herein.
[0216] The specific implementation described above does not constitute a limitation on the protection scope of the present disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements, and improvements within the spirit and principles of the present disclosure should be included in the protection scope of the present disclosure.
Claims
1. A question-answering method based on a large model, comprising: In response to the received question, the question and question analysis prompts are input into the large model, causing the large model to perform the following operations: Based on the retrieval trigger identification task in the problem analysis prompt information, the problem is subjected to retrieval trigger analysis to obtain the retrieval trigger analysis results; as well as If the search trigger analysis results indicate that a search operation needs to be triggered, the problem is rewritten based on the problem rewriting task in the problem analysis prompt information, resulting in multiple rewritten problems. A search content set is then obtained based on these multiple rewritten problems. The retrieval trigger identification task and the question rewriting task are respectively equipped with sequence identifiers to indicate the execution order of the tasks; The question, the search content set, and the answer generation prompt information are input into the large model, causing the large model to perform the following operations: Based on the current task to be executed and the question in the answer generation prompt information, the current text corresponding to the search content set is processed to obtain the processed text. The answer generation prompt information integrates multiple tasks to be executed, and sequence identifiers are added to these tasks to indicate their execution order. The large model executes these multiple tasks uniformly according to their execution order, and the current task to be executed is determined based on this execution order. If the processed text meets preset conditions, the answer to the question is obtained based on the processed text. The currently pending tasks include the structure organization task; The step of processing the current text corresponding to the search content set based on the current task to be executed, to obtain the processed text, includes: Based on the aforementioned structure organization task, the current text is subjected to structured processing to obtain a structure-enhanced processed text.
2. The method according to claim 1, wherein, The currently pending tasks include content organization tasks; The answer generation task to be executed based on the answer generation prompt information processes the current text corresponding to the search content set to obtain the processed text, including: Based on the content organization task, the current text is processed to obtain enhanced text.
3. The method according to claim 2, wherein, The content organization task includes the content filtering task; The step of performing content processing on the current text corresponding to the retrieved content set based on the content organization task to obtain content-enhanced processed text includes: Based on the content matching degree and attribute matching degree of each of the multiple subtexts in the current text, a predetermined number of target subtexts are determined from the current text as the processed text for content enhancement. The content matching degree is determined based on the similarity between the subtext and the question, the attribute matching degree is determined based on the source information of the subtext, the source information of the subtext is determined based on the search content set, and the predetermined number is determined based on the content filtering task.
4. The method according to claim 2, wherein, The content organization task includes content extraction tasks; The step of performing content processing on the current text based on the content organization task to obtain content-enhanced processed text includes: Based on the content extraction task, the current text is denoised to obtain denoised text; and Content extraction is performed on the denoised text to obtain multiple text segments with enhanced hierarchical relationships, which serve as the content-enhanced processed text.
5. The method according to claim 4, wherein, The step of extracting content from the denoised text to obtain multiple text segments with enhanced hierarchical relationships, which serve as the content-enhanced processed text, includes: Based on the contextual relationships between multiple text segments in the denoised text, the multiple text segments are rearranged, and identification information is generated to identify the contextual relationships of each of the multiple text segments, resulting in processed text with enhanced paragraph hierarchy; and Based on the contextual relationships between multiple statements, the multiple statements are rearranged and identification information is generated to identify the contextual relationships of each of the multiple statements, resulting in the processed text with enhanced hierarchical relationships. The multiple statements are obtained by splitting the text segments in the processed text with enhanced paragraph hierarchical relationships.
6. The method according to claim 4, wherein, The step of extracting content from the denoised text to obtain multiple text segments with enhanced hierarchical relationships, which serve as the content-enhanced processed text, includes: Based on the contextual relationships between multiple statements obtained from the denoised text segmentation, the multiple statements are rearranged and identification information is generated to identify the contextual relationships of each of the multiple statements, resulting in the processed text with enhanced hierarchical relationships.
7. The method according to any one of claims 1 to 6, further comprising: Based on the summary generation task in the answer generation prompt information, the search content set is processed to generate a summary set, which is used as the current text.
8. The method according to claim 1, wherein, The step of performing structured processing on the current text based on the structure organization task to obtain structure-enhanced processed text includes: Perform structured recognition on the current text to obtain the structured recognition information of each of the multiple text segments in the current text; and Based on the structural format in the structure organization task and the structural identification information of each of the multiple text segments, the current text is formatted to obtain the structure-enhanced processed text.
9. The method according to claim 1, further comprising: Based on the evaluation information generated from the answer prompt, the processed text is evaluated to obtain an evaluation result indicating whether the processed text meets the preset conditions.
10. The method according to claim 9, wherein, The evaluation information includes at least one of the following: evaluation indicators and reference information.
11. The method according to claim 1, wherein, The step of inputting the question, the search content set, and the answer-generated hint information into the large model includes: The question and the set of search results are respectively filled into the preset positions of the answer generation prompt information and input into the large model.
12. The method according to claim 1, further comprising: If the search trigger analysis results indicate that no search operation is required, then an answer to the question is generated based on the question.
13. The method according to claim 1, wherein, The problem rewriting task based on the problem analysis prompt information rewrites the problem, resulting in multiple rewritten problems, including: Based on the rewriting rules that match the problem type in the problem rewriting task, the problem is rewritten to obtain the multiple rewritten problems.
14. The method according to claim 1 or 13, wherein, The problem rewriting task based on the problem analysis prompt information rewrites the problem, resulting in multiple rewritten problems, including: Based on the problem rewriting task, the problem is rewritten to obtain multiple initial rewritten problems; and If the correlation between each of the plurality of initial rewriting problems and the problem satisfies the correlation threshold in the problem rewriting task, the plurality of rewriting problems are obtained based on the plurality of initial rewriting problems.
15. The method according to claim 1, wherein, The step of inputting the problem and problem analysis prompts into the large model includes: Enter the question into the preset location in the question analysis prompt information and input it into the large model.
16. A question-answering device based on a large model, comprising: The input module, in response to the received question, inputs the question and question analysis prompts into the large model; The analysis module is used to perform retrieval trigger analysis on the problem based on the retrieval trigger identification task in the problem analysis prompt information, and obtain the retrieval trigger analysis results; as well as The question rewriting module is used to rewrite the question based on the question rewriting task in the question analysis prompt information when the search trigger analysis result indicates that a search operation needs to be triggered, thereby obtaining multiple rewritten questions, so as to obtain a search content set based on the multiple rewritten questions. In the problem analysis prompt information, the retrieval trigger identification task and the problem rewriting task are respectively marked with sequence identifiers to indicate the execution order of the tasks; The input module also inputs the question, the search content set, and the answer-generated prompt information into the large model; The processing module is used to process the current task to be executed and the question in the answer generation prompt information, and to process the current text corresponding to the search content set to obtain the processed text. The answer generation prompt information integrates multiple tasks to be executed, and sequence identifiers are added to these tasks to indicate their execution order. The large model executes the multiple tasks to be executed uniformly according to the task execution order, and the current task to be executed is determined based on the task execution order. The first generation module is used to obtain the answer to the question based on the processed text, provided that the processed text meets preset conditions. The currently pending tasks include the structure organization task; The processing module further includes: The structure processing submodule is used to perform structure processing on the current text based on the structure organization task, so as to obtain the structure-enhanced processed text.
17. The apparatus according to claim 16, wherein, The currently pending tasks include content organization tasks; The processing module includes: The content processing submodule is used to process the current text based on the content organization task to obtain the content-enhanced processed text.
18. The apparatus according to claim 17, wherein, The content organization task includes the content filtering task; The content processing submodule includes: A content filtering unit is configured to determine a predetermined number of target subtexts from the current text based on the content matching degree and attribute matching degree of each of the multiple subtexts in the current text, as the processed text for content enhancement. The content matching degree is determined based on the similarity between the subtext and the question, the attribute matching degree is determined based on the source information of the subtext, the source information of the subtext is determined based on the retrieved content set, and the predetermined number is determined based on the content filtering task.
19. The apparatus according to claim 17, wherein, The content organization task includes content extraction tasks; The content processing submodule also includes: The noise reduction unit is used to perform noise reduction processing on the current text based on the content extraction task to obtain the noise-reduced text; as well as The extraction unit is used to extract content from the denoised text to obtain multiple text segments with enhanced hierarchical relationships, which serve as the processed text with enhanced content.
20. The apparatus according to claim 19, wherein, The extraction unit includes: A text segment processing subunit is configured to rearrange the multiple text segments based on their contextual relationships in the denoised text and generate identification information to identify the contextual relationships of each of the multiple text segments, thereby obtaining processed text with enhanced paragraph hierarchy; and The first statement processing subunit is used to rearrange the multiple statements based on their contextual relationships and generate identification information to identify the contextual relationships of the multiple statements, thereby obtaining the processed text with enhanced hierarchical relationships. The multiple statements are obtained by splitting the text segments in the processed text with enhanced paragraph hierarchical relationships.
21. The apparatus according to claim 19, wherein, The extraction unit further includes: The second statement processing subunit is used to rearrange the multiple statements based on the contextual relationships between them obtained from the denoising text splitting and generate identification information to identify the contextual relationships of the multiple statements, thereby obtaining the processed text with enhanced hierarchical relationships.
22. The apparatus according to any one of claims 16 to 21, further comprising: The summary processing module is used to perform summary generation processing on the search content set based on the summary generation task in the answer generation prompt information, and obtain a summary set as the current text.
23. The apparatus according to claim 16, wherein, The structure processing submodule includes: The structure recognition unit is used to perform structure recognition on the current text to obtain the structure recognition information of each of the multiple text segments in the current text; and The structure update unit is used to update the format of the current text based on the structure format in the structure sorting task and the structure identification information of each of the multiple text segments, so as to obtain the structure-enhanced processed text.
24. The apparatus of claim 16, further comprising: An evaluation module is used to evaluate the processed text based on the evaluation information generated in the prompt information of the answer, and to obtain an evaluation result indicating whether the processed text meets the preset conditions.
25. The apparatus according to claim 24, wherein, The evaluation information includes at least one of the following: evaluation indicators and reference information.
26. The apparatus according to claim 16, wherein, The input module further includes: The first input submodule is used to fill the question and the search content set into the preset positions of the answer generation prompt information.
27. The apparatus of claim 16, further comprising: The second generation module is used to generate an answer to the question based on the question, provided that the retrieval trigger analysis result indicates that no retrieval operation is required.
28. The apparatus according to claim 16, wherein, The problem rewriting module includes: The problem rewriting submodule is used to rewrite the problem based on the rewriting rules that match the problem type in the problem rewriting task, thereby obtaining the multiple rewritten problems.
29. The apparatus according to claim 16 or 28, wherein, The problem rewriting module also includes: The first rewriting unit rewrites the problem based on the problem rewriting task, obtaining multiple initial rewritten problems; and The second rewriting unit is used to obtain the plurality of rewriting problems based on the plurality of initial rewriting problems, provided that the correlation between the plurality of initial rewriting problems and the problem satisfies the correlation threshold in the problem rewriting task.
30. The apparatus according to claim 16, wherein, The input module further includes: The second input submodule is used to fill the question into a preset position in the question analysis prompt information and input it into the large model.
31. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-15.
32. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-15.
33. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-15.
34. An intelligent agent configured to perform the method according to any one of claims 1-15.
Citation Information
Patent Citations
Question and answer processing method and device
CN118260404A
Question and answer pair generation method and system based on large language model
CN118332086A