Information recommendation method and device, electronic equipment and storage medium
Patent Information
- Application Number
- CN202211139362.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-19
- Publication Date
- 2026-09-04
- Estimated Expiration
- 2042-09-19
AI Technical Summary
[0003]为了满足应用需求,目前的相关技术中推荐方式也在不断改变,虽然目前的推荐方案一定程度上能够满足一个或多个方面的需求,但是推荐方案仍有待改进,如何优化推荐方案也是本领域相关技术人员一直在研究的重要问题之一
[0046]本申请实施例提供的信息推荐方法,可以实现基于对象之间相似度的信息推荐,该方法在确定待处理数据集中各个对象之间的相似度时,会将待处理数据集中的数据划分为多个数据子集,并通过获取每个数据子集(局部数据)所对应的各个第一对象之间的相似度(局部相似度),来估计得到进行信息推荐所需的全局相似度(待处理数据集对应的所有对象之间的两两相似度),本申请的该方法可以实现基于缺失的相似度数据来估算完整的相似度数据,由于数据子集的数据量是待处理数据集的部分数据量,因此,该方法可以有效减少数据处理量,提高计算效率,能够更好的满足实际需求,尤其是在大规模数据的处理场景中,效果更加突出。
Smart Images

Figure CN117033753B_ABST
Abstract
Description
Technical Field
[0001] This application relates to fields such as computers, distributed computing, cloud technology, and big data. Specifically, this application relates to an information recommendation method, apparatus, electronic device, and storage medium. Background Technology
[0002] With the rapid development of technology, people's living standards and needs are constantly improving. The use of various applications has become commonplace, and information recommendation has become an indispensable part of daily life. For example, for applications that provide multimedia services, recommendations can be made to users who may be interested in multimedia data, thereby improving user experience and increasing user engagement.
[0003] To meet application requirements, recommendation methods in related technologies are constantly evolving. Although current recommendation schemes can meet one or more needs to a certain extent, they still need improvement. How to optimize recommendation schemes is one of the important issues that those skilled in the art have been researching. Summary of the Invention
[0004] The purpose of this application is to provide an information recommendation method, apparatus, electronic device, and storage medium that can better meet application needs. To achieve the above objective, the technical solutions provided by this application are as follows:
[0005] On the one hand, embodiments of this application provide an information recommendation method, which includes:
[0006] Obtain the dataset to be processed, which includes n feature vectors of a first object, where the first object is a candidate recommendation object or a candidate recommended item, and n≥2;
[0007] The dataset to be processed is divided into k subsets, where k ≥ 2;
[0008] For each data subset, based on the feature vector of each first object in the data subset, the first similarity between each first object corresponding to the data subset is obtained;
[0009] Based on the first similarity between each first object corresponding to k subsets of data, a second similarity is determined between each first object in the dataset to be processed, so as to recommend items to the target recommendation object based on the second similarity.
[0010] On the other hand, embodiments of this application provide an information recommendation device, which includes:
[0011] The source data acquisition module is used to acquire the dataset to be processed, which includes n feature vectors of a first object, where the first object is a candidate recommendation object or a candidate recommended item, and n≥2;
[0012] The data segmentation processing module is used to divide the dataset to be processed into k data subsets. For each data subset, based on the feature vector of each first object in the data subset, the first similarity between each first object in the data subset is obtained, where k≥2.
[0013] The processing result acquisition module is used to determine the second similarity between each first object in the dataset to be processed based on the first similarity between each first object corresponding to the k subsets of data, so as to recommend information to the target recommendation object based on the second similarity.
[0014] Optionally, the aforementioned information recommendation device is a device in the first electronic device, and the data segmentation processing module can be used for:
[0015] The k data subsets are sent to k second electronic devices respectively, and the k second electronic devices calculate in parallel the first similarity between the first objects corresponding to their respective data subsets based on the feature vectors of each first object in their respective data subsets.
[0016] Receive the first similarity between each first object corresponding to each data subset sent by the k second electronic devices.
[0017] Optionally, the processing result acquisition module can be used to perform the following operations:
[0018] For each data subset, a first similarity matrix is constructed based on the first similarity between each first object corresponding to the data subset, wherein the element value of each row of the first similarity matrix is the first similarity between an object corresponding to the data subset and each first object corresponding to the data subset.
[0019] The first similarity matrices corresponding to each of the data subsets are fused to obtain a fusion matrix, wherein the number of rows and columns of the fusion matrix are both n. Each row element in the fusion matrix represents a similarity vector between a first object and each of the n first objects. The similarity vector of a first object includes known element values and missing element values. The known element values are the first similarity values corresponding to the first object.
[0020] The second similarity matrix is obtained by completing the fusion matrix. The element value of each row in the second similarity matrix is the second similarity between one of the n first objects and each of the n first objects.
[0021] Optionally, the processing result acquisition module can be used to: initialize a matrix to be optimized based on the fusion matrix, wherein the number of rows and columns of the matrix to be optimized is equal to the fusion matrix; initialize the element values of each element in the matrix to be optimized; use the initialized matrix to be optimized as the model parameters of the neural network model to be trained; repeatedly perform optimization operations on the matrix to be optimized until a preset condition is met; and use the matrix to be optimized when the preset condition is met as the second similarity matrix, wherein the optimization operation includes the following steps:
[0022] The difference between the known element values in the fusion matrix and the element values corresponding to the known element values in the matrix to be optimized is determined. If the preset condition is not met, the difference value is used as the training loss value, and the element values in the matrix to be optimized are adjusted based on the training loss value.
[0023] Optionally, the processing result acquisition module can be used to: decompose the matrix to be optimized into at least two matrices; and initialize the element values of each element in each of the at least two matrices;
[0024] The step of using the initialized matrix to be optimized as the model parameter of the neural network model to be trained includes: using the element values of each of the at least two initialized matrices as the model parameter of the neural network model to be trained.
[0025] When determining the difference between the known element values in the fusion matrix and the corresponding element values in the matrix to be optimized, the processing result acquisition module can be used for:
[0026] Based on the element values of each element in at least two matrices, determine the element values of each element in the matrix to be optimized; determine the difference between the known element values in the fusion matrix and the element values corresponding to the known element values in the matrix to be optimized.
[0027] Optionally, the processing result acquisition module can be used to: apply the following expression to the matrix to be optimized. Decompose:
[0028]
[0029] in, express eigenmatrix express The covariance matrix, for The transpose of the matrix; the at least two matrices include the characteristic matrix and the covariance matrix.
[0030] Optionally, the processing result acquisition module can be used to: based on the first similarity between each first object corresponding to k subsets of data, predict the second similarity between each first object corresponding to the dataset to be processed through a trained neural network model;
[0031] The trained neural network model is obtained by training an initial neural network model based on multiple training samples. Each training sample includes multiple local similarity data, and each local similarity data includes the similarity between sample objects in a subset of sample objects.
[0032] The input to the initial neural network model is multiple local similarity data in each training sample, and the output is global similarity data corresponding to each training sample. The global similarity data corresponding to a training sample includes pairwise similarities between all objects in multiple sample object subsets corresponding to that training sample.
[0033] Optionally, after determining the second similarity between each first object in the dataset to be processed, the information recommendation module can recommend information to the target recommendation object based on the second similarity between each first object in the dataset to be processed.
[0034] Optionally, the first object is a candidate recommendation object, and the target recommendation object is any one of the n first objects. The above information recommendation module can be used for:
[0035] Based on the second similarity between the target recommendation object and each of the n-1 candidate recommendation objects, at least one matching object that matches the target recommendation object is determined from the n-1 candidate recommendation objects. The n-1 candidate recommendation objects are each of the n first objects other than the target recommendation object.
[0036] Obtain the first item of interest for each of the matched objects;
[0037] Based on the first item of interest of each of the matched objects, the target recommended item is determined to be recommended to the target recommendation object.
[0038] Optionally, the first object is a candidate recommended item, and the above information recommendation module can be used for:
[0039] Obtain at least one second item of interest from the target recommended object, wherein the second item of interest is an object among the n first objects;
[0040] For each second item of interest, based on the second similarity between the second item of interest and each piece of information in the n-1 candidate recommended items, at least one matching item that matches the second item of interest is determined from the n-1 candidate recommended items, wherein the n-1 candidate recommended items are each of the n first objects other than the second item of interest;
[0041] Based on the matching items corresponding to each of the second items of interest, the target recommended items are determined to be recommended to the target recommendation object.
[0042] On the other hand, embodiments of this application also provide an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method provided in any optional embodiment of this application.
[0043] On the other hand, embodiments of this application also provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method provided in any optional embodiment of this application.
[0044] On the other hand, embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the methods provided in any optional embodiment of this application.
[0045] The beneficial effects of the technical solution provided in this application are as follows:
[0046] The information recommendation method provided in this application can realize information recommendation based on the similarity between objects. When determining the similarity between objects in the dataset to be processed, the method divides the data in the dataset into multiple data subsets, and estimates the global similarity (pairwise similarity between all objects in the dataset to be processed) required for information recommendation by obtaining the similarity (local similarity) between each first object corresponding to each data subset (local data). The method of this application can estimate the complete similarity data based on the missing similarity data. Since the data volume of the data subset is only a part of the data volume of the dataset to be processed, the method can effectively reduce the amount of data processing, improve the computational efficiency, and better meet the actual needs, especially in the processing of large-scale data, the effect is more prominent. Attached Figure Description
[0047] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below.
[0048] Figure 1A flowchart illustrating an information recommendation method provided in an embodiment of this application;
[0049] Figure 2 This is a schematic diagram of the structure of an information recommendation system provided in an embodiment of this application;
[0050] Figure 3 This is a schematic diagram of the structure of a distributed computing system provided in an embodiment of this application;
[0051] Figure 4 A schematic diagram illustrating the implementation process of an information recommendation method provided in this application embodiment;
[0052] Figure 5 A flowchart illustrating a song recommendation method provided in an embodiment of this application;
[0053] Figure 6 This is a schematic diagram of the structure of an information recommendation device provided in an embodiment of this application;
[0054] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0055] The embodiments of this application are described below with reference to the accompanying drawings. It should be understood that the embodiments described below with reference to the accompanying drawings are exemplary descriptions for explaining the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions of the embodiments of this application.
[0056] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the terms “comprising” and “including” as used in embodiments of this application mean that the corresponding feature can be implemented as the presented feature, information, data, step, operation, element, and / or component, but do not exclude implementation as other features, information, data, step, operation, element, component, and / or combinations thereof supported by the art. It should be understood that when we say that an element is “connected” or “coupled” to another element, the one element can be directly connected or coupled to the other element, or it can mean that the one element and the other element establish a connection relationship through an intermediate element. Furthermore, “connected” or “coupled” as used herein can include wireless connection or wireless coupling. The term “and / or” as used herein indicates at least one of the items defined by the term; for example, “A and / or B” can be implemented as “A,” or as “B,” or as “A and B.” When describing multiple (two or more) items, if the relationship between the multiple items is not explicitly defined, the multiple items can refer to one, several or all of the multiple items. For example, the description of "parameter A includes A1, A2, A3" can be implemented as parameter A includes A1 or A2 or A3, or it can be implemented as parameter A includes at least two of the three items A1, A2 and A3.
[0057] To better understand the methods provided in the embodiments of this application, some related technologies or technical terms involved in the embodiments of this application will be introduced and explained below.
[0058] Federated learning: Federated learning is a distributed machine learning framework with privacy protection and secure encryption technology. It combines distributed machine learning, cryptography, financial rule-based incentive mechanisms, and game theory to solve the problem of using scattered data.
[0059] Matrix factorization: A method of simplifying a matrix to its constituent parts, that is, splitting the matrix into the product of several matrices. Matrix factorization can simplify more complex matrix operations, which can be performed on the decomposed matrices rather than on the original matrix itself. Its derivative, non-negative matrix factorization, is also used for operations such as dimensionality reduction. A common analogy for matrix factorization is numerical factorization, such as factoring 10 into 2×5.
[0060] Correlation: Indicates the degree to which two variables are linearly related (i.e., they change together at a fixed rate). Correlation is a common tool used to describe simple relationships without stating a causal relationship.
[0061] Collaborative filtering recommendation method: A collaborative filtering scheme based on the relevance of object features, which ranks objects (recommended objects or recommended objects) by calculating the relevance between them and makes recommendations based on similarity scores.
[0062] In current recommendation systems, there are various recommendation methods, such as the commonly used collaborative filtering (CF) recommendation method and its variants. Although these methods can meet basic requirements to a certain extent, current recommendation methods are suitable for scenarios with a small number of recommendation objects or recommended objects. Otherwise, the computational cost is very high, and the current solutions are not suitable for distributed computing, resulting in a large overall computational load and low data processing efficiency. In addition, some current recommendation methods rely on the rating data of the recommendation objects for the recommended objects, but not all recommended objects have rating data, resulting in poor recommendation performance.
[0063] To better meet practical application needs and improve user experience, this application provides an information recommendation method to address at least one of the problems existing in current recommendation systems. This method effectively improves data processing efficiency and better meets recommendation requirements, especially in large-scale data similarity recommendation applications, where the solution provided by this application is particularly effective. In an optional embodiment of this application, local similarity data between objects calculated based on object feature vectors can be used to estimate the required global similarity data. This effectively utilizes the advantages of existing similarity data while improving computational efficiency.
[0064] Optionally, the data processing involved in the method provided in this application embodiment can be implemented based on cloud technology. For example, the calculation of the first similarity between each first object corresponding to the data subset can be carried out using cloud computing technology, and the storage of the dataset to be processed can be carried out using cloud storage.
[0065] Cloud computing is a computing model that distributes computing tasks across a resource pool composed of a large number of computers, enabling various application systems to obtain computing power, storage space, and information services as needed. The network providing these resources is called the "cloud." From the user's perspective, resources in the "cloud" are infinitely scalable, readily available, on-demand, expandable, and pay-as-you-go. Cloud storage is a new concept that extends and develops from cloud computing. A distributed cloud storage system (hereinafter referred to as a storage system) refers to a storage system that uses cluster applications, grid technology, and distributed storage file systems to aggregate a large number of various types of storage devices (also called storage nodes) in a network through application software or application interfaces to work collaboratively and provide data storage and business access functions.
[0066] Optionally, the solution provided in this application embodiment can be implemented based on a distributed cloud computing system. For example, a server cluster including multiple cloud servers can be used to build a distributed computing architecture, and the calculation of local similarity data corresponding to multiple datasets can be achieved through a distributed solution.
[0067] Optionally, the solution provided in this application embodiment can be implemented based on artificial intelligence (AI) technology. For example, a neural network model that can predict global similarity data based on local similarity data can be trained using machine learning (ML) based on a training dataset. This model can then be used to predict the second similarity between objects in the dataset to be processed.
[0068] Artificial intelligence (AI) is the theory, methods, technology, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI studies the design principles and implementation methods of various intelligent machines, enabling them to have perception, reasoning, and decision-making capabilities. With the research and advancement of AI technology, it has already been researched and applied in many fields, including smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, autonomous driving, drones, robots, smart healthcare, smart customer service, vehicle networking, and intelligent transportation. It is believed that with further technological development, this technology will be applied in even more fields and play an increasingly important role.
[0069] It should be noted that, in the optional embodiments of this application, various data related to the object (such as the object's rating of items, various feature data of candidate recommended items, etc.) require the object's permission or consent when the embodiments of this application are applied to specific products or technologies. Furthermore, the collection, use, and processing of the relevant data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. In other words, if the embodiments of this application involve data related to the object, this data must be obtained with the object's authorization and consent, and in accordance with the relevant laws, regulations, and standards of the country and region.
[0070] The technical solutions of this application and their effects are described below through several exemplary embodiments. It should be noted that the following embodiments can be referenced, borrowed from, or combined with each other. Identical terms, similar features, and similar implementation steps in different embodiments will not be repeated.
[0071] Figure 1 This illustration shows a flowchart of an information recommendation method provided in an embodiment of this application. The method can be executed by any electronic device, including a terminal device and a server. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The terminal (also referred to as a user terminal or user device) can be a smartphone, tablet computer, laptop computer, desktop computer, intelligent voice interaction device (e.g., smart speaker), wearable electronic device (e.g., smartwatch), in-vehicle terminal, smart home appliance (e.g., smart TV), AR / VR device, etc., but is not limited thereto. The terminal and server can be directly or indirectly connected via wired or wireless communication, which is not limited herein.
[0072] Optionally, the information recommendation method provided in this application embodiment can be implemented as an independent application or a functional module / plugin of an application. The application can be an application with information recommendation function. Based on the information recommendation method provided in this application embodiment, the application can provide better information recommendation services and effectively reduce the consumption of computing resources.
[0073] like Figure 1 As shown, the information recommendation method provided in this application embodiment may include the following steps S110 to S140.
[0074] Step S110: Obtain the dataset to be processed. The dataset to be processed includes n feature vectors of the first object. The first object is a candidate recommendation object or a candidate recommended item, and n≥2.
[0075] The dataset to be processed is the source data upon which the information recommendation is based. Optionally, this dataset can be feature vectors from a large-scale dataset, including a large number of feature vectors of the first object. The first object can be a candidate recommendation object (such as a user) or a candidate recommended item. The feature vector of the first object is a representation vector of the first object, which can include feature data of the first object in multiple dimensions. The specific method of obtaining the feature vectors of the first object is not limited in this embodiment.
[0076] Optionally, for example, the first object can be a candidate recommended item, such as a song in a music application. Feature vectors for each song can be obtained based on relevant data from multiple dimensions. For instance, feature vectors can be derived from the song's own item features, its rating, or behavioral data. Item features can include the number of times the song has been clicked, played, its genre, language, and number of times it has been favorited. Behavioral features can include the number of times each user has clicked, played, favorited, or liked the song.
[0077] For example, the first object is the candidate recommendation object, such as the user of a music application. The feature vector of each user can be obtained based on the relevant data of the user. Specifically, the information related to the product to be recommended to the candidate recommendation object can be obtained from the relevant information of the candidate recommendation object. For example, if you want to recommend songs to the user, you can obtain the user's feature vector based on the user's preferred song style, song language, number of times each song has been played, rating of each song, usage time of the application (such as the total usage time in a certain period of time or the average usage time per time unit), songs saved by the user, etc.
[0078] Step S120: Divide the dataset to be processed into k data subsets, where k ≥ 2.
[0079] Step S130: For each data subset, based on the feature vectors of each first object in the data subset, obtain the first similarity between each first object corresponding to the data subset.
[0080] Step S140: Based on the first similarity between each first object corresponding to the k data subsets, determine the second similarity between each first object in the dataset to be processed, and recommend information to the target recommendation object based on the second similarity.
[0081] To achieve similarity-based information recommendation, it is necessary to determine the similarity between each first object corresponding to the aforementioned dataset to be processed, and to recommend items to the target object based on the similarity between each object. In this embodiment, after obtaining the aforementioned dataset to be processed, the dataset is first divided into several subsets, and the similarity between each pair of objects in each subset is calculated based on the feature vectors of some first objects in each subset. By dividing the dataset to be processed into several subsets, the amount of computation can be greatly reduced, and the computational cost can be lowered.
[0082] In this context, at least some data in different data subsets do not overlap. Optionally, different dataset subsets may have no data overlap at all, meaning that the feature vector of an object belongs to only one data subset. Alternatively, some data in different data subsets may overlap, meaning that for each data subset, the feature vector of some objects contained in that data subset may also be part of the feature vectors in one or more other data subsets.
[0083] This application does not limit the specific method for calculating the first similarity between the first objects; any scheme based on the feature vectors of the objects can be used. For example, for any two first objects, the cosine similarity between the two feature vectors can be calculated, which is the first similarity between the two objects. Alternatively, the first similarity between the two first objects can also be obtained by calculating the Euclidean distance between their feature vectors.
[0084] After calculating the first similarity between objects corresponding to each data subset, for any object among the n first objects corresponding to the dataset to be processed, the first similarity between this object and the objects corresponding to its data subset (that is, the data subset containing the feature vector of this object) is known, while the similarity between this object and the objects corresponding to data subsets it does not belong to is unknown. At this time, the similarity between objects corresponding to each data subset is incomplete. Since the first similarity between objects corresponding to each data subset is also the similarity between some objects corresponding to the dataset to be processed, after calculating the first similarity between objects corresponding to each data subset, the similarity between each pair of objects among the n first objects can be obtained by data completion based on these known similarities between objects.
[0085] The method provided in this application embodiment calculates the first similarity between first objects by using a distributed computing approach when calculating the first similarity between first objects. Since the calculation of the similarity between feature vectors within each data subset is only required for each subset, and the calculations of different data subsets do not overlap, the calculation of the similarity between each first object corresponding to each data subset can be performed in a distributed computing manner, which can more effectively improve the data computing efficiency.
[0086] Optionally, the information recommendation method provided in this application can be executed by a first electronic device. The above-mentioned method of obtaining the first similarity between each first object in a data subset based on the feature vector of each first object in that data subset can include:
[0087] K data subsets are sent to k second electronic devices respectively. The k second electronic devices calculate the first similarity between the first objects corresponding to their respective data subsets in parallel based on the feature vectors of each first object in their respective data subsets.
[0088] Receive the first similarity between each first object corresponding to each of the k data subsets sent by k second electronic devices.
[0089] Using this method, the first similarity between each first object corresponding to each of the k data subsets can be calculated in parallel by k second electronic devices. Then, the first electronic device can obtain the first similarity between each pair of objects among the n first objects by data completion based on the calculation results of each second electronic device.
[0090] Optionally, in actual implementation, the first electronic device and the k second electronic devices can be multiple servers in a server cluster. The first electronic device can be a master node server, and the k second electronic devices can be child node servers. After dividing the dataset to be processed into k parts, the master node server can distribute these k data subsets to the k child node servers. The k child node servers construct horizontal federated learning for the k data subsets of the dataset to be processed and calculate the similarity data corresponding to each data subset in parallel.
[0091] Understandably, the master node server can also be any of the k child node servers. That is, one of the child node servers is both a master node server and a child node server, and this server performs the calculation of the first similarity between each first object corresponding to a data subset. Optionally, the number of servers performing the first similarity calculation can be less than the number of data subsets. For example, the number of the aforementioned second electronic devices can be *s*, where 2 ≤ *s* < *k*. Each second electronic device calculates similarity data for at least one data subset. For example, if *k* is 10 and *s* is 3, the 10 subsets can be divided into 3 parts, each part including at least one subset. Each second electronic device can calculate the first similarity between objects in each subset of one part. For example, if two data subsets are sent to a second electronic device, the device can process the two subsets separately to obtain the pairwise similarity between each first object corresponding to each subset.
[0092] As an optional aspect of this application, determining the second similarity between the first objects corresponding to the dataset to be processed based on the first similarity between the first objects corresponding to the k data subsets may include:
[0093] Based on the first similarity between each first object corresponding to k data subsets, the second similarity between each first object in the dataset to be processed is predicted by a trained neural network model. The input of the trained neural network model includes the first similarity between each first object corresponding to each data subset, and the output is the second similarity between each first object in the dataset to be processed.
[0094] The trained neural network model is obtained by training the initial neural network model with multiple training samples. Each training sample includes multiple local similarity data, and each local similarity data is the similarity between sample objects in a sample object subset. The input of the initial neural network model is multiple local similarity data in each training sample, and the output is the global similarity data corresponding to each training sample. The global similarity data corresponding to a training sample includes the similarity between all objects in multiple sample object subsets corresponding to that training sample.
[0095] It can be seen that during model training, the local similarity data in a training sample corresponds to the first similarity between each first object in the aforementioned subset of data, and the global similarity data corresponds to the second similarity between each first object in the dataset to be processed. In other words, each local similarity data in a training sample represents the pairwise similarity between a subset of sample objects in a sample set, while the global similarity data represents the pairwise similarity between all objects in that sample set. The initial neural network model can be iteratively trained based on a large number of training samples to obtain a well-trained neural network model capable of data completion. Inputting the missing similarity data into this model allows for the prediction of the completed similarity data. The specific model architecture of the neural network is not limited in this embodiment. Optionally, the neural network model can be a generative network.
[0096] Optionally, the initial network model can be trained using either supervised or unsupervised methods. For example, training samples can be labeled samples, where the labeled data is the true global similarity data corresponding to that training sample. During model training, the training loss can be obtained by calculating the difference between the global similarity data and the labeled data for each training sample output by the model. The model parameters can then be optimized and adjusted based on this training loss, and training can continue. Alternatively, training samples can also be unlabeled samples. During model training, the local similarity data in each training sample can be used as the label data. The training loss is obtained by calculating the difference between these local similarity data and the predicted similarity data corresponding to these local similarity data in the global similarity data of the training samples output by the model. In other words, the similarity between each sample object in the local similarity data is taken as the true similarity between these sample objects. By calculating the difference between the true similarity of these sample objects and the similarity predicted by the model, the model is constrained to learn effectively, ensuring that the similarity predicted by the model is close to the true similarity between these sample objects.
[0097] The method for obtaining training samples is not limited in this application embodiment. Optionally, training samples can be generated by obtaining a large sample dataset, wherein each sample dataset may include feature vectors of multiple sample objects. The sample dataset can be divided into several subsets, and multiple local similarity data are obtained by calculating the similarity between the feature vectors of each sample object in these subsets.
[0098] While using a pre-trained neural network model can achieve data completion, this approach requires a large number of training samples and extensive model training and testing, resulting in high costs. To address this issue, this application provides another solution for similarity completion. In this alternative solution, determining the second similarity between each first object in the dataset to be processed based on the first similarity between each first object corresponding to k data subsets can include:
[0099] For each data subset, a first similarity matrix is constructed based on the first similarity between each first object corresponding to the data subset. The element value of each row in the first similarity matrix is the first similarity between an object corresponding to the data subset and each first object corresponding to the data subset.
[0100] The first similarity matrices corresponding to each data subset are merged to obtain a fusion matrix. The number of rows and columns of the fusion matrix are both n. Each row element in the fusion matrix represents the similarity vector between a first object and each of the n first objects. The similarity vector of a first object includes known element values and missing element values. The known element values are the first similarity values corresponding to the first object.
[0101] The second similarity matrix is obtained by completing the fusion matrix. The element value of each row in the second similarity matrix is the second similarity between one of the n first objects and each of the n first objects.
[0102] In other words, a subset of data corresponds to a first similarity matrix. The number of rows and columns of this matrix are equal to the number of first objects corresponding to the subset, which is the number of feature vectors contained in the subset. Each row of the matrix corresponds to a first object, and the value of each element in a row is the first similarity between the first object corresponding to that row and each first object in the subset. For example, the value of the element in the i-th row and j-th column of the first similarity matrix is the first similarity between the i-th first object and the j-th first object.
[0103] In other words, each row of the first similarity matrix represents a similarity vector of a first object. The dimension of this vector (i.e., the number of element values) equals the number of first objects in the subset. The first element of each row represents the similarity between the first object in that row and the first object in that subset (i.e., the similarity between the feature vector of the first object in that row and the feature vector of the first object in that subset). The second element represents the similarity between the first object in that row and the second object in that dataset (the object corresponding to the element in the second row of the matrix). The elements on the diagonal of the first similarity matrix represent the similarity between each first object in the subset and itself, and all elements on the diagonal have a value of 1. It can be understood that, depending on the arrangement of rows and columns, each column of the first similarity matrix could also represent a similarity vector corresponding to a first object.
[0104] As an example, suppose a subset of data contains L feature vectors of the first object, then the first similarity matrix corresponding to this subset of data can be represented as follows:
[0105]
[0106] Where the first row of elements represents the similarity vector corresponding to the first object among the L first objects, S 11 S represents the similarity between the first object and itself. 1L Let S be the similarity between the first object and the Lth object, and S be the similarity between them. L1 Let S be the similarity between the Lth object and the first object. 1L With S L1 The values are equal, and similarly, S 12 With S 21 The values are also equal, both being the similarity between the first and second objects. This shows that the first similarity matrix is not only a square matrix, but also a symmetric matrix.
[0107] After obtaining the first similarity matrix corresponding to each data subset, since the union of the first objects corresponding to all data subsets (or the union after deduplication if there is overlapping data in different subsets) represents all the first objects corresponding to the dataset to be processed, a global relevance matrix with missing relevance (i.e., the aforementioned fusion matrix) can be obtained by concatenating the various first similarity matrices. Then, by completing this global similarity matrix with missing relevance, a completed second similarity matrix can be obtained. This second similarity matrix represents the pairwise similarity between all first objects corresponding to all subsets. Each row of the second similarity matrix contains a completed feature vector corresponding to a first object, which includes the second similarity between that first object and each of the n first objects. Similarly, the second similarity matrix is also a symmetric square matrix.
[0108] In practical applications, the data in different subsets may not overlap. In this case, the aforementioned fusion matrix can be obtained by concatenating the first similarity matrices of each data subset. Since the first similarity matrix of each data subset represents the first similarity between the feature vectors within that subset and has no data overlap with other subsets outside that subset, when concatenating the first similarity matrices of each data subset, each similarity matrix as a whole can be treated as an element on the main diagonal of the concatenated matrix and placed in the concatenated matrix. The final number of rows and columns of the concatenated matrix is equal to the sum of the number of rows of all the first similarity matrices. The element values in the concatenated matrix, except for the positions occupied by the elements in each of the first similarity matrices, are missing, which are the missing similarities that need to be filled in. Optionally, the element values at the positions with missing values can be set to a preset placeholder, which can be a preset value, another symbol, or even left blank.
[0109] As an example, suppose the dataset to be processed contains n = L + P + T feature vectors of the first object, and there are 3 data subsets, denoted as subset 1, subset 2, and subset 3. The data in the 3 subsets do not overlap. The 3 subsets contain L, P, and T feature vectors of the first object, respectively. The values of L, P, and T can be equal or unequal. The first similarity matrix corresponding to the 3 subsets can be represented as follows:
[0110]
[0111] The fusion matrix corresponding to these three first similarity matrices can then be represented as follows:
[0112]
[0113] The fusion matrix has L+P+T rows and columns. Except for the elements in the first similarity matrix corresponding to the three data subsets, all other elements in the fusion matrix have missing values. The first row of the fusion matrix is the similarity vector of the first object corresponding to subset 1; the first L elements of this row have known values, while the other elements have missing values. The (L+1)th row of the fusion matrix is the similarity vector of the first object corresponding to subset 2.
[0114] In an optional embodiment of this application, different data subsets may also have some overlapping data. If two data subsets have at least one feature vector of the same object, that is, at least one overlapping data, then the similarity between these overlapping data exists in the first similarity matrix of the two data subsets and the similarity is the same. In this case, when obtaining the fusion matrix by fusing the first similarity of multiple data subsets, deduplication processing is required to obtain the concatenated and deduplicated fusion matrix.
[0115] Taking a dataset containing n = L + P + T feature vectors of the first object and three subsets as an example, let's call them subset 1, subset 2, and subset 3. Subset 1 contains L feature vectors of the first object, subset 2 contains P+1 feature vectors of the first object, and subset 3 contains T feature vectors of the first object. Assume that a feature vector of one first object in subset 2 is also included in subset 1, meaning that subsets 1 and 2 share a feature vector of the same first object. The first similarity matrices corresponding to the three subsets can be represented as follows, denoted as matrix 1, matrix 2, and matrix 3:
[0116]
[0117] Assuming the eigenvectors of the first object in subset 1 and the first object in subset 2 are the same object, then the first row elements of matrix 1 and matrix 2 both represent the first similarity scores corresponding to the first object. Matrix 1 includes the first similarity scores between this object and L objects in subset 1, and matrix 2 includes the first similarity scores between this object and P+1 objects in subset 2. The S... 11 S in matrix 2 00 Each value represents the first similarity between the object and itself. For this object, there are L+P known element values (i.e., the first similarity between this object and L+P objects is known). When fusing matrices 1, 2, and 3, duplicate element values need to be deduplicated and concatenated to obtain a fusion matrix with L+P+T rows and columns. This fusion matrix can be represented as follows:
[0118]
[0119] In this matrix, the first row represents the similarity vector corresponding to the first object in subset 1. This vector contains L+P known elements, i.e., S... 11 To S 1,L and S 0,1 To S 0,P , of which S 0,1 To S 0,P The first similarity between this object and the P objects in subset 2 excluding this object is the first similarity. The first column of the fusion matrix represents the similarity between these L+P objects and the first object. 10 To S P,0 This represents the similarity between the P objects in subset 2 (excluding the first object) and the first object. Similarly, the known element values in the fusion matrix are the values of all elements in matrices 1, 2, and 3 after removing duplicates. Other element values are the missing element values. Taking the first L rows of the fusion matrix as an example, the known element values in the first row are the first L+P elements, and the known element values in rows 2 through L are the first L elements of each row. The L*L matrix in the upper left corner of the fusion matrix is actually matrix 1. The known element value in the (L+1)th row of the fusion matrix is the first element value of that row (i.e., S). 10 ) and the values of the (L+1)th to (L+P)th elements in that row (i.e., S) 1,1 To S 1,P ).
[0120] After obtaining a fusion matrix with missing similarity through matrix fusion, a completed second similarity matrix can be obtained through matrix completion. All elements in the second similarity matrix are known element values. Therefore, this matrix contains the similarity between each first object and each of the n first objects.
[0121] As an optional approach, the method of obtaining the second similarity matrix by completing the fusion matrix can include:
[0122] Based on the fusion matrix, initialize a matrix to be optimized, the number of rows and columns of the matrix to be optimized being equal to the fusion matrix mentioned above;
[0123] Initialize the element values of each element in the matrix to be optimized;
[0124] The initialized matrix to be optimized is used as the model parameter of the neural network model to be trained. The optimization operation is repeated on the matrix to be optimized until a preset condition is met. The matrix to be optimized when the preset condition is met is used as the second similarity matrix. The optimization operation includes the following steps:
[0125] Determine the difference between the known element values in the fusion matrix and the corresponding element values in the matrix to be optimized. If the preset conditions are not met, use the difference as the training loss value and adjust the element values in the matrix to be optimized based on the training loss value.
[0126] The optional solution provided in this application utilizes the idea of neural network model training to achieve automatic optimization and adjustment of the matrix. Furthermore, this solution eliminates the need for large-scale model training and testing, enabling rapid and efficient automatic learning of matrix elements to obtain the completed second similarity matrix. The aforementioned matrix to be optimized is equivalent to the weight matrix of the neural network that needs to be optimized and updated. This application does not limit the initialization method of each element value in the matrix to be optimized, and it may include, but is not limited to, the initialization method of model parameters during neural network training. Since the known element values in the fusion matrix are calculated based on the feature vectors of each first object, these known element values can serve as learning targets for the matrix to be optimized during the matrix optimization process, constraining the update of the matrix. Specifically, by calculating the difference between the known element values in the fusion matrix and the corresponding element values in the matrix to be optimized, a gradient descent algorithm can be used to adjust the element values in the matrix to be optimized based on this difference. Then, the difference between the known element values in the fusion matrix and the corresponding element values in the adjusted matrix to be optimized is calculated again to obtain a new difference, and the matrix to be optimized is further adjusted based on this new difference. By repeatedly calculating the difference value and adjusting the matrix to be optimized, a matrix to be optimized that meets the preset conditions is obtained. This matrix to be optimized can then be regarded as the completed second similarity matrix.
[0127] Since the final completed second similarity matrix is a symmetric matrix, when initializing the element values in the matrix to be optimized, the matrix to be optimized can be initialized as a symmetric matrix, which can effectively reduce the number of element values that need to be learned and updated. This application does not limit the specific method for calculating the difference between the matrix to be optimized and the fusion matrix. Optionally, the difference between the two matrices can be obtained by calculating the mean squared error between all known element values at known positions in the fusion matrix and the element values at those positions in the matrix to be optimized. That is, the loss function can be the MSE (mean squared error) function, and the calculated difference value is used as the training loss to adjust the element values in the matrix to be optimized.
[0128] In an optional embodiment of this application, the initialization of the element values of each element in the matrix to be optimized may include:
[0129] Decompose the matrix to be optimized into at least two matrices;
[0130] Initialize the element values of each element in at least two matrices;
[0131] Specifically, the initialized matrix to be optimized is used as the model parameter of the neural network model to be trained. The model parameter includes: using the element values of each of the at least two initialized matrices as model parameters.
[0132] Accordingly, determining the difference between the known element values in the fusion matrix and the element values corresponding to the known element values in the matrix to be optimized can include:
[0133] Based on the element values of each element in the above at least two matrices, determine the element values of each element in the matrix to be optimized;
[0134] Determine the difference between the known element values in the fusion matrix and the corresponding element values in the matrix to be optimized.
[0135] To reduce computational load and improve data processing efficiency, the optional scheme in this application can obtain the completed second similarity matrix through matrix decomposition. Specifically, a matrix to be optimized, whose number of rows and columns is equal to that of the fusion matrix, can be initialized first. This matrix is a symmetric matrix. Before initializing the element values, the matrix to be optimized can be decomposed into at least two matrices. The element values can be initialized on the decomposed matrices. The multiplication of the decomposed matrices yields the matrix to be optimized. Through this matrix decomposition, the optimization and update of the matrix to be optimized can be transformed into operations on the decomposed matrices, effectively simplifying the computational complexity.
[0136] For the first optimization operation, the decomposed matrices are multiplied to obtain the matrix to be optimized with initialized element values. The difference between this matrix and the fusion matrix is calculated, and the element values of the decomposed matrices are adjusted based on this difference to obtain the adjusted matrices. Then, the second optimization operation can be repeated, that is, the adjusted matrices are multiplied to obtain the adjusted matrix to be optimized, and the difference between this matrix and the fusion matrix is calculated, and the decomposed matrices are adjusted again. By repeating the above operation until the preset conditions are met, the final decomposed matrices are obtained. The matrix obtained by multiplying these matrices is the second similarity matrix.
[0137] The preset conditions corresponding to the above matrix optimization operation can be configured according to actual needs, and may include, but are not limited to, the difference between the adjusted matrix to be optimized and the fused matrix being less than a set value, or the number of times the above optimization operation is executed reaching a set number, etc.
[0138] In an optional embodiment of this application, the matrix to be optimized can be expressed by the following expression. Decompose:
[0139]
[0140] in, express eigenmatrix express The covariance matrix, for The transpose of the matrix; at least two matrices in this scheme include the characteristic matrix and the covariance matrix.
[0141] Since the final second similarity matrix is a symmetric matrix, the initial matrix to be optimized can also be a symmetric matrix. Therefore, the matrix to be optimized can be decomposed into its feature matrix and covariance matrix. Using this decomposition method, we can more quickly obtain the matrix that meets the preset conditions. and So at this point This is the second similarity matrix.
[0142] After obtaining the completed second similarity matrix through matrix factorization optimization or neural network model generation, since this matrix contains the similarity between each first object and all other objects in the dataset, information recommendation can be performed based on the second similarity matrix.
[0143] As an optional implementation of this application, the first object can be a candidate recommendation object, and the target recommendation object can be any one of the aforementioned n-1 first objects; the aforementioned information recommendation to the target recommendation object based on the second similarity includes:
[0144] Based on the second similarity between the target recommendation object and each object in the n-1 candidate recommendation objects, at least one first matching object that matches the target recommendation object is determined from the n-1 candidate recommendation objects. The n-1 candidate recommendation objects are each object other than the target recommendation object among the n first objects.
[0145] Get the first item of interest for each first matching object;
[0146] Based on the first item of interest of each first matching object, determine the target recommended item to be recommended to the target recommendation object.
[0147] Based on the method provided in this application, when recommending items to any object A (such as a user of an application), since the similarity between object A and other objects is known, recommendations can be made to object A based on items that other objects are interested in. Optionally, objects among the first objects other than object A with a second similarity greater than a preset value to object A can be identified as objects that match object A, and items that these objects are interested in can be recommended to object A. Optionally, other items among the items that these objects are interested in, besides the known items that object A is interested in, can be recommended to A. For example, if the item to be recommended is a song, and object A has collected songs a and b, songs a and b can be considered songs that object A is interested in. Objects B and C are objects that match object A. Object B is interested in songs a and c, and object C is interested in songs d and e. Songs c, d, and e can be recommended to object A. Alternatively, these songs can be used as candidate recommended songs, and based on the similarity between each candidate recommended song and the songs collected by object A, the songs among the candidate recommended songs that are more similar to the songs collected by object A can be recommended to A.
[0148] As another optional implementation of this application, the first object can be a candidate recommended item; the above-mentioned information recommendation to the target recommended object based on the second similarity can include:
[0149] Obtain at least one second item of interest from the target recommended object, where the second item of interest is an object from the n first objects;
[0150] For each second item of interest, based on the second similarity between the second item of interest and each piece of information in the n-1 candidate recommended items, at least one second matching item is determined from the n-1 candidate recommended items that matches the second item of interest. The n-1 candidate recommended items are each of the n first objects other than the second item of interest.
[0151] Based on the second matching item corresponding to each second item of interest, determine the target recommended item to be recommended to the target recommendation object.
[0152] In this scheme, the calculated second similarity is the similarity between each candidate recommended item. When recommending items to the target object, candidate recommended items with high similarity to items that the object is interested in can be recommended to the object. For example, each candidate recommended item with a second similarity greater than the similarity threshold to the target recommended item can be recommended to the target recommended item. Alternatively, the top N candidate recommended items with high second similarity can be recommended to the target recommended item.
[0153] It is understood that, in practice, the second similarity between each candidate recommended object and the second similarity between each candidate recommended item can be calculated based on the scheme provided in the embodiments of this application. When recommending items, information can be recommended based on the similarity between objects and the similarity between items. For example, for any object, one or more matching objects with high similarity to the object can be filtered based on the similarity between objects. Then, based on the similarity between items, the similarity between the items that the object is interested in and the items that the matching objects are interested in can be known. Items with high similarity to the items that the matching objects are interested in can be recommended to the object. Alternatively, items with high similarity to the items that the object is interested in can be filtered first based on the item similarity, and then items that the objects corresponding to the filtered items are interested in can be recommended to the object based on the similarity between objects.
[0154] The specific method for obtaining the items that the object is interested in is not limited in the embodiments of this application. Optionally, the object's interest in items can be determined based on the object's rating of each item, such as considering items with a rating greater than a threshold as items of interest. Alternatively, the object's evaluation information on each item can be obtained to predict whether an item is an item of interest to the object.
[0155] The information recommendation method provided in this application can be applied to any information recommendation scenario. The recommended items can be any type of data, the specific type of data depending on the application scenario. For applications providing multimedia data services, the recommended items can be multimedia data, such as news, entertainment information, music, and videos. For online shopping scenarios, the recommended items can be goods. Based on the method provided in this application, the similarity between candidate recommended items or candidate recommended objects can be calculated efficiently, thus providing a foundation for information recommendation. Especially in information recommendation services with large-scale data, it can effectively reduce the waste of computing resources and low computing efficiency caused by calculating the similarity between large-scale data, and can better meet the practical application needs in various scenarios.
[0156] To better illustrate the solution provided in this application and its practical value, an optional embodiment of this application is described below in conjunction with a specific application scenario. This application scenario is a song recommendation scenario. Users of song-related applications can listen to and favorite songs through the application running on their user terminals. Optionally, depending on the product's configuration strategy, they can also download songs and rate them, etc.
[0157] Figure 2This embodiment shows a schematic diagram of the structure of a song recommendation system. Figure 2 As shown, the song recommendation system may include an application server 110 for song-related applications and user terminals. The application server 110 is the server for the song-related applications, and the user terminals are the terminals running the applications. There may be multiple user terminals. Figure 3 The diagram schematically illustrates a first terminal 121 of object 1 and a second terminal 122 of object 2. Each user terminal and the application server 110 can communicate via a wired or wireless network. User terminals can listen to songs online, search for songs based on keywords, and save favorite songs, or listen to locally stored songs offline. Optionally, the application can also provide users with a song rating function, allowing users to evaluate and rate songs based on their own perceptions. Optionally, the application can also provide users with song preference settings, allowing users to set their preferred song attributes, such as song genre, through this option in the application's user interface.
[0158] Figure 5 This diagram illustrates a song recommendation method in this scenario embodiment. The following section combines... Figure 2 The song recommendation system shown and Figure 5 The implementation process shown illustrates the information recommendation method provided in the embodiments of this application. For example... Figure 5 As shown, the song recommendation process may include the following steps:
[0159] Step S21: The application server obtains the song similarity matrix and song rating.
[0160] In this scenario embodiment, the first object is the candidate recommended item, which is the song in the song library corresponding to the song application. The song similarity matrix includes the similarity between all pairs of songs in the song library (second similarity). Song ratings can be the ratings given by each user of the application to the songs in the application's song library. For a user, the song ratings for that user may or may not exist, and if they exist, it may only be that user's ratings for some songs. If some users do not rate certain songs, the user ratings for those songs can be left blank. Optionally, the rating data for each song by each user can be stored in an object database.
[0161] Step S22: Based on song ratings and song similarity matrices, determine the songs that the target object may be interested in.
[0162] Step S23: Generate a recommended playlist based on potentially interesting songs.
[0163] Step S24: Push the recommended playlist to the target user's terminal.
[0164] The target audience can be any user of the application. Based on the user's ratings of various songs and a song similarity matrix, one or more songs that the user might be interested in can be selected from the song library. Optionally, if the user's rating of at least one song is known, the user's ratings for other songs can be predicted based on the user's rating of that song and the similarity between that song and other songs in the song similarity matrix (e.g., for any song 'a' with an unknown rating, the similarity between song 'b' with a known rating and song 'a' can be multiplied by song 'b''s rating to obtain song 'a''s rating). One or more songs of interest can then be selected based on the ratings. If the user's ratings for multiple songs are known, for each song with an unknown rating, the rating corresponding to each known-rated song can be calculated based on the rating of each known-rated song and the similarity between the unknown-rated song and each known-rated song. The final rating for the unknown song can be obtained by averaging the multiple ratings corresponding to the unknown-rated song or by using other weighted summations. For example, based on a user's attribute information, their preference for different types of songs can be determined. Based on this preference, the weight of each song type corresponding to the user can be determined. After calculating the scores of a song with an unknown rating for each song with a known rating, the weight of each song can be determined based on its type. This weight is then used to weight and sum the scores to obtain the final score of the unknown song. As an example, assuming a user's scores for songs a and b are known, for any song c in the song library, a score s1 can be calculated based on the similarity between song c and song a, and the rating of song a. A score s2 can be calculated based on the similarity between song c and song b, and the rating of song b. The average of scores s1 and s2 can be used as the user's score for song c.
[0165] After calculating a user's ratings for all songs based on a song similarity matrix, a certain number of songs with high ratings can be identified as potential songs of interest. Songs from these potential songs that were not previously recommended to the user can then be selected as the final recommended songs. A recommended playlist is generated and sent to the user's device for display. Figure 2 As shown, recommended songs can be displayed on the user interface of the user terminal. Optionally, if a user's ratings for all songs are unknown, songs with higher ratings from other users with high similarity to that user can be recommended based on that user's similarity to other users.
[0166] In this scenario embodiment, the song similarity matrix (i.e., the second similarity matrix) is calculated based on the song's feature vectors. The song similarity matrix can be calculated by the application server, or it can be calculated by other computer devices and then provided to the application server. Figure 3 This illustration shows a schematic diagram of the architecture of a distributed computing system in this scenario embodiment, such as... Figure 3 As shown, the distributed computing system includes a server cluster, which includes a master node server M and several child node servers P. Optionally, the server cluster can be a cloud server cluster. Using this distributed computing system, the song similarity matrix can be calculated through distributed computing.
[0167] Figure 4 This illustration shows a flowchart of an information recommendation method based on a distributed computing system according to an embodiment of this application. The process can be divided into seven stages: data input, data segmentation, distributed data subset similarity calculation, similarity missing matrix construction, similarity matrix decomposition, similarity matrix fitting, and similarity recommendation. Step S21 can include the first six stages of these seven stages, as detailed below:
[0168] Data Input Stage: This stage involves acquiring the data used to calculate the song similarity matrix. In this embodiment, the input data for song recommendation is a large-scale dataset {Y,X} of a song application, where Y represents the target variable vector in the large-scale dataset, and X represents the feature vector in the large-scale dataset. The target variable vector Y may include rating vectors corresponding to each user of the application. For any user, the rating vector may include the user's ratings for various songs in the song library. If the user's ratings for some songs cannot be obtained, the user's ratings for these songs may be set to null or other set identifiers (such as null). This application does not limit the method of obtaining song ratings; it may be a direct rating obtained with the user's authorization and consent, or it may be obtained based on the user's evaluation information of the songs.
[0169] X is the dataset to be processed in this embodiment, which is the feature vector of each song in the song library, i.e., the vector representation of the song. Each song's feature vector can include multiple feature values of different dimensions. Optionally, the song vector can be obtained based on relevant data of multiple dimensions of the song. Relevant data may include, but is not limited to, the song's behavioral features, song rating, and song item features. Optionally, behavioral features may include: user actions such as clicking, adding to favorites, playing, canceling playback, rating, liking, pausing, stopping, playback duration, and number of plays. A song's rating can be obtained based on the ratings given by various users, such as the average rating given by all users. Song item features may include, but are not limited to: average clicks, average favorites, average plays, average rating, like rate, average playback duration, average number of plays, song style, etc.
[0170] Optionally, in a large-scale dataset {Y,X}, both Y and X can be matrices. Assuming there are n songs in the song library, r users, and the feature vector of each song has a dimension of m, then Y can be an n x r matrix. Each row of this matrix corresponds to a song, and the element value of each row is the rating given by each user for that song. If the ratings for some users are unknown, they can be null. For example, the first row of this matrix could represent the rating vector for the first song, with the first element being the rating given by the first user out of r users, and the second element being the rating given by the second user. X can be an n x m matrix, where each row corresponds to a song, and each row has m elements, which constitute the feature vector of that song.
[0171] Data partitioning stage: This stage is used to divide the obtained large-scale dataset {Y,X} into multiple data subsets.
[0172] Optionally, the large-scale dataset {Y,X} can be divided into k equal parts by rows (resulting in k subsets of data), each subset having a dimension of [n / k]×m, where [n / k] represents the number of songs in each subset, and m is the dimension of the feature vector of each song. This means dividing the n x m matrix X into k smaller matrices, each with [n / k] rows and the same number of columns. Similarly, the matrix Y can also be divided into k smaller matrices, each containing ratings from all users for each song in a subset of the dataset.
[0173] It should be noted that in actual implementation, the range of values for the quantity in each subset can be configured according to requirements, that is, the range of values for [n / k]. Optionally, if the large-scale dataset {Y,X} can be divided exactly equally, it can be divided into k parts. If it cannot be divided exactly equally, the maximum difference between different subsets can be configured as an option, namely z≤[n / k]≤z+1, where z can be any positive number. Based on this partitioning rule, the amount of data in the k subsets is basically the same, and the difference in the amount of data in different subsets will not exceed 1, so that the amount of data in different subsets is basically the same, all between z and z+1.
[0174] Each partitioned dataset can be represented as: {Y1, X1} [m / k]×m {Y2,X2} [n / k]×m ,…,{Y k ,X k} [n / k]×m , with {Y1,X1} [n / k]×m For example, X1 represents the feature vectors of the [n / k] songs corresponding to the first subset of the dataset, and Y1 represents the ratings of each user for these [n / k] songs.
[0175] Distributed data subset similarity calculation stage: This stage is based on the k partitioned data sets, and uses a distributed computing method to calculate the missing similarity matrix, that is, the first similarity matrix corresponding to each subset of data sets.
[0176] like Figure 3 As shown, the server cluster can include k cloud servers. After obtaining k partitioned data, the k data partitions can be distributed among the k cloud servers, where the data subset {Y1, X1} [n / k]×m It can be uploaded to the master worker (master node server). Figure 3 In the master node M, the other k-1 data subsets can be stored in the post worker (child node server). Figure 3 Child nodes P1, ..., child nodes P k-1 In other words, k cloud servers can each process a subset of data, and build horizontal federated learning on these subsets.
[0177] Optional, Figure 2The application server 110 and the master node server in the server cluster can be the same server or different servers. When the application server 110 and the master node server are the same server, the master node server can perform the above-mentioned large-scale dataset partitioning operation and distribute the partitioned k-1 subsets of the dataset to k-1 child node servers. The master node server processes the remaining subset. The master node server and the application server 110 can also be different servers. The application server 110 can distribute the partitioned k subsets of the dataset to k cloud servers, including the master node server.
[0178] like Figure 3 As shown, application server 10 can send data subset 1 to master node M, data subset 2 to child node P1, and data subset k to child node P2. k-1 Each server in the server cluster has a subset of data. For each server, it can calculate the similarity within that subset, that is, the similarity between any two songs within that subset. This can be obtained by calculating the similarity between the feature vectors of any two songs within that subset. k servers construct a horizontal federated learning mechanism using these k subsets of data, obtaining a similarity matrix {Ξ} for each subset. i |i=1,...,k}, where Ξ i Let represent the first similarity matrix corresponding to the i-th data subset within the k data subsets. The first similarity matrix is an [n / k] × [n / k] matrix. Optionally, the similarity between songs can be calculated using the following formula:
[0179]
[0180] in, and Let represent the feature vectors of the l-th row and the j-th row of the data subset in the i-th server, respectively. Let be the similarity between these two feature vectors, that is, the similarity between the song corresponding to the l-th row and the song corresponding to the j-th row.
[0181] Suppose a subset of data has a dimension of 4*m, this subset can be represented as follows:
[0182]
[0183] Then, [a11…a1m] represents the feature vector of the first song in this subset, and the dimension of the feature vector is m. The similarity matrix corresponding to this subset can be represented as follows:
[0184]
[0185] Where Sij represents the similarity between the i-th and j-th songs in the subset, and one row of the similarity matrix represents the similarity between the first song in the subset and the four songs in the subset. For example, S11 represents the similarity between the first song and the first song, and S12 represents the similarity between the first song and the second song in the subset. Where Sii = 1.
[0186] Similarity Missing Matrix Construction Stage: The input to this stage is the similarity matrix {Ξ} corresponding to each data subset obtained in the distributed data subset similarity calculation stage. i For |i=1,...,k}, by concatenating k similarity matrices, we can obtain the similarity missing matrix R, which is also the fusion matrix. The similarity missing matrix R is an n×n matrix, which can be represented as follows:
[0187]
[0188] Assuming k=3, and each data subset has a dimension of 4*m, the similarity matrices corresponding to these 3 data subsets can be represented as follows:
[0189]
[0190] The similarity missing matrix R obtained by concatenating these three similarity matrices can be expressed as:
[0191]
[0192] The matrix R is a 12×12 square matrix. Apart from the element values (known element values) in the similarity matrix corresponding to the three data subsets shown above, all other element values in this matrix are missing element values.
[0193] Similarity Matrix Decomposition Stage: This stage constructs the similarity matrix to be solved (the matrix to be optimized) based on the missing similarity matrix R (the fusion matrix that needs to be completed). The matrix to be optimized is a symmetric matrix with the number of rows and columns equal to the number of rows and columns of matrix R. It can be constructed and solved using matrix decomposition. The matrix decomposition model can be represented as follows:
[0194]
[0195] Among them, matrix Let U represent the matrix to be optimized. The eigenmatrix, Ω represents The covariance matrix can be initialized by setting the values of each element in matrices U and Ω. The specific initialization method is not limited in this application. Alternatively, the known elements in the similarity missing matrix R can be kept unchanged. The matrix to be optimized can be obtained by initializing the missing elements in the similarity missing matrix R. (This matrix can remain a symmetric matrix). Through the matrix decomposition model described above, we can obtain the characteristic matrix U and the covariance matrix Ω after initializing the element values.
[0196] Similarity matrix fitting stage: This stage is based on the missing similarity matrix R to realize the matrix to be optimized. The optimized fit is used to obtain the completed second similarity matrix, which includes the similarity between each song and every song in the song library.
[0197] In this embodiment of the application, the similarity matrix can be optimized and fitted based on the idea of neural network model training. Optionally, the loss function of the similarity matrix can be the following function J:
[0198] J=(R-UΩU T ) T (R-UΩU T )
[0199] UΩU T That is, the matrix that needs to be optimized. Based on this loss function, the estimated value of the similarity feature matrix can be obtained under the condition of minimum loss. (U when the loss is minimized) and covariance matrix estimate (Ω when the loss is minimized), thus obtaining the estimated value of the completed similarity matrix. (Second similarity matrix).
[0200] Specifically, in each optimization process, the element values in matrices U and Ω are treated as model parameters to be optimized, and R and the current UΩU are calculated. T If the loss function does not converge (or is not less than the set value), the element values in U and Ω can be adjusted using the gradient descent algorithm based on the loss value. Then, the optimization process described above is repeated, i.e., the adjusted UΩU is calculated. T The loss between U and R is calculated by repeatedly performing the above process until the loss function converges. The values of U and Ω at convergence are then taken as the final values. and This yields the final song similarity matrix.
[0201] After obtaining the final non-missing similarity matrix Afterwards, the application server can use this matrix to perform similarity-based song recommendations, thus entering the similarity recommendation stage. Optionally, after obtaining the similarity scores of non-missing songs... Next, based on this matrix and the known user ratings for songs in the song library (i.e., the target variable vector mentioned earlier), a target rating matrix can be calculated. Each row in this matrix corresponds to a user, and each column corresponds to a song. The element in each row represents a user's rating of each song in the song library. For any given user, recommendations can be made in descending order of their ratings. In other words, when making recommendations for a user, the system can use the user's ratings for one or more songs and the song similarity matrix to support these recommendations. The similarity between songs is used to determine the ratings of other songs with unknown ratings, and then high-rated songs are recommended to users.
[0202] It should be noted that the song recommendation scenario described above uses songs from the song library as the primary object. In practical applications, the primary object can also be the various users of the application, and the dataset to be processed can be the feature vectors of each user. Correspondingly, the non-missing similarity matrix is calculated. This could be a user similarity matrix, including the similarity between any two users. In this case, song recommendations can be made based on the similarity between users. For example, the completed matrix is a user similarity matrix. When making recommendations to a user, other users with high similarity to that user can be found based on the similarity matrix. Based on the ratings of other users for various songs, songs with high ratings corresponding to those other users can be recommended to that user.
[0203] The information recommendation method provided in this application embodiment can be applied to any information recommendation scenario, including but not limited to the song recommendation mentioned above. This recommendation method can, based on various feature data (feature vectors) of the first object, compute the relevance sub-matrix (first similarity matrix) of each server sub-cluster in parallel across k servers using a distributed computing approach, and then upload each relevance sub-matrix to a cloud server for merging (e.g., ...). Figure 3 In the example shown, k servers in the server cluster send their calculated similarity matrices to the application server. For example, the master node M sends the similarity matrix 1 corresponding to data subset 1 to the application server, and the child node P1 sends the similarity matrix 2 corresponding to data subset 2 to the application server. This results in an overall relevance matrix with missing relevance (the aforementioned missing similarity matrix R). The matrix is then used to optimize the matrix to obtain the final completed non-missing similarity matrix.
[0204] The solution adopted in this application can effectively solve the problem of large-scale computation required for relevance calculation. Optionally, applying the above-mentioned distributed matrix factorization technique in relevance recommendation can effectively solve the problems of resource consumption and downtime caused by excessive data volume and complex data iteration in large-scale data relevance calculation in relevance recommendation algorithms. It can also effectively improve the algorithm's computational performance with minimal loss through matrix factorization technique.
[0205] In the optional implementation of this application, the feature matrix of the relevance matrix is obtained by matrix decomposition of the relevance matrix. This can effectively utilize the advantages of the original similarity matrix without the need for large-scale training and testing of the model. It can effectively solve the problems of wasted computing resources and low computing efficiency caused by large-scale similarity calculations in similarity-based recommendation applications, and can effectively improve computing efficiency, especially in similarity recommendation business with large-scale data.
[0206] Based on the same principle as the information recommendation method provided in the embodiments of this application, the embodiments of this application also provide an information recommendation device, such as... Figure 6 As shown, the information recommendation device 100 may include a source data acquisition module 110, a data segmentation and processing module 120, and a processing result acquisition module 130. Wherein:
[0207] The source data acquisition module 110 is used to acquire the dataset to be processed. The dataset to be processed includes n feature vectors of the first object. The first object is a candidate recommendation object or a candidate recommended item, and n≥2.
[0208] The data segmentation processing module is used to divide the dataset to be processed into k data subsets. For each data subset, based on the feature vector of each first object in the data subset, the first similarity between each first object in the data subset is obtained, k≥2.
[0209] The processing result acquisition module is used to determine the second similarity between each first object in the dataset to be processed based on the first similarity between each first object corresponding to k data subsets, so as to recommend information to the target recommendation object based on the second similarity.
[0210] Optionally, the aforementioned information recommendation device is a device within the first electronic device, and the data segmentation processing module can be used for:
[0211] K data subsets are sent to k second electronic devices respectively. The k second electronic devices calculate the first similarity between the first objects corresponding to their respective data subsets in parallel based on the feature vectors of each first object in their respective data subsets.
[0212] Receive the first similarity between each first object corresponding to each subset of data sent by k second electronic devices.
[0213] Optionally, the result acquisition module can be used to perform the following operations:
[0214] For each data subset, a first similarity matrix is constructed based on the first similarity between each first object corresponding to the data subset. The element value of each row in the first similarity matrix is the first similarity between an object corresponding to the data subset and each first object corresponding to the data subset.
[0215] The first similarity matrices corresponding to each data subset are merged to obtain a fusion matrix. The number of rows and columns of the fusion matrix are both n. Each row element in the fusion matrix represents the similarity vector between a first object and each of the n first objects. The similarity vector of a first object includes known element values and missing element values. The known element values are the first similarity values corresponding to the first object.
[0216] The second similarity matrix is obtained by completing the fusion matrix. The element value of each row in the second similarity matrix is the second similarity between one of the n first objects and each of the n first objects.
[0217] Optionally, the processing result acquisition module can be used to: initialize a matrix to be optimized based on the fusion matrix, wherein the number of rows and columns of the matrix to be optimized is equal to that of the fusion matrix; initialize the element values of each element in the matrix to be optimized; use the initialized matrix to be optimized as the model parameters of the neural network model to be trained; repeatedly perform the optimization operation on the matrix to be optimized until a preset condition is met; and use the matrix to be optimized when the preset condition is met as the second similarity matrix. The optimization operation includes the following steps:
[0218] Determine the difference between the known element values in the fusion matrix and the corresponding element values in the matrix to be optimized. If the preset conditions are not met, use the difference as the training loss value and adjust the element values in the matrix to be optimized based on the training loss value.
[0219] Optionally, the processing result acquisition module can be used to: decompose the matrix to be optimized into at least two matrices; and initialize the element values of each element in each of the at least two matrices;
[0220] The use of the initialized matrix to be optimized as the model parameter of the neural network model to be trained includes: using the element values of each of the above at least two initialized matrices as the model parameter of the neural network model to be trained.
[0221] When determining the difference between the known element values in the fusion matrix and the corresponding element values in the matrix to be optimized, the processing result acquisition module can be used for:
[0222] Based on the element values of each element in at least two matrices, determine the element values of each element in the matrix to be optimized; determine the difference between the known element values in the fusion matrix and the element values corresponding to the known element values in the matrix to be optimized.
[0223] Optionally, the processing result acquisition module can be used to: obtain the matrix to be optimized through the following expression. Decompose:
[0224]
[0225] in, express eigenmatrix express The covariance matrix, for The transpose of the matrix; the matrix decomposition yields at least two matrices, including the eigenvalue matrix and the covariance matrix.
[0226] Optionally, the processing result acquisition module can be used to: based on the first similarity between each first object corresponding to k data subsets, predict the second similarity between each first object corresponding to the dataset to be processed through a trained neural network model;
[0227] The trained neural network model is obtained by training the initial neural network model based on multiple training samples. Each training sample includes multiple local similarity data, and each local similarity data includes the similarity between sample objects in a subset of sample objects.
[0228] The input to the initial neural network model is multiple local similarity data in each training sample, and the output is global similarity data corresponding to each training sample. The global similarity data corresponding to a training sample includes the pairwise similarities between all objects in multiple sample object subsets corresponding to that training sample.
[0229] Optionally, after determining the second similarity between each first object in the dataset to be processed, the information recommendation module can recommend information to the target recommendation object based on the second similarity between each first object in the dataset to be processed.
[0230] Optionally, the first object is a candidate recommendation object, and the target recommendation object is any one of the n first objects. The above information recommendation module can be used for:
[0231] Based on the second similarity between the target recommendation object and each object in the n-1 candidate recommendation objects, at least one matching object that matches the target recommendation object is determined from the n-1 candidate recommendation objects. The n-1 candidate recommendation objects are each object other than the target recommendation object among the n first objects.
[0232] Get the first item of interest for each matched object;
[0233] Based on the first item of interest of each matched object, determine the target recommended item to be recommended to the target recommended object.
[0234] Optionally, the first object is the candidate recommended item, and the above information recommendation module can be used for:
[0235] Obtain at least one second item of interest from the target recommended object, where the second item of interest is an object from the n first objects;
[0236] For each second item of interest, based on the second similarity between the second item of interest and each piece of information in the n-1 candidate recommended items, at least one matching item that matches the second item of interest is determined from the n-1 candidate recommended items. The n-1 candidate recommended items are each of the n first objects other than the second item of interest.
[0237] Based on the matching items corresponding to each second item of interest, determine the target recommended item to be recommended to the target recommendation object.
[0238] The apparatus in this application embodiment can execute the method provided in this application embodiment, and the implementation principle is similar. The actions performed by each module in the apparatus of each embodiment of this application correspond to the steps in the method of each embodiment of this application. For detailed functional descriptions of each module of the apparatus, please refer to the descriptions in the corresponding methods shown above, which will not be repeated here.
[0239] This application provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory. When the processor executes the computer program stored in the memory, it can implement the method in any optional embodiment of this application.
[0240] Figure 7 A schematic diagram of the structure of an electronic device to which an embodiment of the present invention applies is shown, such as... Figure 7 As shown, the electronic device can be a server or a user terminal, and it can be used to implement the methods provided in any embodiment of the present invention.
[0241] like Figure 7 As shown, the electronic device 2000 may primarily include at least one processor 2001. Figure 7The diagram shows components such as a memory 2002, a communication module 2003, and an input / output interface 2004. Optionally, these components can be connected and communicate with each other via a bus 2005. It should be noted that... Figure 7 The structure of the electronic device 2000 shown is merely illustrative and does not constitute a limitation on the electronic devices to which the methods provided in the embodiments of this application are applicable.
[0242] The memory 2002 can be used to store operating systems and applications, etc. The applications can include computer programs that implement the methods shown in the embodiments of the present invention when invoked by the processor 2001, and can also include programs for implementing other functions or services. The memory 2002 can be ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, RAM (Random Access Memory) or other types of dynamic storage devices that can store information and computer programs, or it can be EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disk storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto.
[0243] Processor 2001 is connected to memory 2002 via bus 2005, and implements corresponding functions by calling application programs stored in memory 2002. Processor 2001 can be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this invention. Processor 2001 can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0244] Electronic device 2000 can connect to a network via communication module 2003 (which may include, but is not limited to, components such as a network interface) to communicate with other devices (such as user terminals or servers) through the network and achieve data interaction, such as sending data to or receiving data from other devices. Communication module 2003 may include wired network interfaces and / or wireless network interfaces, meaning the communication module may include at least one of wired or wireless communication modules.
[0245] Electronic device 2000 can connect to required input / output devices, such as keyboards and display devices, via input / output interface 2004. Electronic device 2000 itself may have a display device, and other display devices can also be connected externally via interface 2004. Optionally, storage devices, such as hard drives, can also be connected via interface 2004 to store data from electronic device 2000, retrieve data from storage devices, or store data from storage devices into memory 2002. It is understood that input / output interface 2004 can be a wired interface or a wireless interface. Depending on the actual application scenario, the device connected to input / output interface 2004 can be a component of electronic device 2000 or an external device connected to electronic device 2000 when needed.
[0246] The bus 2005 used to connect the various components may include a pathway for transmitting information between these components. The bus 2005 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Depending on its function, the bus 2005 can be divided into address bus, data bus, control bus, etc.
[0247] Optionally, for the solution provided in the embodiments of the present invention, the memory 2002 can be used to store a computer program that executes the solution of the present invention, and the processor 2001 runs the computer program. When the processor 2001 runs the computer program, it implements the operation of the method or apparatus provided in the embodiments of the present invention.
[0248] Based on the same principle as the method provided in the embodiments of this application, the embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, can implement the corresponding content of the aforementioned method embodiments.
[0249] This application also provides a computer program product, which includes a computer program that, when executed by a processor, can implement the corresponding content of the aforementioned method embodiments.
[0250] It should be noted that the terms "first," "second," "third," "fourth," "1," "2," etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in a sequence other than that shown in the figures or text.
[0251] It should be understood that although arrows indicate various operation steps in the flowcharts of this application's embodiments, the order in which these steps are implemented is not limited to the order indicated by the arrows. Unless explicitly stated herein, in some implementation scenarios of this application's embodiments, the implementation steps in each flowchart can be executed in other orders as required. Furthermore, some or all steps in each flowchart, based on the actual implementation scenario, may include multiple sub-steps or multiple stages. Some or all of these sub-steps or stages can be executed at the same time, and each sub-step or stage can also be executed at different times. In scenarios where execution times differ, the execution order of these sub-steps or stages can be flexibly configured according to requirements, and this application's embodiments do not limit this.
[0252] The above description is only an optional implementation method for some implementation scenarios of this application. It should be noted that for those skilled in the art, other similar implementation methods based on the technical concept of this application without departing from the technical concept of this application also fall within the protection scope of the embodiments of this application.
Claims
1. An information recommendation method, characterized in that, The method includes: Obtain the dataset to be processed, which includes n feature vectors of a first object, where the first object is a candidate recommendation object or a candidate recommended item, and n≥2; The dataset to be processed is divided into k subsets, where k ≥ 2; For each data subset, based on the feature vector of each first object in the data subset, the first similarity between each first object corresponding to the data subset is obtained; Based on the first similarity between each first object corresponding to k data subsets, data completion is performed through a trained neural network model to predict the second similarity between each first object in the dataset to be processed and each of the n first objects, so as to recommend items to the target recommendation object based on the second similarity; The trained neural network model is obtained by training an initial neural network model based on multiple training samples. Each training sample includes multiple local similarity data, and each local similarity data includes the similarity between sample objects in a subset of sample objects. The input to the initial neural network model is multiple local similarity data in each training sample, and the output is global similarity data corresponding to each training sample. The global similarity data corresponding to a training sample includes pairwise similarities between all objects in multiple sample object subsets corresponding to that training sample.
2. The method according to claim 1, characterized in that, The method is executed by a first electronic device, wherein for each data subset, obtaining a first similarity between the first objects corresponding to that data subset based on the feature vectors of each first object in that data subset includes: The k data subsets are sent to k second electronic devices respectively, and the k second electronic devices calculate in parallel the first similarity between the first objects corresponding to their respective data subsets based on the feature vectors of each first object in their respective data subsets. Receive the first similarity between each first object corresponding to each data subset sent by the k second electronic devices.
3. The method according to claim 1, characterized in that, The step of predicting a second similarity between each first object in the dataset to be processed and each of the n first objects is obtained by using a trained neural network model to complete the data based on the first similarity between each first object in the dataset to be processed and each of the n first objects, including: For each data subset, a first similarity matrix is constructed based on the first similarity between each first object corresponding to the data subset, wherein the element value of each row of the first similarity matrix is the first similarity between an object corresponding to the data subset and each first object corresponding to the data subset. The first similarity matrices corresponding to each of the data subsets are fused to obtain a fusion matrix, wherein the number of rows and columns of the fusion matrix are both n. Each row element in the fusion matrix represents a similarity vector between a first object and each of the n first objects. The similarity vector of a first object includes known element values and missing element values. The known element values are the first similarity values corresponding to the first object. The second similarity matrix is obtained by completing the fusion matrix. The element value of each row in the second similarity matrix is the second similarity between one of the n first objects and each of the n first objects.
4. The method according to claim 3, characterized in that, The step of completing the fusion matrix to obtain the second similarity matrix includes: Based on the fusion matrix, an optimization matrix is initialized, wherein the number of rows and columns of the optimization matrix are equal to the fusion matrix; The element values of each element in the matrix to be optimized are initialized; The initialized matrix to be optimized is used as the model parameter of the neural network model to be trained. The optimization operation is repeatedly performed on the matrix to be optimized until a preset condition is met. The matrix to be optimized when the preset condition is met is used as the second similarity matrix. The optimization operation includes the following steps: The difference between the known element values in the fusion matrix and the element values corresponding to the known element values in the matrix to be optimized is determined. If the preset condition is not met, the difference value is used as the training loss value, and the element values in the matrix to be optimized are adjusted based on the training loss value.
5. The method according to claim 4, characterized in that, The initialization of the element values of each element in the matrix to be optimized includes: Decompose the matrix to be optimized into at least two matrices; The element values of each element in each of the at least two matrices are initialized; The step of using the initialized matrix to be optimized as the model parameter of the neural network model to be trained includes: using the element values of each of the at least two initialized matrices as the model parameter of the neural network model to be trained. Determining the difference between the known element values in the fusion matrix and the element values corresponding to the known element values in the matrix to be optimized includes: Based on the element values of each element in the at least two matrices, determine the element values of each element in the matrix to be optimized; Determine the difference between the known element values in the fusion matrix and the element values corresponding to the known element values in the matrix to be optimized.
6. The method according to claim 5, characterized in that, The step of decomposing the matrix to be optimized into at least two matrices includes: The matrix to be optimized is expressed by the following expression. Decompose: in, express eigenmatrix express The covariance matrix, for The transpose of the matrix; the at least two matrices include the characteristic matrix and the covariance matrix.
7. The method according to any one of claims 1 to 6, characterized in that, The first object is a candidate recommendation object, and the target recommendation object is any one of the n first objects; the step of recommending information to the target recommendation object based on the second similarity includes: Based on the second similarity between the target recommendation object and each of the n-1 candidate recommendation objects, at least one matching object that matches the target recommendation object is determined from the n-1 candidate recommendation objects. The n-1 candidate recommendation objects are each of the n first objects other than the target recommendation object. Obtain the first item of interest for each of the matched objects; Based on the first item of interest of each of the matched objects, the target recommended item is determined to be recommended to the target recommendation object.
8. The method according to any one of claims 1 to 6, characterized in that, The first object is a candidate recommended item; the step of recommending information to the target recommended object based on the second similarity includes: Obtain at least one second item of interest from the target recommended object, wherein the second item of interest is an object among the n first objects; For each second item of interest, based on the second similarity between the second item of interest and each piece of information in the n-1 candidate recommended items, at least one matching item that matches the second item of interest is determined from the n-1 candidate recommended items, wherein the n-1 candidate recommended items are each of the n first objects other than the second item of interest; Based on the matching items corresponding to each of the second items of interest, the target recommended items are determined to be recommended to the target recommendation object.
9. An information recommendation device, characterized in that, include: The source data acquisition module is used to acquire the dataset to be processed, which includes n feature vectors of a first object, where the first object is a candidate recommendation object or a candidate recommended item, and n≥2; The data segmentation processing module is used to divide the dataset to be processed into k data subsets. For each data subset, based on the feature vector of each first object in the data subset, the first similarity between each first object in the data subset is obtained, where k≥2. The processing result acquisition module is used to perform data completion through a trained neural network model based on the first similarity between each first object corresponding to k data subsets, predict the second similarity between each first object in the dataset to be processed and each of the n first objects, and recommend information to the target recommendation object based on the second similarity. The trained neural network model is obtained by training an initial neural network model based on multiple training samples. Each training sample includes multiple local similarity data, and each local similarity data includes the similarity between sample objects in a subset of sample objects. The input to the initial neural network model is multiple local similarity data in each training sample, and the output is global similarity data corresponding to each training sample. The global similarity data corresponding to a training sample includes pairwise similarities between all objects in multiple sample object subsets corresponding to that training sample.
10. The apparatus according to claim 9, characterized in that, The information recommendation device is deployed in the first device, and the data segmentation and processing module is used for: The k data subsets are sent to k second electronic devices respectively, and the k second electronic devices calculate in parallel the first similarity between the first objects corresponding to their respective data subsets based on the feature vectors of each first object in their respective data subsets. Receive the first similarity between each first object corresponding to each data subset sent by the k second electronic devices.
11. The apparatus according to claim 9, characterized in that, The processing result acquisition module is used for: For each data subset, a first similarity matrix is constructed based on the first similarity between each first object corresponding to the data subset, wherein the element value of each row of the first similarity matrix is the first similarity between an object corresponding to the data subset and each first object corresponding to the data subset. The first similarity matrices corresponding to each of the data subsets are fused to obtain a fusion matrix, wherein the number of rows and columns of the fusion matrix are both n. Each row element in the fusion matrix represents a similarity vector between a first object and each of the n first objects. The similarity vector of a first object includes known element values and missing element values. The known element values are the first similarity values corresponding to the first object. The second similarity matrix is obtained by completing the fusion matrix. The element value of each row in the second similarity matrix is the second similarity between one of the n first objects and each of the n first objects.
12. The apparatus according to claim 11, characterized in that, The processing result acquisition module is used for: Based on the fusion matrix, an optimization matrix is initialized, wherein the number of rows and columns of the optimization matrix are equal to the fusion matrix; The element values of each element in the matrix to be optimized are initialized; The initialized matrix to be optimized is used as the model parameter of the neural network model to be trained. The optimization operation is repeatedly performed on the matrix to be optimized until a preset condition is met. The matrix to be optimized when the preset condition is met is used as the second similarity matrix. The optimization operation includes the following steps: The difference between the known element values in the fusion matrix and the element values corresponding to the known element values in the matrix to be optimized is determined. If the preset condition is not met, the difference value is used as the training loss value, and the element values in the matrix to be optimized are adjusted based on the training loss value.
13. The apparatus according to claim 12, characterized in that, The processing result acquisition module is used for: Decompose the matrix to be optimized into at least two matrices; The element values of each element in each of the at least two matrices are initialized; The step of using the initialized matrix to be optimized as the model parameter of the neural network model to be trained includes: using the element values of each of the at least two initialized matrices as the model parameter of the neural network model to be trained. When determining the difference between the known element values in the fusion matrix and the element values corresponding to the known element values in the matrix to be optimized, the processing result acquisition module is used for: Based on the element values of each element in the at least two matrices, determine the element values of each element in the matrix to be optimized; Determine the difference between the known element values in the fusion matrix and the element values corresponding to the known element values in the matrix to be optimized.
14. The apparatus according to claim 13, characterized in that, The processing result acquisition module is used for: The matrix to be optimized is expressed by the following expression. Decompose: in, express eigenmatrix express The covariance matrix, for The transpose of the matrix; the at least two matrices include the characteristic matrix and the covariance matrix.
15. The apparatus according to any one of claims 9 to 14, characterized in that, The first object is a candidate recommendation object, and the target recommendation object is any one of the n first objects; the information recommendation module is used for: Based on the second similarity between the target recommendation object and each of the n-1 candidate recommendation objects, at least one matching object that matches the target recommendation object is determined from the n-1 candidate recommendation objects. The n-1 candidate recommendation objects are each of the n first objects other than the target recommendation object. Obtain the first item of interest for each of the matched objects; Based on the first item of interest of each of the matched objects, the target recommended item is determined to be recommended to the target recommendation object.
16. The apparatus according to any one of claims 9 to 14, characterized in that, The first object is a candidate recommended item; the information recommendation module is used for: Obtain at least one second item of interest from the target recommended object, wherein the second item of interest is an object among the n first objects; For each second item of interest, based on the second similarity between the second item of interest and each piece of information in the n-1 candidate recommended items, at least one matching item that matches the second item of interest is determined from the n-1 candidate recommended items, wherein the n-1 candidate recommended items are each of the n first objects other than the second item of interest; Based on the matching items corresponding to each of the second items of interest, the target recommended items are determined to be recommended to the target recommendation object.
17. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method according to any one of claims 1 to 8.
18. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the method described in any one of claims 1 to 8.
19. A computer product, characterized in that, The computer product includes a computer program that, when executed by a processor, implements the method described in any one of claims 1 to 8.
Citation Information
Patent Citations
Recommendation method and apparatus based on heterogeneous information network
CN107577710A