Data processing method, apparatus and system
By splitting the initial query into subqueries and using the target agent to process target candidate documents, the problem of inaccurate complex analysis and reasoning in long document and multi-document scenarios is solved, achieving more efficient and accurate data processing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ALIBABA (CHINA) CO LTD
- Filing Date
- 2025-01-24
- Publication Date
- 2026-07-24
AI Technical Summary
Existing technologies suffer from inaccurate output results when dealing with complex analysis and reasoning in long and multi-document scenarios. In particular, RAG relies too heavily on local text fragment retrieval and struggles to capture the full picture, while LongContext cannot be applied under the limitation of long context length, resulting in a decline in the ability to retrieve and use information in the middle.
By splitting the initial query into multiple subqueries and using a target agent to determine the target candidate document from the initial candidate documents, the target sub-answers are gradually obtained and finally aggregated into the target answer of the initial query, combining the collaborative work of a document splitting model and a large model agent.
It improves the accuracy and efficiency of complex analytical reasoning, reduces the difficulty of query processing, and simplifies the data processing process in long document and multi-document scenarios.
Smart Images

Figure CN122451101A_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of computer technology, and in particular to a data processing method. This specification also relates to a data processing system, a data processing device, a computing device, an electronic device, a computer-readable storage medium, and a computer program product. Background Technology
[0002] Handling complex queries in document scenarios is an important aspect, such as statistical analysis of document data and multi-step reasoning of document knowledge. Understanding complex queries has become one of the key challenges in improving user experience in today's ToC (To Consumer) scenarios.
[0003] Currently, complex tasks involving long documents and multiple documents are mainly handled through RAG (Retrieval-augmented Generation) and LongContext (long sequences, referring to techniques that can directly process longer contextual information, currently generally large model techniques for longer contextual understanding). However, RAG relies too heavily on the retrieval of local text fragments, making it difficult to capture the entire picture of the data. LongContext has a large contextual understanding window, but it suffers from the lost-in-middle problem (referring to the phenomenon that language models have a reduced ability to retrieve and use middle information when processing long input contexts), and it is impossible to overcome the length limit of long contexts in the short term. For example, if the length of the uploaded document exceeds the set threshold in the language model, it will prompt that it is too long and cannot be applied. Both of the above methods result in inaccurate output when performing complex analysis and reasoning in document scenarios. Therefore, there is an urgent need for a data processing method to solve the problem of complex analysis and reasoning in long document and multi-document scenarios and improve the accuracy of data processing results. Summary of the Invention
[0004] In view of the above, embodiments of this specification provide a data processing method. One or more embodiments of this specification also relate to a data processing apparatus, a data processing system, a computing device, an electronic device, a computer-readable storage medium, and a computer program product, to address the technical deficiencies existing in the prior art.
[0005] According to a first aspect of the embodiments of this specification, a data processing method is provided, comprising: Based on the initial query, the initial candidate documents corresponding to the initial query, and the reference query, the initial query is split into multiple sub-queries, and the target candidate documents corresponding to each sub-query are determined from the initial candidate documents. Using the target agent corresponding to each subquery, the target sub-answer corresponding to each subquery is determined based on the target candidate document corresponding to each subquery; Based on the target sub-answers corresponding to each sub-query, the target answer corresponding to the initial query is determined.
[0006] According to a second aspect of the embodiments of this specification, a data processing system is provided, including a planning and splitting unit, an execution and generation unit, and a decision reasoning unit, wherein... The planning and splitting unit is used to split the initial query based on the initial query, the initial candidate documents corresponding to the initial query, and the reference query to obtain multiple sub-queries, and to determine the target candidate documents corresponding to each sub-query from the initial candidate documents; An execution generation unit is used to determine the target sub-answer corresponding to each sub-query based on the target candidate document corresponding to each sub-query, using the target agent corresponding to each sub-query. The decision reasoning unit is used to determine the target answer corresponding to the initial query based on the target sub-answers corresponding to each sub-query.
[0007] According to a third aspect of the embodiments of this specification, a data processing apparatus is provided, comprising: The query splitting module is configured to split the initial query into multiple subqueries based on the initial query, the initial candidate documents corresponding to the initial query, and the reference query, and to determine the target candidate documents corresponding to each subquery from the initial candidate documents. The sub-answer determination module is configured to use the target agent corresponding to each sub-query to determine the target sub-answer corresponding to each sub-query based on the target candidate document corresponding to each sub-query; The target answer determination module is configured to determine the target answer corresponding to the initial query based on the target sub-answers corresponding to each sub-query.
[0008] According to a fourth aspect of the embodiments of this specification, a computing device is provided, comprising: Memory and processor; The memory is used to store computer programs or instructions, and the processor is used to execute the computer programs or instructions, which, when executed by the processor, implement the steps of the above-described data processing method.
[0009] According to a fifth aspect of the embodiments of this specification, an electronic device is provided, comprising: A memory and a processor, the memory and the processor being connected via a bus; The memory is used to store computer programs or instructions, and the processor is used to execute the computer programs or instructions, which, when executed by the processor, implement the steps of the above-described data processing method.
[0010] According to a sixth aspect of the embodiments of this specification, a computer-readable storage medium is provided that stores a computer program or instructions which, when executed by a processor, implement the steps of the data processing method described above.
[0011] According to a seventh aspect of the embodiments of this specification, a computer program product is provided, including a computer program or instructions that, when executed by a processor, implement the steps of the data processing method described above.
[0012] The data processing method provided in one embodiment of this specification, through an initial query, initial candidate documents corresponding to the initial query, and a reference query, can accurately guide the process of splitting the initial query into simpler subqueries, reducing the difficulty of subsequent query processing. When the target candidate documents corresponding to each subquery are determined from the initial candidate documents, the target sub-answers corresponding to each subquery are determined using these target candidate documents, simplifying the complex analysis and reasoning process based on the initial candidate documents. Furthermore, when the target sub-answers corresponding to each subquery are determined using the target agents corresponding to each subquery based on the target candidate documents, more accurate target sub-answers can be obtained using the target agents. Further, the target answer corresponding to the initial query is determined based on the target sub-answers corresponding to each subquery. By splitting the initial query into relatively simple subqueries and using the target agents corresponding to each subquery to obtain the target sub-answers, the difficulty of solving subqueries is reduced, the complex analysis and reasoning process based on the initial candidate documents is simplified, and the accuracy of the target answer is improved. Attached Figure Description
[0013] Figure 1 This is a schematic diagram illustrating a data processing method provided in one embodiment of this specification. Figure 2 This is a flowchart illustrating a data processing method provided in one embodiment of this specification; Figure 3 This is a schematic diagram of the processing procedure of a data processing method provided in one embodiment of this specification; Figure 4 This is a schematic diagram of the structure of a data processing system provided in one embodiment of this specification; Figure 5 This is a schematic diagram of the structure of a data processing apparatus provided in one embodiment of this specification; Figure 6 This is a structural block diagram of a computing device provided in one embodiment of this specification; Figure 7 This is a structural block diagram of an electronic device provided in one embodiment of this specification. Detailed Implementation
[0014] Many specific details are set forth in the following description to provide a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.
[0015] The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of this specification. The singular forms “a,” “described,” and “the” as used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0016] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this specification, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."
[0017] Furthermore, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties. Moreover, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0018] In one or more embodiments of this specification, a large model refers to a deep learning model with a large number of model parameters, typically containing hundreds of millions, tens of billions, hundreds of billions, trillions, or even tens of trillions of model parameters. A large model can also be called a foundation model. It is pre-trained using large-scale unlabeled corpora to produce a pre-trained model with hundreds of millions of parameters. Such models can adapt to a wide range of downstream tasks and have good generalization ability. Examples include Large Language Models (LLMs) and multi-modal pre-training models.
[0019] In practical applications, large models only require a small number of samples to fine-tune the pre-trained model before they can be applied to different tasks. Large models can be widely used in fields such as Natural Language Processing (NLP) and Computer Vision. Specifically, they can be applied to computer vision tasks such as Visual Question Answering (VQA), Image Captioning (IC), and Image Generation, as well as natural language processing tasks such as text-based sentiment classification, text summarization, and machine translation. The main application scenarios of large models include digital assistants, intelligent robots, search, online education, office software, e-commerce, and intelligent design.
[0020] First, the terms and concepts used in one or more embodiments of this specification will be explained.
[0021] Divide and conquer: The divide and conquer approach is the process of breaking down a complex problem into several simpler subproblems, then solving the subproblems one by one and merging them back together.
[0022] Multi-Agent: A collection of multiple agents (intelligent agents) that coordinate and serve each other to complete a task. Document-Centric Plan: A method that uses document information to guide the planning and decomposition of models.
[0023] The LongContext technology offers a large contextual understanding window, making it suitable for tasks requiring a comprehensive overview of the dataset. However, it suffers from the lost-in-middle problem and cannot overcome the length limit of long contexts in the short term. For example, if the uploaded document length exceeds the set threshold, it will prompt an "excessive length" warning and become unusable. In other words, when the context length is too long, access restrictions will occur, significantly degrading the overall experience. RAG excels at handling large-scale external data with superior time performance, but it relies too heavily on retrieving local text fragments, making it difficult to capture the entire data. For tasks requiring understanding full-text information for complex reasoning, RAG has significant shortcomings.
[0024] To address the aforementioned technical problems, this specification provides a data processing method. This specification also relates to a data processing apparatus, a data processing system, a computing device, an electronic device, a computer-readable storage medium, and a computer program product, which will be described in detail in the following embodiments.
[0025] See Figure 1 , Figure 1 A schematic diagram of a data processing method according to an embodiment of this specification is shown.
[0026] Figure 1 The system includes a terminal device 102 and a server 104. In the embodiments of this specification, the system composed of the terminal device 102 and the server 104 can perform the following steps: The endpoint device 102 sends initial data to the server 104, wherein the initial data includes an initial query, or an initial query and an uploaded document. If the initial data includes an uploaded document, the uploaded document is stored in the knowledge base.
[0027] Server 104 is equipped with a data processing system, which includes a planning and splitting unit, an execution and generation unit, and a decision-making and reasoning unit. The planning and splitting unit is used to split the initial query based on the initial query, the initial candidate documents corresponding to the initial query, and a reference query, obtaining multiple subqueries (e.g., splitting to obtain subquery 1, subquery 2, and subquery 3), and determining the target candidate documents corresponding to each subquery from the initial candidate documents. The execution and generation unit is used to utilize the target agents corresponding to each subquery (e.g., agent 1 for subquery 1, agent 2 for subquery 2, and agent 3 for subquery 3), and determine the target sub-answers corresponding to each subquery based on the target candidate documents (subquery 1 corresponds to target sub-answer 1, subquery 2 to target sub-answer 2, and subquery 3 to target sub-answer 3), where the target agents are agents based on a large model. The decision-making and reasoning unit is used to determine the target answer corresponding to the initial query based on the target sub-answers corresponding to each subquery. The decision-making and reasoning unit also includes a decision-making and reasoning unit. The decision network and inference network are used to aggregate the target sub-answers corresponding to each sub-query to obtain an aggregated answer. The decision network determines whether the aggregated answer meets a preset termination condition. If the aggregated answer meets the preset termination condition, the inference network determines the target answer corresponding to the initial query based on the initial query and the aggregated answer. If the aggregated answer does not meet the preset termination condition, a target query is generated based on the aggregated answer and the multiple sub-queries. This target query is then identified as the initial query. The process of splitting the initial query into multiple sub-queries based on the initial query, the initial candidate documents corresponding to the initial query, and the reference query, using the target agents corresponding to each sub-query, determining the target sub-answers corresponding to each sub-query based on the target candidate documents corresponding to each sub-query, aggregating the target sub-answers corresponding to each sub-query to obtain an aggregated answer, and determining whether the aggregated answer meets the preset termination condition continues until the aggregated answer meets the preset termination condition. Finally, the target answer corresponding to the initial query is determined based on the initial query and the aggregated answer.
[0028] The edge device 102 may include a browser, an app (application), or a web application such as an H5 (Hypertext Markup Language 5) application, a lightweight application (also known as a mini-program), or a cloud application. The edge device can be developed based on a software development kit (SDK) provided by the server, such as a real-time communication (RTC) SDK. The edge device can be deployed in an electronic device and depends on the device's operation or certain apps within the device to run. The electronic device may have a display screen and support information browsing, such as a personal mobile terminal like a mobile phone, tablet, or personal computer. Various other types of applications can also be configured in the electronic device, such as human-computer interaction applications, model training applications, text processing applications, web browser applications, shopping applications, search applications, instant messaging tools, email clients, and social media platform software.
[0029] Server 104 can be understood as a server providing various services, including physical servers and cloud servers. Examples include servers providing communication services to multiple clients, servers supporting backend training of models used on clients, and servers processing data sent by clients. It's important to note that Server 104 can be implemented as a distributed server cluster composed of multiple servers, or as a single server. Server 104 can also be a server in a distributed system, or a server integrated with blockchain. Server 104 can also be a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology.
[0030] It is worth noting that the data processing method provided in the embodiments of this specification can be executed by the server 104. In other embodiments of this specification, if the operating resources of the end device 102 can meet the deployment and operation conditions of the large model, the embodiments of this specification can be performed on the end device 102. In other embodiments, the data processing method provided in the embodiments of this specification can also be jointly executed by the end device 102 and the server 104.
[0031] The data processing method provided in this specification, through an initial query, initial candidate documents corresponding to the initial query, and a reference query, can accurately guide the process of splitting the initial query into simpler subqueries, reducing the difficulty of subsequent query processing. When the target candidate documents corresponding to each subquery are determined from the initial candidate documents, the target sub-answers corresponding to each subquery are determined using these target candidate documents, simplifying the complex analysis and reasoning process based on the initial candidate documents. Furthermore, when the target sub-answers corresponding to each subquery are determined using the target agents corresponding to each subquery and the target candidate documents, more accurate target sub-answers can be obtained using the target agents. Further, the target answer corresponding to the initial query is determined based on the target sub-answers corresponding to each subquery. By splitting the initial query into relatively simple subqueries and using the target agents corresponding to each subquery to obtain the target sub-answers, the difficulty of solving subqueries is reduced, the complex analysis and reasoning process based on the initial candidate documents is simplified, and the accuracy of the target answer is improved.
[0032] See Figure 2 , Figure 2 A flowchart of a data processing method according to an embodiment of this specification is shown, which specifically includes the following steps.
[0033] Step 202: Based on the initial query, the initial candidate documents corresponding to the initial query, and the reference query, split the initial query to obtain multiple subqueries, and determine the target candidate documents corresponding to each subquery from the initial candidate documents.
[0034] The initial query can be understood as the query request initially entered by the user, used to search for relevant information in the document collection of the knowledge base, in order to answer the initial query using the found relevant information. The initial candidate documents can be understood as the set of documents that, based on the initial query, are preliminarily selected from the knowledge base that may contain the information the user needs.
[0035] Reference queries can be understood as one or more query splitting examples that are related to or similar to the initial query. That is, they include the original query and the split queries after splitting the original query, which are used to assist in splitting the initial query into subqueries and provide additional context or information. Alternatively, reference queries can also be hint text that guides how to split the initial query into subqueries more effectively. In practical applications, you can select a query splitting example related to the initial query from a number of preset query splitting examples.
[0036] Decomposition can be understood as breaking down the initial query into multiple smaller, more specific queries (i.e., subqueries) to more precisely locate information. A subquery can be understood as a component of the decomposed initial query, with each subquery focusing on a specific aspect or detail of the initial query. Target candidate documents can be understood as, for each subquery, the documents selected from the initial candidate documents that are most likely to contain the information required by that subquery. In other words, if the initial candidate documents are a set of documents related to the initial query, the target candidate documents are the subset of documents from the set of documents related to the initial query that are relevant to the subquery.
[0037] For example, if a user's initial query is "Introduce the main projects of companies A, B, and C", the initial query determines three initial candidate documents: Initial candidate document 1 introduces relevant information about company A, Initial candidate document 2 introduces relevant information about company B, and Initial candidate document 3 introduces relevant information about company C. The initial query can then be split into three subqueries: Subquery 1 introduces the main projects of company A, Subquery 2 introduces the main projects of company B, and Subquery 3 introduces the main projects of company C. The target candidate document corresponding to Subquery 1 is identified as Initial Candidate Document 1, the target candidate document corresponding to Subquery 2 is identified as Initial Candidate Document 2, and the target candidate document corresponding to Subquery 3 is identified as Initial Candidate Document 3.
[0038] By splitting the initial query and identifying the target candidate documents corresponding to each subquery, it is possible to more accurately locate and obtain the information needed by the user.
[0039] In one or more embodiments of this specification, initial candidate documents related to the initial query are first determined from the knowledge base. This reduces the amount of data processing when determining the target candidate documents corresponding to the subquery from the initial candidate documents. Furthermore, by extracting the document information of the initial candidate documents, the document splitting model can be more accurately guided to decompose the initial query based on this information. Specific implementation methods are described below: The initial query is split into multiple sub-queries based on the initial query, the initial candidate documents corresponding to the initial query, and the reference query, including: Based on the initial query, determine the initial candidate document corresponding to the initial query from the knowledge base, and determine the document information of the initial candidate document; Using a document splitting model, the initial query is split into multiple sub-queries based on the initial query, the document information, and the reference query.
[0040] The knowledge base can be understood as a database that stores a large amount of structured or unstructured information, used to respond to queries and provide relevant information. Document information can be understood as metadata about the initial candidate documents, such as titles, summary information (summarizing documents, generating a summary fragment for each document), keywords, structural information (the hierarchical tree structure of the documents), and document fragments related to the initial query (retrieving the most relevant document fragment from the documents using the initial query), which helps in further understanding and filtering documents.
[0041] A document splitting model can be understood as an algorithm or tool that can split an initial query into more specific and easier-to-process subqueries based on the initial query, the document information of candidate documents, and the reference query.
[0042] Specifically, based on the initial query input by the user, a set of possible candidate documents (i.e., initial candidate documents) is retrieved from the knowledge base, and detailed document information of these documents is obtained. Then, using a document splitting model, the initial query is split into multiple more specific and focused subqueries by combining the initial query, the document information of the initial candidate documents, and any available reference queries.
[0043] In practice, document information provides detailed descriptions of the content in the initial candidate documents, including titles, summaries, body text, and keywords. This information helps the document splitting model understand the document's topic and scope, thus more accurately splitting the initial query. Furthermore, by analyzing the document information, the model can assess the relevance between the initial query and the documents in the candidate document set, helping to break down sentences in the initial query that are relevant to the same document into subqueries. Reference queries provide examples of user queries, which help the document splitting model learn patterns and habits in user queries. For instance, by analyzing reference queries, common query structures and word combinations can be identified, leading to more accurate splitting of the initial query.
[0044] It should be noted that when using a document splitting model to split the initial query, there are cases where the initial query can be left unsplit. For example, if the initial query is "What are the main products of Company A, and what are their advantages?", and the most relevant document fragment retrieved from the document (such as an article introducing Company A mentioning "Company A's currently best-selling product a, which, thanks to its smooth and intelligent system, has been launched...") can directly answer the initial query, then there is no need to split the initial query.
[0045] In fact, as can be seen from the above examples, the initial query in the above examples involves a complex analytical reasoning problem involving multi-hop reasoning. That is, in the infinite search space of the Internet, it is necessary to first reason out "what is the main product of Company A", and then, based on the reasoning result "the main product of Company A is product a", further reasoning is needed on "the product advantages of product a" to obtain the final answer. However, by applying the data processing method of the embodiments of this specification, the answer corresponding to the initial query can be obtained quickly from the limited search space of the document scenario.
[0046] In one or more embodiments of this specification, document information may include two types of document information. One type is first document information, which includes information related to the content of the initial candidate documents. Therefore, the first document information can be pre-constructed offline. The second type of document information includes information related to the initial query from the initial candidate documents. Therefore, it needs to be obtained in real time when performing online inference on the initial query upon receipt. Specific implementation methods are as follows: The document information for determining the initial candidate documents includes: Using a document processing model, the initial candidate documents are processed to obtain the first document information of the initial candidate documents; Using a document retrieval model, based on the initial query, document recall is performed on the initial candidate documents to obtain second document information related to the initial query from the initial candidate documents; Based on the first document information and the second document information, the document information of the initial candidate document is determined.
[0047] The first document information can be understood as the document metadata built offline, such as summary information and structural information. This information is pre-calculated and stored when the document is added to the knowledge base. The second document information can be understood as the document fragment information related to the initial query, which needs to be retrieved online when the initial query is received.
[0048] A document processing model can be understood as an algorithmic model used to process documents and extract useful information. It can run offline or online and obtains the document's metadata through processing. A document retrieval model can be understood as an algorithmic model used to retrieve relevant documents from a large number of documents based on a query. It typically runs online and performs recall based on the similarity between the query and the documents.
[0049] In practical applications, the document processing model can pre-process all documents in the knowledge base to obtain the first document information of each document and store it in the knowledge base. When initial candidate documents are determined from the knowledge base based on the initial query, the first document information corresponding to the initial candidate documents can be directly determined from the knowledge base. Then, when the initial query is received, the document retrieval model can obtain online recalled document fragments or core information directly related to the initial query, i.e., obtain the second document information. By combining the first document information and the second document information, the comprehensive document information of the initial candidate documents is formed for subsequent analysis, processing and display.
[0050] For example, the initial query is to find "user manual for the new smart speaker". The product manual is processed offline using a document processing model to extract metadata such as the product name, model, and summary content (first document information). Then, a document retrieval model is used to receive the query online and match it with the product manual based on the keywords in the query (such as "smart speaker" and "user manual") to retrieve the operating steps recorded in the product manual (second document information). By combining the product's metadata and operating steps, comprehensive document information is generated.
[0051] The data processing method provided in the embodiments of this specification uses a document processing model and a document retrieval model to obtain first document information and second document information respectively, and combines these two types of information to determine the comprehensive document information of the initial candidate documents. This can more effectively meet the user's query needs and improve the accuracy and efficiency of information retrieval.
[0052] Step 204: Using the target agent corresponding to each subquery, determine the target sub-answer corresponding to each subquery based on the target candidate document corresponding to each subquery.
[0053] In this context, the target intelligent agent can be understood as an intelligent entity responsible for processing a specific subquery. This could be an artificial intelligence system, a machine learning model, or an expert system, capable of analyzing the subquery and providing an answer based on relevant information. The target candidate documents can be understood as, for each subquery, the set of documents selected from the initial candidate document set that are most likely to contain the required information.
[0054] The target sub-answer can be understood as the specific answer obtained by the target agent for the subquery after processing the subquery and its corresponding target candidate documents.
[0055] Specifically, for each subquery, a target agent specifically responsible for processing the subquery is used to analyze and process the target candidate documents associated with the subquery, and finally determine and output the target sub-answer for the subquery.
[0056] In one or more embodiments of this specification, a target agent corresponding to the query type of the subquery is determined. Each agent may be adept at handling different types of queries. Therefore, by determining the target agent based on the query type, a more accurate target sub-answer for the subquery can be obtained using the target agent. Specific implementation methods are described below: Before determining the target sub-answer corresponding to each sub-query based on the target candidate document corresponding to each sub-query using the target agent corresponding to each sub-query, the method further includes: Based on the query type of each subquery, determine the target agent corresponding to each subquery.
[0057] The query type can be understood as the nature or category of the subquery. For example, query types include summary generation, question answering, comparison, etc. The query type helps to determine the type of agent required to process the query.
[0058] Specifically, different agents may be good at handling different types of queries. By mapping the query type to the agent, the agent most suitable for handling the subquery is determined based on the query type of each subquery. Then, the selected target agent is called to handle the corresponding subquery.
[0059] For example, query types can also include factual queries and suggestive queries. In the case of a subquery like "What are the must-see attractions in city R?", the query type is determined to be a factual query. Therefore, the target intelligent agent for a factual query is a tourism information database or online travel guide. That is, by calling the tourism information database or online travel guide, a list of must-see attractions in city R can be retrieved. Conversely, in the case of a subquery like "How to plan an affordable trip to city R?", the query type is determined to be a suggestive query. Therefore, the target intelligent agent for a suggestive query is a tourism planning algorithm or expert system. That is, by calling the tourism planning algorithm or expert system, a customized travel plan can be generated based on user preferences (such as affordability) and tourism information for city R.
[0060] The data processing method provided in the embodiments of this specification determines and invokes the appropriate target agent according to the query type of the subquery, which can ensure that each subquery is processed in the most appropriate way, thereby improving the efficiency and accuracy of query processing for subqueries.
[0061] In one or more embodiments of this specification, the target agent is an agent based on a large language model. Therefore, when using the target agent to obtain the target sub-answer corresponding to the subquery, the target agent initially generates a prediction token sequence (a token is a basic unit in text, which can be a word, a phrase, a punctuation mark, or a character). At this time, when generating the prediction token sequence, a prediction state is determined. The prediction state can be used to determine whether the prediction generation process is complete. If it is complete, the generated prediction token sequence is determined as the target sub-answer corresponding to the subquery. The specific implementation method is as follows: The step of using the target agent corresponding to each subquery to determine the target sub-answer corresponding to each subquery based on the target candidate document corresponding to each subquery includes: Using the target agent corresponding to each subquery, the predicted text corresponding to each subquery is generated based on the target candidate document corresponding to each subquery, and the prediction status is determined. If the prediction status is incomplete, continue with the steps of generating the prediction text corresponding to each sub-query and determining the prediction status. When the prediction state is complete, the target sub-answer corresponding to each sub-query is determined based on the prediction text corresponding to each sub-query.
[0062] The agent's answers or explanations to the subqueries generated based on the target candidate documents are usually generated step by step in text form, so the predicted text can understand the above-mentioned sequence of predicted tokens.
[0063] The prediction state is a flag indicating whether the agent has completed the process of generating predicted text. An incomplete state means that the agent is still generating text; a completed state means that the agent has completed the generation of text.
[0064] Specifically, the target agent generates prediction tokens step by step. The prediction state can be determined by whether the prediction token sequence contains an end marker (which can be set according to the actual situation, such as a period or EOS token). For example, if the prediction token sequence contains an end marker, the prediction state is determined to be a completed state; otherwise, the prediction state is determined to be an incomplete state.
[0065] For each subquery, the corresponding target agent progressively generates predicted text based on target candidate documents. During generation, the target agent checks whether the predicted text contains an end marker to determine if the prediction state is complete. If the prediction state is incomplete, the target agent continues generating predicted text; if the prediction state is complete, the target sub-answer for the subquery is determined based on the generated predicted text.
[0066] The data processing method provided in the embodiments of this specification involves the target agent gradually constructing an answer based on the content of the target candidate document when generating the predicted text, and confirming the prediction state as a completed state when an end marker is detected, thereby determining the final target sub-answer to ensure the integrity of the target sub-answer.
[0067] In one or more embodiments of this specification, when a subquery is derived from an initial query, the target sub-answer corresponding to the subquery should inherit the constraint information from the initial query. This ensures that when the target sub-answer is generated based on the constraint information, subsequent aggregation of the target sub-answer to obtain the target answer will meet the requirements of the initial query. Specific implementation methods are as follows: The step of using the target agent corresponding to each subquery to determine the target sub-answer corresponding to each subquery based on the target candidate document corresponding to each subquery includes: Determine the initial constraint information corresponding to the initial query, and determine the target constraint information corresponding to each subquery from the initial constraint information; Using the target agent corresponding to each subquery, the target sub-answer corresponding to each subquery is determined in parallel based on the target candidate document and target constraint information corresponding to each subquery.
[0068] Initial constraints can be understood as the restrictions or requirements related to the initial query, which can affect the way the query is processed or the result. Target constraints can be understood as the restrictions or requirements related to a specific subquery, separated from the initial constraints.
[0069] Specifically, based on the initial query submitted by the user, the initial constraint information related to the initial query is determined. Then, the target constraint information related to each subquery is separated from these initial constraint information. Finally, using the target agent corresponding to each subquery, the target candidate document and the target constraint information are combined to determine the target sub-answer corresponding to each subquery.
[0070] In practical applications, when a user inputs an initial query, the initial query usually includes some constraints. These constraints can be determined from the initial query through named entity recognition, contextual understanding, and key constraint word recognition. For example, if a user's initial query contains multiple initial constraints, such as "Generate a 100-word summary based on this article, remembering to directly extract the original text content without arbitrarily altering the expression," then the target constraint for the subquery could be "Directly extract the core fragments from the original text, without arbitrarily altering the content."
[0071] In practice, the target agent corresponding to each subquery is a large model agent. Therefore, when the subquery, target candidate document, and target constraint information are input into the target agent, the target agent can obtain the target answer corresponding to each subquery.
[0072] It should be noted that the target agents corresponding to each subquery can be executed in parallel. By using the target agents corresponding to each subquery in parallel to process each subquery, the target sub-answers corresponding to each subquery can be obtained, thereby improving data processing efficiency.
[0073] The data processing method provided in the embodiments of this specification is crucial for determining the target constraint information of the subquery in the initial query. This target constraint information can be used to guide the target agent to search and filter information in the target candidate documents in order to accurately determine the final target sub-answer and make the target sub-answer meet the user's needs.
[0074] Step 206: Determine the target answer corresponding to the initial query based on the target sub-answers corresponding to each sub-query.
[0075] Specifically, once the target sub-answers for each subquery are obtained, the target answer for the initial query can be obtained by utilizing the target sub-answers for each subquery.
[0076] In one or more embodiments of this specification, when the target sub-answers corresponding to each subquery are obtained, it is necessary to aggregate the target sub-answers corresponding to each subquery to obtain an aggregated answer. A decision judgment is then made regarding the aggregated answer to determine whether it can answer the user's initial query. Based on the judgment result, it is decided whether to execute the target answer generation step or continue the loop. Specific implementation methods are described below: The step of determining the target answer corresponding to the initial query based on the target sub-answers corresponding to each sub-query includes: Aggregate the target sub-answers corresponding to each subquery to obtain the aggregated answer; Determine whether the aggregated answer meets the preset termination condition; If the aggregated answer meets the preset termination condition, the target answer corresponding to the initial query is determined based on the initial query and the aggregated answer. If the aggregated answer does not meet the preset termination condition, a target query is generated based on the aggregated answer and the multiple subqueries. This target query is determined as the initial query. The process of splitting the initial query into multiple subqueries based on the initial query, the corresponding initial candidate documents, and the reference query continues to be executed iteratively. Using the target agents corresponding to each subquery, the target sub-answers corresponding to each subquery are determined based on the corresponding target candidate documents. The target sub-answers corresponding to each subquery are aggregated to obtain the aggregated answer. The process of determining whether the aggregated answer meets the preset termination condition continues until the aggregated answer meets the preset termination condition. Finally, the target answer corresponding to the initial query is determined based on the initial query and the aggregated answer. The preset termination conditions include the aggregated answer matching the initial query, or the number of iterations reaching a preset threshold.
[0077] The aggregated answer can be understood as merging or integrating the target sub-answers of multiple subqueries into a more comprehensive answer, which can be obtained by directly concatenating the target sub-answers. The preset termination condition is used during the loop processing to determine whether to stop further splitting and querying.
[0078] The target query can be understood as a new query generated based on the current aggregated answer and multiple subqueries when the aggregated answer does not meet the preset termination condition, and used for the next round of iteration. The number of iterations can be understood as the number of rounds executed during the splitting and querying process. The preset threshold can be understood as the maximum limit set for the number of iterations, which can be set according to actual conditions to prevent infinite loops.
[0079] Specifically, the target sub-answers corresponding to each subquery are aggregated to form a more comprehensive aggregated answer. It is then determined whether this aggregated answer meets the preset termination condition. The preset termination condition may include the degree of matching between the aggregated answer and the initial query reaching a certain standard (if the degree of matching reaches a certain standard, it is considered that the aggregated answer can answer the initial query, that is, the aggregated answer covers all the intentions of the initial query), or the number of rounds of execution has reached a preset threshold.
[0080] If the aggregated answer meets the preset termination condition, then based on the initial query and the aggregated answer, the target answer corresponding to the initial query is determined. This target answer is a comprehensive and accurate response to the initial query. If the aggregated answer does not meet the preset termination condition, then a new target query needs to be generated based on the current aggregated answer and multiple subqueries. This new target query will be used as the initial query for the next round of iterations.
[0081] The newly generated target query is identified as the new initial query, and the previous steps are repeated, including splitting the new initial query to obtain multiple subqueries, using an agent to find sub-answers in candidate documents, aggregating the sub-answers again, and determining whether the new aggregated answer meets the preset termination condition.
[0082] The data processing method provided in the embodiments of this specification is an iterative process of splitting the initial query into sub-answers. By continuously splitting the query, finding sub-answers, aggregating answers, and determining termination conditions, a target answer that meets all user requirements is finally determined to improve the user experience.
[0083] In one or more embodiments of this specification, by generating a model from aggregated answers and initial query input text, it is possible to generate a target answer that is logically more complete and closer to the initial query requirements. Specific implementation methods are described below: The step of determining the target answer corresponding to the initial query based on the initial query and the aggregated answer includes: The initial query and the aggregated answer are input into a text generation model, and the target answer corresponding to the initial query is obtained using the text generation model.
[0084] The text generation model can be understood as a pre-trained model that can generate new text based on the input text (such as the initial query and the aggregated answer).
[0085] Specifically, the initial query and the aggregated answer are provided as input text to the text generation model. The text generation model analyzes these input texts, understands the relationships and contexts between them, and attempts to generate a text that can more comprehensively and accurately answer the initial query. The text generated by the text generation model is determined as the target answer corresponding to the initial query. This target answer integrates the requirements of the initial query and the information in the aggregated answer, providing a more complete and accurate response.
[0086] In practical applications, the generated target answer may still need some follow-up processing, such as validation, formatting, or further refinement, to ensure its quality and usability.
[0087] For example, the initial query might be "Please recommend a programming book suitable for beginners," while the aggregated answers include the titles, authors, and brief descriptions of several programming books. In this case, by inputting the initial query and the aggregated answers into a text generation model, the model might analyze this information and generate a target answer like this: "For beginners, I recommend the book 'P.' It's written by zz and is perfect for people with no programming experience." This target answer not only includes the book's title and author but also explicitly states that the book is suitable for beginners, thus providing a more comprehensive answer to the initial query.
[0088] The data processing method provided in the embodiments of this specification can generate a more logically complete target answer that is closer to the initial query requirements by aggregating the answer and generating the initial query input text, thereby providing users with a more complete and accurate response and improving user experience.
[0089] In one or more embodiments of this specification, before splitting the initial query into multiple sub-queries based on the initial query, the initial candidate documents corresponding to the initial query, and the reference query, the method further includes: Receive initial data sent by the client, wherein the initial data includes an initial query, or an initial query and an uploaded document; If the initial data includes uploaded documents, the uploaded documents are stored in the knowledge base; After determining the target answer corresponding to the initial query based on the target sub-answers corresponding to each sub-query, the process further includes: The target answer to the initial query is returned to the client so that the client can display the target answer on the user interface.
[0090] The user interface is a graphical interface that allows users to interact with the system, such as entering queries and viewing results.
[0091] Specifically, the client sends initial data to the server. This initial data may contain only the initial query, or it may include both the initial query and a document uploaded by the user through the client's user interface. The server receives and parses this initial data. If the initial data includes an uploaded document, the server stores this uploaded document in the knowledge base for subsequent processing and querying. At this point, document processing can be performed on the uploaded document to obtain its corresponding document information. In fact, if the uploaded document is stored in the knowledge base and the initial candidate documents are determined from the knowledge base, the initial candidate documents may include the uploaded document.
[0092] Based on the initial query, the server will perform a series of processes, including but not limited to query splitting, subquery execution, and answer aggregation. After a series of data processing, the server will generate a target answer, which is a comprehensive and accurate response to the initial query. The server will return the target answer to the client. After receiving the target answer, the client will display the answer on the user interface for the user to view.
[0093] The data processing method provided in the embodiments of this specification allows users to input data more conveniently and quickly through the interaction between the client and the server, thereby enabling the server's data processing system to obtain the target answer corresponding to the initial query.
[0094] The data processing method provided in the embodiments of this specification can improve the processing efficiency and accuracy of the decomposition process when using document information to guide the decomposition of the initial query; and when the initial query is split into multiple sub-queries, it can fully utilize the advantages of the agent to obtain the target sub-answer when using the target agent corresponding to each sub-query, solving complex analysis and reasoning problems in multi-document and long-document scenarios, including but not limited to multi-hop reasoning, comparative analysis, statistical analysis, and multi-intent understanding, effectively solving the shortcomings of the LongContext and RAG algorithms alone, such as RAG's poor performance in perceiving global information and LongContext's poor performance in handling infinite context, thereby improving the accuracy of the target sub-answer and further improving the accuracy of the target answer.
[0095] See Figure 3 , Figure 3 A flowchart illustrating the processing procedure of a data processing method provided in one embodiment of this specification is shown.
[0096] Specifically, the document meta-information of the document collection in the knowledge base (i.e., the document information in the above embodiment) is fully utilized. For example, the document meta-information includes the summary information, structural information, and core fragment information detected from the document collection using the original question (i.e. the initial pyramid scheme). This part of the document meta-information is used as the core input of document planning to guide the document splitting model to decompose the original question.
[0097] As described in the above embodiments, document meta-information represents the core source information of each document, such as summary information (summarizing the document, generating a summary fragment for each document), structural information (the hierarchical tree structure of the document), and core fragment information detected by the original question (retrieving the most relevant document fragment from the document using the original question). The first two summaries and structural information can be constructed offline, while the core fragment information detected by the original question can only be retrieved in real time during online inference.
[0098] In fact, by using a document processing agent to process the initial query, the target response (i.e., the target answer) corresponding to the initial query is obtained. In the specific processing, the sub-response (i.e. the target sub-answer) corresponding to each sub-query is obtained by using the sub-agents corresponding to each sub-query.
[0099] Figure 3 The planning module can be understood as the planning decomposition unit in the above embodiments. The input of the planning module includes the original question Q, the document meta-information list M of the document set related to the original question, and the Fewshot example F (i.e., the reference query in the above embodiments). Utilizing the planning and decomposition capabilities of the large model, Q is decomposed into a list of sub-task classes (this list contains information about each sub-task). The attribute information of the sub-task class may include the sub-task question Q' (i.e., the sub-query in the above embodiments), the task type of the sub-task (such as question-and-answer, summary, comparison, etc., i.e., the query type in the above embodiments), and the document set D' that the sub-task depends on (…). Figure 3 The selected document in the above embodiment, i.e. the target candidate document), and the constraint C' of the subtask ( Figure 3 The task constraint information (i.e., the target constraint information in the above embodiments) can be formally defined as F(Q,M,F)=Tasks[{Q',D',C'}]. In practical applications, it is determined whether the document length is greater than a set length threshold N, and whether to use LongContext or RAG technology to generate sub-responses. If the document length is greater than the set length threshold N, LongContext technology is selected; if the document length is not greater than the set length threshold N, RAG technology is selected.
[0100] Given a list of subtask classes, the corresponding sub-agent (i.e., the target agent in the above embodiment) can be determined using the task type of the subtask. Furthermore, during execution, each subtask can be executed in parallel to improve efficiency. Specifically, after obtaining the subtask list, each subtask is executed in parallel using an executor. After execution, answer information (denoted as A', i.e., the predicted text in the above embodiment) and status information (denoted as S', i.e., the predicted state in the above embodiment) are added to each subtask class. The status information represents the execution status code, and the obtained Task class field is updated from Tasks[{Q',D',C'},...] to Tasks[{Q',D',C',A',S'},...]. If the status information indicates a completed state, the answer information is determined as the sub-response corresponding to the sub-query.
[0101] The decision module can be understood as the decision network in the above embodiments. The decision module aggregates all sub-task information and makes decisions, determining whether to proceed to the final answer aggregation and generation step or continue the loop and continue the subsequent decomposition process. In fact, complex analysis problems of multi-hop reasoning type generally go through multiple decomposition processes. For example, an initial query is "What products do companies A and B have in the Internet field, and what are the differences between the products?" When the initial query is split into two sub-queries, "What products do companies A and B have in the Internet field" and "What are the differences between the products of the two companies", since these two sub-queries are not independent, they cannot be executed in parallel. Therefore, the first round of iteration mainly answers what products companies A and B have in the Internet field. When the decision module obtains the target sub-answer of the first sub-query, it will decide whether it can answer the initial query. Since it cannot answer the initial query, it will combine the intermediate result of the first round of iteration (i.e., the target sub-answer of the first sub-query, for example, companies A and B have products a and b in the Internet field) with the second sub-query to generate the clause "What are the differences between product a and product b" for the next round of iteration, and enter the next round of decomposition process.
[0102] In specific implementation, the sub-agent obtains a complete list of Tasks encapsulating the A' and S' fields, and then enters the decision module. The decision module aggregates the sub-responses of each sub-task and decides whether it can answer the user's original question Q. If it can, it returns the finish field (indicating that the decomposition process is over and can enter the inference module for processing). If it cannot, it generates a Q' (i.e., the target query in the above embodiment) and continues to enter the planning module for the next round of planning and decomposition. There are two stopping conditions for this loop (i.e., the preset ending condition in the above embodiment): one is the finish field, and the other is setting a maximum number of loop rounds MAX_ITER (i.e., a preset threshold).
[0103] In the reasoning module, a global answer is generated by the initial query and by aggregating the sub-responses of all sub-tasks (i.e., ...). Figure 3 The target response (the target answer in the above embodiments) can be understood as acting as the merging role in the divide-and-conquer framework. Specifically, based on the data processing methods described above, a concrete example will be used to explain the data processing methods in detail.
[0104] For example, when the server receives initial data from the client, including the initial query "clustering the above companies' main projects into three categories" and uploaded documents (including the 2023 annual reports of Company A, Company B, and Company C), it can first process the uploaded documents to obtain the document metadata of the three documents. In the planning module, based on the initial query, the document metadata of the three uploaded documents, and the reference query, the initial query is split into three sub-queries. For example, the three sub-queries might be to extract the main projects of Company A, Company B, and Company C, respectively. Then, three sub-agents are invoked to process each of the three sub-queries, and the sub-agents process the data according to the sub-query and its corresponding... Based on the constraint information and the documents they depend on, sub-responses are generated for each subquery. For example, sub-response 1 for subquery 1 is "Company A's main projects can be summarized into the following categories:...", sub-response 2 for subquery 2 is "In summary, Company B's main projects can be clustered into the following three categories:...", and sub-response 3 for subquery 3 is "According to the information in Company C's 2023 annual report,...". The three sub-responses are then input into the decision module, which determines the next execution step. For example, if it is determined that the three sub-responses can answer the initial query, the three sub-responses are input into the reasoning module to obtain the target answer for the initial query as "Based on the annual reports of each company, we can perform cluster analysis on the main projects of these companies, which are clustered into three categories:...".
[0105] The data processing method provided in the embodiments of this specification utilizes the divide-and-conquer approach to transform a complex problem into multiple simpler subproblems. It addresses the pain point of large models lacking sufficient or complete knowledge by reducing the difficulty of solving subqueries. Specifically, it decomposes the initial query into multiple subqueries and executes each subquery using a corresponding agent. This implements a multi-agent (multiple agents) method for complex analysis and reasoning of multiple documents and long documents, focusing on solving complex analysis and reasoning problems in multi-document and long document scenarios, including but not limited to multi-hop reasoning, comparative analysis, statistical analysis, and multi-intent understanding. Extensive verification has shown that the data processing method provided in the embodiments of this specification exhibits excellent performance on both public and project evaluation benchmarks.
[0106] Corresponding to the above method embodiments, this specification also provides data processing system embodiments. Figure 4 A schematic diagram of the structure of a data processing system according to one embodiment of this specification is shown. Figure 4 As shown, the system includes a planning and splitting unit 402, an execution and generation unit 404, and a decision-making and reasoning unit 406, wherein... The planning and splitting unit 402 is used to split the initial query according to the initial query, the initial candidate documents corresponding to the initial query, and the reference query to obtain multiple sub-queries, and to determine the target candidate documents corresponding to each sub-query from the initial candidate documents; The execution generation unit 404 is used to determine the target sub-answer corresponding to each sub-query based on the target candidate document corresponding to each sub-query using the target agent corresponding to each sub-query; The decision reasoning unit 406 is used to determine the target answer corresponding to the initial query based on the target sub-answer corresponding to each sub-query.
[0107] Optionally, the decision reasoning unit further includes a decision network and a reasoning network. The decision network is used to aggregate the target sub-answers corresponding to each sub-query, obtain an aggregated answer, and determine whether the aggregated answer meets a preset termination condition. If the aggregated answer meets a preset termination condition, the inference network is used to determine the target answer corresponding to the initial query based on the initial query and the aggregated answer. If the aggregated answer does not meet the preset termination condition, a target query is generated based on the aggregated answer and the multiple subqueries. This target query is determined as the initial query. The process of splitting the initial query into multiple subqueries based on the initial query, the corresponding initial candidate documents, and the reference query continues to be executed iteratively. Using the target agents corresponding to each subquery, the target sub-answers corresponding to each subquery are determined based on the corresponding target candidate documents. The target sub-answers corresponding to each subquery are aggregated to obtain the aggregated answer. The process of determining whether the aggregated answer meets the preset termination condition continues until the aggregated answer meets the preset termination condition. Finally, the target answer corresponding to the initial query is determined based on the initial query and the aggregated answer. The preset termination conditions include the aggregated answer matching the initial query, or the number of iterations reaching a preset threshold.
[0108] Optionally, the planning and splitting unit 402 is further configured to: Based on the initial query, determine the initial candidate document corresponding to the initial query from the knowledge base, and determine the document information of the initial candidate document; Using a document splitting model, the initial query is split into multiple sub-queries based on the initial query, the document information, and the reference query.
[0109] Optionally, the planning and splitting unit 402 is further configured to: Using a document processing model, the initial candidate documents are processed to obtain the first document information of the initial candidate documents; Using a document retrieval model, based on the initial query, document recall is performed on the initial candidate documents to obtain second document information related to the initial query from the initial candidate documents; Based on the first document information and the second document information, the document information of the initial candidate document is determined.
[0110] The system also includes: The target invocation unit is used to determine the target agent corresponding to each subquery based on the query type of each subquery.
[0111] Optionally, the generation unit 404 is further configured to: Using the target agent corresponding to each subquery, the predicted text corresponding to each subquery is generated based on the target candidate document corresponding to each subquery, and the prediction status is determined. If the prediction status is incomplete, continue with the steps of generating the prediction text corresponding to each sub-query and determining the prediction status. When the prediction state is complete, the target sub-answer corresponding to each sub-query is determined based on the prediction text corresponding to each sub-query.
[0112] Optionally, the decision reasoning unit 406 is further used for: The initial query and the aggregated answer are input into a text generation model, and the target answer corresponding to the initial query is obtained using the text generation model.
[0113] Optionally, the generation unit 404 is further configured to: Determine the initial constraint information corresponding to the initial query, and determine the target constraint information corresponding to each subquery from the initial constraint information; Using the target agent corresponding to each subquery, the target sub-answer corresponding to each subquery is determined in parallel based on the target candidate document and target constraint information corresponding to each subquery.
[0114] The system also includes: A receiving unit is configured to receive initial data sent by a client, wherein the initial data includes an initial query, or an initial query and an uploaded document, and if the initial data includes an uploaded document, the uploaded document is stored in a knowledge base. The sending unit is used to return the target answer of the initial query to the client, so that the client can display the target answer on the user interface.
[0115] The above is an illustrative scheme of a data processing system according to this embodiment. It should be noted that the technical solution of this data processing system and the technical solution of the data processing method described above belong to the same concept. For details not described in detail in the technical solution of the data processing system, please refer to the description of the technical solution of the data processing method described above.
[0116] Corresponding to the above method embodiments, this specification also provides data processing apparatus embodiments. Figure 5 A schematic diagram of the structure of a data processing apparatus according to one embodiment of this specification is shown. Figure 5 As shown, the device includes: The query splitting module 502 is configured to split the initial query based on the initial query, the initial candidate documents corresponding to the initial query, and the reference query to obtain multiple sub-queries, and to determine the target candidate documents corresponding to each sub-query from the initial candidate documents; The sub-answer determination module 504 is configured to use the target agent corresponding to each sub-query to determine the target sub-answer corresponding to each sub-query based on the target candidate document corresponding to each sub-query; The target answer determination module 506 is configured to determine the target answer corresponding to the initial query based on the target sub-answers corresponding to each sub-query.
[0117] In fact, the query splitting module 502 is configured to function similarly to the planning splitting unit in the above data processing system, the sub-answer determination module 504 is configured to function similarly to the execution generation unit in the above data processing system, and the target answer determination module 506 is configured to function similarly to the decision reasoning unit in the above data processing system. For specific implementation details, please refer to the embodiments of the above data processing system, which will not be repeated here.
[0118] The above is an illustrative scheme of a data processing apparatus according to this embodiment. It should be noted that the technical solution of this data processing apparatus and the technical solution of the data processing method described above belong to the same concept. For details not described in detail in the technical solution of the data processing apparatus, please refer to the description of the technical solution of the data processing method described above.
[0119] Figure 6 A structural block diagram of a computing device 600 provided according to one embodiment of this specification is shown.
[0120] The computing device 600 includes: Memory 610 and processor 620; The memory 610 is used to store computer programs or instructions, and the processor 620 is used to execute the computer programs or instructions, which, when executed by the processor 620, implement the steps of the data processing method.
[0121] In one or more embodiments of this specification, the computing device can be understood as an integrated smart terminal, including but not limited to a server, desktop computer, PC (Personal Computer), all-in-one model machine, mobile phone, tablet computer or other portable smart terminal, etc., and the computing device may have the model described in the above embodiments of this application pre-installed.
[0122] Specifically, this computing device can pre-install various types of models, including but not limited to models in natural language processing, visual processing, speech processing, code processing, and multimodal task processing, thus providing diverse model selection. In different product forms, this computing device can support one or more model usage methods, including but not limited to model training, model invocation, model fine-tuning, model deployment, model inference, and application. In some product forms, this computing device also supports model management, including but not limited to multi-type model management (supporting the management of discriminative, generative, and other model types), model version control (supporting the control of different model versions), and model evaluation (evaluating model performance and effectiveness based on model evaluation tools). In other product forms, this computing device can also create applications based on models, providing API (Application Programming Interface) calling capabilities. Users can call models into created applications through the API interface, and application management tools are also provided to manage and monitor the applications.
[0123] Furthermore, the computing device can also include data management (supporting the creation and management of model tuning datasets), a training center (providing abundant training resources to help users learn and master AI (Artificial Intelligence) technology), and basic control capabilities (providing enterprise-level basic control capabilities to ensure the security and efficient operation of the system). Through the above functions, it provides a comprehensive and integrated device for AI development, training, deployment, and application.
[0124] Figure 7 A structural block diagram of an electronic device 700 provided according to one embodiment of this specification is shown.
[0125] A memory 710 and a processor 720 are connected via a bus 730; The memory 710 is used to store computer programs or instructions, and the processor 720 is used to execute the computer programs or instructions, which, when executed by the processor 720, implement the steps of the method.
[0126] Specifically, the components of the electronic device 700 include, but are not limited to, a memory 710 and a processor 720. The processor 720 is connected to the memory 710 via a bus 730, and the database 750 is used to store data.
[0127] Electronic device 700 also includes access device 740, which enables electronic device 700 to communicate via one or more networks 760. Examples of these networks include Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or combinations of communication networks such as the Internet. Access device 740 may include one or more of any type of wired or wireless network interface (e.g., network interface card (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, Wi-MAX (Worldwide Interoperability for Microwave Access) interface, Ethernet interface, Universal Serial Bus (USB) interface, cellular network interface, Bluetooth interface, Near Field Communication (NFC) interface, and so on.
[0128] In one embodiment of this specification, the above-described components of the electronic device 700 and Figure 7 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 7 The block diagram of the electronic device shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.
[0129] Electronic device 700 can be any type of stationary or mobile electronic device, including mobile computers or mobile electronic devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable electronic devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary electronic devices such as desktop computers or personal computers (PCs). Electronic device 700 can also be a mobile or stationary server.
[0130] The above is an illustrative scheme of an electronic device according to this embodiment. It should be noted that the technical solution of this electronic device and the technical solution of the data processing method described above belong to the same concept. For details not described in detail in the technical solution of the electronic device, please refer to the description of the technical solution of the data processing method described above.
[0131] An embodiment of this specification also provides a computer-readable storage medium storing a computer program or instructions that, when executed by a processor, implement the steps of the above-described data processing method.
[0132] The above is an illustrative scheme of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium and the technical solution of the data processing method described above belong to the same concept. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solution of the data processing method described above.
[0133] An embodiment of this specification also provides a computer program product, including a computer program or instructions that, when executed by a processor, implement the steps of the above-described data processing method.
[0134] The above is an illustrative scheme of a computer program product according to this embodiment. It should be noted that the technical solution of this computer program product and the technical solution of the data processing method described above belong to the same concept. For details not described in detail in the technical solution of the computer program product, please refer to the description of the technical solution of the data processing method described above.
[0135] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0136] The computer program or instructions include computer program code, which may be in the form of source code, object code, executable file, or certain intermediate forms. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium may be appropriately added or removed according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media may not include electrical carrier signals and telecommunication signals.
[0137] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments in this specification are not limited to the described order of actions, because according to the embodiments in this specification, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments in this specification.
[0138] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0139] The preferred embodiments disclosed above are merely illustrative of this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the embodiments described herein. These embodiments are selected and specifically described in this specification to better explain the principles and practical applications of the embodiments, thereby enabling those skilled in the art to better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.
Claims
1. A data processing method, comprising: Based on the initial query, the initial candidate documents corresponding to the initial query, and the reference query, the initial query is split into multiple sub-queries, and the target candidate documents corresponding to each sub-query are determined from the initial candidate documents; Using the target agent corresponding to each subquery, the target sub-answer corresponding to each subquery is determined based on the target candidate document corresponding to each subquery; Based on the target sub-answers corresponding to each sub-query, the target answer corresponding to the initial query is determined.
2. The data processing method according to claim 1, wherein splitting the initial query into multiple sub-queries based on the initial query, the initial candidate documents corresponding to the initial query, and the reference query includes: Based on the initial query, determine the initial candidate document corresponding to the initial query from the knowledge base, and determine the document information of the initial candidate document; Using a document splitting model, the initial query is split into multiple sub-queries based on the initial query, the document information, and the reference query.
3. The data processing method according to claim 2, wherein determining the document information of the initial candidate document includes: Using a document processing model, the initial candidate documents are processed to obtain the first document information of the initial candidate documents; Using a document retrieval model, based on the initial query, document recall is performed on the initial candidate documents to obtain second document information related to the initial query from the initial candidate documents; Based on the first document information and the second document information, the document information of the initial candidate document is determined.
4. The data processing method according to any one of claims 1-3, before determining the target sub-answer corresponding to each sub-query based on the target candidate document corresponding to each sub-query using the target agent corresponding to each sub-query, further includes: Based on the query type of each subquery, determine the target agent corresponding to each subquery.
5. The data processing method according to claim 1, wherein determining the target sub-answer corresponding to each sub-query based on the target candidate document corresponding to each sub-query using the target agent corresponding to each sub-query includes: Using the target agent corresponding to each subquery, the predicted text corresponding to each subquery is generated based on the target candidate document corresponding to each subquery, and the prediction status is determined. If the prediction status is incomplete, continue with the steps of generating the prediction text corresponding to each sub-query and determining the prediction status. When the prediction state is complete, the target sub-answer corresponding to each sub-query is determined based on the prediction text corresponding to each sub-query.
6. The data processing method according to claim 1, wherein determining the target answer corresponding to the initial query based on the target sub-answer corresponding to each sub-query includes: Aggregate the target sub-answers corresponding to each subquery to obtain the aggregated answer; Determine whether the aggregated answer meets the preset termination condition; If the aggregated answer meets the preset termination condition, the target answer corresponding to the initial query is determined based on the initial query and the aggregated answer. If the aggregated answer does not meet the preset termination condition, a target query is generated based on the aggregated answer and the multiple subqueries. The initial query is updated to the target query, and the process of splitting the initial query into multiple subqueries based on the initial query, the initial candidate documents corresponding to the initial query, and the reference query continues to be executed in a loop. The steps of splitting the initial query into multiple subqueries using the target agents corresponding to each subquery, determining the target sub-answers corresponding to each subquery based on the target candidate documents corresponding to each subquery, aggregating the target sub-answers corresponding to each subquery to obtain the aggregated answer, and determining whether the aggregated answer meets the preset termination condition are repeated until the aggregated answer meets the preset termination condition. Finally, the target answer corresponding to the initial query is determined based on the initial query and the aggregated answer. The preset termination conditions include the aggregated answer matching the initial query, or the number of iterations reaching a preset threshold.
7. The data processing method according to claim 6, wherein determining the target answer corresponding to the initial query based on the initial query and the aggregated answer includes: The initial query and the aggregated answer are input into a text generation model, and the target answer corresponding to the initial query is obtained using the text generation model.
8. The data processing method according to any one of claims 1-3 and 5-7, wherein the step of using the target agent corresponding to each sub-query to determine the target sub-answer corresponding to each sub-query based on the target candidate document corresponding to each sub-query includes: Determine the initial constraint information corresponding to the initial query, and determine the target constraint information corresponding to each subquery from the initial constraint information; Using the target agent corresponding to each subquery, the target sub-answer corresponding to each subquery is determined in parallel based on the target candidate document and target constraint information corresponding to each subquery.
9. The data processing method according to claim 1, before splitting the initial query into multiple sub-queries based on the initial query, the initial candidate documents corresponding to the initial query, and the reference query, further includes: Receive initial data sent by the client, wherein the initial data includes an initial query, or an initial query and an uploaded document; If the initial data includes uploaded documents, the uploaded documents are stored in the knowledge base; After determining the target answer corresponding to the initial query based on the target sub-answers corresponding to each sub-query, the process further includes: The target answer is returned to the client so that the client can display the target answer on the user interface.
10. A data processing system, comprising a planning and decomposition unit, an execution and generation unit, and a decision-making and reasoning unit, wherein, The planning and splitting unit is used to split the initial query into multiple sub-queries based on the initial query, the initial candidate documents corresponding to the initial query, and the reference query, and to determine the target candidate documents corresponding to each sub-query from the initial candidate documents; An execution generation unit is used to determine the target sub-answer corresponding to each sub-query based on the target candidate document corresponding to each sub-query, using the target agent corresponding to each sub-query. The decision reasoning unit is used to determine the target answer corresponding to the initial query based on the target sub-answers corresponding to each sub-query.
11. The data processing system according to claim 10, wherein the decision reasoning unit includes a decision network and a reasoning network. The decision network is used to aggregate the target sub-answers corresponding to each sub-query, obtain an aggregated answer, and determine whether the aggregated answer meets a preset termination condition. If the aggregated answer meets the preset termination condition, the inference network is used to determine the target answer corresponding to the initial query based on the initial query and the aggregated answer. If the aggregated answer does not meet the preset termination condition, a target query is generated based on the aggregated answer and the multiple subqueries. This target query is determined as the initial query. The process of splitting the initial query into multiple subqueries based on the initial query, the corresponding initial candidate documents, and the reference query continues to be executed iteratively. Using the target agents corresponding to each subquery, the target sub-answers corresponding to each subquery are determined based on the corresponding target candidate documents. The target sub-answers corresponding to each subquery are aggregated to obtain the aggregated answer. The process of determining whether the aggregated answer meets the preset termination condition continues until the aggregated answer meets the preset termination condition. Finally, the target answer corresponding to the initial query is determined based on the initial query and the aggregated answer. in, The preset termination conditions include the aggregated answer matching the initial query, or the number of iterations reaching a preset threshold.
12. A data processing apparatus, comprising: The query splitting module is configured to split the initial query based on the initial query, the initial candidate documents corresponding to the initial query, and the reference query to obtain multiple sub-queries, and to determine the target candidate documents corresponding to each sub-query from the initial candidate documents; The sub-answer determination module is configured to use the target agent corresponding to each sub-query to determine the target sub-answer corresponding to each sub-query based on the target candidate document corresponding to each sub-query; The target answer determination module is configured to determine the target answer corresponding to the initial query based on the target sub-answers corresponding to each sub-query.
13. A computing device, comprising: Memory and processor; The memory is used to store computer programs or instructions, and the processor is used to execute the computer programs or instructions, which, when executed by the processor, implement the steps of the method according to any one of claims 1 to 9.
14. An electronic device, comprising: A memory and a processor, the memory and the processor being connected via a bus; The memory is used to store computer programs or instructions, and the processor is used to execute the computer programs or instructions, which, when executed by the processor, implement the steps of the method according to any one of claims 1 to 9.
15. A computer-readable storage medium storing a computer program or instructions that, when executed by a processor, implement the steps of the method according to any one of claims 1 to 9.
16. A computer program product comprising a computer program or instructions which, when executed by a processor, implement the steps of the method according to any one of claims 1 to 9.