Method, recommendation method, device and apparatus for generating recommendation model

By adjusting the graph convolution kernel, a recommendation model is generated to ensure a reasonable score ratio between popular and novel gift packs. This solves the problem of popular bias in recommendation systems, improves the recommendation of novel gift packs, and enhances the user experience.

CN116662641BActive Publication Date: 2026-11-27NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310429424.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-18
Publication Date
2026-11-27
Estimated Expiration
2043-04-18

AI Technical Summary

Technical Problem

Existing recommendation systems suffer from the Matthew effect, tending to recommend popular products while ignoring novel ones, leading to a decline in user experience.

Method used

By generating a recommendation model, the system uses graph convolution kernels to adjust users' scores for popular and novel gift packs, ensuring that the score for popular gift packs is not lower than a first threshold and the score for novel gift packs is not lower than a second threshold that is higher than the first threshold. The parameters are then updated to generate the recommendation model.

Benefits of technology

While ensuring the accuracy of the recommendation results, the recommendation of novel gift packs has been improved to meet the diverse needs of users and enhance the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116662641B_ABST
    Figure CN116662641B_ABST
Patent Text Reader

Abstract

The application discloses a method for generating a recommendation model and a recommendation method. The method comprises the following steps: obtaining a training data set, wherein the training sample included in the training data set comprises training data and training labels, the training data comprises user feature data and candidate gift package data, and the training labels represent that a first type of gift package in the candidate gift package data has been purchased by a user and a second type of gift package in the candidate gift package data has not been purchased by the user; inputting the training sample into an initial model for training to obtain a prediction label, wherein the initial model comprises a convolution kernel, the convolution kernel reduces the score of the user for the first type of gift package to not less than a first threshold value and increases the score of the user for the second type of gift package to not less than a second threshold value; and performing parameter updating on the parameters of the initial model according to the prediction label and the training label to generate a recommendation model. The method can maintain the recommendation of popular gift packages and improve the recommendation of novel gift packages while ensuring the accuracy of the recommendation result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a method, recommendation method, apparatus, device, and computer-readable storage medium for generating recommendation models. Background Technology

[0002] Artificial intelligence (AI) is the theory, methods, technology, 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 achieve optimal results. In other words, AI is a branch of computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. Artificial intelligence studies the design principles and implementation methods of various intelligent machines, enabling them to possess the functions of perception, reasoning, and decision-making.

[0003] With the development of internet information technology, especially the rise of e-commerce, internet content has experienced explosive growth, gradually entering the era of massive data. Users are often overwhelmed by the dazzling array of goods, movies, music, videos, and other items available, a problem frequently referred to as information overload. Taking video games as an example, game packs, a common form of in-game interaction, typically consist of combinations of related items and are then distributed to interested users through recommendation systems. However, existing recommendation systems suffer from the Matthew effect, tending to recommend popular items while underperforming novel recommendations. Therefore, building a recommendation system that balances accuracy and novelty is crucial for improving the user experience.

[0004] Therefore, there is an urgent need for a recommendation method that can improve the recommendation of novelty packages while ensuring the accuracy of the recommendation results, thereby better meeting user needs. Summary of the Invention

[0005] This application provides a method, recommendation method, apparatus, device, and computer-readable storage medium for generating recommendation models. This method can improve the recommendation of novelty packages while ensuring the accuracy of the recommendation results, thereby better meeting user needs.

[0006] A first aspect of this application provides a method for generating a recommendation model. The method includes: acquiring a training dataset, wherein the training dataset includes at least one training sample comprising training data and training labels, the training data including user-associated user feature data and candidate gift pack data, the training labels representing: a first type of gift pack purchased by the user in the candidate gift pack data, and a second type of gift pack not purchased by the user in the candidate gift pack data; inputting the training samples into an initial model for training to obtain predicted labels, the initial model including a convolutional kernel, wherein the convolutional kernel, during the initial model training, reduces the user's score for the first type of gift pack to no less than a first threshold, and increases the user's score for the second type of gift pack to no less than a second threshold, the second threshold being greater than the first threshold; updating the parameters of the initial model according to the predicted labels and the training labels to generate a recommendation model.

[0007] A second aspect of this application provides a recommendation method, the method comprising: acquiring a recommendation request sent by a user, wherein the recommendation request is used to request a recommendation package for the user; processing the user's user feature data using a recommendation model to obtain a recommendation result corresponding to the recommendation request, wherein the recommendation model is a model generated according to the method described in the first aspect above, and the user feature data is determined according to the recommendation request; and recommending the recommendation result to the user.

[0008] A third aspect of this application provides an apparatus for generating a recommendation model, the apparatus comprising: an acquisition unit and a training unit; the acquisition unit is configured to acquire a training dataset, wherein the training dataset includes at least one training sample comprising training data and training labels, the training data including user-associated user feature data and candidate gift pack data, the training labels representing: a first type of gift pack purchased by the user in the candidate gift pack data, and a second type of gift pack not purchased by the user in the candidate gift pack data; the training unit is configured to input the training samples into an initial model for training to obtain predicted labels, the initial model including a convolutional kernel, wherein the convolutional kernel, during the initial model training, reduces the user's score for the first type of gift pack to no less than a first threshold, and increases the user's score for the second type of gift pack to no less than a second threshold, the second threshold being greater than the first threshold; the training unit is further configured to update the parameters of the initial model based on the predicted labels and the training labels to generate a recommendation model.

[0009] A fourth aspect of this application provides a recommendation apparatus, comprising: an acquisition unit, a processing unit, and a recommendation unit; the acquisition unit is configured to acquire a recommendation request sent by a user, wherein the recommendation request is for requesting a recommendation package for the user; the processing unit is configured to process the user's user feature data using a recommendation model to obtain a recommendation result corresponding to the recommendation request, wherein the recommendation model is a model generated according to the method described in the first aspect above, and the user feature data is determined based on the recommendation request; the recommendation unit is configured to recommend the recommendation result to the user.

[0010] A fifth aspect of this application also provides an electronic device, including: a processor; and a memory for storing a data processing program. After the electronic device is powered on and runs the program through the processor, it executes the method for generating a recommendation model as described above, or the recommendation method as described above.

[0011] A sixth aspect of this application also provides a computer-readable storage medium storing one or more computer instructions, characterized in that the instructions are executed by a processor to implement the method for generating a recommendation model or the recommendation method described in any of the above technical solutions.

[0012] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments disclosed in this application, nor is it intended to limit the scope of this application's disclosure. Other features disclosed in this application will become readily apparent from the following description.

[0013] The technical solution of the method for generating a recommendation model provided in this application embodiment includes: acquiring a training dataset, wherein the training dataset includes at least one training sample including training data and training labels, the training data including user feature data associated with users and candidate gift pack data, and the training labels representing: first type gift packs purchased by users in the candidate gift pack data, and second type gift packs not purchased by users in the candidate gift pack data; inputting the training samples into an initial model for training to obtain predicted labels, the initial model including a convolutional kernel, the convolutional kernel reducing the user's score for the first type gift pack to no less than a first threshold and increasing the user's score for the second type gift pack to no less than a second threshold, the second threshold being greater than the first threshold; updating the parameters of the initial model according to the predicted labels and training labels to generate a recommendation model. It can be understood that users purchase first type gift packs (i.e., popular gift packs) more often, while purchasing second type gift packs (i.e., novelty gift packs) less often. Therefore, the gift packs purchased by users associated with the user feature data are mostly first type gift packs, and the gift packs not purchased by users associated with the user feature data are mostly second type gift packs. In the process of generating the recommendation model described above, the convolutional kernel of the initial model can reduce the score of the user associated with the user feature data for the first type of gift package that the user has already purchased in the candidate gift package data to no less than a first threshold. This ensures the accuracy of the recommendation results output by the recommendation model. Furthermore, the score of the user associated with the user feature data for the second type of gift package that the user has not purchased in the candidate gift package data can be increased to no less than a second threshold, and the second threshold is greater than the first threshold. This improves the model's recommendation of gift packages that the user has never purchased (i.e., novel gift packages). In other words, the recommendation model generated by the method for generating the recommendation model provided in this application embodiment can maintain the recommendation of popular gift packages while improving the recommendation of novel gift packages, thereby better meeting user needs, while ensuring the accuracy of the recommendation results. Attached Figure Description

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

[0015] Figure 1 This is a schematic diagram of an application scenario provided in an embodiment of this application.

[0016] Figure 2 This is a schematic diagram of a method for generating a recommendation model provided in an embodiment of this application.

[0017] Figure 3 The above Figure 2 A schematic diagram of the structure of the initial model involved.

[0018] Figure 4 This is a schematic diagram of a recommended method provided in an embodiment of this application.

[0019] Figure 5 This is a schematic diagram of another recommendation generation model provided in an embodiment of this application.

[0020] Figure 6 The above Figure 5 A schematic diagram of the structure of the recommendation model involved.

[0021] Figure 7 This is a schematic diagram of the structure of an apparatus for generating a recommendation model provided in an embodiment of this application.

[0022] Figure 8 This is a schematic diagram of the structure of a recommended device provided in an embodiment of this application.

[0023] Figure 9 This is a schematic diagram of the structure of a training device provided in an embodiment of this application.

[0024] Figure 10 This is a schematic diagram of the structure of an execution device provided in an embodiment of this application. Detailed Implementation

[0025] To enable those skilled in the art to better understand the technical solutions of this application, the application will be clearly and completely described below with reference to the accompanying drawings of the embodiments. However, this application can be implemented in many other ways different from those described above. Therefore, based on the embodiments provided in this application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this application.

[0026] It should be noted that the terms "first," "second," "third," etc., in the claims, specification, and drawings of this application are used to distinguish similar objects and are not used to describe a specific order or sequence. Such data are interchangeable where appropriate so that the embodiments of this application described herein can be implemented in a sequence other than that shown or described herein. Furthermore, the terms "comprising," "having," and their variations are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that includes 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 these processes, methods, products, or apparatuses.

[0027] To facilitate understanding, the technical terms that may be involved in the embodiments of this application will be briefly introduced first.

[0028] 1. Deep Learning

[0029] Deep learning is a branch of machine learning and artificial intelligence. It refers to the method of using computers to perform machine learning by using multi-layered concepts and computations, where there are certain relationships between the various layers.

[0030] 2. Neural Network Model

[0031] Neural network models are deep learning models designed to mimic the neuronal structure of the human brain to some extent. They are typically implemented through the connections between multiple layers and nodes.

[0032] 3. Deep Neural Network (DNN)

[0033] DNN is a framework for deep learning; it is a neural network with at least one hidden layer. In other words, DNN includes neural network models that incorporate convolutional operations.

[0034] 4. Graph Neural Network (GNN)

[0035] Generic Neural Networks (GNNs) refer to a general term for algorithms that use neural networks to learn graph-structured data, extract and discover features and patterns within it, and meet the needs of graph learning tasks such as clustering, classification, prediction, segmentation, and generation. GNNs are a universal framework for deep learning used for representation learning of non-Euclidean data, especially graph-structured data.

[0036] 5. Graph convolution kernel

[0037] Graph convolution kernels are a generalization of convolution kernels to graph-structured data. They are obtained by taking a weighted average of the representation vectors of a node and its neighboring nodes in the graph structure, where the weights are defined by the graph convolution kernel.

[0038] 6. Positive propagation

[0039] Forward propagation refers to the movement of input through the hidden layer to the output layer. In forward propagation, information travels in a single direction. The input layer provides input to the hidden layer, which then generates the output. There is no backward movement in this process.

[0040] 7. Backpropagation

[0041] Updating weights using the gradient of the loss function is called backpropagation. When defining a neural network, random weights and biases are assigned to nodes, and the network's error is calculated by receiving the output of a single iteration. This error, along with the gradient of the loss function, is then fed back from the outer layers through the hidden layers to update the network's weights. Finally, these weights are updated to reduce errors in subsequent iterations.

[0042] 8. Loss Function

[0043] When a network is built, it attempts to predict the output as closely as possible to the actual value. A loss function (also called a cost function) can be used to measure the network's accuracy, improving prediction precision and reducing errors to minimize loss. The optimal outputs are those with the smallest loss function values. Commonly used loss functions include the mean squared error function and the cross-entropy function.

[0044] 9. Batch

[0045] When training a neural network, instead of sending all the input at once, the input is divided into several random blocks of equal size. Compared to sending all the data into the network at once, sending the data in batches during training results in a more general model.

[0046] 10. Iteration

[0047] One iteration refers to the batch being propagated forward and backward once for training.

[0048] 11. Activation function

[0049] The purpose of activation functions is to increase the nonlinearity of the model, enabling it to better perform classification and regression problems. The aim of using activation functions is to introduce nonlinear factors into the network, enhance its representational capabilities, and solve problems that linear models cannot address.

[0050] 12. Hive Distributed Database: Hive is a data warehouse tool based on Hadoop, used for data extraction, transformation, and loading. It is a mechanism that can store, query, and analyze large-scale data stored in Hadoop.

[0051] 13. Airflow: An orchestration, scheduling, and monitoring platform, open-sourced by Airbnb. It provides a rich set of command-line tools and an easy-to-use user interface for viewing operations, and Airflow also offers a monitoring and alerting system.

[0052] 14. Redis Database: Short for "Remote Dictionary Server," it is an open-source, ANSI C-written, network-enabled, in-memory or persistent log-structured key-value database that provides APIs for multiple languages.

[0053] With the development of internet information technology, internet content has experienced explosive growth, gradually entering the era of big data. Users are often overwhelmed by the dazzling array of goods, movies, music, videos, and other items available, a problem frequently referred to as information overload. As a technological means to address this information overload problem in the big data era, recommendation systems are widely used in e-commerce, social platforms, and video games. Taking video games as an example, game gift packs, a common form of in-game interaction, typically consist of combinations of related items and are then distributed to interested users through recommendation systems. Therefore, building a recommendation system that balances accuracy and novelty is crucial for improving the user experience.

[0054] In traditional techniques, a game gift pack recommendation model based on graph neural networks (GNNs) has been proposed to improve the accuracy of recommendation systems. This model constructs a heterogeneous graph of users, items, and gift packs based on user purchase behavior. Then, it uses a GNN framework to aggregate the representation vectors of neighboring nodes, capturing high-order collaborative filtering signals among users, items, and gift packs, thereby improving recommendation performance. However, due to data distribution—specifically, a larger amount of data on popular game gift packs and a smaller amount on novel ones—this GNN-based model tends to prioritize learning popular game gift packs. Furthermore, the model uses classic symmetric normalized graph convolution kernels, resulting in a popularity bias, where it tends to recommend popular game gift packs. Therefore, while the recommendation accuracy obtained using this GNN-based model is relatively good, it tends to frequently recommend popular game gift packs to users, leading to less exposure to novel game gift packs. Because the variety of popular game packs is limited, repeatedly pushing these packs to users by the aforementioned recommendation model will fail to truly capture user needs, thus reducing the user experience. In summary, traditional recommendation models are prone to the "Matthew effect" (polarization), meaning existing recommendation systems tend to recommend popular items, while less popular items are difficult to expose to interested users. This results in traditional methods failing to effectively recommend suitable items and meet user needs.

[0055] To address the aforementioned issues, embodiments of this application provide a method, recommendation method, apparatus, device, and storage medium for generating recommendation models.

[0056] The application scenarios and recommended methods applicable to the embodiments of this application will be described in detail below with reference to the accompanying drawings. It is understood that, where there is no conflict between the various embodiments provided in this application, the following embodiments and features can be combined with each other. Furthermore, the timing of the steps in the following method embodiments is merely an example and not a strict limitation.

[0057] First, the application scenarios of the recommended methods applicable to the embodiments of this application will be described with reference to the accompanying drawings.

[0058] Figure 1 This is a schematic diagram illustrating an application scenario provided in an embodiment of this application. For example... Figure 1 As shown, this application scenario includes at least one terminal 101 and at least one server 102. The server 102 and the terminal 101 can communicate via network 103 to transmit data.

[0059] Applications can be installed and run on terminal 101. For example, these applications can be, but are not limited to, any of the following: game applications, shopping applications, browser applications, smart assistant applications, social applications, virtual reality (VR) applications, or augmented reality (AR) applications. In this embodiment, the device type of terminal 101 is not specifically limited. For example, terminal 101 can be, but is not limited to, any of the following devices: personal computer, smartphone, tablet computer, desktop computer, personal digital assistant (PDA), laptop computer, smart speaker, smartwatch, or wearable device (e.g., smartwatch, or smart glasses), or other types of mobile devices.

[0060] Server 102 provides background services for clients of applications installed and running on terminal 101. In some implementations, server 102 may deploy a recommendation model generated according to embodiments of this application. After receiving a recommendation request from terminal 101, server 102 can process the recommendation request using the locally deployed recommendation model to obtain the recommendation result corresponding to the request. Subsequently, server 102 can send the recommendation result to terminal 101 to better meet the user needs of terminal 101. Optionally, in other implementations, server 102 can also train an initial model using user data to generate a recommendation model, and deploy the trained recommendation model locally on server 102. In embodiments of this application, the device type of server 102 is not specifically limited. In other words, server 102 can be a standalone 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, content delivery networks (CDNs), and big data and artificial intelligence platforms. Optionally, server 102 can simultaneously provide background services for applications in multiple terminals 101.

[0061] Network 103 can be a wired network or a wireless network, and this application does not specifically limit it. Optionally, in some implementations, the aforementioned wired or wireless network uses standard communication technologies and / or protocols. The network is typically the Internet, but can also be any network, including but not limited to local area networks (LANs), metropolitan area networks (MANs), wide area networks (WANs), mobile, wired or wireless networks, private networks, or any combination of virtual private networks. In some embodiments, technologies and / or formats including Hypertext Markup Language (HTML), Extensible Markup Language (XML), etc., are used to represent data exchanged over the network. Furthermore, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), and Internet Protocol Security (IPsec) can be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technologies can be used to replace or supplement the aforementioned data communication technologies.

[0062] It should be understood that the above Figure 1 The application scenarios shown are for illustrative purposes only and do not constitute any limitation on the application scenarios to which the emotion recognition method provided in this application embodiment is applicable. Optionally, the above... Figure 1 The application scenarios shown can also include a greater number of servers 102, a greater number of terminals 101, and a greater number of networks 103. Optionally, the above... Figure 1 The terminal 101 shown can also be replaced by a server other than server 102.

[0063] Next, combined Figures 2 to 6 This application introduces a method for generating a recommendation model and a recommendation method provided in its embodiments.

[0064] Figure 2 This is a schematic diagram illustrating a method for generating a recommendation model according to an embodiment of this application. The method for generating a recommendation model provided in this embodiment can be executed by a training device. It is understood that the training device can be implemented as software, or a combination of software and hardware. For example, the training device in this embodiment can be, but is not limited to, a server or a terminal device used by the user. Figure 2As shown, the method for generating a recommendation model provided in this application includes steps S210 to S230. Steps S210 to S230 will be described in detail below.

[0065] S210, Obtain a training dataset, wherein the training dataset includes at least one training sample comprising training data and training labels, the training data comprising user-associated user feature data and candidate gift pack data, and the training labels representing: first type gift packs purchased by users in the candidate gift pack data, and second type gift packs not purchased by users in the candidate gift pack data.

[0066] User-associated user characteristic data is used to represent the user's characteristics. The content included in the user characteristic data is not specifically limited. In some implementations, user characteristic data includes: the user's identifier, the identifier of the gift pack purchased by the user, the purchase data of the gift pack purchased by the user, and the number of times the user purchased the gift pack. The user's identifier is used to identify the user, and the identifier of the gift pack purchased by the user is used to identify the gift pack. The presentation method of the user's identifier and the identifier of the gift pack purchased by the user is not specifically limited. For example, the user's identifier may be, but is not limited to, the user's account or user name. For example, the identifier of the gift pack may be, but is not limited to, the name of the gift pack. It is understood that in this embodiment, the gift pack purchased by the user is a first type of gift pack, and the gift pack not purchased by the user is a second type of gift pack. The first type of gift pack is a popular gift pack, and the second type of gift pack is a novel gift pack. Optionally, in other implementations, the above-mentioned user characteristic data may also include at least one of the following data: the user's occupation, the user's social relationships, the user's game level, the user's combat power in the game, or the user's spending power.

[0067] The candidate gift pack data includes first-type gift packs that the user has purchased and second-type gift packs that the user has not purchased. The following is an example description of the candidate gift pack data and the gift packs that the user has purchased. For instance, the gift packs that the user has purchased, associated with the user's feature data, include: Gift Pack 1 and Gift Pack 2; the candidate gift pack data includes: Gift Pack 1, Gift Pack 2, Gift Pack 3, Gift Pack 4, and Gift Pack 5, where Gift Pack 1 to Gift Pack 5 are five different gift packs; among them, Gift Pack 1 and Gift Pack 2 are examples of first-type gift packs; and Gift Pack 3, Gift Pack 4, and Gift Pack 5 are examples of second-type gift packs.

[0068] In this embodiment of the application, there is no specific limitation on the number and type of items included in any one of the gift packs in the candidate gift pack data and the gift packs purchased by the user. For example, in the field of game applications, the items included in any one of the above-mentioned gift packs may be, but are not limited to, one or more of the following: virtual currency, props, or equipment.

[0069] It is understood that the above description of S210 uses the example of a training dataset including at least one training sample. In the embodiments of this application, the number of training samples included in the training dataset is not specifically limited. That is, the training dataset described in S210 above may include one or more training samples. In the scenario where the training dataset includes multiple training samples, the multiple training samples correspond one-to-one with multiple users.

[0070] S220, Input the training samples into the initial model for training to obtain the predicted labels. The initial model includes convolutional kernels. During the initial model training, the convolutional kernels reduce the user's score for the first type of gift package to no less than a first threshold and increase the user's score for the second type of gift package to no less than a second threshold. The second threshold is greater than the first threshold.

[0071] In this embodiment, the initial model is a graph convolutional neural network model, wherein the output model includes an input layer, intermediate layers, and an output layer. The intermediate layers include at least a graph convolutional layer, and the convolutional kernels of the graph convolutional layers are used to perform graph convolution computations. For example, Figure 3 The structure of the initial model provided in an embodiment of this application is shown. See also Figure 3 As shown, the initial model includes an input layer 310, an intermediate layer 320, and an output layer 330. The intermediate layer 320 includes an N-layer graph convolutional layer 321, where N is an integer. The value of N is not specifically limited and can be set according to the actual application scenario and needs. For example, N can be, but is not limited to, 2, 5, or 10. It should be noted that the above... Figure 3 The intermediate layer 320 shown only includes graph convolutional layer 321 and does not introduce any other computational layers such as pooling layers or activation layers. Optionally, in some other implementations, additional computational layers may be introduced... Figure 3 The intermediate layer 321 shown includes other computational layers such as regularization layers or activation layers following the graph convolutional layer 321. The regularization layer performs regularization operations on the output of the convolutional layer to reduce the risk of overfitting. The activation layer introduces non-linear characteristics into the model network to enhance its learning ability.

[0072] In the embodiments of this application, the training process described in S220 above may specifically include S220-1 to S220-4. S220-1 to S220-4 will be described in detail below.

[0073] S220-1, the input layer of the initial model extracts features from the training data to obtain the user feature matrix, the gift package feature matrix, and the item feature matrix; where the user feature matrix represents the user feature data; the gift package feature matrix represents the features of the candidate gift packages recorded in the candidate gift package data; and the item matrix represents the features of the items included in the candidate gift packages recorded in the candidate gift package data.

[0074] In this embodiment, any one of the user feature matrix, gift package feature matrix, and item feature matrix can be a two-dimensional matrix. For example, the user feature matrix is ​​a two-dimensional matrix obtained by extracting features from user data. The number of rows in the user feature matrix represents the number of users, and the number of columns represents the feature length. The features of the gift package can be, but are not limited to, one or more of the following: the gift package's ID, the gift package's virtual price, or the type and number of items included in the gift package. The features of the item can be, but are not limited to, one or more of the following: the item's ID, the item's type, or the item's purpose.

[0075] It is understandable that any one of the above user feature matrix, gift package feature matrix, and item feature matrix has a fixed value, meaning that none of the above feature matrices includes adjustable variable parameters.

[0076] S220-2, the intermediate layer of the initial model performs feature transformation on the user feature matrix, gift package feature matrix and item feature matrix to obtain the initial user representation matrix corresponding to the user feature matrix, the initial gift package representation matrix corresponding to the gift package feature matrix and the initial item representation matrix corresponding to the item feature matrix; wherein, any representation matrix includes adjustable neural network parameters, and the intermediate layer includes a convolutional layer.

[0077] Any initial representation matrix includes adjustable neural network parameters. In other words, when adjusting the parameters of the initial model, the parameters also include the adjustable neural network parameters included in the initial representation matrix.

[0078] In the embodiments of this application, the intermediate layer includes at least a convolutional layer, and there is no specific limitation on whether the intermediate layer also includes other network layers besides the convolutional layer. In some implementations, when the intermediate layer only includes a convolutional layer, the above-mentioned feature transformation processing is also performed by the convolutional layer. Optionally, other network layers are provided before the convolutional layers included in the intermediate layer, and the above-mentioned feature transformation processing can also be performed by these other network layers.

[0079] S220-3, the convolutional layers of the initial model obtain the user representation matrix, gift package representation matrix, and item representation matrix based on the convolutional kernel, the initial user representation matrix, the initial gift package representation matrix, and the initial item representation matrix.

[0080] The convolutional layers of the initial model described above obtain the user representation matrix, gift package representation matrix, and item representation matrix based on the convolutional kernel, the initial user representation matrix, the initial gift package representation matrix, and the initial item representation matrix. In some implementations, the user representation matrix is ​​the product of the initial user representation matrix and the convolutional kernel; the gift package representation matrix is ​​the product of the initial gift package representation matrix and the convolutional kernel; and the item representation matrix is ​​the product of the initial item representation matrix and the convolutional kernel. In this implementation, the user representation matrix is ​​equivalent to a first-order matrix of the initial user representation matrix; the gift package representation matrix is ​​equivalent to a first-order matrix of the initial gift package representation matrix; and the item representation matrix is ​​equivalent to a first-order matrix of the initial item representation matrix. Optionally, in other implementations, the user representation matrix is ​​the product of a first user representation matrix and a convolution kernel, where the first user representation matrix is ​​the product of the initial user representation matrix and the convolution kernel; the gift package representation matrix is ​​the product of a first gift package representation matrix and a convolution kernel, where the first gift package representation matrix is ​​the product of the initial gift package representation matrix and the convolution kernel; the item representation matrix is ​​the product of a first item representation matrix and a convolution kernel, where the first item representation matrix is ​​the product of the initial item representation matrix and the convolution kernel. The user representation matrix is ​​equivalent to a second-order matrix of the initial user representation matrix; the gift package representation matrix is ​​equivalent to a second-order matrix of the initial gift package representation matrix; and the item representation matrix is ​​equivalent to a second-order matrix of the initial item representation matrix.

[0081] Optionally, in some implementations, the convolutional layers of the initial model obtain the user representation matrix, gift package representation matrix, and item representation matrix based on the convolutional kernel, the initial user representation matrix, the initial gift package representation matrix, and the initial item representation matrix. Specifically, this may include the following steps:

[0082] S220-31, by performing successive convolutions on the initial user representation matrix, initial gift pack representation matrix and initial item representation matrix using convolution kernels, to obtain the first initial user representation matrix, first initial gift pack representation matrix and first initial item representation matrix after each convolution.

[0083] For example, by performing a K-order convolution on the initial user representation matrix, the initial gift package representation matrix, and the initial item representation matrix using a convolution kernel, the resulting first initial user representation matrix includes the zero-order matrix, the first-order matrix, the second-order matrix, ..., the K-order matrix of the initial user representation matrix; the resulting first initial gift package representation matrix includes the zero-order matrix, the first-order matrix, the second-order matrix, ..., the K-order matrix of the initial gift package representation matrix; and the resulting first initial item representation matrix includes the zero-order matrix, the first-order matrix, the second-order matrix, ..., the K-order matrix of the initial item representation matrix.

[0084] S220-32, average the first initial user representation matrix, the first initial gift package representation matrix, and the first initial item representation matrix after each convolution to obtain the user representation matrix, the gift package representation matrix, and the item representation matrix.

[0085] For example, by performing a K-order convolution on the initial user representation matrix, initial gift package representation matrix, and initial item representation matrix using a convolution kernel, the resulting user representation matrix is ​​the average of the zero-order matrix, the first-order matrix, the second-order matrix, ..., and the K-order matrix of the initial user representation matrix; the resulting gift package representation matrix is ​​the average of the zero-order matrix, the first-order matrix, the second-order matrix, ..., and the K-order matrix of the initial gift package representation matrix; and the resulting item representation matrix is ​​the average of the zero-order matrix, the first-order matrix, the second-order matrix, ..., and the K-order matrix of the initial item representation matrix.

[0086] Optionally, in some implementations, the convolution kernel is an asymmetric convolution kernel obtained by performing asymmetric processing on the adjacency matrix using the initial diagonal matrix. The adjacency matrix represents the mapping relationship between users, candidate gift packages recorded in the candidate gift package data, and the items included in the candidate gift packages. In some implementations, the value of the i-th row and i-th column of the initial diagonal matrix is ​​equal to the sum of the i-th row of the adjacency matrix. Any element of the initial diagonal matrix other than the i-th row and i-th column is equal to zero. The value of i ranges from [1, P], where P represents the maximum number of rows in the adjacency matrix, and P is an integer greater than or equal to 2. In some implementations, the adjacency matrix is ​​determined based on the indicator matrix and the association matrix. The association matrix represents the mapping relationship between candidate gift packages recorded in the candidate gift package data and the items included in the candidate gift packages. Optionally, in some implementations, the adjacency matrix determined based on the indicator matrix and the association matrix is ​​expressed by the following mathematical formula:

[0087]

[0088] Where A represents the adjacency matrix; X represents the indicator matrix; Z represents the incidence matrix; X T Z represents the transpose of X; T Let Z be the transpose of Z.

[0089] Optionally, in some implementations, the convolutional kernel is specifically the product of the first diagonal matrix, the adjacency matrix, and the second diagonal matrix. The first diagonal matrix is ​​the power of the first parameter value of the initial diagonal matrix, where the first parameter value is equal to a negative initial parameter value. The second diagonal matrix is ​​the power of the second parameter value of the initial diagonal matrix, where the second parameter value is equal to the initial parameter value minus 1. The initial parameter values ​​are preset values. The initial parameter values ​​in the convolutional kernel are preset values, meaning they are set in the initial model before training. The specific values ​​of the initial parameters can be adjusted based on the training results of the initial model; that is, the initial parameter values ​​are not fixed. In this embodiment, the initial parameter values ​​in the convolutional kernel can be used to balance the accuracy and novelty of the recommendations made by the trained recommendation model. Specifically, increasing the initial parameter values ​​can improve the novelty of the recommendation model, making it easier for the model to generate novel game packages. There are no restrictions on the range of initial parameter values; that is, the specific values ​​can be adjusted and set based on the actual test results of the model. In some implementations, to balance the recommendation probability of novelty packages and popularity packages, the applicant theoretically derived that increasing the initial parameter value can increase the exposure of novelty packages. However, a larger initial parameter value is not always better, as an excessively large value can suppress popularity packages. The applicant's experiments showed that with an initial parameter value range of [0.5, 1.5], the recommendation of novelty packages can be significantly improved without sacrificing accuracy, while popularity packages remain unaffected. For example, see below. Figure 5 Formula 5.7 in the described method shows a specific data formula representation of the above convolution kernel.

[0090] It is understandable that the convolutional computation performed by the convolutional layers of the initial model described in S220-3 above is graph convolutional computation processing.

[0091] S220-4, the output layer of the initial model obtains predicted labels based on the user representation matrix and the gift package representation matrix.

[0092] The output layer of the initial model obtains predicted labels based on the user representation matrix and the gift package representation matrix, including: determining the score value of the user in the user representation matrix for each gift package in the gift package representation matrix based on the user representation matrix and the gift package representation matrix; and determining the predicted label based on the score value of the user in the user representation matrix for each gift package in the gift package representation matrix.

[0093] Optionally, in some implementations, the product of the user representation matrix and the gift package representation matrix is ​​used as the score of the user associated with the user representation matrix to the candidate gift package associated with the gift package representation matrix; this score is used as the prediction label.

[0094] As described above, the convolution kernel provided in this embodiment is an asymmetric convolution kernel. During the initial model training process, this convolution kernel can produce different results by convolving candidate gift packs with different training labels. It can convolve the initial user representation matrix, initial gift pack representation matrix, and initial item representation matrix of the first type of gift pack into a lower vector, and convolve the initial user representation matrix, initial gift pack representation matrix, and initial item representation matrix of the second type of gift pack into a higher vector. Specifically:

[0095] If the candidate gift package associated with the initial gift package representation matrix is ​​a first type of gift package, the convolution kernel reduces the initial user representation matrix, initial gift package representation matrix and initial item representation matrix to user representation matrix, gift package representation matrix and item representation matrix by performing convolution of consecutive orders on the initial user representation matrix, initial gift package representation matrix and initial item representation matrix, and makes the product of user representation matrix and gift package representation matrix not lower than the first threshold.

[0096] If the candidate gift package associated with the initial gift package representation matrix is ​​a second type of gift package, the convolution kernel performs successive convolutions on the initial user representation matrix, the initial gift package representation matrix, and the initial item representation matrix to elevate the initial user representation matrix, the initial gift package representation matrix, and the initial item representation matrix into user representation matrix, gift package representation matrix, and item representation matrix, and ensures that the product of the user representation matrix and the gift package representation matrix is ​​not lower than the second threshold.

[0097] S230: Based on the predicted labels and training labels, update the parameters of the initial model to generate a recommendation model.

[0098] Executing S230 above, i.e., updating the parameters of the initial model based on the predicted label and the training label to generate a recommendation model, includes: updating the parameters of the initial model based on the difference between the predicted label and the training label; stopping the parameter updating of the initial model once the training reaches the preset training conditions, thus obtaining the recommendation model. The difference between the predicted label and the training label can be represented by a loss function. In this embodiment, the loss function can be a classification loss function. The form of the classification loss function is not specifically limited and can be selected according to actual needs. For example, the classification loss function can be, but is not limited to, negative log-likelihood loss or cross-entropy loss. The preset training conditions are not specifically limited and can be set according to the actual scenario. In some implementations, the preset training conditions may include at least one of the following conditions: the number of training iterations of the initial model meets a preset number of training iterations, the training time of the initial model meets a preset training time, or the loss result of the initial model (i.e., the value of the loss function of the initial model) is less than a preset loss threshold. The preset number of training iterations, preset training time, and preset loss threshold are not specifically limited and can be set according to actual needs.

[0099] In this embodiment, a trained recommendation model can be obtained after executing S230. Subsequently, the trained recommendation model can be used to provide recommendation services to users. Next, a method for providing recommendation services to users using the trained recommendation model will be described.

[0100] Optionally, in some implementations, after updating the parameters of the initial model based on the predicted and training labels to generate a recommendation model, the method further includes: obtaining a recommendation request sent by the user to be recommended, wherein the recommendation request is used to request a recommendation package for the user to be recommended; processing the feature data of the user to be recommended using the recommendation model to obtain a recommendation result corresponding to the recommendation request, wherein the feature data of the user to be recommended is determined based on the recommendation request; and recommending the recommendation result corresponding to the recommendation request to the user to be recommended. In the above implementation, the recommendation request sent by the user to be recommended is used to request a recommendation package for the user to be recommended, and the feature data of the user to be recommended is determined based on the recommendation request sent by the user to be recommended. The recommendation request sent by the user to be recommended may include the basic information of the user to be recommended. That is, the device executing the method of this application embodiment can determine the feature data of the user to be recommended based on the recommendation request sent by the user to be recommended. The above-mentioned process of using a recommendation model to process the feature data of the user to be recommended and obtain the recommendation result corresponding to the recommendation request includes: using a recommendation model to process the feature data of the user to be recommended, the recommendation model outputs the score result of the user to be recommended for each of the multiple candidate gift packs; and determining the candidate gift pack corresponding to the highest score result of the user to be recommended among the score results of the user to be recommended for each of the multiple candidate gift packs as the gift pack indicated by the recommendation result corresponding to the recommendation request.

[0101] It should be understood that the above Figure 2 The illustrated method for generating recommendation models is merely illustrative and does not constitute any limitation on the method for generating recommendation models provided in the embodiments of this application. Optionally, in some other implementations, the training dataset may further include multiple training samples, wherein the multiple training samples are associated with multiple users. For example, the training dataset includes a first training sample and a second training sample. The first training sample includes first training data and a first training label. The first training data includes first user feature data and candidate gift pack data. The first training label represents: a first type of gift pack purchased by the first user in the candidate gift pack data, and a second type of gift pack not purchased by the first user in the candidate gift pack data. The second training sample includes second training data and a second training label. The second training data includes second user feature data and candidate gift pack data. The second training label represents: a first type of gift pack purchased by the second user in the candidate gift pack data, and a second type of gift pack not purchased by the second user in the candidate gift pack data.

[0102] In this embodiment, the convolution kernel of the initial model ensures that: the score of the user associated with the user feature data for the first type of gift package that the user has already purchased in the candidate gift package data is not lower than a first threshold, thus guaranteeing the accuracy of the recommendation results output by the recommendation model; and the score of the user associated with the user feature data for the second type of gift package that the user has not purchased in the candidate gift package data is not lower than a second threshold, and the second threshold is greater than the first threshold, thus improving the model's recommendation of gift packages that the user has never purchased (i.e., novel gift packages). In other words, the method for generating a recommendation model provided in this embodiment maintains the recommendation of popular gift packages while improving the recommendation of novel gift packages, thereby better meeting user needs, while ensuring the accuracy of the recommendation results. Furthermore, in the above implementation, the recommendation results obtained by processing the recommendation requests of the user to be recommended using the trained recommendation model can better recommend suitable items to the user to be recommended, thereby better meeting the user's needs.

[0103] The above text combined Figure 2 This paper introduces the method for generating recommendation models provided in this application. After obtaining a trained recommendation model, it can be used to provide recommendation services to users, such as recommending gift packages. Next, combined with... Figure 4 This application introduces the model recommendation method provided in this implementation.

[0104] Figure 4 This is a schematic diagram illustrating a recommended method provided in an embodiment of this application. The recommended method provided in this application can be executed by an execution device. It is understood that the execution device can be implemented as software, or a combination of software and hardware. For example, the execution device in this application embodiment can be, but is not limited to, a server or a terminal device used by a user. Figure 4 As shown, the recommended method provided in this application includes steps S410 to S430. Steps S410 to S430 will be described in detail below.

[0105] 410. Obtain the recommendation request sent by the user, wherein the recommendation request is used to request a gift pack to be recommended to the user.

[0106] 420. The user feature data is processed using a recommendation model to obtain the recommendation result corresponding to the recommendation request. The user feature data is determined based on the recommendation request.

[0107] User characteristic data is associated with users, whereby user characteristic data represents the characteristics of the user. The content included in user characteristic data is not specifically limited. In some implementations, user characteristic data includes: the user's identifier, the identifier of the gift pack purchased by the user, the purchase data of the gift pack purchased by the user, and the number of times the user purchased the gift pack. Optionally, in other implementations, the above-mentioned user characteristic data may also include at least one of the following: the user's occupation, the user's social relationships, the user's game level, the user's combat power in the game, or the user's spending power. In this embodiment, user characteristic data is determined based on a recommendation request. The implementation method of determining user characteristic data based on a recommendation request is not specifically limited. In some implementations, the recommendation request includes user characteristic data. Optionally, in other implementations, the recommendation request includes the user's identifier. In this implementation, determining user characteristic data based on the recommendation request may include the following steps: determining the user's identifier based on the recommendation request; determining the user characteristic data based on the user's identifier.

[0108] Executing S420 above, i.e., processing user feature data using a recommendation model to obtain recommendation results corresponding to the recommendation request, includes: inputting user feature data and multiple candidate gift packages into the recommendation model to obtain the user's recommendation score for each of the multiple candidate gift packages; determining the recommendation result corresponding to the recommendation request based on the user's recommendation score for each of the multiple candidate gift packages, wherein the gift package indicated by the recommendation result is the candidate gift package with the highest recommendation score among the multiple candidate gift packages. The number of the multiple candidate gift packages is not specifically limited; for example, the multiple candidate gift packages can be, but are not limited to, 2, 3, or 10, etc. In the above implementation, a trained recommendation model is used to process user feature data to obtain recommendation results for users associated with the user feature data, wherein the gift package indicated by the recommendation result is the candidate gift package with the highest score among the multiple candidate gift packages for that user.

[0109] It is understandable that the recommendation model described in S420 above is based on the above... Figure 2 The method for generating recommendation models described above generates models that, for details not elaborated here, can be found in the above-mentioned methods. Figure 2 The relevant description in the document.

[0110] 430. The recommendation results will be presented to the user.

[0111] It should be understood that the above Figure 4The recommendation method shown is for illustrative purposes only and does not constitute any limitation on the recommendation method provided in the embodiments of this application. It is understood that S410 to S430 above are described using a recommendation model to recommend a gift package to a single user as an example. Optionally, in other implementations, gift packages can also be recommended to multiple different users based on the recommendation method described in S410 to S430 above.

[0112] In this embodiment, a trained recommendation model is used to process user feature data to obtain recommendation results. The aforementioned recommendation model can maintain the accuracy of the recommendation results while simultaneously improving the recommendation of popular gift packs and novel gift packs, thus better meeting user needs. Therefore, this recommendation method can maintain the accuracy of the recommendation results while simultaneously improving the recommendation of popular gift packs and novel gift packs, thus better meeting user needs.

[0113] Below, in conjunction with Figure 5 This application introduces another method for generating recommendation models based on embodiments. It is understood that... Figure 5 The recommended method described above is as follows. Figure 2 A specific example of the described generative recommendation model, Figure 5 The methods described are for illustrative purposes only and do not constitute any limitation on the recommended methods provided in this application.

[0114] Figure 5 This is a schematic diagram illustrating another method for generating a recommendation model provided in this application embodiment. The method for generating a recommendation model provided in this application embodiment can be executed by an execution device. It is understood that the execution device can be implemented as software, or a combination of software and hardware. In some implementations, the execution device in this application embodiment can be, but is not limited to, a server or a terminal device used by a user. For example, the method for generating a recommendation model provided in this application embodiment can be, but is not limited to, executed by... Figure 1 The server 102 shown is executing. For example... Figure 5 As shown, the method includes steps S501 to S513. Steps S501 to S513 will be described in detail below.

[0115] S501, Obtain the training dataset, wherein the training dataset includes training sample 1, training sample 1 includes training data 1 and training label 1, training data 1 includes the profile features of user 1 and the candidate gift pack set 1 associated with game 1, and training label 1 represents: the gift pack of type #1 that user 1 has purchased in candidate gift pack set 1, and the gift pack of type #2 that user 1 has not purchased in candidate gift pack set 1.

[0116] User 1's profile features are used to describe User 1's attribute information, which is also referred to as User 1's feature information. In other words, User 1 can be identified based on User 1's profile features. User 1's profile features may include, but are not limited to, the following information: User 1's occupation, User 1's social relationships, User 1's game level, User 1's combat power in the game, User 1's spending ability, and User 1's historical purchase records of game gift packs. The historical purchase records of game gift packs by User 1 record information about gift packs purchased by User 1 in a specific game within a certain time period. In this embodiment, User 1's historical purchase records of game gift packs may specifically record the following information: User 1's identifier ID, game gift pack ID, the time of purchase of the game gift pack, and the quantity of game gift packs purchased. User 1's ID is used to identify User 1; the game gift pack ID is used to identify the game gift pack. It is understood that there is a mapping relationship between the above-mentioned User 1's identifier ID, game gift pack ID, time of purchase of game gift pack, and quantity of game gift packs purchased. For example, Table 5.1 shown below describes an example of a record of user 1’s historical purchases of game gift packs provided in an embodiment of this application in the form of a two-dimensional data table.

[0117] Table 5.1

[0118]

[0119] In this embodiment, the data acquisition method for obtaining the training dataset described in S510 is not specifically limited. In some implementations, executing S510 may include the following steps: obtaining game log information; obtaining the profile features of initial user 1 based on the game log information; preprocessing the profile features of initial user 1, and storing the preprocessed profile features of user 1 in the form of a data table in the Hive database; the Airflow task scheduling system reads the profile features of user 1 from the Hive database.

[0120] The steps for obtaining the training dataset have been described above, in conjunction with step S501. After obtaining the training dataset, the recommendation model can be trained using the obtained training dataset. The recommendation model is a deep neural network model. The specific type of deep neural network model is not limited; for example, the deep neural network model applicable to the embodiments of this application may be, but is not limited to, a multilayer perceptron (MLP) model or a Transformer model.

[0121] The candidate gift pack set 1 includes the gift pack of type #1 that user 1 has purchased, and the gift pack of type #2 that user 1 has not purchased. Specifically, the gift pack of type #1 is the one user 1 has purchased, and the gift pack of type #2 is the one user 1 has not purchased. Furthermore, candidate gift pack set 1 includes both the gift packs of type #1 and type #2.

[0122] The training steps for training a recommendation model using a training dataset, as provided in the embodiments of this application, are described below with reference to S502 to S511. The recommendation model includes an input layer, intermediate layers, and an output layer. The intermediate layers of the recommendation model include N layers, where N is an integer. The value of N is not specifically limited and can be set according to the actual application scenario and actual needs. In some implementations, the above intermediate layers only include graph convolutional layers and do not introduce any other computational layers such as activation layers. Optionally, in other implementations, other computational layers such as regularization layers or activation layers can be set after the N layers included in the intermediate layers.

[0123] S502, the input layer of the recommendation model is used to extract features from training data 1 to obtain the feature matrix corresponding to training data 1.

[0124] The purpose of performing S520 above is to extract features from each feature included in training data 1 using the input layer, so as to obtain the feature matrix corresponding to each feature. It is understood that the input layer of the recommendation model provided in this embodiment is a network layer with feature extraction functionality.

[0125] In this embodiment, the feature matrix corresponding to training data 1 includes the following matrices: user feature matrix, game gift pack feature matrix, item feature matrix, indicator matrix, and correlation matrix. The feature matrices corresponding to training data 1 will be described in detail below.

[0126] The user feature matrix is ​​obtained by extracting features from the profile of user 1. The user feature matrix is ​​a two-dimensional matrix, where the number of rows represents the number of users and the number of columns represents the feature length.

[0127] In this embodiment, the training dataset includes training sample 1, which includes the profile features of user 1 and the candidate gift pack set 1 associated with game 1. That is, the training dataset described in this embodiment is associated with the following: user set U, game gift pack set B, and item set I. User set U includes user 1, game gift pack set B includes candidate gift pack set I, and item set I includes the items included in the gift packs in game gift pack set B. Correspondingly, the number of user set U, game gift pack set B, and item set I are |U|, |B|, and |I|, respectively. For ease of description, it is assumed below that u∈U, b∈B, i∈I, where u represents user 1, b represents any gift pack in game gift pack set B, and i represents any item included in a gift pack in game gift pack set B.

[0128] Based on this, the user feature matrix described above can be represented as:

[0129]

[0130] In the above (Formula 5.1), F U Let F represent the user feature matrix. U It is a real matrix with dimension |U|*m; denoted as a real number matrix; |U| represents the number of users; m represents the user feature dimension.

[0131] The game gift pack feature matrix is ​​obtained by extracting features from game gift packs. The game gift pack matrix is ​​a two-dimensional matrix, where the number of rows represents the number of game gift packs, and the number of columns represents the feature length.

[0132] Based on this, the feature matrix of the game gift pack described above can be represented as:

[0133]

[0134] In the above (Formula 5.2), F B Let F represent the feature matrix of the game gift pack. B It is a real matrix with dimension |B|*n; B represents a real number matrix; |B| represents the number of game gift packs; n represents the feature dimension of the gift pack.

[0135] The item feature matrix is ​​obtained by extracting features from the items. It is a two-dimensional matrix where the number of rows represents the number of items, and the number of columns represents the feature length.

[0136] Based on this, the item feature matrix described above can be represented as:

[0137]

[0138] In the above (Formula 5.3), F I Let F represent the feature matrix of the items. I It is a real matrix with dimension |I|*p; represents a real number matrix; |I| represents the number of game items; p represents the dimension of item features.

[0139] In this embodiment, the indicator matrix represents the game gift pack purchased by the user; that is, the indicator matrix represents the mapping relationship between the user and the game gift pack purchased by the user. The indicator matrix can be represented as:

[0140] X |U|*|B| (Formula 5.4)

[0141] In the above (Formula 5.4), X represents the indicator matrix, which is a matrix of dimension |U|*|B|; |U| represents the number of users; and |B| represents the number of game gift packs. Wherein, if user u has purchased game gift pack b, then the matrix element X... ub =1; if user u has not purchased game gift pack b, then matrix element X ub =0.

[0142] In this embodiment, the association matrix represents the items included in the game gift pack; that is, the association matrix represents the mapping relationship between the game gift pack and the items included in it. The association matrix can be represented as:

[0143] Z |B|*|I| (Formula 5.5)

[0144] In the above (Formula 5.5), Z represents the indicator matrix, which is a matrix of dimension |B|*|I|; |B| represents the number of game gift packs; and |I| represents the number of game items. Wherein, if game gift pack b contains item i, then the matrix element Z... bi =1; if game gift pack b does not contain item i, then matrix element Z bi =0.

[0145] S503, input the feature matrix corresponding to training data 1 output from the input layer into the intermediate layer.

[0146] After executing S503 above, the intermediate layer can obtain the feature matrix corresponding to training data 1. That is, the feature matrix corresponding to training data 1 is used as the input data for the intermediate layer.

[0147] Optionally, in some implementations, the input layer can also be used to perform preprocessing operations on the feature matrix corresponding to the user data. These preprocessing operations may include, but are not limited to, one or more of the following: data normalization, mean removal, or data augmentation.

[0148] The preceding text has detailed the working principle of the input layer of the recommendation model provided in this application embodiment. Next, the working principle of the intermediate layer of the recommendation model provided in this application embodiment will be described in detail. The input data of the intermediate layer includes the feature matrix corresponding to the training data 1 output by the input layer. That is, the user feature matrix, game gift pack feature matrix, item feature matrix, indicator matrix, and association matrix serve as the input data of the intermediate layer.

[0149] S504, the intermediate layer constructs the adjacency matrix corresponding to the user-gift pack-item ternary graph based on the indicator matrix and the association matrix.

[0150] The User-Gift Pack-Item ternary diagram is used to represent the mapping relationship between users, game gift packs, and items. Specifically, this mapping relationship can include the following: the mapping relationship between users in user set U and game gift packs in game gift pack set B, and the mapping relationship between gift packs in game gift pack set B and items in item set I. For example, see... Figure 6 The input layer in the diagram illustrates the mapping relationship described above. See also... Figure 6 Taking user U1 as an example, there is a mapping relationship between user U1 and game gift pack B3, meaning that the game gift pack purchased by user U1 includes game gift pack B3; there is also a mapping relationship between game gift pack B3 and item I1, meaning that game gift pack B3 contains item I1. Taking user U2 as an example, there is a mapping relationship between user U2 and game gift pack B1, and also between user U2 and game gift pack B2. In other words, the game gift packs purchased by user U1 include both game gift pack B1 and game gift pack B2. Specifically, there is a mapping relationship between item I1 and item I3 in game gift pack B1, and a mapping relationship between item I2 and item I3 in game gift pack B2.

[0151] The adjacency matrix corresponding to the user-gift-item ternary graph represents the mapping relationship between users, game gift packs, and items described in the user-gift-item ternary graph. In other words, the user-gift-item ternary graph can be generated based on the adjacency matrix corresponding to the user-gift-item ternary graph.

[0152] In this embodiment of the application, the adjacency matrix corresponding to the user-gift pack-item ternary graph can be represented by the following formula:

[0153]

[0154] In the above (Formula 5.6), A represents the adjacency matrix corresponding to the user-gift pack-item ternary graph; X represents the indicator matrix; Z represents the association matrix; X T Z represents the transpose of X; T Let Z be the transpose of Z.

[0155] In this embodiment of the application, for ease of description, the "adjacency matrix corresponding to the user-gift pack-item ternary graph" will be uniformly referred to as "adjacency matrix" below. That is to say, the adjacency matrix described below has the same meaning as the adjacency matrix corresponding to the user-gift pack-item ternary graph described above.

[0156] S505, the intermediate layer performs asymmetric normalization on the adjacency matrix to construct a tripartite graph convolution kernel.

[0157] In this embodiment, a tripartite graph convolution kernel is used as an operator to update the representation matrix of the intermediate layer. The tripartite graph convolution kernel is determined based on the adjacency matrix. The physical meaning of the tripartite graph convolution kernel is: if the popularity of the target game gift pack indicated by the adjacency matrix is ​​lower than a preset threshold 1, increase the popularity of the target game gift pack; and if the popularity of the target game gift pack indicated by the adjacency matrix is ​​higher than a preset threshold 2, decrease the popularity of the target game gift pack. The popularity of the target game gift pack indicated by the adjacency matrix can be understood as the user's score for that target game gift pack. For example, Figure 6 The intermediate layer in the diagram illustrates a schematic of a first-order asymmetric tripartite graph convolution provided in an embodiment of this application.

[0158] In this embodiment, the process of asymmetric normalization of the adjacency matrix refers to transforming the scale of the element values ​​in the adjacency matrix according to certain rules. Specifically, in the calculation process of asymmetric normalization, the diagonal matrix D is first calculated based on the adjacency matrix A. Here, D is equivalent to a summation, which counts the number of times all game gift packs appear. Then, D is calculated. -r Here, r is an adjustable parameter and, when it is non-negative, because it is monotonically decreasing, the larger the value in D, the better D becomes. -r The smaller the value, the better. At the same time, calculate D. -(1-r) It should be noted that the sum of the exponents of the two D's to the left and right of A is 1; this is necessary to ensure the convergence of the algorithm. Finally... It is the product of three matrices. By adjusting r (increasing it), the popular gift packs can be de-weighted.

[0159] Based on this, the above three-part graph convolution kernel can be represented by the following mathematical formula:

[0160] And r≠1-r (Equation 5.7)

[0161] In the above (Formula 5.7), This represents the tripartite graph convolution kernel. It is an operator used to update the representation matrix, and It is an asymmetric convolution kernel; r represents a hyperparameter, and the value of r can be used to balance the accuracy and novelty of the recommendation. Specifically, when r = 0.5, It is a symmetric convolution kernel. Specifically, increasing the value of r can improve the novelty of the recommendation model, meaning the model is more likely to recommend novel game packs. There is no restriction on the range of r values; that is, the specific value of r can be adjusted and set according to the actual test results of the model. In some implementations, to balance the recommendation probability of novel packs and popular packs, the applicant theoretically deduced that increasing the value of r can increase the exposure of novel packs, but a larger value of r is not always better, as an excessively large value will suppress popular packs. The applicant found through experiments that when the value of r is in the range of [0.5, 1.5], compared to a symmetric convolution kernel, it can significantly improve the recommendation of novel packs without decreasing accuracy, while historically popular packs are not affected. D represents a diagonal matrix, which is determined by the adjacency matrix. Specifically, the value of the i-th row and i-th column of D is equal to the sum of the i-th row of the adjacency matrix A, where i ranges from [1, P], and P represents the maximum number of rows or columns of the diagonal matrix D.

[0162] The value of the i-th row and i-th column of the diagonal matrix D can be expressed by the following formula:

[0163]

[0164] In the above (Formula 5.8), (D) ii Let represent the value in the i-th row and i-th column of the diagonal matrix D; (A) ij Let represent the sum of the i-th row of the adjacency matrix A.

[0165] S506, the intermediate layer performs initial feature transformation on the user feature matrix, game gift pack feature matrix and item feature matrix to obtain the user representation matrix, game gift pack representation matrix and item representation matrix.

[0166] In this embodiment, any one of the user feature matrix, game gift pack feature matrix, and item feature matrix is ​​a fixed value; any one of the user representation matrix, game gift pack representation matrix, and item representation matrix is ​​a variable value containing adjustable model parameters in the deep neural network. The user representation matrix, game gift pack representation matrix, and item representation matrix can each be represented by the following formulas:

[0167]

[0168]

[0169]

[0170] In the above (Formula 5.9), (E U ) 0 Represents the user representation matrix; (E B ) 0 Game gift pack representation matrix; (E I ) 0 represents the item representation matrix; DNN represents a deep neural network, and the output dimension of DNN is d.

[0171] S507, the intermediate layer determines the k-th order representation matrix based on the tripartite graph convolution kernel, user representation matrix, game gift pack representation matrix and item representation matrix.

[0172] The k-th order representation matrix includes: the k-th order user representation matrix, the k-th order game gift pack representation matrix, and the k-th order item representation matrix.

[0173] The determination of the k-th order representation matrix based on the tripartite graph convolution kernel, user representation matrix, game gift pack representation matrix, and item representation matrix can include the following steps: multiplying the tripartite graph convolution kernel by the (k-1)-th order representation matrix to obtain the k-th order representation matrix; wherein the (k-1)-th order representation matrix includes: the (k-1)-th order user representation matrix, the (k-1)-th order game gift pack representation matrix, and the k-th order item representation matrix. The aforementioned k-th order representation matrix can be expressed by the following formula:

[0174]

[0175] S508, the intermediate layer calculates the average value of the K-th order representation based on the k-th order representation matrix, and updates the user representation matrix, game gift pack representation matrix, and item representation matrix based on the average value of the K-th order representation.

[0176] Performing S508 above, that is, calculating the average value of the K-th order representation based on the k-th order representation matrix, and updating the user representation matrix, game gift pack representation matrix, and item representation matrix based on the average value of the K-th order representation matrix, may include the following steps: determining the i-th order representation matrix based on the k-th order representation matrix, where i = 1, 2, ..., k; calculating the average value of the i-th order representation matrix to obtain the average value of the K-th order representation; updating the user representation matrix, game gift pack representation matrix, and item representation matrix based on the average value of the K-th order representation matrix.

[0177] In this embodiment, the average value of the K-order representation can be expressed by the following formula:

[0178]

[0179] The intermediate layer has been described in detail above with reference to S503 to S508. Below, the output layer will be described with reference to S509 to S511.

[0180] After executing S508 above, the updated user representation matrix, game gift pack representation matrix, and item representation matrix output by the intermediate layer will be used as input data to the output layer. Next, the role of the output layer will be explained.

[0181] S509, the output layer obtains the predicted label 1 based on the updated user representation matrix and game gift pack representation matrix output by the intermediate layer, where the predicted label 1 represents the preference score of user 1 for any game gift pack in the game gift pack set predicted by the recommendation model.

[0182] In this embodiment of the application, user 1's preference score for any game gift pack in the game gift pack set can be expressed by the following formula:

[0183]

[0184] In the above (Formula 5.12), u represents user 1; b represents any game gift pack in the game gift pack set B; This represents u's preference score for b; e u Let e ​​represent the representation vector of u, and e u User representation matrix E U A certain line; e b Let e ​​represent the representation vector of b, and let e be the vector of b. b The game gift pack representation matrix E B A certain line.

[0185] S510, the output layer determines the loss function of the recommendation model based on the predicted label 1 and the training label 1.

[0186] The loss function of the recommendation model represents the difference between the predicted label 1 and the training label 1. The smaller the difference between the two labels, the better the training effect of the model. In this embodiment, the type of loss function is not specifically limited. For example, the loss function can be, but is not limited to, the cross-entropy loss function for binary classification, or a loss function based on a Bayesian framework.

[0187] Below, taking the loss function described in S510 above as an example, which is a loss function determined based on the Bayesian framework, we will introduce the mathematical expression of the loss function obtained after executing S510.

[0188] In some implementations, based on the Bayesian framework, the loss function determined by the predicted labels and true labels of the training samples can be expressed by the following formula:

[0189]

[0190] In the above (Formula 5.13), This represents the rating that user u gives to the game packs in the collection of game packs that the user has already purchased; This represents the rating of user u for game gift packs in the set of game gift packs that user has not purchased; Θ represents the trainable parameters of the DNN model; λ represents the regularization coefficient, used to constrain the magnitude of Θ, and λ is a value that needs to be preset before model training, i.e., a hyperparameter; T represents the training sample 1 described in S501 above. This training sample 1 can be a triplet training dataset, and T can be expressed by the following formula:

[0191]

[0192] In the above (Formula 5.14), T represents the game gift pack b in the set of game gift packs purchased by user u associated with training sample 1. + And game packs b in the collection of game packs that user u did not purchase. - ;||Θ|| F The F-norm of the model parameter Θ is ||Θ|| F Used to measure the size of Θ.

[0193] S511, until the preset training conditions are met, stop updating the parameters of the recommendation model and obtain the trained recommendation model.

[0194] Perform S511 above, that is, update the adjustable parameters of the recommendation model according to the loss function, wherein the adjustable parameters of the recommendation model include the model parameters Θ shown above (Equation 5.14).

[0195] In this embodiment, the preset training conditions are not specifically limited and can be set according to the actual application scenario. In some implementations, the preset training conditions may be, but are not limited to, any of the following: the number of training iterations of the recommendation model is greater than the preset number of training iterations, the loss value corresponding to the output result of the recommendation model is within the preset error range, or the output result of the recommendation model reaches the preset recognition accuracy. Among these, the preset number of training iterations, the preset error range, and the preset recognition accuracy can be selected according to actual needs, and this embodiment does not specifically limit them.

[0196] The method for generating a recommendation model provided in this application embodiment has been described in detail above, with reference to S501 to S511. The trained recommendation model can be deployed on a server. Below, the application stage of the recommendation model is described with reference to S512 and S513.

[0197] S512, the server determines the profile features of user A based on the recommendation request sent by the terminal, wherein a pre-trained recommendation model is deployed on the server.

[0198] In this context, user A's recommendation request includes user A's basic information. Based on this, the server can determine user A's profile characteristics according to user A's recommendation request.

[0199] Optionally, before executing S512 above, the server can also obtain a referral request from user A. The server can obtain user A's referral request through the following steps: when a user logs into the game store within the game application installed on their terminal, the game's built-in program sends user A's referral request to the server.

[0200] S513, the server uses the deployed and trained recommendation model to analyze and process the profile features of user A, and obtains the recommendation results corresponding to user A's recommendation request.

[0201] Typically, the variations among all the game packs included in a game are not significant. Therefore, the features of all game packs can be stored in a pre-trained recommendation model deployed on the server. Subsequently, user profile features can be used as input data to analyze this data.

[0202] Optionally, in some implementations, the pre-trained recommendation model deployed on the server may not store features of all game gift packs included in the game. In this implementation, S513 above can be replaced by the following steps: inputting the user A's profile features and game gift pack features as binary data into the server using the pre-trained recommendation model; the server using the pre-trained recommendation model to analyze and process the user A's profile features and game gift pack features to obtain the recommendation result corresponding to user A's recommendation request.

[0203] Executing S513 above, whereby the server uses the deployed and trained recommendation model to analyze and process the profile features of user A and obtain the recommendation result corresponding to user A's recommendation request, may include the following steps: The server uses the locally deployed and trained recommendation model to analyze and process the profile features of user A and obtain user A's ratings for each game gift pack included in the game; based on user A's ratings for each game gift pack included in the game, the server determines the recommendation result corresponding to user A's recommendation request, wherein the recommendation result corresponding to user A's recommendation request is the game gift pack associated with user A's highest rating.

[0204] It should be understood that the above Figure 5 The recommendation methods shown are for illustrative purposes only and do not constitute any limitation on the recommendation methods provided in the embodiments of this application. For example, the loss function determined using the Bayesian framework in S510 above can also be replaced by a binary classification cross-entropy loss function. Furthermore, the recommendation scenario for the game gift packs described above can also be replaced by a user scenario of shopping on an online e-commerce platform.

[0205] In this embodiment, the convolutional kernel of the intermediate layer in the recommendation model is an asymmetric convolutional kernel based on user-game pack-item. The physical meaning of this asymmetric convolutional kernel is: if the popularity of the target game pack indicated by the adjacency matrix is ​​lower than a preset threshold 1, increase the popularity of the target game pack; and if the popularity of the target game pack indicated by the adjacency matrix is ​​higher than a preset threshold 2, decrease the popularity of the target game pack. Based on this, by setting the value of the hyperparameter r in the asymmetric convolutional kernel of the intermediate layer in the recommendation model, the chance of recommending novel game packs to users can be increased. Furthermore, by using the trained recommendation model to analyze and process the recommendation request of user A, the recommendation results can be better used to recommend suitable items to users to meet their needs.

[0206] The above, combined with Figures 1 to 6 This paper details the application scenarios applicable to the recommendation method provided in this application, the method for generating the recommendation model, and the recommendation method itself. Below, we will combine... Figures 7 to 10This application introduces the apparatus, recommendation device, and electronic device (including training device and execution device) for generating recommendation models. It should be understood that the recommendation method described above corresponds to the recommendation device and execution device described below. Similarly, the method for generating recommendation models described above corresponds to the apparatus and training device for generating recommendation models described below. Any content not described in detail below can be found in the relevant descriptions in the above method embodiments.

[0207] Figure 7 This is a schematic diagram of a device for generating a recommendation model according to an embodiment of this application. See also... Figure 7 The apparatus for generating a recommendation model shown includes an acquisition unit 701 and a training unit 702. The functions of the acquisition unit 701 and the training unit 702 will be described below.

[0208] The acquisition unit 701 is configured to: acquire a training dataset, wherein the training dataset includes at least one training sample comprising training data and training labels, the training data comprising user-associated user feature data and candidate gift pack data, and the training labels representing: a first type of gift pack purchased by the user in the candidate gift pack data, and a second type of gift pack not purchased by the user in the candidate gift pack data; the training unit 702 is configured to: input the training samples into an initial model for training to obtain predicted labels, the initial model comprising a convolutional kernel, wherein the convolutional kernel, during the initial model training, reduces the user's score for the first type of gift pack to no less than a first threshold, and increases the user's score for the second type of gift pack to no less than a second threshold, the second threshold being greater than the first threshold; the training unit 702 is further configured to: update the parameters of the initial model based on the predicted labels and the training labels to generate a recommendation model.

[0209] Figure 8 This is a schematic diagram of a recommended device provided in an embodiment of this application. See also... Figure 8 The recommendation device shown includes an acquisition unit 801, a processing unit 802, and a recommendation unit 803. The functions of the acquisition unit 801, the processing unit 802, and the recommendation unit 803 will be described below.

[0210] The acquisition unit 801 is used to: acquire a recommendation request sent by a user, wherein the recommendation request is used to request a gift package to be recommended to the user; the processing unit 802 is used to: process the user feature data using the recommendation model to obtain a recommendation result corresponding to the recommendation request, wherein the recommendation model is a model generated according to the above-described method for generating a recommendation model, and the user feature data is determined according to the recommendation request; the recommendation unit 803 is used to: recommend the recommendation result to the user.

[0211] This application provides an electronic device, which can be a training device corresponding to a method for generating a recommendation model provided in this application, or an execution device corresponding to a recommendation method provided in this application.

[0212] Figure 9 This is a schematic diagram of a training device structure provided in an embodiment of this application. The training device 900 can be equipped with the above-mentioned... Figure 9 The training device described in the corresponding embodiment is used to implement the above. Figure 2 , Figure 5 The illustrated model training phase describes the various steps of the method. Specifically, the training device 900 is implemented by one or more servers. The training device 900 can vary significantly due to different configurations or performance, and may include one or more central processing units (CPUs) 922 (e.g., one or more processors) and memory 932, and one or more storage media 930 (e.g., one or more mass storage devices) for storing application programs 942 or data 944. The memory 932 and storage media 930 can be temporary or persistent storage. The program stored in the storage media 930 may include one or more modules (not shown in the illustration), each module may include a series of instruction operations on the training device. Furthermore, the CPU 922 may be configured to communicate with the storage media 930 and execute the series of instruction operations in the storage media 930 on the training device 900.

[0213] The training device 900 may also include one or more power supplies 926, one or more wired or wireless network interfaces 950, one or more input / output interfaces 958, and / or one or more operating systems 941, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0214] In one embodiment of this application, the central processing unit 922 is used to execute... Figure 2 The steps of the method for generating a recommendation model described in the corresponding embodiment are as follows. The specific manner in which the central processing unit 922 executes the aforementioned steps is consistent with that in this application. Figure 2 and Figure 5 The various method embodiments shown for the model training phase are based on the same concept, and their technical effects are the same as those in this application. Figure 2 and Figure 5 The corresponding method embodiments are the same, and for details, please refer to the description in the method embodiments shown above in this application, which will not be repeated here.

[0215] Figure 10 This is a schematic diagram of the structure of an execution device provided in an embodiment of this application. The execution device 1000 can specifically be a virtual reality (VR) device, a mobile phone, a tablet, a laptop computer, a smart wearable device, a monitoring data processing device, or a radar data processing device, etc., and is not limited thereto. The execution device 1000 may be equipped with... Figure 8 The recommended device described in the corresponding embodiment is used to implement Figure 4 and Figure 5 The described model application phase functionality. Specifically, the execution device 1000 includes: a receiver 1001, a transmitter 1002, a processor 1003, and a memory 1004 (wherein the execution device 1000 may have one or more processors 1003). Figure 10 (Taking a processor as an example), processor 1003 may include application processor 10031 and communication processor 10032. In some embodiments of this application, receiver 1001, transmitter 1002, processor 1003 and memory 1004 may be connected via bus or other means.

[0216] Memory 1004 may include read-only memory and random access memory, and provides instructions and data to processor 1003. A portion of memory 1004 may also include non-volatile random access memory (NVRAM). Memory 1004 stores processor and operation instructions, executable modules, or data structures, or subsets thereof, or extended sets thereof, wherein the operation instructions may include various operation instructions for implementing various operations.

[0217] Processor 1003 controls the operation of the execution device. In specific applications, the various components of the execution device are coupled together through a bus system, which may include not only the data bus, but also power buses, control buses, and status signal buses. However, for clarity, all buses are referred to as the bus system in the diagram.

[0218] The methods disclosed in the embodiments of this application can be applied to or implemented by the processor 1003. The processor 1003 can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 1003 or by instructions in software form. The processor 1003 can be a general-purpose processor, a digital signal processor (DSP), a microprocessor, or a microcontroller, and may further include an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The processor 1003 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 1004. Processor 1003 reads the information in memory 1004 and, in conjunction with its hardware, completes the steps of the above method.

[0219] Receiver 1001 can be used to receive input digital or character information, and to generate signal inputs related to the settings and function control of the execution device. Transmitter 1002 can be used to output digital or character information through the first interface; transmitter 1002 can also be used to send instructions to the disk group through the first interface to modify the data in the disk group; transmitter 1002 may also include a display device such as a display screen.

[0220] In this embodiment of the application, the application processor 10031 in the processor 1003 is used to execute... Figure 4 and Figure 5 This corresponds to the recommendation model application stage in the embodiment. It should be noted that the specific method by which the application processor 10031 executes each step is different from that in this application. Figure 4 and Figure 5 The various method embodiments are based on the same concept, and the technical effects they bring are the same as those in this application. Figure 4 and Figure 5 The corresponding method embodiments are the same, and for details, please refer to the description in the method embodiments shown above in this application, which will not be repeated here.

[0221] This application provides a computer-readable storage medium, which includes computer instructions. When executed by a processor, the computer instructions are used to implement any of the methods for generating recommendation models in this application.

[0222] This application provides a computer-readable storage medium, which includes computer instructions. When executed by a processor, the computer instructions are used to implement the technical solution of any of the recommended methods in this application.

[0223] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored on a computer-readable medium and includes several instructions to cause a computing device (which may be a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments disclosed in this application.

[0224] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0225] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0226] Computer-readable media include both permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage media, or any other non-transferable media that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include non-transitory computer-readable media, such as modulated data signals and carrier waves.

[0227] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0228] Although this application discloses preferred embodiments as described above, it is not intended to limit this application. Any person skilled in the art can make possible changes and modifications without departing from the spirit and scope of this application. Therefore, the scope of protection of this application should be determined by the scope defined in the claims of this application.

Claims

1. A method for generating a recommendation model, characterized in that, The method includes: Obtain a training dataset, wherein the training dataset includes at least one training sample comprising training data and training labels, the training data comprising user-associated user feature data and candidate gift pack data, and the training labels representing: a first type of gift pack that the user has purchased in the candidate gift pack data, and a second type of gift pack that the user has not purchased in the candidate gift pack data; The training samples are input into an initial model for training to obtain predicted labels. The initial model includes a convolutional kernel. During the training of the initial model, the convolutional kernel reduces the user's score for the first type of gift package to no less than a first threshold and increases the user's score for the second type of gift package to no less than a second threshold, where the second threshold is greater than the first threshold. Based on the predicted labels and the training labels, the parameters of the initial model are updated to generate a recommendation model; The convolution kernel is an asymmetric convolution kernel obtained by performing asymmetric processing on the adjacency matrix using an initial diagonal matrix. Specifically, the convolution kernel is the product of the first diagonal matrix, the adjacency matrix, and the second diagonal matrix. The initial diagonal matrix is ​​determined based on the adjacency matrix, which represents the mapping relationship between the user, the candidate gift packs recorded in the candidate gift pack data, and the items included in the candidate gift packs. The first diagonal matrix is ​​the first power of the first parameter value of the initial diagonal matrix, and the first parameter value is equal to a negative initial parameter value. The second diagonal matrix is ​​the second power of the second parameter value of the initial diagonal matrix, and the second parameter value is equal to the initial parameter value minus 1. The initial parameter value is a preset value used to balance the accuracy and novelty of the recommendation results recommended by the trained recommendation model.

2. The method according to claim 1, characterized in that, The training specifically includes: The input layer of the initial model extracts features from the training data to obtain a user feature matrix, a gift package feature matrix, and an item feature matrix; wherein, the user feature matrix represents the user feature data; the gift package feature matrix represents the features of the candidate gift packages recorded in the candidate gift package data; and the item feature matrix represents the features of the items included in the candidate gift packages recorded in the candidate gift package data. The intermediate layer of the initial model performs feature transformation on the user feature matrix, the gift package feature matrix, and the item feature matrix to obtain the initial user representation matrix corresponding to the user feature matrix, the initial gift package representation matrix corresponding to the gift package feature matrix, and the initial item representation matrix corresponding to the item feature matrix; wherein, any representation matrix includes adjustable neural network parameters, and the intermediate layer includes a convolutional layer; The convolutional layer of the initial model obtains the user representation matrix, the gift package representation matrix, and the item representation matrix based on the convolutional kernel, the initial user representation matrix, the initial gift package representation matrix, and the initial item representation matrix; The output layer of the initial model obtains the predicted label based on the user representation matrix and the gift package representation matrix.

3. The method according to claim 2, characterized in that, The value of the i-th row and i-th column of the initial diagonal matrix is ​​equal to the sum of the i-th row of the adjacency matrix. The value of any element in the initial diagonal matrix other than the i-th row and i-th column is equal to zero. The value of i is in the range of [1, P]. P represents the maximum number of rows in the adjacency matrix and is an integer greater than or equal to 2.

4. The method according to claim 2, characterized in that, The adjacency matrix is ​​determined based on the indicator matrix and the association matrix, wherein the association matrix represents the mapping relationship between the candidate gift packs recorded in the candidate gift pack data and the items included in the candidate gift packs.

5. The method according to claim 4, characterized in that, The adjacency matrix is ​​represented by the following mathematical formula: Wherein, A represents the adjacency matrix; X represents the indicator matrix; Z represents the correlation matrix; and the... Denotes the transpose matrix of X; Let Z be the transpose matrix.

6. The method according to claim 2, characterized in that, The convolutional layers of the initial model obtain user representation matrices, gift package representation matrices, and item representation matrices based on the convolutional kernel, the initial user representation matrix, the initial gift package representation matrix, and the initial item representation matrix, including: The initial user representation matrix, the initial gift package representation matrix, and the initial item representation matrix are convolved with the convolution kernel in successive orders to obtain the first initial user representation matrix, the first initial gift package representation matrix, and the first initial item representation matrix after each order of convolution. The first initial user representation matrix, the first initial gift package representation matrix, and the first initial item representation matrix after each convolution are averaged to obtain the user representation matrix, the gift package representation matrix, and the item representation matrix.

7. The method according to claim 6, characterized in that, The output layer of the initial model obtains the predicted label based on the user representation matrix and the gift package representation matrix, including: The product of the user representation matrix and the gift package representation matrix is ​​used as the score of the user associated with the user representation matrix for the candidate gift package associated with the gift package representation matrix; The score is used as the predicted label.

8. The method according to claim 7, characterized in that, If the candidate gift package associated with the initial gift package representation matrix is ​​the first type of gift package, the convolution kernel reduces the initial user representation matrix, the initial gift package representation matrix, and the initial item representation matrix to the user representation matrix, the gift package representation matrix, and the item representation matrix by performing successive convolutions on the initial user representation matrix, the initial gift package representation matrix, and the initial item representation matrix, and ensures that the product of the user representation matrix and the gift package representation matrix is ​​not lower than the first threshold. If the candidate gift package associated with the initial gift package representation matrix is ​​the second type of gift package, the convolution kernel performs successive convolutions on the initial user representation matrix, the initial gift package representation matrix, and the initial item representation matrix to elevate the initial user representation matrix, the initial gift package representation matrix, and the initial item representation matrix into the user representation matrix, the gift package representation matrix, and the item representation matrix, and ensures that the product of the user representation matrix and the gift package representation matrix is ​​not lower than the second threshold.

9. The method according to claim 1, characterized in that, The step of updating the parameters of the initial model based on the predicted labels and the training labels to generate a recommendation model includes: The parameters of the initial model are updated based on the difference between the predicted label and the training label. Once the training reaches the preset training conditions, stop updating the parameters of the initial model to obtain the recommended model.

10. The method according to any one of claims 1 to 9, characterized in that, The user characteristic data includes: the user's identifier, the identifier of the gift pack purchased by the user, the purchase data of the gift pack purchased by the user, and the number of times the user purchased the gift pack.

11. A recommendation method, characterized in that, The method includes: Obtain a recommendation request sent by a user, wherein the recommendation request is used to request a gift pack to be recommended to the user; The user's user feature data is processed using a recommendation model to obtain the recommendation result corresponding to the recommendation request, wherein the recommendation model is a model generated by the method according to any one of claims 1 to 10, and the user feature data is determined based on the recommendation request; The recommendation results are then presented to the user.

12. The method according to claim 11, characterized in that, The step of processing the user's user feature data using a recommendation model to obtain the recommendation result corresponding to the recommendation request includes: The user feature data and multiple candidate gift packs are input into the recommendation model to obtain the recommendation score for each candidate gift pack among the multiple candidate gift packs for the user; Based on the user's recommendation score for each of the plurality of candidate gift packs, the recommendation result corresponding to the recommendation request is determined, wherein the gift pack indicated by the recommendation result is the candidate gift pack with the highest recommendation score among the plurality of candidate gift packs.

13. A training device, characterized in that, The device includes: an acquisition unit and a training unit; The acquisition unit is used to acquire a training dataset, wherein the training dataset includes at least one training sample including training data and training labels, the training data includes user feature data associated with the user and candidate gift pack data, and the training labels represent: a first type of gift pack that the user has purchased in the candidate gift pack data, and a second type of gift pack that the user has not purchased in the candidate gift pack data; The training unit is used to input the training samples into the initial model for training to obtain predicted labels. The initial model includes a convolutional kernel. During the training of the initial model, the convolutional kernel reduces the user's score for the first type of gift package to no less than a first threshold and increases the user's score for the second type of gift package to no less than a second threshold, wherein the second threshold is greater than the first threshold. The training unit is also used to update the parameters of the initial model based on the predicted label and the training label to generate a recommendation model; The convolution kernel is an asymmetric convolution kernel obtained by performing asymmetric processing on the adjacency matrix using an initial diagonal matrix. Specifically, the convolution kernel is the product of the first diagonal matrix, the adjacency matrix, and the second diagonal matrix. The initial diagonal matrix is ​​determined based on the adjacency matrix, which represents the mapping relationship between the user, the candidate gift packs recorded in the candidate gift pack data, and the items included in the candidate gift packs. The first diagonal matrix is ​​the first power of the first parameter value of the initial diagonal matrix, and the first parameter value is equal to a negative initial parameter value. The second diagonal matrix is ​​the second power of the second parameter value of the initial diagonal matrix, and the second parameter value is equal to the initial parameter value minus 1. The initial parameter value is a preset value used to balance the accuracy and novelty of the recommendation results recommended by the trained recommendation model.

14. A recommendation device, characterized in that, The device includes: an acquisition unit, a processing unit, and a recommendation unit; The acquisition unit is used to acquire a recommendation request sent by a user, wherein the recommendation request is used to request a gift package to be recommended to the user; The processing unit is configured to process the user's user feature data using the recommendation model to obtain the recommendation result corresponding to the recommendation request, wherein the recommendation model is a model generated by the method according to any one of claims 1 to 10, and the user feature data is determined according to the recommendation request; The recommendation unit is used to recommend the recommendation results to the user.

15. An electronic device, characterized in that, include: The memory and the processor are coupled; The memory is used to store one or more computer instructions; The processor is configured to execute one or more computer instructions to implement the method as described in any one of claims 1 to 12.

16. A computer-readable storage medium storing one or more computer instructions thereon, characterized in that, The instruction is executed by the processor to implement the method as described in claims 1 to 10, or any one of claims 11 to 12.

Citation Information

Patent Citations

  • Recommendation model training method and device, and recommendation method and device

    CN110046952A

  • Game gift bag recommendation method and device, electronic equipment and computer storage medium

    CN115006837A