Method and device for training item recommendation model, electronic device and storage medium
By combining multi-task learning and neural networks, the problem of insufficient training data types in existing recommendation models is solved, thereby improving the accuracy of item recommendation models.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- PING AN TECH (SHENZHEN) CO LTD
- Filing Date
- 2023-04-07
- Publication Date
- 2026-04-28
AI Technical Summary
Existing recommendation model training methods rely on obtaining historical feedback data that is easy to obtain or has a high level of reliability, resulting in a limited variety of training data and affecting the accuracy of model recommendations.
By adopting a multi-task learning approach, sample object information and basic item information are integrated, and multiple neural networks are used to perform intent prediction, behavior prediction and item prediction respectively. The accuracy of the recommendation model is improved by training the neural network model through parameter optimization.
By combining multi-task learning and neural networks, it is possible to effectively learn from various feedback data and improve the recommendation accuracy of item recommendation models.
Smart Images

Figure CN116186416B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a training method and apparatus for an item recommendation model, an electronic device, and a storage medium. Background Technology
[0002] In related technologies, the training of recommendation models largely relies on historical user feedback data on items. However, the difficulty and reliability of obtaining different types of feedback data vary. Current model training methods often choose historical feedback data that is easy to obtain or has a high reliability level as training data. This results in a limited variety of training data, affecting the model's training performance and reducing the accuracy of recommendations. Summary of the Invention
[0003] The main objective of this application is to provide a training method and apparatus, electronic device and storage medium for an item recommendation model, aiming to improve the accuracy of the recommendation model.
[0004] To achieve the above objectives, a first aspect of this application proposes a method for training an item recommendation model, the method comprising:
[0005] Obtain sample object information and sample item information of the training sample objects; wherein, the sample item information includes basic item information and item tag information, and the item tag information is used to indicate the sample object intent and sample object behavior of the training sample objects;
[0006] The sample object information and the basic item information are integrated and processed to obtain at least two target sample pairs for each training sample object;
[0007] The first sample pair and the second sample pair from the at least two target sample pairs are input into a preset neural network model; wherein the neural network model includes a first neural network, a second neural network and a third neural network;
[0008] Based on the first neural network, the first sample pair and the second sample pair are processed for intent prediction to obtain sample intent prediction data.
[0009] Based on the second neural network, the first sample pair and the second sample pair are processed for behavior prediction to obtain sample behavior prediction data;
[0010] Based on the third neural network, the first sample pair and the second sample pair are processed to predict the items, thereby obtaining sample item prediction data.
[0011] The neural network model is trained by optimizing its parameters based on the sample intent prediction data, the sample behavior prediction data, the sample item prediction data, and the item tag information to obtain an item recommendation model.
[0012] In some embodiments, the data integration processing of the sample object information and the basic item information to obtain at least two target sample pairs for each training sample object includes:
[0013] The sample object information is encoded to obtain the sample object feature vector;
[0014] The basic information of the items is encoded to obtain the sample item feature vector;
[0015] The feature vectors of the sample object and the feature vectors of the sample item are merged to obtain the target sample pair.
[0016] In some embodiments, the first neural network includes a first encoding layer and a first linear layer, and the sample intent prediction data includes first sample intent prediction data and second sample intent prediction data. The step of performing intent prediction processing on the first sample pair and the second sample pair based on the first neural network to obtain the sample intent prediction data includes:
[0017] The first sample pair is encoded by the first encoding layer to obtain the first sample encoding vector, and the second sample pair is encoded by the first encoding layer to obtain the second sample encoding vector.
[0018] The label probability of the first sample encoding vector is calculated using the first linear layer and the preset reference intent label to obtain the first sample intent prediction data. Similarly, the label probability of the second sample encoding vector is calculated using the first linear layer and the reference intent label to obtain the second sample intent prediction data.
[0019] In some embodiments, the second neural network includes a second encoding layer and a second linear layer, and the sample behavior prediction data includes first sample behavior prediction data and second sample behavior prediction data. The step of performing behavior prediction processing on the first sample pair and the second sample pair based on the second neural network to obtain the sample behavior prediction data includes:
[0020] The first sample pair is encoded by the second encoding layer to obtain the third sample encoding vector, and the second sample pair is encoded by the second encoding layer to obtain the fourth sample encoding vector.
[0021] The label probability of the third sample encoding vector is calculated using the second linear layer and the preset reference behavior label to obtain the first sample behavior prediction data. Similarly, the label probability of the fourth sample encoding vector is calculated using the second linear layer and the reference behavior label to obtain the second sample behavior prediction data.
[0022] In some embodiments, the third neural network includes a third encoding layer and a third linear layer, and the sample item prediction data includes first sample item prediction data and second sample item prediction data. The step of performing item prediction processing on the first sample pair and the second sample pair based on the third neural network to obtain the sample item prediction data includes:
[0023] The first sample pair is encoded by the third encoding layer to obtain the fifth sample encoding vector, and the second sample pair is encoded by the third encoding layer to obtain the sixth sample encoding vector.
[0024] The label probability of the fifth sample encoding vector is calculated using the third linear layer and the preset reference item label to obtain the predicted data of the first sample item. Similarly, the label probability of the sixth sample encoding vector is calculated using the third linear layer and the reference item label to obtain the predicted data of the second sample item.
[0025] In some embodiments, optimizing the parameters of the neural network model based on the sample intent prediction data, the sample behavior prediction data, the sample item prediction data, and the item tag information to train the neural network model and obtain an item recommendation model includes:
[0026] A similarity calculation is performed on the first sample encoding vector and the fifth sample encoding vector to obtain a first similarity value;
[0027] The similarity between the second sample encoding vector and the sixth sample encoding vector is calculated to obtain a second similarity value;
[0028] The similarity between the third sample encoding vector and the fifth sample encoding vector is calculated to obtain a third similarity value;
[0029] The similarity between the fourth sample encoding vector and the sixth sample encoding vector is calculated to obtain a fourth similarity value;
[0030] Based on the sample intent prediction data and the sample object intent features in the item label information, a loss calculation is performed to obtain a first loss value;
[0031] The loss is calculated based on the sample behavior prediction data and the sample object behavior characteristics in the item label information to obtain a second loss value;
[0032] Based on the predicted data of the sample items and the item label information, a third loss value is obtained by calculating the loss.
[0033] The target loss value is obtained by weighting the first loss value, the second loss value, the third loss value, the first similarity value, the second similarity value, the third similarity value, and the fourth similarity value.
[0034] The neural network model is trained by optimizing its parameters based on the target loss value to obtain the item recommendation model.
[0035] To achieve the above objectives, a second aspect of this application provides an item recommendation method, the item recommendation method comprising:
[0036] Obtain target object information and target item information of the target object;
[0037] The target object information and the target item information are input into the item recommendation model for recommendation processing to obtain an item recommendation list; the item recommendation model is trained according to the item recommendation model training method described in the first aspect;
[0038] The target item is pushed to the target object based on the item recommendation list.
[0039] To achieve the above objectives, a third aspect of this application provides a training apparatus for an item recommendation model, the training apparatus comprising:
[0040] The sample acquisition module is used to acquire sample object information and sample item information of the training sample objects; wherein, the sample item information includes basic item information and item tag information, and the item tag information is used to indicate the sample object intent and sample object behavior of the training sample objects;
[0041] The data integration module is used to perform data integration processing on the sample object information and the basic information of the item to obtain at least two target sample pairs for each training sample object.
[0042] An input module is used to input the first sample pair and the second sample pair from the at least two target sample pairs into a preset neural network model; wherein the neural network model includes a first neural network, a second neural network, and a third neural network;
[0043] The first prediction module is used to perform intent prediction processing on the first sample pair and the second sample pair based on the first neural network to obtain sample intent prediction data.
[0044] The second prediction module is used to perform behavior prediction processing on the first sample pair and the second sample pair based on the second neural network to obtain sample behavior prediction data.
[0045] The third prediction module is used to perform item prediction processing on the first sample pair and the second sample pair based on the third neural network to obtain sample item prediction data.
[0046] The training module is used to optimize the parameters of the neural network model based on the sample intent prediction data, the sample behavior prediction data, the sample item prediction data, and the item label information, so as to train the neural network model and obtain the item recommendation model.
[0047] To achieve the above objectives, a fourth aspect of this application provides an item recommendation device, the item recommendation device comprising:
[0048] The data acquisition module is used to acquire target object information and target item information.
[0049] The data input module is used to input the target object information and the target item information into the item recommendation model for recommendation processing to obtain an item recommendation list; the item recommendation model is trained according to the item recommendation model training method described in the first aspect.
[0050] The item recommendation module is used to push the target item to the target object based on the item recommendation list.
[0051] To achieve the above objectives, a fifth aspect of the present application provides an electronic device, the electronic device including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method described in the first or second aspect.
[0052] To achieve the above objectives, a sixth aspect of the present application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in the first or second aspect.
[0053] This application proposes a training method for an item recommendation model, an item recommendation method, a training device for an item recommendation model, an item recommendation device, an electronic device, and a computer-readable storage medium. It acquires sample object information and sample item information from training sample objects. The sample item information includes basic item information and item tag information. Item tag information is used to indicate the sample object's intent and sample object behavior. Since sample objects may have multiple responses to sample items, in order for the item recommendation model to learn from these multiple feedback data, a multi-task learning approach is adopted, treating each feedback data as a separate task for learning. By integrating and processing the sample object information and basic item information, each training sample object is obtained. At least two target sample pairs of a sample object enable a multi-task learning neural network to share the same target sample pair. The first and second sample pairs from the at least two target sample pairs are input into a pre-defined neural network model, which includes a first neural network, a second neural network, and a third neural network. The first neural network performs intent prediction processing on the first and second sample pairs to obtain sample intent prediction data. The second neural network performs behavior prediction processing on the first and second sample pairs to obtain sample behavior prediction data. Multi-task learning based on the first and second neural networks allows them to learn different types of feedback data from the sample object to the sample item. Since both the first and second neural networks learn from only one type of feedback data, when the item tag information of the first and second sample pairs is the same, the recommended order of the sample items for the first and second sample pairs cannot be obtained. Therefore, a third neural network is introduced, and the third neural network performs item prediction processing on the first and second sample pairs to obtain sample item prediction data. Furthermore, by optimizing the parameters of the neural network model based on sample intent prediction data, sample behavior prediction data, sample item prediction data, and item label information, a neural network model can be trained to obtain an item recommendation model. This can improve the training effect of the model and increase the recommendation accuracy of the item recommendation model. Attached Figure Description
[0054] Figure 1 This is a flowchart of the training method for the item recommendation model provided in the embodiments of this application;
[0055] Figure 2 yes Figure 1 The flowchart of step S120 in the middle;
[0056] Figure 3 yes Figure 1 The flowchart of step S140 in the middle;
[0057] Figure 4 yes Figure 1The flowchart of step S150 in the middle;
[0058] Figure 5 yes Figure 1 The flowchart of step S160 in the middle;
[0059] Figure 6 yes Figure 1 The flowchart of step S170 in the process;
[0060] Figure 7 This is a flowchart of the item recommendation method provided in the embodiments of this application;
[0061] Figure 8 This is a schematic diagram of the structure of the training device for the item recommendation model provided in the embodiments of this application;
[0062] Figure 9 This is a schematic diagram of the item recommendation device provided in the embodiments of this application;
[0063] Figure 10 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0064] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0065] It should be noted that although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first," "second," etc., in the specification, claims, and the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0066] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0067] First, let's analyze some of the terms used in this application:
[0068] Artificial intelligence (AI) is a new branch of computer science that studies, develops, and applies theories, methods, technologies, and systems to simulate, extend, and expand human intelligence. It aims to understand the essence of intelligence and produce intelligent machines that can react in a way similar to human intelligence. Research in this field includes robotics, speech recognition, image recognition, natural language processing, and expert systems. AI can simulate the information processes of human consciousness and thought. Furthermore, AI utilizes digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceiving the environment, acquiring knowledge, and using that knowledge to achieve optimal results.
[0069] Encoder: Transforms an input sequence into a fixed-length vector.
[0070] In related technologies, the training of recommendation models largely relies on historical user feedback data on items. However, the difficulty and reliability of obtaining different types of feedback data vary. Current model training methods often choose historical feedback data that is easy to obtain or has a high reliability level as training data. This results in a limited variety of training data, affecting the model's training performance and reducing the accuracy of recommendations.
[0071] Based on this, embodiments of this application provide a training method and apparatus, electronic device and storage medium for an item recommendation model, aiming to improve the accuracy of the recommendation model.
[0072] The training method, item recommendation method, item recommendation model training device, item recommendation device, electronic device, and computer-readable storage medium for the item recommendation model provided in this application are specifically described through the following embodiments. First, the training method for the item recommendation model in the embodiments of this application is described.
[0073] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.
[0074] Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.
[0075] The training method for the item recommendation model provided in this application relates to the field of artificial intelligence technology. This training method can be applied to a terminal, a server, or software running on either a terminal or a server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, etc.; the server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application implementing the item recommendation model training method, but is not limited to the above forms.
[0076] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0077] It should be noted that in all specific embodiments of this application, when processing data related to user identity or characteristics, such as user information, user behavior data, user historical data, and user location information, user permission or consent is obtained first. Furthermore, the collection, use, and processing of this data comply with relevant laws, regulations, and standards. In addition, when embodiments of this application require access to sensitive personal information of users, separate permission or consent from the user is obtained through pop-ups or redirection to confirmation pages. Only after obtaining the user's separate permission or consent is the necessary user-related data required for the proper functioning of these embodiments acquired.
[0078] Figure 1 This is an optional flowchart of the training method for the item recommendation model provided in the embodiments of this application. Figure 1 The training methods may include, but are not limited to, steps S110 to S170.
[0079] Step S110: Obtain the sample object information and sample item information of the training sample objects; wherein, the sample item information includes basic item information and item tag information, and the item tag information is used to indicate the sample object intent and sample object behavior of the training sample objects;
[0080] Step S120: Perform data integration processing on the sample object information and the basic information of the items to obtain at least two target sample pairs for each training sample object;
[0081] Step S130: Input the first sample pair and the second sample pair from at least two target sample pairs into a preset neural network model; wherein the neural network model includes a first neural network, a second neural network and a third neural network;
[0082] Step S140: Perform intent prediction processing on the first sample pair and the second sample pair based on the first neural network to obtain sample intent prediction data;
[0083] Step S150: Perform behavior prediction processing on the first sample pair and the second sample pair based on the second neural network to obtain sample behavior prediction data.
[0084] Step S160: Based on the third neural network, perform item prediction processing on the first sample pair and the second sample pair to obtain sample item prediction data.
[0085] Step S170: Optimize the parameters of the neural network model based on the sample intent prediction data, sample behavior prediction data, sample item prediction data, and item label information to train the neural network model and obtain the item recommendation model.
[0086] Steps S110 to S170 of this application embodiment involve acquiring sample object information and sample item information of the training sample objects. The sample item information includes basic item information and item tag information. The item tag information is used to indicate the sample object intent and sample object behavior of the training sample objects. Since the sample objects may have multiple responses to the sample items, in order to enable the item recommendation model to learn the multiple feedback data of the sample objects to the sample items, a multi-task learning approach is adopted to learn each feedback data as a separate task. By integrating the sample object information and the basic item information, at least two target sample pairs are obtained for each training sample object. This enables the neural network performing multi-task learning to share the same target sample pair. The first sample pair and the second sample pair from the at least two target sample pairs are input into a preset neural network model. The neural network model includes a first neural network, a second neural network, and a third neural network. Intent prediction processing is performed on the first sample pair and the second sample pair based on the first neural network to obtain sample intent prediction data. Behavior prediction processing is performed on the first sample pair and the second sample pair based on the second neural network to obtain sample behavior prediction data. Multi-task learning is performed based on the first neural network and the second neural network, enabling the first neural network and the second neural network to learn different types of feedback data of the sample objects to the sample items. Since both the first and second neural networks learn from the same feedback data, they cannot determine the recommended item order when the item label information of the first and second sample pairs is the same. Therefore, a third neural network is introduced to perform item prediction processing on the first and second sample pairs, obtaining sample item prediction data. Furthermore, the parameters of the neural network model are optimized based on sample intent prediction data, sample behavior prediction data, sample item prediction data, and item label information to train the neural network model, resulting in an item recommendation model that improves the accuracy of the item recommendation model.
[0087] In step S110 of some embodiments, the sample object information and sample item information of the training sample object are obtained from a webpage based on a script program, or from an open-source dataset. The sample object information is used to identify the identity of the sample object and can be the sample object's ID. The sample item information includes basic item information and item tag information. The basic item information is used to identify the item and can be the item's ID. The item tag information is the sample object's feedback data on the sample item, including the user's browsing history and the user's interaction behavior with the item. It is used to indicate the sample object's intention and sample object behavior of the training sample object. The sample object's intention can be the sample object's purchase intention for the sample item, and the sample object behavior can be the sample object's likes, favorites, or other behaviors.
[0088] Please see Figure 2 In some embodiments, step S120 may include, but is not limited to, steps S210 to S230:
[0089] Step S210: Encode the sample object information to obtain the sample object feature vector;
[0090] Step S220: Encode the basic information of the items to obtain the feature vector of the sample items;
[0091] Step S230: Merge the feature vectors of the sample objects and the feature vectors of the sample items to obtain the target sample pairs.
[0092] In step S210 of some embodiments, sample object information and basic item information are input into a shared layer for embedding encoding, wherein the shared layer includes a first encoder and a second encoder. If the first encoder is represented as Eu, the id of the sample object is encoded based on the first encoder Eu to obtain the sample object feature vector.
[0093] In step S220 of some embodiments, if the second encoder is represented as Ev, the id of the sample item is encoded based on the second encoder Ev to obtain the feature vector of the sample item.
[0094] In step S230 of some embodiments, the feature vector of the sample object and the feature vector of the sample item are concatenated to obtain a target vector, which is then used as the target sample pair. It should be noted that the feature vector of the sample object can be concatenated with the feature vector of one sample item, or with the feature vectors of multiple sample items. For example, if the feature vector of the sample object is represented as user1 and the feature vector of the sample item is represented as item1, then the target sample pair is {user1, item1}. If one feature vector of the sample item is represented as item1 and another feature vector of the sample item is represented as item2, then the target sample pair is {user1, item1, item2}.
[0095] Steps S210 to S230 involve inputting sample object information and basic item information into the shared layer. The first encoder of the shared layer embeds and encodes the sample object information to obtain the sample object feature vector. The second encoder of the shared layer embeds and encodes the basic item information to obtain the sample item feature vector. The sample object feature vector and the sample item feature vector are then merged to obtain the target sample pair. This allows multi-task learning to share the same underlying parameters, i.e., the target sample pair, while the top-level parameters remain independent to adapt to learning from different feedback data, thereby improving the recommendation accuracy of the item recommendation model.
[0096] In step S130 of some embodiments, to obtain the item recommendation model, the first and second sample pairs from at least two target sample pairs are used as input data and input into a preset neural network model to train the neural network model based on the target sample pairs. The first and second sample pairs have the same sample object information but different basic item information; they correspond to different sample items of the same sample object. The neural network model includes a first neural network, a second neural network, and a third neural network. The first neural network learns the intention features of the sample object towards the sample item, and the second neural network learns the behavioral features of the sample object towards the sample item. When the sample object intentions of the first and second sample pairs are the same, the first neural network cannot accurately recommend and rank the sample items corresponding to the first and second sample pairs based on the sample object intentions. Similarly, when the sample object behaviors of the first and second sample pairs are the same, the second neural network cannot accurately recommend and rank the sample items corresponding to the first and second sample pairs based on the sample object behaviors. By introducing the third neural network to learn the ranking relationship between the first and second sample pairs, the recommendation accuracy of the item recommendation model can be improved.
[0097] Please see Figure 3 In some embodiments, the first neural network includes a first encoding layer and a first linear layer, and the sample intent prediction data includes first sample intent prediction data and second sample intent prediction data. Step S140 may include, but is not limited to, steps S310 to S320:
[0098] Step S310: Encode the first sample pair through the first coding layer to obtain the first sample coding vector, and encode the second sample pair through the first coding layer to obtain the second sample coding vector;
[0099] Step S320: The label probability of the first sample encoding vector is calculated using the first linear layer and the preset reference intent label to obtain the first sample intent prediction data; the label probability of the second sample encoding vector is calculated using the first linear layer and the reference intent label to obtain the second sample intent prediction data.
[0100] In step S310 of some embodiments, in order for the first neural network to learn the sample object intent of the sample object to the sample item in the first sample pair and the sample object intent of the sample object to the sample item in the second sample pair, the first sample pair and the second sample pair are input into the first neural network, the first sample pair is encoded based on the first encoding layer of the first neural network to obtain the first sample encoding vector, and the second sample pair is encoded based on the second encoding layer of the first neural network to obtain the second sample encoding vector.
[0101] In step S320 of some embodiments, the reference intent label includes a first reference intent label and a second reference intent label. The first reference intent label can characterize the sample object's intention towards the sample item, and the second reference intent label can characterize the sample object's no intention towards the sample item. The first sample encoding vector and the second sample encoding vector are input into the first linear layer for label probability calculation. A first probability that the first sample encoding vector belongs to the first reference intent label and a second probability that the first sample encoding vector belongs to the second reference intent label are calculated. If the first probability is greater than the second probability, the first sample encoding vector belongs to the first reference intent label; if the first probability is less than the second probability, the first sample encoding vector belongs to the second reference intent label; if the first probability is equal to the second probability, the first sample encoding vector is randomly selected to belong to either the first or second reference intent label to obtain the first sample intent prediction data. The first sample intent prediction data is the probability that the intention feature of the sample object towards the sample item in the first sample pair belongs to the reference intent label. The calculation method of the second sample intent prediction data is the same as that of the first sample intent prediction data, and will not be repeated here.
[0102] In steps S310 to S320 above, the first sample pair and the second sample pair are encoded by the first encoding layer to obtain the first sample encoding vector and the second sample encoding vector. The probability that the first sample encoding vector and the second sample encoding vector belong to the reference intent label is calculated according to the linear layer. The calculated probability is used as the sample intent prediction data. The accuracy of intent prediction can be increased by the learning strategy of the first neural network single task.
[0103] Please see Figure 4 In some embodiments, the second neural network includes a second encoding layer and a second linear layer, and the sample behavior prediction data includes first sample behavior prediction data and second sample behavior prediction data. Step S150 may include, but is not limited to, steps S410 to S420:
[0104] Step S410: Encode the first sample pair through the second coding layer to obtain the third sample coding vector, and encode the second sample pair through the second coding layer to obtain the fourth sample coding vector;
[0105] Step S420: The label probability of the third sample encoding vector is calculated using the second linear layer and the preset reference behavior label to obtain the first sample behavior prediction data; the label probability of the fourth sample encoding vector is calculated using the second linear layer and the reference behavior label to obtain the second sample behavior prediction data.
[0106] In step S410 of some embodiments, the single-task learning strategy executed by the second neural network is the learning of sample object behavior. In order for the second neural network to learn the sample object behavior of the sample object to the sample item in the first sample pair and the sample object behavior of the sample object to the sample item in the second sample pair, the first sample pair and the second sample pair are input into the second neural network. The first sample pair is encoded based on the second encoding layer of the second neural network to obtain the third sample encoding vector. The second sample pair is encoded based on the second encoding layer of the second neural network to obtain the fourth sample encoding vector.
[0107] In step S420 of some embodiments, the reference behavior label includes a first reference behavior label and a second reference behavior label. The first reference behavior label can characterize that the sample object has certain behaviors towards the sample item, such as clicking or adding to favorites. The second reference intent label can characterize that the sample object does not have certain behaviors towards the sample item, such as not clicking or not adding to favorites. The third sample encoding vector and the fourth sample encoding vector are input into the second linear layer for label probability calculation. A first probability that the third sample encoding vector belongs to the first reference behavior label and a second probability that the third sample encoding vector belongs to the second reference behavior label are calculated. If the first probability is greater than the second probability, the third sample encoding vector belongs to the first reference behavior label; if the first probability is less than the second probability, the third sample encoding vector belongs to the second reference behavior label; if the first probability is equal to the second probability, the third sample encoding vector is randomly selected to belong to either the first or second reference behavior label to obtain the first sample behavior prediction data. The first sample behavior prediction data is the probability that the behavior feature of the sample object towards the sample item in the first sample pair belongs to the reference behavior label. The calculation method for the second sample behavior prediction data is the same as that for the first sample behavior prediction data, and will not be repeated here.
[0108] In steps S410 to S420 above, the first sample pair and the second sample pair are encoded by the second encoding layer to obtain the third sample encoding vector and the fourth sample encoding vector. The probability that the third sample encoding vector and the fourth sample encoding vector belong to the reference behavior label is calculated according to the second linear layer. The calculated probability is used as the sample behavior prediction data. The accuracy of the sample object behavior prediction can be increased by the learning strategy of the second neural network based on the single task of sample object behavior.
[0109] Please see Figure 5 In some embodiments, the third neural network includes a third encoding layer and a third linear layer, and the sample item prediction data includes first sample item prediction data and second sample item prediction data. Step S160 may also include, but is not limited to, steps S510 to S520:
[0110] Step S510: Encode the first sample pair through the third coding layer to obtain the fifth sample coding vector, and encode the second sample pair through the third coding layer to obtain the sixth sample coding vector;
[0111] Step S520: The label probability of the fifth sample encoding vector is calculated using the third linear layer and the preset reference item label to obtain the first sample item prediction data; and the label probability of the sixth sample encoding vector is calculated using the third linear layer and the reference item label to obtain the second sample item prediction data.
[0112] In step S510 of some embodiments, the first neural network performs the sample object intent prediction task based on reference intent labels, and the second neural network performs the sample object behavior prediction task based on reference behavior labels. Both consider a single label for single-task learning, which means that if two items with the same label appear in a task, it is impossible to accurately recommend and rank those items. Therefore, when performing multi-task learning, a label cross-referencing method can be used to fuse multiple label information, and the label cross-referencing ranking result can be learned according to the pairwise loss function to construct an enhanced task and obtain a more granular recommendation model. For example, the item label information of two sample items are (1,0) and (1,1), where the first item of the item label information indicates whether there is a purchase behavior and the second item indicates whether there is a collection behavior. In the purchase task, both sample items have purchase behaviors, and it is impossible to accurately rank the two sample items based on the purchase label. At this time, it is necessary to combine the collection label to distinguish the two sample items. Since the purchase has a higher credibility level, the order of the cross-results of the purchase and collection labels can be (1,1)>(1,0)>(0,1)>(0,0).
[0113] To enable the third neural network to learn the ranking relationship between two items, sample pairs consisting of the same user and two different items are grouped together and input into the third neural network in groups during training. Specifically, the first sample pair and the second sample pair are input into the third neural network. The first sample pair is encoded using the third encoding layer of the third neural network to obtain the fifth sample encoding vector. The second sample pair is encoded using the third encoding layer of the third neural network to obtain the sixth sample encoding vector.
[0114] In step S520 of some embodiments, the reference item label includes a first label, a second label, a third label, and a fourth label. The first label can represent that the sample object has an intention towards the sample item; the second label can represent that the sample object has no intention towards the sample item; the third label can represent that the sample object has certain behaviors towards the sample item, such as clicking or adding it to favorites; and the fourth label can represent that the sample object has not performed certain behaviors towards the sample item, such as not clicking or adding it to favorites. The fifth and sixth sample encoding vectors are input into the third linear layer for label probability calculation. The first probability that the fifth sample encoding vector belongs to the first label, the second probability that it belongs to the second label, the third probability that it belongs to the third label, and the fourth probability that it belongs to the fourth label are calculated. If the first probability is greater than the second probability, the fifth sample encoding vector belongs to the first label; if the first probability is less than the second probability, the fifth sample encoding vector belongs to the second label; if the first probability is equal to the second probability, the fifth sample encoding vector is randomly selected to belong to either the first or second label; if the third probability is greater than the fourth probability, the fifth sample encoding vector belongs to the second label. If the first probability is less than the second probability, then the fifth sample encoding vector belongs to the second label. If the third probability equals the fourth probability, then the fifth sample encoding vector is randomly selected to belong to either the third or fourth label. When it is determined that the fifth sample encoding vector belongs to one of the two labels (either the first or second label, or the third or fourth label), the first sample item prediction data is obtained. The first reference item label includes a reference intent label and a reference behavior label. The first sample item prediction data is the probability that the intention feature of the sample object in the first sample pair belongs to the reference intent label and the reference behavior label. The label probability of the sixth sample encoding vector is calculated using the third linear layer and the reference item label to obtain the second sample item prediction data. The specific process for obtaining the second sample item prediction data is the same as the calculation method for obtaining the first sample item prediction data, and will not be repeated here.
[0115] When the predicted data for the first sample item is (1,0) and the predicted data for the second sample item is (0,1), the ranking result for the first sample pair and the second sample pair is: First sample pair > Second sample pair, with the sample items in the first sample pair having a higher recommendation priority than those in the second sample pair. When the predicted data for the first sample item is (1,0) and the predicted data for the second sample item is (1,1), because the second sample pair has been collected or liked, the ranking result for the first sample pair and the second sample pair is: First sample pair < Second sample pair, with the sample items in the second sample pair having a higher recommendation priority than those in the first sample pair.
[0116] In steps S510 to S520 above, the first sample pair and the second sample pair are encoded by the third encoding layer to obtain the fifth sample encoding vector and the sixth sample encoding vector. The probability that the fifth sample encoding vector and the sixth sample encoding vector belong to the reference item label is calculated according to the third linear layer. The calculated probability is used as the sample item prediction data. The relationship between the sample object intent feature and the sample object behavior feature can be obtained from the sample item prediction data. The first sample pair and the second sample pair with the same label are ranked according to the relationship. The recommendation of the first sample pair and the second sample pair can be made according to the ranking result, which improves the recommendation accuracy of the item recommendation model.
[0117] Please see Figure 6 In some embodiments, step S170 may include, but is not limited to, steps S610 to S690:
[0118] Step S610: Calculate the similarity between the first sample encoding vector and the fifth sample encoding vector to obtain the first similarity value;
[0119] Step S620: Calculate the similarity between the second sample encoding vector and the sixth sample encoding vector to obtain the second similarity value;
[0120] Step S630: Calculate the similarity between the third sample encoding vector and the fifth sample encoding vector to obtain the third similarity value;
[0121] Step S640: Calculate the similarity between the fourth sample encoding vector and the sixth sample encoding vector to obtain the fourth similarity value;
[0122] Step S650: Calculate the loss based on the sample intent prediction data and the sample object intent features in the item tag information to obtain the first loss value;
[0123] Step S660: Calculate the loss based on the sample behavior prediction data and the sample object behavior characteristics in the item tag information to obtain the second loss value;
[0124] Step S670: Calculate the loss based on the sample item prediction data and item label information to obtain the third loss value;
[0125] Step S680: The first loss value, the second loss value, the third loss value, the first similarity value, the second similarity value, the third similarity value, and the fourth similarity value are weighted and calculated to obtain the target loss value;
[0126] Step S690: Optimize the parameters of the neural network model based on the target loss value to train the neural network model and obtain the item recommendation model.
[0127] In step S610 of some embodiments, the third neural network is used as the teacher network, and the first and second neural networks are used as student networks. Knowledge distillation is performed by maximizing the similarity between the hidden layer outputs of the student networks and the hidden layer outputs of the teacher networks, and the knowledge learned by the third neural network is passed to the first and second neural networks. It should be noted that during knowledge distillation, the third neural network does not update its weight parameters, that is, the third neural network does not perform backpropagation. In order to pass the sample object intent features of the first sample pair learned by the third neural network to the first neural network, the cosine similarity of the first sample encoding vector and the fifth sample encoding vector is calculated to obtain the first similarity value. The method for calculating the similarity is shown in formula (1).
[0128]
[0129] in, The first similarity value, It refers to batch User item pairs in the sample, This is the encoding vector for the first sample. for transpose, This is the encoding vector for the fifth sample, where τ is an adjustable temperature parameter that can scale the input and expand the range of cosine similarity. Denotes the L2 norm of the first sample encoding vector. The L2 norm of the fifth sample encoding vector. This indicates the batch size, which is the number of sample pairs in a batch.
[0130] It should be noted that in the early stages of model training, the adjustable temperature parameter is set relatively large to make the predicted probability distribution smoother, resulting in a longer parameter update step size, which can avoid getting stuck in local optima. In the later stages of model training, this parameter is reduced to promote model convergence.
[0131] In step S620 of some embodiments, in order to pass the sample object intent features of the second sample pair learned by the third neural network to the first neural network, the similarity of the second sample encoding vector and the sixth sample encoding vector is calculated to obtain the second similarity value. The method for calculating the similarity is shown in formula (2).
[0132]
[0133] in, The second similarity value, This is the encoding vector for the second sample. This is the encoding vector for the sixth sample.
[0134] In step S630 of some embodiments, in order to pass the sample object behavior features of the first sample pair learned by the third neural network to the second neural network, the similarity of the third sample encoding vector and the fifth sample encoding vector is calculated to obtain the third similarity value. The method for calculating the similarity is shown in formula (3).
[0135]
[0136] in, It is the third similarity value. The encoding vector for the third sample. This is the encoding vector for the fifth sample.
[0137] In step S640 of some embodiments, in order to pass the sample object behavior features of the second sample pair learned by the third neural network to the second neural network, the similarity of the fourth sample encoding vector and the sixth sample encoding vector is calculated to obtain the fourth similarity value. The method for calculating the similarity is shown in formula (4).
[0138]
[0139] in, It is the fourth similarity value. This is the encoding vector for the fourth sample. This is the encoding vector for the sixth sample.
[0140] In step S650 of some embodiments, if the sample intends to predict data is represented as The sample object intent feature in the item label information is represented as follows: Predict data based on sample intent and sample object intent features Loss calculation is performed to obtain the first loss value L. A The calculation method for the first loss value is shown in formula (5).
[0141]
[0142] in, This indicates whether the user intends to purchase the item. If they intend to purchase, then... The value is 1, indicating no intention to purchase. The value is 0. This indicates a prediction of the user's intention regarding the item.
[0143] In step S660 of some embodiments, if the sample behavior prediction data is represented as The behavioral characteristics of sample objects in the item label information are represented as follows: Based on sample behavior prediction data and sample object behavioral characteristics Loss calculation is performed to obtain the second loss value L. B The calculation method for the second loss value is shown in formula (6).
[0144]
[0145] in, This indicates whether the user has saved or added items to their favorites. If so, then... The value is 1; if there is no collection or other similar behavior, then... The value is 0. This indicates a prediction of user behavior towards an item.
[0146] In step S670 of some embodiments, although the implicit feedback data (i.e., interaction records labeled 0 or 1) is simple to train, it often lacks sufficient discrimination between positive samples because it only distinguishes between positive and negative samples. That is, items that the user has interacted with are considered liked, and items that the user has not interacted with are considered disliked. This results in poor ranking performance and is also prone to labeling bias when calculating model updates using the pointwise loss function. For example, the true relevance of items a, b, and c is 0.9, 0.8, and 0.7, respectively. According to the true relevance, the ranking relationship of the items is a>b>c. However, since the pointwise loss function only distinguishes between positive and negative samples, when a and b are compared, b's label is 0, and when b and c are compared, b's label is 1. This causes the same item to have completely different effects on the update direction of the item recommendation model, hindering model convergence. Therefore, the pairwise loss function is used to calculate the third loss value. The calculation method of the third loss value is shown in formula (7).
[0147]
[0148] Where, x i x j For a sample pair consisting of the same user and two items, x i For the first sample pair, x j For the second sample pair, x i >x j x represents i The cross-sort result is higher than x j I(·) is the indicator function, and σ(·) is the sigmoid activation function. It should be noted that the item label information... It is used to determine the ranking relationship, and its value is not directly substituted into the loss function.
[0149] In step S680 of some embodiments, the first loss value L is... A Second loss value L B Third loss value L CFirst similarity value Second similarity value Third similarity value and the fourth similarity value The target loss value L is obtained by performing a weighted calculation. total The method for calculating the target loss value is shown in formula (8).
[0150]
[0151] The values of λ1, λ2, λ3, λ4, λ5, λ6 and λ7 can be determined by grid search, and the specific values are not limited.
[0152] Steps S610 to S690 above calculate the target loss value using the first loss value, the second loss value, the third loss value, the first similarity value, the second similarity value, and the fourth similarity value. Calculating the loss value based on multi-dimensional prediction data can improve the accuracy of the item recommendation model.
[0153] Figure 7 This is an optional flowchart of the item recommendation method provided in the embodiments of this application. Figure 7 The method may include, but is not limited to, steps S710 to S730.
[0154] Step S710: Obtain the target object information of the target object and the target item information of the target item;
[0155] Step S720: Input the target object information and target item information into the item recommendation model for recommendation processing to obtain an item recommendation list; the item recommendation model is trained according to the training method of the item recommendation model as described in the first aspect embodiment.
[0156] Step S730: Push the target item to the target object according to the item recommendation list.
[0157] The item recommendation method of this application embodiment inputs target object information and target item information into an item recommendation model for recommendation processing. The item recommendation model includes a first neural network, a second neural network, and a third neural network. Based on the first neural network, target intention prediction data is obtained by predicting the object intention between the target object and the target item. Based on the second neural network, target behavior prediction data is obtained by predicting the object behavior between the target object and the target item. Based on the third neural network, target item prediction data is obtained by predicting the relevance between the target object and the target item. The target intention prediction data, target behavior prediction data, and target item prediction data are weighted and calculated to obtain a prediction relevance score. The target items are sorted in descending order according to the prediction relevance score to obtain an item recommendation list. The top k target items in the item recommendation list are pushed to the target object, where k is a positive integer greater than or equal to 1, so that the relevance between the target object and the target item is high, thereby improving the accuracy of the recommendation.
[0158] It should be noted that the target object can be users browsing the website, consumers, etc., and the calculation method for the predicted relevance score is shown in formula (9).
[0159]
[0160] Where, r i To predict the relevance score, The target intent prediction data is as follows: For target behavior prediction data, For the target item prediction data, θ1, θ2, and θ3 are weighting coefficients. The values of θ1, θ2, and θ3 can be determined by grid search, and the specific values are not limited.
[0161] Please see Figure 8 This application also provides a training apparatus for an item recommendation model, which can implement the above-described item recommendation model training method. The apparatus includes:
[0162] The sample acquisition module 810 is used to acquire sample object information and sample item information of the training sample objects; wherein, the sample item information includes basic item information and item tag information, and the item tag information is used to indicate the sample object intent and sample object behavior of the training sample objects;
[0163] The data integration module 820 is used to integrate and process the sample object information and the basic information of the item to obtain at least two target sample pairs for each training sample object.
[0164] The input module 830 is used to input the first sample pair and the second sample pair from at least two target sample pairs into a preset neural network model; wherein the neural network model includes a first neural network, a second neural network and a third neural network;
[0165] The first prediction module 840 is used to perform intent prediction processing on the first sample pair and the second sample pair based on the first neural network to obtain sample intent prediction data.
[0166] The second prediction module 850 is used to perform behavior prediction processing on the first sample pair and the second sample pair based on the second neural network to obtain sample behavior prediction data.
[0167] The third prediction module 860 is used to perform item prediction processing on the first sample pair and the second sample pair based on the third neural network to obtain sample item prediction data.
[0168] The training module 870 is used to optimize the parameters of the neural network model based on the sample intent prediction data, sample behavior prediction data, sample item prediction data and item label information, so as to train the neural network model and obtain the item recommendation model.
[0169] The specific implementation of the training device for the item recommendation model is basically the same as the specific implementation of the training method for the item recommendation model described above, and will not be repeated here.
[0170] Please see Figure 9 This application also provides an item recommendation device that can implement the above-described item recommendation method. The device includes:
[0171] Data acquisition module 910 is used to acquire target object information of the target object and target item information of the target item;
[0172] The data input module 920 is used to input the target object information and the target item information into the item recommendation model for recommendation processing to obtain an item recommendation list; the item recommendation model is trained according to the item recommendation model training method described in the first aspect;
[0173] The item recommendation module 930 is used to push the target item to the target object according to the item recommendation list.
[0174] The specific implementation of the item recommendation device is basically the same as the specific implementation of the item recommendation method described above, and will not be repeated here.
[0175] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the training method or item recommendation method of the aforementioned item recommendation model. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.
[0176] Please see Figure 10 , Figure 10 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes:
[0177] The processor 1010 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application.
[0178] The memory 1020 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1020 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1020, and the processor 1010 calls and executes the training method or item recommendation method of the item recommendation model in the embodiments of this application.
[0179] The input / output interface 1030 is used to implement information input and output;
[0180] The communication interface 1040 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0181] Bus 1050 transmits information between various components of the device (e.g., processor 1010, memory 1020, input / output interface 1030, and communication interface 1040);
[0182] The processor 1010, memory 1020, input / output interface 1030 and communication interface 1040 are connected to each other within the device via bus 1050.
[0183] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the training method or item recommendation method of the above-described item recommendation model.
[0184] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0185] The training method, device, electronic device, and computer-readable storage medium for the item recommendation model provided in this application embodiment acquire sample object information and sample item information of the training sample objects. The sample item information includes basic item information and item tag information. The item tag information is used to indicate the sample object intent and sample object behavior of the training sample objects. Since sample objects may have multiple responses to sample items, in order for the item recommendation model to learn the multiple feedback data of sample objects to sample items, a multi-task learning approach is adopted, treating each feedback data as a separate task for learning. By integrating and processing the sample object information and basic item information, each training sample object is obtained. At least two target sample pairs of a training sample object enable a multi-task learning neural network to share the same target sample pair. The first and second sample pairs from these at least two target sample pairs are input into a pre-defined neural network model, which includes a first neural network, a second neural network, and a third neural network. The first neural network performs intent prediction processing on the first and second sample pairs to obtain sample intent prediction data. The second neural network performs behavior prediction processing on the first and second sample pairs to obtain sample behavior prediction data. Multi-task learning based on the first and second neural networks allows them to learn different types of feedback data from the sample object to the sample item. Since both the first and second neural networks learn from only one type of feedback data, when the item tag information of the first and second sample pairs is the same, the recommended item order for the first and second sample pairs cannot be determined. Therefore, a third neural network is introduced to perform item prediction processing on the first and second sample pairs to obtain sample item prediction data. Furthermore, the parameters of the neural network model are optimized based on the sample intent prediction data, sample behavior prediction data, sample item prediction data, and item tag information to train the neural network model, resulting in an item recommendation model that improves the accuracy of the item recommendation model.
[0186] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0187] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0188] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0189] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0190] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0191] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0192] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0193] The units described above as separate components may or may not be physically separate. The 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 the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0194] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0195] If the integrated unit is implemented as 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 this application, in essence, 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. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0196] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.
Claims
1. A training method for an item recommendation model, characterized in that, The training method includes: Obtain sample object information and sample item information of the training sample objects; wherein, the sample item information includes basic item information and item tag information, and the item tag information is used to indicate the sample object intent and sample object behavior of the training sample objects; The sample object information and the basic item information are integrated and processed to obtain at least two target sample pairs for each training sample object; The first sample pair and the second sample pair from the at least two target sample pairs are input into a preset neural network model; wherein the neural network model includes a first neural network, a second neural network and a third neural network; Based on the first neural network, the first sample pair and the second sample pair are processed for intent prediction to obtain sample intent prediction data. Based on the second neural network, the first sample pair and the second sample pair are processed for behavior prediction to obtain sample behavior prediction data; Based on the third neural network, the first sample pair and the second sample pair are processed to predict the items, thereby obtaining sample item prediction data. The neural network model is trained by optimizing its parameters based on the sample intent prediction data, the sample behavior prediction data, the sample item prediction data, and the item tag information to obtain an item recommendation model. The step of optimizing the parameters of the neural network model based on the sample intent prediction data, the sample behavior prediction data, the sample item prediction data, and the item tag information to train the neural network model and obtain an item recommendation model includes: A first loss value is obtained by calculating the loss based on the sample intent prediction data and the sample object intent features in the item tag information; a second loss value is obtained by calculating the loss based on the sample behavior prediction data and the sample object behavior features in the item tag information; a third loss value is obtained by calculating the loss based on the sample item prediction data and the item tag information; a target loss value is obtained by weighting the first loss value, the second loss value, the third loss value, the first similarity value, the second similarity value, the third similarity value, and the fourth similarity value; the neural network model is then optimized based on the target loss value to train the neural network model and obtain the item recommendation model.
2. The training method according to claim 1, characterized in that, The data integration processing of the sample object information and the basic information of the item to obtain at least two target sample pairs for each training sample object includes: The sample object information is encoded to obtain the sample object feature vector; The basic information of the items is encoded to obtain the sample item feature vector; The feature vectors of the sample object and the feature vectors of the sample item are merged to obtain the target sample pair.
3. The training method according to claim 1 or 2, characterized in that, The first neural network includes a first encoding layer and a first linear layer. The sample intent prediction data includes first sample intent prediction data and second sample intent prediction data. The step of performing intent prediction processing on the first sample pair and the second sample pair based on the first neural network to obtain sample intent prediction data includes: The first sample pair is encoded by the first encoding layer to obtain the first sample encoding vector, and the second sample pair is encoded by the first encoding layer to obtain the second sample encoding vector. The label probability of the first sample encoding vector is calculated using the first linear layer and the preset reference intent label to obtain the first sample intent prediction data. Similarly, the label probability of the second sample encoding vector is calculated using the first linear layer and the reference intent label to obtain the second sample intent prediction data.
4. The training method according to claim 3, characterized in that, The second neural network includes a second encoding layer and a second linear layer. The sample behavior prediction data includes first sample behavior prediction data and second sample behavior prediction data. The step of performing behavior prediction processing on the first sample pair and the second sample pair based on the second neural network to obtain sample behavior prediction data includes: The first sample pair is encoded by the second encoding layer to obtain the third sample encoding vector, and the second sample pair is encoded by the second encoding layer to obtain the fourth sample encoding vector. The label probability of the third sample encoding vector is calculated using the second linear layer and the preset reference behavior label to obtain the first sample behavior prediction data. Similarly, the label probability of the fourth sample encoding vector is calculated using the second linear layer and the reference behavior label to obtain the second sample behavior prediction data.
5. The training method according to claim 4, characterized in that, The third neural network includes a third encoding layer and a third linear layer. The sample item prediction data includes first sample item prediction data and second sample item prediction data. The step of performing item prediction processing on the first sample pair and the second sample pair based on the third neural network to obtain sample item prediction data includes: The first sample pair is encoded by the third encoding layer to obtain the fifth sample encoding vector, and the second sample pair is encoded by the third encoding layer to obtain the sixth sample encoding vector. The label probability of the fifth sample encoding vector is calculated using the third linear layer and the preset reference item label to obtain the predicted data of the first sample item. Similarly, the label probability of the sixth sample encoding vector is calculated using the third linear layer and the reference item label to obtain the predicted data of the second sample item.
6. The training method according to claim 5, characterized in that, The first similarity value, the second similarity value, the third similarity value, and the fourth similarity value are calculated according to the following steps: The similarity between the first sample encoding vector and the fifth sample encoding vector is calculated to obtain the first similarity value; The similarity between the second sample encoding vector and the sixth sample encoding vector is calculated to obtain the second similarity value; The similarity between the third sample encoding vector and the fifth sample encoding vector is calculated to obtain the third similarity value; The similarity between the fourth sample encoding vector and the sixth sample encoding vector is calculated to obtain the fourth similarity value.
7. A method for recommending items, characterized in that, The item recommendation method includes: Obtain target object information and target item information of the target object; The target object information and the target item information are input into the item recommendation model for recommendation processing to obtain an item recommendation list; the item recommendation model is trained according to the item recommendation model training method as described in any one of claims 1 to 6. The target item is pushed to the target object based on the item recommendation list.
8. A training device for an item recommendation model, characterized in that, The training device includes: The sample acquisition module is used to acquire sample object information and sample item information of the training sample objects; wherein, the sample item information includes basic item information and item tag information, and the item tag information is used to indicate the sample object intent and sample object behavior of the training sample objects; The data integration module is used to integrate the sample object information and the basic information of the item to obtain at least two target sample pairs for each training sample object. An input module is used to input the first sample pair and the second sample pair from the at least two target sample pairs into a preset neural network model; wherein the neural network model includes a first neural network, a second neural network, and a third neural network; The first prediction module is used to perform intent prediction processing on the first sample pair and the second sample pair based on the first neural network to obtain sample intent prediction data. The second prediction module is used to perform behavior prediction processing on the first sample pair and the second sample pair based on the second neural network to obtain sample behavior prediction data. The third prediction module is used to perform item prediction processing on the first sample pair and the second sample pair based on the third neural network to obtain sample item prediction data. The training module is used to optimize the parameters of the neural network model based on the sample intent prediction data, the sample behavior prediction data, the sample item prediction data, and the item label information, so as to train the neural network model and obtain the item recommendation model. The training device is also used for: A first loss value is obtained by calculating the loss based on the sample intent prediction data and the sample object intent features in the item tag information; a second loss value is obtained by calculating the loss based on the sample behavior prediction data and the sample object behavior features in the item tag information; a third loss value is obtained by calculating the loss based on the sample item prediction data and the item tag information; a target loss value is obtained by weighting the first loss value, the second loss value, the third loss value, the first similarity value, the second similarity value, the third similarity value, and the fourth similarity value; the neural network model is then optimized based on the target loss value to train the neural network model and obtain the item recommendation model.
9. An electronic device, characterized in that, The electronic device includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement: The training method for the item recommendation model as described in any one of claims 1 to 6; or, The item recommendation method as described in claim 7.
10. A computer-readable storage medium storing a computer program, characterized in that, The computer program is executed by the processor to achieve the following: The training method for the item recommendation model as described in any one of claims 1 to 6; or, The item recommendation method as described in claim 7.
Citation Information
Patent Citations
Recommendation model training method and device, recommendation method and device, medium and equipment
CN114117213A
Updating an online multi-domain sentence representation generation module of a text classification system
US20200250274A1