Task processing method and server

By continuing pre-training using hybrid pre-training data from vertical and general fields on large language models and fine-tuning training, the problem of large language models performing poorly on vertical fields tasks is solved, significantly improving the quality of processing results.

WO2025060612A1PCT designated stage expired Publication Date: 2025-03-27ALIBABA (CHINA) CO LTD

Patent Information

Application Number
PCT/CN2024/104632
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-09-18
Filing Date
2024-07-10
Publication Date
2025-03-27

AI Technical Summary

Technical Problem

The large language model performs poorly on various tasks in the vertical field, and the quality of the generated processing results is low.

Method used

By using mixed pre-training data from vertical and general fields, the pre-trained model continues to pre-train the pre-trained domain basic model, and then fine-tune the domain basic model using the vertical field data set to obtain the domain model suitable for vertical fields.

Benefits of technology

It enhances the model's text understanding and generation ability in the vertical field, and improves the generation quality of task processing results when the model is applied to various NLP tasks in the vertical field.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024104632_27032025_PF_FP_ABST
    Figure CN2024104632_27032025_PF_FP_ABST
Patent Text Reader

Abstract

The present application provides a task processing method and a server. According to the method of the present application, mixed pre-training data in the vertical field and the general field is used to continue pre-training a pretrained model to obtain a pre-trained domain foundation model; on the basis of keeping original strong semantic understanding and representation capability of the pre-trained model as much as possible, the model is made to be familiar with the characteristics of the text format and data distribution in the vertical field, and more knowledge of the vertical field is injected into the model, thereby enhancing the text understanding and generation capability of the model in the vertical field; then a data set in the vertical field is used to perform fine tuning training on the domain foundation model to obtain a domain model suitable for the vertical field, so that a domain model general for various natural language processing (NLP) tasks in the vertical field can be obtained, and the text understanding and generation capability of the model in the vertical field is improved, thereby improving the generation quality of task processing results when the model is applied to various NLP tasks in the vertical field.
Need to check novelty before this filing date? Find Prior Art

Description

Task processing method and server

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on September 18, 2023, with application number 202311205678.9 and application name “Task Processing Method and Server”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to computer technology, and in particular to a task processing method and server. Background Art

[0003] Natural language processing (NLP) technology has developed rapidly in recent years. Deep learning models for NLP, such as the Large Language Model (LLM), have unified diverse NLP tasks into a text generation paradigm, achieving promising results across a wide range of NLP tasks.

[0004] However, mainstream deep learning models for NLP (such as LLM) perform poorly on various tasks in vertical fields (such as e-commerce, healthcare, education, technology, finance, etc.), and the quality of generated processing results is low.

[0005] Summary of the Invention

[0006] This application provides a task processing method and server to solve the problem that large language models perform poorly on various tasks in vertical fields and generate low-quality processing results.

[0007] In the first aspect, the present application provides a task processing method, comprising: using mixed pre-training data of vertical fields and general fields to continue pre-training the pre-trained model to obtain a pre-trained domain basic model; using the data set of the vertical field to fine-tune the domain basic model to obtain a domain model suitable for the vertical field, and the domain model is used to perform natural language processing tasks in the vertical field and generate corresponding task processing results.

[0008] On the second aspect, the present application provides a task processing method, including: using mixed pre-training data from the e-commerce field and the general field to continue pre-training the pre-trained large model to obtain a pre-trained basic large model in the e-commerce field; using a data set in the e-commerce field to fine-tune the basic large model in the e-commerce field to obtain an e-commerce field large model, and the e-commerce field large model is used to perform natural language processing tasks in the e-commerce field and generate corresponding task processing results.

[0009] In the third aspect, the present application provides a task processing method, which is applied to a server, including: receiving a call request for a domain model sent by an end-side device, the call request including a task instruction, and the task instruction is generated based on the task prompt format information and input data of the natural language processing task to be executed; inputting the task instruction into the domain model, performing task processing based on the task instruction through the domain model, and generating a task processing result, wherein the domain model uses a mixture of vertical and general domain pre-training data, continues to pre-train the pre-trained model to obtain a pre-trained domain basic model, and then uses the vertical domain data set to fine-tune the domain basic model; and returns the task processing result to the end-side device.

[0010] In a fourth aspect, the present application provides a server comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the server to execute the method described in any one of the above aspects.

[0011] The task processing method and server provided in this application continue to pre-train the pre-trained model by using mixed pre-training data from vertical and general fields to obtain a pre-trained domain basic model. While maintaining the original powerful semantic understanding and representation capabilities of the pre-trained model as much as possible, the model is made familiar with the text format and data distribution characteristics of the vertical field, and more vertical field knowledge is injected into the model, thereby enhancing the model's text understanding and generation capabilities in the vertical field; then, the vertical field data set is used to fine-tune the domain basic model to obtain a domain model suitable for the vertical field. A domain model that is common to various natural language processing tasks in the vertical field can be obtained, thereby improving the model's text understanding and generation capabilities in the vertical field, thereby improving the generation quality of task processing results when the model is applied to various NLP tasks in the vertical field. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0013] FIG1 is a schematic diagram of an exemplary system architecture applicable to the present application;

[0014] FIG2 is a schematic diagram of another example system architecture applicable to the present application;

[0015] FIG3 is a flowchart of a task processing method provided by an exemplary embodiment of the present application;

[0016] FIG4 is a flowchart of constructing pre-training data for a vertical field according to an exemplary embodiment of the present application;

[0017] FIG5 is a flowchart of constructing a vertical field multi-task instruction dataset provided by an exemplary embodiment of the present application;

[0018] FIG6 is a schematic diagram of a fine-tuning training framework for multi-task instruction data provided by an exemplary embodiment of the present application;

[0019] FIG7 is a framework diagram of obtaining a domain model for a vertical domain provided by an exemplary embodiment of the present application;

[0020] FIG8 is a flow chart of a task processing method in the e-commerce field provided by an exemplary embodiment of the present application;

[0021] FIG9 is a flowchart of implementing task processing based on a domain model according to an exemplary embodiment of the present application;

[0022] FIG10 is a flowchart of implementing task processing based on a domain model according to another exemplary embodiment of the present application;

[0023] FIG11 is a schematic diagram of a process framework of a product comparison task provided by an exemplary embodiment of the present application;

[0024] FIG12 is a flow chart of a product comparison method provided by an exemplary embodiment of the present application;

[0025] FIG13 is an example diagram of an interface for displaying product comparison results provided by an exemplary embodiment of the present application;

[0026] FIG14 is a schematic diagram of the structure of a server provided by an exemplary embodiment of the present application.

[0027] The above drawings illustrate specific embodiments of the present application, which will be described in more detail below. These drawings and the textual description are not intended to limit the scope of the present application in any way, but rather to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION

[0028] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.

[0029] It should be noted that the user information (including but not limited to user device information, user attribute information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application 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 relevant laws, regulations and standards, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0030] First, let’s explain the terms involved in this application:

[0031] Large Language Model (LLM): A deep neural network model with huge parameters trained using a large amount of text, which can understand and generate natural language text. It is also called a large-scale language model or large language model.

[0032] Pre-trained large model: A pre-trained model obtained by pre-training large models such as large-scale language models (LLMs).

[0033] Domain-based pre-training: Based on a pre-trained model in a general domain, continue pre-training on unlabeled corpus in a specific domain using the same or similar pre-training tasks.

[0034] Vertical sector: An internet industry term that refers to a specific area of ​​business that provides services to a limited group of people. This includes e-commerce, entertainment, healthcare, environmental protection, education, sports, and other fields. A vertical sector is a sub-segment within a larger sector.

[0035] General domain: In this application, the general domain is a concept that is opposite to the vertical domain. The general domain encompasses multiple domains and can cover multiple vertical domains. It can be understood as a relatively common or common domain with a large amount of existing corpus data. The data in the general domain can cover data in one or more vertical domains.

[0036] Multi-task instruction fine-tuning: Fine-tuning training based on multi-task instruction data is a method for fine-tuning pre-trained models. The trained model can correctly respond to task instructions given by humans, thereby better solving various task instruction-driven tasks.

[0037] Named Entity Recognition (NER): Identify named entities with specific meanings from text.

[0038] Relation Extraction (RE): Identify the relationship between text fragments from the text.

[0039] Chain of Thought (CoT) is a method for performing complex reasoning by providing a natural language description of the reasoning steps and gradually deriving the final result. For example, in a product comparison task, given the relevant information of two products, the two products are compared and a recommendation is given that meets the user's needs. A chain of thought to solve this task could be: based on the information of the two products, the characteristics, similarities, and differences of the two products are given respectively, and then the advantages of the two products are described, and finally, the recommended product is given based on the user's needs. The chain of thought method allows the model to perform task reasoning step by step, and then provides the final result while also explaining the important reasoning process.

[0040] Visual question answering task: Given an input image and a question, determine the answer to the question from the visual information of the input image.

[0041] Image description task: Generate description text for the input image.

[0042] Visual entailment task: predict the semantic relevance of an input image and text, i.e., entailment, neutrality, or contradiction.

[0043] Referential expression and comprehension task: locate the image area corresponding to the input information in the input image based on the input information.

[0044] Image generation task: Generate an image based on the input description text.

[0045] Text-based sentiment classification task: predict the sentiment classification information of the input information.

[0046] Text summarization task: Generate summary information of input information.

[0047] Multimodal tasks: refers to downstream tasks whose input and output data involve multiple modal data such as images and text, such as visual question answering tasks, image description tasks, visual implication tasks, referential expression and understanding tasks, image generation tasks, etc.

[0048] Multimodal pre-trained model: refers to a pre-trained model whose input and output data involve multiple modal data such as images and text. After fine-tuning and training, it can be applied to multimodal task processing.

[0049] Large models refer to deep learning models with large-scale model parameters, typically containing hundreds of millions, tens of billions, or even hundreds of billions of model parameters. Large models, also known as foundation models (FMs), are pre-trained on large, unlabeled corpora, producing pre-trained models with over 100 million parameters. These models are adaptable to a wide range of downstream tasks and exhibit good generalization capabilities. Examples include large language models (LLMs) and multi-modal pre-training models.

[0050] Large models can be widely used in fields such as natural language processing and computer vision. 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.

[0051] Commonly used pre-trained models in the field of natural language processing (such as pre-trained language models and pre-trained large language models) have powerful natural language understanding capabilities. Based on the generative capabilities of pre-trained models, they can perform various natural language processing tasks such as information extraction (such as named entity recognition (NER) and relation extraction (RE), text classification, and text generation. They are widely used in various scenarios such as e-commerce, healthcare, intelligent transportation, online education, and digital assistants. For example, in the e-commerce field, they can realize intelligent question-and-answer (Q&A) of product-related information, product comparison, and product search, while in the online education field, they can realize intelligent customer service of education-related knowledge and text subject content extraction.

[0052] However, the general multi-task pre-training models in the field of natural language processing are obtained through pre-training based on general-domain pre-training data. Since the scale of the labeled data used for fine-tuning training is very small, the models obtained through fine-tuning training using a small amount of fine-tuning data still perform unsatisfactorily on various tasks in vertical fields (such as e-commerce, medical care, education, technology, etc.), and the quality of the generated processing results is low.

[0053] Taking e-commerce as an example, due to its enormous commercial value, many researchers are researching how to use natural language processing (NLP) to solve numerous problems in this area, such as extracting product information, understanding user queries, generating product content, and enabling intelligent customer service conversations. However, general-purpose large language models (LLMs) are not well suited to solving various NLP tasks in the e-commerce sector. This is because e-commerce text has the following characteristics compared to general-purpose text:

[0054] Many e-commerce texts are not coherent and fluent sentences, but rather have unique structures. For example, product titles are often a continuous concatenation of key entities or concepts, while product attribute lists are often semi-structured lists of key-value pairs, not complete sentences. This creates significant difficulties for general LLMs to understand e-commerce texts.

[0055] 2. The e-commerce domain contains a large number of novel entities and concepts. The distribution of these entities and concepts differs significantly from that of general text and is subject to rapid updates as products and trends change. For example, the e-commerce domain has many unique brands and merchant names, and the meaning behind these entities may differ from their literal meaning.

[0056] Based on the above-mentioned unique characteristics of text in the e-commerce field, the quality of the task processing results generated by the pre-training model obtained by training with pre-training data in general fields is still low after fine-tuning training with a small amount of fine-tuning data when applied to natural language processing tasks in the e-commerce field.

[0057] In response to the aforementioned technical problems, this application provides a task processing method, which uses mixed pre-training data from vertical and general fields to continue pre-training the pre-training model to obtain a pre-trained domain basic model. On the basis of maintaining the original powerful semantic understanding and representation capabilities of the pre-training model as much as possible, the model is made familiar with the text format and data distribution characteristics of the vertical field, and more vertical field knowledge is injected into the model, thereby enhancing the model's text understanding and generation capabilities in the vertical field; then, using the vertical field data set, the domain basic model is fine-tuned and trained to obtain a domain model suitable for the vertical field. A domain model that is common to various natural language processing tasks in the vertical field can be obtained, and the model's text understanding and generation capabilities in the vertical field can be improved, thereby improving the generation quality of the task processing results when the model is applied to various NLP tasks in the vertical field. Among them, the pre-training model can be a model applied to natural language processing, such as various pre-trained language models, pre-trained large language models, etc.

[0058] In this application, to distinguish it from pre-training data, the dataset used for fine-tuning training is referred to as the "fine-tuning dataset." Typically, the dataset used for pre-training is data without annotation information, while the data used for fine-tuning training is data with annotation information. In this application, when fine-tuning the domain-based model, a vertical domain fine-tuning dataset is used.

[0059] Figure 1 is a schematic diagram of an example system architecture applicable to this application. As shown in Figure 1, the system architecture includes a server and a terminal device. A communication link is provided between the server and the terminal device, enabling communication between the server and the terminal device.

[0060] Among them, the server is a device with computing capabilities deployed in the cloud or locally, such as a cloud cluster. The server stores pre-trained models, pre-built mixed pre-trained data for vertical and general fields, and fine-tuning datasets for vertical fields. The server is responsible for first using the mixed pre-trained data for vertical and general fields to continue pre-training the pre-trained model to obtain a pre-trained domain basic model; then using the fine-tuning dataset for the vertical field, fine-tuning the domain basic model to obtain a domain model suitable for the vertical field. The domain model can be applied to various natural language processing tasks in vertical fields, including but not limited to information extraction (such as named entity recognition NER, relation extraction RE, etc.), text classification, text generation and other tasks. Among them, different types of tasks use different task prompt format information, and the task prompt format information is used to indicate the task requirements, input data and output results to be performed by the domain model.

[0061] The end-side device can be an electronic device running a downstream application system, specifically a hardware device with network communication, computing, and information display functions, including but not limited to smartphones, tablets, desktop computers, local servers, cloud servers, etc. When the end-side device runs a downstream application system, it is necessary to use the natural language processing capabilities of the domain model. For example, the downstream application system running on the end-side device can implement intelligent question-answering, information extraction, text classification, and text summarization in a vertical field. When implementing at least one function of the downstream application system, it is necessary to use the natural language processing capabilities of the domain model in that vertical field.

[0062] Based on the system architecture shown in Figure 1, when a natural language processing task in a vertical domain needs to be executed, the end-side device obtains the input data and the task prompt format information of the natural language processing task, generates a task instruction based on the task prompt format information and the input data, and sends a call request for the domain model to the server, where the call request includes the task instruction. The server receives the call request, obtains the task instruction to be executed, inputs the task instruction into the domain model of the vertical domain, performs task processing based on the task instruction through the domain model, generates the task processing result, and returns the task processing result to the end-side device. The end-side device receives the task processing result returned by the server, and continues to execute the processing logic of the downstream application system based on the task processing result to realize the functions of the downstream application system.

[0063] FIG2 is a schematic diagram of another example system architecture applicable to this application. As shown in FIG2 , the system architecture includes a server and a model service. The server and the model service have a communication link that enables communication between the server and the model service.

[0064] The model service is a service that can provide pre-trained models. The model service can provide the server with download information for the pre-trained model. The server then downloads the pre-trained model from the model service to its local computer based on the download information. Alternatively, the server can send a pre-trained model request to the model service, and the model service responds to the pre-trained model request by sending the pre-trained model to the server. Furthermore, the server can also obtain the pre-trained model from the model service through other interactive methods, which are not specifically limited here.

[0065] The server can be a device with computing capabilities deployed in the cloud or locally by various institutions or system platforms, such as a cloud cluster, a local server, etc. The server model service obtains the pre-trained model and stores pre-built mixed pre-trained data of vertical and general fields, and fine-tuning datasets of vertical fields. The server is responsible for first using the mixed pre-trained data of vertical and general fields to continue pre-training the pre-trained model to obtain a pre-trained domain basic model; then using the fine-tuning dataset of the vertical field, fine-tuning the domain basic model to obtain a domain model suitable for the vertical field. The domain model can be applied to various natural language processing tasks in the vertical field, including but not limited to information extraction (such as named entity recognition NER, relation extraction RE, etc.), text classification, text generation and other tasks. Among them, different types of tasks use different task prompt format information, and the task prompt format information is used to indicate the task requirements, input data and output results to be performed by the domain model.

[0066] Based on the architecture shown in Figure 2, the server also runs downstream application systems that utilize domain models for vertical domains. When the server runs a downstream application system and needs to perform a natural language processing task in the vertical domain, it obtains the input data and the task prompt format information for the natural language processing task. Based on the task prompt format information and the input data, it generates a task instruction. The task instruction is input into the domain model for the vertical domain. The domain model then executes the task processing based on the task instruction, generates a task processing result, and returns the task processing result to the downstream application system. Based on the task processing result, the server continues to execute the subsequent processing logic of the downstream application system to implement the functionality of the downstream application system.

[0067] The following specific embodiments describe in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0068] FIG3 is a flowchart of a task processing method provided by an exemplary embodiment of the present application. The execution subject of this embodiment is the server in the system architecture shown in FIG1 or FIG2. The method of this embodiment aims to continue pre-training and fine-tuning the pre-trained model according to the specific vertical field to which the user belongs, and obtain a domain model suitable for the specific vertical field. As shown in FIG3, the specific steps of the method are as follows:

[0069] Step S31: Use mixed pre-training data of vertical fields and general fields to continue pre-training the pre-training model to obtain a pre-trained domain basic model.

[0070] Among them, the pre-trained model can be a model applied to natural language processing, such as various pre-trained language models, pre-trained large language models, etc.

[0071] In this embodiment, vertical domains refer to specific fields to which pre-trained models need to be applied based on actual application scenarios, such as e-commerce, healthcare, transportation, and sports. General domains are the opposite of vertical domains. General domains can be understood as relatively common or common fields with a large amount of existing corpus data. General domains typically encompass multiple fields and can cover a variety of vertical fields.

[0072] Pre-training data for vertical fields refers to data used for model pre-training based on data in vertical fields. Pre-training data for general fields refers to data used for model pre-training based on data in general fields.

[0073] The method for constructing pre-training data for general domains is the same as the method for constructing training data used in the pre-training phase of the pre-training model, and will not be further described here. In addition, the pre-training data for general domains can directly adopt the training data used in the pre-training phase of the pre-training model.

[0074] The construction method of pre-training data in vertical fields is similar to that of pre-training data in general fields. The difference is that the data sources used are different. The pre-training data in vertical fields are constructed only based on data from vertical fields, while the pre-training data in general fields are constructed based on data from general fields. However, the construction process is the same, and the specific method can be consistent with the construction method of training data used in the pre-training stage of the pre-training model, which will not be repeated here.

[0075] Mixed pre-training data for vertical and general domains is obtained by mixing pre-training data for vertical and general domains. Specifically, the pre-training data for vertical and general domains can be combined into a training set, which is used as a training set for further pre-training of the pre-trained model. The training set contains mixed pre-training data for vertical and general domains.

[0076] Optionally, for the training set obtained by merging the pre-training data of the vertical field and the general field, the order of the training data in the training set can be further disrupted so that the pre-training data of the vertical field and the general field are fully mixed, which can improve the training effect of the pre-training model in the field.

[0077] It should be noted that when constructing mixed pre-training data for vertical and general fields, the proportion of pre-training data in the vertical field should not be too small or too large. If the proportion of pre-training data in the vertical field is too small, the model will not be able to learn sufficient knowledge in the vertical field, affecting the model's text understanding and generation capabilities in the vertical field. If the proportion of pre-training data in the vertical field is too large, the model will not be able to better maintain the original powerful semantic understanding and representation capabilities of the pre-training model, which will also affect the model's text understanding and generation capabilities in the vertical field. The proportion of pre-training data in the vertical field is about 1 / 2, and the vertical field and the general field are mixed in a ratio of about 1:1. The obtained mixed pre-training data is used to continue pre-training the pre-training model. On the basis of maintaining the original powerful semantic understanding and representation capabilities of the pre-training model as much as possible, the model can be familiar with the text format and data distribution characteristics of the vertical field, and inject more vertical field knowledge into the model, thereby enhancing the model's text understanding and generation capabilities in the vertical field. In some embodiments, the training samples in the mixed pre-training data are unsupervised texts, that is, the training samples are sample texts without labels.

[0078] In this step, the pre-trained model is further pre-trained using a mixture of pre-trained data from the vertical domain and the general domain to obtain a pre-trained domain-based model. This continued pre-training process can use the same training method as the pre-trained model. Of course, the continued pre-training of the pre-trained model in this step can also use a different training method than the pre-training of the pre-trained model.

[0079] In this step, you can use mixed pre-training data from vertical and general fields to perform any of the following pre-training tasks on the pre-trained model: Causal Language Model (CLM) task, Masked Language Modeling task, to continue pre-training the pre-trained model and obtain a pre-trained domain basic model.

[0080] Among them, the causal language modeling task includes the forward causal language modeling task and the reverse causal language modeling task. The mixed pre-training data contains multiple training samples, and each training sample contains multiple words (also called word segmentations, tokens). The forward causal language modeling task is a modeling task of predicting the word after the training sample from the word before the training sample. The reverse causal language modeling task is a modeling task of predicting the word before the training sample from the word after the training sample. The masked language modeling task is a modeling task of predicting the word in the masked position in the training sample from the word in the non-masked position in the training sample.

[0081] Exemplarily, in this step, mixed pre-training data from vertical and general fields can be used to perform causal language modeling pre-training tasks (such as forward causal language modeling pre-training tasks, or reverse causal language modeling pre-training tasks) on the pre-trained model to continue pre-training the pre-trained model and obtain a pre-trained domain basic model.

[0082] Taking the forward causal language modeling pre-training task as an example, the server samples training samples from the mixed pre-training data, performs word segmentation on the training samples, and obtains each word in the training sample. The server then determines the word vector corresponding to each word in the training sample and encodes each word vector using the pre-training model to obtain the encoding vector for each word vector. Furthermore, for each word in the training sample, the server predicts the forward prediction for that word based on the encoding vector of that word and the encoding vectors of the historical words. That is, the forward prediction for that word is the word in the training sample that follows and is adjacent to it. The historical word is the word that precedes the word in the training sample. Exemplarily, the pre-trained model predicts and outputs the first word X1 based on the Begin-Of-Sentence (BOS) in the training sample, which is used to identify the beginning of the training sample. Then, the second word X2 is predicted and output based on the BOS and the first word X1. Then, the third word X3 is predicted and output based on the BOS, the first word X1, and the second word X2. And so on, until the last word or the End-Of-Sentence (EOS) is output based on the BOS and the previous words. Further, a forward pre-training loss function is determined based on the forward prediction result, and the forward pre-training loss function represents the loss function of the forward causal language modeling pre-training task.

[0083] In this step, the pre-trained model is further pre-trained by using mixed pre-training data from vertical and general fields. While maintaining the original powerful semantic understanding and representation capabilities of the pre-trained model as much as possible, the model is made familiar with the text format and data distribution characteristics of the vertical field, and more vertical field knowledge is injected into the model, thereby enhancing the model's text understanding and generation capabilities in the vertical field.

[0084] Step S32: Use the vertical domain dataset to fine-tune the domain basic model to obtain a domain model suitable for the vertical domain. The domain model is used to perform natural language processing tasks in the vertical domain and generate corresponding task processing results.

[0085] In this embodiment, to distinguish it from pre-training data, the data set used for fine-tuning training is referred to as a “fine-tuning data set.” Typically, the data set used for pre-training is data without annotation information, while the data used for fine-tuning training is data with annotation information.

[0086] After using mixed pre-training data from vertical and general domains to continue pre-training the pre-trained model and obtaining a pre-trained domain basic model, the domain basic model can be fine-tuned using a fine-tuning dataset from the vertical domain to obtain a domain model suitable for the vertical domain. By fine-tuning the domain basic model, the final domain model can be better suited for natural language processing tasks in the vertical domain, thereby further improving the performance of the model.

[0087] The method of this embodiment uses mixed pre-training data from vertical and general fields to continue pre-training the pre-trained model to obtain a pre-trained domain basic model. While maintaining the original powerful semantic understanding and representation capabilities of the pre-trained model as much as possible, the model is made familiar with the text format and data distribution characteristics of the vertical field, and more vertical field knowledge is injected into the model, thereby enhancing the model's text understanding and generation capabilities in the vertical field; further, the domain basic model is fine-tuned using a fine-tuning dataset in the vertical field to obtain a domain model suitable for the vertical field, so that the final domain model can be better applied to natural language processing tasks in the vertical field, further improving the performance of the model, thereby greatly improving the generation quality of task processing results when the model is applied to various NLP tasks in the vertical field.

[0088] In an optional embodiment, in step S31, the server pre-constructs mixed pre-training data of the vertical field and the general field to continue pre-training the pre-training model, and before obtaining the pre-trained domain basic model, the server pre-constructs mixed pre-training data of the vertical field and the general field. Specifically, it can be implemented as follows: construct pre-training data for the vertical field, and mix the pre-training data of the vertical field with the pre-training data of the general neighborhood according to a preset mixing method to obtain mixed pre-training data. Among them, the preset mixing method is a pre-configured mixing method used to mix the pre-training data of the vertical field and the general field. In this embodiment, a variety of available mixing methods and specific mixing rules corresponding to each mixing method are pre-configured. In actual application, the user can select one of the mixing methods as the preset mixing method used according to his own application needs.

[0089] Exemplarily, when the user triggers the selection of a hybrid mode, the server displays the configured hybrid modes through the hybrid mode configuration interface, and displays the hybrid rules corresponding to the various hybrid modes. The user can browse the configured hybrid modes and corresponding hybrid rules through the hybrid mode configuration interface, and select a hybrid mode that suits their own application needs as the preset hybrid mode used in the model training process for obtaining a domain model in a vertical field. The user can select one of the hybrid modes and trigger the selection operation. In response to the selection operation of any hybrid mode, the server will use the selected hybrid mode as the preset hybrid mode currently in use. The selection operation can be that the user clicks on the "Select" control in the interface, or the user triggers the selection operation of the hybrid mode by clicking on a hybrid mode displayed on the interface. In addition, the selection operation can also be implemented in other ways with similar functions to selecting an option, which is not specifically limited here.

[0090] In this embodiment, users are supported to edit and update the mixing rules corresponding to configured mixing modes. Specifically, the server displays the configured mixing modes and the mixing rules corresponding to various mixing modes through a mixing mode configuration interface. Users can edit the mixing rules corresponding to one or more mixing modes displayed in the mixing mode configuration interface to modify the specific mixing rules corresponding to the mixing mode.

[0091] In response to an edit operation on the mixing rules corresponding to any mixing mode, the server obtains the new mixing rules of the edited mixing mode and updates the mixing rules corresponding to the mixing mode. Furthermore, the user can select the mixing mode with the updated mixing rules as the preset mixing mode used in the model training process for obtaining the domain model of the vertical domain.

[0092] Alternatively, a typical blending method involves blending the pre-trained data for the vertical domain with the pre-trained data for the general neighborhood according to a preset blending ratio to obtain blended pre-trained data. The blending rule corresponding to this blending method is configured with a preset blending ratio. The preset blending ratio is the pre-configured blending ratio of the pre-trained data for the vertical domain and the general domain. The specific value can be configured and adjusted based on the needs of the actual application scenario and is not specifically limited here. A preset blending ratio of 1:1 or close to 1:1 can achieve good training results. The specific value can be configured and adjusted based on the needs of the actual application scenario and is not specifically limited here. For example, the preset blending ratio can be configured as 1:1, 2:3, 2:1, etc. Furthermore, the server sets a default value for the preset blending ratio, and technicians can adjust and update the currently configured preset blending ratio based on the needs of the actual application scenario. The default value of the preset blending ratio can be 1:1 or other values. Furthermore, based on different blending ratios, multiple blending methods can be configured based on the proportions, allowing users to select the blending ratio that suits their application needs.

[0093] In practical applications, a vertical domain can include multiple sub-domains. For example, a vertical domain could be e-commerce, encompassing sub-domains such as product search, product comparison, image search, and short video display. Pre-training data for a vertical domain includes pre-training data for multiple sub-domains. Another typical hybrid approach is to combine pre-training data from the sub-domains corresponding to the application domain of the domain model with pre-training data from the general domain to generate hybrid pre-training data. This hybrid approach can enhance the data characteristics of the sub-domains, enabling the trained domain model to better learn the data characteristics of the sub-domains and better adapt to the specific application domain.

[0094] For example, if the user can determine that the specific application field of the domain model in the e-commerce field is the product comparison segment, then in the pre-training stage of the domain model, a mixed pre-training data of the product comparison segment and the pre-training data of the general field can be used. This can enable the model to learn the data characteristics of the product comparison segment, and improve the performance and generation quality of the obtained domain model when applied to the product comparison task.

[0095] In an optional embodiment, pre-training data for a vertical field can be constructed in the following manner:

[0096] Step S1: Collect various types of sample data in vertical fields.

[0097] In this step, a large amount of sample data in the vertical field is collected according to the vertical field of the model application. Depending on the tasks performed by the domain model, the modality of the sample data input to the model can be different. For multimodal tasks, the model input data usually includes samples of multiple different modalities, including but not limited to text, pictures, videos, and codes. In this step, sample data of one or more modalities in the vertical field can be collected specifically according to the modality of the input data of the task performed by the model. Among them, different types of sample data refer to the source type of the sample data, such as sample data from different data platforms, and different data platforms correspond to different types.

[0098] Step S2: Perform data cleaning on various types of sample data to obtain various types of input samples in vertical fields.

[0099] In this step, data cleaning is performed on various types of sample data collected in vertical fields to obtain sample data with higher quality as input samples, thereby ensuring the quality of the input samples. Specifically, data cleaning is performed on various types of sample data, at least including filtering and deduplication of sample data. In addition, the quality of sample data can also be improved by other commonly used data cleaning methods to obtain higher quality input samples, which is not specifically limited in this embodiment. In addition, different filtering rules can be used for filtering sample data of different modalities, which can be set and adjusted according to the needs of the actual application scenario, which is not specifically limited here. For example, for pictures, pictures containing text content that does not meet the requirements can be filtered out, or pictures whose colors do not meet the preset requirements can be filtered out, and so on. The pictures that do not meet the text content requirements and do not meet the preset requirements can be configured according to the actual application scenario, which is not specifically limited here.

[0100] In an optional embodiment, sampling weights for different types of input samples can be configured. The sampling weights for different types of input samples can be determined based on the quality and scale of the input samples. The configuration and adjustment can be made by relevant technicians based on the quality and / or scale of the input samples, combined with empirical values, and are not specifically limited here.

[0101] For example, if the quality of a certain type of input sample is high, a larger sampling weight is set for the input sample of that type; if the quality of a certain type of input sample is low, a smaller sampling weight is set for the input sample of that type, thereby improving the quality of the input samples participating in continued pre-training. If the scale of a certain type of input sample is large, a smaller sampling weight is set for the input sample of that type; if the scale of a certain type of input sample is small, a larger sampling weight is set for the input sample of that type, thereby improving the diversity of the input samples participating in continued pre-training.

[0102] When continuing to pre-train the pre-trained model using various types of input samples from a vertical field, batch sampling is performed based on the sampling weights of different types of input samples, and the pre-trained model is iteratively trained using the sampled input samples. Input samples with larger sampling weights are more likely to be sampled for continued pre-training, while input samples with smaller sampling weights are less likely to be sampled for continued pre-training. This can improve the quality and diversity of input samples used for continued pre-training, and enhance model training results.

[0103] In an optional embodiment, the pre-trained model is a pre-trained language model. In the continued pre-training stage, mixed pre-training data of vertical and general fields is used to perform a causal language modeling pre-training task (such as a forward causal language modeling pre-training task or a reverse causal language modeling pre-training task) on the pre-trained model to achieve continued pre-training of the pre-trained model to obtain a pre-trained domain basic model. Taking this scenario as an example, as shown in FIG4 , the specific steps of constructing pre-training data for a vertical field are as follows:

[0104] Step S41: Collect various types of text data in vertical fields.

[0105] In this step, based on the vertical field to which the model is applied, a large amount of text data in the vertical field is collected. Specifically, one or more types of unlabeled text data in the vertical field can be collected, including but not limited to: news, books, product information, user interaction behavior data, promotional copy, and user-generated content (UGC) in the vertical field. Among them, product information includes relevant knowledge information of various products in the vertical field, such as the attributes, usage methods, uses, functional descriptions, and other information of various products. User interaction behavior data refers to data generated based on interactive behavior with users, such as search behavior data, conversation data, etc. User-generated content is user-generated content, including text posted by users, such as comments, dynamics, articles, press releases, etc.

[0106] In addition, when collecting various types of text data in a vertical field, there is no need to limit the language type used by the text data. Text data in multiple languages ​​can be collected, including but not limited to text data in various languages ​​such as Chinese and English.

[0107] Step S42: Perform data cleaning on various types of text data to obtain various types of text samples in vertical fields.

[0108] In this step, data cleaning is performed on the collected text data of various types in vertical fields to obtain high-quality text data as text samples, thereby ensuring the quality of the text samples.

[0109] Specifically, data cleaning is performed on various types of text data, including at least filtering and deduplication of the text data. In addition, other commonly used data cleaning methods can also be used to improve the quality of text data to obtain higher-quality text samples, which are not specifically limited in this embodiment.

[0110] For example, the server may filter various types of text data to remove substandard and low-quality text data, including but not limited to: filtering out text that is too short or too long, text that has a high percentage of numbers, text that contains a large number of special symbols, and text with abnormal sentence breaks and punctuation.

[0111] Optionally, the server can filter various types of text data according to preset filtering rules to filter out text data of low quality that does not meet the requirements. The filtering rules can be configured and adjusted according to the needs of the actual use scenario and are not specifically limited here.

[0112] For example, a filtering rule may be: length greater than an upper limit or length less than a lower limit. By filtering out text data that meets this filtering rule, text data that is too short or too long is filtered out. The specific values ​​of the upper and lower length limits can be configured and adjusted based on the needs of actual application scenarios and empirical values, and are not specifically limited here.

[0113] For example, another example of a filtering rule could be: the percentage of digits is greater than a preset digit percentage threshold. By filtering out text data that meets this filtering rule, text data with an excessively high percentage of digits is filtered out. The preset digit percentage threshold can be configured and adjusted based on actual application needs and empirical data, and is not specifically limited here.

[0114] For example, a special symbol set is defined, and another example of a filtering rule can be: the number of special symbols appearing in the special symbol set is greater than or equal to a preset number threshold. By filtering out text data that meets the filtering rule, texts containing a large number of special symbols are filtered out. In addition, the filtering rule can also be set as: the proportion of special symbols is greater than or equal to a preset symbol proportion threshold. This filtering rule can also be used to filter out texts containing a large number of special symbols. Among them, the special symbol set, the preset number threshold, and the preset symbol proportion threshold can be configured and adjusted according to the needs of the actual application scenario and experience values, and are not specifically limited here.

[0115] Optionally, the server can train a text classification model based on preset filtering rules, and the text classification model is used to identify the category corresponding to the text data. The categories include: categories that do not meet the filtering rules, and categories corresponding to each filtering rule. For example, if m (m is a positive integer) filtering rules are set, then m+1 different categories can be set, including the category of not meeting the filtering rules, and categories corresponding to the m filtering rules. The server trains a text classification model for classifying text data, and the text classification model is used to predict the category (one of the m+1 categories) corresponding to the input text data. By inputting each text data into the text classification model, the category corresponding to the text data can be identified by the text classification module. According to the category corresponding to the text data, if the text data corresponds to the category corresponding to any filtering rule, that is, the text data meets any filtering rule, the text data will be filtered out.

[0116] For example, if a text data set is classified and identified using a text classification model, and if the classification and identification result shows that the text data meets the filtering rule of including sentence segmentation and punctuation anomalies, then the text data is filtered out. In this way, text data containing sentence segmentation and punctuation anomalies can be filtered out.

[0117] Optionally, data cleaning is performed on various types of text data, further comprising: removing invisible characters and invalid text from each text data. Invisible characters are also referred to as control characters or non-printing characters, which are characters that cannot be displayed in the text, such as spaces, tabs, carriage returns, line feeds, etc. Invalid text refers to pre-configured content that does not belong to the original content of the text and may affect the natural language understanding of the text. For example, a repeated prefix added to the beginning of the text, such as the file name of the source file. Exemplarily, an invisible character set and an invalid text set can be pre-defined to remove the content that appears in the invisible character set and the invalid text set from the text data. Specifically, what the invisible character set and the invalid text set contain can be configured and adjusted according to the needs and experience of the actual application scenario, and is not specifically limited here.

[0118] Because duplicate data can affect the model training process, this embodiment removes duplicates from each type of text data during data cleaning. This can be achieved by generating text segments of a preset length for each type of text data, where the length of the text segment refers to the number of words (also known as participles or tokens) contained in the text segment; calculating summary information for each text segment; and determining duplicate text data based on the degree of overlap in the summary information of the text segments of different text data, and then removing duplicates from the duplicate text data.

[0119] In which, the text fragments of preset length contained in any text data can be text fragments of length n (i.e., n-grams) generated by an n-gram algorithm, each text fragment containing a fragment consisting of n consecutive words in the text data, where n is the preset length of the text fragment, which can be configured according to the needs of the actual application scenario, for example, n can be 1, 2, 3..., which is not specifically limited here. By calculating the summary information of each text fragment of the text data through a digest algorithm, a collection of summary information of multiple text fragments of the text data can be obtained. Based on the degree of overlap of the collection of text fragment summary information of different text data, as the similarity between different text data, the text data with a higher degree of overlap is determined as duplicate text data. In which, the digest algorithm can be a secure hash algorithm (Secure Hash Algorithm, abbreviated as SHA), an MD5 message digest algorithm (MD5 Message-Digest Algorithm, abbreviated as MD5), etc.

[0120] Exemplarily, for sets A and B of text segment summary information of any two text data T1 and T2, assuming that text data T1 contains s1 text segments and text data T2 contains s2 text segments, then set A contains summary information of s1 text segments and set B contains summary information of s2 text segments. Assuming that the number of identical summary information contained in set A and set B is s, min{s1,s2}≤s≤max{s1,s2}, where min{s1,s2} is the minimum value between s1 and s2, and max{s1,s2} is the maximum value between s1 and s2. The degree of overlap between set A and set B can be determined as follows: s / (s1+s2-s). When the degree of overlap between set A and set B is greater than or equal to the overlap threshold, the text data T1 and T2 are determined to be duplicate text data. Among them, the overlap threshold can be configured and adjusted according to the needs and experience of the actual application scenario, and is not specifically limited here.

[0121] Optionally, the degree of overlap between set A and set B can also be calculated as follows: s / (s1+s2). Different overlap calculation methods can set different overlap thresholds. Optionally, duplicate text data of various types can be removed. Specifically, duplicate text data can be determined by comparing whether two text data are completely consistent. In addition, duplicate text data in various types of text data collected in vertical fields can also be determined by other existing methods for determining whether two different texts are texts with duplicate content. This is not specifically limited in this embodiment.

[0122] Alternatively, for text data that are determined to be repeated, one of the text data can be randomly selected to be retained, and the other text data that are repeated with the retained text data can be deleted. Alternatively, when removing repeated text data, a repeated relationship graph can also be constructed based on the repeated relationship between the text data, with each text data corresponding to a node in the graph, and an edge between two nodes indicating that the text data corresponding to the two nodes are repeated text data. By identifying connected blocks (nodes containing mutually repeated text data) in the repeated relationship graph, for each connected block in the repeated relationship graph, only one node randomly selected therein is retained, the other nodes in the connected block are deleted, and when the node is deleted, the text data corresponding to the node is deleted. This can retain only one text among a number of mutually repeated text data and delete all other texts.

[0123] Step S43: splice text samples of the same type, divide the splicing results into multiple input samples based on a preset maximum input length, and construct input sample sets of various types. The pre-training data of the vertical field includes input sample sets of various types in the vertical field.

[0124] After data cleaning of various types of text data in vertical fields, each cleaned text data is used as a text sample for further pre-training.

[0125] In this step, for any type of text sample, all text samples of this type are spliced ​​together, and the spliced ​​result is divided into multiple segments according to the preset maximum input length of the model, and each segment is used as an input sample to construct an input sample set of this type. The length of each input sample is equal to or less than the preset maximum input length. The preset maximum input length can be set according to the maximum input length that the model can accept. By splicing multiple text samples of the same type and dividing the input samples according to the preset maximum input length of the model, the efficiency of continuing pre-training of the pre-training model can be improved by increasing the length of the input samples in the pre-training data.

[0126] Optionally, for any type of text sample, when concatenating all text samples of that type, an end symbol (EOS) can be added after each text sample, and the text samples with the end symbol added can be concatenated, thereby using the end symbol to separate different text samples. When performing the causal language modeling pre-training task, the end symbol (EOS) in the input sample is treated as a word segmentation. The pre-trained model predicts and outputs the first word X1 based on the beginning symbol (BOS) in the training sample. Then, the second word X2 is predicted and output based on the BOS and the first word X1. Then, the third word X3 is predicted and output based on the BOS, the first word X1, and the second word X2. And so on, until the last word is output based on the BOS and the previous words.

[0127] In this embodiment, through steps 41-S43, various types of text data in vertical fields are collected, and data cleaning is performed on various types of text data to obtain various types of high-quality text samples in vertical fields. Furthermore, multiple text samples of the same type are spliced ​​and the input samples are divided according to the preset maximum input length of the model. This can increase the length of the input samples in the pre-training data, thereby improving the efficiency of continuing pre-training of the pre-training model.

[0128] Step S44: Obtain pre-training data of the general neighborhood.

[0129] Optionally, the pre-training data for the general domain can directly adopt the training data used in the pre-training phase of the pre-training model. Optionally, the server can also collect various types of text data in the general domain and construct pre-training data for the general neighborhood based on the various types of text data in the general domain in a manner similar to steps S42-S43. The specific implementation method is described in the above steps S42-S43 and will not be repeated here.

[0130] Specifically, various types of text data in general fields can be collected by collecting various types of unlabeled text data in general fields, including but not limited to: encyclopedias, books, blogs, news, question-and-answer data, and other texts of different types and sources. When collecting various types of text data in general fields, the language used in the text data is not limited, and text data in multiple languages ​​in general fields can be collected, including but not limited to text data in various languages ​​such as Chinese and English.

[0131] Step S45: Mix the pre-training data of the vertical domain with the pre-training data of the general neighborhood according to a preset mixing method to obtain mixed pre-training data.

[0132] For example, in this embodiment, the preset mixing method is to mix the pre-trained data of the vertical domain with the pre-trained data of the general neighborhood according to a preset mixing ratio. The preset mixing ratio is a pre-configured mixing ratio of the pre-trained data of the vertical domain to the pre-trained data of the general neighborhood.

[0133] When constructing mixed pre-training data for vertical and general fields, the proportion of pre-training data in the vertical field should not be too small or too large. If the proportion of pre-training data in the vertical field is too small, the model will not be able to learn sufficient knowledge in the vertical field, affecting the model's text understanding and generation capabilities in the vertical field. If the proportion of pre-training data in the vertical field is too large, the model will not be able to maintain the original strong semantic understanding and representation capabilities of the pre-trained model well, which will also affect the model's text understanding and generation capabilities in the vertical field. The proportion of pre-training data in the vertical field is about 1 / 2, that is, the vertical field and the general field are mixed in a ratio of about 1:1. The obtained mixed pre-training data is used to continue pre-training the pre-training model. On the basis of maintaining the original strong semantic understanding and representation capabilities of the pre-training model as much as possible, the model can be familiar with the characteristics of the text format and data distribution of the vertical field, and inject more vertical field knowledge into the model, thereby enhancing the model's text understanding and generation capabilities in the vertical field. In this embodiment, a better training effect can be achieved when the preset mixing ratio is 1:1 or close to 1:1. The specific value can be configured and adjusted according to the needs of the actual application scenario and is not specifically limited here. For example, the preset mixing ratio can be configured as 1:1, 2:3, 2:1, etc.

[0134] In an optional embodiment, when fine-tuning the domain basic model using a vertical domain dataset in step S32, any method in the prior art of fine-tuning the pre-trained model using annotated data in the vertical domain can be used, which will not be repeated here.

[0135] In another optional embodiment, when fine-tuning the domain basic model using the vertical domain dataset in step S32, the server can use the constructed vertical domain multi-task instruction dataset to fine-tune the domain basic model to obtain a domain model suitable for the vertical domain. Among them, the multi-task instruction dataset contains instruction data for a variety of different tasks, and the instruction data refers to the data used to generate task instructions for the input model during the fine-tuning training phase, including task prompt format information, input information, and output results. The task prompt format information used for different tasks is different. The task prompt format information is used to instruct the model to perform the processing of the corresponding task to obtain the task processing result. Specifically, as shown in Figure 5, the server can construct a multi-task instruction dataset for the vertical field through the following steps S51-S53:

[0136] Step S51: Acquire instruction data of multiple existing tasks in vertical fields. The instruction data includes task prompt format information, input information, and output results. Different tasks use different task prompt format information.

[0137] In this step, labeled training data for existing tasks in the vertical domain can be collected by collecting publicly available fine-tuning datasets used to fine-tune pre-trained models for various tasks in the vertical domain (the purpose is to obtain a model suitable for a specific task). In this embodiment, tasks with constructed fine-tuning datasets are referred to as existing tasks.

[0138] Furthermore, for labeled training data for various existing tasks in vertical domains, the format of instruction data for each task is standardized, including task prompt format information, input information, and output results. The task prompt format information instructs the model to execute the corresponding task processing process to obtain the task processing result. The input information includes one or more task inputs, and the output result is the labeled task processing result.

[0139] Exemplarily, the task prompt format information for various tasks includes at least the following information: prompt, input, and output. The prompt indicates the task requirement / purpose of the task. The input indicates which information items are included in the input information. The output indicates the information items that need to be generated by the model, that is, the information items included in the task processing results. In addition, the task prompt format information for some tasks may also include pre-set example information. The example information may include example information of input items, example information of target items, etc., to provide reference examples for the model.

[0140] For example, common natural language processing tasks can be divided into three categories: information extraction tasks, text classification tasks, and text generation tasks. Information extraction tasks include named entity recognition (detecting named entities contained in a given text and assigning their classification categories), entity detection (detecting named entities contained in a given text), attribute detection and attribute extraction tasks (detecting information describing entity attributes contained in a given text, such as a product's origin), and question-answering tasks related to a given entity (such as a product). Text classification tasks include entity classification tasks (identifying the entity's classification category given entity-related text, such as its name, attributes, and description text), sentiment classification tasks (classifying sentiment based on text, such as user comments), and conversation intent classification tasks (identifying the user's intent based on the conversation content). Text generation tasks include title generation (e.g., generating a title based on product attributes, description information, and other text), copy generation (e.g., generating product promotional copy based on product attributes, description information, and other text), conversation response generation (generating responses based on input questions), and user query rewriting (rewriting user query information in search systems).

[0141] In this embodiment, labeled training data of various existing natural language processing tasks in vertical fields can be collected, and instruction data for existing tasks can be constructed based on a unified instruction data format.

[0142] In an optional embodiment, the prompt format information of the task can be configured based on the chain of thought (CoT) in combination with input items, output items and intermediate reasoning steps. Not only the final output item is introduced into the prompt, but also the intermediate reasoning steps are introduced into the prompt, which can effectively improve the quality of the task processing results and help users understand the task processing results.

[0143] For example, taking the product comparison task in the e-commerce field as an example, the method based on thought chain can configure the following task prompt format information:

[0144] Tip: We need to perform product comparison. Based on the two product titles and attributes, summarize the characteristics, similarities, and differences of the two products. Then describe the advantages of the two products in words that consumers can understand. Finally, make recommendations based on different applicable scenarios.

[0145] The input items are as follows:

[0146] Product 1: {Product 1 title, attributes, price}

[0147] Product 2: {Product 1's title, attributes, price}

[0148] The output items and output formats are as follows:

[0149] Features of product 1: {Features of product 1}.

[0150] Features of Product 2: {Features of Product 2}.

[0151] Similarities: {similarities between the two products}.

[0152] Difference: {the difference between the two products}.

[0153] The advantage of product 1 is {the advantage of product 1}.

[0154] The advantage of product 2 is {the advantage of product 2}.

[0155] Recommended suggestions: {Purchase suggestions based on different applicable scenarios}.

[0156] Based on the task prompt format information, the prompt includes the intermediate reasoning process of the model performing product comparison. The input item indicates the information that needs to be input for product 1 and product 2 to be compared. In this example, the input product information includes title, attributes and price as an example for schematic explanation. The output format indicates that the output items include the characteristics of product 1, the characteristics of product 2, the similarities between the two products, the differences between the two products, the advantages of product 1, the advantages of product 2, and recommendations. In this way, the task processing results given by the model not only include the final recommendation suggestions, but also include the intermediate comparison process of comparing the two products. Furthermore, based on the task processing results output by the model, the corresponding part of the task processing results is extracted through regular expressions and other methods and displayed to the user.

[0157] Step S52: Generate instruction data for a new task based on the instruction data of at least one existing task according to the corresponding task transformation rule.

[0158] After constructing the instruction data of existing tasks, considering that the number of existing tasks with labeled training data in vertical fields may be small, in this step, a new task is obtained by transforming at least one existing task, and instruction data of a new task is obtained by transforming at least one existing task. Thus, through data enhancement, the task types are increased, instruction data of more tasks are obtained, and the diversity and data volume of the instruction data set of multiple tasks in the vertical field are improved.

[0159] Optionally, a task simplification rule corresponding to at least one existing task can be pre-configured. Based on the task simplification rule, new tasks of varying difficulty can be constructed by adjusting the input and / or output information of the existing task. In this step, the server can simplify the input information and / or output results in the instruction data of the at least one existing task according to the task simplification rule corresponding to the existing task, obtain the input information and output results of the new task, and configure the task prompt format information for the new task.

[0160] For example, the task of named entity recognition is to identify the named entities contained in the input text and give the corresponding classification category (i.e., entity type) of the named entities. By adjusting the output of the named entity recognition task to include only the named entities contained in the input text, the named entity recognition task is simplified into an entity detection task. By adjusting the input of the named entity recognition task to the name of the named entity and the output to the corresponding classification category of the named entity, the named entity recognition task is simplified into an entity classification task.

[0161] Among them, the task simplification rules of existing tasks and the task prompt format information of new tasks can be configured by relevant technical personnel based on the existing tasks and new tasks in actual application scenarios, and are not specifically limited here.

[0162] Optionally, a task reversal rule corresponding to at least one existing task may be pre-configured. Based on the task reversal rule, a new task may be constructed by reversing the input and output of the existing task. In this step, the server may use the output of the existing task as the input information for the new task and the input information of the existing task as the output result of the new task based on the instruction data of the at least one existing task and in accordance with the task reversal rule corresponding to the existing task, thereby constructing the input information and output result of the new task and configuring the task prompt format information for the new task.

[0163] For example, for an existing question-answering task, the question and answer can be reversed to construct a new one by using the question and answer as the answer and question of a new task, respectively. For example, for an existing task of generating product descriptions from product titles, the output is the product title. By reversing the input and output of the existing task, a new task of generating product descriptions from product titles can be constructed. The input of the new task is the product title, and the output is the product description.

[0164] The task reversal rules of existing tasks and the task prompt format information of new tasks can be configured by relevant technical personnel based on the existing tasks and new tasks in actual application scenarios, and are not specifically limited here.

[0165] Optionally, a task reorganization rule corresponding to at least one existing task may be preconfigured. Based on the task reorganization rule, the new task is constructed by splitting and reorganizing the input and output of the existing task. In this step, the server may, based on the instruction data of the at least one existing task and the task reorganization rule corresponding to the existing task, split and reorganize the input information and output result of the existing task to construct the input information and output result of the new task, and configure the task prompt format information for the new task.

[0166] For example, an existing task might be a product matching task, where the input is the title and attributes of two products, and the output is a match result indicating whether the two products are the same. By splitting and recombining the input and output of an existing task, a new task called product title-attribute matching can be constructed: the input is a given product title and two attributes; the output is a single attribute that matches the given product title.

[0167] The task reorganization rules of existing tasks and the task prompt format information of new tasks can be configured by relevant technical personnel based on the existing tasks and new tasks in actual application scenarios, and are not specifically limited here.

[0168] Optionally, for the instruction data of at least one existing task, a large model can be used to perform corresponding task processing according to the task prompt format information and input information in the instruction data, obtain the task processing result, and use the task processing result as the labeled output result to construct new instruction data, which can increase the data volume of the instruction data.

[0169] Step S53: construct a multi-task instruction data set in a vertical field based on the instruction data of the existing tasks and the new tasks.

[0170] Based on the instruction data of the existing tasks constructed in step S51 and the instruction data of the new tasks constructed in step S52, an instruction data set for multiple tasks in a vertical field is constructed. The instruction data set for multiple tasks in a vertical field includes both the instruction data of the existing tasks constructed in step S51 and the instruction data of the new tasks constructed in step S52.

[0171] The method of this embodiment, by acquiring instruction data of multiple existing tasks in a vertical field, and generating instruction data of a new task according to the corresponding task transformation rules for the instruction data of at least one existing task, can increase the scale of instruction data used for fine-tuning training and the diversity of covered task types, thereby improving the effect of fine-tuning training, and improving the performance of the vertical field domain model obtained by training and the quality of the generated task processing results.

[0172] Furthermore, in step S32, the constructed multi-task instruction dataset of the vertical field is used to fine-tune the domain basic model to obtain a domain model suitable for the vertical field.

[0173] Specifically, instruction data is sampled from a multi-task instruction dataset in a vertical domain. Based on the task prompt format information and input information in the instruction data, a task instruction containing input information and conforming to the task prompt format is generated. The domain-based model then performs task processing based on the task instruction to obtain the task processing result. Based on the task processing result and the output result (annotated) in the instruction data, the loss function is calculated and the parameters of the domain-based model are updated. The model is trained to generate output results based on the task prompt format information and input information, thus achieving iterative fine-tuning of the domain-based model. Fine-tuning the domain-based model using a multi-task instruction dataset in a vertical domain can improve the model's performance and generalization ability on various tasks in that vertical domain.

[0174] The task prompt format information can be understood as a template for task instructions. By substituting the input information into the template, task instructions containing the input information can be generated according to the format requirements of the task prompt format information. The method for generating task instructions can refer to the existing method of generating model input instructions based on a given prompt format / template and input information, and will not be repeated here.

[0175] For example, Figure 6 is a schematic diagram of fine-tuning multi-task instructions for a domain-based model provided in an embodiment of the present application. As shown in Figure 6, fine-tuning training is performed based on instruction datasets for two tasks, named entity recognition and conversation intent detection. Example task instructions for both tasks are provided. The task instructions for the named entity recognition task include: "Prompt" refers to the prompt in the task prompt format information, instructing the model to extract all named entities related to attributes, brands, components, and product types from the input text; "Input" is the input text; and "Output" is the portion to be generated by the model. By inputting the task instructions into the domain-based model, the domain-based model generates and outputs the named entity recognition results. The task instructions for the conversation intent detection task include: "Prompt" refers to the prompt in the task prompt format information, instructing the model to classify the intent of the last sentence in the input conversation text and select the output result from candidate intent categories; "Input" is the input conversation text; "Candidate Labels" is the candidate intent categories; and "Output" is the portion to be generated by the model. By inputting the task instructions into the domain-based model, the domain-based model generates and outputs the conversation intent detection results. The domain basic model is fine-tuned and trained through instruction datasets of various tasks. The trained domain model can be applied to various tasks in vertical fields and is a multi-task general model.

[0176] Figure 7 is a framework diagram of obtaining a domain model of a vertical field based on a pre-trained model provided by an exemplary embodiment of the present application. In this embodiment, as shown in Figure 7, the vertical neighborhood is the e-commerce field, and the domain large language model of the e-commerce field is obtained as an example for exemplary explanation. Based on the general pre-trained large language model, the pre-trained large language model is further pre-trained using the unlabeled pre-trained data of the e-commerce field and the unlabeled pre-trained data of the general field to obtain the basic large language model of the e-commerce field. On the basis of maintaining the original powerful semantic understanding and representation capabilities of the pre-trained large language model as much as possible, the model is made familiar with the text format and data distribution characteristics of the e-commerce field, and more knowledge of the e-commerce field is injected into the model, thereby enhancing the model's text understanding and generation capabilities in the e-commerce field. Furthermore, we use a fine-tuning training set of instruction data for various tasks in the e-commerce field (such as information extraction tasks, text classification tasks, text generation tasks, etc.) to fine-tune the basic large language model in the e-commerce field with multi-task instruction data to obtain a large language model in the e-commerce field. This allows the final large language model in the e-commerce field to be better suited for natural language processing tasks in the e-commerce field, further improving the performance of the model and thus greatly improving the generation quality of the large language model when performing various NLP tasks in the e-commerce field.

[0177] FIG8 is a flowchart of a task processing method in the e-commerce field provided by an exemplary embodiment of the present application. The execution subject of this embodiment is the server in the system architecture shown in FIG1 or FIG2. The method of this embodiment is intended to continue pre-training and fine-tuning the pre-trained large model to obtain an e-commerce domain large model suitable for the e-commerce field. As shown in FIG8, the specific steps of this method are as follows:

[0178] Step S81: Use mixed pre-training data from the e-commerce field and the general field to continue pre-training the pre-trained large model to obtain a pre-trained basic large model in the e-commerce field.

[0179] The pre-trained large model can be a large model used for natural language processing, such as various pre-trained large language models. In this step, e-commerce is used as a vertical domain, and mixed pre-training data from both e-commerce and general domains is used to further pre-train the pre-trained large model. This allows the large model to become familiar with the text formatting and data distribution characteristics of the e-commerce domain, and infuses the large model with more vertical domain knowledge, thereby enhancing the large model's text understanding and generation capabilities in the e-commerce domain.

[0180] Specifically, by constructing pre-training data in the e-commerce field, the pre-training data in the e-commerce field is mixed with the pre-training data in the general neighborhood according to a preset mixing method to obtain mixed pre-training data.

[0181] The specific implementation of this step is similar to the specific implementation of the aforementioned step S31. Please refer to the relevant content in the aforementioned embodiment for details, and no further details will be given here.

[0182] Step S82: Use the data set in the e-commerce field to fine-tune the basic large model in the e-commerce field to obtain the e-commerce field large model. The e-commerce field large model is used to perform natural language processing tasks in the e-commerce field and generate corresponding task processing results.

[0183] After pre-training the pre-trained large model using mixed pre-training data from the e-commerce field and the general field to obtain a pre-trained basic large model for the e-commerce field, the basic large model can be fine-tuned using the data set in the e-commerce field to obtain an e-commerce field large model suitable for the e-commerce field. By fine-tuning the basic large model, the final obtained e-commerce field large model can be better applied to natural language processing tasks in the e-commerce field, thereby further improving the performance of the large model. The specific implementation of this step is similar to the specific implementation of the aforementioned step S32. For details, please refer to the relevant content in the aforementioned embodiment and will not be repeated here.

[0184] The method of this embodiment continues to pre-train the pre-trained big model by using mixed pre-training data from the e-commerce field and the general field to obtain a pre-trained basic big model in the e-commerce field. While maintaining the original powerful semantic understanding and representation capabilities of the pre-trained big model as much as possible, the big model is made familiar with the text format and data distribution characteristics of the e-commerce field, and more knowledge of the e-commerce field is injected into the big model, thereby enhancing the text understanding and generation capabilities of the big model in the e-commerce field; further, the basic big model is fine-tuned and trained using a fine-tuning dataset in the e-commerce field to obtain an e-commerce field big model suitable for the e-commerce field, so that the finally obtained e-commerce field big model can be better applied to natural language processing tasks in the e-commerce field, further improving the performance of the big model, thereby greatly improving the generation quality of task processing results when the big model is applied to various NLP tasks in the e-commerce field.

[0185] Figure 9 is a flowchart of implementing task processing based on a domain model in a vertical domain, provided by an exemplary embodiment of the present application. After obtaining a domain model for a vertical domain based on any of the aforementioned method embodiments, in this embodiment, a natural language processing task in the vertical domain is performed based on the domain model in the vertical domain to obtain a task processing result.

[0186] It should be noted that the vertical domain model obtained through training based on the aforementioned embodiment can be deployed locally on the server, or deployed on servers of other organizations or system platforms. The execution entity of this embodiment is a server running the vertical domain model, which also runs downstream application systems capable of using the domain model.

[0187] As shown in Figure 9, the specific steps for implementing task processing based on the vertical domain model are as follows:

[0188] Step S91: In response to a task processing request for a natural language processing task in a vertical field, obtain input data and task prompt format information of the natural language processing task.

[0189] In this embodiment, when the application system running on the server needs to perform a natural language processing task in a vertical field, it submits a task processing request to the server. The task processing request includes input data and task category information of the natural language processing task. The task category information of different natural language processing tasks is different.

[0190] In actual applications, downstream application systems may generate a variety of natural language processing tasks during operation, including but not limited to various information extraction tasks, text classification tasks, and text generation tasks. Different natural language processing tasks have different task categories. Based on the task category, the corresponding natural language processing task can be determined, and the task prompt format information for the corresponding natural language processing task can be obtained.

[0191] For example, consider an e-commerce system whose downstream application is in the e-commerce field. During the operation of the e-commerce system, after a user enters a consultation text, the e-commerce system may generate a product identification task: performing the product identification task based on the user's consultation text, extracting entities of various categories such as products, product attributes, and brands from the consultation text, and determining the corresponding entity categories. After obtaining the product identification results, the e-commerce system searches for knowledge documents that match the current product based on the product identification results and generates a question-and-answer task: generating a response to the user's consultation text based on the searched knowledge documents. After obtaining the response information, the e-commerce system outputs the response information.

[0192] In addition, in other scenarios and other fields in the e-commerce field, there are many application systems that generate a variety of different natural language processing tasks. The solution of this embodiment uses a general domain model to perform various natural language processing tasks in this vertical field, which will not be listed one by one here.

[0193] Step S92: Generate task instructions according to the task prompt format information and input data.

[0194] After obtaining the input data and task prompt format information for the natural language processing task to be executed, the server generates a task instruction containing the input data based on the task prompt format information. For example, for a product identification task, the input data is the user-entered inquiry text. This input data is substituted into the input items of the task prompt format information to generate a task instruction for the product identification task. For example, the task instruction for the named entity recognition task shown in Figure 6 can extract entities such as products, attributes, brands, and components from the input text and provide the corresponding entity categories.

[0195] Step S93: Input the task instruction into the domain model, execute task processing based on the task instruction through the domain model, and generate a task processing result.

[0196] After generating the task instructions of the natural language processing task to be executed, the task instructions are input into the domain model. Through the reasoning of the domain model, natural language processing based on the task instructions is realized to generate the task processing results.

[0197] Step S94: Return the task processing result.

[0198] After generating the task processing results for a natural language processing task, the server can return the task processing results. For example, based on the needs of the downstream application system, the server can return the task processing results to the downstream application system, and the downstream application system will execute the subsequent processing logic. For example, after executing a product identification task using a domain model and obtaining the product identification results, the server returns the product identification results to the e-commerce system. The e-commerce system will then search for knowledge documents that match the product based on the product identification results.

[0199] In this embodiment, the domain model of the vertical field obtained by training in any of the aforementioned method embodiments is used as a general model for various natural language processing tasks in the vertical field. Since the original powerful semantic understanding and representation capabilities of the pre-trained model are maintained as much as possible during the training process, more vertical field knowledge is injected into the domain model, and the domain model's text understanding and generation capabilities in the vertical field are enhanced. The domain model is used to perform various natural language processing tasks in the vertical field, including but not limited to named entity recognition, text classification, text generation and other tasks, which can greatly improve the quality of natural language processing results.

[0200] In an optional embodiment, after obtaining a domain model for a vertical domain based on any of the aforementioned method embodiments, the server may provide an application programming interface (API) of the domain model for the vertical domain to the outside world. External devices can use the natural language processing capabilities of the domain model through the API of the domain model for the vertical domain.

[0201] Figure 10 is a flowchart of another exemplary embodiment of the present application for implementing task processing based on a domain model in a vertical field. In this embodiment, the domain model and the downstream application system that uses the natural language processing capabilities of the domain model run on different electronic devices respectively. The electronic device running the domain model serves as a server on the service side, and the electronic device running the downstream application system serves as an end-side device. As shown in Figure 10, the specific steps for implementing task processing of natural language processing tasks based on a domain model in a vertical field are as follows:

[0202] Step S1001: In response to a task processing request for a natural language processing task in a vertical field, the terminal-side device obtains input data and task prompt format information of the natural language processing task.

[0203] In this embodiment, when the application system running on the end-side device needs to perform a natural language processing task in a vertical field, it submits a task processing request to the end-side device. The task processing request includes input data and task category information of the natural language processing task. The task category information of different natural language processing tasks is different.

[0204] In actual applications, downstream application systems may generate a variety of natural language processing tasks during operation, including but not limited to various information extraction tasks, text classification tasks, and text generation tasks. Different natural language processing tasks have different task categories. Based on the task category, the corresponding natural language processing task can be determined, and the task prompt format information for the corresponding natural language processing task can be obtained.

[0205] For example, consider an e-commerce system whose downstream application is in the e-commerce field. During the operation of the e-commerce system, after a user enters a consultation text, the e-commerce system may generate a product identification task: performing the product identification task based on the user's consultation text, extracting entities of various categories such as products, product attributes, and brands from the consultation text, and determining the corresponding entity categories. After obtaining the product identification results, the e-commerce system searches for knowledge documents that match the current product based on the product identification results and generates a question-and-answer task: generating a response to the user's consultation text based on the searched knowledge documents. After obtaining the response information, the e-commerce system outputs the response information.

[0206] In addition, in other scenarios and other fields in the e-commerce field, there are many application systems that generate a variety of different natural language processing tasks. The solution of this embodiment uses a general domain model to perform various natural language processing tasks in this vertical field, which will not be listed one by one here.

[0207] Step S1002: The terminal device generates a task instruction according to the task prompt format information and input data.

[0208] The specific implementation method of step S1002 is consistent with that of the aforementioned step S92. Please refer to the relevant content of the aforementioned embodiment for details, and no further details will be given here.

[0209] Step S1003: The client device sends a call request for the domain model to the server, where the call request includes a task instruction.

[0210] In this embodiment, the server can provide an application programming interface (API) of a domain model for a vertical domain. The end-side device can send a call request to the server through the API of the domain model for the vertical domain. The call request contains a task instruction that requires input of the domain model. The task instruction is generated based on the task prompt format information and input data of the natural language processing task to be executed.

[0211] It should be noted that the server can pre-acquire one or more domain models of different vertical fields, and different domain models have different APIs. The server can display the APIs of domain models of different vertical fields to the end-side device. The end-side device can choose to call different APIs based on the running application system or the vertical field to which the current natural language processing task belongs, to use the API corresponding to the domain model of the vertical field. In addition, in actual applications, the server can receive call requests from multiple different end-side devices and provide natural language processing capabilities based on the domain models of vertical fields to multiple different end-side devices.

[0212] Step S1004: The server inputs the task instruction into the domain model, performs task processing based on the task instruction through the domain model, and generates a task processing result.

[0213] After receiving the call request for the domain model, the server obtains the task instruction and inputs the task instruction into the domain model of the vertical domain. The domain model performs task processing based on the task instruction and generates a task processing result. The domain model run by the server in this embodiment uses a mixture of pre-trained data of the vertical domain and the general domain to further pre-train the pre-trained model to obtain a pre-trained domain basic model, and then uses the fine-tuning data set of the vertical domain to fine-tune the domain basic model. The specific process of obtaining the domain model can be found in the relevant content of the aforementioned embodiment and will not be repeated here.

[0214] Step S1005: The server returns the task processing result to the terminal device.

[0215] In this embodiment, the domain model of a vertical domain obtained by training in any of the aforementioned method embodiments is used as a general model for various natural language processing tasks in that vertical domain, and an API for using the domain model is provided to the external end-side device. Since the original powerful semantic understanding and representation capabilities of the pre-trained model are maintained as much as possible during the training process, more vertical domain knowledge is injected into the domain model, enhancing the domain model's text understanding and generation capabilities in the vertical domain. Downstream application systems use this domain model to perform various natural language processing tasks in that vertical domain, including but not limited to named entity recognition, text classification, text generation, and other tasks, which can greatly improve the quality of natural language processing results.

[0216] Based on any of the aforementioned method embodiments, the task prompt format information of any type of task can be configured in combination with the chain of thought (CoT) method. The task prompt format information includes a natural language description of the reasoning steps, instructing the model to perform task reasoning step by step to obtain the final result. It can not only output the final result, but also the intermediate reasoning process, which can effectively prompt the quality of the output result and reduce the user's understanding and decision-making costs.

[0217] For example, consider the e-commerce product comparison task: Given information about two products, compare them and provide a recommendation that meets the user's needs. A possible approach to solving this task could be: based on the information about the two products, provide their characteristics, similarities, and differences, then describe their advantages, and finally provide a recommended product based on the user's needs. Based on this approach, a task prompt format for the product comparison task could be configured as follows:

[0218] Tip: We need to perform a product comparison function. Based on the two product titles and attributes, summarize the characteristics, similarities, and differences of the two products. Then describe the advantages of the two products in terms that consumers can understand. Finally, make recommendations based on different applicable scenarios.

[0219] The input items are as follows:

[0220] Product 1: {Product 1 title, attributes, price}

[0221] Product 2: {Product 1's title, attributes, price}

[0222] The output items and output formats are as follows:

[0223] Features of product 1: {Features of product 1}.

[0224] Features of Product 2: {Features of Product 2}.

[0225] Similarities: {similarities between the two products}.

[0226] Difference: {the difference between the two products}.

[0227] The advantage of product 1 is {the advantage of product 1}.

[0228] The advantage of product 2 is {the advantage of product 2}.

[0229] Recommended suggestions: {Purchase suggestions based on different applicable scenarios}.

[0230] Based on the task prompt format information, the prompt includes the intermediate reasoning process of the model performing product comparison. The input item indicates the information that needs to be input for product 1 and product 2 to be compared. In this example, the input product information includes title, attributes and price as an example for schematic explanation. The output format indicates that the output results include the characteristics of product 1, the characteristics of product 2, the similarities between the two products, the differences between the two products, the advantages of product 1, the advantages of product 2, and recommendations. In this way, the task processing results given by the model not only include the final recommendations, but also include the intermediate comparison process of comparing the two products. Furthermore, based on the task processing results output by the model, the output items that need to be displayed can be extracted from the task processing results through pre-configured rules and displayed to the user through the front-end interface. For example, key information in the task processing results can be extracted and displayed to the user through pre-configured regular expressions and other methods.

[0231] As shown in Figure 11, based on the task prompt format information of the aforementioned product comparison task, the process framework for implementing the product comparison task using the domain model of the e-commerce domain is as follows: First, based on the given information of Product 1 and Product 2, a task instruction based on the Chain of Thought (CoT) method is generated according to the task prompt format information configured based on the Chain of Thought (CoT) method. The task instruction is input into the domain model of the e-commerce domain, and the domain model executes the step-by-step reasoning process based on the task instruction based on the Chain of Thought (CoT) to generate a comparison result. The generated comparison result includes the characteristics of Product 1, the characteristics of Product 2, the similarities between the two products, the differences between the two products, the advantages of Product 1, the advantages of Product 2, and recommendations. In other examples, the disadvantages of the two products can also be given separately. The task chain of thought and the task prompt format information can be configured by relevant technical personnel based on the needs of the actual application scenario, and are not specifically limited here.

[0232] FIG12 is a flow chart of the product comparison method provided in this embodiment. As shown in FIG12 , the specific steps for implementing product comparison based on the large language model in the e-commerce field are as follows:

[0233] Step S121: Obtain information of multiple products to be compared and task prompt format information.

[0234] The obtained product information includes key information such as the product title, attributes, price, usage, applicable scenarios, product description, etc. The specific key information can be configured in the input items of the task prompt format information according to the actual application scenario, and is not specifically limited here.

[0235] The product information obtained in this step is the input item information required to perform the product comparison task. The task prompt format information of the product comparison task is as shown in the example of the above embodiment and will not be repeated here.

[0236] Step S122: Generate a task instruction according to the task prompt format information and information of the multiple commodities.

[0237] Step S123: Input the task instruction into the large language model in the e-commerce field, and use the large language model to perform product comparison processing according to the task instruction to obtain an output result of the product comparison.

[0238] Step S124: Output the product comparison result.

[0239] For example, Figure 13 shows an example interface displaying product comparison results. As shown in Figure 13, the interface can display the characteristics of two products, summarize their advantages and disadvantages, and provide recommendations based on user usage scenarios. Furthermore, the interface can also display various product parameters, highlighting key product parameters (such as advantageous parameters) based on their characteristics, advantages, and disadvantages.

[0240] In this embodiment, the task prompt format information of various tasks is configured based on the chain of thought (CoT) method, so that the task prompt format information contains a natural language description of the intermediate reasoning steps, instructing the domain model to gradually perform task reasoning to obtain the final result. Not only the final result can be output, but also the intermediate reasoning process can be output, which can effectively prompt the quality of the output result and reduce the user's understanding and decision-making costs.

[0241] FIG14 is a schematic diagram of the structure of a server provided in an embodiment of the present application. As shown in FIG14 , the server includes a memory 1401 and a processor 1402. Memory 1401 is used to store computer-executable instructions and can be configured to store various other data to support operations on the server. Processor 1402 is communicatively connected to memory 1401 and is used to execute the computer-executable instructions stored in memory 1401 to implement the technical solutions provided in any of the above-mentioned method embodiments. The specific functions and technical effects that can be achieved are similar and will not be repeated here.

[0242] Figure 14 illustrates a server deployed in the cloud as an example. The server can also be a local server. Optionally, as shown in Figure 14 , the server also includes other components, such as a firewall 1403, a load balancer 1404, a communication component 1405, and a power supply component 1406. Figure 14 only schematically illustrates some components, and does not mean that the server only includes the components shown in Figure 14.

[0243] An embodiment of the present application also provides a computer-readable storage medium, which stores computer-executable instructions. When a processor executes the computer-executable instructions, the method of any of the aforementioned embodiments is implemented. The specific functions and technical effects that can be achieved are not repeated here.

[0244] The present application also provides a computer program product, including a computer program. When executed by a processor, the computer program implements the method of any of the aforementioned embodiments. The computer program is stored in a readable storage medium. At least one processor of a server can read the computer program from the readable storage medium. The at least one processor executes the computer program, causing the server to perform the technical solution provided by any of the aforementioned method embodiments. The specific functions and technical effects achieved are not further described here.

[0245] An embodiment of the present application provides a chip comprising: a processing module and a communication interface. The processing module is capable of executing the technical solution of the server in the aforementioned method embodiments. Optionally, the chip also includes a storage module (e.g., a memory) configured to store instructions, and the processing module configured to execute the instructions stored in the storage module. Execution of the instructions stored in the storage module causes the processing module to execute the technical solution provided by any of the aforementioned method embodiments.

[0246] The above-mentioned integrated module implemented in the form of a software functional module can be stored in a computer-readable storage medium. The above-mentioned software functional module is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform some steps of the methods of various embodiments of the present application.

[0247] It should be understood that the above-mentioned processor can be a processing unit (Central Processing Unit, referred to as CPU), or it can be other general-purpose processors, digital signal processors (Digital Signal Processor, referred to as DSP), application-specific integrated circuits (Application Specific Integrated Circuit, referred to as ASIC), etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the application can be directly embodied as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor. The memory may include high-speed RAM memory, and may also include non-volatile storage NVM, such as at least one disk memory, and can also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk or an optical disk, etc.

[0248] The above-mentioned memory can be an object storage service (OSS). The above-mentioned memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The above-mentioned communication component is configured to facilitate wired or wireless communication between the device where the communication component is located and other devices. The device where the communication component is located can access a wireless network based on communication standards, such as mobile hotspot (WiFi), second-generation mobile communication system (2G), third-generation mobile communication system (3G), fourth-generation mobile communication system (4G) / long-term evolution (LTE), fifth-generation mobile communication system (5G), etc., or a combination thereof. In an exemplary embodiment, the communication component receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies. The above-mentioned power supply component provides power to various components of the device where the power supply component is located. The power supply component may include a power management system, one or more power supplies, and other components associated with generating, managing and distributing power for the device where the power supply component is located. The above-mentioned storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.

[0249] An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be an integral part of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the storage medium can also exist as discrete components in an electronic device or a main control device.

[0250] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.

[0251] The order of the above-mentioned embodiments of the present application is for description only and does not represent the advantages and disadvantages of the embodiments. In addition, in some of the processes described in the above-mentioned embodiments and the accompanying drawings, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or in parallel. They are only used to distinguish between different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., do not represent the order of precedence, and do not limit "first" and "second" to different types. The meaning of "multiple" is more than two, unless otherwise clearly and specifically defined.

[0252] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods of each embodiment of the present application.

[0253] The above are only preferred embodiments of the present application and do not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A task processing method, characterized in that: include: Use mixed pre-training data from vertical and general fields to continue pre-training the pre-trained model to obtain a pre-trained domain basic model. Using the data set of the vertical field, the domain basic model is fine-tuned and trained to obtain a domain model suitable for the vertical field. The domain model is used to perform natural language processing tasks in the vertical field and generate corresponding task processing results.

2. The method according to claim 1, characterized in that The method of using the mixed pre-training data of the vertical domain and the general domain to continue pre-training the pre-training model to obtain the pre-trained domain basic model also includes: Constructing pre-training data in the vertical field; The pre-trained data in the vertical field is mixed with the pre-trained data in the general neighborhood in a preset mixing manner to obtain mixed pre-trained data.

3. The method according to claim 2, characterized in that The pre-training data of the vertical domain is mixed with the pre-training data of the general neighborhood in a preset mixing manner to obtain mixed pre-training data, including: Mixing the pre-trained data of the vertical domain with the pre-trained data of the general neighborhood according to a preset mixing ratio to obtain mixed pre-trained data; or, The pre-training data in the vertical field includes pre-training data in multiple sub-fields. According to the application field of the domain model, the pre-training data in the sub-field corresponding to the application field is mixed with the pre-training data in the general field to obtain mixed pre-training data.

4. The method according to claim 2, characterized in that: Also includes: The configured hybrid mode is displayed through the hybrid mode configuration interface, and the hybrid rules corresponding to the hybrid mode are displayed; In response to an editing operation on a mixing rule corresponding to any of the mixing modes, a new mixing rule of the mixing mode after editing is obtained, and the mixing rule corresponding to the mixing mode is updated; In response to a selection operation of any of the mixing modes, the selected mixing mode is used as a preset mixing mode currently in use.

5. The method according to claim 1, characterized in that The pre-trained model is further pre-trained using mixed pre-trained data of vertical fields and general fields to obtain a pre-trained domain basic model, including: Use mixed pre-training data from vertical and general domains to perform causal language construction on the pre-trained model. Simulate the pre-training task to continue pre-training the pre-trained model and obtain the pre-trained domain basic model.

6. The method according to claim 5, characterized in that The method uses mixed pre-training data of vertical fields and general fields to perform causal language modeling pre-training tasks on the pre-training model, and further pre-trains the pre-training model to obtain a pre-trained domain basic model, including: The mixed pre-training data includes text samples of multiple types, the text samples of the same type are spliced, and the splicing result is divided into multiple input samples based on a preset maximum input length to construct input sample sets of each type; According to the input sample sets of each type, a causal language modeling pre-training task is performed on the pre-trained model to achieve continued pre-training of the pre-trained model and obtain a pre-trained domain basic model.

7. The method according to claim 1, characterized in that The method of using the data set of the vertical field to fine-tune the basic model of the field to obtain a field model suitable for the vertical field includes: Using the constructed multi-task instruction dataset of the vertical field, the domain basic model is fine-tuned and trained to obtain a domain model suitable for the vertical field, wherein the instruction dataset contains multiple instruction data, and the instruction data includes task prompt format information, input information and output results, and different tasks use different task prompt format information.

8. The method according to claim 7, characterized in that Construct a multi-task instruction dataset in the vertical field, including: Acquire instruction data of multiple existing tasks in the vertical field, wherein the instruction data includes task prompt format information, input information, and output results, and different tasks use different task prompt format information; For at least one existing task's instruction data, generating new task's instruction data according to a corresponding task transformation rule; Based on the instruction data of the existing tasks and the new tasks, an instruction data set of multiple tasks in the vertical field is constructed.

9. The method according to claim 8, characterized in that The generating of instruction data of a new task from instruction data of at least one existing task according to a corresponding task transformation rule includes at least one of the following: Based on at least one instruction data of an existing task, according to the task simplification rule corresponding to the existing task, simplify the input information and / or output result in the instruction data of the existing task to obtain the input information and output result of the new task, and configure the task prompt format information of the new task; Based on at least one instruction data of an existing task, according to the task reversal rule corresponding to the existing task, the output result of the existing task is used as the input information of the new task, and the input information of the existing task is used as the output result of the new task, the input information and output result of the new task are constructed, and the task prompt format information of the new task is configured; Based on at least one instruction data of an existing task, according to the task reorganization rule corresponding to the existing task, the existing task The input information and output results of the task are split and reorganized to construct the input information and output results of the new task, and configure the task prompt format information of the new task.

10. The method according to any one of claims 1 to 9, characterized in that After fine-tuning the domain basic model using the data set of the vertical domain to obtain a domain model suitable for the vertical domain, the method further includes: In response to a task processing request for a natural language processing task in the vertical field, obtaining input data and task prompt format information of the natural language processing task; Generate task instructions according to the task prompt format information and input data; Inputting the task instruction into the domain model, performing task processing based on the task instruction through the domain model, and generating a task processing result; Output the task processing result.

11. A task processing method, characterized in that: include: Use mixed pre-training data from the e-commerce field and the general field to continue pre-training the pre-trained large model to obtain a pre-trained basic large model in the e-commerce field; Using the data set in the e-commerce field, fine-tuning and training are performed on the basic large model in the e-commerce field to obtain the large model in the e-commerce field. The large model in the e-commerce field is used to perform natural language processing tasks in the e-commerce field and generate corresponding task processing results.

12. The method according to claim 11, characterized in that Before the pre-training of the pre-trained large model using the mixed pre-training data of the e-commerce field and the general field to obtain the pre-trained basic large model of the e-commerce field, the method further includes: Build pre-training data in the e-commerce field; According to a preset mixing method, the pre-training data in the e-commerce field is mixed with the pre-training data in the general neighborhood to obtain mixed pre-training data.

13. A task processing method, characterized in that: Applicable to servers, including: A call request for a domain model sent by a receiving end-side device, wherein the call request includes a task instruction, and the task instruction is generated according to task prompt format information and input data of a natural language processing task to be executed; The task instruction is input into the domain model, and the domain model is used to perform task processing based on the task instruction to generate a task processing result, wherein the domain model is obtained by using mixed pre-trained data of vertical domains and general domains, continuing to pre-train the pre-trained model to obtain a pre-trained domain basic model, and then using the data set of the vertical domain to fine-tune the domain basic model; Return the task processing result to the terminal side device.

14. A server, characterized in that: include: at least one processor; as well as a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the server to execute the method described in any one of claims 1-13.

Citation Information

Patent Citations

  • Language model training method, text matching method and related device

    CN114626463A

  • Small sample text classification method based on field template pre-training

    CN115840820A

  • Task processing method and server

    CN117171325A

  • Adapting ai models from one domain to another

    US20220138552A1

  • Inter-training of pre-trained transformer-based language models using partitioning and classification

    US20230078698A1

Cited By

  • Method and device for building multi-dimensional large language model capability framework

    CN119918585A

  • Customizable AI agent management platform facing enterprise demands and management method thereof

    CN120046871A

  • Pre-training language model fine tuning method, reasoning service system, equipment and medium

    CN121352037A