Query task processing method and document question answering method

By constructing categorized prompts and using a task processing model for binary classification to filter target document fragments, the problem of poor query accuracy caused by the diversity of responses from large models is solved, achieving efficient and accurate query task processing.

CN122364362APending Publication Date: 2026-07-10ALIBABA (CHINA) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ALIBABA (CHINA) CO LTD
Filing Date
2025-01-10
Publication Date
2026-07-10

Smart Images

  • Figure CN122364362A_ABST
    Figure CN122364362A_ABST
Patent Text Reader

Abstract

This specification provides a query task processing method and a document question-answering method. The query task processing method includes: obtaining document query information and multiple candidate document fragments corresponding to the document query information; constructing classification hints for the candidate document fragments based on the document query information and the candidate document fragments, and inputting the classification hints into a task processing model to obtain classification results for the candidate document fragments; using the classification results of multiple candidate document fragments, selecting a target document fragment from the multiple candidate document fragments; and generating a document query answer for the document query information based on the target document fragment. By constructing a binary closed candidate document fragment classification task, the task processing model can directly determine which candidate document fragments are answer reference documents related to the document query information, avoiding the establishment of a mapping relationship between the model response and the expected query result, thus improving the accuracy of query task processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments in this specification relate to the field of Internet technology, and in particular to query task processing methods and document question-and-answer methods. Background Technology

[0002] With the rapid development of internet technology, the amount of information worldwide is exploding. Hundreds of millions of new data points are generated daily via the internet, encompassing various forms such as text, images, audio, and video. This information explosion not only brings users a high degree of resource abundance but also places higher demands on the processing of query tasks.

[0003] Currently, large models can generate responses indicating the relevance between the query text and the query information. Then, a mapping is established between the responses and the expected query results, and the query text relevant to the query information is determined based on this mapping. However, due to the diversity of responses from large models, constructing a perfectly accurate mapping is very difficult. This limits the determination of the query text relevant to the query information to the perfection of the mapping construction, further resulting in poor accuracy in query task processing. Therefore, a highly accurate query task processing solution is urgently needed. Summary of the Invention

[0004] In view of this, embodiments of this specification provide a query task processing method. One or more embodiments of this specification also relate to a document question-and-answer method, an information processing method based on a task processing model, a task platform, a query task processing device, a document question-and-answer device, an information processing device based on a task processing model, 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 query task processing method is provided, including:

[0006] Retrieve document query information and multiple candidate document fragments corresponding to the document query information;

[0007] Based on document query information and candidate document fragments, classification hints for candidate document fragments are constructed, and the classification hints are input into the task processing model to obtain the classification results of candidate document fragments. The classification results include a first classification result and a second classification result. The first classification result represents the prediction result that the candidate document fragment is an answer reference document, and the second classification result represents the prediction result that the candidate document fragment is a non-answer reference document.

[0008] The target document fragment is selected from the classification results of multiple candidate document fragments.

[0009] Based on the target document fragment, generate the document query answer with document query information.

[0010] According to a second aspect of the embodiments of this specification, a document question-and-answer method is provided, including:

[0011] Obtain document questions for a target document, where the target document includes multiple candidate document fragments;

[0012] Based on the document question and candidate document fragments, classification hints for candidate document fragments are constructed, and the classification hints are input into the task processing model to obtain the classification results of the candidate document fragments. The classification results include a first classification result and a second classification result. The first classification result represents the prediction result that the candidate document fragment is the answer reference document, and the second classification result represents the prediction result that the candidate document fragment is the non-answer reference document.

[0013] The target document fragment is selected from the classification results of multiple candidate document fragments.

[0014] Generate document answers to document questions based on target document fragments.

[0015] According to a third aspect of the embodiments of this specification, an information processing method based on a task processing model is provided, applied to a task platform, comprising:

[0016] Receive model requests sent by terminal devices;

[0017] Based on the model request, a target task processing model is determined from multiple task processing models, whereby the target task processing model is used to execute the query task processing method.

[0018] According to a fourth aspect of the embodiments of this specification, a task platform is provided, including a request interface and a response unit;

[0019] The request interface is used to receive model requests sent by terminal devices. The model request includes at least one of the following: the scene identifier of the target scene, the scene input data of the target scene, and the model specification parameters.

[0020] The response unit is used to determine the target task processing model from multiple task processing models based on the model request, wherein the target task processing model is used to execute the query task processing method.

[0021] According to a fifth aspect of the embodiments of this specification, a query task processing apparatus is provided, comprising:

[0022] The first acquisition module is configured to acquire document query information and multiple candidate document fragments corresponding to the document query information;

[0023] The first input module is configured to construct classification hints for candidate document fragments based on document query information and candidate document fragments, and input the classification hints into the task processing model to obtain the classification results of the candidate document fragments. The classification results include a first classification result and a second classification result. The first classification result represents the prediction result that the candidate document fragment is an answer reference document, and the second classification result represents the prediction result that the candidate document fragment is a non-answer reference document.

[0024] The first filtering module is configured to filter out the target document fragment from multiple candidate document fragments using the classification results of multiple candidate document fragments;

[0025] The first generation module is configured to generate document query answers based on the target document fragment.

[0026] According to a sixth aspect of the embodiments of this specification, a document question-and-answer device is provided, comprising:

[0027] The second acquisition module is configured to acquire document questions for the target document, wherein the target document includes multiple candidate document fragments;

[0028] The second input module is configured to construct classification hints for candidate document fragments based on the document question and candidate document fragments, and input the classification hints into the task processing model to obtain the classification results of the candidate document fragments. The classification results include a first classification result and a second classification result. The first classification result represents the prediction result that the candidate document fragment is the answer reference document, and the second classification result represents the prediction result that the candidate document fragment is the non-answer reference document.

[0029] The second filtering module is configured to filter out the target document fragment from multiple candidate document fragments using the classification results of multiple candidate document fragments;

[0030] The second generation module is configured to generate document answers to document questions based on target document fragments.

[0031] According to a seventh aspect of the embodiments of this specification, an information processing apparatus based on a task processing model is provided, applied to a task platform, comprising:

[0032] The receiving module is configured to receive model requests sent by the terminal device;

[0033] The determination module is configured to determine the target task processing model from multiple task processing models based on the model request, wherein the target task processing model is used to execute the query task processing method.

[0034] According to an eighth aspect of the embodiments of this specification, a computing device is provided, comprising:

[0035] Memory and processor;

[0036] The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions, which, when executed by the processor, implement the steps of the methods provided in the first, second, or third aspects described above.

[0037] According to a ninth aspect of the embodiments of this specification, an electronic device is provided, comprising:

[0038] The memory and processor are connected via a bus;

[0039] The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions, which, when executed by the processor, implement the steps of the methods provided in the first, second, or third aspects described above.

[0040] According to a tenth aspect of the embodiments of this specification, a computer-readable storage medium is provided that stores a computer program / instructions that, when executed by a processor, implement the steps of the methods provided in the first, second, or third aspects described above.

[0041] According to an eleventh aspect of the embodiments of this specification, a computer program product is provided, including a computer program / instructions that, when executed by a processor, implement the steps of the methods provided in the first, second, or third aspects described above.

[0042] This specification provides a query task processing method according to one embodiment, comprising: acquiring document query information and multiple candidate document fragments corresponding to the document query information; constructing classification hint information for the candidate document fragments based on the document query information and the candidate document fragments, and inputting the classification hint information into a task processing model to obtain classification results for the candidate document fragments, wherein the classification results include a first classification result and a second classification result, the first classification result representing the prediction result that the candidate document fragment is an answer reference document, and the second classification result representing the prediction result that the candidate document fragment is a non-answer reference document; using the classification results of multiple candidate document fragments, selecting a target document fragment from the multiple candidate document fragments; and generating a document query answer for the document query information based on the target document fragment. By constructing a binary closed candidate document fragment classification task, the task processing model can directly determine which candidate document fragments are answer reference documents related to the document query information, avoiding the establishment of a mapping relationship between the model response and the expected query result, thereby improving the efficiency of query task processing, and fully leveraging the semantic understanding, reasoning, and instruction following capabilities of the task processing model, thus improving the accuracy of query task processing. Attached Figure Description

[0043] Figure 1 This is a flowchart illustrating a query task processing method provided in one embodiment of this specification;

[0044] Figure 2 This is a flowchart illustrating the processing procedure of a query task processing system provided in one embodiment of this specification.

[0045] Figure 3 This is a flowchart illustrating the processing procedure of an information retrieval unit according to one embodiment of this specification;

[0046] Figure 4 This is a flowchart illustrating the processing procedure of another information retrieval unit provided in one embodiment of this specification;

[0047] Figure 5 This is a flowchart illustrating the processing procedure of a query task processing method provided in one embodiment of this specification;

[0048] Figure 6 This is an architecture diagram of a query task processing system provided in one embodiment of this specification;

[0049] Figure 7 This is a flowchart illustrating a document question-and-answer method provided in one embodiment of this specification;

[0050] Figure 8 This is a flowchart illustrating an information processing method based on a task processing model, provided in one embodiment of this specification.

[0051] Figure 9 This is a schematic diagram of the structure of a task platform provided in one embodiment of this specification;

[0052] Figure 10 This is a schematic diagram of the structure of a query task processing device provided in one embodiment of this specification;

[0053] Figure 11 This is a schematic diagram of the structure of a document question-and-answer device provided in one embodiment of this specification;

[0054] Figure 12 This is a schematic diagram of the structure of an information processing device based on a task processing model provided in one embodiment of this specification;

[0055] Figure 13 This is a structural block diagram of a computing device provided in one embodiment of this specification;

[0056] Figure 14 This is a structural block diagram of an electronic device provided in one embodiment of this specification. Detailed Implementation

[0057] 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.

[0058] 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.

[0059] 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."

[0060] 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.

[0061] 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 foundational 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-scale language models and multimodal pre-training models.

[0062] 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 NLP tasks such as text-based sentiment classification, text summarization, and machine translation. The main application scenarios for large models include digital assistants, intelligent robots, search, online education, office software, e-commerce, and intelligent design.

[0063] First, the terms and concepts used in one or more embodiments of this specification will be explained.

[0064] Language Model (LM): A statistical model used to understand and generate natural language. The goal of a language model is to analyze a text and predict the probability distribution of the next word or character. Language models can be used for a variety of text generation tasks.

[0065] Large-scale language models (LLMs) refer to neural network models with greater scale and capabilities. By increasing the number of parameters, layers, and attention mechanisms, large models can better capture the semantics, structure, and relationships of text. Large models have achieved significant results in natural language processing tasks.

[0066] A prompt is an input text or instruction that triggers an action or generates a response. For example, an input sentence provided to an artificial intelligence language model is a prompt.

[0067] A token is the smallest unit of input to the model. When the model predicts the next token, the token can be understood as a discrete unit in the input sequence. It can be a word, phrase, subword, character, or even a custom-defined smaller or larger fragment of text.

[0068] Key-Value Cache: Since each generated token requires the input prompt as well as the key and value information of previous tokens, and the same prompt is often used for the same task, recording the key and value information corresponding to previous tokens and reusing them when encountering the same prompt can greatly save computational resources.

[0069] Information retrieval (IR) is an important field in computer science that aims to use computer systems to find relevant information that meets a user's information needs from large amounts of unstructured data. Information retrieval typically involves a large collection of documents, such as web pages or document libraries, where each document can be any form of unstructured text data. Users typically input their search requests in the form of queries, which can be keywords, phrases, or natural language sentences.

[0070] Retrieval-Augmented Generation (RAG) is a technique that combines retrieval and generation to improve the accuracy and reliability of artificial intelligence systems in answering natural language questions. RAG combines traditional retrieval-based question-answering systems with natural language generation techniques, enabling the model to utilize the latest information from external knowledge bases when generating answers. This overcomes some limitations of traditional generative models, such as outdated knowledge and susceptibility to misleading information. Through its retrieval module, RAG can obtain the most relevant or up-to-date information in real time, ensuring that the generated answers are based on correct knowledge.

[0071] Deep self-attention (Transformer) models are network structures based on multi-head self-attention mechanisms, primarily used for processing sequential data. A Transformer model consists of repeatedly stacked encoder and decoder units. This design allows the Transformer to efficiently learn long-term dependencies, making it suitable for various natural language processing tasks, including machine translation, text summarization, and question answering systems.

[0072] Bidirectional Encoder Representations from Transformers (BERT) model: This is a pre-trained NLP model. By learning from a large amount of unlabeled text data, this model can capture deep semantic information in text and achieves significant performance improvements on many NLP tasks.

[0073] The Text-to-Text Transfer Transformer (T5) model is an NLP model. The main characteristic of the T5 model is that it unifies all NLP tasks into a text-to-text format, meaning both the input and output are text sequences. This design makes the model more adaptable to various tasks, such as translation, question answering, and summarization.

[0074] In traditional information retrieval schemes, vector-based retrieval is the mainstream approach: a bidirectional coding neural network model (such as BERT and its variants) is used. Both the text fragment to be retrieved and the query are input into the neural network model, and the final layer output vector serves as the representation of both the text fragment and the query. The vector representation of the query is then multiplied by the vector representations of all the text fragments to be retrieved, and the resulting dot product value is considered the relevance between the query and the text fragments to be retrieved. The fragments with the highest similarity are then retrieved as needed. However, this method only yields similarity scores, often only retrieving similar or related text fragments. It is difficult to achieve semantic-level understanding and retrieve relevant text content.

[0075] Because large models can achieve recall at both the "understanding" and "reasoning" levels, some works utilize their reasoning and generation capabilities. They combine the search fragment with the query to form a question, which the large model then responds to, using various complex mapping rules to determine whether to recall the current fragment. For example, the query is: "Li Bai's poems." The search fragment is: "Before my bed, the bright moonlight shines, I wonder if it's frost on the ground. I raise my head to gaze at the bright moon, then lower my head and think of my hometown." The question is: Is the question "Before my bed, the bright moonlight shines, I wonder if it's frost on the ground. I raise my head to gaze at the bright moon, then lower my head and think of my hometown" related to "Li Bai's poems"? The large model's response is: This poem is indeed related to Li Bai. The poem, titled "Quiet Night Thoughts," is a five-character ancient poem by the Tang Dynasty poet Li Bai. It concisely and profoundly expresses the poet's longing for his hometown. By depicting the scene of moonlight shining on his bed and the resulting deep yearning for his distant home, it showcases the poet's delicate emotions and outstanding artistic talent. In conclusion, this text fragment is related to "Li Bai's poems." Next, a complex mapping is constructed: "This poem is indeed related to Li Bai" and "This text fragment is related to 'Li Bai's poems'" are mapped to "related fragments". Although this method can leverage the understanding and reasoning capabilities of large models, due to the diversity of responses from large models, constructing perfectly accurate mappings is very difficult. This results in information retrieval results being limited by the completeness of the mapping construction; waiting for the large model to generate a complete answer takes too long and is too slow.

[0076] To address the aforementioned issues, this specification provides a detailed analysis of the model in its embodiments. Model training can typically be divided into three stages: pre-training, supervised fine-tuning (SFT), and human preference alignment. In the pre-training stage, the model learns how to continue writing based on partial text input on a massive amount of text data. During pre-training, the model gradually acquires general pattern recognition capabilities (such as recognizing common patterns in language, like word collocations, grammatical structures, and contextual dependencies), semantic understanding capabilities (i.e., by capturing a wide range of linguistic phenomena, the model can understand the semantics of text to a certain extent, extracting semantic relationships between words and the basic meaning of sentences), and general domain knowledge (such as 1+1=2, the sun rises in the east). In the supervised fine-tuning stage, the model is required to complete certain instructions; that is, the input to the model consists of task-oriented instructions, requiring the model to generate responses capable of completing the corresponding tasks. This training phase improves the model's ability to understand human intentions, reason, and follow instructions—that is, its performance in specific application scenarios, ensuring it can accurately complete given tasks. For example, the following training data are SFT data for customer service and literature scenarios, respectively. Example 1: Input: I want to know the current status of the item I ordered last week? Model Response: Hello, thank you for your inquiry. You can check the latest order status through our order query page, or you can provide the order number so I can help you with further inquiries. Example 2: Input: Please list three ancient poets. Model Response: There are many outstanding poets in history, including Li Bai, Du Fu, and Wang Wei. They are known for their Romantic poetry, Realist poetry, and pastoral poetry, respectively. In the human preference alignment phase, the model is required to generate multiple versions of responses to the same input. These responses are then scored according to a scoring algorithm or real human ratings. Based on the scores obtained from the responses, the model strengthens its instruction-following ability and learns which responses are more in line with human values ​​and social norms.

[0077] Based on the above analysis, this embodiment of the specification proposes a query task processing scheme that uses the model as a retrieval tool to determine the target document fragment, taking into account the task characteristics of the retrieval task, the semantic understanding ability, reasoning ability, various domain knowledge, instruction compliance ability obtained from model training, and the characteristics of the model generation method. The scheme involves: obtaining document query information and multiple candidate document fragments corresponding to the document query information; constructing classification hints for the candidate document fragments based on the document query information and the candidate document fragments, and inputting the classification hints into the task processing model to obtain classification results for the candidate document fragments. These classification results include a first classification result and a second classification result. The first classification result represents the prediction that the candidate document fragment is an answer reference document, and the second classification result represents the prediction that the candidate document fragment is a non-answer reference document. Using the classification results of multiple candidate document fragments, the target document fragment is selected from the multiple candidate document fragments. Finally, based on the target document fragment, the document query answer for the document query information is generated.

[0078] It is worth noting that the scheme proposed in the embodiments of this specification can leverage the semantic understanding and reasoning capabilities of the task processing model, significantly reducing time consumption while achieving better information retrieval results. It does not require the construction of complex mapping rules, ensuring the speed of retrieval recall. Furthermore, the target document fragment determination scheme proposed in the embodiments of this specification can be used as an independent recall method, or it can be combined with traditional retrieval methods for multi-path recall to improve the recall rate.

[0079] This specification provides a query task processing method, and also relates to a document question-and-answer method, an information processing method based on a task processing model, a task platform, a query task processing device, a document question-and-answer device, an information processing device based on a task processing model, 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.

[0080] See Figure 1 , Figure 1 This specification shows a flowchart of a query task processing method according to an embodiment, which specifically includes the following steps:

[0081] Step 102: Obtain document query information and multiple candidate document fragments corresponding to the document query information.

[0082] It should be noted that document query information refers to the document query information corresponding to the target query task. The target query task refers to a task set by the user or system to find specific information from documents related to the document query information. The target query task can be a query task in different scenarios, such as a legal clause query task in a legal scenario, or a knowledge document question-and-answer task in an academic scenario. Document query information describes the query intent and expresses the specific information the user hopes to obtain from the document. Document query information can be a complete document question or a set of parameters used to guide and limit the query process, such as query conditions, query scope, and expected result format. Document query information can be information in different modalities, such as text query information, voice query information, and image query information, selected according to the actual situation; this specification does not impose any limitations on this.

[0083] In practical applications, there are various ways to obtain document query information and multiple candidate document fragments corresponding to the document query information. The specific method is selected according to the actual situation, and the embodiments in this specification do not impose any limitations on this. In one possible implementation of this specification, document query information and multiple candidate document fragments corresponding to the document query information sent by the user through a terminal device can be received. In another possible implementation of this specification, document query information and multiple candidate document fragments corresponding to the document query information can be read from other databases or data acquisition devices.

[0084] In one optional embodiment of this specification, multiple candidate document fragments are obtained by segmenting the target document corresponding to the document query information. The above-mentioned acquisition of the document query information and the multiple candidate document fragments corresponding to the document query information may include the following steps:

[0085] Retrieve document search information and the target document corresponding to the document search information;

[0086] The target document is segmented to obtain multiple candidate document segments.

[0087] It should be noted that the target document refers to a document related to the document query information, such as a document containing keywords from the document query information, or a document in the same domain as the document query information. The target document can be a document from different data sources, including databases, document knowledge bases, and at least one source on the internet. When obtaining the target document corresponding to the document query information, a search engine or database query tool can be used to search for the target document matching the document query information from multiple data sources. The search process can be carried out through various methods such as full-text indexing and metadata matching. The target document can be any form of electronic document, such as Portable Document Format (PDF), text format, web page format, etc. Fragmentation, also known as segmentation, refers to dividing a large document into smaller, logically coherent parts, i.e., multiple candidate document fragments. Candidate document fragments refer to document parts related to the document query information that may contain the answer. Candidate document fragments can be sentences, paragraphs, chapters, etc., selected according to the actual situation; this specification does not impose any limitations on this.

[0088] In practical applications, there are various ways to segment a target document to obtain multiple candidate document segments. The specific method chosen depends on the actual situation, and the embodiments in this specification do not impose any limitations on this. One possible implementation of this specification is to segment the target document into multiple candidate document segments based on natural delimiters (such as paragraphs, sentences, chapters, etc.). Another possible implementation of this specification is to utilize a deep learning model to understand the structure of the target document and segment it into multiple semantically complete candidate document segments.

[0089] By applying the solution of the embodiments in this specification, multiple candidate document fragments are obtained by segmenting the target document, thereby dividing the target document into multiple independent query units and more accurately determining the document content that can answer the document query information.

[0090] Step 104: Based on the document query information and candidate document fragments, construct classification hint information for the candidate document fragments, and input the classification hint information into the task processing model to obtain the classification results of the candidate document fragments. The classification results include a first classification result and a second classification result. The first classification result represents the prediction result that the candidate document fragment is an answer reference document, and the second classification result represents the prediction result that the candidate document fragment is a non-answer reference document.

[0091] In one or more embodiments of this specification, after obtaining multiple candidate document fragments, in order to reduce the number of candidate document fragments when generating document query answers and thus improve query efficiency, target document fragments that are highly relevant to the document query information can be retrieved from the multiple candidate document fragments. That is, given a set of candidate document fragments {Text_1, Text_2, ..., Text_n} and document query information Q, the relevance of each candidate document fragment to the document query information is determined. In the embodiments of this specification, a task processing model can be used as a retrieval device to retrieve target document fragments from multiple candidate document fragments. Based on the instruction-following capability of the task processing model, a retrieval recall task is proposed as basic classification prompt information to the task processing model, enabling the task processing model to perform a closed binary classification task on each candidate document fragment, thereby determining whether each candidate document fragment is a prediction result of the answer reference document for the document query information.

[0092] It's important to note that classification hints are guiding information designed to help task processing models better understand and classify candidate document fragments. Classification hints typically include task descriptions related to the retrieval and recall task, enabling the model to accurately classify the document rather than randomly generating content. Optionally, classification hints may also include at least one reference classification sequence to improve the accuracy of the task model's judgment on whether a candidate document fragment is a reference document for the answer. A task processing model is a model that predicts whether a candidate document fragment is a reference document for the answer based on classification hints. Task processing models can be large models or trained machine learning or deep learning models. They are capable of analyzing input data and outputting corresponding classification results, such as language models based on the Transformer architecture (BERT, T5, etc.).

[0093] The first classification result refers to the task processing model's prediction (probability) that a candidate document fragment belongs to the "answer reference document". If a candidate document fragment is marked with a high probability of belonging to the first classification result, it means that the candidate document fragment is very likely to contain the answer to the document query information and can be used as a target query document. In contrast to the first classification result, the second classification result refers to the probability of the task processing model predicting that a candidate document fragment belongs to the "non-answer reference document". If a candidate document fragment is marked with a low probability of belonging to the second classification result, it means that the candidate document fragment is unlikely to contain the answer to the document query information and cannot be used as a target query document. By combining the first and second classification results, it can be determined whether the corresponding candidate document fragment can be used as a target document fragment. An answer reference document is a document fragment that contains a valid response to the document query information. This type of document can accurately and fully answer the document query information or satisfy its information needs. In contrast to answer reference documents, non-answer reference documents are document fragments that do not contain direct answers to the document query information. Non-answer reference documents may be related to the document query information but not specific enough, or they may be completely unrelated document fragments.

[0094] In practical applications, there are various ways to construct classification prompts for candidate document fragments based on document query information and candidate document fragments. The specific method chosen depends on the actual situation, and this specification does not impose any limitations on this approach. One possible implementation of this specification involves adding the document query information and candidate document fragments to a classification prompt template to obtain classification prompt information. Another possible implementation involves inputting the document query information and candidate document fragments into a prompt generation model to obtain the classification prompt information output by the model. The prompt generation model can be trained based on sample prompt information, sample query information, and sample candidate document fragments.

[0095] Furthermore, there are various ways to generate classification results for multiple candidate document fragments using a task processing model, and the specific method chosen depends on the actual situation. This specification does not impose any limitations on these methods in the embodiments. In one possible implementation, the classification hints for each candidate document fragment can be sequentially input into the task processing model to obtain the classification results for each fragment. In another possible implementation, when the number of candidate document fragments is large, sequentially classifying them using the task processing model would be time-consuming. Therefore, in this embodiment, parallel decoding technology can be used to input the classification hints for multiple candidate document fragments into the task processing model in parallel to obtain classification results for multiple fragments. The processing procedure for each candidate document fragment is the same in the task processing model, involving a binary classification task. Generating classification results for multiple candidate document fragments using parallel decoding improves the efficiency of determining the classification results for all candidate document fragments.

[0096] In one possible implementation of this specification, the above-mentioned construction of classification prompt information for candidate document fragments based on document query information and candidate document fragments may include the following steps:

[0097] Obtain a classification prompt template, which includes task description information. The task description information is used to guide the task processing model to classify candidate document fragments based on classification rules.

[0098] Add document search information and candidate document fragments to the category suggestion template to obtain category suggestion information.

[0099] It should be noted that a classification suggestion template is a pre-built structure or format used to guide how to combine document query information and candidate document fragments to form input useful to the task processing model. A classification suggestion template typically includes template text content and variable placeholders. The template text content includes task description information and at least one reference classification sequence. The variable placeholders can be replaced by document query information and candidate document fragments when generating classification suggestions.

[0100] Since the goal of invoking the task processing model is to recall the target document fragment from multiple candidate document fragments, the task description information can be understood as the description information of the retrieval and recall task. In the embodiments of this specification, to avoid constructing a complex mapping table, the prompt information for the retrieval and recall task needs to include a description requiring the model to provide a binary closed-form response so that the task processing model can output the classification results of the candidate document fragments. Therefore, the task description information can be refined into the description information of the closed-form binary classification task in the retrieval and recall process. The task description information is used to describe the task that the task processing model is about to perform, that is, to classify the candidate document fragments according to the classification rules.

[0101] Classification rules are used to constrain the processing of task processing models. Classification rules can include emphasis information for binary classification tasks. For example, a classification rule could be "output a binary judgment result," where the task description is "Please determine whether the candidate text fragment contains information helpful for responding to the document query." In this example, the task description only includes the specific task content. Furthermore, to avoid the task processing model generating overly long answers (in which case, the model's diverse responses need to be mapped to whether or not to recall the result), the instruction compliance capability of the task processing model can be utilized. Constraints requiring the task processing model to prioritize generating predicted answers can be configured in the classification rules. For example, requiring the task processing model to output its perceived answer for the first token prediction, a classification rule could be "output the judgment result first, then give the reason," where the task description is "Please determine whether the candidate text fragment contains information helpful for responding to the document query; if yes, reply Yes first; if no, reply No first, and give the reason." In this example, the task description includes both the specific task content and the model's prediction requirement.

[0102] In practical applications, the implementation method for "obtaining the category suggestion template" can refer to the implementation method for "obtaining document query information and multiple candidate document fragments corresponding to the document query information" described above, and will not be repeated in the embodiments of this specification. When adding the document query information and candidate document fragments to the category suggestion template, the document query information and candidate document fragments can be used to replace the variable placeholders in the category suggestion template to obtain the category suggestion information, or the document query information and candidate document fragments can be inserted after the corresponding variable placeholders to obtain the category suggestion information.

[0103] By applying the solution of the embodiments of this specification, classifying prompt information can be generated efficiently by adding document query information and candidate document fragments to the classification prompt template. Furthermore, since the classification prompt template includes task description information for guiding the task processing model to classify candidate document fragments based on classification rules, it can be guaranteed that the generated classification prompt information can guide the task processing model to perform a binary classification task and generate classification results for candidate document fragments.

[0104] In one optional embodiment of this specification, to better leverage the understanding and reasoning capabilities of the task processing model, a reference classification sequence can be configured in the classification prompt template to enable the task processing model to fully understand the document query information and the classification task. That is, the classification prompt template also includes at least one reference classification sequence, which includes a reference document fragment, reference query information, and reference classification labels. The reference classification labels include a reference classification result and a reference classification reason, with the reference classification result preceding the reference classification reason.

[0105] It's important to note that a reference classification sequence can be understood as a reference example. A reference classification sequence refers to a set of manually labeled or verified reference document fragments, reference query information, and corresponding reference classification labels. This data guides the task processing model to learn the correct classification pattern and accurately classify new candidate document fragments. Reference document fragments are document fragments that have been confirmed by experts or through other reliable means to have clear answer or non-answer attributes. These fragments serve as examples for the task processing model, helping it understand which document fragments should be classified as answer reference documents or non-answer reference documents. Reference query information refers to known query information. Used in conjunction with reference document fragments, this information allows the task processing model to learn how to correctly classify document fragments based on specific document query information.

[0106] Reference classification labels are used to guide task processing models in making correct classification decisions. Reference classification results indicate whether a reference document fragment is considered an answer reference document (e.g., "yes" or "no"). Reference classification reasons explain why a particular reference document fragment is classified as an answer reference document or a non-answer reference document, helping the task processing model understand and learn the logic behind the classification, thus improving its generalization ability. To avoid the task processing model generating excessively long responses and waiting a long time to determine the classification result, the reference classification result can be placed before the reference classification reasons. This allows the task processing model to learn the positional relationship between the reference classification result and the reference classification reasons, prioritizing the generation of predicted answers for new candidate document fragments, such as predicting the classification result for the first token.

[0107] For example, Reference Category Sequence 1 can be as follows: Reference Document Fragment 1: "The bright moonlight shines before my bed, I wonder if it is frost on the ground. I raise my head to gaze at the bright moon, I lower my head and think of my hometown." Reference Query Information 1: Poems by Li Bai. Reference Category Tag 1: Yes. This poem, titled "Quiet Night Thoughts," is a five-character ancient poem written by the Tang Dynasty poet Li Bai. It concisely and profoundly expresses the poet's longing for his hometown. By depicting the scene of moonlight shining before his bed and the resulting deep yearning for his distant hometown, it showcases the poet's delicate emotions and outstanding artistic talent. Reference Category Sequence 2 can be as follows: Reference Document Fragment 2: "Suddenly, like a spring breeze overnight, thousands of pear trees bloom." Reference Query Information 2: Poems by Li Bai. Reference Category Tag 2: No. This poem, titled "Song of White Snow Sending Off Judge Wu Returning to the Capital," is an ancient poem written by the Tang Dynasty poet Cen Shen. It is a poem depicting the scenery of the frontier and a farewell, using a magnificent snow scene as a backdrop to express the poet's deep affection for his friend and his feelings of parting.

[0108] The classification prompts constructed based on the above reference classification sequence are as follows: Task Description Information {Please determine whether the text contains information helpful for answering the question? If yes, reply Yes first; if no, reply No first, and give the reason}. Reference Classification Sequence 1 {Reference Document Fragment 1: "The bright moonlight shines before my bed, I wonder if it is frost on the ground. I raise my head to gaze at the bright moon, I lower my head to think of my hometown." Reference Query Information 1: Poems by Li Bai. Reference Classification Tag 1: Yes. This poem is titled "Quiet Night Thoughts," a five-character ancient poem written by the Tang Dynasty poet Li Bai. It concisely and profoundly expresses the poet's longing for his hometown. By depicting the scene of moonlight shining before his bed and the deep longing for his distant hometown that it evokes, it showcases the poet's delicate emotions and outstanding artistic talent}. Reference Classification Sequence 2 {Reference Document Fragment 2: "Suddenly, like a spring breeze overnight, thousands of pear trees bloom." Reference Query Information 2: Poems by Li Bai. Reference Classification Tag 2: No. This poem is titled "Song of White Snow Sending Off Judge Wu Returning to the Capital," an ancient poem written by the Tang Dynasty poet Cen Shen. It is a poem depicting the scenery of the frontier and a farewell, set against a backdrop of magnificent snowscape, expressing the poet's deep affection for his friend and the sorrow of parting. Text {candidate document fragment}. Question {document query information}. Response {model output}.

[0109] The scheme implemented in this specification adds at least one reference classification sequence to the classification prompt template. The reference classification result informs the task processing model whether the reference document fragment is an answer reference document. Then, the reference classification reason guides the model to learn why it is classified in this way, thereby helping the task processing model to generate classification results for candidate document fragments more accurately. Furthermore, the reference classification result is placed before the reference classification reason, ensuring that the task processing model prioritizes generating predicted answers for new candidate document fragments based on the style of the reference classification sequence, avoiding waiting for the model to fully generate the response content before determining the classification result, thus improving the efficiency of obtaining classification results.

[0110] It's worth noting that mainstream models all use next-to-token prediction, which involves continuously predicting the next token based on the input prompt and the generated tokens. Specifically, each model has a vocabulary containing all the tokens it can recognize and output. When the model receives input, it calculates the probability of each token being the output for the current round using this vocabulary. Then, various sampling strategies (such as greedy search) are used to select suitable tokens. The probability of all tokens in the vocabulary is calculated again based on the received input and the predicted tokens, and tokens are further selected. This process is repeated until a special "end marker" is generated or the upper limit of the output window is reached. For example, when the model receives "this person" as the prompt input, the probability distribution of tokens in the vocabulary during the first generation might be "very" (0.2), "is" (0.2), "still" (0.1), etc. If the first generation selects "very" as the result, the second generation calculates the probability of "not," "good," "bad," etc., which are available in the vocabulary. If the second generation selects "not" as the result, the third generation calculates the probability of "good," "bad," "okay," etc., which are available in the vocabulary. Based on the above analysis, it can be seen that when a specific type of prompt is input, the model's predicted probability value for certain word elements can be regarded as a "score." For example, when the model receives the question "Was 'Quiet Night Thoughts' written by Li Bai?", the probability of the model replying "yes" can be used as the score for "'Quiet Night Thoughts' was written by Li Bai." Therefore, in the embodiments of this specification, the Next Token Prediction method can be used to classify candidate text fragments using a task processing model, directly determining which candidate document fragments are answer reference documents related to the document query information, avoiding the establishment of a mapping relationship between the model's response and the expected query result.

[0111] In practical applications, there are multiple ways to input classification prompts into the task processing model using the Next token prediction method to obtain classification results for candidate document fragments. The specific method chosen depends on the actual situation, and this specification does not impose any limitations on this approach. In one possible implementation, if the task processing model is a pre-trained classification model, it already has a built-in classification lexicon. In this case, the classification prompts can be directly input into the task processing model to obtain the classification results for the candidate document fragments. In another possible implementation, if the task processing model's built-in lexicon differs from the classification lexicon, or if it does not carry a lexicon, the classification lexicon can be provided to the task processing model. The task processing model then processes the classification prompts based on the classification lexicon to obtain the classification results for the candidate document fragments.

[0112] In one optional embodiment of this specification, the above-mentioned input of classification prompt information into the task processing model to obtain the classification result of candidate document fragments may include the following steps:

[0113] The classification prompts and classification lexicon table are input into the task processing model to obtain the first classification result and the second classification result of the candidate document fragment. The classification lexicon table includes at least one first classification lexicon and at least one second classification lexicon. The first classification lexicon represents the candidate document fragment as an answer reference document, and the second classification lexicon represents the candidate document fragment as a non-answer reference document. The first classification result is obtained based on at least one first classification lexicon, and the second classification result is obtained based on at least one second classification lexicon.

[0114] It should be noted that the categorization lexicon is a predefined vocabulary, including at least one primary categorization lexicon and at least one secondary categorization lexicon. The categorization lexicon defines the vocabulary range that the task processing model can understand and generate, guiding how the model identifies and classifies candidate document fragments. Primary categorization lexicons are special markers that indicate a candidate document fragment is an answer reference document, such as Yes, YES, yes, YEs, YeS, yES. Primary categorization lexicons can also be understood as affirmative lexicons. Secondary categorization lexicons are special markers that indicate a candidate document fragment is not an answer reference document, such as No, NO, nO. Secondary categorization lexicons can also be understood as negative lexicons. Of course, primary and secondary categorization lexicons can also be special markers from other languages ​​that can indicate whether a candidate document fragment is an answer reference document or a non-answer reference document, such as "yes" and "no". The primary classification result refers to the prediction result obtained by the task processing model based on at least one primary categorization lexicon, indicating the probability or likelihood that a candidate document fragment is considered an answer reference document. The primary classification result can be understood as the affirmative response of the task processing model. The first classification result reflects the task processing model's confidence that the candidate document fragment can answer the document query. The second classification result refers to the prediction result obtained by the task processing model based on at least one second-classification term, indicating the probability or likelihood that a candidate document fragment is considered a non-answer reference document. The second classification result can be understood as the task processing model's negative response. The second classification result reflects the task processing model's confidence that the candidate document fragment cannot answer the document query.

[0115] In practical applications, when there are multiple first-category and / or second-category words, the prediction results obtained by the task processing model based on all first-category words can be integrated to obtain the first-category result, and the prediction results obtained by the task processing model based on all second-category words can be integrated to obtain the second-category result. For example, a "positive response set" can be constructed to collect the prediction results obtained by the task processing model based on multiple first-category words, and a "negative response set" can be constructed to collect the prediction results obtained by the task processing model based on multiple second-category words. Finally, the sum of the probabilities of each positive word in the "positive response set" is determined as the first-category result, and the sum of the probabilities of each negative word in the "negative response set" is determined as the second-category result.

[0116] For example, taking the task description as "Please determine whether the candidate text fragment contains information helpful for responding to the document query information. If yes, reply 'Yes' first; if no, reply 'No' first, and give the reason," the set of affirmative responses is {Yes, YES, yes, YEs, YeS, yES}, and the set of negative responses is {No, NO, nO}. The sum of probabilities of each affirmative token in the "affirmative response set" output by the task processing model is collected. For example, the sum of probabilities of each token in {Yes, YES, yes, YEs, YeS, yES} in the example is used as the score by which the task processing model believes the current candidate document fragment should be recalled, i.e., the first classification result. The sum of probabilities of each negative token in the "negative response set" is collected. For example, the sum of probabilities of {No, NO, nO} in the example is used as the score by which the task processing model believes the current candidate document fragment should not be recalled, i.e., the second classification result. After obtaining the first and second classification results, the task processing model's response generation can be stopped. The model can then directly determine whether to recall the current candidate document fragment based on the "positive response" and "negative response" scores, thus saving time waiting for the task processing model to provide a complete response and improving efficiency. It's worth noting that when the classification terminology is English, the task processing model can obtain the classification result based on the prediction of the first token.

[0117] Taking the task description as "Please determine whether the candidate text fragments contain information helpful for responding to the document query information. If yes, reply 'Yes' first; if no, reply 'No' first, and give the reason," we can construct a set of affirmative responses {Yes} and a set of negative responses {No}. It is worth noting that when the classification terminology is Chinese, because the task processing model's vocabulary uses "word segmentation," the terminology decomposed from Chinese words is not as easily enumerated as the English "Yes or No." Therefore, in this embodiment, the English "Yes / No" is preferred as the classification terminology. In this case, the task processing model may need to predict multiple tokens to obtain the classification result, but guided by the classification prompts, the model will still prioritize generating the classification result, thus improving the efficiency of query task processing.

[0118] By applying the scheme of the embodiments of this specification, based on the characteristics of the model generation method, the generation probability of the model on at least one first category word and at least one second category word in the classification word table is regarded as the first classification result and the second classification result. This realizes the use of the task processing model as a retrieval machine to recall target document fragments, and realizes the scoring of the relevance between candidate document fragments and document query information, thereby avoiding the establishment of a mapping relationship between the model response and the expected query result, and improving the efficiency of query task processing.

[0119] In one optional embodiment of this specification, after inputting classification hint information into the task processing model and obtaining the classification results of candidate document fragments, key-value caching technology can be used to cache the classification hint template (including task description information and at least one reference classification sequence) and even the candidate document fragments in the classification hint information. During the second execution of target document fragment retrieval, the key-value information can be directly reused, improving the efficiency of the task processing model in generating classification results. That is, the classification hint information includes a classification hint template; after inputting the classification hint information into the task processing model and obtaining the classification results of candidate document fragments, the following steps may also be included:

[0120] Parse the processing data of the task processing model to obtain the first key-value information of the classification prompt template, and store the first key-value information in the cache; and / or,

[0121] Parse the processing data to obtain the first key-value information of the classification prompt template and the second key-value information of the candidate document fragments, and store the first key-value information and the second key-value information in the cache.

[0122] It should be noted that processing data refers to intermediate states or outputs generated based on input data during the operation of the task processing model, such as keys, values, and queries calculated in the self-attention mechanism. The first key-value information refers to the key and value information of the classification suggestion template extracted from the task processing model's processing. The second key-value information refers to the key and value information of the candidate document fragments extracted from the task processing model's processing. A cache is a temporary storage area used to save recently used or frequently accessed data for quick retrieval. In the embodiments of this specification, the cache is used to store key-value information so that when the same or similar inputs to the task processing model reappear, the results can be directly retrieved from the cache without the task processing model recalculating.

[0123] In practical applications, when storing the first key-value information in the cache, it can be cached in a first cache area. This allows the text portion of the first key-value information to be reused for any "candidate document fragment" or "document query information." When storing the first and second key-value information in the cache, they can be stored in a second cache area. The second cache area has a smaller scope than the first cache area. When the "candidate document fragments" are the same, the text portions of both the first and second key-value information can be reused for any "document query information."

[0124] The solution implemented in this specification stores the first key-value information and the second key-value information using key-value caching technology. In the subsequent processing of the task processing model, the key-value information can be reused, which greatly improves the speed of obtaining classification results.

[0125] Step 106: Using the classification results of multiple candidate document fragments, select the target document fragment from the multiple candidate document fragments.

[0126] It should be noted that the process of selecting the target document fragment from multiple candidate document fragments based on their classification results can be considered an information retrieval process. The target document fragment refers to the fragment selected from multiple candidate fragments that is most likely to directly answer the document query. Target document fragments typically have a very high relevance to the document query and can provide users with the specific information or answer they need.

[0127] In practical applications, there are various ways to select the target document fragment from multiple candidate document fragments based on the classification results of multiple candidate document fragments. The specific method should be selected according to the actual situation. This specification does not limit the specific methods used in this embodiment.

[0128] In one possible implementation of this specification, the process of selecting the target document fragment from multiple candidate document fragments using the classification results of multiple candidate document fragments may include the following steps:

[0129] Among multiple candidate document fragments, the candidate document fragment whose first classification result is greater than the second classification result is identified as the target document fragment.

[0130] It should be noted that after obtaining the first and second classification results for each candidate document fragment, since the first classification result represents the probability that the candidate document fragment is an answer reference document, and the second classification result represents the probability that the candidate document fragment is not an answer reference document, for any candidate document fragment, the first and second classification results can be compared to check their probabilities. If the first classification result is greater than the second classification result, it means that the task processing model considers the candidate document fragment to be more likely an answer reference document, containing content that can reply to the document query information. Therefore, the candidate document fragment can be identified as the target document fragment. If the first classification result is less than the second classification result, it means that the task processing model considers the candidate document fragment to be more likely a non-answer reference document, not containing content that can reply to the document query information. Therefore, the candidate document fragment is not identified as the target document fragment.

[0131] For example, suppose there are two candidate document fragments, candidate document fragment 1 and candidate document fragment 2. Candidate document fragment 1 has a first classification result of 0.6 and a second classification result of 0.4. Candidate document fragment 2 has a first classification result of 0.2 and a second classification result of 0.8. Since the first classification result of candidate document fragment 1 is greater than the second classification result, candidate document fragment 1 is determined to be the target document fragment. Since the first classification result of candidate document fragment 2 is less than the second classification result, candidate document fragment 2 is not determined to be the target document fragment.

[0132] The scheme implemented in this specification determines whether to recall candidate document fragments as target document fragments based on the first and second classification results of each of the multiple candidate document fragments, making the target document fragments more comprehensive and accurate.

[0133] In another possible implementation of this specification, the above-mentioned method of selecting the target document fragment from multiple candidate document fragments based on the classification results of multiple candidate document fragments may include the following steps:

[0134] Based on the classification results of multiple candidate document fragments, the multiple candidate document fragments are sorted, and the target document fragment is selected from the multiple candidate document fragments according to the sorting results.

[0135] It should be noted that sorting refers to the process of arranging multiple candidate document fragments sequentially according to the first or second classification result of each fragment. In practical applications, multiple candidate document fragments are usually sorted in descending order of the first classification result. Of course, multiple candidate document fragments can also be sorted in ascending order of the first classification result, ascending order of the second classification result, and so on. The specific method of sorting multiple candidate document fragments is selected according to the actual situation, and this specification does not limit it in any way.

[0136] Furthermore, when selecting the target document fragment from multiple candidate document fragments based on the ranking results, the K candidate document fragments with the largest first classification results can be selected as the target document fragments. Here, K is a positive integer. If the multiple candidate document fragments are sorted in descending order of the first classification results, the K candidate document fragments with the highest ranking can be selected as the target document fragments. If the multiple candidate document fragments are sorted in ascending order of the first classification results, the K candidate document fragments with the lowest ranking can be selected as the target document fragments.

[0137] For example, suppose there are two candidate document fragments, A and B. Candidate document fragment A has a first classification result (A) of 0.7 and a second classification result (A') of 0.3. Candidate document fragment B has a first classification result (B') of 0.8 and a second classification result (B'') of 0.2. Sort candidate document fragments A and B in descending order of their first classification results. It can be determined that candidate document fragment B ranks before candidate document fragment A. Assuming K=1, candidate document fragment B is then identified as the target document fragment.

[0138] The scheme of the embodiments of this specification is applied to sort multiple candidate document fragments based on their respective first and second classification results, and to filter out target document fragments according to the sorting results. The number of target document fragments can be specified to achieve accurate recall of target document fragments.

[0139] Step 108: Generate the document query answer based on the target document fragment.

[0140] It's important to note that a document query answer refers to the text content generated based on a fragment of the target document that directly answers the document query information. For example, if the document query information is "How to make a latte," the document query answer would be: "Use an espresso machine to make approximately 30 ml of espresso. Pour 350 ml of whole milk into a stainless steel milk jug, heat and froth the milk with a steam wand until it reaches a temperature of 65-70 degrees Celsius and forms fine foam. Slowly pour the frothed milk into the espresso. Lightly latte art on the surface for added visual appeal, and you will have a latte."

[0141] In practical applications, there are various ways to generate document query answers based on target document fragments. The specific method chosen depends on the actual situation, and this specification does not impose any limitations on the embodiments. One possible implementation of this specification involves using a task processing model to generate document query answers based on target document fragments. Another possible implementation involves calling a search engine to generate document query answers based on target document fragments.

[0142] By applying the scheme of the embodiments in this specification, a binary closed candidate document fragment classification task is constructed, which enables the task processing model to directly determine which candidate document fragments are answer reference documents related to the document query information. This avoids establishing a mapping relationship between the model response and the expected query result, thereby improving the efficiency of query task processing. Furthermore, it fully leverages the semantic understanding, reasoning, and instruction-following capabilities of the task processing model, thereby improving the accuracy of query task processing.

[0143] In one optional embodiment of this specification, the document query answer that generates document query information based on the target document fragment may include the following steps:

[0144] Input the query prompts, target document fragments, and document query information into the task processing model to obtain the document query answer.

[0145] It should be noted that the target document fragment can serve as reference information during the task processing model's response process. Query prompts are used to guide the task processing model to find answers to document query information from the target document fragment. Query prompts may include messages such as "The information that can be referenced during the processing is [target document fragment]. Please refer to the above information and answer the following questions [document query information]." The specific query prompts should be selected based on the actual situation, and this specification does not impose any limitations on this.

[0146] The solution implemented in the embodiments of this specification utilizes a task processing model to generate document query answers based on target document fragments. By leveraging the semantic understanding, reasoning, and instruction following capabilities of the task processing model, the accuracy and generation efficiency of document query answers are improved.

[0147] Large-scale models, with their powerful generative capabilities, have demonstrated immense potential in numerous application scenarios. From open-domain question-answering systems to intelligent dialogue assistants, from content creation aids to educational tutoring platforms, the application scope of large-scale models is increasingly broad. Large-scale models can not only understand complex semantic relationships but also generate fluent and natural language, greatly improving the quality of human-computer interaction. However, despite their powerful capabilities, large-scale models can only generate data information encountered during their training. Once training is complete, all responses from large-scale models rely on the information and capabilities gained during training and cannot provide high-quality responses to information not encountered during training. For example, when asked to answer time-sensitive questions such as "What is the latest news in City A?" or "What is the fiber softening temperature of polyacrylonitrile fiber?" or very niche questions (difficult to cover in training data) requiring specific factual support, large-scale models are unlikely to provide satisfactory responses.

[0148] Therefore, in the embodiments of this specification, the RAG technology is combined with the response generation of large models, which further enhances the ability of large models to provide accurate and real-time information. See also Figure 2 , Figure 2 This specification shows a flowchart of the processing procedure of a query task processing system according to an embodiment of the present specification. The query task processing system includes an information retrieval unit 202 and an information query unit 204.

[0149] Information retrieval unit 202 is used to obtain document query information; and to recall target document fragments that are highly relevant to the document query information from multiple data sources. The target document fragments are used as reference information in the response process of the task processing model. The multiple data sources include at least one of databases, document knowledge bases, and the Internet.

[0150] The information query unit 204 is used to splice the target document fragment and document query information to obtain the data to be queried; and input the data to be queried and the query prompt information into the task processing model to obtain the document query answer of the document query information.

[0151] exist Figure 2 In the query task processing system shown, the recall quality of the information retrieval unit is crucial for the task processing model to solve factual or time-sensitive problems. (See also...) Figure 3 , Figure 3 A flowchart illustrating the processing procedure of an information retrieval unit according to an embodiment of this specification is shown. The information retrieval unit includes a segmentation unit 302 and a retrieval unit 304.

[0152] The segmentation unit 302 is used to segment the target document corresponding to the document query information from multiple data sources into fragments to obtain multiple candidate document fragments.

[0153] The retrieval unit 304 is used to construct classification prompts for candidate document fragments based on document query information and candidate document fragments, and input the classification prompts into the task processing model to obtain classification results for the candidate document fragments. The classification results include a first classification result and a second classification result. The first classification result represents the prediction result that the candidate document fragment is an answer reference document, and the second classification result represents the prediction result that the candidate document fragment is a non-answer reference document. The target document fragment is selected from multiple candidate document fragments using the classification results of multiple candidate document fragments.

[0154] In one optional embodiment of this specification, the information retrieval unit may include multiple retrieval units, thereby enhancing the recall effect. See also Figure 4 , Figure 4 A flowchart illustrating the processing procedure of another information retrieval unit provided in one embodiment of this specification is shown. The information retrieval unit includes a segmentation unit 402 and multiple retrieval units 404.

[0155] The segmentation unit 402 is used to segment the target document corresponding to the document query information from multiple data sources into fragments to obtain multiple candidate document fragments.

[0156] The retrieval unit 404 is used to construct classification prompts for each candidate document fragment based on document query information and each candidate document fragment; input the classification prompts for multiple candidate document fragments into the task processing model in parallel to obtain classification results for multiple candidate document fragments; and use the classification results for multiple candidate document fragments to select the target document fragment from the multiple candidate document fragments.

[0157] See Figure 5 , Figure 5 This document illustrates a flowchart of a query task processing method according to an embodiment of this specification. The processing of the query task processing method can be divided into an information acquisition stage, an information retrieval stage, and an information query stage. The following describes each of these three stages in detail. In the information acquisition stage, document query information and multiple candidate document fragments corresponding to the document query information are acquired. In the information retrieval stage, for a single candidate document fragment, classification hints are constructed based on the document query information and the candidate document fragment. These classification hints are then input into the task processing model to obtain the classification result for the candidate document fragment. This process is repeated N times to obtain the classification results for multiple candidate document fragments, where N is the number of candidate document fragments. Using the classification results of multiple candidate document fragments, the target document fragment is selected from the multiple candidate document fragments. In the information query stage, based on the target document fragment, a document query answer for the document query information is generated.

[0158] It's worth noting that the classification hints include task description information to guide the task processing model in classifying candidate document fragments based on classification rules. These rules require the model to respond with the first token (i.e., respond with the classification result first). After receiving the hints, the model follows the instructions and responds with a retrieval result at the first token. After obtaining the vocabulary probability distribution of the model's first response, the server immediately stops generating the response and obtains the first and second classification results for the candidate document fragment. Then, the server directly determines whether to recall the current candidate document fragment based on the first and second classification results, thus saving time waiting for the model to respond completely and improving efficiency.

[0159] For example, the pseudocode for the target document fragment retrieval process is as follows:

[0160] Input: A set of candidate document fragments D = {s1, s2, ..., s...} n}, where s i Represents the i-th candidate document fragment; document query information Q, classification suggestion template P, task processing model M, and first category word set T = {t1, t2, ..., t} mThe second category of word set F = {f1, f2, ..., f} k}

[0161] Output: A list R of target document fragments, used to store target document fragments that can be recalled.

[0162] Initialization phase: Set R = empty set.

[0163] Target document fragment recall phase: For each candidate document fragment s i ∈D, perform the following operations: Construct a complete classification prompt: prompt = P + s i +Q. Generate responses to prompts using M and obtain the probability distribution of the first-round vocabulary: probDist = M(prompt). Initialize scores: set positiveScore = 0. Set negativeScore = 0. Calculate the positive response score: for t j ∈T: If t j In probDi st, then pos it iveScore+=probDi st[t j ]. Calculate the negative response score: for f l ∈F: If f l In probDi st, then negativeScore += probDi st[f l Determine whether to recall: If possibleScore > negatibleScore, then release the response. i Add to R.

[0164] Return value: Returns R, a list of all target document fragments that can be recalled. End.

[0165] The scheme implemented in this specification predicts the relevance between candidate document fragments and document query information by constructing a closed binary classification task, and allows the task processing model to answer the retrieval result on the first token. This avoids model training, mapping construction, and model decoupling, fully leveraging the understanding and reasoning capabilities of the task processing model, improving the recall effect of target document fragments, and avoiding the waiting time required for the task processing model to make a complete prediction, thus greatly improving recall efficiency.

[0166] Considering the large number of model parameters in the task processing model and the limited computing resources of the terminal device, the query task processing method proposed in the embodiments of this specification can be applied to, for example... Figure 6 The query task processing system shown is not limited to this. See also Figure 6 , Figure 6This specification illustrates an architecture diagram of a query task processing system according to an embodiment of the present specification. The query task processing system may include a terminal device 602 and a server 604.

[0167] Terminal device 602 is used to send document query information and multiple candidate document fragments corresponding to the document query information to server 604;

[0168] The server-side 604 function is used to construct classification hints for candidate document fragments based on document query information and candidate document fragments. These hints are then input into the task processing model to obtain classification results for the candidate document fragments. The classification results include a first classification result and a second classification result. The first classification result indicates that the candidate document fragment is a predicted answer reference document, and the second classification result indicates that the candidate document fragment is a predicted non-answer reference document. Using the classification results of multiple candidate document fragments, the target document fragment is selected from them. Based on the target document fragment, the document query answer for the document query information is generated.

[0169] Terminal device 602 is also used to receive document query answers sent by server 604.

[0170] like Figure 6 As shown, the task processing model is deployed in server 604. Server 604 can connect to one or more terminal devices 602 via a local area network (LAN), wide area network (WAN), internet connection, or other types of data network. Terminal devices 602 may include, but are not limited to, smartphones, tablets, laptops, PDAs, personal computers, smart home devices, and in-vehicle devices. Terminal devices 602 can also interact with users through a graphical user interface to invoke the task processing model, thereby implementing the query task processing method provided in the embodiments of this specification.

[0171] It is worth noting that the query task processing method provided in the embodiments of this specification is generally executed by the server. However, in other embodiments of this specification, if the terminal device's operating resources can meet the deployment and operating conditions of the task processing model, the terminal device can also have similar functions to the server, thereby executing the query task processing method provided in the embodiments of this specification. In other embodiments, the query task processing method provided in the embodiments of this specification can also be jointly executed by the terminal device and the server.

[0172] The scheme implemented in this specification utilizes the semantic understanding, reasoning, domain knowledge, and instruction-following capabilities of the task processing model to determine whether candidate document fragments can be used to respond to a user's document query. As the capabilities of the task processing model improve, the retrieval and recall performance also improves. The classification prompts from the task processing model require the model's inference range to end with the binary prediction result of the first token, enabling the model to predict whether to recall candidate document fragments at the first token, eliminating the lengthy waiting time for the model to complete its full prediction. Furthermore, transforming the model's response task into a closed binary classification task eliminates the need to construct complex mapping rules to map the model's diverse natural responses to the required categories. Moreover, the task processing model can converge results at the level of the prediction distribution, fully leveraging the model's response capabilities.

[0173] Experimental results show that the query task processing method proposed in the embodiments of this specification improves the recall rate from 47.6% to 76.2%, and the keyword granularity recall rate from 58.5% to 84.2%. Furthermore, when the scheme proposed in the embodiments of this specification is integrated into a question-answering system as a single-searcher information retrieval system, both accuracy and efficiency are guaranteed.

[0174] The following is in conjunction with the appendix Figure 7 Taking the application of the query task processing method provided in this specification in a document question-and-answer scenario as an example, the query task processing method will be further explained. Figure 7 This specification illustrates a flowchart of a document question-and-answer method according to an embodiment, which specifically includes the following steps:

[0175] Step 702: Obtain document questions for the target document, where the target document includes multiple candidate document fragments.

[0176] Step 704: Based on the document question and candidate document fragments, construct classification hints for the candidate document fragments, and input the classification hints into the task processing model to obtain the classification results of the candidate document fragments. The classification results include a first classification result and a second classification result. The first classification result represents the prediction result that the candidate document fragment is an answer reference document, and the second classification result represents the prediction result that the candidate document fragment is a non-answer reference document.

[0177] Step 706: Using the classification results of multiple candidate document fragments, select the target document fragment from the multiple candidate document fragments.

[0178] Step 708: Generate document answers to the document questions based on the target document fragment.

[0179] It should be noted that the implementation methods of steps 702 to 708 can refer to the implementation methods of steps 102 to 108 above, and will not be repeated in the embodiments of this specification.

[0180] By applying the scheme of the embodiments in this specification, a binary closed candidate document fragment classification task is constructed, which enables the task processing model to directly determine which candidate document fragments are answer reference documents related to the document question. This avoids establishing a mapping relationship between the model response and the expected query result, improves the efficiency of document question answering, and fully leverages the semantic understanding, reasoning, and instruction following capabilities of the task processing model, thereby improving the accuracy of document question answering.

[0181] See Figure 8 , Figure 8 This specification illustrates a flowchart of an information processing method based on a task processing model, according to an embodiment of the present invention. The information processing method based on the task processing model is applied to a task platform and specifically includes the following steps:

[0182] Step 802: Receive the model request sent by the terminal device.

[0183] Step 804: Based on the model request, determine the target task processing model from multiple task processing models, wherein the target task processing model is used to execute the query task processing method.

[0184] It should be noted that the target task processing model is a task processing model applicable to the target scenario. The model request includes at least one of the following: the scenario identifier of the target scenario, the scenario input data of the target scenario, and model specification parameters. There are multiple ways to determine the target task processing model from multiple task processing models based on the model request; the specific method chosen depends on the actual situation, and this specification does not impose any limitations on this method. In one possible implementation of this specification, the corresponding target task processing model can be searched from at least one task processing model included in the model library based on the model request. In another possible implementation, the target task processing model can be trained and obtained based on the model request. In yet another optional implementation, the target task processing model can be constructed based on the model request.

[0185] For example, one can first search for at least one pre-trained task processing model from the model library based on the scene identifier of the target scene, then select an initial task processing model from the at least one task processing model based on the model specification parameters, and then train the selected initial task processing model based on the scene input data of the target scene to obtain a target task processing model suitable for user needs.

[0186] The solutions implemented in the embodiments of this specification are adapted to user needs to obtain target task processing models, realize personalized model services, provide users with an efficient, flexible and easy-to-use model service method, and improve user experience.

[0187] In one optional embodiment of this specification, the model request includes a scene identifier of the target scene; the process of determining the target task processing model from multiple task processing models based on the model request may include the following steps:

[0188] Based on the scene identifier of the target scene, the target task processing model suitable for the target scene is searched from the model library. The model library stores multiple task processing models suitable for different query scenarios.

[0189] It should be noted that scene identifiers are unique or specific labels used to distinguish different query scenarios. The model library is a database for storing and managing various pre-trained deep learning models. Multiple task processing models adapted to different query scenarios cover different query scenarios and needs. The model library allows users to select the appropriate model according to their needs, or directly call the model for query task processing through the application programming interface.

[0190] Multiple task processing models adapted to different query scenarios are stored in the model library, each optimized for a specific application environment. For example, based on the scenario identifier "automatic question answering," a target task processing model suitable for the automatic question answering scenario can be found from the model library.

[0191] By applying the solutions in the embodiments of this specification, based on scenario requirements, the target task processing model suitable for the scenario is accurately found through scenario identification, making query task processing more accurate and more scenario-appropriate, thereby improving user experience and query task processing quality.

[0192] In one optional embodiment of this specification, the model request includes scene input data of the target scene; the determination of the target task processing model from multiple task processing models based on the model request may include the following steps:

[0193] From multiple task processing models, an initial task processing model suitable for the target scenario is determined;

[0194] Based on the scene input data of the target scene, the initial task processing model is trained to obtain the target task processing model.

[0195] It's important to note that different task processing models are suitable for different scenarios. For example, task processing model 1 is suitable for scenarios 1 and 2, while task processing model 2 is suitable for scenarios 2 and 3. The initial task processing model refers to the model among multiple task processing models that is applicable to the target scenario. If the target scenario is scenario 1, then the initial task processing model is task processing model 1, which is suitable for scenario 1. The initial task processing model may not only be applicable to the target scenario but also to other scenarios; it is a general task processing model applicable to different scenarios. The initial task processing model can be used for query task processing, but the results may not be ideal. In this case, the initial task processing model can be optimized based on the scenario input data of the target scenario. For example, optimizing the initial task processing model based on the scenario input data of an automatic question answering scenario can yield a target task processing model suitable for the automatic question answering scenario. The scenario input data of the target scenario can be understood as the model training data within the target scenario.

[0196] By applying the solutions in the embodiments of this specification, based on scenario requirements, a general initial task processing model is further trained using scenario input data to obtain a target task processing model adapted to the scenario. This makes the target task processing model more closely aligned with the scenario, thereby improving user experience and the processing quality of query tasks.

[0197] In one optional embodiment of this specification, the model request includes model specification parameters; the process of determining the target task processing model from multiple task processing models based on the model request may include the following steps:

[0198] Based on the model specification parameters, the corresponding target task processing model is searched from the model library, which stores multiple task processing models with different model specification parameters.

[0199] It's important to note that model specifications refer to the various parameters that define the model's structure and behavior. These parameters can be broadly categorized into two types: model parameters (learnable parameters) and hyperparameters. Model parameters are those automatically adjusted during model training via backpropagation, including but not limited to weight matrices and biases. For example, in a simple fully connected layer, the weight matrix is ​​a two-dimensional tensor connecting neurons in the input and output layers; the biases are one-dimensional vectors providing additional offset values ​​for each output neuron. Hyperparameters are parameters set before model training begins, controlling the model's learning process and architecture. Hyperparameters include, but are not limited to, the learning rate and the number of neurons per layer, chosen based on specific requirements.

[0200] By applying the solutions in the embodiments of this specification, based on the model specification parameters, the corresponding target task processing model can be accurately found, ensuring the efficient and stable operation of the target task processing model and improving the user experience.

[0201] In one optional embodiment of this specification, after determining the target task processing model from multiple task processing models based on the model request, the following steps may be further included:

[0202] Deploy the target task processing model, and based on the target task processing model, build a query task processing interface so that the terminal device can schedule the target task processing model to execute the target query task.

[0203] It should be noted that the query task processing interface is an interactive programming interface for the terminal device to schedule the target task processing model to process the target query task, and it is usually provided in the form of an application programming interface (API). Through the query task processing interface, users can input task data for the target query task, such as the question to be answered, to initiate the query task processing.

[0204] In practical applications, there are various ways to deploy the target task processing model, and the specific method should be chosen based on the actual situation. This specification does not impose any limitations on this approach. One possible implementation of this specification is to deploy the target task processing model on cloud-side devices using infrastructure provided by a cloud service provider. Another possible implementation of this specification is to deploy the target task processing model on edge devices using a lightweight framework. For example, the target task processing model can be deployed on a distributed system, and a query task processing interface can be built based on the target task processing model and provided to terminal devices, enabling the terminal devices to schedule the target task processing model to execute target query tasks.

[0205] By applying the solutions provided in the embodiments of this specification, deploying the target task processing model, and building a query task processing interface based on the target task processing model, the terminal device can efficiently call the target task processing model, thereby improving the processing quality and response speed of the target query task.

[0206] See Figure 9 , Figure 9 This specification shows a schematic diagram of a task platform 900 provided in one embodiment of the present specification. The task platform 900 includes a request interface 902 and a response unit 904.

[0207] Request interface 902 is used to receive model requests sent by terminal devices, wherein the model request includes at least one of the following: scene identifier of the target scene, scene input data of the target scene, and model specification parameters.

[0208] Response unit 904 is used to determine the target task processing model from multiple task processing models based on the model request, wherein the target task processing model is used to execute the query task processing method.

[0209] In one optional embodiment of this specification, the task platform further includes a query task processing interface, which is constructed based on the target task processing model.

[0210] The query task processing interface is used to allow terminal devices to schedule and execute target query tasks.

[0211] By applying the solutions in the embodiments of this specification, the task platform adapts to user needs to obtain target task processing models, realizes personalized model services, provides users with an efficient, flexible and easy-to-use model service platform, and improves user experience.

[0212] Corresponding to the above-described embodiments of the query task processing method, this specification also provides embodiments of the query task processing apparatus. Figure 10 A schematic diagram of a query task processing apparatus according to one embodiment of this specification is shown. Figure 10 As shown, the device includes:

[0213] The first acquisition module 1002 is configured to acquire document query information and multiple candidate document fragments corresponding to the document query information;

[0214] The first input module 1004 is configured to construct classification hint information for candidate document fragments based on document query information and candidate document fragments, and input the classification hint information into the task processing model to obtain the classification result of the candidate document fragments. The classification result includes a first classification result and a second classification result. The first classification result represents the prediction result that the candidate document fragment is an answer reference document, and the second classification result represents the prediction result that the candidate document fragment is a non-answer reference document.

[0215] The first filtering module 1006 is configured to filter out the target document fragment from multiple candidate document fragments using the classification results of multiple candidate document fragments;

[0216] The first generation module 1008 is configured to generate document query answers based on the target document fragment.

[0217] Optionally, the first input module 1004 is further configured to input classification prompt information and a classification lexicon table into the task processing model to obtain a first classification result and a second classification result for the candidate document fragment. The classification lexicon table includes at least one first classification lexicon and at least one second classification lexicon. The first classification lexicon represents the candidate document fragment as an answer reference document, and the second classification lexicon represents the candidate document fragment as a non-answer reference document. The first classification result is obtained based on at least one first classification lexicon, and the second classification result is obtained based on at least one second classification lexicon.

[0218] Optionally, the first input module 1004 is further configured to obtain a classification prompt template, wherein the classification prompt template includes task description information, which is used to guide the task processing model to classify candidate document fragments based on classification rules; and to add document query information and candidate document fragments to the classification prompt template to obtain classification prompt information.

[0219] Optionally, the category suggestion template also includes at least one reference category sequence, which includes a reference document fragment, reference query information, and reference category labels. The reference category labels include a reference category result and a reference category reason, with the reference category result preceding the reference category reason.

[0220] Optionally, the first filtering module 1006 is further configured to identify the candidate document fragments among multiple candidate document fragments whose first classification result is greater than the second classification result as the target document fragments.

[0221] Optionally, the first filtering module 1006 is further configured to sort the multiple candidate document fragments according to the classification results of the multiple candidate document fragments, and filter out the target document fragment from the multiple candidate document fragments according to the sorting results.

[0222] Optionally, the first acquisition module 1002 is further configured to acquire document query information and the target document corresponding to the document query information; and to divide the target document into segments to obtain multiple candidate document segments.

[0223] Optionally, the first generation module 1008 is further configured to input the query prompt information, the target document fragment, and the document query information into the task processing model to obtain the document query answer of the document query information.

[0224] Optionally, the classification prompt information includes a classification prompt template; the device further includes: a parsing module configured to parse the processing data of the task processing model, obtain first key-value information of the classification prompt template, and store the first key-value information in a cache; and / or, parse the processing data, obtain the first key-value information of the classification prompt template and second key-value information of the candidate document fragments, and store the first key-value information and the second key-value information in a cache.

[0225] By applying the scheme of the embodiments in this specification, a binary closed candidate document fragment classification task is constructed, which enables the task processing model to directly determine which candidate document fragments are answer reference documents related to the document query information. This avoids establishing a mapping relationship between the model response and the expected query result, thereby improving the efficiency of query task processing. Furthermore, it fully leverages the semantic understanding, reasoning, and instruction-following capabilities of the task processing model, thereby improving the accuracy of query task processing.

[0226] The above is an illustrative scheme of a query task processing device according to this embodiment. It should be noted that the technical solution of this query task processing device and the technical solution of the query task processing method described above belong to the same concept. For details not described in detail in the technical solution of the query task processing device, please refer to the description of the technical solution of the query task processing method described above.

[0227] Corresponding to the above-described document question-and-answer method embodiments, this specification also provides embodiments of a document question-and-answer device. Figure 11 A schematic diagram of a document question-and-answer device according to one embodiment of this specification is shown. Figure 11 As shown, the device includes:

[0228] The second acquisition module 1102 is configured to acquire document questions for a target document, wherein the target document includes multiple candidate document fragments;

[0229] The second input module 1104 is configured to construct classification hints for candidate document fragments based on document questions and candidate document fragments, and input the classification hints into the task processing model to obtain classification results for candidate document fragments. The classification results include a first classification result and a second classification result. The first classification result represents the prediction result that the candidate document fragment is an answer reference document, and the second classification result represents the prediction result that the candidate document fragment is a non-answer reference document.

[0230] The second filtering module 1106 is configured to filter out the target document fragment from multiple candidate document fragments using the classification results of multiple candidate document fragments;

[0231] The second generation module 1108 is configured to generate document answers to document questions based on target document fragments.

[0232] By applying the scheme of the embodiments in this specification, a binary closed candidate document fragment classification task is constructed, which enables the task processing model to directly determine which candidate document fragments are answer reference documents related to the document question. This avoids establishing a mapping relationship between the model response and the expected query result, improves the efficiency of document question answering, and fully leverages the semantic understanding, reasoning, and instruction following capabilities of the task processing model, thereby improving the accuracy of document question answering.

[0233] The above is an illustrative scheme of a document question-and-answer device according to this embodiment. It should be noted that the technical solution of this document question-and-answer device and the technical solution of the document question-and-answer method described above belong to the same concept. For details not described in detail in the technical solution of the document question-and-answer device, please refer to the description of the technical solution of the document question-and-answer method described above.

[0234] Corresponding to the above-described embodiments of the information processing method based on the task processing model, this specification also provides embodiments of the information processing apparatus based on the task processing model. Figure 12 A schematic diagram of the structure of an information processing device based on a task processing model provided in one embodiment of this specification is shown. Figure 12 As shown, the device is applied to a mission platform and includes:

[0235] The receiving module 1202 is configured to receive model requests sent by the terminal device;

[0236] The determination module 1204 is configured to determine the target task processing model from multiple task processing models based on the model request, wherein the target task processing model is used to execute the query task processing method.

[0237] Optionally, the model request includes a scene identifier of the target scene; the determination module 1204 is further configured to search for a target task processing model suitable for the target scene from the model library based on the scene identifier of the target scene, wherein the model library stores multiple task processing models suitable for different query scenarios.

[0238] Optionally, the model request includes scene input data of the target scene; the determination module 1204 is further configured to determine an initial task processing model suitable for the target scene from multiple task processing models; and to train the initial task processing model based on the scene input data of the target scene to obtain the target task processing model.

[0239] Optionally, the model request includes model specification parameters; the determination module 1204 is further configured to search for the corresponding target task processing model from the model library based on the model specification parameters, wherein the model library stores multiple task processing models with different model specification parameters.

[0240] Optionally, the device further includes: a deployment module configured to deploy a target task processing model and, based on the target task processing model, construct a query task processing interface to enable the terminal device to schedule the target task processing model to execute a target query task.

[0241] The solutions implemented in the embodiments of this specification are adapted to user needs to obtain target task processing models, realize personalized model services, provide users with an efficient, flexible and easy-to-use model service method, and improve user experience.

[0242] The above is an illustrative scheme of an information processing device based on a task processing model according to this embodiment. It should be noted that the technical solution of this information processing device based on a task processing model and the technical solution of the information processing method based on a task processing model described above belong to the same concept. For details not described in detail in the technical solution of the information processing device based on a task processing model, please refer to the description of the technical solution of the information processing method based on a task processing model described above.

[0243] Figure 13 A structural block diagram of a computing device 1300 provided in one embodiment of this specification is shown.

[0244] The computing device 1300 includes:

[0245] Memory 1310 and processor 1320;

[0246] The memory 1310 is used to store computer programs / instructions, and the processor 1320 is used to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor 1320, they implement the steps of the above-mentioned query task processing method, document question-and-answer method, or information processing method based on task processing model.

[0247] 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, personal computer (PC), 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.

[0248] 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 application programming interface (API) invocation capabilities. Models can be invoked into created applications through the API interface, and application management tools are provided for application management and monitoring.

[0249] Furthermore, the computing device may 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 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 artificial intelligence development, training, deployment, and application.

[0250] Figure 14 A structural block diagram of an electronic device 1400 provided according to one embodiment of this specification is shown.

[0251] The memory 1410 and the processor 1420 are connected via a bus 1430;

[0252] The memory 1410 is used to store computer programs / instructions, and the processor 1420 is used to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor 1420, they implement the steps of the above-mentioned query task processing method, document question and answer method, or information processing method based on task processing model.

[0253] Specifically, the components of the electronic device 1400 include, but are not limited to, a memory 1410 and a processor 1420. The processor 1420 and the memory 1410 can be connected via a bus 1430.

[0254] Electronic device 1400 may also include access device 1440, which enables electronic device 1400 to communicate with database 1450 storing data via one or more networks 1460. Examples of such 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 1440 may include one or more of any type of wired or wireless network interface (e.g., a network interface card (NIC)), such as an IEEE 802.11 wireless local area network (WLAN) interface, a Wi-MAX (World Interoperability for Microwave Access) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and so on.

[0255] In one embodiment of this specification, the above-described components of the electronic device 1400 and Figure 14 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 14 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.

[0256] Electronic device 1400 can be any type of stationary or mobile electronic device, including mobile computers or mobile computing 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 PCs. Electronic device 1400 can also be a mobile or stationary electronic device.

[0257] 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 belongs to the same concept as the technical solutions of the query task processing method, document question answering method, and information processing method based on task processing model described above. For details not described in detail in the technical solution of the electronic device, please refer to the description of the technical solutions of the query task processing method, document question answering method, or information processing method based on task processing model described above.

[0258] An embodiment of this specification also provides a computer-readable storage medium storing a computer program / instructions that, when executed by a processor, implement the steps of the above-described query task processing method, document question-and-answer method, or information processing method based on a task processing model.

[0259] 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 belongs to the same concept as the technical solutions of the query task processing method, document question answering method, and information processing method based on task processing model described above. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solutions of the query task processing method, document question answering method, or information processing method based on task processing model described above.

[0260] An embodiment of this specification also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the above-described query task processing method, document question-and-answer method, or information processing method based on a task processing model.

[0261] 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 belongs to the same concept as the technical solutions of the query task processing method, document question answering method, and information processing method based on task processing model described above. For details not described in detail in the technical solution of the computer program product, please refer to the description of the technical solutions of the query task processing method, document question answering method, or information processing method based on task processing model described above.

[0262] 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.

[0263] The computer 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.

[0264] 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.

[0265] 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.

[0266] 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 query task processing method, comprising: Obtain document query information and multiple candidate document fragments corresponding to the document query information; Based on the document query information and the candidate document fragments, classification hint information for the candidate document fragments is constructed, and the classification hint information is input into the task processing model to obtain the classification result of the candidate document fragments. The classification result includes a first classification result and a second classification result. The first classification result represents the prediction result that the candidate document fragment is an answer reference document, and the second classification result represents the prediction result that the candidate document fragment is a non-answer reference document. Using the classification results of the multiple candidate document fragments, the target document fragment is selected from the multiple candidate document fragments; Based on the target document fragment, generate the document query answer for the document query information.

2. The method according to claim 1, wherein inputting the classification prompt information into the task processing model to obtain the classification result of the candidate document fragment includes: The classification prompt information and the classification lexicon table are input into the task processing model to obtain a first classification result and a second classification result for the candidate document fragment. The classification lexicon table includes at least one first classification lexicon and at least one second classification lexicon. The first classification lexicon indicates that the candidate document fragment is an answer reference document, and the second classification lexicon indicates that the candidate document fragment is a non-answer reference document. The first classification result is obtained based on the at least one first classification lexicon, and the second classification result is obtained based on the at least one second classification lexicon.

3. The method according to claim 1, wherein constructing classification prompt information for the candidate document fragments based on the document query information and the candidate document fragments includes: Obtain a classification prompt template, wherein the classification prompt template includes task description information, and the task description information is used to guide the task processing model to classify the candidate document fragments based on classification rules; The document query information and the candidate document fragments are added to the category suggestion template to obtain the category suggestion information.

4. The method according to claim 3, wherein the classification prompt template further includes at least one reference classification sequence, the reference classification sequence including reference document fragments, reference query information and reference classification tags, the reference classification tags including reference classification results and reference classification reasons, the reference classification results being located before the reference classification reasons.

5. The method according to claim 1, wherein selecting the target document fragment from the plurality of candidate document fragments using the classification results of the plurality of candidate document fragments comprises: Among the plurality of candidate document fragments, the candidate document fragment whose first classification result is greater than the second classification result is determined as the target document fragment.

6. The method according to claim 1, wherein selecting the target document fragment from the plurality of candidate document fragments using the classification results of the plurality of candidate document fragments comprises: Based on the classification results of the multiple candidate document fragments, the multiple candidate document fragments are sorted, and the target document fragment is selected from the multiple candidate document fragments according to the sorting results.

7. The method according to claim 1, wherein obtaining document query information and multiple candidate document fragments corresponding to the document query information includes: Obtain the document query information and the target document corresponding to the document query information; The target document is segmented to obtain multiple candidate document segments.

8. The method according to claim 1, wherein generating the document query answer based on the target document fragment comprises: The query prompts, the target document fragment, and the document query information are input into the task processing model to obtain the document query answer.

9. The method according to any one of claims 1 to 8, wherein the classification prompt information includes a classification prompt template; After inputting the classification prompt information into the task processing model to obtain the classification result of the candidate document fragment, the method further includes: The processing data of the task processing model is parsed to obtain the first key-value information of the classification prompt template, and the first key-value information is stored in the cache; And / or, The processing data is parsed to obtain the first key-value information of the classification prompt template and the second key-value information of the candidate document fragment, and the first key-value information and the second key-value information are stored in the cache.

10. A document question-answering method, comprising: Obtain document questions for a target document, wherein the target document includes multiple candidate document fragments; Based on the document question and the candidate document fragments, classification hints for the candidate document fragments are constructed, and the classification hints are input into the task processing model to obtain the classification results of the candidate document fragments. The classification results include a first classification result and a second classification result. The first classification result represents the prediction result that the candidate document fragment is an answer reference document, and the second classification result represents the prediction result that the candidate document fragment is a non-answer reference document. Using the classification results of the multiple candidate document fragments, the target document fragment is selected from the multiple candidate document fragments; Based on the target document fragment, generate the document answer to the document question.

11. An information processing method based on a task processing model, applied to a task platform, comprising: Receive model requests sent by terminal devices; Based on the model request, a target task processing model is determined from a plurality of task processing models, wherein the target task processing model is used to perform the method as described in any one of claims 1 to 9.

12. The method according to claim 11, wherein the model request includes a scene identifier of the target scene; The step of determining the target task processing model from multiple task processing models based on the model request includes: Based on the scene identifier of the target scene, a target task processing model suitable for the target scene is searched from the model library, wherein the model library stores multiple task processing models suitable for different query scenarios.

13. The method according to claim 11, wherein the model request includes scene input data of the target scene; The step of determining the target task processing model from multiple task processing models based on the model request includes: From the multiple task processing models, an initial task processing model suitable for the target scenario is determined; Based on the scene input data of the target scene, the initial task processing model is trained to obtain the target task processing model.

14. The method according to claim 11, wherein the model request includes model specification parameters; The step of determining the target task processing model from multiple task processing models based on the model request includes: Based on the model specification parameters, the corresponding target task processing model is searched from the model library, wherein the model library stores multiple task processing models with different model specification parameters.

15. The method according to any one of claims 11 to 14, wherein after determining the target task processing model from multiple task processing models based on the model request, the method further comprises: Deploy the target task processing model, and based on the target task processing model, construct a query task processing interface so that the terminal device can schedule the target task processing model to execute the target query task.

16. A task platform, comprising a request interface and a response unit; The request interface is used to receive model requests sent by the terminal device, wherein... The model request includes at least one of the following: the scene identifier of the target scene, the scene input data of the target scene, and the model specification parameters. The response unit is configured to determine a target task processing model from a plurality of task processing models based on the model request, wherein the target task processing model is configured to perform the method as described in any one of claims 1 to 9.

17. The task platform according to claim 16, further comprising a query task processing interface, wherein the query task processing interface is constructed based on the target task processing model; The query task processing interface is used for the terminal device to schedule and execute target query tasks.

18. A computing device, comprising: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions, which, when executed by the processor, implement the steps of the method according to any one of claims 1 to 15.

19. 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 / instructions, and the processor is used to execute the computer programs / instructions, which, when executed by the processor, implement the steps of the method according to any one of claims 1 to 15.

20. A computer-readable storage medium storing a computer program / instructions that, when executed by a processor, implement the steps of the method according to any one of claims 1 to 15.

21. A computer program product comprising a computer program / instructions that, when executed by a processor, implement the steps of the method according to any one of claims 1 to 15.