Model data processing method, electronic device, and computer storage medium

By training and fine-tuning the graph neural network model in the downstream task stage, and combining it with the knowledge graph specific to the downstream task, the problem of insufficient knowledge graph coverage in the pre-training stage of the language model is solved, and the model is efficiently adapted and effectively processed in the downstream task.

CN115564017BActive Publication Date: 2026-03-31ALIBABA (CHINA) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-05
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

In existing technologies, the knowledge graphs used in the pre-training stage of language models are mostly limited to a limited number of specific domains, making it difficult to cover all domains. This results in the knowledge injection failing to play a role in downstream tasks, or even having a counterproductive effect, and failing to effectively handle highly specialized text processing tasks such as those in the medical field.

Method used

Instead of training the graph neural network model during the pre-training stage, the model is trained using a relatively small number of training samples during the downstream task stage. This is combined with the knowledge graph specific to the downstream task for training and fine-tuning, thereby achieving flexibility and adaptability in knowledge injection.

Benefits of technology

It reduces the computational cost of training graph neural network models, achieves flexibility and adaptability in knowledge injection, and enables the model to handle downstream tasks more effectively, especially achieving good results in text processing tasks in the medical field.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115564017B_ABST
    Figure CN115564017B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a model data processing method, an electronic device and a computer storage medium. The model data processing method comprises: obtaining an initial language model that has been pre-trained, a graph neural network model to be trained, and training samples corresponding to a preset task; training the graph neural network model using the training samples to obtain an initial graph neural network model; and fine-tuning the initial language model and the initial graph neural network model using the training samples to obtain a task model for the preset task. The embodiments of the present application provide the scheme, which no longer trains the graph neural network model in the pre-training stage, but trains the graph neural network model in the downstream task, i.e., the preset task stage. The number of samples is greatly reduced, the training computing power cost of the graph neural network model is reduced, the knowledge injection of the model is more flexible, and the model is more suitable for the downstream task, so that the finally obtained task model can more effectively process the downstream task.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a model data processing method, electronic device, and computer storage medium. Background Technology

[0002] Model pre-training involves first training a model (also known as a pre-trained model) on a primary task using a large number of training samples to obtain an initial model. Then, this model is used on the target task, and the initial model is fine-tuned using training samples specific to the target task to achieve the desired results. This process improves the efficiency of model training.

[0003] Language model pre-training is an important branch of model pre-training. Currently, the paradigm of language model pre-training plus fine-tuning achieves good results in most downstream target tasks. However, in some domains, such as the medical field, the text structure used in these domains differs significantly from that of general domain texts, resulting in numerous long-tail entity understanding problems. External knowledge is needed to improve the model's performance on text processing tasks in these domains. Therefore, knowledge injection technology has emerged.

[0004] One current knowledge injection technique involves introducing graph neural networks into the model pre-training stage to process knowledge graphs, thereby achieving knowledge injection into the model. However, different domains have different knowledge graphs, and the knowledge graphs used in the pre-training stage are often limited to a finite number of domain-specific graphs, making it difficult to cover all domains. Therefore, the injected knowledge may be ineffective or even counterproductive in downstream tasks, thus preventing the pre-trained language model from effectively handling downstream tasks. Summary of the Invention

[0005] In view of this, embodiments of this application provide a model data processing scheme to at least partially solve the above-mentioned problems.

[0006] According to a first aspect of the embodiments of this application, a model data processing method is provided, comprising: acquiring a pre-trained initial language model, a graph neural network model to be trained, and training samples corresponding to a preset task; training the graph neural network model using the training samples to obtain an initial graph neural network model; and fine-tuning the initial language model and the initial graph neural network model using the training samples to obtain a task model for the preset task.

[0007] According to a second aspect of the embodiments of this application, a model data processing method is provided, comprising: acquiring task data to be processed; inputting the task data into a corresponding task model, and obtaining a task result output by the task model; wherein the task model is a task model obtained according to the above method.

[0008] According to a third aspect of the embodiments of this application, a model data processing method is provided, comprising: acquiring item information query data; inputting the item information query data into a corresponding item information model, and obtaining an item information recognition result output by the item information model; wherein the item information model is a model obtained by the above method based on an e-commerce knowledge graph and e-commerce item sample data.

[0009] According to a fourth aspect of the embodiments of this application, a model data processing method is provided, comprising: acquiring medical data to be processed; inputting the medical data into a corresponding medical information processing model, and obtaining a medical data recognition result output by the medical information processing model; wherein the medical information processing model is a model obtained by the above method based on a medical knowledge graph and medical sample data.

[0010] According to a fifth aspect of the present application, an electronic device is provided, comprising: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other via the communication bus; the memory is used to store at least one executable instruction, wherein the executable instruction causes the processor to perform an operation corresponding to the method described in the first aspect.

[0011] According to a sixth aspect of the embodiments of this application, a computer storage medium is provided that stores a computer program thereon, which, when executed by a processor, implements the method described in the first aspect.

[0012] According to the solution provided in the embodiments of this application, the graph neural network model is no longer trained in the pre-training stage, but instead trained in the downstream task, i.e., the pre-defined task stage. Therefore, on the one hand, because the graph neural network model is trained using training samples from the downstream task, the number of these training samples is significantly reduced compared to the large number of training samples in the pre-training stage, thus lowering the computational cost of training the graph neural network model; on the other hand, it achieves decoupling of the knowledge graph from the pre-training stage, allowing the downstream task to use a knowledge graph more suitable for its task to train the graph neural network model, making the knowledge injection of the model more flexible and better adapted to the downstream task, thereby enabling the final task model to more effectively handle the downstream task. Attached Figure Description

[0013] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings.

[0014] Figure 1 This is a schematic diagram of an exemplary system for the model data processing method applicable to the embodiments of this application;

[0015] Figure 2A This is a flowchart illustrating the steps of a model data processing method according to Embodiment 1 of this application;

[0016] Figure 2B for Figure 2A A schematic diagram of a scenario example in the illustrated embodiment;

[0017] Figure 3A This is a flowchart illustrating the steps of a model data processing method according to Embodiment 2 of this application;

[0018] Figure 3B for Figure 3A A schematic diagram of a model in the embodiment shown;

[0019] Figure 4 This is a flowchart illustrating the steps of a model data processing method according to Embodiment 3 of this application;

[0020] Figure 5 This is a flowchart illustrating the steps of a model data processing method according to Embodiment 4 of this application;

[0021] Figure 6 This is a flowchart of the steps of a model data processing method according to Embodiment 5 of this application;

[0022] Figure 7 This is a schematic diagram of the structure of an electronic device according to Embodiment Six of this application. Detailed Implementation

[0023] To enable those skilled in the art to better understand the technical solutions in the embodiments of this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art should fall within the protection scope of the embodiments of this application.

[0024] The specific implementation of the embodiments of this application will be further described below with reference to the accompanying drawings.

[0025] Figure 1 An exemplary system for a model data processing method applicable to embodiments of this application is shown. For example... Figure 1 As shown, the system 100 may include a cloud server 102, a communication network 104, and / or one or more user devices 106. Figure 1 The example in the text shows multiple user devices.

[0026] The cloud server 102 can be any suitable device for storing information, data, programs, and / or any other suitable type of content, including but not limited to distributed storage system devices, server clusters, computing cloud server clusters, etc. In some embodiments, the cloud server 102 can perform any suitable function. For example, in some embodiments, the cloud server 102 can be used to pre-train an initial language model. As an optional example, in some embodiments, the cloud server 102 can be used to train the graph neural network model using the training samples to obtain an initial graph neural network model. As another example, in some embodiments, the cloud server 102 can be used to perform a preset task using a task model.

[0027] In some embodiments, communication network 104 may be any suitable combination of one or more wired and / or wireless networks. For example, communication network 104 may include any one or more of the following: the Internet, intranet, wide area network (WAN), local area network (LAN), wireless network, digital subscriber line (DSL) network, frame relay network, asynchronous transfer mode (ATM) network, virtual private network (VPN), and / or any other suitable communication network. User equipment 106 may be connected to communication network 104 via one or more communication links (e.g., communication link 112), and communication network 104 may be linked to cloud server 102 via one or more communication links (e.g., communication link 114). Communication links may be any communication link suitable for transmitting data between user equipment 106 and cloud server 102, such as network links, dial-up links, wireless links, hardwired links, any other suitable communication links, or any suitable combination of such links.

[0028] User device 106 may include any one or more user devices capable of initiating preset tasks or controlling the training process. In some embodiments, user device 106 may include any suitable type of device. For example, in some embodiments, user device 106 may include mobile devices, tablet computers, laptop computers, desktop computers, wearable computers, game consoles, media players, vehicle entertainment systems, and / or any other suitable type of user device.

[0029] Based on the above system, this application provides a model data processing method, which will be described below through several embodiments.

[0030] Example 1

[0031] Figure 2A A flowchart illustrating a model data processing method provided in this application embodiment is shown in the figure, which includes:

[0032] S201. Obtain the pre-trained initial language model, the graph neural network model to be trained, and the training samples corresponding to the preset task.

[0033] In this embodiment of the application, the language models can be any model capable of language processing, and can be applied to many fields related to language processing, such as sentence recognition and translation.

[0034] Model pre-training involves first training a model (also known as a pre-trained model) on a primary task using a large number of training samples to obtain an initial model. Then, this initial model is used on the target task, fine-tuned using training samples specific to the target task, resulting in a model capable of achieving the target task. This improves model training efficiency. Language model pre-training is an important branch of model pre-training, and currently, the paradigm of language model pre-training + fine-tuning achieves good results in most downstream target tasks.

[0035] In this embodiment, the initial language model can be a pre-trained language model that has not been fine-tuned.

[0036] Graph Neural Network Models (GNNs) are general deep learning architectures that can run on social networks or other graph-based data. They are a type of generalized neural network based on a graph structure. GNN models typically use the underlying graph as a computational graph and learn neural network primitives to generate single-node embedding vectors by passing, transforming, and aggregating node feature information across the entire graph.

[0037] In this embodiment, a graph neural network model can be used to provide the language model with the semantics of entities and the relationships between entities, thereby performing knowledge injection. Current pre-trained language models are typically trained on general corpora. Therefore, when used for more specialized downstream tasks (such as those in the medical field), they often fail to achieve good results. Therefore, by enabling the language model to utilize external knowledge (such as knowledge graphs), it is hoped that the model's performance on these tasks can be improved; that is, injecting external knowledge into the language model, which is called knowledge injection.

[0038] The training samples corresponding to the preset tasks can serve as training samples for downstream tasks. The specific content of the training samples can be determined based on the preset downstream tasks. If the downstream task is processing medical information, the training samples can be medical data; if the downstream task is querying item information, the training samples can be item information.

[0039] The training samples from the pre-defined tasks are used to train the graph neural network model in subsequent steps, as well as to fine-tune the initial language model and the initial graph neural network model. By training the graph neural network model using the training samples corresponding to the pre-defined tasks, the number of training samples is significantly reduced compared to the large number of training samples in the pre-training stage, thus reducing the computational cost of training the graph neural network model.

[0040] S202. The graph neural network model is trained using the training samples to obtain an initial graph neural network model.

[0041] When training a graph neural network (GNN) model, the aforementioned training samples can be used. These training samples may include knowledge graphs and task data samples corresponding to a preset task. Based on this, the GNN model can be trained. In this embodiment, the specific training method for the GNN model is not limited; an initial GNN model can be obtained based on the input of the training samples. In one feasible approach, the training samples can be input into the GNN model, and the output of the GNN model can be used as the input of an initial language model. The GNN model can then be adjusted based on the output of the initial language model. It should be noted that in this case, the parameters of the initial language model are not adjusted; only the parameters of the GNN model are adjusted.

[0042] In this embodiment, the initial graph neural network model can be used to inject knowledge into the language model. By training the graph neural network model using training samples corresponding to a preset task, the knowledge graph is decoupled from the pre-training stage. Downstream tasks can use a knowledge graph more suitable for their tasks to train the graph neural network model, making the knowledge injection of the model more flexible and more adapted to the downstream tasks. As a result, the final task model can more effectively handle the downstream tasks.

[0043] S203. Use the training samples to fine-tune the initial language model and the initial graph neural network model to obtain a task model for the preset task.

[0044] In this step, after the initial language model and the initial graph neural network model are obtained, that is, after the above models have undergone initial training, the training samples will be used to jointly fine-tune the two models to adjust the parameters of both models at the same time, so that they are more in line with the preset task, thereby obtaining the task model for the preset task after fine-tuning training.

[0045] For specific methods on fine-tuning the initial language model and the initial graph neural network model, please refer to the relevant techniques for model fine-tuning, which will not be elaborated here.

[0046] The following example illustrates the solution provided in this embodiment through a specific use case, with the preset task being medical information recognition.

[0047] See Figure 2B In this embodiment, the initial pre-trained language model, the graph neural network model to be trained, and the training samples corresponding to the preset task can be determined first.

[0048] For example, if the medical information is in Chinese, the initial language model is an initial language model pre-trained based on ordinary Chinese training samples; the graph neural network model to be trained can be any form of graph neural network model; the training samples corresponding to the preset task can include medical knowledge graphs and medical sample data.

[0049] Based on a medical knowledge graph, a graph neural network model can be trained to obtain an initial graph neural network model trained on medical information. To enable the initial graph neural network model and the initial language model to work together, and to ensure the initial language model can better process medical information, the initial language model and the initial graph neural network model can be fine-tuned based on medical sample data to obtain a task model for medical information recognition.

[0050] According to the solution provided in the embodiments of this application, the graph neural network model is no longer trained in the pre-training stage, but instead trained in the downstream task, i.e., the pre-defined task stage. Therefore, on the one hand, because the graph neural network model is trained using training samples from the downstream task, the number of these training samples is significantly reduced compared to the large number of training samples in the pre-training stage, thus lowering the computational cost of training the graph neural network model; on the other hand, it achieves decoupling of the knowledge graph from the pre-training stage, allowing the downstream task to use a knowledge graph more suitable for its task to train the graph neural network model, making the knowledge injection of the model more flexible and better adapted to the downstream task, thereby enabling the final task model to more effectively handle the downstream task.

[0051] Example 2

[0052] Figure 3AA flowchart illustrating a model data processing method provided in this application embodiment is shown in the figure, which includes:

[0053] S301. Obtain the pre-trained initial language model, the graph neural network model to be trained, and the training samples corresponding to the preset task. The training samples include the knowledge graph and task data samples corresponding to the preset task.

[0054] A knowledge graph is a structured semantic knowledge base composed of entities, relations, and attributes. Different domains can correspond to different entities and entity relations, thus forming different knowledge graphs. Task data samples can be sample data related to a preset task and used for model training.

[0055] For example, when the preset task is medical data recognition, the knowledge graph can be a knowledge graph in the medical field, and the task sample data can be medical information and the corresponding tags.

[0056] S302. Based on the task data sample, entity node data corresponding to the task data sample is filtered from the knowledge graph through attention calculation.

[0057] In this embodiment, since the knowledge graph corresponds to a large domain, but in actual tasks, only a portion of the knowledge within that domain may be used, attention computation is employed to select entity node data that is more critical to the current task's objective from the vast amount of information included in the knowledge graph, based on task sample data. This improves the quality of training samples used to train the graph neural network model. It should be noted that the extracted entity node data can include entity nodes and the connections between them.

[0058] Attention computation applicable to knowledge graphs can include three modes: Learn attention weights, Similarity-based attention, and Attention-guided walk. Learn attention weights utilize a parameter matrix to learn the relative importance between entity nodes and their neighbors, thereby filtering entity node data corresponding to the task data sample based on importance. Similarity-based attention calculates the similarity between entity node X and the entity node corresponding to the task data sample, and filters entity node data corresponding to the task data sample based on similarity. Attention-guided walk is based on the path taken during a walk within the knowledge graph influenced by the task data sample. The resulting path can be used to calculate the vector representation of the entity node at the path's starting point, thus filtering entity node data corresponding to the task data sample by influencing the walk path.

[0059] Furthermore, in this embodiment, similarity-based attention is preferred. To this end, this embodiment provides an attention-based computation scheme.

[0060] In one feasible approach, as described in this embodiment, an L-layer bidirectional encoder-decoder can be used to generate vectors for each entity node in the knowledge graph. Each layer can calculate the learnable linear matrix and bias vector of the entity node, thereby aggregating data of the entity node and other entity nodes connected to it. Then, when calculating similarity, a query vector q can be generated based on the task data samples. Where σ=tanh(·), and Let represent the learnable linear matrix and bias vector of the query vector at layer i, respectively, and S represent the semantic vector of the task data sample. At each layer, queries can be performed in the knowledge graph based on the query vector to obtain entity node data with high similarity to the task data sample.

[0061] Optionally, in this embodiment, step S302 may include: inputting the task data sample into the graph neural network model, whereby the graph neural network model uses attention calculation to determine the current entity node corresponding to the task data sample from the knowledge graph; determining multiple neighboring entity nodes corresponding to the current entity node based on the adjacency relationship corresponding to the current entity node; and aggregating the entity node data of the current entity node and the entity node data of the multiple neighboring entity nodes to obtain the entity node data corresponding to the task data sample. In this embodiment, the graph neural network model uses attention calculation to query the corresponding entity node data from the knowledge graph, which makes the queried entity node data more compatible with the graph neural network model, thereby improving the quality of the trained graph neural network model. In addition, during the query process, aggregating the multiple neighboring entity nodes determined by the adjacency relationship corresponding to the current entity node to obtain the entity node data corresponding to the task data sample can fully utilize the structural information in the knowledge graph, improving the quality of the determined entity node data.

[0062] S303. Train the graph neural network model based on the task data sample and the entity node data.

[0063] In this step, the entity node data corresponding to the task data samples, as well as the task data samples themselves, can be used as input to the graph neural network model to train the model. The specific training process is not limited in this embodiment. Furthermore, during the training of the graph neural network model, the model parameters of the initial language model remain unchanged.

[0064] S304. Use the training samples to fine-tune the initial language model and the initial graph neural network model to obtain a task model for the preset task.

[0065] Optionally, in this step, fine-tuning the initial language model and the initial graph neural network model using the training samples may include: using the training samples, based on a preset loss function, jointly fine-tuning the initial language model and the initial graph neural network model to obtain a corresponding loss value; and adjusting the model parameters of the initial language model and the model parameters of the initial graph neural network model according to the loss value.

[0066] For example, see Figure 3BAn exemplary initial language model includes: a first encoder for extracting semantic features from the task data samples to obtain corresponding sample semantic vectors; a second encoder for obtaining sample entity vectors corresponding to the sample language vectors, determined and output by the initial graph neural network model based on the sample semantic vectors; and a third encoder for performing task prediction based on the sample semantic vectors and the sample entity vectors to obtain task prediction results. Based on this initial language model, in this embodiment, the task data samples can be used as input to the first encoder, the entity node data as input to the graph neural network model, and the outputs of the first encoder and the graph neural network model as input to the second encoder. The outputs of the first encoder and the second encoder can be used as output to the third encoder. The parameters of the graph neural network model can be adjusted based on the output of the third encoder, and during this process, the parameters of the first encoder, second encoder, and third encoder in the initial language model remain unchanged.

[0067] Based on this, in this embodiment, when the structure of the language model is as follows Figure 3B As shown, the step of using the training samples and jointly fine-tuning the initial language model and the initial graph neural network model based on a preset loss function to obtain the corresponding loss value can be implemented as follows: The first encoder in the initial language model extracts semantic features from the task data samples to obtain corresponding sample semantic vectors; the second encoder in the initial language model obtains sample entity vectors corresponding to the sample language vectors, determined and output by the initial graph neural network model, based on the sample semantic vectors; the third encoder in the initial language model performs task prediction based on the sample semantic vectors and the sample entity vectors to obtain task prediction results; and the corresponding loss value is determined based on the task prediction results and the preset loss function.

[0068] For example, if ERNIE represents the language model and GAT represents the graph neural network model, then the above fine-tuning process can be represented by the following formula:

[0069]

[0070] in, The model parameters represent the language model. L represents the model parameters of the graph neural network model. fine-tuning The loss function represents the fine-tuning phase. This represents the variable value that minimizes the overall loss function of the model, including the language model and the graph neural network model.

[0071] For example, the first encoder can be used to determine the semantic feature vector of the task data sample; the second encoder is used to determine the sample entity vector of the semantic feature vector, that is, to determine the knowledge injection corresponding to the semantic feature vector; the third encoder is used to combine the semantic feature vector and the knowledge injection to perform task prediction and obtain the prediction result.

[0072] The following is based on Figure 3B Taking the illustrated model as an example, the solution provided in this embodiment will be explained through an exemplary training process. The training process can be divided into three stages, and the formulas for the three stages can be expressed as follows:

[0073] Phase 1 (Language Model Pre-training Phase):

[0074] Phase Two (Graph Neural Network Model Training Phase):

[0075] Phase Three (Fine-tuning Training Phase):

[0076] Among them, the above The model parameters represent the language model. The model parameters representing the graph neural network model; L pretraining L represents the loss function during the pre-training phase. fine-tuning This represents the loss function during the fine-tuning training phase. This represents the variable value that minimizes the loss function of the language model; This represents the variable value that minimizes the loss function of the graph neural network model; This represents the variable value that minimizes the overall loss function of the model, including the language model and the graph neural network model. It should be noted that the specific implementation of the loss function in each of the above stages can be selected by those skilled in the art based on actual needs, and the embodiments of this application do not limit the specific implementation form of the loss function.

[0077] As can be seen from the above formula, in this embodiment, the parameters of the language model are mainly adjusted during the pre-training stage to obtain the initial language model.

[0078] In the training phase of a graph neural network (GNN) model, to avoid performance loss during training, the parameters of the GNN model can be adjusted primarily, without adjusting the parameters of the language model, to obtain an initial GNN model. Training samples corresponding to pre-defined tasks can be used to train the GNN model, avoiding the need for large amounts of data and significantly reducing the number of training samples, thus lowering the computational cost of training the GNN model. Furthermore, the knowledge graph can be decoupled from the pre-training phase, allowing downstream tasks to use a more suitable knowledge graph to train the GNN model. This makes the knowledge injection into the model more flexible and better adapted to the downstream task, enabling the final task model to handle the downstream task more effectively.

[0079] During the fine-tuning training phase, the parameters of both the language model and the graph neural network model can be adjusted simultaneously, enabling the two models to work in coordination.

[0080] Compared with existing schemes for knowledge injection into pre-trained language models, the scheme provided in this application only requires training the graph neural network using the knowledge graph of the corresponding domain before fine-tuning the training task. This effectively solves the problem of large corpora and high overhead required for knowledge injection, and enables the trained graph neural network model to perform knowledge injection for the corresponding domain, thereby improving the efficiency of knowledge injection.

[0081] Example 3

[0082] Figure 4 A flowchart illustrating a model data processing method provided in this application embodiment is shown in the figure, which includes:

[0083] S401. Obtain the task data to be processed.

[0084] In this embodiment, the task data to be processed can be task data that matches the task model. For example, if the task model is used for product recommendation, the task data to be processed can be the preference data of the user to be recommended or the product query data; if the task model is used for drug recommendation, the task data to be processed can be the consultation information of the patient's medical records for the drug to be recommended.

[0085] S402. Input the task data into the corresponding task model and obtain the task result output by the task model.

[0086] In this embodiment, the task model is the task model obtained by the method provided in any of the above embodiments. The specific steps for obtaining the task model can be referred to in the above embodiments, and will not be repeated here.

[0087] Correspondingly, the task results output by the task model are also related to the specific task, such as product recognition results or medical consultation information recognition results, etc. This application embodiment does not limit this.

[0088] As can be seen from this embodiment, the task model trained through the aforementioned Embodiment 1 or 2 can be effectively applied to downstream tasks, improving the application flexibility and versatility of the task model.

[0089] Example 4

[0090] Figure 5 A flowchart illustrating a model data processing method provided in this application embodiment is shown in the figure, which includes:

[0091] S501, Obtain item information query data.

[0092] In this embodiment, the item information query data can be determined based on the input item query keywords or generated based on the user's item preference information; this embodiment does not limit this.

[0093] S502. Input the item information query data into the corresponding item information model and obtain the item information recognition result output by the item information model.

[0094] In this embodiment, the task model is the task model obtained by the method provided in any of the above embodiments. The specific steps for obtaining the task model can be referred to in the above embodiments, and will not be repeated here.

[0095] Optionally, in this embodiment, the method further includes: determining the corresponding item association information and / or the information of the item to be recommended based on the item information identification result.

[0096] In this embodiment, the item information identification result can be used to indicate the item category or item name. When making recommendations, it can also be expanded according to the item category or item name, that is, to determine the item association information to expand the items recommended to the user; or, the information of the item to be recommended, such as the advantages of the item, can be determined to make targeted recommendations to the user.

[0097] For example, if the item information recognition result is used to indicate a mobile phone, the corresponding key item information can be determined based on the mobile phone, such as a mobile phone stand or mobile phone case; or, a high-performance mobile phone or a mobile phone specifically for gaming can be identified and recommended.

[0098] As can be seen from this embodiment, applying the task model trained in Embodiment 1 or 2 to downstream tasks related to item information can achieve efficient item information recognition, and further task processing can be performed based on the recognition results. Furthermore, this task model has high applicability to downstream tasks and can better complete them.

[0099] Example 5

[0100] Figure 6 A flowchart illustrating a model data processing method provided in this application embodiment is shown in the figure, which includes:

[0101] S601. Obtain medical data to be processed.

[0102] In this embodiment, the medical data to be processed may be information related to online diagnosis and treatment of patients, etc., and this embodiment does not limit it.

[0103] S602. Input the medical data into the corresponding medical information processing model and obtain the medical data recognition result output by the medical information processing model.

[0104] In this embodiment, the task model is the task model obtained by the method provided in any of the above embodiments. The specific steps for obtaining the task model can be referred to in the above embodiments, and will not be repeated here.

[0105] Optionally, in this embodiment, the method further includes: determining corresponding diagnostic data and / or recommended drug information based on the medical data identification results.

[0106] In this embodiment, the medical data identification results can be used to indicate the possible diseases of the patient. Furthermore, based on the disease, corresponding diagnostic data, examination items that require further examination for diagnosis, and recommended drugs to relieve the patient's pain can be determined.

[0107] As can be seen from this embodiment, applying the task model trained in Embodiment 1 or 2 to downstream tasks related to online healthcare can achieve efficient medical data identification, and further task processing can be performed based on the identification results. Furthermore, this task model has high applicability to downstream tasks and can better accomplish them.

[0108] Example 6

[0109] Reference Figure 7 The diagram shows a structural schematic of an electronic device according to Embodiment Six of this application. The specific embodiments of this application do not limit the specific implementation of the electronic device.

[0110] like Figure 7As shown, the electronic device may include: a processor 702, a communications interface 704, a memory 706, and a communications bus 708.

[0111] in:

[0112] The processor 702, communication interface 704, and memory 706 communicate with each other via communication bus 708.

[0113] Communication interface 704 is used to communicate with other electronic devices or servers.

[0114] The processor 702 is used to execute program 710, specifically to perform the relevant steps in the above-described model data processing method embodiment.

[0115] Specifically, program 710 may include program code that includes computer operation instructions.

[0116] The processor 702 may be a CPU, an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application. The smart device includes one or more processors, which may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.

[0117] Memory 706 is used to store program 710. Memory 706 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.

[0118] Specifically, program 710 can be used to cause processor 702 to perform the operation corresponding to the model data processing method described in any of the foregoing multiple method embodiments.

[0119] The specific implementation of each step in program 710 can be found in the corresponding steps and units described in the above method embodiments, and has corresponding beneficial effects, which will not be repeated here. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the devices and modules described above can be referred to the corresponding process descriptions in the foregoing method embodiments, and will not be repeated here.

[0120] This application also provides a computer storage medium storing a computer program that, when executed by a processor, implements any of the model data processing methods described in the above-described method embodiments.

[0121] This application also provides a computer program product, including computer instructions that instruct a computing device to perform an operation corresponding to any of the model data processing methods in the above-described multiple method embodiments.

[0122] It should be noted that, depending on the implementation needs, the various components / steps described in the embodiments of this application can be broken down into more components / steps, or two or more components / steps or parts of the operation of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of this application.

[0123] The methods described in the embodiments of this application can be implemented in hardware, firmware, or as software or computer code that can be stored in a recording medium (such as CD-ROM, RAM, floppy disk, hard disk, or magneto-optical disk), or as computer code originally stored on a remote recording medium or a non-transitory machine-readable medium and subsequently stored on a local recording medium, downloaded over a network. Thus, the methods described herein can be processed by software stored on a recording medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware (such as an ASIC or FPGA). It is understood that the computer, processor, microprocessor controller, or programmable hardware includes storage components (e.g., RAM, ROM, flash memory, etc.) capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods described herein. Furthermore, when a general-purpose computer accesses code used to implement the methods shown herein, the execution of the code transforms the general-purpose computer into a dedicated computer for executing the methods shown herein.

[0124] Those skilled in the art will recognize that the units and method steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of this application.

[0125] The above embodiments are only used to illustrate the embodiments of this application, and are not intended to limit the embodiments of this application. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the embodiments of this application. Therefore, all equivalent technical solutions also fall within the scope of the embodiments of this application, and the patent protection scope of the embodiments of this application should be defined by the claims.

Claims

1. A model data processing method, comprising: obtaining an initial language model that has been pre-trained, a graph neural network model to be trained, and training samples corresponding to a preset task, wherein the training samples comprise text samples; training the graph neural network model using the training samples to obtain an initial graph neural network model; fine-tuning the pre-trained initial language model and the initial graph neural network model using the training samples to obtain a task model for the preset task; wherein training the graph neural network model using the training samples to obtain an initial graph neural network model comprises: inputting the training samples into the graph neural network model to obtain an output of the graph neural network model; inputting the output of the graph neural network model into the pre-trained initial language model to obtain an output of the pre-trained initial language model; and adjusting the graph neural network model according to the output of the pre-trained initial language model to obtain the initial graph neural network model.

2. The method of claim 1, wherein, The training samples comprise a knowledge graph corresponding to the preset task and task data samples.

3. The method of claim 2, wherein, The training of the graph neural network model using the training samples comprises: filtering entity node data corresponding to the task data samples from the knowledge graph through attention calculation based on the task data samples; training the graph neural network model according to the task data samples and the entity node data.

4. The method of claim 3, wherein, The filtering of the entity node data corresponding to the task data samples from the knowledge graph through attention calculation based on the task data samples comprises: inputting the task data samples into the graph neural network model to determine, by the graph neural network model using attention calculation, a current entity node corresponding to the task data samples from the knowledge graph; determining a plurality of neighbor entity nodes corresponding to the current entity node according to adjacency relationships corresponding to the current entity node; aggregating entity node data of the current entity node and entity node data of the plurality of neighbor entity nodes to obtain the entity node data corresponding to the task data samples.

5. The method according to any one of claims 1 to 4, wherein, In the training process of the graph neural network model, the model parameters of the initial language model remain unchanged.

6. The method according to any one of claims 2-4, wherein, The fine-tuning of the pre-trained initial language model and the initial graph neural network model using the training samples comprises: jointly fine-tuning the pre-trained initial language model and the initial graph neural network model based on a preset loss function using the training samples to obtain a corresponding loss value; adjusting model parameters of the pre-trained initial language model and model parameters of the initial graph neural network model according to the loss value.

7. The method of claim 6, wherein, The jointly fine-tuning of the pre-trained initial language model and the initial graph neural network model based on a preset loss function using the training samples to obtain a corresponding loss value comprises: performing semantic feature extraction on the task data samples through a first encoder in the pre-trained initial language model to obtain a corresponding sample semantic vector; obtaining, by a second encoder in the pre-trained initial language model, a sample entity vector corresponding to the sample semantic vector determined and output by the initial graph neural network model based on the sample semantic vector; obtaining, by a third encoder in the pre-trained initial language model, a task prediction result based on the sample semantic vector and the sample entity vector; determining a corresponding loss value according to the task prediction result and a preset loss function.

8. A model data processing method, comprising: obtaining task data to be processed; inputting the task data into a corresponding task model and obtaining a task result output by the task model; wherein the task model is obtained according to any one of the methods of claims 1-7.

9. A model data processing method, comprising: obtaining item information query data; inputting the item information query data into a corresponding item information model and obtaining an item information recognition result output by the item information model; wherein the item information model is a model obtained based on an e-commerce knowledge graph and e-commerce item sample data according to any one of the methods of claims 1-7.

10. The method of claim 9, wherein, The method further comprises: determining corresponding item association information and / or information of items to be recommended according to the item information recognition result.

11. A model data processing method, comprising: obtaining medical data to be processed; inputting the medical data into a corresponding medical information processing model and obtaining a medical data recognition result output by the medical information processing model; wherein the medical information processing model is a model obtained based on a medical knowledge graph and medical sample data according to any one of the methods of claims 1-7.

12. The method of claim 11, wherein, The method further comprises: determining corresponding diagnosis data and / or information of recommended drugs according to the medical data recognition result.

13. An electronic device comprising: a processor, a memory, a communication interface, and a communication bus, the processor, the memory, and the communication interface completing communication with each other through the communication bus; The memory is used to store at least one executable instruction, and the executable instruction makes the processor execute the corresponding operation of the method in any one of claims 1-12.

14. A computer storage medium having a computer program stored thereon, the program being executed by a processor to implement the method of any one of claims 1-12.