A content recommendation method, apparatus, and related products
Patent Information
- Application Number
- CN202211157845.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-22
- Publication Date
- 2026-09-01
- Estimated Expiration
- 2042-09-22
AI Technical Summary
在高度稀疏的数据场景中,因内容数量大,用户与内容的交互的拓扑特征不够鲜明,使得LightGCN模型对于交互关系的拓扑学习难以起到效果,导致内容推荐效果不佳
[0022]本申请提供的内容推荐技术方案中,基于用户与内容的交互数据构建初始超图并对用户表示进行编码得到用户表示矩阵,再根据编码得到的用户表示矩阵并结合交互数据所涉及的多项内容的内容表示矩阵进行内容推荐。具体而言,编码得到用户表示矩阵的过程涉及到多个轮次的传播,每次传播得到的传播结果陆续加入到初始化得到的用户表示传播序列,以不断更新用户表示传播序列,接着再通过用户表示传播序列来得到用户表示矩阵。传播过程中涉及各轮次对于交互数据的扩展,通过扩展构建出更加丰富的交互数据更新超图,辅助完成对用户表示的编码操作。第i轮次的传播结果将加入到用户表示传播序列的末尾以完成第i轮次对于用户表示传播序列的更新。由此可见,因用户表示的传播依赖于随交互数据的扩展而动态更新的超图,因此每个轮次的传播建立在这一轮次扩展的交互数据以及前一轮次的传播结果的基础上,每个轮次扩展的交互数据会真实影响这一轮次的传播结果。这一动态联系,也使得K-1次传播结束获得的用户表示传播序列增加准确,并进而提升在高度稀疏的数据场景中,对于用户表示的编码效果的准确性和内容推荐的准确性。
Smart Images

Figure CN117807299B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of collaborative filtering recommendation technology, and in particular to a content recommendation method, apparatus and related products. Background Technology
[0002] With the continuous development of information technology and the increasing richness of content, recommendation mechanisms are widely used in many scenarios. For example, on shopping platforms, more products that users may be interested in are recommended based on their browsing history; in music software, music collected and liked by user A is recommended to user B based on the similarity of the music styles that user A and user B listen to.
[0003] To recommend content to users, a variety of recommendation models have emerged. The LightGCN model is a personalized recommendation model that performs convolutional operations on the user-content interaction graph to learn its topological structure, thereby obtaining user and content representation vectors to complete the content recommendation task. Specifically, the user or content representation vector is updated based on the user or content representation vectors connected within its neighborhood. Multiple convolutional results from stacked convolutional layers are averaged to produce the final user or content representation vector.
[0004] In highly sparse data scenarios, user interactions with content exhibit low overlap. This means that the sets of interactive content from different users have very little or no overlap with each other. Figure 1 This is a schematic diagram illustrating the distribution of interaction data from multiple users randomly sampled in a given scenario. Figure 1 In the distribution effect of the displayed interactive data, light-colored dots represent content, dark lines represent the interaction between users and content, and the intersection of multiple dark lines represents users. Figure 1 It's easy to see that while each user engages in relatively active interactions, there's little overlap in interactions between users. In this scenario, the topological structure and features of the user-content interaction graph or hypergraph, constructed from real data, are not sufficiently distinct. Personalized recommendation models, such as the LightGCN model, essentially learn the topological structure of this interaction graph. However, in highly sparse data scenarios, due to the large amount of content, the topological features of user-content interactions are not distinct enough, making it difficult for the LightGCN model to effectively learn the topological relationships of interactions, resulting in poor content recommendation performance. Specifically, the recommended content deviates significantly from the user's interests. Currently, improving the performance of content recommendation solutions in highly sparse data scenarios has become a highly anticipated and unresolved technical problem in the field of recommendation technology. Summary of the Invention
[0005] This application provides a content recommendation method, apparatus, and related products, which aim to provide better content recommendation results in highly sparse data scenarios.
[0006] In its first aspect, this application provides a content recommendation method. This content recommendation method includes:
[0007] Construct an initial hypergraph based on interaction data of multiple users and multiple content items, and initialize the user representation propagation sequence;
[0008] The initial hypergraph is updated by expanding the interaction data, and K-1 rounds of propagation are performed based on the updated hypergraph on the initial user representation propagation sequence; the target length of the user representation propagation sequence is K, where K is an integer; wherein, the propagation result of the i-th round is used to be added to the end of the user representation propagation sequence to update the user representation propagation sequence; 1≤i≤K-1, where i is an integer;
[0009] The user representation matrix corresponding to the multiple users is obtained based on the user representation propagation sequence obtained after the (K-1)th round of propagation.
[0010] Content recommendation is performed based on the user representation matrix and the content representation matrix corresponding to the multiple content items.
[0011] A second aspect of this application provides a content recommendation device. The content recommendation device includes:
[0012] The hypergraph construction and sequence initialization unit is used to construct an initial hypergraph and initialize the user representation propagation sequence based on the interaction data of multiple users and multiple content items;
[0013] The hypergraph update and propagation unit is used to update the initial hypergraph by expanding the interaction data, and to propagate the updated hypergraph for K-1 rounds based on the initialized user representation propagation sequence; the target length of the user representation propagation sequence is K, where K is an integer; wherein, the propagation result of the i-th round is used to be added to the end of the user representation propagation sequence to update the user representation propagation sequence; 1≤i≤K-1, where i is an integer;
[0014] The user representation matrix acquisition unit is used to obtain the user representation matrix corresponding to the multiple users based on the user representation propagation sequence obtained after the (K-1)th round of propagation.
[0015] The content recommendation unit is used to recommend content based on the user representation matrix and the content representation matrix corresponding to the multiple content items.
[0016] A third aspect of this application provides a content recommendation device. The content recommendation device includes a processor and a memory.
[0017] The memory is used to store program code and transmit the program code to the processor;
[0018] The processor is used to execute the steps of the content recommendation method provided in the first aspect according to the instructions in the program code.
[0019] In a fourth aspect, this application provides a computer-readable storage medium. The computer-readable storage medium is used to store program code for performing the steps of the content recommendation method provided in the first aspect.
[0020] A fifth aspect of this application provides a computer program product. This computer program product includes a computer program or instructions that, when executed by a content recommendation device, implement the steps of the content recommendation method provided in the first aspect.
[0021] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:
[0022] The content recommendation technology solution provided in this application constructs an initial hypergraph based on user-content interaction data and encodes user representations to obtain a user representation matrix. Then, content recommendation is performed based on the encoded user representation matrix and the content representation matrices of multiple content elements involved in the interaction data. Specifically, the process of encoding the user representation matrix involves multiple rounds of propagation. The propagation results obtained in each round are successively added to the initialized user representation propagation sequence to continuously update the user representation propagation sequence. The user representation matrix is then obtained through the user representation propagation sequence. The propagation process involves the expansion of interaction data in each round, constructing a richer interaction data to update the hypergraph and assist in completing the encoding operation of user representations. The propagation result of the i-th round is added to the end of the user representation propagation sequence to complete the update of the user representation propagation sequence in the i-th round. Therefore, since the propagation of user representations depends on the dynamically updated hypergraph as the interaction data expands, the propagation in each round is based on the expanded interaction data of that round and the propagation results of the previous round. The expanded interaction data in each round will truly affect the propagation result of that round. This dynamic relationship also increases the accuracy of the user representation propagation sequence obtained after K-1 propagations, thereby improving the accuracy of user representation encoding and content recommendation in highly sparse data scenarios. Attached Figure Description
[0023] Figure 1 A schematic diagram showing the distribution of interaction data from multiple users randomly sampled in a given scenario;
[0024] Figure 2 A scenario architecture diagram for implementing a content recommendation method provided in this application embodiment;
[0025] Figure 3 A flowchart illustrating a content recommendation method provided in this application embodiment;
[0026] Figure 4 A schematic diagram of an AD-JK mechanism provided for an embodiment of this application;
[0027] Figure 5 A schematic diagram illustrating an embodiment of this application for obtaining a user representation matrix;
[0028] Figure 6 This is a schematic diagram illustrating interactive data expansion performed after clustering user representation vectors, as provided in an embodiment of this application.
[0029] Figure 7 This is a schematic diagram of the structure of a content recommendation device provided in an embodiment of this application;
[0030] Figure 8 This is a schematic diagram of the server structure in an embodiment of this application;
[0031] Figure 9 This is a schematic diagram of the structure of a terminal device in an embodiment of this application. Detailed Implementation
[0032] As discussed above, current personalized recommendation models, such as the LightGCN model, struggle to achieve good performance in highly sparse data scenarios. This is because the topological structure and features of the interaction graph between users and content are not distinct enough in highly sparse data scenarios, making them difficult for these models to learn. Therefore, it is necessary to propose a content recommendation scheme that can maintain good recommendation performance in highly sparse data scenarios.
[0033] This application provides a content recommendation method, apparatus, device, storage medium, and computer program product. A user representation propagation sequence is initialized based on interaction data between multiple users and multiple content items, and multiple rounds of propagation are performed to update the user representation propagation sequence. Each round of propagation involves expanding upon the original interaction data, thereby enriching the interaction data. Simultaneously with the expansion of the interaction data, the filtering matrix used for propagation is dynamically updated, ensuring that the propagation process and the encoding of user representations are in a dynamically updated state. Each round of propagation requires the results of the previous round and the expanded data of the current round. This enhances the accuracy of the final user representation propagation sequence, ultimately affecting the encoding effect of user representations, and consequently, the accuracy and effectiveness of content recommendation.
[0034] To facilitate understanding of this solution, several terms and nouns that may be involved in the embodiments of this application are explained below.
[0035] Hypergraph: A hypergraph is a graph structure in which a hyperedge can connect two or more nodes. A hypergraph can be described by the formula G = (V, ξ, X, W), where V represents the set of nodes, ξ represents the set of hyperedges, X is the node representation matrix, and W is the weight matrix of the hyperedges. W is a diagonal matrix where the values at each position represent the weights of the hyperedges. For a hypergraph, the connection between nodes and hyperedges can be described using an adjacency matrix H with values in the range {0, 1}. For a node vi and a hyperedge ej, when ej connects to vi, the value at the i-th row and j-th column of the adjacency matrix H is 1.
[0036] Jump Knowledge Attention (JK) mechanism: Its purpose is to build extended features for each node on a larger scale, so that the values in the sequence can contain not only the current information, but also the information of the entire sequence, so that they can be captured by the attention mechanism and play a role in learning the weights corresponding to the sequence values.
[0037] The content recommendation method provided in this application can be implemented by a terminal device. Specifically, on the terminal device, user representations are encoded based on interaction data between multiple users and multiple content items. This includes: initializing a user representation propagation sequence based on the interaction data; performing K-1 rounds of propagation on the initialized user representation propagation sequence by expanding the interaction data; and obtaining user representation matrices corresponding to multiple users based on the user representation propagation sequence obtained after the K-1th round of propagation. Furthermore, the terminal device can also recommend content to users based on the user representation matrix and the content representation matrix.
[0038] The embodiments of this invention can be applied to various scenarios, including but not limited to video recommendation, music recommendation, book recommendation, online shopping, and search. As examples, terminal devices may include, but are not limited to, mobile phones, computers, intelligent voice interaction devices, smart home appliances, in-vehicle terminals, and aircraft. Furthermore, the execution entity of the content recommendation method provided in this application can also be a server, meaning that the encoding of the user representation and the content recommendation operation can be completed on the server. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. Additionally, the server can also be a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.
[0039] In some other implementations, the content recommendation method provided in this application embodiment can also be implemented jointly by terminal devices and servers. Figure 2 This is a scenario architecture diagram for implementing a content recommendation method according to an embodiment of this application. To facilitate understanding of the technical solutions provided in this application embodiment, the following is combined with... Figure 2 This section describes the implementation scenario of the solution. The implementation scenario involves terminal devices and servers. For example, user interaction data with content can be extracted from the terminal device and aggregated into the server. The server encodes user representations into a user representation matrix based on this data. To meet the content recommendation needs of the target user, the server makes content recommendations and pushes the recommended content (or a message uniquely indicating the recommended content, such as a content representation) to the target user's terminal device, so that the target user can access the relevant recommended content through their terminal device.
[0040] To facilitate understanding, the following example, using a server as the execution entity, illustrates the specific implementation of the solution. Figure 3 A flowchart illustrating a content recommendation method provided in an embodiment of this application. Figure 3 The content recommendation method shown includes steps 301-304, where steps 301-303 focus on the encoding operation for user representation, and step 304 focuses on the operation of content recommendation after encoding.
[0041] Step 301: Construct an initial hypergraph based on the interaction data of multiple users and multiple content items, and initialize the user representation propagation sequence.
[0042] In this embodiment, the server can obtain the aforementioned interaction data through an application running on the terminal device. For example, a user can interact with content through an application running on the terminal device. For instance, in a music application, a user collects music, clicks on it to listen, thus interacting with the music, and the application can obtain the user's interaction data with the music. Through the communication connection between the terminal device and the server, the server can also obtain the aforementioned interaction data and then perform subsequent operations.
[0043] It is understood that the specific embodiments of this application involve user-content interaction data. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. For example, before a user uses the application, a pop-up window in the application explains the methods of data collection and use, clearly informing the user that the interaction data generated by their behavior and operations in the application may be used in the products and technologies related to this application for content recommendations. The application window provides text or icons indicating "agree," "permit," or "authorize." When such text or icons are triggered, it indicates that the user has agreed to, permitted, or authorized the collection and use of their interaction data. Under this premise, the application can collect data and provide the data to the server.
[0044] In one possible implementation, to avoid collecting too much data or data lacking timeliness, interaction data between all current users and content within a predetermined time period can be acquired and compiled into an interaction dataset. All current users can refer to entities logged in during the predetermined time period. Content can be news, videos, and / or images viewed by users.
[0045] While this interaction data describes the relationship between users and content, to uncover and learn deeper connections for more accurate content recommendations, it's necessary to obtain user representations from multiple users involved in the interaction data through encoding. The overall encoding approach involves progressively constructing a user representation propagation sequence through a propagation process, and then obtaining a user representation matrix based on this sequence, thus completing the encoding of the user representations. At the beginning of the propagation, a hypergraph needs to be constructed based on the aforementioned interaction data. Since the hypergraph may be updated in subsequent operations, for ease of distinction, the hypergraph constructed from the interaction data mentioned in this step is referred to as the initial hypergraph. Users, content, and the interaction data between users and content are key elements constituting this initial hypergraph.
[0046] In this embodiment, a user representation propagation sequence is also initialized. The target length of the initialized user representation propagation sequence is K, which can be set according to actual needs, and K is an integer. The target length of the sequence is related to the total number of propagation rounds, and the number of propagation rounds is 1 less than the target length of the sequence. For example, if the target length of the sequence is K, then the total number of propagation rounds is K-1.
[0047] The initial user representation propagation sequence includes one element, the initial propagation matrix. After the first round of propagation, the propagation result is added as the second element to the end of the first element in the sequence; after the second round of propagation, the propagation result is added as the third element to the end of the second element in the sequence, and so on, until the (K-1)th round of propagation, at which point the propagation result is added as the Kth element to the end of the (K-1)th element in the sequence. In other words, the user representation propagation sequence obtained after the (K-1)th round of propagation should include K elements: the initial propagation matrix in the initial user representation propagation sequence, and the propagation results from the first to the (K-1)th rounds.
[0048] In this embodiment, the initial propagation matrix is calculated based on the interaction data of multiple users and multiple content items. In an optional implementation, to obtain the initial propagation matrix, the following steps 1-4 need to be performed to complete the preparation operation. Step 1: Based on the interaction data of multiple users and multiple content items, obtain the data sets corresponding to multiple users and the content data sets corresponding to multiple content items; Step 2: Number the users in the data sets corresponding to multiple users and number the content data in the content data sets. The numbering can start from 0, and each user and each content item is given a number to distinguish them within the same type; Step 3: Based on the numbers of the content data in the content data sets, construct a content representation matrix, where the row numbers of the content representation matrix correspond to the numbers of the content; Step 4: Based on the user numbers in the data sets corresponding to multiple users and the numbers of the content data in the content data sets, obtain the original hypergraph adjacency matrix. The execution order of steps 3 and 4 is not limited.
[0049] Step 4 mentioned earlier requires obtaining the original hypergraph adjacency matrix. Below is a brief example of how to obtain this matrix. First, obtain the number of users for multiple users and the number of content items for multiple content items. Second, based on the number of users and content items, construct an initial matrix with a dimension of user count × content count. Next, fill the initial matrix with the user IDs from the datasets corresponding to the multiple users and the content IDs from the content datasets. Use the filled matrix as the original hypergraph adjacency matrix.
[0050] Use users with IDs as the row indices of the initial matrix, and use content data with IDs as the column indices. If any user with an ID interacts with any content data with an ID, the value at the corresponding position in the initial matrix is 1; otherwise, it is 0. Add the values of each row of the hypergraph adjacency matrix and sequentially add them to the main diagonal of the initialized node degree matrix Dv. Add the values of each column of the hypergraph adjacency matrix and sequentially add them to the main diagonal of the initialized hyperedge degree matrix De.
[0051] Based on the original hypergraph adjacency matrix and content representation matrix, an initial propagation matrix is calculated using interaction data from multiple users and multiple content items. This includes: obtaining the initial propagation matrix from the original hypergraph adjacency matrix and content representation matrix. The initial propagation matrix X can be calculated using the following formula. (0) Represented as X (0) = Hori * E. Where Hori represents the adjacency matrix of the original hypergraph, and E represents the content representation matrix. Therefore, the product of the two is used as the initial propagation matrix X. (0) The initial user representation propagation sequence X can be represented as X = {X...} (0)}
[0052] Step 302: Update the initial hypergraph by expanding the interaction data, and propagate for K-1 rounds based on the updated hypergraph and the initialized user representation propagation sequence.
[0053] In this embodiment, the server needs to expand the interaction data collected at the beginning in each round of propagation. After expansion, the initial hypergraph can be updated based on the expanded interaction data, and the propagation in this round is based on the updated hypergraph in this round. In an optional embodiment, this step includes: expanding the interaction data in the i-th round to obtain the expanded interaction data corresponding to the i-th round; updating the initial hypergraph based on the expanded interaction data corresponding to the i-th round to obtain the updated hypergraph corresponding to the i-th round of propagation; obtaining the filtering matrix for the i-th round based on the updated hypergraph corresponding to the i-th round of propagation; and using the filtering matrix for the i-th round to propagate the user representation propagation sequence in the i-th round.
[0054] Taking any round from round 1 to round K-1 as an example (1≤i≤K-1, i is an integer), the filtering matrix used in round i depends on the interaction data expanded in round i. Therefore, the filtering matrix used for propagation is updated as the rounds change. For example, the filtering matrix L used in round 1 propagation... (1) The filtering matrix L used in the second round of propagation depends on the interactive data expanded in the first round of propagation. (2) It depends on the interaction data expanded by the second round of propagation.
[0055] The propagation in the current round is based on the current user representation propagation sequence, combined with the current round's filtering matrix, to obtain the propagation result for the current round, and then added to the current user representation propagation sequence to update the sequence. For example, the propagation in the first round is based on the initial propagation matrix in the initialized user representation propagation sequence, using the first round's filtering matrix L. (1) Obtain the propagation result X of the first round. (1)The second round of propagation occurs when the user represents the propagation sequence {X}. (0) X (1) The last element X (1) Based on this, the propagation result X of the second round is obtained using the filtering matrix L(2) of the second round. (2) And so on. After K-1 rounds of propagation, the final user representation propagation sequence is as follows: X = {X... (0) X (1) X (2) , ..., X (K-1)}
[0056] Step 303: Obtain the user representation matrix corresponding to multiple users based on the user representation propagation sequence obtained after the (K-1)th round of propagation.
[0057] As an optional implementation of this step, an attention mechanism (such as the JK mechanism introduced above) can be used to process the user representation propagation sequence obtained after the (K-1)th round of propagation to obtain the weight matrices corresponding to the K elements in the sequence; then, the user representation matrix is obtained based on the K elements and the weight matrices corresponding to the K elements.
[0058] The JK attention mechanism is used to construct larger-scale extended features for each user node, so that the values in the sequence can contain not only the current information but also the information of the entire sequence, thus enabling the attention mechanism to capture them. Previous JK mechanisms have certain shortcomings in capturing the differences in attention information between nodes in the hypergraph. This is because the additional information obtained by previous JK mechanisms for each user representation is not significantly different. The additional information is much more than the content of the representation vector, leading to small differences in additional information and input redundancy, which to some extent affects the accuracy of the obtained weight matrix. To address this issue, this application proposes an improved JK mechanism, named the Average Difference Jump Knowledge Attention (AD-JK) mechanism. Figure 4 This is a schematic diagram of the AD-JK mechanism. (For example...) Figure 4 The processing structure of the AD-JK mechanism shown includes: a mean calculation layer, a difference calculation layer, a first multilayer perceptron, a splicing layer, a weight activation layer, and a classification layer.
[0059] The AD-JK mechanism is used to process the user representation propagation sequence obtained at the end of the (K-1)th round of propagation to obtain the weight matrices corresponding to the K elements, including the following steps 1 to 6:
[0060] Step 1: Obtain the mean of K elements through the mean calculation layer.
[0061] like Figure 4 As shown, X (0) X (1) X (2) , ..., X (K-1) As input to the mean calculation layer. Because X (0) X (1) X (2) , ..., X (K-1) Since all elements belong to the same user representation propagation sequence, the output of the mean calculation layer is essentially the mean of that sequence.
[0062] It should be noted that steps 2 through 5 below are performed once for each of the K elements. This yields the initial weight matrix for each element. For ease of description, steps 2 through 5 below will use the target element as an example. The target element is one of the K elements. For example, the target element could be X. (0) .exist Figure 4 In the illustration, X (i) As a target element.
[0063] Step 2: Calculate the difference between the mean and the target feature through the difference calculation layer.
[0064] like Figure 4 As shown, the outputs of the target feature and the mean calculation layer are both connected to the difference calculation layer, serving as its two inputs. By calculating the difference between the mean and the target feature through the difference calculation layer, the vector distance between the target feature and the sequence mean can be obtained.
[0065] Step 3: The difference between the mean and the target element is processed by the first multilayer perceptron MLP1 to obtain the additional information corresponding to the target element.
[0066] Since the difference between the mean and different features may vary, the first multilayer perceptron (MLP1) processes different differences for different target features, thus enabling it to output additional information corresponding to different features. This additional information also reflects the vector distance (difference) between the target feature and the mean sequence. Therefore, by constructing a broader feature domain using the AD-JK mechanism, compared to the previous JK mechanism, the input size of the multilayer perceptron is reduced, the difference in attention information at each node is improved, and each value in the sequence perceives its vector distance from the sequence mean. This, in turn, enhances the impact of each round of propagation on the generated user representation matrix, making each round of propagation more data-driven and the user representation matrix more accurate. In other words, the capture of user representation more accurately reflects the user's actual situation.
[0067] Step 4: Use the stitching layer to stitch together the target element and the corresponding additional information to obtain the stitching result corresponding to the target element.
[0068] Specifically, the additional information corresponding to the target element output by the first multilayer perceptron can be horizontally spliced with the target element.
[0069] Step 5: Use the splicing result corresponding to the target element as the input of the weight activation layer to obtain the initial weight matrix corresponding to the target element output by the weight activation layer.
[0070] The concatenation result corresponding to the target element is input into the weight activation layer to obtain the initial weight matrix for that element. As described above, the concatenation results for different elements are input into the weight activation layer, which then outputs its own initial weight matrix. All outputs from the weight activation layer need to be processed by a classification layer to obtain the final output, as shown in step 6 below.
[0071] Step 6: The classification layer processes the initial weight matrices corresponding to the K elements output by the weight activation layer to obtain the final weight matrices corresponding to the K elements.
[0072] In a practical implementation, the classification layer may include a softmax function.
[0073] Through steps 1 to 6, the final weight matrices corresponding to the K elements are obtained. Next, the user representation matrix can be obtained based on the K elements and their respective weight matrices. In an optional implementation, a weighted sum is obtained based on the K elements and their respective weight matrices; then, the weighted sum is filtered using a second multilayer perceptron to obtain the user representation matrix. Figure 5 This is a schematic diagram illustrating an embodiment of obtaining a user representation matrix according to this application. Figure 5 As can be seen, the weighted sum X is obtained by multiplying the K elements of the user representation propagation sequence by their corresponding weights and then summing the results. fin Next, the weighted sum is fed into the second multilayer perceptron (MLP2), where it processes and filters the data before finally outputting the user representation matrix X. f See the formula below:
[0074] X f =MLP2(X fin )
[0075]
[0076] In the formula above, W (l) X represents the weight matrix of any element. (l) Represents any single element. l takes a value from 0 to K-1, and is an integer.
[0077] Step 304: Recommend content based on the user representation matrix and the content representation matrix corresponding to multiple content items.
[0078] In the user representation matrix, each row represents a user. Therefore, the user representation vector corresponding to a specific user can be extracted from the user representation matrix obtained in step 303. As an example, the target user is one of the multiple users from whom the interaction data originates, and is also the target object of the recommended content. To recommend content to this user, the user representation vector corresponding to the target user among the multiple users can be obtained from the user representation matrix, and the content representation vectors corresponding to multiple items to be recommended can be obtained from the content representation matrix. For example, the interaction data mentioned in step 301 involves 50 users and 800 items. All of these items may be items to be recommended, or only some may be. The items to be recommended can be determined by user characteristics or classification, or based on the characteristics or classification of the content. Alternatively, no specific determination operation can be performed, and all 800 items can be directly considered as items to be recommended for which scores need to be obtained.
[0079] Before making recommendations, content can be rated. For example, a multilayer perceptron can be used to output the content rating: the user representation vector and the content representation vector are concatenated or otherwise operated on, the result of which is used as the input to the multilayer perceptron, and a one-dimensional vector is output as the user's rating of the content.
[0080] In other implementation examples, taking target content as an example, the target content is one of several items to be recommended. For the target content among the multiple items to be recommended, a recommendation score is obtained by multiplying the user representation vector with the content representation vector corresponding to the target content. Then, the recommended scores of the multiple items to be recommended are sorted to obtain a content recommendation sequence for the target user. Content with higher recommendation scores is given priority for recommendation to the target user. In practical applications, the number of recommended items M can be set, and the top M items with the highest recommendation scores can be selected and presented to the user.
[0081] The score is calculated by directly multiplying the user representation vector by the content representation vector corresponding to the target content. This method is simple and easy to operate, making the process from the end of user representation encoding to the completion of content recommendation concise and easy to implement, thus improving content recommendation efficiency. It also makes the entire network structure more lightweight to some extent, thereby improving the internal processing performance of the server.
[0082] The content recommendation method described above constructs an initial hypergraph based on user-content interaction data and encodes user representations to obtain a user representation matrix. Then, content recommendation is performed based on the encoded user representation matrix and the content representation matrices of multiple content elements involved in the interaction data. Specifically, the process of encoding the user representation matrix involves multiple rounds of propagation. The propagation results from each round are successively added to the initialized user representation propagation sequence to continuously update the sequence. The user representation matrix is then obtained through this propagation sequence. The propagation process involves expanding the interaction data in each round, constructing richer interaction data to update the hypergraph and assist in encoding the user representations. The propagation result of the i-th round is added to the end of the user representation propagation sequence to complete the update. Therefore, since the propagation of user representations depends on the dynamically updated hypergraph as the interaction data expands, each round of propagation is based on the expanded interaction data of that round and the propagation results of the previous round. The expanded interaction data in each round truly affects the propagation results of that round. This dynamic relationship also increases the accuracy of the user representation propagation sequence obtained after K-1 propagations, thereby improving the accuracy of user representation encoding and content recommendation in highly sparse data scenarios. This allows users to receive more content they are interested in or interested in on platforms or systems that apply this content recommendation method. The platform or system can also increase user engagement as a result.
[0083] The propagation process described above can be divided into several main parts: clustering, partitioning, expanding interactive data, calculating matrices, and convolution.
[0084] As described in step 302 of the previous embodiment, each round of propagation involves expanding the user-content interaction data and updating the hypergraph. This process will be described in detail below.
[0085] Taking any round from round 1 to round K-1 as an example (1≤i≤K-1, i is an integer), the propagation process in round i involves expanding the interactive data and propagating it in the following steps 1 to 7:
[0086] Step 1: During the i-th round of propagation, expand the interaction data to obtain the expanded interaction data corresponding to the i-th round.
[0087] In this step of data expansion, it can be achieved by clustering the last element in the user representation propagation and then expanding based on the clustering results. An optional implementation scheme is described below:
[0088] In the i-th round of propagation, clustering is performed based on the last element of the current user representation propagation sequence to determine multiple distinct cluster labels. Users involved in the interaction data are then categorized according to these cluster labels, ensuring that users within each category share the same cluster label. The interaction data of any two users within each category is then expanded based on the similarity of their user representations, resulting in the expanded interaction data for the i-th round. Each element in the user representation propagation sequence is in matrix form, hence the last element is also in matrix form. Each row of the matrix represents a user representation vector corresponding to a user. Clustering based on the last element of the current user representation propagation sequence can specifically involve clustering the user representation vectors of different users contained in the last matrix of the current user representation propagation sequence. That is, clustering the user representations of different users along the vector dimension. The similarity of user representation vectors can be measured in various ways, such as using cosine similarity or other methods to measure similarity between vectors, such as the Jaccard coefficient or Manhattan distance.
[0089] Figure 6 This is a schematic diagram illustrating interactive data expansion performed after clustering user representation vectors, as provided in an embodiment of this application. Figure 6 In this example, uppercase letters A, B, C, and D represent different users. Through clustering, users A and B are grouped into one category, and users C and D are grouped into another. Lowercase letters a, b, c, and d represent different content, such as... Figure 6 As shown, user A has a real interaction with content a, user B has a real interaction with content b, user C has a real interaction with content c, and user D has a real interaction with content d. The value on the arrow pointing from the user to the content represents the confidence level. Figure 6 The left side shows the interaction data before expansion. Since these interactions actually occur, the values on the arrows (solid arrows) pointing from the user to the content are all 1. Figure 6 The right side represents the expanded interaction data, extending the interaction data between user B and content a, user A and content b, user C and content d, and user D and content c. The relationships constructed by these dashed arrows are expanded and not real. Here, p represents the similarity between the user representation vectors of user A and user B, and q represents the similarity between the user representation vectors of user C and user D. p and q also represent the confidence level of the expanded interaction data.
[0090] Taking a cluster consisting of A and B as an example, where (A,a,1) and (B,b,1) are the original confidence interaction records of the original interaction data. As an example, the similarity function is set to cosine similarity, and its value is within the interval [0,1]. (That is, less than 0 is taken as 0, and the confidence of the original interaction is 1). To avoid the expanded interaction data having too low a confidence level, thus losing the meaning and value of data expansion, a threshold gate can be set to limit low similarity expansion. Figure 6 In this context, sim(UA, UB) represents the similarity between the user representation vectors of users A and B, and sim(UC, UD) represents the similarity between the user representation vectors of users C and D. (A, b, p) and (B, a, p) can represent newly added confidence interaction records (also known as extended confidence interaction records) obtained by interactively expanding the representation vectors of two users A and B based on their similarity.
[0091] Step 2: Obtain the set of confidence interaction records corresponding to the i-th round based on the original confidence interaction records of the interaction data and the newly added confidence interaction records of the extended interaction data corresponding to the i-th round.
[0092] Each round of data expansion is built upon the last element of the current user representation propagation sequence. Therefore, the clustering results may differ in each round, leading to variations in the expanded interaction data. Each round can be based on the original confidence interaction records of the interaction data (see...). Figure 6 (solid arrow in the text) and the newly added confidence interaction records of the extended interaction data (see reference). Figure 6 (The dashed arrow in the image) constructs the set of confidence interaction records corresponding to this round.
[0093] In highly sparse data scenarios, clustering offers significant advantages in building connections between users and expanding interactive data. This is because clustering can achieve "connections" among a large number of users. Other methods, such as calculating higher-order connectivity based on user-content interaction data, struggle to achieve similar effects in highly sparse data environments. Therefore, clustering-based expansion of user interaction data can create clearer associations and descriptions of user interests in highly sparse data scenarios, enriching data content, improving the quality of data expansion, and ultimately compensating for the disadvantages of data sparsity.
[0094] Step 3: Construct the updated hypergraph corresponding to the propagation of the i-th round based on the set of confidence interaction records corresponding to the i-th round.
[0095] Due to the data expansion, the graph data in the confidence interaction record set corresponding to the i-th round shows a significant change compared to the original interaction record set. This expansion results in some non-realistic changes. These changes also affect the nodes and hyperedges in the graph. Therefore, step 4 below needs to be performed.
[0096] Step 4: Calculate the hypergraph adjacency matrix, node degree matrix, and hyperedge degree matrix for the i-th round based on the updated hypergraph corresponding to the i-th round.
[0097] Based on the aforementioned changes to the hypergraph, the hypergraph adjacency matrix, node degree matrix, and hyperedge degree matrix for the i-th round can be recalculated. Since calculating the hypergraph adjacency matrix, node degree matrix, and hyperedge degree matrix are relatively mature techniques related to hypergraphs, the specific calculation process will not be elaborated here.
[0098] Because the hypergraph changes continuously as interactive data expands and user representations propagate, convolutional computation is dynamic. Compared to a static hypergraph, convolutional computation reduces noise generation, thereby improving the accuracy of the acquired user representation matrix and ultimately enhancing the accuracy of content recommendation.
[0099] In this embodiment, the filtering matrix can specifically be a hypergraph Laplacian filtering matrix (or hypergraph Laplacian filter). See step 5 below for the method of obtaining it.
[0100] Step 5: Obtain the hypergraph Laplacian filtering matrix for the i-th round based on the hypergraph adjacency matrix, node degree matrix, and hyperedge degree matrix for the i-th round.
[0101] The formula for obtaining the hypergraph Laplacian filtering matrix in the i-th round is as follows:
[0102]
[0103] Among them, L (i) H represents the Laplacian filtering matrix of the hypergraph in the i-th round. (i) Let Dv represent the hypergraph adjacency matrix in the i-th round. (i) De represents the node degree matrix in the i-th round. (i) Let W represent the hyperedge degree matrix in the i-th round. W represents the weight matrix, which is defaulted to the identity matrix I. I represents the identity matrix.
[0104] Step 6: Generate the propagation result for the i-th round based on the Laplacian filtering matrix of the hypergraph in the i-th round and the last element in the current user representation propagation sequence.
[0105] In this step, we can obtain the product of the hyperparameters and the Laplacian filtering matrix of the hypergraph in the i-th round; obtain the subtraction result of the identity matrix and the product result; and obtain the product of the subtraction result and the last element in the current user representation propagation sequence as the propagation result for the i-th round. The above process can be expressed as the formula:
[0106] X (i) =(I-γL) (i) )*X (i-1)
[0107] In the above formula, X (i-1) X represents the last element of the propagation sequence representing the current user. (i) L represents the propagation result in the i-th round. (i) Let represent the Laplacian filtering matrix of the hypergraph in the i-th round, and γ be a hyperparameter with values in the range [0,1].
[0108] Step 7: Update the current user representation propagation sequence based on the propagation results of the i-th round.
[0109] This step immediately adds the propagation result of the i-th round to the very end of the current user representation propagation sequence.
[0110] In the content recommendation methods described above, since user representation is derived from item representation, see formula X. (0) =Hori*E, therefore, the final user representation matrix has strong interpretability for the user representation.
[0111] Generally, homogeneous hypergraphs containing only user nodes, derived from user-content interaction data, are prone to noise. The main reason for this noise is the potential for introducing erroneous information into collaborative filtering, leading to inaccurate results. This modeling process expands based on pairwise interactions, using similarity calculations to minimize the possibility of extracting content information of no interest to the user into the user representation during expansion. This reduces noise and improves the accuracy, relevance, and effectiveness of content recommendations.
[0112] Unlike methods such as LightGCN or DHCF that update user and content representations as parameters, the parameters in this approach primarily reside within the several multilayer perceptron networks used. The content representation vector is determined based on the encoding rules of the upstream task, while the user representation vector is the model's output and does not require parameter updates. Therefore, the amount of parameter updates is significantly reduced. Furthermore, regarding the attention mechanism, the AD-JK mechanism further reduces the input size compared to the traditional JK attention mechanism, making the network model more lightweight and with relatively fewer parameters.
[0113] The technical solution of this invention may further include the calculation of the model loss function and the updating of model parameters. During training... Figure 5 When modeling with the structure and corresponding functions shown, the network parameters of the model (including the aforementioned weighted activation layer and the first and second multilayer perceptrons) can be updated according to the Bayesian Personalized Ranking Loss (BPR Loss), thereby improving the accuracy of the model.
[0114] The model constructed using the technical solution of this invention can be used to build a training set. The training set can include positive and negative examples from users, where positive examples refer to content that generates interaction, and negative examples refer to content that does not generate interaction. The loss of each test case in the training set can then be calculated using the following formula:
[0115] loss(u,pos,neg)=-ln[σ(s u,pos -s u,neg )]
[0116] Where s u,pos and s u,neg Let represent the ratings of user u for positive example pos and negative example neg, respectively. The loss for the entire training set can then be calculated, and the parameters of the network layers in the model can be optimized based on this loss.
[0117] Based on the content recommendation method provided in the foregoing embodiments, this application also provides a content recommendation apparatus. The specific implementation of this apparatus is described below. Figure 7 This is a schematic diagram of a content recommendation device provided in an embodiment of this application. Figure 7 As shown, the content recommendation device includes:
[0118] The hypergraph construction and sequence initialization unit 701 is used to construct an initial hypergraph and initialize the user representation propagation sequence based on the interaction data of multiple users and multiple contents.
[0119] The hypergraph update and propagation unit 702 is used to update the initial hypergraph by expanding the interaction data, and based on the updated hypergraph, propagate for K-1 rounds on the initialized user representation propagation sequence; the target length of the user representation propagation sequence is K, where K is an integer; wherein, the propagation result of the i-th round is used to be added to the end of the user representation propagation sequence to update the user representation propagation sequence; 1≤i≤K-1, where i is an integer;
[0120] User representation matrix acquisition unit 703 is used to obtain the user representation matrix corresponding to the multiple users based on the user representation propagation sequence obtained after the end of the (K-1)th round of propagation.
[0121] The content recommendation unit 704 is used to recommend content based on the user representation matrix and the content representation matrix corresponding to the multiple content items.
[0122] The content recommendation apparatus provided in this application constructs an initial hypergraph based on user-content interaction data and encodes user representations to obtain a user representation matrix. Then, it performs content recommendation based on the encoded user representation matrix and the content representation matrices of multiple content elements involved in the interaction data. Specifically, the process of encoding the user representation matrix involves multiple rounds of propagation. The propagation results obtained in each round are successively added to the initialized user representation propagation sequence to continuously update the user representation propagation sequence. The user representation matrix is then obtained through the user representation propagation sequence. The propagation process involves the expansion of the interaction data in each round, constructing a richer interaction data update hypergraph to assist in completing the encoding operation of the user representation. The propagation result of the i-th round is added to the end of the user representation propagation sequence to complete the update of the user representation propagation sequence in the i-th round. Therefore, since the propagation of user representations depends on the dynamically updated hypergraph as the interaction data expands, the propagation in each round is based on the expanded interaction data of that round and the propagation results of the previous round. The expanded interaction data in each round will truly affect the propagation results of that round. This dynamic relationship also increases the accuracy of the user representation propagation sequence obtained after K-1 propagations, thereby improving the accuracy of user representation encoding and content recommendation in highly sparse data scenarios.
[0123] In an optional implementation, the user representation propagation sequence obtained after the (K-1)th round of propagation includes K elements, namely: the initial propagation matrix in the initialized user representation propagation sequence, and the propagation results from the 1st round to the (K-1)th round; the initial propagation matrix is calculated based on the interaction data of the multiple users and the multiple contents;
[0124] The user-represented matrix acquisition unit 703 specifically includes:
[0125] The weight matrix acquisition sub-unit is used to process the user representation propagation sequence obtained after the end of the (K-1)th round of propagation using an attention mechanism to obtain the weight matrices corresponding to the K elements respectively.
[0126] The user representation matrix acquisition sub-unit is used to obtain the user representation matrix based on the K elements and the weight matrices corresponding to the K elements.
[0127] In an optional implementation, the attention mechanism is specifically a mean difference jump attention mechanism, and the processing structure of the mean difference jump attention mechanism includes: a mean calculation layer, a difference calculation layer, a first multilayer perceptron, a splicing layer, a weight activation layer, and a classification layer;
[0128] The weight matrix is used to obtain sub-units, specifically for:
[0129] The mean of the K elements is obtained through the mean calculation layer;
[0130] The difference between the mean and the target element is calculated by the difference calculation layer; the target element is one of the K elements.
[0131] The difference between the mean and the target element is processed by the first multilayer perceptron to obtain additional information corresponding to the target element;
[0132] The target element and its corresponding additional information are spliced together by the splicing layer to obtain the splicing result corresponding to the target element;
[0133] The concatenation result corresponding to the target element is used as the input of the weight activation layer to obtain the initial weight matrix corresponding to the target element output by the weight activation layer.
[0134] The classification layer processes the initial weight matrices corresponding to the K elements output by the weight activation layer to obtain the final weight matrices corresponding to the K elements.
[0135] In the optional implementation, the hypergraph update and propagation unit 702 includes:
[0136] The data expansion subunit is used to expand the interactive data in the i-th round to obtain the expanded interactive data corresponding to the i-th round.
[0137] The hypergraph update subunit is used to update the initial hypergraph based on the extended interaction data corresponding to the i-th round, so as to obtain the updated hypergraph corresponding to the i-th round of propagation.
[0138] The filter matrix acquisition sub-unit is used to obtain the filter matrix for the i-th round based on the updated hypergraph corresponding to the i-th round of propagation.
[0139] The propagation subunit is used to propagate the user representation propagation sequence in the i-th round using the filtering matrix of the i-th round.
[0140] In an optional implementation, the user representation propagation sequence obtained at the end of the (K-1)th round of propagation includes K elements, namely: the initial propagation matrix in the initialized user representation propagation sequence, and the propagation results from the 1st to the (K-1)th round; the hypergraph update subunit is specifically used for:
[0141] The set of confidence interaction records corresponding to the i-th round is obtained based on the original confidence interaction records of the interaction data and the newly added confidence interaction records of the extended interaction data corresponding to the i-th round.
[0142] Construct the updated hypergraph corresponding to the propagation in the i-th round based on the set of confidence interaction records corresponding to the i-th round.
[0143] The filtering matrix acquisition sub-unit is specifically used to: calculate the hypergraph adjacency matrix, node degree matrix, and hyperedge degree matrix of the i-th round based on the updated hypergraph corresponding to the i-th round;
[0144] The hypergraph Laplacian filtering matrix for the i-th round is obtained based on the hypergraph adjacency matrix, node degree matrix, and hyperedge degree matrix for the i-th round.
[0145] The propagation subunit is specifically used to: generate the propagation result of the i-th round based on the hypergraph Laplacian filtering matrix of the i-th round and the last element of the current user representation propagation sequence;
[0146] Update the current user representation propagation sequence based on the propagation results of the i-th round.
[0147] In the optional implementation, the data expansion subunit includes:
[0148] Clustering subunits are used to cluster the last element in the current user representation propagation sequence during the i-th round of propagation, and determine multiple different cluster labels.
[0149] The sub-unit is used to classify users involved in the interactive data according to the clustering label, so that users in each user category have the same clustering label.
[0150] The interaction extension subunit is used to extend the interaction data of any two users within each user category based on the similarity of user representations, so as to obtain the extended interaction data corresponding to the i-th round.
[0151] In an optional implementation, each element in the user representation propagation sequence is in matrix form, and each row of the matrix represents a user representation vector corresponding to a user; the clustering subunit is specifically used to cluster the user representation vectors of different users contained in the last matrix of the current user representation propagation sequence.
[0152] In the optional implementation, the propagation result generation subunit is specifically used for:
[0153] Obtain the product of the hyperparameters and the Laplacian filtering matrix of the hypergraph in the i-th round;
[0154] Obtain the result of the subtraction operation between the identity matrix and the product result;
[0155] The product of the subtraction result and the last element in the current user representation propagation sequence is obtained as the propagation result for the i-th round.
[0156] The user represents the matrix to obtain sub-units, specifically used for:
[0157] A weighted sum is obtained based on the K elements and the weight matrices corresponding to the K elements;
[0158] The user representation matrix is obtained by filtering the weighted sum using a second multilayer perceptron.
[0159] In optional implementations, the content recommendation device also includes:
[0160] The content set acquisition unit is used to acquire the data set corresponding to the multiple users and the multiple content sets based on the interaction data between the multiple users and the multiple content sets.
[0161] The data numbering unit is used to number the users in the data set corresponding to multiple users, and to number the content data in the content data set;
[0162] The content representation matrix construction unit is used to construct the content representation matrix based on the number of the content data in the content data set;
[0163] The original hypergraph adjacency matrix acquisition unit is used to obtain the original hypergraph adjacency matrix based on the user IDs in the data set corresponding to multiple users and the content data IDs in the content data set.
[0164] The initial propagation matrix calculation unit is used to obtain the initial propagation matrix based on the original hypergraph adjacency matrix and the content representation matrix.
[0165] In the optional implementation, the original hypergraph adjacency matrix acquisition unit is specifically used for:
[0166] Obtain the number of users among the multiple users and the number of contents among the multiple content items;
[0167] Based on the number of users and the number of content, construct an initial matrix with the dimension of number of users × number of content;
[0168] The initial matrix is filled with the user IDs from the data sets corresponding to multiple users and the content data IDs from the content data sets. The filled matrix is then used as the original hypergraph adjacency matrix.
[0169] The content recommendation unit 704 includes:
[0170] The representation vector acquisition subunit is used to obtain the user representation vector corresponding to the target user among the plurality of users from the user representation matrix, and to obtain the content representation vectors corresponding to the plurality of recommended content from the content representation matrix; the target user is one of the plurality of users, and the plurality of recommended content is part or all of the plurality of content;
[0171] The recommendation score acquisition subunit is used to obtain the recommendation score of the target content by multiplying the user representation vector with the content representation vector corresponding to the target content among the multiple content items to be recommended; the target content is one of the multiple content items to be recommended.
[0172] The recommendation subunit is used to sort the multiple recommended contents according to their recommendation scores to obtain a content recommendation sequence for the target user.
[0173] Based on the content recommendation method and apparatus provided in the foregoing embodiments, this application also provides a content recommendation device to implement the above-described content recommendation method or apparatus. The structure of the content recommendation device is described below in both server and terminal device forms.
[0174] Figure 8 This is a schematic diagram of a server structure provided in an embodiment of this application. The server 900 can vary significantly due to different configurations or performance. It 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 diagram), each module may include a series of instruction operations on the server. 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 server 900.
[0175] Server 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. TM Mac OS X TM Unix TM Linux TM FreeBSD TM etc.
[0176] CPU 922 is used to perform the following steps:
[0177] Construct an initial hypergraph based on interaction data of multiple users and multiple content items, and initialize the user representation propagation sequence;
[0178] The initial hypergraph is updated by expanding the interaction data, and K-1 rounds of propagation are performed based on the updated hypergraph on the initial user representation propagation sequence; the target length of the user representation propagation sequence is K, where K is an integer; wherein, the propagation result of the i-th round is used to be added to the end of the user representation propagation sequence to update the user representation propagation sequence; 1≤i≤K-1, where i is an integer;
[0179] The user representation matrix corresponding to the multiple users is obtained based on the user representation propagation sequence obtained after the (K-1)th round of propagation.
[0180] Content recommendation is performed based on the user representation matrix and the content representation matrix corresponding to the multiple content items.
[0181] This application also provides another content recommendation device, such as... Figure 9 As shown, for ease of explanation, only the parts related to the embodiments of this application are shown. For specific technical details not disclosed, please refer to the method section of the embodiments of this application. The terminal can be any terminal device including mobile phones, tablets, personal digital assistants (PDAs), point-of-sale (POS) terminals, in-vehicle computers, etc. Taking a mobile phone as an example:
[0182] Figure 9 This is a block diagram illustrating a portion of the structure of a mobile phone related to the terminal provided in the embodiments of this application. (Reference) Figure 9The mobile phone includes: a radio frequency (RF) circuit 1010, a memory 1020, an input unit 1030, a display unit 1040, a sensor 1050, an audio circuit 1060, a wireless fidelity (WiFi) module 1070, a processor 1080, and a power supply 1090, etc. Those skilled in the art will understand that... Figure 9 The mobile phone structure shown does not constitute a limitation on the mobile phone and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0183] The following is combined with Figure 9 A detailed introduction to each component of a mobile phone:
[0184] The RF circuit 1010 can be used for receiving and transmitting signals during information transmission or calls. Specifically, it receives downlink information from the base station and processes it with the processor 1080; additionally, it transmits uplink data to the base station. Typically, the RF circuit 1010 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier (LNA), a duplexer, etc. Furthermore, the RF circuit 1010 can also communicate wirelessly with networks and other devices. The aforementioned wireless communications may use any communication standard or protocol, including but not limited to Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, and Short Messaging Service (SMS).
[0185] The memory 1020 can be used to store software programs and modules. The processor 1080 executes various mobile phone functions and data processing by running the software programs and modules stored in the memory 1020. The memory 1020 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory 1020 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0186] The input unit 1030 can be used to receive input numerical or character information, and to generate key signal inputs related to user settings and function control of the mobile phone. Specifically, the input unit 1030 may include a touch panel 1031 and other input devices 1032. The touch panel 1031, also known as a touch screen, can collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch panel 1031), and drive the corresponding connection devices according to a pre-set program. Optionally, the touch panel 1031 may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch position and the signal generated by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends it to the processor 1080, and can also receive and execute commands sent by the processor 1080. In addition, the touch panel 1031 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 1031, the input unit 1030 may also include other input devices 1032. Specifically, other input devices 1032 may include, but are not limited to, one or more of the following: physical keyboard, function keys (such as volume control buttons, power buttons, etc.), trackball, mouse, joystick, etc.
[0187] The display unit 1040 can be used to display information input by the user or information provided to the user, as well as various menus of the mobile phone. The display unit 1040 may include a display panel 1041, which may optionally be configured as a Liquid Crystal Display (LCD), Organic Light-Emitting Diode (OLED), or similar display panel 1041. Further, a touch panel 1031 may cover the display panel 1041. When the touch panel 1031 detects a touch operation on or near it, it transmits the information to the processor 1080 to determine the type of touch event. Subsequently, the processor 1080 provides corresponding visual output on the display panel 1041 according to the type of touch event. Although in Figure 9 In this embodiment, the touch panel 1031 and the display panel 1041 are two separate components to realize the input and output functions of the mobile phone. However, in some embodiments, the touch panel 1031 and the display panel 1041 can be integrated to realize the input and output functions of the mobile phone.
[0188] The mobile phone may also include at least one sensor 1050, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor. The ambient light sensor can adjust the brightness of the display panel 1041 according to the ambient light level, and the proximity sensor can turn off the display panel 1041 and / or the backlight when the phone is moved to the ear. As a type of motion sensor, an accelerometer sensor can detect the magnitude of acceleration in various directions (generally three axes). When stationary, it can detect the magnitude and direction of gravity and can be used for applications that recognize the phone's posture (such as landscape / portrait switching, related games, magnetometer posture calibration), vibration recognition-related functions (such as pedometer, taps), etc. Other sensors that may be configured in the mobile phone, such as gyroscopes, barometers, hygrometers, thermometers, and infrared sensors, will not be described in detail here.
[0189] The audio circuit 1060, speaker 1061, and microphone 1062 provide an audio interface between the user and the mobile phone. The audio circuit 1060 converts the received audio data into electrical signals and transmits them to the speaker 1061, where the speaker 1061 converts them into sound signals for output. On the other hand, the microphone 1062 converts the collected sound signals into electrical signals, which are then received by the audio circuit 1060, converted into audio data, and then processed by the processor 1080 before being transmitted via the RF circuit 1010 to, for example, another mobile phone, or the audio data can be output to the memory 1020 for further processing.
[0190] WiFi is a short-range wireless transmission technology. Through the WiFi module 1070, mobile phones can help users send and receive emails, browse web pages, and access streaming media, providing users with wireless broadband internet access. Although Figure 9 The WiFi module 1070 is shown, but it is understood that it is not an essential component of a mobile phone and can be omitted as needed without changing the essence of the invention.
[0191] The processor 1080 is the control center of the mobile phone, connecting various parts of the phone through various interfaces and lines. It executes software programs and / or modules stored in the memory 1020, and calls data stored in the memory 1020 to perform various functions and process data, thereby collecting overall data and information from the phone. Optionally, the processor 1080 may include one or more processing units; preferably, the processor 1080 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 1080.
[0192] The mobile phone also includes a power supply 1090 (such as a battery) that supplies power to various components. Preferably, the power supply can be logically connected to the processor 1080 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system.
[0193] Although not shown, mobile phones may also include a camera, Bluetooth module, etc., which will not be described in detail here.
[0194] In this embodiment of the application, the processor 1080 included in the terminal also has the following functions:
[0195] Construct an initial hypergraph based on interaction data of multiple users and multiple content items, and initialize the user representation propagation sequence;
[0196] The initial hypergraph is updated by expanding the interaction data, and K-1 rounds of propagation are performed based on the updated hypergraph on the initial user representation propagation sequence; the target length of the user representation propagation sequence is K, where K is an integer; wherein, the propagation result of the i-th round is used to be added to the end of the user representation propagation sequence to update the user representation propagation sequence; 1≤i≤K-1, where i is an integer;
[0197] The user representation matrix corresponding to the multiple users is obtained based on the user representation propagation sequence obtained after the (K-1)th round of propagation.
[0198] Content recommendation is performed based on the user representation matrix and the content representation matrix corresponding to the multiple content items.
[0199] This application also provides a computer-readable storage medium for storing program code that executes any one of the implementation methods of the content recommendation method described in the foregoing embodiments.
[0200] This application also provides a computer program product including instructions that, when run on a computer, cause the computer to execute any one of the implementation methods of the content recommendation method described in the foregoing embodiments.
[0201] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the system and equipment described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0202] In the several embodiments provided in this application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For instance, the division of the system is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple systems may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0203] The system described as separate components may or may not be physically separate. Components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0204] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0205] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes: USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, optical disks, and other media capable of storing program code.
[0206] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A content recommendation method characterized by, Applications include video recommendation, music recommendation, book recommendation, online shopping, and search scenarios, including: An initial hypergraph is constructed based on the interaction data of multiple users and multiple content items, and a user representation propagation sequence is initialized. The interaction data refers to the interaction data collected and generated by users in the application. The initial hypergraph is updated by expanding the interaction data, and K-1 rounds of propagation are performed based on the updated hypergraph on the initial user representation propagation sequence; wherein, the propagation result of the i-th round is added to the end of the user representation propagation sequence to update the user representation propagation sequence; the target length of the user representation propagation sequence is K, where K is an integer; 1≤i≤K-1, where i is an integer; The user representation matrix corresponding to the multiple users is obtained based on the user representation propagation sequence obtained after the (K-1)th round of propagation. Content recommendation is performed based on the user representation matrix and the content representation matrix corresponding to the multiple content items; The user representation propagation sequence obtained after the (K-1)th round of propagation includes K elements, which are: the initial propagation matrix in the initialized user representation propagation sequence, and the propagation results from the 1st round to the (K-1)th round; the initial propagation matrix is calculated based on the interaction data of the multiple users and the multiple contents; The step of obtaining the user representation matrix corresponding to the multiple users based on the user representation propagation sequence obtained after the (K-1)th round of propagation includes: An attention mechanism is used to process the user representation propagation sequence obtained at the end of the (K-1)th round of propagation to obtain the weight matrices corresponding to the K elements respectively; The user representation matrix is obtained based on the K elements and the weight matrices corresponding to the K elements; Specifically, the attention mechanism is a mean difference jump attention mechanism, and the processing structure of the mean difference jump attention mechanism includes: a mean calculation layer, a difference calculation layer, a first multilayer perceptron, a splicing layer, a weight activation layer, and a classification layer. The user representation propagation sequence obtained at the end of the (K-1)th round of propagation is processed using an attention mechanism to obtain the weight matrices corresponding to the K elements, including: The mean of the K elements is obtained through the mean calculation layer; The difference between the mean and the target element is calculated by the difference calculation layer; the target element is one of the K elements. The difference between the mean and the target element is processed by the first multilayer perceptron to obtain additional information corresponding to the target element; The target element and its corresponding additional information are spliced together by the splicing layer to obtain the splicing result corresponding to the target element; The concatenation result corresponding to the target element is used as the input of the weight activation layer to obtain the initial weight matrix corresponding to the target element output by the weight activation layer. The classification layer processes the initial weight matrices corresponding to the K elements output by the weight activation layer to obtain the final weight matrices corresponding to the K elements.
2. The content recommendation method according to claim 1, characterized by, The step of updating the hypergraph by expanding the interaction data and performing K-1 rounds of propagation based on the updated hypergraph and the initialized user representation propagation sequence includes: The interaction data is expanded in the i-th round to obtain the expanded interaction data corresponding to the i-th round; Based on the extended interaction data corresponding to the i-th round, the updated hypergraph corresponding to the i-th round of propagation is updated on the basis of the initial hypergraph to obtain the updated hypergraph corresponding to the i-th round of propagation. Based on the updated hypergraph corresponding to the i-th round of propagation, obtain the filtering matrix for the i-th round; The user representation propagation sequence is propagated in the i-th round using the filtering matrix of the i-th round.
3. The content recommendation method according to claim 2, characterized by, The user representation propagation sequence obtained after the (K-1)th round of propagation includes K elements, namely: the initial propagation matrix in the initialized user representation propagation sequence, and the propagation results from the 1st to the (K-1)th round; the updated hypergraph corresponding to the i-th round of propagation is obtained by updating the extended interaction data corresponding to the i-th round based on the initial hypergraph, including: The set of confidence interaction records corresponding to the i-th round is obtained based on the original confidence interaction records of the interaction data and the newly added confidence interaction records of the extended interaction data corresponding to the i-th round. Construct the updated hypergraph corresponding to the propagation in the i-th round based on the set of confidence interaction records corresponding to the i-th round. The process of obtaining the filtering matrix for the i-th round based on the updated hypergraph corresponding to the i-th round of propagation includes: Calculate the hypergraph adjacency matrix, node degree matrix, and hyperedge degree matrix for the i-th round based on the updated hypergraph corresponding to the i-th round. The hypergraph Laplacian filtering matrix for the i-th round is obtained based on the hypergraph adjacency matrix, node degree matrix, and hyperedge degree matrix for the i-th round. The step of propagating the user representation propagation sequence in the i-th round using the filtering matrix of the i-th round includes: The propagation result for the i-th round is generated based on the hypergraph Laplacian filtering matrix of the i-th round and the last element in the current user representation propagation sequence; Update the current user representation propagation sequence based on the propagation results of the i-th round.
4. The content recommendation method according to claim 2, characterized by, The step of expanding the interaction data in the i-th round to obtain the expanded interaction data corresponding to the i-th round includes: During the i-th round of propagation, clustering is performed based on the last element in the current user representation propagation sequence to determine multiple different cluster labels; The users involved in the interaction data are divided into user categories based on cluster labels, so that users within each user category have the same cluster label. Based on the similarity of user representations, the interaction data of any two users within each user category is expanded to obtain the expanded interaction data corresponding to the i-th round.
5. The content recommendation method according to claim 4, characterized by, Each element in the user representation propagation sequence is in matrix form, and each row of the matrix represents a user representation vector corresponding to a user; the clustering based on the last element in the current user representation propagation sequence includes: Cluster the user representation vectors of different users contained in the last matrix of the current user representation propagation sequence.
6. The content recommendation method according to claim 3, characterized by, The step of generating the propagation result for the i-th round based on the hypergraph Laplacian filtering matrix of the i-th round and the last element of the current user representation propagation sequence includes: Obtain the product of the hyperparameters and the Laplacian filtering matrix of the hypergraph in the i-th round; Obtain the result of the subtraction operation between the identity matrix and the product result; The product of the subtraction result and the last element in the current user representation propagation sequence is obtained as the propagation result for the i-th round.
7. The content recommendation method of claim 1, wherein, The step of obtaining the user representation matrix based on the K elements and the weight matrices corresponding to the K elements includes: A weighted sum is obtained based on the K elements and the weight matrices corresponding to the K elements; The user representation matrix is obtained by filtering the weighted sum using a second multilayer perceptron.
8. The content recommendation method of claim 1, wherein, The method further includes: Based on the interaction data between the multiple users and the multiple content items, obtain the data set corresponding to the multiple users and obtain the content data set corresponding to the multiple content items; The users in the data set corresponding to multiple users are numbered, and the content data in the content data set is also numbered; The content representation matrix is constructed based on the number of the content data in the content data set; The original hypergraph adjacency matrix is obtained based on the user IDs in the data sets corresponding to multiple users and the content data IDs in the content data sets. The initial propagation matrix is calculated based on the interaction data of the multiple users and the multiple content items, including: The initial propagation matrix is obtained based on the original hypergraph adjacency matrix and the content representation matrix.
9. The content recommendation method of any of claims 1-8, wherein, The content recommendation based on the user representation matrix and the content representation matrix corresponding to the multiple content items includes: The user representation vector corresponding to the target user among the plurality of users is obtained from the user representation matrix, and the content representation vectors corresponding to the plurality of recommended content are obtained from the content representation matrix respectively; the target user is one of the plurality of users, and the plurality of recommended content is part or all of the plurality of content; For the target content among the multiple recommended content items, the recommendation score of the target content is obtained by multiplying the user representation vector with the content representation vector corresponding to the target content; the target content is one of the multiple recommended content items. The recommended scores of the multiple items to be recommended are sorted to obtain a content recommendation sequence for the target user.
10. A content recommendation apparatus characterized by comprising: Applications include video recommendation, music recommendation, book recommendation, online shopping, and search scenarios, including: The hypergraph construction and sequence initialization unit is used to construct an initial hypergraph and initialize the user representation propagation sequence based on the interaction data of multiple users and multiple contents. The interaction data is the interaction data collected and generated by users in the application. The hypergraph update and propagation unit is used to update the initial hypergraph by expanding the interaction data, and to propagate the updated hypergraph for K-1 rounds based on the initialized user representation propagation sequence; the target length of the user representation propagation sequence is K, where K is an integer; wherein, the propagation result of the i-th round is used to be added to the end of the user representation propagation sequence to update the user representation propagation sequence; 1≤i≤K-1, where i is an integer; The user representation matrix acquisition unit is used to obtain the user representation matrix corresponding to the multiple users based on the user representation propagation sequence obtained after the (K-1)th round of propagation. The content recommendation unit is used to recommend content based on the user representation matrix and the content representation matrix corresponding to the multiple content items; The user representation propagation sequence obtained after the (K-1)th round of propagation includes K elements, which are: the initial propagation matrix in the initialized user representation propagation sequence, and the propagation results from the 1st round to the (K-1)th round; the initial propagation matrix is calculated based on the interaction data of the multiple users and the multiple contents; The user representation matrix acquisition unit includes: The weight matrix acquisition sub-unit is used to process the user representation propagation sequence obtained after the end of the (K-1)th round of propagation using an attention mechanism to obtain the weight matrices corresponding to the K elements respectively. The user representation matrix acquisition sub-unit is used to obtain the user representation matrix based on the K elements and the weight matrices corresponding to the K elements respectively; Specifically, the attention mechanism is a mean difference jump attention mechanism, and the processing structure of the mean difference jump attention mechanism includes: a mean calculation layer, a difference calculation layer, a first multilayer perceptron, a splicing layer, a weight activation layer, and a classification layer. The weight matrix is used to obtain sub-units, specifically for: The mean of the K elements is obtained through the mean calculation layer; The difference between the mean and the target element is calculated by the difference calculation layer; the target element is one of the K elements. The difference between the mean and the target element is processed by the first multilayer perceptron to obtain additional information corresponding to the target element; The target element and its corresponding additional information are spliced together by the splicing layer to obtain the splicing result corresponding to the target element; The concatenation result corresponding to the target element is used as the input of the weight activation layer to obtain the initial weight matrix corresponding to the target element output by the weight activation layer. The classification layer processes the initial weight matrices corresponding to the K elements output by the weight activation layer to obtain the final weight matrices corresponding to the K elements.
11. The apparatus of claim 10, wherein, The hypergraph update and propagation unit includes: The data expansion subunit is used to expand the interactive data in the i-th round to obtain the expanded interactive data corresponding to the i-th round. The hypergraph update subunit is used to update the initial hypergraph based on the extended interaction data corresponding to the i-th round, so as to obtain the updated hypergraph corresponding to the i-th round of propagation. The filter matrix acquisition sub-unit is used to obtain the filter matrix for the i-th round based on the updated hypergraph corresponding to the i-th round of propagation. The propagation subunit is used to propagate the user representation propagation sequence in the i-th round using the filtering matrix of the i-th round.
12. The apparatus of claim 11, wherein, The user representation propagation sequence obtained after the (K-1)th round of propagation includes K elements, which are: the initial propagation matrix in the initialized user representation propagation sequence, and the propagation results from the 1st to the (K-1)th round; the hypergraph update subunit is specifically used for: The set of confidence interaction records corresponding to the i-th round is obtained based on the original confidence interaction records of the interaction data and the newly added confidence interaction records of the extended interaction data corresponding to the i-th round. Construct the updated hypergraph corresponding to the propagation in the i-th round based on the set of confidence interaction records corresponding to the i-th round. The process of obtaining the filtering matrix for the i-th round based on the updated hypergraph corresponding to the i-th round of propagation includes: Calculate the hypergraph adjacency matrix, node degree matrix, and hyperedge degree matrix for the i-th round based on the updated hypergraph corresponding to the i-th round. The hypergraph Laplacian filtering matrix for the i-th round is obtained based on the hypergraph adjacency matrix, node degree matrix, and hyperedge degree matrix for the i-th round. The step of propagating the user representation propagation sequence in the i-th round using the filtering matrix of the i-th round includes: The propagation result for the i-th round is generated based on the hypergraph Laplacian filtering matrix of the i-th round and the last element in the current user representation propagation sequence; Update the current user representation propagation sequence based on the propagation results of the i-th round.
13. A content recommendation device, characterized by, The device includes a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is configured to execute the steps of the content recommendation method according to any one of claims 1 to 9, based on the instructions in the program code.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store program code for performing the steps of the content recommendation method according to any one of claims 1 to 9.
15. A computer program product, characterized in that, It includes a computer program or instructions that, when executed by a content recommendation device, implement the steps of the content recommendation method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Personalized sorting and recommendation method based on homogeneous hypergraph attention network
CN114840772A