Data processing method and related device
By integrating collaborative knowledge and semantic knowledge in the recommendation model, using multiple iteration processes and the semantic features of the pre-trained language model, the problem of low accuracy of the traditional recommendation model is solved, and a more accurate and efficient recommendation effect is achieved.
Patent Information
- Application Number
- PCT/CN2024/111407
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-09-18
- Filing Date
- 2024-08-12
- Publication Date
- 2025-03-27
AI Technical Summary
When performing online recommendation, the traditional recommendation model has low accuracy and can only use the coordinated information between the user and historical items, which lacks semantic understanding, resulting in inaccurate recommendation results.
By using multiple sets of first training data and pre-trained language models, the recommended model is trained, and multiple iterations are adopted to obtain semantic features, and the recommended model is updated based on these features to blend collaborative knowledge and semantic knowledge.
Improves the accuracy of the recommended model, so that the model can provide more accurate recommendation results without increasing architectural complexity while ensuring lower latency.
Smart Images

Figure CN2024111407_27032025_PF_FP_ABST
Abstract
Description
A data processing method and related equipment
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on September 18, 2023, with Chinese application number 202311210842.5 and application name “A data processing method and related equipment”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of artificial intelligence technology, and in particular to a data processing method and related equipment. Background Art
[0003] Artificial Intelligence (AI) is the theory, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, to perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a branch of computer science that seeks to understand the essence of intelligence and produce new intelligent machines that can respond in a manner similar to human intelligence. AI also studies the design principles and implementation methods of various intelligent machines, enabling them to possess the capabilities of perception, reasoning, and decision-making. Research in the field of AI includes robotics, natural language processing, computer vision, decision-making and reasoning, human-computer interaction, recommendation and search, and basic AI theory.
[0004] In scenarios such as recommendation systems, search engines, or advertising push, recommendation models are often used to identify the data (such as items, information, and advertisements) that users are most interested in from massive amounts of data.
[0005] Traditional recommendation models leverage user behavior data and item attributes to predict user interest in new items by calculating similarities and building user-item relationship models. These models typically have a simple architecture, resulting in low latency for online recommendations. However, these models typically rely solely on collaborative information between users and historical items, with limited available reference information, often resulting in inaccurate recommendations. This translates to low precision.
[0006] Summary of the Invention
[0007] The present invention provides a data processing method that can improve the accuracy of a recommendation model. The present invention also provides corresponding devices, equipment, computer-readable storage media, and computer program products.
[0008] A first aspect of the present application provides a data processing method, which includes: training a recommendation model based on multiple groups of first training data and pre-trained language models to obtain a trained recommendation model, wherein the training process includes multiple iterative processes, and any first training data includes attribute information of the user and attribute information of objects related to the user; in the nth iteration process of the multiple iterative processes, the method includes: obtaining the first training data of the nth iteration process, where n is a positive integer; obtaining the semantic features of the first training data of the nth iteration process through the pre-trained language model of the nth iteration process; and updating the recommendation model of the nth iteration process based on the semantic features of the nth iteration process and the first training data of the nth iteration process to obtain a recommendation model after the nth iteration process.
[0009] In the first aspect, the recommendation model can be trained using a pre-trained language model and the first training data, so that the trained recommendation model can not only learn the collaborative information carried by the first training data itself, but also learn the semantic knowledge carried by the pre-trained language model. This allows the trained recommendation model to integrate collaborative knowledge and semantic knowledge to achieve recommendation tasks, thereby improving the accuracy of recommendations. At the same time, it does not overly complicate the architecture of the recommendation model, thereby ensuring better latency.
[0010] In a possible implementation of the first aspect, based on the semantic features of the n-th iteration process and the first training data of the n-th iteration process, the recommendation model of the n-th iteration process is updated to obtain the recommendation model after the n-th iteration process, including: masking the first training data of the n-th iteration process to obtain the masked first training data of the n-th iteration process; inputting the masked first training data of the n-th iteration process into the recommendation model of the n-th iteration process to obtain the first feature corresponding to the masked first training data of the n-th iteration process; according to the first feature and the semantic features of the first training data of the n-th iteration process, obtaining a prediction result of the mask in the masked first training data of the n-th iteration process through the mask prediction network corresponding to the recommendation model of the n-th iteration process; according to the prediction result corresponding to the n-th iteration process, the recommendation model of the n-th iteration process is updated to obtain the recommendation model after the n-th iteration process.
[0011] In this possible implementation, the recommendation model and the corresponding prediction network can use the semantic representation of the pre-trained language model and the representation of the first training data by the recommendation model (that is, the first feature) to restore the masked part of the first training data in the nth iteration process, so that the recommendation model can perceive the deep information of the first training data including collaborative information and the corresponding semantic features at the feature level, thereby providing a better feature information foundation for the execution of subsequent recommendation tasks.
[0012] In a possible implementation of the first aspect, in the nth iteration process of multiple iteration processes, the method further includes: inputting the first training data of the nth iteration process into the recommendation model of the nth iteration process to obtain the second feature corresponding to the first training data of the nth iteration process; updating the recommendation model of the nth iteration process according to the prediction result of the mask corresponding to the nth iteration process to obtain the recommendation model after the nth iteration process, including: updating the recommendation model of the nth iteration process according to the second feature and the semantic feature of the first training data of the nth iteration process, and according to the prediction result of the mask corresponding to the nth iteration process to obtain the recommendation model after the nth iteration process.
[0013] In this possible implementation method, the second feature can be aligned with the semantic feature of the first training data of the nth iteration process based on comparative learning, model distillation, etc., to obtain the alignment result of the second feature and the semantic feature of the first training data of the nth iteration process, and then according to the alignment result and the accuracy of the prediction result of the mask corresponding to the nth iteration process, the recommendation model of the nth iteration process is updated to obtain the recommendation model after the nth iteration process.
[0014] In a possible implementation of the first aspect, the recommendation model of the nth iteration process is updated according to the alignment result of the second feature and the semantic feature of the first training data of the nth iteration process, and the prediction result of the mask corresponding to the nth iteration process, to obtain the recommendation model after the nth iteration process, including: using a loss function, according to the second feature and the semantic feature of the first training data of the nth iteration process, and the prediction result of the mask corresponding to the nth iteration process, calculating the loss value, the loss function including a first loss term and a second loss term, the first loss term is used to evaluate whether the second feature and the semantic feature of the first training data of the nth iteration process are aligned, and the second loss term is used to evaluate whether the prediction result of the mask corresponding to the nth iteration process is accurate; according to the loss value, the recommendation model of the nth iteration process is updated to obtain the recommendation model after the nth iteration process.
[0015] In this possible implementation, the semantic representation of the pre-trained language model can be aligned with the relevant representation of the recommendation model at the sample level through comparative learning and other methods, so that the knowledge of the language model and the knowledge of the recommendation model can be fully integrated in the implicit space to achieve feature alignment at the sample level, thereby enabling information from different modalities to be more fully integrated.
[0016] In this way, not only can collaborative information and semantic information be jointly modeled at the fine-grained feature level, but also through sample-level feature alignment, information from different modalities such as text and tables can be more fully integrated, thereby enhancing the capabilities of the trained recommendation model and improving the corresponding prediction accuracy. At the same time, the recommendation model can still maintain a relatively lightweight framework, and while enhancing its capabilities, it can ensure high efficiency in the subsequent reasoning stage.
[0017] In a possible implementation of the first aspect, the first training data of the nth iterative process is data of a first modality, which is different from the text modality; obtaining semantic features of the first training data of the nth iterative process through a pre-trained language model includes: performing modality conversion on the first training data of the nth iterative process to obtain text data corresponding to the first training data of the nth iterative process; and inputting the text data of the nth iterative process into the pre-trained language model of the nth iterative process to obtain semantic features of the first training data of the nth iterative process.
[0018] In this possible implementation, the first training data of the nth iteration process is modally converted to obtain text data corresponding to the first training data of the nth iteration process, so that feature extraction can be performed on the text data through a pre-trained language model to obtain corresponding semantic features.
[0019] In a possible implementation of the first aspect, training a recommendation model based on multiple sets of first training data and a pre-trained language model to obtain a trained recommendation model includes: training the pre-trained language model and the recommendation model based on the multiple sets of first training data to obtain a trained recommendation model and a trained pre-trained language model; in the nth iteration of the multiple iterations, the method further includes: inputting the first training data of the nth iteration into the recommendation model of the nth iteration to obtain a second feature corresponding to the first training data of the nth iteration; and training the pre-trained language model of the nth iteration based on the second feature and the first training data of the nth iteration to obtain a pre-trained language model after the nth iteration.
[0020] In this possible implementation, during the training process, not only the recommendation model can be trained, but also the pre-trained language model can be trained. For example, based on comparative learning, model distillation, etc., the second feature can be aligned with the semantic feature of the first training data of the n-th iteration process to obtain the alignment result of the second feature with the semantic feature of the first training data of the n-th iteration process, and then according to the alignment result and the accuracy of the prediction result of the mask corresponding to the n-th iteration process, the pre-trained language model of the n-th iteration process is updated to obtain the pre-trained language model after the n-th iteration process, so that the knowledge of the language model and the knowledge of the recommendation model can be fully integrated in the implicit space to achieve feature alignment at the sample level, so that information of different modalities can be more fully integrated. In this way, not only can collaborative information and semantic information be jointly modeled at the fine-grained feature level, but also through sample-level feature alignment, information of different modalities such as text and tables can be more fully integrated, thereby enhancing the ability of the trained pre-trained language model and improving the corresponding prediction accuracy.
[0021] In a possible implementation of the first aspect, the method further includes: obtaining second training data corresponding to the reasoning task; fine-tuning the target model based on the second training data to obtain a fine-tuned target model, where the target model includes a trained recommendation model and / or a trained pre-trained language model, and the fine-tuned target model is used to perform the reasoning task.
[0022] In this possible implementation, if the inference latency is considered, only the recommendation model can be fine-tuned; if the model effect is considered, the recommendation model and the pre-trained language model can be fine-tuned at the same time to more fully optimize the trained recommendation model and pre-trained language model and enhance the model's capabilities.
[0023] A second aspect of the present application provides a data processing device that has the functionality to implement the method of the first aspect or any possible implementation of the first aspect. This functionality can be implemented in hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the aforementioned functionality, such as a training module.
[0024] The third aspect of the present application provides an electronic device, which includes at least one processor, a memory, and computer-executable instructions stored in the memory and executable by the processor. When the computer-executable instructions are executed by the processor, the processor executes the method as described in the first aspect or any possible implementation of the first aspect.
[0025] The fourth aspect of the present application provides a computer-readable storage medium storing one or more computer-executable instructions. When the computer-executable instructions are executed by a processor, the processor executes the method as described in the first aspect or any possible implementation of the first aspect.
[0026] The fifth aspect of the present application provides a computer program product that stores one or more computer-executable instructions. The computer program product includes computer-executable instructions. When the computer-executable instructions are executed by a processor, the processor executes a method as described in the first aspect or any possible implementation of the first aspect.
[0027] A sixth aspect of the present application provides a chip system, which includes a processor for supporting an electronic device in implementing the functions involved in the first aspect or any possible implementation of the first aspect. In one possible design, the chip system may also include a memory for storing program instructions and data necessary for the electronic device. The chip system may be composed of a chip or may include a chip and other discrete devices.
[0028] Among them, the technical effects brought about by the second to sixth aspects or any possible implementation methods thereof can refer to the technical effects brought about by the first aspect or the relevant possible implementation methods of the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] FIG1 is an exemplary schematic diagram of a data processing method provided in an embodiment of the present application;
[0030] FIG2 is an exemplary schematic diagram of training a recommendation model and a pre-trained language model provided in an embodiment of the present application;
[0031] FIG3 is an exemplary schematic diagram of fine-tuning a trained model provided in an embodiment of the present application;
[0032] FIG4 is a schematic diagram of an exemplary scenario provided in an embodiment of the present application;
[0033] FIG5 is a schematic diagram of an embodiment of a data processing device provided in an embodiment of the present application;
[0034] FIG6 is a schematic structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0035] The following describes the embodiments of the present application in conjunction with the accompanying drawings. The terms used in the implementation methods of the present application are only used to explain the specific embodiments of the present application and are not intended to limit the present application.
[0036] Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0037] In this application, "at least one" means one or more, and "more" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchangeable where appropriate. This is merely a way of distinguishing objects with the same properties when describing them in the embodiments of this application. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a list of elements is not necessarily limited to those elements but may include other elements not expressly listed or inherent to such process, method, product, or apparatus.
[0038] Since the embodiments of the present application involve the application of a large number of neural networks, in order to facilitate understanding, the relevant terms and related concepts such as neural networks involved in the embodiments of the present application are first introduced below.
[0039] (1) Neural Network
[0040] A neural network can be composed of neural units. A neural unit can refer to an operation unit that takes xs (i.e., input data) and intercept 1 as input. The output of the operation unit can be:
[0041] Where s = 1, 2, ... n, n is a natural number greater than 1, Ws is the weight of xs, and b is the bias of the neural unit. f is the activation function of the neural unit, which is used to introduce nonlinear characteristics into the neural network to convert the input signal of the neural unit into the output signal. The output signal of the activation function can be used as the input of the next convolutional layer, and the activation function can be a sigmoid function. A neural network is a network formed by connecting multiple single neural units mentioned above, that is, the output of one neural unit can be the input of another neural unit. The input of each neural unit can be connected to the local receptive field of the previous layer to extract the features of the local receptive field. The local receptive field can be an area composed of several neural units.
[0042] (2) Loss Function
[0043] During neural network training, because we want the output of the neural network to be as close as possible to the desired predicted value, we can compare the current network's predicted value with the desired target value and then update the weight vector of each layer of the neural network based on the difference between the two. (Of course, there is usually an initialization process before the first update, which is to pre-configure the parameters for each layer in the deep neural network.) For example, if the network's prediction value is too high, the weight vector is adjusted to make it predict a lower value. This adjustment is continued until the neural network can predict the desired target value or a value very close to the desired target value. Therefore, it is necessary to predefine "how to compare the difference between the predicted value and the target value." This is the loss function (or objective function), which is an important equation used to measure the difference between the predicted value and the target value. For example, the loss function output value (loss) indicates a greater difference, so neural network training becomes a process of minimizing this loss as much as possible.
[0044] (3) Backpropagation algorithm
[0045] Neural networks can use the back propagation (BP) algorithm to correct the size of the parameters in the initial super-resolution model during training, reducing the reconstruction error loss of the super-resolution model. Specifically, the forward propagation of the input signal to the output generates an error loss. This error loss is then backpropagated to update the parameters of the initial super-resolution model, thereby converging the error loss. The BP algorithm is a backward propagation movement dominated by the error loss, aiming to obtain the optimal super-resolution model parameters, such as the weight matrix.
[0046] Currently, large-scale information retrieval systems (such as recommendation systems, search engines, or computational advertising) aim to provide users with the most interesting data (such as items, information, advertisements) by retrieving them from massive amounts of data (such as items, information, advertisements).
[0047] In practical applications, information retrieval systems usually use recommendation models to determine content of interest to users.
[0048] Traditional collaborative information-based recommendation models leverage user behavior data and item attributes to predict user interest in unknown items by calculating similarities and building user-item relationship models. The advantages of this traditional recommendation model lie in its simple architecture and low online inference latency.
[0049] However, traditional recommendation models can usually only make recommendations based on the collaborative information between users and historical items. There is less available reference information, which often makes the recommendation results inaccurate. In other words, the accuracy of traditional recommendation models is usually low.
[0050] Currently, when performing recommendation tasks based on pre-trained language models, the process typically involves extracting textual information about users and items and inputting it into the pre-trained language model for modeling. The advantage of this approach is that pre-trained language models typically possess strong semantic understanding and textual reasoning capabilities. They also possess a vast knowledge base, enabling them to mine semantic information from recommendation data. However, the disadvantage is that large pre-trained language models have a large number of parameters, which can lead to excessively high online latency. Furthermore, they struggle to model collaborative information between users and items, making them less effective than recommendation models based on collaborative information in most ranking scenarios.
[0051] Based on this, a data processing method is provided in an embodiment of the present application, which can realize the joint modeling of collaborative information and semantic information through a recommendation model, thereby making full use of multi-dimensional information to realize information recommendation while ensuring low latency.
[0052] The data processing method of the embodiment of the present application can be applied to an electronic device. The specific type of the electronic device is not limited here. For example, the electronic device can be a terminal device, a cloud server, a single server or a server cluster, or a virtual machine (VM) or a container.
[0053] The type of terminal device is not limited here. For example, the terminal device can be a mobile phone, a tablet computer, a computer with wireless transceiver function, a virtual reality (VR) terminal, an augmented reality (AR) terminal, a terminal in industrial control, a terminal in self-driving (such as a vehicle computer, an on-board computing platform, a domain controller, a sensor, etc.), a terminal in remote medical, a terminal in a smart grid, a terminal in transportation safety, a terminal in a smart city, a terminal in a smart home, a terminal in the Internet of Things (IoT), a wearable device, a robot, etc., or a combination of one or more of the following.
[0054] The recommendation scenarios involved in the embodiments of the present application may have various situations, which are not limited here. In different application scenarios, the types of recommended objects may have various situations.
[0055] For example, the recommendation scenario can be product recommendations in e-commerce apps, search engine result recommendations, application software (APP) recommendations in app stores, music recommendations, video recommendations, advertisement recommendations, etc. In different scenarios, the types of recommended objects can be links, apps, music, videos, advertisement push, or one or more items in online shopping platforms.
[0056] In the recommendation scenario, the recommendation model can be used to determine the recommendation probability or score of each object to be recommended relative to the user. Then, the relevant recommendation system (such as application market, search engine, advertising platform, audio and video application or other related application) can obtain the recommendation result based on the recommendation probability or score of each object to be recommended relative to the user. For example, the objects to be recommended can be sorted according to the recommendation probability or score and presented to the user through the corresponding application or terminal device.
[0057] In an embodiment of the present application, the recommendation model can be trained by an electronic device so that the trained recommendation model can realize the joint modeling of collaborative information and semantic information, thereby making full use of multi-dimensional information to realize information recommendation while ensuring low latency.
[0058] Specifically, the data processing method may include the following steps:
[0059] The recommendation model is trained according to the multiple sets of first training data and the pre-trained language model to obtain a trained recommendation model.
[0060] In the embodiment of the present application, there are many ways to obtain the first training data, which are not limited here.
[0061] Illustratively, the first training data may be obtained from an open source database or may be collected manually.
[0062] The first training data may include attribute information of the user and attribute information of objects related to the user.
[0063] The user's attribute information is used to describe the user's attributes. For example, the user's attribute information includes one or more of the user's name, number, gender, age, occupation, hobbies, etc.
[0064] User-related objects can be determined based on the user's historical data, for example, based on the user's historical behavior logs, etc. For example, taking the application market as an example, the user-related objects can include applications involved in the user's historical operations in the application market.
[0065] In different recommendation scenarios, the user-related objects can be different. For example, in an app market, the user-related objects are applications to be recommended, while in e-commerce apps, the user-related objects can be items to be recommended. Furthermore, the attribute information of objects can also vary in different recommendation scenarios. For example, the attribute information of the relevant objects in the app market may include: the name (identification), type, size, etc. of the app; while the attribute information of the relevant objects in an e-commerce app may include: the name of the item, its category, price range, etc.
[0066] In addition, the first training data may further include label information of the object.
[0067] The label information of each object can be determined based on the user's operation on the corresponding object (for example, based on the user's behavior log). For example, if the user performs an operation on the relevant object (such as downloading, clicking, or purchasing), the label of the relevant object can be 1, indicating that the object is a positive example; if the user does not perform an operation on the relevant object, or only browses it, the label of the relevant object can be 0, indicating that the object is a negative example.
[0068] The data format of the first training data is not limited here either.
[0069] Exemplarily, the first training data may be in a table form, a text form, a knowledge graph form, etc.
[0070] In the embodiment of the present application, it can be considered that the first training data carries collaborative information between the user and the corresponding object (eg, the object to be recommended).
[0071] Embodiments of the present application relate to a pre-trained language model. The pre-trained language model can be considered as a natural language sequence encoder, which encodes each word in the natural language sequence into a vector representation, thereby performing a prediction task. The pre-trained language model can be a language model that has been pre-trained. In the pre-training stage, the language model is trained on a language model task on large-scale unsupervised text and / or supervised text, thereby learning word representations. After the pre-training stage, the obtained pre-trained language model has a large amount of semantic knowledge and can capture the deep semantic features of the text.
[0072] Furthermore, the pre-trained language model can be fine-tuned to meet the needs of downstream prediction tasks. During the fine-tuning phase, the model is initialized using the parameters learned during the pre-training phase. Training on downstream tasks such as text classification and sequence labeling is performed in a relatively small number of steps, successfully transferring the semantic information learned during pre-training to the downstream tasks.
[0073] In an embodiment of the present application, the recommendation model can be trained using a pre-trained language model and the first training data, so that the trained recommendation model can not only learn the collaborative information carried by the first training data itself, but also learn the semantic knowledge carried by the pre-trained language model. This allows the trained recommendation model to integrate collaborative knowledge and semantic knowledge to achieve recommendation tasks, thereby improving the accuracy of recommendations. At the same time, it does not overly complicate the architecture of the recommendation model, and therefore, can ensure better latency.
[0074] The training process includes multiple iterations. The following takes the nth iteration of the multiple iterations as an example to describe the training process in detail. Where n is a positive integer, that is, the nth iteration can be any iteration in the multiple iterations.
[0075] Specifically, as shown in FIG1 , during the nth iteration, the method includes steps 101 - 103 .
[0076] Step 101: Obtain the first training data of the nth iteration process, where n is a positive integer.
[0077] The first training data may be stored locally on the electronic device executing the embodiment of the present application, or may be transmitted to the electronic device by other devices, or may be obtained by the electronic device through a web page or other applications.
[0078] Step 102: Obtain semantic features of the first training data of the nth iteration process through the pre-trained language model of the nth iteration process.
[0079] In the embodiments of the present application, the language model is trained on a large-scale unsupervised text and / or supervised text during the pre-training phase to perform language model tasks, thereby learning word representations. After the pre-training phase, the resulting pre-trained language model has a large amount of semantic knowledge and is able to capture the deep semantic features of the text.
[0080] Therefore, during the nth iteration, the semantic features of the first training data can be obtained by preprocessing the language model.
[0081] During the training process, the pre-trained language model may remain unchanged or may be fine-tuned as the training progresses, which is not limited in the embodiments of the present application.
[0082] In some examples, the data form of the first training data cannot meet the requirements of the pre-trained language model. Therefore, the first training data needs to be modally converted to obtain text modality data, which is then processed by the pre-trained language model.
[0083] Specifically, in some embodiments, the first training data of the nth iteration process is data of a first modality, which is different from a text modality;
[0084] The semantic features of the first training data of the nth iteration process are obtained through the pre-trained language model, including:
[0085] Performing modal conversion on the first training data of the nth iteration process to obtain text data corresponding to the first training data of the nth iteration process;
[0086] The text data of the nth iteration process is input into the pre-trained language model of the nth iteration process to obtain the semantic features of the first training data of the nth iteration process.
[0087] Exemplarily, the first mode may be a table mode, that is, the first training data of the nth iteration process is table data.
[0088] In this way, the first training data of the nth iteration process can be modally converted according to the preset data conversion rule to obtain text data corresponding to the first training data of the nth iteration process.
[0089] There can be many specific ways of this modal conversion, which are not limited in the embodiments of the present application.
[0090] A data conversion method is introduced below as an example.
[0091] In an example, the first training data of the nth iteration process is tabular data. Specifically, the first training data in tabular form is shown in Table 1 below.
[0092] Table 1: First training data in tabular form
[0093] For a first training data item shown in Table 1, the first training data may include user data describing attributes such as the user's age, gender, and occupation, and object data describing object attributes such as the name and category of movies the user has watched in the past.
[0094] Use "." as the separator between each attribute and "is" as the connector between the attribute name and the attribute value. For the first training data shown in Table 1, it can be converted into text data through modal conversion: "User ID is 217. Gender is female. Occupation is college student. Movie ID is 12. Movie name is XX. Movie category is drama."
[0095] In this way, the first training data of the nth iteration process is modally converted to obtain text data corresponding to the first training data of the nth iteration process, so that feature extraction can be performed on the text data through the pre-trained language model to obtain corresponding semantic features.
[0096] Step 103 : Based on the semantic features of the nth iteration process and the first training data of the nth iteration process, the recommendation model of the nth iteration process is updated to obtain a recommendation model after the nth iteration process.
[0097] In an embodiment of the present application, the recommendation model of the nth iteration process can be updated based on the semantic features of the nth iteration process and the first training data of the nth iteration process to obtain a recommendation model after the nth iteration process, so that the recommendation model after the nth iteration process can learn the collaborative information in the first training data and the semantic information related to the first training data.
[0098] If the recommendation model after the nth iteration process meets the preset convergence conditions (for example, convergence to a specified state or the number of iterations reaches a preset number, etc.), the recommendation model after the nth iteration process can be used as the trained recommendation model. Otherwise, the recommendation model after the nth iteration process can be used as the recommendation model for the n+1th iteration process and continue training.
[0099] In addition, in some embodiments, during the training process, not only the recommendation model can be trained, but also the pre-trained language model can be trained.
[0100] Specifically, in some embodiments, training a recommendation model based on multiple sets of first training data and a pre-trained language model to obtain a trained recommendation model includes:
[0101] The pre-trained language model and the recommendation model are trained according to the multiple sets of first training data to obtain a trained recommendation model and a trained pre-trained language model.
[0102] Below, the training process of the pre-trained language model and the recommendation model is introduced by way of example. It should be noted that, in different application scenarios, only the recommendation model can be trained, or only the pre-trained language model can be trained, or both the pre-trained language model and the recommendation model can be trained. In other words, in different application scenarios, the steps of the relevant embodiments of the training process of the pre-trained language model and the recommendation model can be performed in part or in full, and the embodiments of the present application do not limit this.
[0103] Specifically, in one embodiment, updating the recommendation model of the nth iteration process based on the semantic features of the nth iteration process and the first training data of the nth iteration process to obtain the recommendation model after the nth iteration process includes:
[0104] Performing mask processing on the first training data of the nth iteration process to obtain the masked first training data of the nth iteration process;
[0105] Inputting the masked first training data of the nth iteration process into the recommendation model of the nth iteration process to obtain a first feature corresponding to the masked first training data of the nth iteration process;
[0106] Obtaining a prediction result of the mask in the masked first training data of the nth iteration process by using a mask prediction network corresponding to the recommendation model of the nth iteration process according to the first feature and the semantic feature of the first training data of the nth iteration process;
[0107] According to the prediction result corresponding to the n-th iteration process, the recommendation model of the n-th iteration process is updated to obtain the recommendation model after the n-th iteration process.
[0108] In an embodiment of the present application, the first training data may be masked to train a recommendation model to predict the mask therein, thereby learning the corresponding representation information.
[0109] For example, for the first training data in the tabular form shown in Table 1, after masking the gender and the movie name, the masked first training data in the tabular form shown in Table 2 can be obtained.
[0110] Table 2: Masked tabular form of the first training data
[0111] Then, the masked first training data of the nth iteration process may be input into the recommendation model of the nth iteration process to obtain the first feature corresponding to the masked first training data of the nth iteration process.
[0112] Then, based on the first feature and the semantic feature of the first training data of the nth iteration process, the prediction result of the mask in the masked first training data of the nth iteration process can be obtained through the prediction network corresponding to the recommendation model of the nth iteration process.
[0113] In this way, the recommendation model and the corresponding prediction network can use the semantic representation of the pre-trained language model and the representation of the first training data by the recommendation model (that is, the first feature) to restore the masked part of the first training data in the nth iteration process, so that the recommendation model can perceive the deep information of the first training data including collaborative information and the corresponding semantic features at the feature level, thereby providing a better feature information foundation for the execution of subsequent recommendation tasks.
[0114] FIG2 is a schematic diagram showing an exemplary method for training a recommendation model and a pre-trained language model.
[0115] Among them, it can be seen that after the first training data in tabular form is modally converted and the corresponding text data is obtained, the text data "user ID is 217. Gender is female. Occupation is college student, movie ID is 12. Movie name is XX. Movie category is plot" can be input into the pre-trained language model to obtain the corresponding semantic features.
[0116] Furthermore, after the first training data is masked, it can be input into the recommendation model to obtain the corresponding first feature.
[0117] Then, the first feature and the semantic feature can be input into the mask prediction network corresponding to the recommendation model to obtain the prediction result of the corresponding mask, so that the recommendation model and the corresponding mask prediction network can be trained according to the difference between the prediction result of the mask and the true mask, so that the recommendation model can perceive the first training data including collaborative information and the deep information of the corresponding semantic feature at the feature level.
[0118] The specific structure of the mask prediction network corresponding to the recommendation model is not limited here.
[0119] In the example shown in Figure 2, the semantic feature and the first feature can be input into a cross-attention module, which is implemented based on a cross-attention mechanism, wherein the semantic feature can be input as a key and a value, and the first feature can be input as a query. The output of the cross-attention module can then be input into a prediction layer to obtain a prediction result for the corresponding mask. Exemplarily, the prediction layer can include a fully connected layer, etc.
[0120] In addition, in some embodiments, the semantic representation of the preprocessing language model and the representation of the recommendation model can be aligned so that the knowledge of the language model and the knowledge of the collaborative model are fully integrated in the implicit space, thereby further improving the performance of the model.
[0121] Specifically, in some embodiments, during the nth iteration of the multiple iterations, the method further includes:
[0122] Inputting the first training data of the nth iteration process into the recommendation model of the nth iteration process to obtain the second feature corresponding to the first training data of the nth iteration process;
[0123] According to the prediction result of the mask corresponding to the n-th iteration process, the recommendation model of the n-th iteration process is updated to obtain the recommendation model after the n-th iteration process, including:
[0124] According to the second feature and the semantic feature of the first training data of the nth iteration process, and according to the prediction result of the mask corresponding to the nth iteration process, the recommendation model of the nth iteration process is updated to obtain the recommendation model after the nth iteration process.
[0125] In an embodiment of the present application, the second feature can be aligned with the semantic feature of the first training data of the nth iteration process based on comparative learning, model distillation, etc., to obtain the alignment result of the second feature and the semantic feature of the first training data of the nth iteration process, and then according to the alignment result and the accuracy of the prediction result of the mask corresponding to the nth iteration process, the recommendation model of the nth iteration process is updated to obtain the recommendation model after the nth iteration process.
[0126] Specifically, in some embodiments, updating the recommendation model of the nth iteration process according to the alignment result of the second feature and the semantic feature of the first training data of the nth iteration process, and according to the prediction result of the mask corresponding to the nth iteration process, to obtain the recommendation model after the nth iteration process, includes:
[0127] A loss value is calculated based on the second feature and the semantic feature of the first training data of the n-th iteration process, and the prediction result of the mask corresponding to the n-th iteration process through a loss function. The loss function includes a first loss term and a second loss term. The first loss term is used to evaluate whether the second feature and the semantic feature of the first training data of the n-th iteration process are aligned, and the second loss term is used to evaluate whether the prediction result of the mask corresponding to the n-th iteration process is accurate.
[0128] According to the loss value, the recommendation model of the nth iteration process is updated to obtain the recommendation model after the nth iteration process.
[0129] In the example shown in Figure 2, the first training data in Table 1 can be input into the recommendation model to obtain the second feature obtained by the recommendation model processing the first training data in Table 1. Then, through methods such as comparative learning, the semantic representations of the pre-trained language model can be aligned with the relevant representations of the recommendation model at the sample level. This allows the knowledge of the language model and the recommendation model to be fully integrated in the implicit space, achieving feature alignment at the sample level and enabling more comprehensive integration of information from different modalities.
[0130] The specific setting method of the loss function is not limited here. For example, in one example, the first loss term may include the following:
[0131] Among them, B represents the size of the first training data, log represents the logarithmic function, exp represents the exponential function, and sim() represents the similarity calculation function. Represents the semantic features of the text data corresponding to the first training data, represents the second feature of the first training data, Representation of all text data, represents the loss of incorporating the knowledge of the pre-trained language model into the collaborative model, Represents the loss of incorporating the knowledge of the recommendation model into the pre-trained language model. ICL Represents the sum of the losses of the pre-trained language model and the recommendation model.
[0132] The second loss term can evaluate the difference between the prediction result of the mask corresponding to the n-th iteration process and the corresponding correct mask. For example, the second loss term can calculate the cross entropy loss between the prediction result of the mask corresponding to the n-th iteration process and the corresponding correct mask, etc.
[0133] In this way, not only can collaborative information and semantic information be jointly modeled at the fine-grained feature level, but also through sample-level feature alignment, information from different modalities such as text and tables can be more fully integrated, thereby enhancing the capabilities of the trained recommendation model and improving the corresponding prediction accuracy. At the same time, the recommendation model can still maintain a relatively lightweight framework, and while enhancing its capabilities, it can ensure high efficiency in the subsequent reasoning stage.
[0134] In addition, in some embodiments, during the training process, not only the recommendation model can be trained, but also the pre-trained language model can be trained.
[0135] Specifically, in the nth iteration of the multiple iterations, the method further includes:
[0136] Inputting the first training data of the nth iteration process into the recommendation model of the nth iteration process to obtain the second feature corresponding to the first training data of the nth iteration process;
[0137] The pre-trained language model of the n-th iteration process is trained based on the second feature and the first training data of the n-th iteration process to obtain a pre-trained language model after the n-th iteration process.
[0138] For example, the text data corresponding to the first training data of the nth iteration process can be masked to obtain the masked text data of the nth iteration process. Then, the masked text data of the nth iteration process is input into the pre-trained language model of the nth iteration process to obtain the third feature corresponding to the masked text data of the nth iteration process. Furthermore, the first training data of the nth iteration process is input into the recommendation model of the nth iteration process to obtain the second feature corresponding to the first training data of the nth iteration process.
[0139] Next, based on the third feature and the semantic features of the nth iteration process, a mask prediction network corresponding to the pre-trained language model of the nth iteration process can be used to obtain a prediction result for the mask in the masked text data of the nth iteration process. Then, based on the prediction result for the mask in the masked text data of the nth iteration process, the pre-trained language model of the nth iteration process can be updated to obtain a pre-trained language model after the nth iteration process.
[0140] Specifically, the pre-trained language model of the nth iteration process can be updated according to the second feature, the semantic feature of the nth iteration process, and the prediction result of the mask corresponding to the masked text data of the nth iteration process.
[0141] For example, a second loss function may be used to calculate a second loss value based on the second feature and the semantic feature of the first training data of the nth iteration process, and the prediction result of the mask in the masked text data of the nth iteration process. The second loss function includes a first loss term and a third loss term. The first loss term is used to evaluate whether the second feature and the semantic feature of the first training data of the nth iteration process are aligned, and the third loss term is used to evaluate whether the prediction result of the mask in the masked text data of the nth iteration process is accurate.
[0142] According to the second loss value, the recommendation model of the nth iteration process is updated to obtain the recommendation model after the nth iteration process.
[0143] In the example shown in Figure 2, the first training data shown in Table 1 can be converted into text data through modal conversion: "User ID is 217. Gender is female. Occupation is college student. Movie ID is 12. Movie name is XX. Movie category is drama."
[0144] After the text data is masked, the masked text data can be obtained: "User ID is 217. Gender is [mask]. Occupation is college student. Movie ID is 12. Movie title is [mask]. Movie category is drama."
[0145] The masked text data is input into the pre-trained language model to obtain a corresponding third feature. The third feature and the semantic feature can then be input into a mask prediction network corresponding to the pre-trained language model to obtain a mask prediction result corresponding to the masked text data. Based on the difference between the mask prediction result in the masked text data of the nth iteration and the corresponding true mask, the pre-trained language model and the mask prediction network corresponding to the pre-trained language model can be updated, so that the pre-trained language model can perceive the first training data including the collaborative information and the deep-level information of the corresponding semantic feature at the feature level.
[0146] In addition, the second feature can be aligned with the semantic feature of the first training data of the nth iteration process based on comparative learning, model distillation, etc., to obtain the alignment result of the second feature with the semantic feature of the first training data of the nth iteration process, and then the pre-trained language model of the nth iteration process is updated according to the alignment result and the accuracy of the prediction result of the mask corresponding to the nth iteration process to obtain the pre-trained language model after the nth iteration process, so that the knowledge of the pre-trained language model and the knowledge of the recommendation model can be fully integrated in the implicit space to achieve feature alignment at the sample level, so that information of different modalities can be more fully integrated. In this way, not only can collaborative information and semantic information be jointly modeled at the fine-grained feature level, but also through sample-level feature alignment, information of different modalities such as text and tables can be more fully integrated, thereby enhancing the ability of the pre-trained language model after training and improving the corresponding prediction accuracy.
[0147] The specific structure of the mask prediction network corresponding to the recommendation model is not limited here.
[0148] In the example shown in FIG2 , the semantic feature and the third feature can be fused by concatenation or other methods. The fused data can then be input into a prediction layer to obtain a prediction result of the mask in the corresponding masked text data. For example, the prediction layer can include a fully connected layer or the like.
[0149] In this way, the trained recommendation model and the trained pre-trained language model can be obtained through training to be used in subsequent recommendation tasks.
[0150] In addition, in some embodiments, fine-tuning can be performed according to the situation of the downstream task so that the trained model can better match the situation of the downstream task and obtain more accurate recommendation results.
[0151] Specifically, in some embodiments, the method further includes:
[0152] Obtaining second training data corresponding to the reasoning task;
[0153] According to the second training data, the target model is fine-tuned to obtain a fine-tuned target model, where the target model includes a trained recommendation model and / or a trained pre-trained language model, and the fine-tuned target model is used to perform reasoning tasks.
[0154] The specific content of the downstream reasoning task is not limited here. For example, the downstream reasoning task can be in various business scenarios such as e-commerce recommendation, music recommendation, game recommendation, advertising, application market, etc. The second training data can be collected based on the downstream reasoning task.
[0155] In an embodiment of the present application, as shown in FIG3 , there are three ways to perform fine-tuning, namely: (a) fine-tuning only the trained recommendation model. In this case, the target model may include the trained recommendation model and the prediction network corresponding to the trained recommendation model; (b) fine-tuning only the trained pre-trained language model. In this case, the target model may include the trained pre-trained language model and the prediction network corresponding to the trained pre-trained language model; (c) fine-tuning the pre-trained language model and the recommendation model together. In this case, the target model may include the trained recommendation model and the prediction network corresponding to the trained recommendation model, and the trained pre-trained language model and the prediction network corresponding to the trained pre-trained language model.
[0156] For example, if inference latency is a concern, only the recommendation model can be fine-tuned. If model performance is a concern, both the recommendation model and the pre-trained language model can be fine-tuned simultaneously to fully optimize the trained recommendation model and pre-trained language model and enhance the model's capabilities.
[0157] In the scenario shown in FIG4 , taking item recommendation as an example, an exemplary implementation of the embodiment of the present application may include the following steps:
[0158] 1) First, first training data in a tabular form can be obtained based on historical user behavior logs and item information in an item database, and the first training data in the tabular form can be converted into data in a textual form;
[0159] 2) Using the first training data in the table mode and the corresponding text data, combined with the pre-trained language model, to train the recommendation model to obtain a trained recommendation model;
[0160] 3) Fine-tune the trained recommendation model on downstream recommendation tasks, and then deploy the fine-tuned recommendation model online;
[0161] 4) After deploying the fine-tuned recommendation model to the online inference module, when a user request comes in, the recommendation model is used to score the user request and item information together, sort the items by the scoring results, and present the final result to the user in the form of an item list.
[0162] In addition, in the scenario shown in FIG4 , a set of candidate products that the user is interested in can be obtained through a recall module, etc., so as to obtain a corresponding item list by combining the candidate product set and the scoring results of the recommendation model.
[0163] Based on the method of any of the above embodiments, the inventors conducted experiments on three datasets: Movielens-1M, BookCrossing, and GoodReads. The experimental results are shown in Table 3:
[0164] Among them, the existing models adopted include: AFM, PNN, Wide&Deep, DeepFM, xDeepFM, AFN, AutoInt, DCNv2, CTRL, CTR-BERT, P5, PTab, and the model adopted by any of the above embodiments of the present application includes ALTctr(Ours) obtained by training the recommendation model, ALTlang(Ours) obtained by training the pre-trained language model, and ALTboth(Ours) obtained by training both the recommendation model and the pre-trained model.
[0165] The evaluation indicators of the above experiments include Area Under Curve (AUC), logistic loss (Logloss), and relative improvement (Rel.Impr).
[0166] AUC refers to the area under the receiver operating characteristic (ROC) curve and the coordinate axes. Logloss refers to the loss value of the loss function. Rel.Impr refers to the performance improvement of ALTboth (Ours) compared to the existing model obtained by training both the recommended model and the pre-trained model.
[0167] It can be seen that the performance of the model using any of the above embodiments of the present application is better than the above-mentioned existing recommendation models, and in terms of training and reasoning efficiency, the training and reasoning efficiency of the recommendation model using any of the above embodiments of the present application is close to that of the existing recommendation model, and compared with the pre-trained language model, the reasoning delay is significantly reduced.
[0168] That is to say, the trained recommendation model in the embodiment of the present application can jointly model collaborative information and semantic information, not only realizing fine-grained feature-level information fusion, but also considering sample-level knowledge fusion, so that the recommendation model can make full use of the semantic knowledge of the pre-trained language model, thereby improving the prediction effect; and, integrating the knowledge of the language model into the recommendation model, while improving the effect of the recommendation model, ensures the low latency characteristics of the model, is more in line with the deployment requirements in actual application scenarios, and achieves better prediction effects.
[0169] The data processing method provided in the embodiments of the present application has been described above from multiple aspects. The data processing device provided in the embodiments of the present application will be described below with reference to the accompanying drawings.
[0170] As shown in FIG5 , an embodiment of the present application provides a data processing device 50, which includes:
[0171] A training module 501 is configured to train a recommendation model based on multiple sets of first training data and a pre-trained language model to obtain a trained recommendation model, wherein the training process includes multiple iterations, and any first training data includes attribute information of a user and attribute information of objects related to the user;
[0172] In the nth iteration of the multiple iterations, the training module 501 includes an acquisition module 502 and a processing module 503:
[0173] The acquisition module 502 is used to obtain the first training data of the nth iteration process, where n is a positive integer;
[0174] The processing module 503 is used to:
[0175] Obtaining semantic features of the first training data of the nth iteration process through the pre-trained language model of the nth iteration process;
[0176] Based on the semantic features of the nth iteration process and the first training data of the nth iteration process, the recommendation model of the nth iteration process is updated to obtain a recommendation model after the nth iteration process.
[0177] Optionally, the processing module 503 is configured to:
[0178] Performing mask processing on the first training data of the nth iteration process to obtain the masked first training data of the nth iteration process;
[0179] Inputting the masked first training data of the nth iteration process into the recommendation model of the nth iteration process to obtain a first feature corresponding to the masked first training data of the nth iteration process;
[0180] Obtaining a prediction result of the mask in the masked first training data of the nth iteration process by using a mask prediction network corresponding to the recommendation model of the nth iteration process according to the first feature and the semantic feature of the first training data of the nth iteration process;
[0181] According to the prediction result corresponding to the n-th iteration process, the recommendation model of the n-th iteration process is updated to obtain the recommendation model after the n-th iteration process.
[0182] Optionally, the processing module 503 is configured to:
[0183] Inputting the first training data of the nth iteration process into the recommendation model of the nth iteration process to obtain the second feature corresponding to the first training data of the nth iteration process;
[0184] According to the second feature and the semantic feature of the first training data of the nth iteration process, and according to the prediction result of the mask corresponding to the nth iteration process, the recommendation model of the nth iteration process is updated to obtain the recommendation model after the nth iteration process.
[0185] Optionally, the processing module 503 is configured to:
[0186] A loss value is calculated based on the second feature and the semantic feature of the first training data of the n-th iteration process, and the prediction result of the mask corresponding to the n-th iteration process through a loss function. The loss function includes a first loss term and a second loss term. The first loss term is used to evaluate whether the second feature and the semantic feature of the first training data of the n-th iteration process are aligned, and the second loss term is used to evaluate whether the prediction result of the mask corresponding to the n-th iteration process is accurate.
[0187] According to the loss value, the recommendation model of the nth iteration process is updated to obtain the recommendation model after the nth iteration process.
[0188] Optionally, the first training data of the nth iteration process is data of a first modality, and the first modality is different from the text modality;
[0189] The processing module 503 is used to:
[0190] Performing modal conversion on the first training data of the nth iteration process to obtain text data corresponding to the first training data of the nth iteration process;
[0191] The text data of the nth iteration process is input into the pre-trained language model of the nth iteration process to obtain the semantic features of the first training data of the nth iteration process.
[0192] Optionally, the processing module 503 is configured to:
[0193] Training the pre-trained language model and the recommendation model according to the multiple sets of first training data to obtain a trained recommendation model and a trained pre-trained language model;
[0194] In the nth iteration of the multiple iterations, the processing module 503 is further configured to:
[0195] Inputting the first training data of the nth iteration process into the recommendation model of the nth iteration process to obtain the second feature corresponding to the first training data of the nth iteration process;
[0196] The pre-trained language model of the n-th iteration process is trained based on the second feature and the first training data of the n-th iteration process to obtain a pre-trained language model after the n-th iteration process.
[0197] Optionally, the acquisition module 502 is further configured to: acquire second training data corresponding to the reasoning task;
[0198] The processing module 503 is also used to: fine-tune the target model according to the second training data to obtain a fine-tuned target model, where the target model includes a trained recommendation model and / or a trained pre-trained language model, and the fine-tuned target model is used to perform reasoning tasks.
[0199] FIG6 is a schematic diagram of a possible logical structure of an electronic device 60 provided in an embodiment of the present application. The electronic device 60 is used to implement the functions of the electronic device involved in any of the above embodiments. The electronic device 60 includes a memory 601, a processor 602, a communication interface 603, and a bus 604. The memory 601, processor 602, and communication interface 603 are interconnected via bus 604.
[0200] The memory 601 may be a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 601 may store programs. When the program stored in the memory 601 is executed by the processor 602, the processor 602 and the communication interface 603 are used to perform one or more steps in the above-described data processing method embodiment.
[0201] The processor 602 can be a central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), a graphics processing unit (GPU), a digital signal processor (DSP), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component or any combination thereof, used to execute relevant programs to implement the functions required to be executed by the training module in the data processing device in the above embodiment, or to execute one or more steps in the embodiment of the method of the present application. The steps of the method disclosed in conjunction with the embodiment of the present application can be executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 601, and the processor 602 reads the information in the memory 601 and executes one or more steps in the above-mentioned data processing method embodiment in combination with its hardware.
[0202] The communication interface 603 uses a transceiver device such as, but not limited to, a transceiver to implement communication between the electronic device 60 and other devices or a communication network.
[0203] Bus 604 provides a pathway for transmitting information between the various components of electronic device 60 (e.g., memory 601, processor 602, and communication interface 603). Bus 604 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, for example. Buses can be categorized as address buses, data buses, control buses, and the like. For ease of illustration, FIG6 shows a single thick line, but this does not imply that there is only one bus or only one type of bus.
[0204] In another embodiment of the present application, a computer-readable storage medium is provided, in which computer-executable instructions are stored. When the processor of the device executes the computer-executable instructions, the device executes the steps executed by the processor in Figure 6 above.
[0205] In another embodiment of the present application, a computer program product is also provided, which includes computer execution instructions stored in a computer-readable storage medium; when the processor of the device executes the computer execution instructions, the device executes the steps performed by the processor in Figure 6 above.
[0206] In another embodiment of the present application, a chip system is provided, comprising a processor configured to implement the steps performed by the processor in FIG. 6 . In one possible design, the chip system may further comprise a memory configured to store program instructions and data necessary for data writing. The chip system may be comprised of a chip alone or may include a chip and other discrete components.
[0207] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0208] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.
[0209] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0210] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0211] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
Claims
1. A data processing method, characterized in that: The method comprises: Training the recommendation model according to the multiple sets of first training data and the pre-trained language model to obtain a trained recommendation model, wherein the training process includes multiple iterations, and any of the first training data includes attribute information of the user and attribute information of objects related to the user; In an nth iteration of the multiple iterations, the method comprises: Obtaining the first training data of the nth iteration process, where n is a positive integer; Obtaining semantic features of first training data of the nth iteration process through the pre-trained language model of the nth iteration process; Based on the semantic features of the nth iteration process and the first training data of the nth iteration process, the recommendation model of the nth iteration process is updated to obtain the recommendation model after the nth iteration process.
2. The method according to claim 1, characterized in that The updating of the recommendation model of the nth iteration process based on the semantic features of the nth iteration process and the first training data of the nth iteration process to obtain the recommendation model after the nth iteration process includes: Performing mask processing on the first training data of the nth iteration process to obtain the masked first training data of the nth iteration process; Inputting the masked first training data of the nth iteration process into the recommendation model of the nth iteration process to obtain a first feature corresponding to the masked first training data of the nth iteration process; Obtaining a prediction result of a mask in the masked first training data of the nth iteration process through a mask prediction network corresponding to the recommendation model of the nth iteration process according to the first feature and the semantic feature of the first training data of the nth iteration process; According to the prediction result corresponding to the nth iteration process, the recommendation model of the nth iteration process is updated to obtain the recommendation model after the nth iteration process.
3. The method according to claim 2, characterized in that In an nth iteration of the multiple iterations, the method further comprises: Inputting the first training data of the nth iteration process into the recommendation model of the nth iteration process to obtain a second feature corresponding to the first training data of the nth iteration process; The updating of the recommendation model of the nth iteration process according to the prediction result of the mask corresponding to the nth iteration process to obtain the recommendation model after the nth iteration process includes: According to the second feature and the semantic feature of the first training data of the nth iteration process, and according to the prediction result of the mask corresponding to the nth iteration process, the recommendation model of the nth iteration process is updated to obtain the recommendation model after the nth iteration process.
4. The method according to claim 3, characterized in that The updating of the recommendation model of the nth iteration process according to the alignment result of the second feature and the semantic feature of the first training data of the nth iteration process and the prediction result of the mask corresponding to the nth iteration process to obtain the recommendation model after the nth iteration process includes: Calculating a loss value according to the second feature and the semantic feature of the first training data of the n-th iteration process, and according to the prediction result of the mask corresponding to the n-th iteration process, through a loss function, wherein the loss function includes a first loss term and a second loss term, the first loss term is used to evaluate whether the second feature and the semantic feature of the first training data of the n-th iteration process are aligned, and the second loss term is used to evaluate whether the prediction result of the mask corresponding to the n-th iteration process is accurate; The recommendation model of the nth iteration process is updated according to the loss value to obtain a recommendation model after the nth iteration process.
5. The method according to any one of claims 1 to 4, characterized in that: The first training data of the nth iteration process is data of a first modality, and the first modality is different from a text modality; The obtaining of the semantic features of the first training data of the nth iteration process by the pre-trained language model includes: Performing modal conversion on the first training data of the nth iteration process to obtain text data corresponding to the first training data of the nth iteration process; The text data of the nth iteration process is input into the pre-trained language model of the nth iteration process to obtain the semantic features of the first training data of the nth iteration process.
6. The method according to any one of claims 1 to 5, characterized in that: The step of training the recommendation model according to the plurality of sets of first training data and the pre-trained language model to obtain the trained recommendation model includes: According to the plurality of groups of first training data, the pre-trained language model and the recommendation model are trained to obtain a trained recommendation model and a trained pre-trained language model; In an nth iteration of the multiple iterations, the method further comprises: Inputting the first training data of the nth iteration process into the recommendation model of the nth iteration process to obtain a second feature corresponding to the first training data of the nth iteration process; Based on the second feature and the first training data of the nth iteration process, the pre-trained language model of the nth iteration process is trained to obtain the pre-trained language model after the nth iteration process.
7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: Obtaining second training data corresponding to the reasoning task; According to the second training data, the target model is fine-tuned to obtain a fine-tuned target model, wherein the target model includes a trained recommendation model and / or a trained pre-trained language model, and the fine-tuned target model is used to perform the reasoning task.
8. A data processing device, characterized in that: include: A training module, used for training the recommendation model according to multiple sets of first training data and pre-trained language models to obtain a trained recommendation model, wherein the training process includes multiple iterations, and any of the first training data includes attribute information of the user and attribute information of objects related to the user; In the nth iteration process of the multiple iteration processes, the training module includes an acquisition module and a processing module: The acquisition module is used to acquire the first training data of the nth iteration process, where n is a positive integer; The processing module is used for: Obtaining semantic features of first training data of the nth iteration process through the pre-trained language model of the nth iteration process; Based on the semantic features of the nth iteration process and the first training data of the nth iteration process, the recommendation model of the nth iteration process is updated to obtain the recommendation model after the nth iteration process.
9. The device according to claim 8, characterized in that The processing module is used for: Performing mask processing on the first training data of the nth iteration process to obtain the masked first training data of the nth iteration process; Inputting the masked first training data of the nth iteration process into the recommendation model of the nth iteration process to obtain a first feature corresponding to the masked first training data of the nth iteration process; Obtaining a prediction result of a mask in the masked first training data of the nth iteration process through a mask prediction network corresponding to the recommendation model of the nth iteration process according to the first feature and the semantic feature of the first training data of the nth iteration process; According to the prediction result corresponding to the nth iteration process, the recommendation model of the nth iteration process is updated to obtain the recommendation model after the nth iteration process.
10. The device according to claim 9, characterized in that The processing module is used for: Inputting the first training data of the nth iteration process into the recommendation model of the nth iteration process to obtain a second feature corresponding to the first training data of the nth iteration process; According to the second feature and the semantic feature of the first training data of the nth iteration process, and according to the prediction result of the mask corresponding to the nth iteration process, the recommendation model of the nth iteration process is updated to obtain the recommendation model after the nth iteration process.
11. The device according to claim 10, characterized in that The processing module is used for: Calculating a loss value according to the second feature and the semantic feature of the first training data of the n-th iteration process, and according to the prediction result of the mask corresponding to the n-th iteration process, through a loss function, wherein the loss function includes a first loss term and a second loss term, the first loss term is used to evaluate whether the second feature and the semantic feature of the first training data of the n-th iteration process are aligned, and the second loss term is used to evaluate whether the prediction result of the mask corresponding to the n-th iteration process is accurate; The recommendation model of the nth iteration process is updated according to the loss value to obtain a recommendation model after the nth iteration process.
12. The device according to any one of claims 8 to 11, characterized in that: The first training data of the nth iteration process is data of a first modality, and the first modality is different from a text modality; The processing module is used for: Performing modal conversion on the first training data of the nth iteration process to obtain text data corresponding to the first training data of the nth iteration process; The text data of the nth iteration process is input into the pre-trained language model of the nth iteration process to obtain the semantic features of the first training data of the nth iteration process.
13. The device according to any one of claims 8 to 12, characterized in that: The processing module is used for: According to the plurality of groups of first training data, the pre-trained language model and the recommendation model are trained to obtain a trained recommendation model and a trained pre-trained language model; In an nth iteration of the multiple iterations, the processing module is further configured to: Inputting the first training data of the nth iteration process into the recommendation model of the nth iteration process to obtain a second feature corresponding to the first training data of the nth iteration process; Based on the second feature and the first training data of the nth iteration process, the pre-trained language model of the nth iteration process is trained to obtain the pre-trained language model after the nth iteration process.
14. The device according to any one of claims 8 to 13, characterized in that: The acquisition module is also used to acquire second training data corresponding to the reasoning task; The processing module is also used to fine-tune the target model according to the second training data to obtain a fine-tuned target model, wherein the target model includes a trained recommendation model and / or a trained pre-trained language model, and the fine-tuned target model is used to perform the reasoning task.
15. An electronic device, characterized in that: The electronic device includes at least one processor, a memory, and instructions stored in the memory and executable by the at least one processor, and the at least one processor executes the instructions to implement the steps of the method described in any one of claims 1-7.
16. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Hyperspherical collaborative metric recommendation device and method based on pre-trained semantic model
CN111651558A
News recommendation method and device, computer equipment and storage medium
CN112231569A
Resource recommendation method and device and storage medium
CN115982357A
Article recommendation method based on graph collaboration and comparative learning
CN116167828A
Recommendation method and recommendation apparatus based on deep reinforcement learning, and non-transitory computer-readable recording medium
US20210027178A1
Cited By
Recommendation method, training method and related products
CN120611099A
Sample injection method and device of model, equipment and storage medium
CN121009369A