Task processing method, entity recognition method, and data processing method for task processing
Through the multi-task unified pre-trained task processing model, the problem of insufficient task processing accuracy and universality in the existing technology is solved, and efficient, safe and fast task processing effects are achieved.
Patent Information
- Application Number
- PCT/CN2024/106303
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-08-17
- Filing Date
- 2024-07-19
- Publication Date
- 2025-02-20
AI Technical Summary
The existing technology is difficult to achieve high generality and high task processing accuracy in various types of task segmentation scenarios, and the generative large-scale language model has high cost, data security problems, slow inference speed, and task processing accuracy is affected by instruction text. Big problems.
The task processing model is trained using a multi-task unified pre-training method, fixed the format of instruction text and result text, and supervised training is carried out through sample instruction text in the first format and label result text in the second format to generate task execution in accordance with the second format. result.
It realizes task processing methods with high generality and high task processing accuracy on multiple natural language understanding tasks, reducing costs and data security risks, and improving inference speed and task processing accuracy.
Smart Images

Figure CN2024106303_20022025_PF_FP_ABST
Abstract
Description
Task processing method, entity recognition method, and data processing method for task processing
[0001] This disclosure claims priority to application number 202311047348.1 filed with the China Patent Office on August 17, 2023, entitled “Task processing method, entity recognition method, and data processing method for task processing,” the entire contents of which are incorporated by reference into this disclosure. Technical Field
[0002] The embodiments of this specification relate to the field of text processing technology, and in particular to a task processing method, an entity recognition method, and a data processing method for task processing. Background Art
[0003] With the continuous development of deep learning technology, natural language processing (NLP), represented by natural language understanding (NLU) and natural language generation (NLG), has made great progress.
[0004] Currently, deep learning models are pre-trained in various types of task segmentation scenarios based on large-scale, high-quality sample data, resulting in highly accurate task processing models. However, the performance of a task processing model is directly related to the size and quality of the sample data used in the pre-training process, the model's training methods, and the hardware and software resources available. Even if all of these directly related conditions are met and a task processing model with excellent performance is trained, there is still a pressing issue in actual application: how to fully utilize this performance to achieve generalized task processing in various types of task segmentation scenarios with high versatility and high task processing accuracy in any task segmentation scenario.
[0005] Summary of the Invention
[0006] In view of this, embodiments of this specification provide a task processing method. One or more embodiments of this specification also relate to another task processing method, an entity recognition method, a data processing method for task processing, a task processing device, another task processing device, an entity recognition device, a data processing device for task processing, a computing device, a computer-readable storage medium, and a computer program to address technical deficiencies in the prior art.
[0007] In one embodiment of this specification, a task processing method is provided, including:
[0008] Receive the target text input by the front end and the task information of the target task selected for the target text;
[0009] constructing an instruction text conforming to a first format based on the target text and the task information;
[0010] Based on the instruction text, a task processing model is used to execute the target task on the target text to generate a task execution result that conforms to the second format, wherein the task processing model is trained based on the sample instruction text in the first format and the label result text in the second format, the sample instruction text includes sample task text and sample task information, and the second format is determined based on the sample task information and the label text corresponding to the sample task information.
[0011] In one embodiment of the present specification, a target text input by a front end and task information of a target task selected for the target text are received; based on the target text and the task information, an instruction text conforming to a first format is constructed; based on the instruction text, a task processing model is used to execute the target task on the target text to generate a task execution result conforming to a second format, wherein the task processing model is trained based on sample instruction texts in the first format and labeled result texts in the second format, the sample instruction texts including sample task texts and sample task information, and the second format is determined based on the sample task information and the label text corresponding to the sample task information. The task processing model is obtained by pre-supervised training based on sample instruction texts in the first format and the label text corresponding to the sample task information, and learns the input instruction text in the first format and the output result in the second format. When the second format is determined based on the sample task information and the label text corresponding to the sample task information, the task processing model can generate a task execution result conforming to the second format corresponding to the task information and the corresponding label text according to the task information of the instruction text. While executing the target task on the target text under different task information, the task processing model has the ability to refine the processing of specific task information, that is, the task processing has high versatility and high task processing accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] FIG1 is a flowchart of a task processing method provided by one embodiment of this specification;
[0013] FIG2 is a flowchart of another task processing method provided by one embodiment of this specification;
[0014] FIG3 is a flow chart of an entity recognition method provided by one embodiment of this specification;
[0015] FIG4 is a flow chart of a data processing method for task processing provided by one embodiment of this specification;
[0016] FIG5 is a schematic diagram of a front-end interface of a task processing method provided by an embodiment of this specification;
[0017] FIG6 is a flowchart of a task processing method applied to a search engine according to an embodiment of the present disclosure;
[0018] FIG7 is a schematic diagram of the structure of a task processing device provided by one embodiment of this specification;
[0019] FIG8 is a schematic diagram of the structure of another task processing device provided by an embodiment of this specification;
[0020] FIG9 is a schematic structural diagram of an entity recognition device provided by one embodiment of this specification;
[0021] FIG10 is a schematic diagram of the structure of a data processing device for task processing provided by one embodiment of this specification;
[0022] FIG11 is a structural block diagram of a computing device provided in one embodiment of this specification. DETAILED DESCRIPTION
[0023] The following description sets forth many specific details to facilitate a thorough 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 generalizations without violating the scope of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.
[0024] The terms used in one or more embodiments of this specification are for the purpose of describing specific embodiments only and are not intended to limit one or more embodiments of this specification. The singular forms "a," "the," and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" 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.
[0025] 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 the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0026] In addition, 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, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0027] In one or more embodiments of this specification, a large model refers to a deep learning model with large-scale model parameters, typically containing hundreds of millions, tens of billions, hundreds of billions, trillions, or even more than ten trillion model parameters. A large model can also be called a cornerstone model / foundation model. It is pre-trained on a large-scale unlabeled corpus to produce a pre-trained model with more than 100 million parameters. This model can adapt to a wide range of downstream tasks and has good generalization capabilities, such as a large language model (LLM) and a multi-modal pre-training model.
[0028] When large models are used in practice, only a small number of samples are needed to fine-tune the pre-trained model and it can be applied to different tasks. Large models can be widely used in natural language processing (NLP), computer vision and other fields. Specifically, they can be applied to computer vision tasks such as visual question answering (VQA), image caption (IC), and image generation, as well as natural language processing tasks such as text-based sentiment classification, text summary generation, and machine translation. The main application scenarios of large models include digital assistants, intelligent robots, search, online education, office software, e-commerce, and intelligent design.
[0029] First, the terms involved in one or more embodiments of this specification are explained.
[0030] Natural Language Understanding (NLU): A general term for the task of deep learning models understanding natural language. Specifically, it involves converting natural language into feature vectors that deep learning models can understand, and then using them for further processing and application, including grammatical analysis, semantic analysis, entity recognition and extraction, and text classification. Natural language understanding is a key foundation for natural language processing and the underlying technology for various systems such as information management systems, automated office systems, search engines, and recommendation systems. Deep learning models generally rely on pre-trained sample inputs and outputs to learn and understand the content of natural language understanding tasks.
[0031] Open Domain Model: A general model without domain (task scenario) restrictions and high versatility.
[0032] CNN (Convolutional Neural Networks) model: A multi-layer deep learning model with forward propagation and backpropagation, and a convolution kernel (filter) to process feature data.
[0033] RNN (Recurrent Neural Network) model: A recursive deep learning model that processes vector representations recursively and connects intermediate layers in a chain-like manner.
[0034] LSTM (Long Short Term Memory) model: A deep learning model that has the ability to memorize long-term and short-term information and has a convolution filter that processes feature data.
[0035] Transformer (translation) model: A deep learning model based on the attention mechanism, which extracts and analyzes the features of the data through the attention mechanism.
[0036] BERT (Bidirectional Encoder Representation from Transformers) model: a deep learning model with bidirectional attention encoding representation function.
[0037] RoBERTa (A Robustly Optimized BERT Pretraining Approach): A BERT-derived model with hybrid character-level and word-level encoding and a dynamic masking mechanism.
[0038] GAN (Generative Adversarial Network): consists of a generator and a discriminator. By alternately training the generator and the discriminator, a highly accurate generator is obtained.
[0039] Currently, due to its importance and wide range of applications, natural language understanding has always been a key research and development direction. Natural language understanding has made significant progress, especially since the advent of the BERT model. In various segmented task scenarios, natural language understanding models using supervised learning have achieved extremely high accuracy based on large-scale, high-quality sample data. However, the high customization costs of supervised models (sample data labeling costs, model development costs, etc.) limit their scope of application. Except for scenarios where demand is relatively fixed and large-scale use can spread costs, it is difficult to implement in cost-sensitive scenarios, where sample data labeling is difficult, and demand changes rapidly. Therefore, researchers have been committed to exploring a general model that is not restricted by domains, namely, an open domain model, which has high task processing accuracy in various types of task segmentation scenarios.
[0040] However, due to the limitation of the parameter size of current open domain models (generally 10 9 The model's generalization is insufficient. With the emergence of large-scale language models, especially generative large-scale language models, users only need to carefully describe their needs without having to label a large amount of sample data to train the model to obtain relatively reliable task execution results. However, generative large-scale language models have the following problems:
[0041] 1. Cost issue: As a basic task, natural language understanding tasks have a huge number of calls, and the long-term call cost even exceeds the cost of developing a dedicated supervision model. 2. Data security issue: In some scenarios with strict data security management, distributed generative large-scale language models cannot be called externally. 3. Inference speed issue: The concurrency and response time of generative large-scale language models make it difficult to support large-scale real-time call requests for basic tasks such as natural language understanding. 4. The task processing accuracy of generative large-scale language models is greatly affected by the instruction text, and the format style of the instruction text needs to be designed for different tasks. 5. The parsability and stability of the model output are poor. The output of the generative large-scale language model is in natural language form and has no strict format constraints, which makes it difficult to use it in downstream tasks. 6. Closed-source models cannot be deeply customized based on accumulated project data, and general models are difficult to meet task scenarios with high task processing accuracy requirements.
[0042] In response to the above problems, a task processing method is provided in the embodiment of the specification of Figure 1, which adopts a multi-task unified pre-training method to train the task processing model, and fixes the format of the instruction text and the format of the result text, overcoming the above problems 1-6, and is universal in a variety of natural language understanding tasks, resulting in a friendly usage method similar to an application programming interface (API).
[0043] In this specification, a task processing method is provided. This specification also involves another task processing method, an entity recognition method, a data processing method for task processing, a task processing device, another task processing device, an entity recognition device, a data processing device for task processing, a computing device, a computer-readable storage medium and a computer program, which are described in detail one by one in the following embodiments.
[0044] Referring to FIG1 , FIG1 shows a flowchart of a task processing method provided by an embodiment of this specification, including the following specific steps:
[0045] Step 102: Receive the target text input by the front end and the task information of the target task selected for the target text.
[0046] The embodiments of this specification are applied to the client, server or application platform of an application with multiple task processing functions, and a deep learning model with multiple task processing functions, i.e., a task processing model, is deployed on the client, server or application platform. The front end is the application front end or application platform front end with multiple task processing functions that the user logs in to. The user can manually enter the target text on the front end, or obtain the target text on the front end to input the target text. Task information of multiple tasks can be set on the front end, and the user can select the task information of the target task by clicking or dragging. The user can also select by entering the task information of the target task, which is not limited here.
[0047] The target text is the natural language text to be processed by the task. It can be at least one sentence or at least one word. For example, the target text is "I am not happy".
[0048] The target task is the text processing task to be performed, a natural language understanding task, including but not limited to recognition and extraction tasks such as entity recognition (entity extraction), event recognition (event extraction), and question-answer recognition (question-answer extraction), as well as text classification tasks such as topic classification, intent classification, and sentiment classification. The target task's task information is the task feature information of the target task, a natural language text. The target task information characterizes the task characteristics of the target task, including but not limited to the task type, label type, and task execution logic. For example, for the target text "I am unhappy," the target task is sentiment classification, and the target task information is "Classification: Sentiment."
[0049] For example, user A logs in to the front end of the T platform, a multifunctional integrated application platform with recognition and extraction functions and text classification functions, enters the target text "A place is really hot" at the front end, and selects the target task of the place entity from the recognition and extraction tasks. The task information of the target task selected for the target text is "Extraction: Place".
[0050] Receiving the target text input by the front end and the task information of the target task selected for the target text lays a data foundation for the subsequent construction of the instruction text in the first format.
[0051] Step 104: Construct an instruction text conforming to the first format based on the target text and the task information.
[0052] The instruction text is a natural language text instruction that is directly input into the task processing model. The instruction text is used to guide the task processing model to understand the task content of the target task, and thereby perform the target task corresponding to the task information on the target text, and generate an output result in the corresponding output format. Generally, the instruction text has a corresponding format style. Through the limitation of a specific format style, the model can clearly understand the target task and perform the target task on the target text. For example, if the format style of the instruction text is "adverb + adjective + noun; text style label, text style example", the model can clearly understand the task content and output format of the target task through the text grammatical level of adverbs, adjectives and nouns, and through the text style level of text style labels and text style examples.
[0053] The first format is a text instruction format for the instruction text corresponding to the target task. The first format is determined based on the sample task text and sample task information in the pre-training process and is learned by the task processing model. During the application process, the instruction text is input in the first format style. The first format style includes: control symbols (input, task), which are used to guide the task processing model to understand the meaning of the instruction text and control the task execution of the task processing model. The first format style includes the target text and task information. In the embodiment of this specification, the first format style is: input: target text; task information. For example, if the target task is name entity recognition and extraction, the first format style is "input: target text; extraction: name".
[0054] Based on the target text and the task information, an instruction text conforming to the first format is constructed. Specifically, based on the target text and the task information, an instruction text conforming to the first format is constructed according to the first format style.
[0055] Exemplarily, based on the target text "A place is really hot" and the task information "Extract: location", according to the first format style "input: target text; task information", an instruction text conforming to the first format is constructed: input: A place is really hot; extract: location.
[0056] Based on the target text and task information, an instruction text that conforms to the first format is constructed, so that the subsequent task processing model can understand the task content of the target task more accurately, laying the format foundation for the subsequent generation of high-precision task execution results.
[0057] Step 106: Based on the instruction text, use the task processing model to execute the target task on the target text to generate a task execution result that conforms to the second format, wherein the task processing model is trained based on the sample instruction text in the first format and the label result text in the second format, the sample instruction text includes the sample task text and the sample task information, and the second format is determined based on the sample task information and the label text corresponding to the sample task information.
[0058] The task processing model is a deep learning model with multiple task processing functions and natural language generation capabilities. It can execute corresponding tasks based on the task information of different tasks and generate task execution results in a specific format. Task processing models include but are not limited to: CNN model, RNN model, LSTM model, Transformer model, BERT model, RoBERTa model and GAN model. The task processing model is a generative small-scale language model (the parameter scale is generally 10 12 GB level), compared to the generative large-scale language model (parameter scale is generally 10 15Level), can be deployed on the client, server or application platform, without being deployed on an external distributed cluster. The task processing model is pre-trained, that is, pre-trained (Pre-train) and / or fine-tuned (Fine-tune). In the embodiment of this specification, the task processing model is a generative language model, which processes natural language understanding tasks in a natural language generation manner. In order for the generative language model to understand the task content of the natural language understanding task, it is necessary to define the input instruction text in a first format. In order for the generative language model to output the output result of natural language understanding in a specific format, it is necessary to define the output result in a second format, so that the task processing model with multiple task processing functions can accurately perform the natural language understanding task.
[0059] The task execution result is the natural language text result of executing the target task on the target text, and is the input result generated by the task processing model.
[0060] The second format is the text format of the task execution result corresponding to the target task. The second format is determined based on the sample task information and the label text corresponding to the sample task information during the pre-training process and is learned by the task processing model. During the application process, the task execution result is output in the second format style. The second format style includes: control symbol (output), which is used to guide the task processing model to generate the task execution result. The specific second format style is: output: task information: predicted text. For example, if the target task is name entity recognition and extraction, the second format style is "output: name: name entity".
[0061] The sample task text is the natural language text to be processed for the sample task. The sample task information represents the characteristics of the sample task. Sample tasks are pre-trained text processing tasks, which can be various natural language understanding tasks. For example, if the sample task is sentiment classification, the sample task text for sentiment classification is "I am unhappy," and the sample task information for sentiment classification is "Classification: Sentiment."
[0062] The label text is the text of the task processing execution object. It is the text corresponding to the sample task information during the task processing, i.e., the pre-training process. For example, if the sample task is sentiment classification, the sample task text for sentiment classification is "I am unhappy", and the sample task information for sentiment classification is "Classification: Sentiment", the corresponding label text is "unhappy".
[0063] During the pre-training process of the task processing model, the sample instruction text in the first format is used as a training sample, and the label result text in the second format is used as a label sample to perform supervised training on the task processing model. The first format is determined based on the sample task text and the sample task information, and the second format is determined based on the sample task information and the label text corresponding to the sample task information. After such supervised training, the task processing model learns the first format of different sample instruction texts and the second format of the corresponding label result text. In step 106, the task processing model understands and executes the target task through the input instruction text that conforms to the first format, and generates a task execution result that conforms to the second format. The second format improves the interpretability and stability of the output results by constraining the target task, making it easier to use in subsequent downstream tasks.
[0064] Based on the instruction text, the task processing model is used to perform the target task on the target text to generate a task execution result that conforms to the second format. The specific method is: input the instruction text into the task processing model, and based on the context of the instruction text, generate the predicted text corresponding to the task information, and based on the task information and the predicted text, determine the task execution result that conforms to the second format. Among them, the predicted text is generated based on the context by a coding and decoding method, that is, the instruction text is feature-encoded to obtain the feature vector of the instruction text, and the feature vector is decoded based on the context decoding mechanism to generate the predicted text. The context mechanism can be an attention mask mechanism or a diagonal masking mechanism. Specifically, the token at the next position is predicted based on the previous token in the feature vector of the instruction text. Among them, based on the task information and the predicted text, the task execution result that conforms to the second format is determined. The specific method is: based on the task information and the predicted text, according to the second format style, a task execution result that conforms to the second format is constructed.
[0065] Exemplarily, the task processing model is a Transformer model trained based on sample instruction text in a first format for recognition and extraction tasks and labeled result text in a second format for text classification tasks. The task processing model has the functions of recognition, extraction, and text classification. The instruction text "Input: It's really hot in place A; Extract: Place" is input into the task processing model, and the instruction text is feature-encoded to obtain a feature vector of the instruction text. Based on a diagonal masking mechanism, the feature vector is decoded to generate the predicted text "place A" corresponding to the task information "Extraction: Place". Based on the task information and the predicted text, a task execution result conforming to the second format "Output: Task Information: Predicted Text" is constructed: Output: Place: Place A.
[0066] In an embodiment of the present specification, a target text input by a front end and task information of a target task selected for the target text are received; based on the target text and the task information, an instruction text conforming to a first format is constructed; based on the instruction text, a task processing model is used to execute the target task on the target text to generate a task execution result conforming to a second format, wherein the task processing model is trained based on a sample instruction text in the first format and a label result text in the second format, the sample instruction text includes a sample task text and sample task information, and the second format is determined based on the sample task information and the label text corresponding to the sample task information. The task processing model is obtained by pre-supervised training based on the sample instruction text in the first format and the label result text in the second format, and learns the input instruction text in the first format and the output result in the second format. When the second format is determined based on the sample task information and the label text corresponding to the sample task information, the task processing model can generate a task execution result conforming to the second format corresponding to the task information and the corresponding label text according to the task information of the instruction text. While executing the target task on the target text under different task information, the task processing model has the ability to refine the processing of specific task information, that is, the task processing has high versatility and high task processing accuracy.
[0067] In an optional embodiment of the present specification, the task information of the target task includes a task type and a tag type;
[0068] Correspondingly, step 106 includes the following specific steps:
[0069] The instruction text is input into the task processing model, and based on the label type, the target task corresponding to the task type is executed on the target text, a predicted text corresponding to the label type is generated, and a task execution result that conforms to the second format is determined based on the label type and the predicted text.
[0070] Task information characterizes the characteristics of the target task, thereby determining the primary and secondary formats. This information limits the input and output of the task processing model, ensuring that the model accurately understands the target task content and produces output results in a specific format. Furthermore, task information can be further broken down into task types and tag objects, characterizing the characteristics of the task method and task object.
[0071] The task type is the task method for the target task, that is, the type of task execution. The label type is the task object for the target task, that is, the type of label text. For example, for a location entity recognition and extraction task, the task type is recognition and extraction, and the label type is location. This requires recognition and extraction of label text with the location label type in the target text. Both the task type and label type are pre-set. When the user enters the target text, they select the corresponding target task based on the target text.
[0072] In the embodiment of this specification, the first formatting pattern includes: control symbol (input, task); target text; task type; label type. Specifically, the first formatting pattern is: input: target text; task type: label type.
[0073] Since the task processing model in the embodiment of this specification is a generative language model, it performs natural language understanding tasks through natural language generation. Therefore, it is necessary to generate corresponding prediction text instead of directly outputting the task execution results like natural language understanding.
[0074] The instruction text is input into the task processing model, and based on the label type, the target task corresponding to the task type is performed on the target text to generate the predicted text corresponding to the label type. The specific method is as follows: the instruction text is input into the task processing model, and based on the label type and the context of the instruction text, the predicted text corresponding to the label type is generated.
[0075] Exemplarily, the instruction text "Input: Place A is really hot; Extract: Place" is input into the task processing model, the instruction text is feature encoded to obtain the feature vector Feature of the instruction text, and based on the label type "Place" and the diagonal masking mechanism, the extraction task corresponding to the task type "Extraction" is performed on the target text "Place A is really hot" to generate the corresponding predicted text "Place A", and based on the task information and the predicted text, according to the second format style "Output: Task information: Predicted text", the task execution result that conforms to the second format is determined: Output: Place: Place A.
[0076] The instruction text is input into the task processing model. Based on the label type, the target task corresponding to the task type is executed on the target text, and the predicted text corresponding to the label type is generated. Based on the label type and the predicted text, the task execution result that conforms to the second format is determined. The task type and label type enable the task processing model to have a more detailed understanding of the target task content and generate a task execution result that conforms to the second format, further improving task processing accuracy.
[0077] In an optional embodiment of the present specification, before step 106, the following specific steps are further included:
[0078] Obtain sample task texts and sample task information for various sample tasks;
[0079] Constructing a sample instruction text conforming to a first format based on the sample task text and the sample task information;
[0080] Determining a second format and a label result text conforming to the second format based on the sample task information and the sample label text corresponding to the sample task information;
[0081] Based on the sample instruction text, using the task processing model to perform the corresponding sample task on the sample task text, and generate a prediction result text that conforms to the second format;
[0082] The task processing model is trained based on the prediction result text and the label result text, and when the preset training end conditions are met, a trained task processing model is obtained.
[0083] Sample tasks are pre-trained text processing tasks, including various natural language understanding tasks. Sample task text is the natural language text to be processed for the sample task, which can be at least one sentence or at least one word. Sample task information is the task feature information for the sample task, a type of natural language text. The sample task information characterizes the task features of the sample task, including but not limited to: task type, label type, and task execution logic. Sample task text and sample task information can be obtained from open source sample sets, collected from historical task processing datasets, or manually constructed.
[0084] Sample instruction text is a natural language text instruction directly input into the task processing model during the pre-training process. This sample instruction text is used during the pre-training process to guide the task processing model in understanding the content of the sample task. This sample instruction text then executes the sample task corresponding to the sample task information on the sample task text, generating output results in the corresponding output format. During the pre-training process of the task processing model, sample instruction text in the first format serves as training samples.
[0085] The sample label text is the text of the sample task executed during the pre-training process, that is, the text corresponding to the sample task information. For example, if the sample task is sentiment classification, the label text is sentiment terms. The label result text is the labeled natural language text result used during the pre-training process to measure the task execution performance of the task processing model. During the pre-training process of the task processing model, the label result text in the second format serves as the label sample. The predicted result text is the natural language text result of the task processing model executing the sample task on the sample task text during the pre-training process, and is the output generated by the task processing model.
[0086] The preset training end conditions are pre-set judgment conditions for the end of task processing model training, including but not limited to: a preset number of iterations, a preset loss value threshold, and a preset training convergence condition.
[0087] Based on the sample task text and the sample task information, a sample instruction text that conforms to the first format is constructed. Specifically, based on the sample task text and the sample task information, a sample instruction text that conforms to the first format is constructed according to the first format style.
[0088] Based on the sample task information and the sample label text corresponding to the sample task information, determine the second format and the label result text that conforms to the second format. The specific method is: based on the sample task information and the sample label text corresponding to the sample task information, determine the second format; based on the sample task information and the sample label text corresponding to the sample task information, construct the label result text that conforms to the second format according to the second format style.
[0089] The task processing model is trained based on the predicted and labeled text. Specifically, a loss value is calculated based on the predicted and labeled text, and model parameters of the task processing model are adjusted based on the loss value. The loss value is the difference between the predicted and labeled text, and may include but is not limited to cosine loss, cross entropy loss, and vector distance loss. The parameter adjustment method is gradient descent.
[0090] For example, sample task text and sample task information for recognition and extraction tasks (entity extraction, event extraction, question answer extraction) and text classification tasks (topic classification, intent classification, and sentiment classification) are obtained, with 100 tasks for each category. Based on the sample task text and sample task information, sample instruction text conforming to the first format (input: sample task text; sample task information) is constructed. Based on the sample task information and the sample label text corresponding to the sample task information, a second format (output: sample task information: sample label text or predicted result text) is determined: output: sample task information: sample label text or predicted result text. Based on the sample task information and the sample label text corresponding to the sample task information, labeled result text conforming to the second format (output: sample task information: sample label text or predicted result text) is constructed. The sample instruction text is input into the Transformer model, and the corresponding sample task is executed on the sample task text to generate predicted result text conforming to the second format. Based on the predicted result text and the labeled result text, a loss value (Loss) is calculated. Based on the loss value, the model parameters of the task processing model are adjusted. When the preset training convergence conditions are met, a trained task processing model is obtained.
[0091] The invention relates to a method for obtaining sample task texts and sample task information of multiple sample tasks; constructing a sample instruction text conforming to a first format based on the sample task texts and the sample task information; determining a second format and a label result text conforming to the second format based on the sample task information and the sample label text corresponding to the sample task information; executing the corresponding sample task on the sample task text using a task processing model based on the sample instruction text to generate a predicted result text conforming to the second format; training the task processing model based on the predicted result text and the label result text, and obtaining a trained task processing model when a preset training end condition is met. Based on the sample task texts and the sample task information, constructing a sample instruction text conforming to the first format; determining a second format and a label result text conforming to the second format based on the sample task information and the sample label text corresponding to the sample task information; and training the task processing model based on the sample instruction texts and the label result text under the constraints of the sample task information of multiple sample tasks, so that the task processing model has the ability to process different tasks and has high versatility. At the same time, through training under the fixed format constraints of the first format and the second format, the task processing model has the ability to process refined tasks for each sample task and has high task processing accuracy.
[0092] In an optional embodiment of the present specification, based on the sample instruction text, using the task processing model to perform the corresponding sample task on the sample task text to generate a prediction result text that conforms to the second format includes the following specific steps:
[0093] The sample instruction text is input into the task processing model, and based on the context of the sample instruction text, a predicted text corresponding to the sample task information is generated, and based on the sample task information and the predicted text, a predicted result text conforming to the second format is determined.
[0094] The sample instruction text conforming to the first format can be regarded as a natural language text sentence. Based on the context of the text sentence, a predicted text is generated, and the predicted result text conforming to the second format is determined based on this.
[0095] The predicted text is the natural language text corresponding to the sample task information directly generated by the task processing model during the pre-training process. It is the output generated by the task processing model. For example, if the sample task information is "Extract: Location", the predicted text is "B Location".
[0096] Based on the context of the sample instruction text, the predicted text corresponding to the sample task information is generated through an encoding and decoding method. Specifically, the sample instruction text is feature-encoded to obtain a feature vector of the sample instruction text. The feature vector is then decoded using a context decoding mechanism to generate the predicted text. The context mechanism can be an attention mask mechanism or a diagonal mask mechanism. Specifically, the next token is predicted based on the previous token in the instruction text feature vector.
[0097] Based on the sample task information and the predicted text, a predicted result text conforming to the second format is determined, specifically in the following manner: based on the sample task information and the predicted text, a predicted result text conforming to the second format is constructed according to the second format style.
[0098] Exemplarily, the sample instruction text is input into the task processing model, the sample instruction text is feature encoded to obtain a feature vector SampleFeature of the sample instruction text, the feature vector is decoded based on the diagonal masking mechanism, and the predicted text corresponding to the sample task information is generated, and based on the task information and the predicted text, a prediction result text conforming to the second format is constructed in accordance with the second format style "output: task information: predicted text".
[0099] The sample instruction text is input into the task processing model. Based on the context of the sample instruction text, predicted text corresponding to the sample task information is generated. Based on the sample task information and the predicted text, a predicted result text conforming to the second format is determined. This method of generating predicted text from the context improves the accuracy of the determined predicted result text and enhances the model training effect.
[0100] In an optional embodiment of the present specification, after obtaining sample task texts and sample task information of multiple sample tasks, the following specific steps are further included:
[0101] According to the quantity distribution of the sample task texts and the preset quantity balance strategy, the sample task texts are screened.
[0102] Because the sample task texts of the sample tasks are unbalanced in quantity distribution, for example, the number of sample task texts of the entity recognition extraction task is relatively large, resulting in sample oversampling of the entity recognition extraction task, and the number of sample task texts of the text classification task is relatively small, resulting in sample undersampling of the text classification task. The trained task processing model has a higher task processing accuracy for the entity recognition task, but has a lower task processing accuracy for the text classification task, which reduces the versatility of task processing and the task processing accuracy. In order to prevent this problem, the embodiments of this specification summarize and screen the sample task texts according to a preset quantity balance strategy.
[0103] The preset quantity balance strategy is a measurement condition for distribution balance set for the quantity distribution of sample task texts, including but not limited to: a quantity balance strategy for sample task types and a quantity balance strategy for sample label types.
[0104] For example, the sample tasks include: recognition and extraction tasks (entities, events, question answers) and text classification tasks (topic classification, intent classification, sentiment classification), with a total of two major categories and six subcategories. The preset quantity balance strategy is 100 sample task texts for each subcategory. According to the quantity distribution of the sample task texts of the six subcategories of sample tasks, the sample task texts are screened according to the above quantity balance strategy to obtain 100 sample task texts for each subcategory, for a total of 600 sample task texts.
[0105] Based on the distribution of sample task texts and a preset quantity balance strategy, the sample task texts are screened. This improves the training effect of the task processing model and enhances the versatility and accuracy of task processing.
[0106] In an optional embodiment of this specification, the sample task information includes a sample task type;
[0107] Correspondingly, based on the quantity distribution of the sample task texts and according to the preset quantity balance strategy, the sample task texts are screened, including the following specific steps:
[0108] According to the sample task types, determine the quantity distribution of sample task texts of each sample task type;
[0109] According to the quantity distribution of the sample task texts of each sample task type, the sample task texts are screened according to a preset first quantity balance strategy, wherein the first quantity balance strategy is a quantity balance strategy for the sample task type.
[0110] The sample task type is the task mode of the sample task, that is, the type of task execution mode, including but not limited to: recognition extraction and text classification.
[0111] The first quantity balance strategy is a quantity balance strategy for sample task types. In the embodiment of this specification, the first quantity balance strategy is that the quantity of sample task texts of any sample task type does not exceed a first preset threshold M.
[0112] For example, based on the sample task type, the number of sample task texts for each sample task type is determined as follows: 400 for recognition and extraction tasks, and 380 for text classification tasks. A first quantity balancing strategy ensures that the number of sample task texts for any sample task type does not exceed a first preset threshold of 300. The sample task texts are screened to obtain 300 sample task texts for recognition and extraction tasks and 300 sample task texts for text classification tasks.
[0113] Based on the sample task types, the quantity distribution of sample task texts for each sample task type is determined. Based on the quantity distribution of sample task texts for each sample task type, the sample task texts are screened according to a preset first quantity balance strategy, where the first quantity balance strategy is a quantity balance strategy specific to the sample task type. This improves the versatility and task processing accuracy of the task processing model across different task types.
[0114] In an optional embodiment of this specification, the sample task information includes a sample tag type;
[0115] Correspondingly, based on the quantity distribution of the sample task texts and according to the preset quantity balance strategy, the sample task texts are screened, including the following specific steps:
[0116] According to the sample label type, determine the quantity distribution of sample task texts corresponding to each sample label type;
[0117] According to the quantity distribution of the sample task texts corresponding to each sample label type, the sample task texts are screened according to a preset second quantity balance strategy, wherein the second quantity balance strategy is a quantity balance strategy for the sample label type.
[0118] The sample label type is the task object of the sample task, that is, the type of sample label text, including but not limited to: entity extraction (location entity extraction, name entity extraction), event extraction, question answer extraction, topic classification, intent classification, and sentiment classification.
[0119] The second quantity balance strategy is a quantity balance strategy for sample tag types. In the embodiment of this specification, the second quantity balance strategy is that the number of sample task texts of any sample tag type does not exceed a second preset threshold K.
[0120] For example, based on the sample label type, the quantity distribution of sample task texts for each sample label type is determined as follows: location entity extraction: 120, person name entity extraction: 150, event extraction: 80, question answer extraction: 90, topic classification: 110, intent classification: 130, and sentiment classification: 100. A second quantity balancing strategy ensures that the number of sample task texts for any sample label type does not exceed a second preset threshold of 75. The sample task texts are screened to obtain 75 sample task texts for location entity extraction, 75 sample task texts for person name entity extraction, 75 sample task texts for event extraction, 75 sample task texts for question answer extraction, 75 sample task texts for topic classification, 75 sample task texts for intent classification, and 75 sample task texts for sentiment classification.
[0121] Based on the sample label type, the quantity distribution of sample task texts corresponding to each sample label type is determined. Based on the determined quantity distribution of sample task texts corresponding to each sample label type, the sample task texts are screened according to a preset second quantity balance strategy, where the second quantity balance strategy is a quantity balance strategy for the sample label type. This improves the versatility of the task processing model across different label types and the task processing accuracy across different label types.
[0122] In an optional embodiment of the present specification, the sample task information includes target sample task information and reference sample task information, there is a semantic association relationship between the target sample task information and the reference sample task information, and the sample task text includes a sample label text corresponding to the target sample task information;
[0123] Accordingly, based on the sample task text and the sample task information, constructing a sample instruction text that conforms to the first format includes the following specific steps:
[0124] Constructing a sample instruction text conforming to a first format based on the sample task text, the target sample task information, and the reference sample task information;
[0125] Accordingly, based on the sample task information and the sample label text corresponding to the sample task information in the sample task text, determining the second format and constructing the label result text that conforms to the second format includes the following specific steps:
[0126] Based on the target sample task information and the sample label text corresponding to the target sample task information, determining a second format and constructing a positive label result text that conforms to the second format;
[0127] Constructing a negative label result text conforming to the second format based on the reference sample task information and the interference label text corresponding to the reference sample task information;
[0128] Based on the positive label result text and the negative label result text, a label result text is determined.
[0129] If the sample task information contains only the correct task feature information for the sample task, that is, it corresponds to the sample label text. For example, if the sample task information only contains "extract: location" and does not contain other incorrect sample task information such as "category," "person name," or "event," the task processing model will be guided to generate only one predicted text, regardless of whether the sample task information is correct. Therefore, to eliminate this influence, it is necessary to add a certain amount of interference negative examples during the pre-training process to improve the task processing model's resistance to interference.
[0130] The target sample task information is the correct task feature information of the sample task, and the reference sample task information is the incorrect task feature information of the sample task, which is a kind of interference information. In this embodiment of the specification, in order to improve the anti-interference ability of the model, there is semantic similarity between the target sample task information and the reference sample task information. For example, the target sample task information is "location" and the reference sample task information is "direction". The reference sample task information can be selected from the sample task information of multiple sample tasks obtained, and the selection principle is to take into account both high-frequency sample tasks and low-frequency sample tasks (i.e., long-tail sample tasks).
[0131] The positive label result text is the label natural language text result used to positively measure the task execution effect of the task processing model. The negative label result text is the label natural language text result used to negatively measure the task execution effect of the task processing model.
[0132] Based on the sample task text, target sample task information and reference sample task information, a sample instruction text that conforms to the first format is constructed. The specific method is: based on the sample task text, target sample task information and reference sample task information, a sample instruction text that conforms to the first format is constructed according to the first format style.
[0133] Based on the target sample task information and the sample label text corresponding to the target sample task information, determine the second format and construct a positive label result text that conforms to the second format. The specific method is: based on the target sample task information and the sample label text corresponding to the target sample task information, determine the second format, and based on the target sample task information and the sample label text corresponding to the target sample task information, construct a positive label result text that conforms to the second format according to the second format style.
[0134] Based on the reference sample task information and the interference label text corresponding to the reference sample task information, construct a negative label result text that conforms to the second format. The specific method is: based on the reference sample task information and the interference label text corresponding to the reference sample task information, construct a negative label result text that conforms to the second format according to the second format style.
[0135] Based on the positive label result text and the negative label result text, the label result text is determined, specifically by concatenating the positive label result text and the negative label result text to obtain the label result text.
[0136] For example, the sample task text is "Place A is really hot," the sample label text is "Place A," the interference label text is "None," the target sample task information is "Extract: Place," and the reference sample task information is "Extract: Name." Based on the sample task text, target sample task information, and reference sample task information, a sample instruction text conforming to the first format is constructed according to the first formatting style "Input: sample task text; target sample task information, reference sample task information": Input: Place A is really hot; Extract: Place, Name. Based on the target sample task information and the sample label text corresponding to the target sample task information, a second format is determined: Output: Sample task information: Sample label text. Based on the target sample task information and the sample label text corresponding to the target sample task information, a positive label result text conforming to the second format is constructed according to the second formatting style: Output: Place: Place A. Based on the reference sample task information and the interference label text corresponding to the reference sample task information, a negative label result text conforming to the second format is constructed according to the second formatting style: Output: Name: None. The positive label result text and the negative label result text are concatenated to obtain the label result text: Output: Place: Place A; Name: None.
[0137] Based on the sample task text, target sample task information, and reference sample task information, a sample instruction text conforming to the first format is constructed. Based on the target sample task information and the sample label text corresponding to the target sample task information, a second format is determined and a positive label result text conforming to the second format is constructed. Based on the reference sample task information and the interference label text corresponding to the reference sample task information, a negative label result text conforming to the second format is constructed. Based on the positive label result text and the negative label result text, a label result text is determined. This eliminates the task understanding bias of the task processing model and avoids the fixed-format input and output constraints that reduce the model's task processing performance.
[0138] In an optional embodiment of the present specification, before executing the target task on the target text using the task processing model based on the instruction text, the following specific steps are also included:
[0139] Get the fine-tuning task text and fine-tuning task information of the fine-tuning task;
[0140] Constructing a fine-tuning instruction text conforming to a first format based on the fine-tuning task text and the fine-tuning task information;
[0141] Determining a second format and constructing a label result text that conforms to the second format based on the fine-tuning task information and the object text corresponding to the fine-tuning task information in the fine-tuning task text;
[0142] Based on the fine-tuning instruction text, using the trained task processing model to perform the corresponding fine-tuning task on the fine-tuning task text, and generate a prediction result text that conforms to the second format;
[0143] Based on the prediction result text and the label result text, the model parameters of the task processing model are adjusted, and when the preset fine-tuning end conditions are met, the fine-tuned task processing model is obtained.
[0144] During the pre-training process of the aforementioned task processing model, large-scale weakly supervised sample data constructed through remote supervision can be used to further pre-train the task processing model. While this improves the versatility and accuracy of the task processing model to a certain extent, there is still room for improvement in task processing accuracy in specific task scenarios. In this case, small-scale strongly supervised sample data (high-quality labeled sample data) constructed by experts can be used to fine-tune the task processing model.
[0145] Fine-tuning tasks are text processing tasks used for fine-tuning, and can be various natural language understanding tasks. Fine-tuning task text is the natural language text to be processed for the fine-tuning task, which can be at least one sentence or at least one word. Fine-tuning task information is the task feature information of the fine-tuning task, a natural language text. Fine-tuning task information characterizes the task characteristics of the fine-tuning task, including but not limited to: task type, label type, and task execution logic. Fine-tuning task text and fine-tuning task information are high-quality annotated sample data constructed by experts.
[0146] Fine-tuning instruction text is a natural language text instruction directly input into the task processing model during the fine-tuning process. This text is used to guide the task processing model in understanding the content of the fine-tuning task. It then executes the fine-tuning task corresponding to the fine-tuning task information on the fine-tuning task text, generating output results in the corresponding output format. During the fine-tuning of the task processing model, the fine-tuning instruction text in the first format serves as the fine-tuning sample.
[0147] The fine-tuning label text is the text of the fine-tuning task during the fine-tuning process, that is, the text corresponding to the fine-tuning task information. For example, if the fine-tuning task is sentiment classification, the label text is sentiment terms. The label result text is the natural language text result of the label used to measure the task processing model's performance during the fine-tuning process. During the fine-tuning of the task processing model, the label result text in the second format serves as the label sample. The predicted result text is the natural language text result of the fine-tuning task performed by the task processing model on the fine-tuning task text during the fine-tuning process, and is the output generated by the task processing model.
[0148] The preset training end conditions are pre-set judgment conditions for the end of task processing model training, including but not limited to: a preset number of iterations, a preset loss value threshold, and a preset training convergence condition.
[0149] The specific implementation method of fine-tuning is similar to the implementation method of the above-mentioned pre-training. Please refer to the above-mentioned pre-training process for details and will not be repeated here.
[0150] The fine-tuning task text and fine-tuning task information of the fine-tuning task are obtained; based on the fine-tuning task text and fine-tuning task information, a fine-tuning instruction text conforming to the first format is constructed; based on the fine-tuning task information and the object text corresponding to the fine-tuning task information in the fine-tuning task text, a second format is determined and a label result text conforming to the second format is constructed; based on the fine-tuning instruction text, a trained task processing model is used to perform the corresponding fine-tuning task on the fine-tuning task text, generating a predicted result text conforming to the second format; based on the predicted result text and the labeled result text, the model parameters of the task processing model are adjusted, and when the preset fine-tuning end conditions are met, a fine-tuned task processing model is obtained. This further improves the versatility and task processing accuracy of the task processing model.
[0151] Referring to FIG. 2 , FIG. 2 shows a flowchart of another task processing method provided by an embodiment of this specification. The method is applied to a cloud-side device and includes the following specific steps:
[0152] Step 202: Receive the target text input by the front end and the task information of the target task selected for the target text.
[0153] Step 204: Construct an instruction text conforming to the first format based on the target text and the task information.
[0154] Step 206: Based on the instruction text, use the task processing model to execute the target task on the target text to generate a task execution result that conforms to the second format, wherein the task processing model is trained based on the sample instruction text in the first format and the label result text in the second format, the sample instruction text includes the sample task text and the sample task information, and the second format is determined based on the sample task information and the label text corresponding to the sample task information.
[0155] Step 208: Feedback the task execution result to the front end.
[0156] Cloud-side devices are network cloud devices that host the servers for applications with multiple task processing capabilities. These virtual devices deploy deep learning models with multiple task processing capabilities, known as task processing models. The front end is the front end of the application or application platform that users log into. Cloud-side devices and end-devices are connected via network transmission channels for data transmission. Cloud-side devices offer higher computing power than end-devices.
[0157] It should be noted that steps 202 to 208 have been described in detail in the embodiment of FIG. 1 above and will not be repeated here.
[0158] In an embodiment of the present specification, a target text input by a front end and task information of a target task selected for the target text are received; based on the target text and the task information, an instruction text conforming to a first format is constructed; based on the instruction text, a task processing model is used to execute the target task on the target text to generate a task execution result conforming to a second format, wherein the task processing model is trained based on sample instruction text in the first format and label result text in the second format, the sample instruction text includes sample task text and sample task information, and the second format is determined based on the sample task information and the label text corresponding to the sample task information; and the task execution result is fed back to the front end. The task processing model is obtained through supervised training in advance based on sample instruction text in a first format and label result text in a second format, and has learned the input instruction text in the first format and the output result in the second format. When the second format is determined based on sample task information and the label text corresponding to the sample task information, the task processing model can generate a task execution result in the second format corresponding to the task information and the corresponding label text according to the task information of the instruction text. While executing the target task on the target text under different task information, the task processing model has the ability to refine specific task information, that is, the task processing has high versatility and high task processing accuracy, and utilizes the advantages of the high computing power of cloud-side devices to reduce the cost of task processing and improve the efficiency of task processing.
[0159] In an optional embodiment of the present specification, after step 106, the following specific steps are further included:
[0160] Feedback task execution results to the front end;
[0161] Receive execution result feedback sent by the front end, where the execution result feedback is generated based on the task execution result;
[0162] Based on the execution result feedback, adjust the model parameters of the task processing model.
[0163] After receiving the feedback of the task execution results, the front end can further generate execution result feedback based on the task execution results, and complete further adjustments to the task processing model through interaction.
[0164] For example, the task execution result "output: location: location B" is fed back to the front end, and user A generates execution result feedback based on the task execution result: the output location should be location A, receives the execution result feedback sent by the front end, and adjusts the model parameters of the task processing model based on the execution result feedback.
[0165] Feedback task execution results to the front-end; receive execution result feedback from the front-end, where the execution result feedback is generated based on the task execution results; and adjust the model parameters of the task processing model based on the execution result feedback. Through this interactive form, further adjustments to the model parameters of the task processing model are achieved, further improving the task processing accuracy of the task processing model.
[0166] Referring to FIG3 , FIG3 shows a flowchart of an entity recognition method provided by an embodiment of this specification, including the following specific steps:
[0167] Step 302: Receive the target text input by the front end and the recognition task information of the recognition task selected for the target text.
[0168] Step 304: Construct an instruction text conforming to the first format based on the target text and the recognition task information.
[0169] Step 306: Based on the instruction text, use the task processing model to perform the recognition task on the target text to generate an entity recognition result that conforms to the second format, wherein the task processing model is trained based on the sample instruction text in the first format and the label result text in the second format, the sample instruction text includes sample task text and sample task information, and the second format is determined based on the sample task information and the object text corresponding to the sample task information in the sample task text.
[0170] The embodiment of this specification and the embodiment of the specification of FIG. 1 are based on the same inventive concept. The specific methods of steps 302 to 306 refer to the above steps 102 to 106 and are not repeated here.
[0171] In an embodiment of the present specification, a target text input by a front end and recognition task information of a target task selected for the target text are received; based on the target text and the recognition task information, an instruction text conforming to a first format is constructed; based on the instruction text, a task processing model is used to perform a target task on the target text to generate an entity recognition result conforming to a second format, wherein the task processing model is trained based on a sample instruction text in the first format and a label result text in the second format, the sample instruction text includes a sample task text and sample task information, and the second format is determined based on the sample task information and the label text corresponding to the sample task information. The task processing model is obtained by pre-supervised training based on the sample instruction text in the first format and the label result text in the second format, and learns the input instruction text in the first format and the output result in the second format. When the second format is determined based on the sample task information and the label text corresponding to the sample task information, the task processing model can generate an entity recognition result conforming to the second format corresponding to the recognition task information and the corresponding label text according to the recognition task information of the instruction text. While performing the target task on the target text under different task information, the task processing model has the ability to refine entity recognition for specific recognition task information, and has high versatility and high entity recognition accuracy.
[0172] 4 , which shows a flow chart of a data processing method for task processing provided by an embodiment of this specification, and is applied to a cloud-side device, including the following specific steps:
[0173] Step 402: Obtain sample task texts and sample task information of multiple sample tasks.
[0174] Step 404: Construct a sample instruction text conforming to the first format based on the sample task text and the sample task information.
[0175] Step 406: Based on the sample task information and the sample label text corresponding to the sample task information, determine the second format and the label result text that conforms to the second format.
[0176] Step 408: Based on the sample instruction text, use the task processing model to execute the corresponding sample task on the sample task text to generate a prediction result text that conforms to the second format.
[0177] Step 410: Based on the prediction result text and the label result text, the task processing model is trained, and when the preset training end condition is met, a trained task processing model is obtained.
[0178] Step 412: Send the task processing model to the end-side device.
[0179] Cloud-side devices are virtual devices that provide model training capabilities. End-side devices are physical devices that provide various task processing functions. End-side and cloud-side devices are connected via network channels for data transmission. Cloud-side devices have higher computing power and storage capacity than end-side devices.
[0180] The embodiment of this specification and the embodiment of FIG1 described above are based on the same inventive concept. For the specific methods of steps 402 to 410, please refer to the embodiment of pre-training the task processing model in the embodiment of FIG1 described above, which will not be repeated here.
[0181] In an embodiment of the present specification, sample task texts and sample task information of a plurality of sample tasks are obtained; based on the sample task texts and the sample task information, a sample instruction text conforming to a first format is constructed; based on the sample task information and the sample label text corresponding to the sample task information, a second format and a label result text conforming to the second format are determined; based on the sample instruction text, a task processing model is used to execute the corresponding sample task on the sample task text to generate a prediction result text conforming to the second format; based on the prediction result text and the label result text, the task processing model is trained, and when a preset training end condition is met, a trained task processing model is obtained; and the task processing model is sent to an end-side device. Based on the sample task text and sample task information, a sample instruction text that conforms to the first format is constructed. Based on the sample task information and the sample label text corresponding to the sample task information, the second format and the label result text that conforms to the second format are determined. Based on the sample instruction text and the label result text, the task processing model is trained under the constraints of the sample task information of a variety of sample tasks, so that the task processing model has the ability to process different tasks and the task processing model has high versatility. At the same time, through training under the fixed format constraints of the first format and the second format, the task processing model has the ability to refine the task processing of each sample task and the task processing model has high task processing accuracy. The training process is executed on the cloud-side device, which takes advantage of the high computing power and large storage of the cloud-side device, reduces the cost of task processing, and improves the training efficiency and training effect of the task processing model.
[0182] FIG5 shows a front-end interface diagram of a task processing method provided by an embodiment of this specification, as shown in FIG5 :
[0183] The front-end interface of the task processing platform includes input and output display areas, a task selection area, and an input box. The input and output display areas display the instruction text input into the task processing model in the first format and the task execution results (result text) output in the second format. The task selection area displays available tasks: extraction and classification, as well as label types for location entities, person name entities, events, question answers, topic classification, intent classification, sentiment classification, and question-answering tasks. Enter the target text "A place is really hot" in the input box, select the task type "Extraction" in the task selection area, then select the label type "Location Entity", and finally click the "Input" control. The input and output display areas display the instruction text in the first format: Input: A place is really hot; Extraction: Location. Based on the instruction text, the task processing model performs the location entity extraction task on the target text, generating the task execution result in the second format: Output: Location: A place. This task execution result is displayed in the input and output display areas.
[0184] The following further illustrates the task processing method provided in this specification using the application of the task processing method in a search engine as an example, in conjunction with FIG6 . FIG6 shows a flowchart of the processing process of a task processing method applied to a search engine provided in one embodiment of this specification, including the following specific steps:
[0185] Step 602: Obtain sample task texts and sample task information of multiple sample tasks.
[0186] Step 604: Construct a sample instruction text conforming to the first format based on the sample task text and the sample task information.
[0187] Step 606: Based on the sample task information and the sample label text corresponding to the sample task information, determine the second format and the label result text that conforms to the second format.
[0188] Step 608: Based on the sample instruction text, use the task processing model to execute the corresponding sample task on the sample task text to generate a prediction result text that conforms to the second format.
[0189] Step 610: Based on the prediction result text and the label result text, the task processing model is trained, and when the preset training end condition is met, a trained task processing model is obtained.
[0190] Step 612: Receive the target text input by the front end and the task information of the search task selected for the target text.
[0191] Step 614: Construct an instruction text conforming to the first format based on the target text and the task information.
[0192] Step 616: Based on the instruction text, use the task processing model to execute the target task on the target text, and generate a task execution result that conforms to the second format.
[0193] Step 618: Determine that the task execution result is the search keyword.
[0194] Step 620: Based on the search keyword, call the search engine, search for corresponding search results and feed them back to the front end.
[0195] In the embodiments of this specification, a multi-task unified pre-training method is adopted to train the task processing model, and the format of the instruction text and the format of the result text are fixed. The task execution results in a fixed format are used as search keywords for searching, which improves the search efficiency and search accuracy and enhances the user's search experience.
[0196] Corresponding to the above method embodiment, this specification also provides an embodiment of a task processing device. FIG7 shows a schematic diagram of the structure of a task processing device provided in one embodiment of this specification. As shown in FIG7 , the device includes:
[0197] The first receiving module 702 is configured to receive a target text inputted by a front-end and task information of a target task selected for the target text;
[0198] A first construction module 704 is configured to construct an instruction text conforming to a first format based on the target text and the task information;
[0199] The first generation module 706 is configured to execute the target task on the target text based on the instruction text using the task processing model to generate a task execution result that conforms to the second format, wherein the task processing model is trained based on the sample instruction text in the first format and the label result text in the second format, the sample instruction text includes the sample task text and the sample task information, and the second format is determined based on the sample task information and the label text corresponding to the sample task information.
[0200] Optionally, the task information of the target task includes a task type and a tag type;
[0201] Correspondingly, the first generating module 706 is further configured to:
[0202] The instruction text is input into the task processing model, and based on the label type, the target task corresponding to the task type is executed on the target text, a predicted text corresponding to the label type is generated, and a task execution result that conforms to the second format is determined based on the label type and the predicted text.
[0203] Optionally, the device further comprises:
[0204] The first training module is configured to obtain sample task texts and sample task information of multiple sample tasks; construct a sample instruction text that conforms to the first format based on the sample task texts and sample task information; determine a second format and a label result text that conforms to the second format based on the sample task information and the sample label text corresponding to the sample task information; based on the sample instruction text, use the task processing model to execute the corresponding sample task on the sample task text to generate a predicted result text that conforms to the second format; train the task processing model based on the predicted result text and the label result text, and obtain a trained task processing model when the preset training end conditions are met.
[0205] Optionally, the first training module is further configured to:
[0206] The sample instruction text is input into the task processing model, and based on the context of the sample instruction text, a predicted text corresponding to the sample task information is generated, and based on the sample task information and the predicted text, a predicted result text conforming to the second format is determined.
[0207] Optionally, the device further comprises:
[0208] The first screening module is configured to screen the sample task texts according to the quantity distribution of the sample task texts and a preset quantity balance strategy.
[0209] Optionally, the sample task information includes a sample task type;
[0210] Correspondingly, the first screening module is further configured to:
[0211] According to the sample task type, determine the quantity distribution of sample task texts of each sample task type; according to the quantity distribution of sample task texts of each sample task type, screen the sample task texts according to a preset first quantity balance strategy, wherein the first quantity balance strategy is a quantity balance strategy for the sample task type.
[0212] Optionally, the sample task information includes a sample tag type;
[0213] Correspondingly, the first screening module is further configured to:
[0214] According to the sample label type, the quantity distribution of the sample task texts corresponding to each sample label type is determined; based on the determined quantity distribution of the sample task texts corresponding to each sample label type, the sample task texts are screened according to a preset second quantity balance strategy, wherein the second quantity balance strategy is a quantity balance strategy for the sample label type.
[0215] Optionally, the sample task information includes target sample task information and reference sample task information, there is a semantic association relationship between the target sample task information and the reference sample task information, and the sample task text includes a sample label text corresponding to the target sample task information;
[0216] Correspondingly, the first training module is further configured to: construct a sample instruction text that conforms to the first format based on the sample task text, the target sample task information and the reference sample task information; determine the second format and construct a positive label result text that conforms to the second format based on the target sample task information and the sample label text corresponding to the target sample task information; construct a negative label result text that conforms to the second format based on the reference sample task information and the interference label text corresponding to the reference sample task information; and determine the label result text based on the positive label result text and the negative label result text.
[0217] Optionally, the device further comprises:
[0218] The first fine-tuning module is configured to obtain the fine-tuning task text and fine-tuning task information of the fine-tuning task; construct a fine-tuning instruction text that conforms to the first format based on the fine-tuning task text and the fine-tuning task information; determine the second format and construct a label result text that conforms to the second format based on the fine-tuning task information and the object text corresponding to the fine-tuning task information in the fine-tuning task text; based on the fine-tuning instruction text, use the trained task processing model to perform the corresponding fine-tuning task on the fine-tuning task text to generate a prediction result text that conforms to the second format; based on the prediction result text and the label result text, adjust the model parameters of the task processing model, and obtain a fine-tuned task processing model when the preset fine-tuning end conditions are met.
[0219] In the embodiment of this specification, the task processing model is obtained through supervised training in advance based on sample instruction text in a first format and label result text in a second format, and has learned the input instruction text in the first format and the output result in the second format. When the second format is determined based on sample task information and the label text corresponding to the sample task information, the task processing model can generate a task execution result that conforms to the second format and corresponds to the task information and the corresponding label text based on the task information of the instruction text. While executing the target task on the target text under different task information, it has the ability to refine specific task information, that is, the task processing has high versatility and high task processing accuracy.
[0220] The above is a schematic scheme of a task processing device of this embodiment. It should be noted that the technical scheme of the task processing device and the technical scheme of the task processing method described above are of the same concept. For details not described in detail in the technical scheme of the task processing device, please refer to the description of the technical scheme of the task processing method described above.
[0221] Corresponding to the above method embodiment, this specification also provides a task processing device embodiment. Figure 8 shows a schematic diagram of the structure of another task processing device provided in one embodiment of this specification. As shown in Figure 8, the device is applied to a cloud-side device and includes:
[0222] The second receiving module 802 is configured to receive the target text input by the front end and the task information of the target task selected for the target text;
[0223] The second construction module 804 is configured to construct an instruction text conforming to the first format based on the target text and the task information;
[0224] A second generation module 806 is configured to execute the target task on the target text using the task processing model based on the instruction text, and generate a task execution result conforming to a second format, wherein the task processing model is trained based on sample instruction text in the first format and labeled result text in the second format, the sample instruction text includes sample task text and sample task information, and the second format is determined based on the sample task information and the labeled text corresponding to the sample task information;
[0225] The feedback module 808 is configured to feed back the task execution result to the front end.
[0226] Optionally, the device further comprises:
[0227] The interaction module is configured to feed back the task execution results to the front end; receive the execution result feedback sent by the front end, wherein the execution result feedback is generated based on the task execution results; and adjust the model parameters of the task processing model based on the execution result feedback.
[0228] In an embodiment of the present specification, the task processing model is obtained through supervised training in advance based on sample instruction text in a first format and label result text in a second format, and has learned the input instruction text in the first format and the output result in the second format. When the second format is determined based on sample task information and the label text corresponding to the sample task information, the task processing model can generate a task execution result that conforms to the second format and corresponds to the task information and the corresponding label text based on the task information of the instruction text. While executing the target task on the target text under different task information, the task processing model has the ability to refine specific task information, that is, the task processing has high versatility and high task processing accuracy, and utilizes the advantages of the high computing power of the cloud-side device to reduce the cost of task processing and improve the efficiency of task processing.
[0229] The above is a schematic scheme of a task processing device of this embodiment. It should be noted that the technical scheme of the task processing device and the technical scheme of the task processing method described above are of the same concept. For details not described in detail in the technical scheme of the task processing device, please refer to the description of the technical scheme of the task processing method described above.
[0230] Corresponding to the above method embodiments, this specification also provides an embodiment of an entity recognition device. FIG9 shows a schematic diagram of the structure of an entity recognition device provided by one embodiment of this specification. As shown in FIG9 , the device includes:
[0231] The third receiving module 902 is configured to receive the target text input by the front end and the recognition task information of the recognition task selected for the target text;
[0232] The third construction module 904 is configured to construct an instruction text conforming to the first format based on the target text and the recognition task information;
[0233] The third generation module 906 is configured to perform a recognition task on the target text based on the instruction text using a task processing model to generate an entity recognition result that conforms to the second format, wherein the task processing model is trained based on a sample instruction text in the first format and a label result text in the second format, the sample instruction text includes a sample task text and sample task information, and the second format is determined based on the sample task information and the object text corresponding to the sample task information in the sample task text.
[0234] In the embodiment of this specification, the task processing model is obtained by pre-supervised training based on sample instruction text in a first format and label result text in a second format, and learns the input instruction text in the first format and the output result in the second format. When the second format is determined based on sample task information and the label text corresponding to the sample task information, the task processing model can generate an entity recognition result that conforms to the second format and corresponds to the recognition task information and the corresponding label text based on the recognition task information of the instruction text. While performing the target task on the target text under different task information, the task processing model has the ability to refine entity recognition for specific recognition task information, and has high versatility and high entity recognition accuracy.
[0235] The above is a schematic diagram of an entity recognition device according to this embodiment. It should be noted that the technical solution of this entity recognition device and the technical solution of the entity recognition method described above are based on the same concept. For details not described in detail in the technical solution of the entity recognition device, please refer to the description of the technical solution of the entity recognition method described above.
[0236] Corresponding to the above method embodiments, this specification also provides an embodiment of a data processing device for task processing. Figure 10 shows a schematic diagram of the structure of a data processing device for task processing provided by one embodiment of this specification. As shown in Figure 10, the device is applied to a cloud-side device and includes:
[0237] An acquisition module 1002 is configured to acquire sample task texts and sample task information of a plurality of sample tasks;
[0238] A construction module 1004 is configured to construct a sample instruction text conforming to a first format based on the sample task text and the sample task information;
[0239] Determining module 1006, configured to determine a second format and a label result text conforming to the second format based on the sample task information and the sample label text corresponding to the sample task information;
[0240] The generating module 1008 is configured to execute the corresponding sample task on the sample task text using the task processing model based on the sample instruction text, and generate a prediction result text conforming to the second format;
[0241] The training module 1010 is configured to train the task processing model based on the prediction result text and the label result text, and obtain a trained task processing model when a preset training end condition is met;
[0242] The sending module 1012 is configured to send the task processing model to the terminal device.
[0243] In the embodiments of this specification, based on the sample task text and the sample task information, a sample instruction text conforming to the first format is constructed, based on the sample task information and the sample label text corresponding to the sample task information, a second format and a label result text conforming to the second format are determined, based on the sample instruction text and the label result text, a task processing model is trained under the constraints of the sample task information of a variety of sample tasks, so that the task processing model has the ability to process different tasks, and the task processing model has high versatility. At the same time, through training under the fixed format constraints of the first format and the second format, the task processing model has the ability to refine the task processing of each sample task, and the task processing model has high task processing accuracy. The training process is executed on the cloud-side device, which takes advantage of the high computing power and large storage of the cloud-side device, reduces the cost of task processing, and improves the training efficiency and training effect of the task processing model.
[0244] The above is a schematic diagram of a data processing device for task processing according to this embodiment. It should be noted that the technical solution of the data processing device for task processing is identical to the technical solution of the data processing method for task processing described above. For details not described in detail in the technical solution of the data processing device for task processing, please refer to the description of the technical solution of the data processing method for task processing described above.
[0245] Figure 11 shows a block diagram of a computing device according to one embodiment of this specification. Components of the computing device 1100 include, but are not limited to, a memory 1110 and a processor 1120. The processor 1120 is connected to the memory 1110 via a bus 1130, and a database 1150 is used to store data.
[0246] The computing device 1100 also includes an access device 1140 that enables the computing device 1100 to communicate via one or more networks 1160. Examples of such networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 1140 may include one or more of any type of network interface (e.g., a network interface card (NIC)) whether wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, or a near field communication (NFC) interface.
[0247] In one embodiment of the present specification, the aforementioned components of the computing device 1100 and other components not shown in FIG11 may also be connected to each other, for example, via a bus. It should be understood that the computing device structure block diagram shown in FIG11 is for illustrative purposes only and does not limit the scope of this specification. Those skilled in the art may add or replace other components as needed.
[0248] Computing device 1100 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, personal digital assistant, laptop computer, notebook computer, netbook computer, etc.), a mobile phone (e.g., a smartphone), a wearable computing device (e.g., a smartwatch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or personal computer (PC). Computing device 1100 may also be a mobile or stationary server.
[0249] The processor 1120 is configured to execute the following computer-executable instructions, which, when executed by the processor, implement the steps of the above-mentioned task processing method, entity recognition method, or data processing method for task processing.
[0250] The above is a schematic diagram of a computing device according to this embodiment. It should be noted that the technical solution of this computing device is based on the same concept as the technical solutions of the aforementioned task processing method, entity recognition method, and task processing data processing method. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solutions of the aforementioned task processing method, entity recognition method, or task processing data processing method.
[0251] An embodiment of the present specification further provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the above-mentioned task processing method, entity recognition method, or task processing data processing method.
[0252] The above is a schematic diagram of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium is based on the same concept as the technical solutions of the aforementioned task processing method, entity recognition method, and task processing data processing method. 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 aforementioned task processing method, entity recognition method, or task processing data processing method.
[0253] An embodiment of the present specification further provides a computer program, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above-mentioned task processing method, entity recognition method or task processing data processing method.
[0254] The above is an illustrative solution of a computer program according to this embodiment. It should be noted that the technical solution of this computer program is based on the same concept as the technical solutions of the aforementioned task processing method, entity recognition method, and task processing data processing method. For details not described in detail in the technical solution of the computer program, please refer to the description of the technical solutions of the aforementioned task processing method, entity recognition method, or task processing data processing method.
[0255] The foregoing description of this specification describes specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0256] Computer instructions include computer program code, which may be in source code form, object code form, executable files, or some intermediate form. Computer-readable media may include any entity or device capable of carrying computer program code, recording media, USB flash drives, removable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signals, telecommunications signals, and software distribution media. It should be noted that the content of computer-readable media may be appropriately increased or decreased based on the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media does not include electric carrier signals and telecommunications signals.
[0257] It should be noted that for the aforementioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.
[0258] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0259] The preferred embodiments disclosed above are intended only to help illustrate this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and variations can be made based on the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that those skilled in the art can better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.
Claims
1. A task processing method, comprising: Receive a target text input by a front end and task information of a target task selected for the target text; Based on the target text and the task information, construct an instruction text conforming to a first format; Based on the instruction text, a task processing model is used to execute the target task on the target text to generate a task execution result that conforms to a second format, wherein the task processing model is trained based on sample instruction text in the first format and label result text in the second format, the sample instruction text includes sample task text and sample task information, and the second format is determined based on the sample task information and the label text corresponding to the sample task information.
2. The task processing method according to claim 1, wherein the task information of the target task includes a task type and a tag type; The step of executing the target task on the target text using the task processing model based on the instruction text to generate a task execution result conforming to the second format includes: The instruction text is input into a task processing model, and based on the label type, the target task corresponding to the task type is executed on the target text, a predicted text corresponding to the label type is generated, and a task execution result conforming to a second format is determined based on the label type and the predicted text.
3. The task processing method according to claim 1 or 2, before executing the target task on the target text using the task processing model based on the instruction text, further comprising: Obtain sample task texts and sample task information for a variety of sample tasks; Based on the sample task text and the sample task information, construct a sample instruction text conforming to a first format; Determining a second format and a label result text conforming to the second format based on the sample task information and the sample label text corresponding to the sample task information; Based on the sample instruction text, using the task processing model to execute the corresponding sample task on the sample task text, and generating a prediction result text conforming to the second format; The task processing model is trained based on the prediction result text and the label result text, and when a preset training end condition is met, a trained task processing model is obtained.
4. The task processing method according to claim 3, wherein based on the sample instruction text, using the task processing model to execute the corresponding sample task on the sample task text to generate a prediction result text conforming to the second format comprises: The sample instruction text is input into the task processing model, and based on the context of the sample instruction text, a predicted text corresponding to the sample task information is generated, and based on the sample task information and the predicted text, a predicted result text conforming to the second format is determined.
5. The task processing method according to claim 3, after obtaining sample task texts and sample task information of the plurality of sample tasks, further comprising: According to the quantity distribution of the sample task texts, the sample task texts are balanced according to the preset quantity balance strategy. to filter.
6. The task processing method according to claim 5, wherein the sample task information includes a sample task type; The screening of the sample task texts according to the quantity distribution of the sample task texts and the preset quantity balance strategy includes: Determining the quantity distribution of sample task texts of each sample task type according to the sample task type; According to the quantity distribution of the sample task texts of each sample task type, the sample task texts are screened according to a preset first quantity balance strategy, wherein the first quantity balance strategy is a quantity balance strategy for the sample task type.
7. The task processing method according to claim 5, wherein the sample task information includes a sample tag type; The screening of the sample task texts according to the quantity distribution of the sample task texts and the preset quantity balance strategy includes: According to the sample label type, determining the quantity distribution of sample task texts corresponding to each sample label type; According to the quantity distribution of the sample task texts corresponding to each sample label type, the sample task texts are screened according to a preset second quantity balance strategy, wherein the second quantity balance strategy is a quantity balance strategy for the sample label type.
8. The task processing method according to claim 1 or 2, before executing the target task on the target text using the task processing model based on the instruction text, further comprising: Get the fine-tuning task text and fine-tuning task information of the fine-tuning task; Based on the fine-tuning task text and the fine-tuning task information, construct a fine-tuning instruction text conforming to a first format; Based on the fine-tuning task information and the object text corresponding to the fine-tuning task information in the fine-tuning task text, determining a second format and constructing a label result text conforming to the second format; Based on the fine-tuning instruction text, using the trained task processing model to perform a corresponding fine-tuning task on the fine-tuning task text, to generate a prediction result text conforming to the second format; Based on the prediction result text and the label result text, the model parameters of the task processing model are adjusted, and when a preset fine-tuning end condition is met, a fine-tuned task processing model is obtained.
9. A task processing method, applied to a cloud-side device, comprising: Receive a target text input by a front end and task information of a target task selected for the target text; Based on the target text and the task information, construct an instruction text conforming to a first format; Based on the instruction text, the target task is executed on the target text using a task processing model to generate a task execution result conforming to a second format, wherein the task processing model is trained based on a sample instruction text in the first format and a label result text in the second format, the sample instruction text includes a sample task text and sample task information, and the second format is determined based on the sample task information and the label text corresponding to the sample task information; Feedback the task execution result to the front end.
10. The task processing method according to claim 9, after feeding back the task execution result to the front end, further comprising: Receiving execution result feedback sent by the front end, wherein the execution result feedback is generated based on the task execution result; Based on the execution result feedback, the model parameters of the task processing model are adjusted.
11. An entity recognition method, comprising: Receive a target text input by a front end and recognition task information of a recognition task selected for the target text; Based on the target text and the recognition task information, construct an instruction text conforming to a first format; Based on the instruction text, the recognition task is performed on the target text using a task processing model to generate an entity recognition result that conforms to a second format, wherein the task processing model is trained based on a sample instruction text in the first format and a label result text in the second format, the sample instruction text includes a sample task text and sample task information, and the second format is determined based on the sample task information and an object text corresponding to the sample task information in the sample task text.
12. A data processing method for task processing, applied to a cloud-side device, comprising: Obtain sample task texts and sample task information for a variety of sample tasks; Based on the sample task text and the sample task information, construct a sample instruction text conforming to a first format; Determining a second format and a label result text conforming to the second format based on the sample task information and the sample label text corresponding to the sample task information; Based on the sample instruction text, using the task processing model to execute the corresponding sample task on the sample task text, and generating a prediction result text conforming to the second format; Based on the prediction result text and the label result text, the task processing model is trained, and when a preset training end condition is met, a trained task processing model is obtained; The task processing model is sent to the terminal side device.
13. A computing device comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the method described in any one of claims 1 to 12 are implemented.
14. A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions, when executed by a processor, implement the steps of the method according to any one of claims 1 to 12.
15. A computer program comprising computer instructions, which, when executed by a processor, implement the steps of the method according to any one of claims 1 to 12.
Citation Information
Patent Citations
NLU task processing method and system, electronic equipment and storage medium
CN114154482A
Text processing model training method, text processing method and related equipment
CN116151236A
Task processing method, entity identification method and data processing method for task processing
CN117291185A
Method and apparatus of training natural language processing model, and method and apparatus of processing natural language
US20220293092A1
Method for generating pre-trained language model, electronic device and storage medium
US20220350965A1
Cited By
Activity assessment method for factual knowledge question, product, equipment and medium
CN120180060A
Methods, products, equipment and media for assessing the ability to answer factual knowledge questions
CN120180060B