[go: up one dir, main page]

CN116128575A - Article recommendation method, apparatus, computer equipment, storage medium and program product - Google Patents

Article recommendation method, apparatus, computer equipment, storage medium and program product Download PDF

Info

Publication number
CN116128575A
CN116128575A CN202310027099.3A CN202310027099A CN116128575A CN 116128575 A CN116128575 A CN 116128575A CN 202310027099 A CN202310027099 A CN 202310027099A CN 116128575 A CN116128575 A CN 116128575A
Authority
CN
China
Prior art keywords
graph
undirected
initial
nodes
user
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310027099.3A
Other languages
Chinese (zh)
Inventor
陈亮
廖婕
周克涌
郑子彬
张文锋
邓文强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Merchants Union Consumer Finance Co Ltd
Sun Yat Sen University
Original Assignee
Merchants Union Consumer Finance Co Ltd
Sun Yat Sen University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Merchants Union Consumer Finance Co Ltd, Sun Yat Sen University filed Critical Merchants Union Consumer Finance Co Ltd
Priority to CN202310027099.3A priority Critical patent/CN116128575A/en
Publication of CN116128575A publication Critical patent/CN116128575A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising
    • G06Q30/0241Advertisements
    • G06Q30/0251Targeted advertisements
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/06Asset management; Financial planning or analysis

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Development Economics (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • Economics (AREA)
  • Game Theory and Decision Science (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Marketing (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Human Resources & Organizations (AREA)
  • Operations Research (AREA)
  • Technology Law (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application relates to an item recommendation method, an item recommendation device, a computer device, a storage medium and a computer program product. The method comprises the following steps: constructing an initial undirected weight graph according to the user nodes, the object nodes corresponding to the user nodes, the relation among the user nodes and the object nodes; the user nodes comprise head nodes corresponding to head users and long-tail nodes corresponding to long-tail users; inputting the initial undirected graph into a preset graph self-encoder model, and updating the relation between long tail nodes and other nodes to generate a target undirected graph; and recommending the articles for the long-tail user according to the initial undirected unauthorized image and the target undirected unauthorized image, and generating article recommendation results. By adopting the method, the article recommendation can be more accurately performed on the long-tail user according to the constructed initial undirected graph and the target undirected graph containing more comprehensive feedback information, so that a more accurate article recommendation result is generated.

Description

物品推荐方法、装置、计算机设备、存储介质和程序产品Article recommendation method, apparatus, computer equipment, storage medium and program product

技术领域technical field

本申请涉及人工智能技术领域,特别是涉及一种物品推荐方法、装置、计算机设备、存储介质和计算机程序产品。The present application relates to the technical field of artificial intelligence, in particular to an item recommendation method, device, computer equipment, storage medium and computer program product.

背景技术Background technique

各个金融机构在进行物品推荐时,一般都需要针对不同的用户进行个性化地物品推荐,从而提高物品推荐的准确性,提高用户对服务的满意程度。When recommending items, various financial institutions generally need to recommend items personalizedly for different users, so as to improve the accuracy of item recommendation and user satisfaction with services.

一般情况下,在进行物品推荐时,所针对的用户可能包括头部用户以及长尾用户。其中,头部用户是指包含充足反馈信息的待推荐用户。长尾用户是指仅包含少数反馈信息或反馈信息不完善的待推荐用户。因此,针对长尾用户,由于缺乏足够的浏览历史信息、标签信息等反馈信息,因此,在基于少数反馈信息或不完善的反馈信息对长尾用户进行物品推荐时,存在物品推荐不准确的问题。In general, when recommending items, the targeted users may include head users and long-tail users. Among them, the top user refers to the user to be recommended with sufficient feedback information. Long-tail users refer to users to be recommended who only contain a small amount of feedback information or whose feedback information is incomplete. Therefore, for long-tail users, due to the lack of sufficient feedback information such as browsing history information and label information, when recommending items to long-tail users based on a small number of feedback information or incomplete feedback information, there is a problem of inaccurate item recommendation. .

发明内容Contents of the invention

基于此,有必要针对上述技术问题,提供一种能够提高物品推荐准确性的物品推荐方法、装置、计算机设备、计算机可读存储介质和计算机程序产品。Based on this, it is necessary to provide an item recommendation method, device, computer equipment, computer readable storage medium and computer program product capable of improving the accuracy of item recommendation in order to address the above technical problems.

第一方面,本申请提供了一种物品推荐方法。所述方法包括:In a first aspect, the present application provides an item recommendation method. The methods include:

根据用户节点、与所述用户节点对应的物品节点、所述用户节点之间的关系、所述用户节点与所述物品节点之间的关系,构建初始无向无权图;所述用户节点包括与头部用户对应的头部节点及长尾用户对应的长尾节点;According to the user node, the item node corresponding to the user node, the relationship between the user nodes, the relationship between the user node and the item node, construct an initial undirected and unweighted graph; the user node includes The head node corresponding to the head user and the long tail node corresponding to the long tail user;

将所述初始无向无权图输入至预设图自编码器模型中,对所述长尾节点与其他节点之间的关系进行更新,生成目标无向无权图;Inputting the initial undirected and unweighted graph into a preset graph autoencoder model, updating the relationship between the long-tail node and other nodes, and generating a target undirected and unweighted graph;

根据所述初始无向无权图及所述目标无向无权图,对所述长尾用户进行物品推荐,生成物品推荐结果。According to the initial undirected and unweighted graph and the target undirected and unweighted graph, item recommendation is performed to the long-tail user, and an item recommendation result is generated.

在其中一个实施例中,所述根据用户节点、与所述用户节点对应的物品节点、所述用户节点之间的关系、所述用户节点与所述物品节点之间的关系,构建初始无向无权图,包括:In one of the embodiments, the construction of an initial undirected Unauthorized graphs, including:

将用户节点、与所述用户节点对应的物品节点作为节点,将所述用户节点之间的关系、所述用户节点与所述物品节点之间的关系作为边,构建初始邻接矩阵;Using the user node and the item node corresponding to the user node as nodes, using the relationship between the user nodes, the relationship between the user node and the item node as edges, and constructing an initial adjacency matrix;

获取所述用户节点的特征向量、所述物品节点的特征向量,根据所述用户节点的特征向量、所述物品节点的特征向量,生成特征矩阵;Obtaining the feature vector of the user node and the feature vector of the item node, and generating a feature matrix according to the feature vector of the user node and the feature vector of the item node;

根据初始邻接矩阵及特征矩阵,构建初始无向无权图。According to the initial adjacency matrix and feature matrix, the initial undirected and unweighted graph is constructed.

在其中一个实施例中,所述方法还包括:In one embodiment, the method also includes:

对所述初始无向无权图中的所述头部节点的连接边进行删除,生成新的无向无权图;Deleting the connection edges of the head nodes in the initial undirected and unweighted graph to generate a new undirected and unweighted graph;

将所述新的无向无权图输入至初始图自编码器模型中进行处理,生成新的邻接矩阵;Inputting the new undirected and unweighted graph into the initial graph autoencoder model for processing to generate a new adjacency matrix;

根据所述新的邻接矩阵计算所述初始图自编码器模型的损失函数的值,根据所述损失函数的值对所述初始图自编码器模型的模型参数进行更新,生成预设图自编码器模型。Calculate the value of the loss function of the initial graph self-encoder model according to the new adjacency matrix, update the model parameters of the initial graph self-encoder model according to the value of the loss function, and generate a preset graph self-encoder device model.

在其中一个实施例中,所述将所述初始无向无权图输入至预设图自编码器模型中,对所述长尾节点与其他节点之间的关系进行更新,生成目标无向无权图,包括:In one of the embodiments, the initial undirected and unweighted graph is input into the preset graph autoencoder model, and the relationship between the long-tail node and other nodes is updated to generate the target undirected and unweighted graph. rights map, including:

将所述初始无向无权图输入至预设图自编码器模型中,对所述长尾节点的待增加连接边进行预测,生成目标邻接矩阵;Inputting the initial undirected and unweighted graph into the preset graph autoencoder model, predicting the connection edges to be added of the long-tail nodes, and generating a target adjacency matrix;

根据所述目标邻接矩阵及所述特征矩阵,生成所述目标无向无权图。The target undirected and unweighted graph is generated according to the target adjacency matrix and the feature matrix.

在其中一个实施例中,所述方法还包括:In one embodiment, the method also includes:

将所述初始无向无权图输入至初始图神经网络模型中进行图卷积处理,生成所述初始无向无权图对应的第一嵌入表征矩阵;Inputting the initial undirected and unweighted graph into the initial graph neural network model for graph convolution processing to generate a first embedded representation matrix corresponding to the initial undirected and unweighted graph;

将所述目标无向无权图输入至初始图神经网络模型中进行图卷积处理,生成所述目标无向无权图对应的第二嵌入表征矩阵;Inputting the target undirected and unweighted graph into the initial graph neural network model for graph convolution processing to generate a second embedded representation matrix corresponding to the target undirected and unweighted graph;

根据所述第一嵌入表征矩阵及所述第二嵌入表征矩阵计算所述初始图神经网络模型的损失函数的值,根据所述损失函数的值对所述初始图神经网络模型的模型参数进行更新,生成预设图神经网络模型。Calculate the value of the loss function of the initial graph neural network model according to the first embedded representation matrix and the second embedded representation matrix, and update the model parameters of the initial graph neural network model according to the value of the loss function , to generate a preset graph neural network model.

在其中一个实施例中,所述根据所述初始无向无权图及所述目标无向无权图,对所述长尾用户进行物品推荐,生成物品推荐结果,包括:In one of the embodiments, according to the initial undirected and unweighted graph and the target undirected and unweighted graph, item recommendation is performed to the long-tail user, and item recommendation results are generated, including:

将所述初始无向无权图输入预设图神经网络模型中进行图卷积处理,生成目标嵌入表征矩阵;所述预设图神经网络模型为基于所述初始无向无权图及所述目标无向无权图进行训练所得;Inputting the initial undirected and unweighted graph into a preset graph neural network model for graph convolution processing to generate a target embedding representation matrix; the preset graph neural network model is based on the initial undirected and unweighted graph and the The target undirected and unweighted graph is obtained by training;

根据所述目标嵌入表征矩阵对所述长尾用户进行物品推荐,生成所述物品推荐结果。performing item recommendation on the long-tail user according to the target embedding representation matrix, and generating the item recommendation result.

第二方面,本申请还提供了一种物品推荐装置。所述装置包括:In a second aspect, the present application also provides an item recommendation device. The devices include:

初始无向无权图构建模块,用于根据用户节点、与所述用户节点对应的物品节点、所述用户节点之间的关系、所述用户节点与所述物品节点之间的关系,构建初始无向无权图;所述用户节点包括与头部用户对应的头部节点及长尾用户对应的长尾节点;An initial undirected and unweighted graph construction module, configured to construct an initial An undirected and unweighted graph; the user node includes a head node corresponding to the head user and a long tail node corresponding to the long tail user;

目标无向无权图生成模块,用于将所述初始无向无权图输入至预设图自编码器模型中,对所述长尾节点与其他节点之间的关系进行更新,生成目标无向无权图;The target undirected and unweighted graph generation module is used to input the initial undirected and unweighted graph into the preset graph autoencoder model, update the relationship between the long tail node and other nodes, and generate the target undirected and unweighted graph. to the Unauthorized Graph;

物品推荐结果生成模块,用于根据所述初始无向无权图及所述目标无向无权图,对所述长尾用户进行物品推荐,生成物品推荐结果。The item recommendation result generating module is configured to recommend items to the long-tail users according to the initial undirected and unweighted graph and the target undirected and unweighted graph, and generate item recommendation results.

第三方面,本申请还提供了一种计算机设备。所述计算机设备包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现上述第一方面中任一项实施例中的方法的步骤。In a third aspect, the present application also provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of the method in any one embodiment of the first aspect above when executing the computer program.

第四方面,本申请还提供了一种计算机可读存储介质。所述计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述第一方面中任一项实施例中的方法的步骤。In a fourth aspect, the present application also provides a computer-readable storage medium. The computer-readable storage medium has a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method in any one embodiment of the above-mentioned first aspect are implemented.

第五方面,本申请还提供了一种计算机程序产品。所述计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现上述第一方面中任一项实施例中的方法的步骤。In a fifth aspect, the present application also provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the steps of the method in any one embodiment of the first aspect above are implemented.

上述物品推荐方法、装置、计算机设备、存储介质和计算机程序产品,根据用户节点、与用户节点对应的物品节点、用户节点之间的关系、用户节点与物品节点之间的关系,构建初始无向无权图;用户节点包括与头部用户对应的头部节点及长尾用户对应的长尾节点;将初始无向无权图输入至预设图自编码器模型中,对长尾节点与其他节点之间的关系进行更新,生成目标无向无权图;根据初始无向无权图及目标无向无权图,对长尾用户进行物品推荐,生成物品推荐结果。本申请通过将构建好的初始无向无权图输入至预设图自编码器模型中,对长尾节点与其他节点之间的关系进行更新,就能够扩充长尾用户不完善的反馈信息,从而生成包含更全面反馈信息的目标无向无权图。之后,根据构建的初始无向无权图及包含更全面反馈信息的目标无向无权图,就能够较准确地对长尾用户进行物品推荐,从而生成较准确的物品推荐结果。The above item recommendation method, device, computer equipment, storage medium, and computer program product construct an initial undirected Unweighted graph; user nodes include the head node corresponding to the head user and the long tail node corresponding to the long tail user; the initial undirected unweighted graph is input into the preset graph autoencoder model, and the long tail node and other The relationship between the nodes is updated to generate the target undirected and unweighted graph; according to the initial undirected and unweighted graph and the target undirected and unweighted graph, items are recommended for long-tail users, and item recommendation results are generated. This application can expand the imperfect feedback information of long-tail users by inputting the constructed initial undirected and unweighted graph into the preset graph autoencoder model and updating the relationship between long-tail nodes and other nodes. Thus, a target undirected and unweighted graph containing more comprehensive feedback information is generated. Afterwards, according to the constructed initial undirected and unweighted graph and the target undirected and unweighted graph containing more comprehensive feedback information, items can be more accurately recommended to long-tail users, thereby generating more accurate item recommendation results.

附图说明Description of drawings

图1为一个实施例中物品推荐方法的应用环境图;FIG. 1 is an application environment diagram of an item recommendation method in an embodiment;

图2为一个实施例中物品推荐方法的流程示意图;FIG. 2 is a schematic flow diagram of an item recommendation method in an embodiment;

图3为一个实施例中初始无向无权图构建步骤的流程示意图;Fig. 3 is a schematic flow chart of the initial undirected and unweighted graph construction steps in one embodiment;

图4为一个实施例中初始无向无权图的结构示意图;FIG. 4 is a schematic structural diagram of an initial undirected and unweighted graph in an embodiment;

图5为另一个实施例中预设图自编码器模型生成步骤的流程示意图;Fig. 5 is a schematic flow chart of the steps of generating the preset graph autoencoder model in another embodiment;

图6为一个实施例中预设图自编码器模型的训练示意图;Fig. 6 is a schematic diagram of the training of the preset graph self-encoder model in one embodiment;

图7为一个实施例中目标无向无权图生成步骤的流程示意图;Fig. 7 is a schematic flow chart of the step of generating a target undirected and unweighted graph in an embodiment;

图8为另一个实施例中预设图神经网络模型生成步骤的流程示意图;Fig. 8 is a schematic flow chart of the steps of generating a preset graph neural network model in another embodiment;

图9为一个实施例中预设图神经网络模型的训练示意图;Fig. 9 is a schematic diagram of training of a preset graph neural network model in an embodiment;

图10为一个实施例中物品推荐结果生成步骤的流程示意图;FIG. 10 is a schematic flowchart of the steps of generating item recommendation results in an embodiment;

图11为一个可选的实施例中物品推荐方法的流程示意图;FIG. 11 is a schematic flow chart of an item recommendation method in an optional embodiment;

图12为一个实施例中物品推荐系统的结构示意图;Fig. 12 is a schematic structural diagram of an item recommendation system in an embodiment;

图13为一个实施例中物品推荐装置的结构框图;Fig. 13 is a structural block diagram of an item recommendation device in an embodiment;

图14为一个实施例中计算机设备的内部结构图。Figure 14 is a diagram of the internal structure of a computer device in one embodiment.

具体实施方式Detailed ways

为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solution and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present application, and are not intended to limit the present application.

各个金融机构在进行物品推荐时,一般都需要针对不同的用户进行个性化地物品推荐,从而提高物品推荐的准确性,提高用户对服务的满意程度。When recommending items, various financial institutions generally need to recommend items personalizedly for different users, so as to improve the accuracy of item recommendation and user satisfaction with services.

一般情况下,在进行物品推荐时,所针对的用户可能包括头部用户以及长尾用户。其中,头部用户是指包含充足反馈信息的待推荐用户。长尾用户是指仅包含少数反馈信息或反馈信息不完善的待推荐用户。因此,针对长尾用户,由于缺乏足够的浏览历史信息、标签信息等反馈信息,因此,在基于少数反馈信息或不完善的反馈信息对长尾用户进行物品推荐时,存在物品推荐不准确的问题。In general, when recommending items, the targeted users may include head users and long-tail users. Among them, the top user refers to the user to be recommended with sufficient feedback information. Long-tail users refer to users to be recommended who only contain a small amount of feedback information or whose feedback information is incomplete. Therefore, for long-tail users, due to the lack of sufficient feedback information such as browsing history information and label information, when recommending items to long-tail users based on a small number of feedback information or incomplete feedback information, there is a problem of inaccurate item recommendation. .

本申请实施例提供的物品推荐方法,可以应用于如图1所示的应用环境中。其中,终端102通过网络与服务器104进行通信。数据存储系统可以存储服务器104需要处理的数据。数据存储系统可以集成在服务器104上,也可以放在云上或其他网络服务器上。服务器104根据用户节点、与用户节点对应的物品节点、用户节点之间的关系、用户节点与物品节点之间的关系,构建初始无向无权图;用户节点包括与头部用户对应的头部节点及长尾用户对应的长尾节点;服务器104将初始无向无权图输入至预设图自编码器模型中,对长尾节点与其他节点之间的关系进行更新,生成目标无向无权图;服务器104根据初始无向无权图及目标无向无权图,对长尾用户进行物品推荐,生成物品推荐结果。其中,终端102可以但不限于是各种个人计算机、笔记本电脑、智能手机、平板电脑、物联网设备和便携式可穿戴设备,物联网设备可为智能音箱、智能电视、智能空调、智能车载设备等。便携式可穿戴设备可为智能手表、智能手环、头戴设备等。服务器104可以用独立的服务器或者是多个服务器组成的服务器集群来实现。The item recommendation method provided in the embodiment of the present application may be applied to the application environment shown in FIG. 1 . Wherein, the terminal 102 communicates with the server 104 through the network. The data storage system can store data that needs to be processed by the server 104 . The data storage system can be integrated on the server 104, or placed on the cloud or other network servers. The server 104 constructs an initial undirected and unweighted graph according to the user nodes, item nodes corresponding to the user nodes, the relationship between user nodes, and the relationship between user nodes and item nodes; the user nodes include the head corresponding to the head user node and the long-tail node corresponding to the long-tail user; the server 104 inputs the initial undirected and unweighted graph into the preset graph autoencoder model, updates the relationship between the long-tail node and other nodes, and generates the target undirected and unweighted graph. Weight graph: The server 104 recommends items to long-tail users according to the initial undirected and unweighted graph and the target undirected and unweighted graph, and generates item recommendation results. Among them, the terminal 102 can be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, Internet of Things devices and portable wearable devices, and the Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart vehicle-mounted devices, etc. . Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, and the like. The server 104 can be implemented by an independent server or a server cluster composed of multiple servers.

在一个实施例中,如图2所示,提供了一种物品推荐方法,以该方法应用于图1中的服务器104为例进行说明,包括以下步骤:In one embodiment, as shown in FIG. 2 , a method for item recommendation is provided. The method is applied to the server 104 in FIG. 1 as an example for illustration, including the following steps:

步骤220,根据用户节点、与用户节点对应的物品节点、用户节点之间的关系、用户节点与物品节点之间的关系,构建初始无向无权图;用户节点包括与头部用户对应的头部节点及长尾用户对应的长尾节点。Step 220, construct an initial undirected and unweighted graph according to user nodes, item nodes corresponding to user nodes, relationship between user nodes, and relationship between user nodes and item nodes; user nodes include head users corresponding to head users Long-tail nodes corresponding to internal nodes and long-tail users.

其中,节点是指图上的顶点,可以包括用户节点和物品节点,用户节点包括与头部用户对应的头部节点及长尾用户对应的长尾节点。头部用户是指包含充足反馈信息的待推荐用户。长尾用户是指仅包含少数反馈信息或反馈信息不完善的待推荐用户。反馈信息是指采集到的用户的历史行为信息,示例性的,反馈信息包括用户浏览视频软件时的浏览、点赞等行为,用户浏览商品软件时的点击、收藏、加入购物车等行为。无向无权图是指图中用户节点之间的关系、用户节点与物品节点之间的关系均无方向、且无权值的图。Wherein, a node refers to a vertex on the graph, and may include a user node and an item node, and the user node includes a head node corresponding to a head user and a long tail node corresponding to a long tail user. Top users refer to users to be recommended with sufficient feedback information. Long-tail users refer to users to be recommended who only contain a small amount of feedback information or whose feedback information is incomplete. The feedback information refers to the collected historical behavior information of the user. Exemplarily, the feedback information includes behaviors such as browsing and liking when the user browses video software, and behaviors such as clicking, saving, and adding to a shopping cart when the user browses commodity software. An undirected and unweighted graph refers to a graph in which the relationship between user nodes and the relationship between user nodes and item nodes have no direction and no weight.

可选地,服务器104可以从终端102中获取用户的历史行为信息,并根据用户的历史行为信息确定用户、用户在进行历史行为时使用的物品以及不同用户之间的关系、用户与物品之间的关系,从而确定出用户节点、与用户节点对应的物品节点、用户节点之间的关系、用户节点与物品节点之间的关系。之后,服务器104可以根据用户节点、与用户节点对应的物品节点、用户节点之间的关系、用户节点与物品节点之间的关系,构建初始无向无权图。Optionally, the server 104 can obtain the user's historical behavior information from the terminal 102, and determine the user, the items used by the user when performing the historical behavior, the relationship between different users, and the relationship between the user and the item according to the user's historical behavior information. , so as to determine the user node, the item node corresponding to the user node, the relationship between the user nodes, and the relationship between the user node and the item node. Afterwards, the server 104 may construct an initial undirected and unweighted graph according to user nodes, item nodes corresponding to the user nodes, relationships between user nodes, and relationships between user nodes and item nodes.

步骤240,将初始无向无权图输入至预设图自编码器模型中,对长尾节点与其他节点之间的关系进行更新,生成目标无向无权图。Step 240, input the initial undirected and unweighted graph into the preset graph autoencoder model, update the relationship between the long-tail nodes and other nodes, and generate the target undirected and unweighted graph.

可选地,服务器104可以将构建好的初始无向无权图输入至预设图自编码器模型中进行处理,对长尾节点与其他用户节点之间的关系、或者对长尾节点与其他物品节点之间的关系进行更新,从而对长尾节点与其他节点之间的关系信息进行扩充,进而生成目标无向无权图。其中,预设图自编码器模型(Graph Autoencoders,GAE)是采用输入信息作为编码器去重构(reconstruct)原始图的模型。目标无向无权图是指对初始无向无权图中的长尾节点进行信息扩充后的无向无权图。Optionally, the server 104 can input the constructed initial undirected and unweighted graph into the preset graph autoencoder model for processing, for the relationship between long-tail nodes and other user nodes, or for the relationship between long-tail nodes and other user nodes The relationship between item nodes is updated, so as to expand the relationship information between long tail nodes and other nodes, and then generate the target undirected and unweighted graph. Among them, the preset graph autoencoder model (Graph Autoencoders, GAE) is a model that uses input information as an encoder to reconstruct the original graph. The target undirected and unweighted graph refers to the undirected and unweighted graph after information augmentation of the long tail nodes in the initial undirected and unweighted graph.

步骤260,根据初始无向无权图及目标无向无权图,对长尾用户进行物品推荐,生成物品推荐结果。Step 260, according to the initial undirected and unweighted graph and the target undirected and unweighted graph, recommend items to long-tail users, and generate item recommendation results.

可选地,根据初始无向无权图及目标无向无权图,服务器104可以对长尾用户进行物品推荐,生成物品推荐结果。示例性的,服务器104可以将初始无向无权图及目标无向无权图一同输入至预设图神经网络模型中进行处理,生成处理结果;再根据该处理结果进行物品推荐,生成物品推荐结果。服务器104也可以通过初始无向无权图及目标无向无权图一同训练得到预设图神经网络模型,再将初始无向无权图输入至预设图神经网络模型中进行处理,生成处理结果;之后,服务器104可以根据该处理结果进行物品推荐,生成物品推荐结果。其中,图神经网络模型(graph neural network,GNN)是指使用神经网络来学习图结构数据,从而满足聚类、分类、预测、分割、生成等图学习任务需求的模型。可选地,本申请实施例中也可以使用图卷积神经网络模型进行处理,本申请对此不做限定。Optionally, according to the initial undirected and unweighted graph and the target undirected and unweighted graph, the server 104 may recommend items to long-tail users and generate item recommendation results. Exemplarily, the server 104 may input the initial undirected and unweighted graph and the target undirected and unweighted graph into the preset graph neural network model for processing, and generate a processing result; then perform item recommendation according to the processing result, and generate item recommendation result. The server 104 can also train the initial undirected and unweighted graph together with the target undirected and unweighted graph to obtain the preset graph neural network model, and then input the initial undirected and unweighted graph into the preset graph neural network model for processing, and generate Result; afterward, the server 104 may perform item recommendation according to the processing result, and generate an item recommendation result. Among them, the graph neural network model (graph neural network, GNN) refers to a model that uses a neural network to learn graph-structured data to meet the needs of graph learning tasks such as clustering, classification, prediction, segmentation, and generation. Optionally, in this embodiment of the application, a graph convolutional neural network model may also be used for processing, which is not limited in this application.

上述物品推荐方法中,根据用户节点、与用户节点对应的物品节点、用户节点之间的关系、用户节点与物品节点之间的关系,构建初始无向无权图;用户节点包括与头部用户对应的头部节点及长尾用户对应的长尾节点;将初始无向无权图输入至预设图自编码器模型中,对长尾节点与其他节点之间的关系进行更新,生成目标无向无权图;根据初始无向无权图及目标无向无权图,对长尾用户进行物品推荐,生成物品推荐结果。本申请通过将构建好的初始无向无权图输入至预设图自编码器模型中,对长尾节点与其他节点之间的关系进行更新,就能够扩充长尾用户不完善的反馈信息,从而生成包含更全面反馈信息的目标无向无权图。之后,根据构建的初始无向无权图及包含更全面反馈信息的目标无向无权图,就能够较准确地对长尾用户进行个性化物品推荐,从而生成较准确的物品推荐结果。最终,可以提升用户满意度。In the above item recommendation method, an initial undirected and unweighted graph is constructed according to user nodes, item nodes corresponding to user nodes, relationship between user nodes, and relationship between user nodes and item nodes; user nodes include The corresponding head node and the long-tail node corresponding to the long-tail user; input the initial undirected and unweighted graph into the preset graph autoencoder model, update the relationship between the long-tail node and other nodes, and generate the target unweighted Directed and unweighted graph: According to the initial undirected and unweighted graph and the target undirected and unweighted graph, items are recommended for long-tail users, and item recommendation results are generated. This application can expand the imperfect feedback information of long-tail users by inputting the constructed initial undirected and unweighted graph into the preset graph autoencoder model and updating the relationship between long-tail nodes and other nodes. Thus, a target undirected and unweighted graph containing more comprehensive feedback information is generated. Afterwards, according to the constructed initial undirected and unweighted graph and the target undirected and unweighted graph containing more comprehensive feedback information, it is possible to more accurately recommend personalized items to long-tail users, thereby generating more accurate item recommendation results. Ultimately, user satisfaction can be improved.

在一个实施例中,如图3所示,根据用户节点、与用户节点对应的物品节点、用户节点之间的关系、用户节点与物品节点之间的关系,构建初始无向无权图,包括:In one embodiment, as shown in Figure 3, according to the user nodes, the item nodes corresponding to the user nodes, the relationship between user nodes, and the relationship between user nodes and item nodes, an initial undirected and unweighted graph is constructed, including :

步骤320,将用户节点、与用户节点对应的物品节点作为节点,将用户节点之间的关系、用户节点与物品节点之间的关系作为边,构建初始邻接矩阵。In step 320, user nodes and item nodes corresponding to the user nodes are used as nodes, and relationships between user nodes and relationships between user nodes and item nodes are used as edges to construct an initial adjacency matrix.

可选地,首先,服务器104可以获取用户的历史行为信息,并根据用户的历史行为信息确定出用户、用户在进行历史行为时使用的物品以及不同用户之间的关系、用户与物品之间的关系。之后,服务器104可以将各用户作为各用户节点,将用户在进行历史行为时使用的各物品作为各物品节点,并将用户节点、与用户节点对应的物品节点作为节点,将用户节点之间的关系、用户节点与物品节点之间的关系作为边,从而根据各节点以及各边构建初始邻接矩阵。其中,初始邻接矩阵可以表示为A,且A∈{0,1}n×n,n表示节点总数。初始邻接矩阵A中的各个元素Aij表示节点i和节点j之间是否存在连接的边。若节点i和节点j之间存在连接的边,则Aij的元素值为1;若节点i和节点j之间不存在连接的边,则Aij的元素值为0。Optionally, firstly, the server 104 may obtain the user's historical behavior information, and determine the user, the items used by the user when performing the historical behavior, the relationship between different users, and the relationship between the user and the item according to the user's historical behavior information. relation. Afterwards, the server 104 can use each user as each user node, each item used by the user when performing historical behaviors as each item node, and use the user node and the item node corresponding to the user node as nodes, and the Relationships, relationships between user nodes and item nodes are used as edges, and an initial adjacency matrix is constructed based on each node and each edge. Among them, the initial adjacency matrix can be expressed as A, and A∈{0,1} n×n , n represents the total number of nodes. Each element A ij in the initial adjacency matrix A indicates whether there is a connected edge between node i and node j. If there is a connecting edge between node i and node j, the element value of A ij is 1; if there is no connecting edge between node i and node j, then the element value of A ij is 0.

步骤340,获取用户节点的特征向量、物品节点的特征向量,根据用户节点的特征向量、物品节点的特征向量,生成特征矩阵。Step 340, acquire the feature vector of the user node and the feature vector of the item node, and generate a feature matrix according to the feature vector of the user node and the feature vector of the item node.

可选地,服务器104可以获取用户的历史行为信息,并根据用户的历史行为信息以及确定出的各用户节点和各物品节点得到各用户节点的特征信息、各物品节点的特征信息。之后,服务器104可以将各用户节点的特征信息以及各物品节点的特征信息独热编码为各用户节点的特征向量、各物品节点的特征向量,并根据各用户节点的特征向量、各物品节点的特征向量生成特征矩阵X。其中,特征矩阵可以表示为X,且

Figure BDA0004045547950000071
n表示节点总数,f表示特征向量的维数,矩阵的每一行xi表示节点i的f维特征向量。独热编码可以将离散的特征信息数值化,以便于服务器运算。例如,独热编码可以采用两位二进制数表示性别特征,若第一位表示“是否为女性”,且第二位表示“是否为男性”,则女性可以独热编码为“10”,而男性独热编码为“01”。Optionally, the server 104 may obtain the user's historical behavior information, and obtain the feature information of each user node and each item node according to the user's historical behavior information and the determined user nodes and item nodes. Afterwards, the server 104 can one-hot encode the feature information of each user node and the feature information of each item node into a feature vector of each user node and a feature vector of each item node, and based on the feature vector of each user node and the feature vector of each item node The eigenvectors generate the eigenmatrix X. where the feature matrix can be denoted as X, and
Figure BDA0004045547950000071
n represents the total number of nodes, f represents the dimension of the feature vector, and each row x i of the matrix represents the f-dimensional feature vector of node i. One-hot encoding can digitize discrete feature information to facilitate server calculations. For example, one-hot encoding can use two binary numbers to represent gender characteristics. If the first digit indicates "whether it is female" and the second digit indicates "whether it is male", then female can be one-hot encoded as "10", while male One-hot encoding is "01".

步骤360,根据初始邻接矩阵及特征矩阵,构建初始无向无权图。Step 360, construct an initial undirected and unweighted graph according to the initial adjacency matrix and feature matrix.

可选地,服务器104可以根据初始邻接矩阵A及特征矩阵X,构建初始无向无权图。其中,无向无权图是指图中用户节点之间的关系、用户节点与物品节点之间的关系均无方向、且无权值的图,即图中各边均为无方向、且无权值的图。初始无向无权图可以表示为G,且G=(A,X),A表示初始邻接矩阵,X表示特征矩阵。示例性的,如图4所示,图4为一个实施例中初始无向无权图的结构示意图。节点包括头部节点v0、长尾节点v1、物品节点v2、物品节点v3、物品节点v4以及物品节点v5,各节点上包括各节点对应的特征向量,边包括头部节点v0与长尾节点v1之间的关注关系、头部节点v0与物品节点v2之间的分享关系、头部节点v0与物品节点v3之间的点赞关系、头部节点v0与物品节点v4之间的点赞关系以及头部节点v0与物品节点v5之间的点赞关系。Optionally, the server 104 may construct an initial undirected and unweighted graph according to the initial adjacency matrix A and the feature matrix X. Among them, an undirected and unweighted graph refers to a graph in which the relationship between user nodes and the relationship between user nodes and item nodes have no direction and no weight value, that is, each edge in the graph has no direction and no A graph of weights. The initial undirected and unweighted graph can be represented as G, and G=(A,X), A represents the initial adjacency matrix, and X represents the feature matrix. Exemplarily, as shown in FIG. 4 , FIG. 4 is a schematic structural diagram of an initial undirected and unweighted graph in an embodiment. The nodes include the head node v 0 , the long tail node v 1 , the item node v 2 , the item node v 3 , the item node v 4 and the item node v 5 , each node includes the feature vector corresponding to each node, and the edge includes the head node The following relationship between v 0 and long tail node v 1 , the sharing relationship between head node v 0 and item node v 2 , the like relationship between head node v 0 and item node v 3 , the head node Like relationship between v 0 and item node v 4 and like relationship between head node v 0 and item node v 5 .

本实施例中,将用户节点、与用户节点对应的物品节点作为节点,将用户节点之间的关系、用户节点与物品节点之间的关系作为边,构建初始邻接矩阵;获取用户节点的特征向量、物品节点的特征向量,根据用户节点的特征向量、物品节点的特征向量,生成特征矩阵;根据初始邻接矩阵及特征矩阵,构建初始无向无权图。从而通过初始邻接矩阵及特征矩阵构建初始无向无权图,能够较便捷且准确地得到用户与用户之间的关系以及用户与物品之间的关系。In this embodiment, the user node and the item node corresponding to the user node are used as nodes, and the relationship between the user nodes and the relationship between the user node and the item node are used as edges to construct an initial adjacency matrix; obtain the feature vector of the user node , The eigenvector of the item node, according to the eigenvector of the user node and the eigenvector of the item node, generate a feature matrix; according to the initial adjacency matrix and feature matrix, construct an initial undirected and unweighted graph. Therefore, the initial undirected and unweighted graph is constructed through the initial adjacency matrix and feature matrix, and the relationship between users and the relationship between users and items can be obtained more conveniently and accurately.

在一个实施例中,如图5所示,提供了一种物品推荐方法,还包括:In one embodiment, as shown in FIG. 5 , an item recommendation method is provided, further comprising:

步骤520,对初始无向无权图中的头部节点的连接边进行删除,生成新的无向无权图。Step 520, delete the connecting edges of the head nodes in the initial undirected and unweighted graph, and generate a new undirected and unweighted graph.

示例性的,如图6所示,图6为一个实施例中预设图自编码器模型的训练示意图。可选地,服务器104可以对初始无向无权图中的头部节点的连接边进行删除,生成删边后新的邻接矩阵A1,从而生成删边后新的无向无权图G1。其中,G1=(A1,X)。删除初始无向无权图中的头部节点的连接边时可以随机删除与头部节点连接的任意一个或多个连接边。当然,本申请对此不做限定。Exemplarily, as shown in FIG. 6 , FIG. 6 is a schematic diagram of training a preset graph autoencoder model in an embodiment. Optionally, the server 104 may delete the connection edges of the head nodes in the initial undirected and unweighted graph, and generate a new adjacency matrix A 1 after edge deletion, thereby generating a new undirected and weightless graph G 1 after edge deletion . Wherein, G 1 =(A 1 ,X). When deleting the connection edges of the head node in the initial undirected and unweighted graph, any one or more connection edges connected to the head node can be randomly deleted. Of course, the present application does not limit this.

步骤540,将新的无向无权图输入至初始图自编码器模型中进行处理,生成新的邻接矩阵。Step 540: Input the new undirected and unweighted graph into the initial graph autoencoder model for processing to generate a new adjacency matrix.

可选地,结合图6所示,服务器104可以将删边后新的无向无权图G1输入至初始图自编码器模型中进行处理,即服务器104可以将新的无向无权图G1输入至初始图自编码器模型中,对已删除连接边的头部节点的待增加连接边进行预测,生成预测加边后新的邻接矩阵A2Optionally, as shown in FIG. 6, the server 104 can input the new undirected and unweighted graph G1 after edge deletion into the initial graph self-encoder model for processing, that is, the server 104 can input the new undirected and unweighted graph G 1 is input into the initial graph autoencoder model, and predicts the connection edge to be added to the head node whose connection edge has been deleted, and generates a new adjacency matrix A 2 after the predicted edge is added.

步骤560,根据新的邻接矩阵计算初始图自编码器模型的损失函数的值,根据损失函数的值对初始图自编码器模型的模型参数进行更新,生成预设图自编码器模型。Step 560, calculate the value of the loss function of the initial GAS model according to the new adjacency matrix, update the model parameters of the initial GAS model according to the value of the loss function, and generate a preset GAS model.

可选地,结合图6所示,服务器104可以根据预测加边后新的邻接矩阵A2计算初始图自编码器模型的损失函数Lossp的值,并根据初始图自编码器模型的损失函数Lossp的值对初始图自编码器模型的模型参数Θ进行更新,直到初始图自编码器模型的损失函数Lossp的值最小时,即直到预测加边后新的邻接矩阵A2与初始邻接矩阵A的差距最小时,使用此时初始图自编码器模型的损失函数Lossp对应的的模型参数作为初始图自编码器模型的目标模型参数,从而生成训练好的预设图自编码器模型。其中,Θ=(L1,L2)为初始图自编码器模型的模型参数。初始图自编码器模型的损失函数Lossp的计算公式如公式(1)、公式(2)、及公式(3)所示。Optionally, as shown in FIG. 6 , the server 104 can calculate the value of the loss function Loss p of the initial graph autoencoder model according to the new adjacency matrix A2 after prediction and edge addition, and according to the loss function of the initial graph autoencoder model The value of Loss p updates the model parameter Θ of the initial graph autoencoder model until the value of the loss function Loss p of the initial graph autoencoder model is minimum, that is, until the new adjacency matrix A 2 is adjacent to the initial adjacency When the gap of matrix A is the smallest, use the model parameters corresponding to the loss function Loss p of the initial graph autoencoder model at this time as the target model parameters of the initial graph autoencoder model, thereby generating a trained preset graph autoencoder model . Wherein, Θ=(L 1 , L 2 ) is the model parameter of the initial graph autoencoder model. The calculation formula of the loss function Loss p of the initial image self-encoder model is shown in formula (1), formula (2), and formula (3).

H=A1relu(A1XL1)L2  (1)H=A 1 relu(A 1 XL 1 )L 2 (1)

A2=sigmoid(HHT)  (2)A 2 =sigmoid(HH T ) (2)

Figure BDA0004045547950000081
Figure BDA0004045547950000081

其中,H表示初始图自编码器模型的中间模型参数;A1表示删边后新的邻接矩阵,X表示特征矩阵;relu()表示第一非线性激活函数,定义为h(x)=max(0,x);L1表示初始图自编码器模型的第一模型参数;L2表示初始图自编码器模型的第二模型参数;A2表示预测加边后新的邻接矩阵;Sigmoid()表示第二非线性激活函数,定义为h(x)=1/(1+e-x);HT表示初始图自编码器模型的中间模型参数的转置;Lossp表示初始图自编码器模型的损失函数;A表示初始邻接矩阵;n表示节点总数,i和j表示不同的节点。在本申请实施例中,relu激活函数也可以替换为ELU激活函数或者Leaky Relu激活函数。Among them, H represents the intermediate model parameters of the initial graph self-encoder model; A 1 represents the new adjacency matrix after edge deletion, X represents the feature matrix; relu() represents the first nonlinear activation function, defined as h(x)=max (0,x); L 1 represents the first model parameter of the initial graph autoencoder model; L 2 represents the second model parameter of the initial graph autoencoder model; A 2 represents the new adjacency matrix after predicting and adding edges; Sigmoid( ) represents the second nonlinear activation function, defined as h(x)=1/(1+e -x ); HT represents the transposition of the intermediate model parameters of the initial graph autoencoder model; Loss p represents the initial graph autoencoder The loss function of the device model; A represents the initial adjacency matrix; n represents the total number of nodes, and i and j represent different nodes. In the embodiment of the present application, the relu activation function may also be replaced by an ELU activation function or a Leaky Relu activation function.

本实施例中,对初始无向无权图中的头部节点的连接边进行删除,生成新的无向无权图;将新的无向无权图输入至初始图自编码器模型中进行处理,生成新的邻接矩阵;根据新的邻接矩阵计算初始图自编码器模型的损失函数的值,根据损失函数的值对初始图自编码器模型的模型参数进行更新,生成预设图自编码器模型。本实施例通过初始邻接矩阵、删边后新的邻接矩阵以及预测加边后新的邻接矩阵共同训练预设图自编码器模型,从而能够生成较准确的预设图自编码器模型。In this embodiment, the connection edges of the head nodes in the initial undirected and unweighted graph are deleted to generate a new undirected and unweighted graph; the new undirected and unweighted graph is input into the initial graph autoencoder model to perform Processing to generate a new adjacency matrix; calculate the value of the loss function of the initial graph self-encoder model according to the new adjacency matrix, update the model parameters of the initial graph self-encoder model according to the value of the loss function, and generate a preset graph self-encoder device model. In this embodiment, the preset graph autoencoder model is jointly trained by the initial adjacency matrix, the new adjacency matrix after edge deletion, and the new adjacency matrix after prediction and edge addition, so as to generate a more accurate preset graph autoencoder model.

在一个实施例中,如图7所示,将初始无向无权图输入至预设图自编码器模型中,对长尾节点与其他节点之间的关系进行更新,生成目标无向无权图,包括:In one embodiment, as shown in Figure 7, the initial undirected and unweighted graph is input into the preset graph autoencoder model, and the relationship between long-tail nodes and other nodes is updated to generate the target undirected and unweighted Figures, including:

步骤720,将初始无向无权图输入至预设图自编码器模型中,对长尾节点的待增加连接边进行预测,生成目标邻接矩阵。Step 720: Input the initial undirected and unweighted graph into the preset graph autoencoder model, predict the connection edges to be added to the long-tail nodes, and generate the target adjacency matrix.

可选地,在预设图自编码器模型训练完成之后,服务器104可以将初始无向无权图G输入至预设图自编码器模型中对长尾节点的待增加连接边进行预测,以对长尾节点与其他用户节点之间的关系、或者对长尾节点与其他物品节点之间的关系进行更新,即对长尾节点与其他节点之间的关系信息进行扩充,从而生成目标邻接矩阵。其中,预设图自编码器模型(Graph Autoencoders,GAE)是采用输入信息作为编码器去重构(reconstruct)原始图的模型。目标邻接矩阵可以表示为A’。目标邻接矩阵A’的的计算公式如公式(4)、公式(5)、公式(6)及公式(7)所示。Optionally, after the training of the preset graph self-encoder model is completed, the server 104 can input the initial undirected and unweighted graph G into the preset graph self-encoder model to predict the connection edges to be added to the long-tail nodes, so as to Update the relationship between the long-tail node and other user nodes, or the relationship between the long-tail node and other item nodes, that is, expand the relationship information between the long-tail node and other nodes to generate the target adjacency matrix . Among them, the preset graph autoencoder model (Graph Autoencoders, GAE) is a model that uses input information as an encoder to reconstruct the original graph. The target adjacency matrix can be expressed as A'. The calculation formula of the target adjacency matrix A' is shown in formula (4), formula (5), formula (6) and formula (7).

H=Arelu(AXL1)L2  (4)H=Arelu(AXL 1 )L 2 (4)

AP=softmax(HHT)  (5)AP=softmax(HH T ) (5)

AM=Bernoulli(AP)  (6)AM=Bernoulli(AP) (6)

A=Clamp(AM+A)  (7)A =Clamp(AM+A) (7)

其中,AP表示目标邻接矩阵的第一中间变量;softmax()表示归一化指数函数;AM表示目标邻接矩阵的第二中间变量;Bernoulli()表示伯努利采样;Clamp()表示将矩阵元素值截断到[0,1]之间;A’表示目标邻接矩阵。Among them, AP represents the first intermediate variable of the target adjacency matrix; softmax() represents the normalized exponential function; AM represents the second intermediate variable of the target adjacency matrix; Bernoulli() represents Bernoulli sampling; Clamp() represents the matrix element Values are truncated to [0,1]; A' represents the target adjacency matrix.

步骤740,根据目标邻接矩阵及特征矩阵,生成目标无向无权图。Step 740: Generate a target undirected and unweighted graph according to the target adjacency matrix and feature matrix.

可选地,服务器104可以根据目标邻接矩阵A’和特征矩阵X,生成目标无向无权图G’。其中,G’=(A’,X)。其中,目标邻接矩阵是指对长尾节点与其他节点之间的关系信息进行扩充后的邻接矩阵。目标无向无权图是指对初始无向无权图中的长尾节点与其他节点之间的关系进行信息扩充后的无向无权图。Optionally, the server 104 can generate the target undirected and unweighted graph G' according to the target adjacency matrix A' and the feature matrix X. Among them, G'=(A',X). Among them, the target adjacency matrix refers to the adjacency matrix after expanding the relationship information between the long tail node and other nodes. The target undirected and unweighted graph refers to the undirected and unweighted graph after the information expansion of the relationship between the long-tail nodes and other nodes in the initial undirected and unweighted graph.

本实施例中,将初始无向无权图输入至预设图自编码器模型中,对长尾节点的待增加连接边进行预测,生成目标邻接矩阵;根据目标邻接矩阵及特征矩阵,生成目标无向无权图,就能够扩充长尾用户不完善的反馈信息,从而生成包含更全面反馈信息的目标无向无权图。In this embodiment, the initial undirected and unweighted graph is input into the preset graph autoencoder model, and the connection edges to be added to the long-tail nodes are predicted to generate the target adjacency matrix; according to the target adjacency matrix and feature matrix, the target An undirected and unweighted graph can expand the imperfect feedback information of long-tail users, thereby generating a target undirected and unweighted graph that contains more comprehensive feedback information.

在一个实施例中,如图8所示,提供了一种物品推荐方法,还包括:In one embodiment, as shown in FIG. 8 , an item recommendation method is provided, which further includes:

步骤820,将初始无向无权图输入至初始图神经网络模型中进行图卷积处理,生成初始无向无权图对应的第一嵌入表征矩阵。Step 820: Input the initial undirected and unweighted graph into the initial graph neural network model to perform graph convolution processing to generate a first embedded representation matrix corresponding to the initial undirected and unweighted graph.

示例性的,如图9所示,图9为一个实施例中预设图神经网络模型的训练示意图。可选地,服务器104可以将初始无向无权图Z输入至初始图神经网络模型中进行图卷积处理,生成初始无向无权图G对应的第一嵌入表征矩阵。其中,嵌入表征矩阵可以表示为

Figure BDA0004045547950000101
且n表示节点总数,c表示嵌入表征维数,矩阵的每一行zi表示节点i的c维嵌入表征,且c远小于f。Φ=(W1,W2)表示初始图神经网络模型的模型参数。第一嵌入表征矩阵Z1的计算公式如公式(8)所示。Exemplarily, as shown in FIG. 9 , FIG. 9 is a schematic diagram of training a preset graph neural network model in an embodiment. Optionally, the server 104 may input the initial undirected and unweighted graph Z into the initial graph neural network model to perform graph convolution processing to generate the first embedded representation matrix corresponding to the initial undirected and unweighted graph G. Among them, the embedded representation matrix can be expressed as
Figure BDA0004045547950000101
And n represents the total number of nodes, c represents the embedded representation dimension, each row z i of the matrix represents the c-dimensional embedded representation of node i, and c is much smaller than f. Φ=(W 1 , W 2 ) represents the model parameters of the initial graph neural network model. The calculation formula of the first embedded representation matrix Z 1 is shown in formula (8).

Z1=Arelu(AXW1)W2  (8)Z 1 =Arelu(AXW 1 )W 2 (8)

其中,Z1表示第一嵌入表征矩阵;A表示初始邻接矩阵;relu()表示第一非线性激活函数,定义为h(x)=max(0,x);W1表示初始图神经网络模型的第一模型参数;W2表示初始图神经网络模型的第二模型参数。Among them, Z 1 represents the first embedded representation matrix; A represents the initial adjacency matrix; relu() represents the first nonlinear activation function, defined as h(x)=max(0,x); W 1 represents the initial graph neural network model The first model parameter of W ; W 2 represents the second model parameter of the initial graph neural network model.

步骤840,将目标无向无权图输入至初始图神经网络模型中进行图卷积处理,生成目标无向无权图对应的第二嵌入表征矩阵。Step 840: Input the target undirected and unweighted graph into the initial graph neural network model to perform graph convolution processing to generate a second embedded representation matrix corresponding to the target undirected and unweighted graph.

可选地,结合图9所示,服务器104可以将目标无向无权图G’输入至初始图神经网络模型中进行图卷积处理,生成目标无向无权图G’对应的第二嵌入表征矩阵。其中,第二嵌入表征矩阵Z2的的计算公式如公式(9)所示。Optionally, as shown in FIG. 9 , the server 104 may input the target undirected and unweighted graph G' into the initial graph neural network model for graph convolution processing, and generate the second embedding corresponding to the target undirected and unweighted graph G' representation matrix. Wherein, the calculation formula of the second embedded representation matrix Z 2 is shown in formula (9).

Z2=Arelu(AXW1)W2  (9)Z 2 =A relu(A XW 1 )W 2 (9)

其中,Z2表示第二嵌入表征矩阵;A’表示目标邻接矩阵;relu()表示第一非线性激活函数,定义为h(x)=max(0,x);W1表示初始图神经网络模型的第一模型参数;W2表示初始图神经网络模型的第二模型参数。Among them, Z 2 represents the second embedded representation matrix; A' represents the target adjacency matrix; relu() represents the first nonlinear activation function, defined as h(x)=max(0,x); W 1 represents the initial graph neural network The first model parameter of the model; W 2 represents the second model parameter of the initial graph neural network model.

步骤860,根据第一嵌入表征矩阵及第二嵌入表征矩阵计算初始图神经网络模型的损失函数的值,根据损失函数的值对初始图神经网络模型的模型参数进行更新,生成预设图神经网络模型。Step 860, calculate the value of the loss function of the initial graph neural network model according to the first embedded representation matrix and the second embedded representation matrix, update the model parameters of the initial graph neural network model according to the value of the loss function, and generate a preset graph neural network Model.

可选地,结合图9所示,服务器104可以根据第一嵌入表征矩阵Z1及第二嵌入表征矩阵Z2计算初始图神经网络模型的损失函数Lossq的值,并根据初始图神经网络模型的损失函数Lossq的值对初始图神经网络模型的模型参数Φ进行更新,直到初始图神经网络模型的损失函数Lossq最小时,使用此时初始图神经网络模型的损失函数Lossq对应的模型参数作为初始图神经网络模型的目标模型参数,从而生成训练好的预设图神经网络模型。其中,初始图神经网络模型的损失函数Lossq的计算公式如公式(10)所示。Optionally, as shown in FIG. 9, the server 104 can calculate the value of the loss function Loss q of the initial graph neural network model according to the first embedded representation matrix Z1 and the second embedded representation matrix Z2 , and according to the initial graph neural network model The value of the loss function Loss q of the initial graph neural network model is updated to the model parameter Φ until the loss function Loss q of the initial graph neural network model is the smallest, and the model corresponding to the loss function Loss q of the initial graph neural network model at this time is used The parameters are used as the target model parameters of the initial graph neural network model to generate a trained preset graph neural network model. Among them, the calculation formula of the loss function Loss q of the initial graph neural network model is shown in formula (10).

Lossq=CrossEntropy(Z1,Y)+CrossEntropy(Z2,Y)  (10)Loss q = CrossEntropy(Z 1 ,Y)+CrossEntropy(Z 2 ,Y) (10)

其中,Lossq表示初始图神经网络模型的损失函数;CrossEntropy()表示交叉熵损失函数,交叉熵损失函数是一种常用的深度学习模型损失函数,用于衡量两个概率分布之间的相似性;Z1表示第一嵌入表征矩阵;Y为已知且不变的节点标签;Z2表示第二嵌入表征矩阵。Among them, Loss q represents the loss function of the initial graph neural network model; CrossEntropy() represents the cross-entropy loss function, which is a commonly used deep learning model loss function and is used to measure the similarity between two probability distributions ; Z 1 represents the first embedded representation matrix; Y is the known and invariable node label; Z 2 represents the second embedded representation matrix.

本实施例中,将初始无向无权图输入至初始图神经网络模型中进行图卷积处理,生成初始无向无权图对应的第一嵌入表征矩阵;将目标无向无权图输入至初始图神经网络模型中进行图卷积处理,生成目标无向无权图对应的第二嵌入表征矩阵;根据第一嵌入表征矩阵及第二嵌入表征矩阵计算初始图神经网络模型的损失函数的值,根据损失函数的值对初始图神经网络模型的模型参数进行更新,生成预设图神经网络模型。本实施例通过初始无向无权图和长尾节点信息扩充后的目标无向无权图G’共同训练预设图神经网络模型,相比传统方法中只使用初始无向无权图G进行预设图神经网络模型训练的方法,显然,本申请实施例中的预设图神经网络模型训练方法更加准确,因此,本申请实施例能够训练生成更准确的预设图神经网络模型。In this embodiment, the initial undirected and unweighted graph is input into the initial graph neural network model for graph convolution processing, and the first embedded representation matrix corresponding to the initial undirected and unweighted graph is generated; the target undirected and unweighted graph is input into Perform graph convolution processing in the initial graph neural network model to generate the second embedded representation matrix corresponding to the target undirected and unweighted graph; calculate the value of the loss function of the initial graph neural network model according to the first embedded representation matrix and the second embedded representation matrix , according to the value of the loss function, the model parameters of the initial graph neural network model are updated to generate a preset graph neural network model. This embodiment uses the initial undirected and unweighted graph and the target undirected and unweighted graph G' after the expansion of long-tail node information to jointly train the preset graph neural network model. Compared with the traditional method, only the initial undirected and unweighted graph G is used. The training method of the preset graph neural network model, obviously, the preset graph neural network model training method in the embodiment of the present application is more accurate, therefore, the embodiment of the present application can train and generate a more accurate preset graph neural network model.

在一个实施例中,如图10所示,根据初始无向无权图及目标无向无权图,对长尾用户进行物品推荐,生成物品推荐结果,包括:In one embodiment, as shown in FIG. 10 , according to the initial undirected and unweighted graph and the target undirected and unweighted graph, items are recommended for long-tail users, and item recommendation results are generated, including:

步骤1020,将初始无向无权图输入预设图神经网络模型中进行图卷积处理,生成目标嵌入表征矩阵;预设图神经网络模型为基于初始无向无权图及目标无向无权图进行训练所得。Step 1020, input the initial undirected and unweighted graph into the preset graph neural network model for graph convolution processing to generate the target embedding representation matrix; the preset graph neural network model is based on the initial undirected and unweighted graph and the target undirected and unweighted graph Figure obtained from training.

可选地,在预设图神经网络模型训练完成之后,服务器104可以将初始无向无权图G输入预设图神经网络模型中进行图卷积处理,从而生成目标嵌入表征矩阵Z。其中,预设图神经网络模型为基于初始无向无权图及目标无向无权图进行训练所得到的图神经网络模型。图神经网络模型(graph neural network,GNN)是指使用神经网络来学习图结构数据,从而满足聚类、分类、预测、分割、生成等图学习任务需求的模型。可选地,本申请实施例中也可以使用图卷积神经网络模型进行处理,本申请对此不做限定。目标嵌入表征矩阵Z的每一行zi表示节点i的嵌入表征向量。Optionally, after the training of the preset graph neural network model is completed, the server 104 may input the initial undirected and unweighted graph G into the preset graph neural network model for graph convolution processing, thereby generating the target embedding representation matrix Z. Wherein, the preset graph neural network model is a graph neural network model obtained by training based on an initial undirected and unweighted graph and a target undirected and unweighted graph. A graph neural network model (graph neural network, GNN) refers to a model that uses a neural network to learn graph-structured data to meet the needs of graph learning tasks such as clustering, classification, prediction, segmentation, and generation. Optionally, in this embodiment of the application, a graph convolutional neural network model may also be used for processing, which is not limited in this application. Each row zi of the target embedding representation matrix Z represents the embedding representation vector of node i.

步骤1040,根据目标嵌入表征矩阵对长尾用户进行物品推荐,生成物品推荐结果。Step 1040, recommend items to long-tail users according to the target embedding representation matrix, and generate item recommendation results.

可选地,首先,服务器104可以获取待推荐的长尾用户编号i,即确定出待推荐的长尾用户i。其次,根据目标嵌入表征矩阵Z,服务器104可以计算长尾用户i的嵌入表征zi与所有待推荐物品(物品1,物品2,……,物品m)的嵌入表征zj之间的余弦相似度,并生成余弦相似度列表(s1,s2,s3,...,sm)。其中,m表示预先设置的待推荐物品列表长度,m表示余弦相似度列表的长度。sj表示长尾用户i的嵌入表征与物品j的嵌入表征之间的余弦相似度;余弦相似度又称余弦相似性,余弦相似度是通过计算两个向量的夹角余弦值来评估两个向量的相似度。在本申请实施例中,余弦相似度也可以替换为皮尔逊相关系数或者Jaccard相似系数(Jaccard similarity coefficient)。之后,对余弦相似度列表(s1,s2,s3,...,sm)中的各余弦相似度进行排序,生成余弦相似度排序结果。然后,从余弦相似度排序结果中选取长尾用户i对应的余弦相似度最高的预设个数(k个)的物品,并将长尾用户i对应的余弦相似度最高的预设个数(k个)的物品确定为目标物品。然后,将长尾用户i对应的目标物品输出至长尾用户i,即输出长尾用户i的物品推荐结果。其中,本申请实施例对预设个数(k个)不做限定。Optionally, first, the server 104 may obtain the long-tail user number i to be recommended, that is, determine the long-tail user i to be recommended. Secondly, according to the target embedding representation matrix Z , the server 104 can calculate the cosine similarity degree, and generate a cosine similarity list (s1, s2, s3,...,sm). Among them, m represents the length of the preset item list to be recommended, and m represents the length of the cosine similarity list. sj represents the cosine similarity between the embedded representation of long-tail user i and the embedded representation of item j; cosine similarity is also called cosine similarity, and cosine similarity is to evaluate two vectors by calculating the cosine value of the angle between them of similarity. In the embodiment of the present application, the cosine similarity may also be replaced by Pearson correlation coefficient or Jaccard similarity coefficient (Jaccard similarity coefficient). Afterwards, the cosine similarities in the cosine similarity list (s1, s2, s3,...,sm) are sorted to generate a cosine similarity sorted result. Then, select the items with the highest preset number (k) of cosine similarity corresponding to the long-tail user i from the cosine similarity sorting results, and the preset number (k) of the highest cosine similarity corresponding to the long-tail user i ( k) items are determined as target items. Then, output the target item corresponding to the long-tail user i to the long-tail user i, that is, output the item recommendation result of the long-tail user i. Wherein, the embodiment of the present application does not limit the preset number (k).

本实施例中,由于本申请实施例基于初始无向无权图及目标无向无权图训练出了更准确的预设图神经网络模型,因此,将初始无向无权图输入至更准确的预设图神经网络模型进行图卷积处理,就能够生成更准确的目标嵌入表征矩阵。之后,根据更准确的目标嵌入表征矩阵对长尾用户进行物品推荐,就能够生成更准确的物品推荐结果。In this embodiment, since the embodiment of the application has trained a more accurate preset graph neural network model based on the initial undirected and unweighted graph and the target undirected and unweighted graph, the initial undirected and unweighted graph is input into the more accurate By performing graph convolution processing on the preset graph neural network model, a more accurate target embedding representation matrix can be generated. Afterwards, according to the more accurate target embedding representation matrix to recommend items to long-tail users, more accurate item recommendation results can be generated.

在一个可选的实施例中,如图11所示,提供了一种物品推荐方法,以该方法应用于图1中的服务器104为例进行说明,包括以下步骤:In an optional embodiment, as shown in FIG. 11 , a method for item recommendation is provided. The method is applied to the server 104 in FIG. 1 as an example for illustration, including the following steps:

步骤1102,将用户节点、与用户节点对应的物品节点作为节点,将用户节点之间的关系、用户节点与物品节点之间的关系作为边,构建初始邻接矩阵;Step 1102, using user nodes and item nodes corresponding to the user nodes as nodes, and using the relationship between user nodes and the relationship between user nodes and item nodes as edges to construct an initial adjacency matrix;

步骤1104,获取用户节点的特征向量、物品节点的特征向量,根据用户节点的特征向量、物品节点的特征向量,生成特征矩阵;Step 1104, obtaining the feature vector of the user node and the feature vector of the item node, and generating a feature matrix according to the feature vector of the user node and the feature vector of the item node;

步骤1106,根据初始邻接矩阵及特征矩阵,构建初始无向无权图;用户节点包括与头部用户对应的头部节点及长尾用户对应的长尾节点;Step 1106, construct an initial undirected and unweighted graph according to the initial adjacency matrix and feature matrix; user nodes include head nodes corresponding to head users and long-tail nodes corresponding to long-tail users;

步骤1108,对初始无向无权图中的头部节点的连接边进行删除,生成新的无向无权图;Step 1108, delete the connection edge of the head node in the initial undirected and unweighted graph, and generate a new undirected and unweighted graph;

步骤1110,将新的无向无权图输入至初始图自编码器模型中进行处理,生成新的邻接矩阵;Step 1110, inputting the new undirected and unweighted graph into the initial graph autoencoder model for processing to generate a new adjacency matrix;

步骤1112,根据新的邻接矩阵计算初始图自编码器模型的损失函数的值,根据损失函数的值对初始图自编码器模型的模型参数进行更新,生成预设图自编码器模型;Step 1112, calculate the value of the loss function of the initial graph autoencoder model according to the new adjacency matrix, update the model parameters of the initial graph autoencoder model according to the value of the loss function, and generate a preset graph autoencoder model;

步骤1114,将初始无向无权图输入至预设图自编码器模型中,对长尾节点的待增加连接边进行预测,生成目标邻接矩阵;Step 1114, input the initial undirected and unweighted graph into the preset graph autoencoder model, predict the connection edges to be added to the long-tail nodes, and generate the target adjacency matrix;

步骤1116,根据目标邻接矩阵及特征矩阵,生成目标无向无权图;Step 1116, generate a target undirected and unweighted graph according to the target adjacency matrix and feature matrix;

步骤1118,将初始无向无权图输入至初始图神经网络模型中进行图卷积处理,生成初始无向无权图对应的第一嵌入表征矩阵;Step 1118, input the initial undirected and unweighted graph into the initial graph neural network model for graph convolution processing, and generate the first embedded representation matrix corresponding to the initial undirected and unweighted graph;

步骤1120,将目标无向无权图输入至初始图神经网络模型中进行图卷积处理,生成目标无向无权图对应的第二嵌入表征矩阵;Step 1120, input the target undirected and unweighted graph into the initial graph neural network model to perform graph convolution processing, and generate a second embedded representation matrix corresponding to the target undirected and unweighted graph;

步骤1122,根据第一嵌入表征矩阵及第二嵌入表征矩阵计算初始图神经网络模型的损失函数的值,根据损失函数的值对初始图神经网络模型的模型参数进行更新,生成预设图神经网络模型;Step 1122, calculate the value of the loss function of the initial graph neural network model according to the first embedded representation matrix and the second embedded representation matrix, update the model parameters of the initial graph neural network model according to the value of the loss function, and generate a preset graph neural network Model;

步骤1124,将初始无向无权图输入预设图神经网络模型中进行图卷积处理,生成目标嵌入表征矩阵;预设图神经网络模型为基于初始无向无权图及目标无向无权图进行训练所得;Step 1124, input the initial undirected and unweighted graph into the preset graph neural network model for graph convolution processing to generate the target embedding representation matrix; the preset graph neural network model is based on the initial undirected and unweighted graph and the target undirected and unweighted graph The graph is obtained through training;

步骤1126,根据目标嵌入表征矩阵对长尾用户进行物品推荐,生成物品推荐结果。Step 1126, recommend items to long-tail users according to the target embedding representation matrix, and generate item recommendation results.

上述物品推荐方法,根据用户节点、与用户节点对应的物品节点、用户节点之间的关系、用户节点与物品节点之间的关系,构建初始无向无权图;用户节点包括与头部用户对应的头部节点及长尾用户对应的长尾节点;将初始无向无权图输入至预设图自编码器模型中,对长尾节点与其他节点之间的关系进行更新,生成目标无向无权图;根据初始无向无权图及目标无向无权图,对长尾用户进行物品推荐,生成物品推荐结果。本申请通过将构建好的初始无向无权图输入至预设图自编码器模型中,对长尾节点与其他节点之间的关系进行更新,就能够扩充长尾用户不完善的反馈信息,从而生成包含更全面反馈信息的目标无向无权图。之后,根据构建的初始无向无权图及包含更全面反馈信息的目标无向无权图,就能够较准确地对长尾用户进行物品推荐,从而生成较准确的物品推荐结果。The above item recommendation method constructs an initial undirected and unweighted graph according to the user nodes, the item nodes corresponding to the user nodes, the relationship between user nodes, and the relationship between user nodes and item nodes; the user nodes include The head node and the long-tail node corresponding to the long-tail user; input the initial undirected and unweighted graph into the preset graph autoencoder model, update the relationship between the long-tail node and other nodes, and generate the target undirected Unweighted graph: According to the initial undirected and unweighted graph and the target undirected and unweighted graph, items are recommended for long-tail users, and item recommendation results are generated. This application can expand the imperfect feedback information of long-tail users by inputting the constructed initial undirected and unweighted graph into the preset graph autoencoder model and updating the relationship between long-tail nodes and other nodes. Thus, a target undirected and unweighted graph containing more comprehensive feedback information is generated. Afterwards, according to the constructed initial undirected and unweighted graph and the target undirected and unweighted graph containing more comprehensive feedback information, items can be more accurately recommended to long-tail users, thereby generating more accurate item recommendation results.

应该理解的是,虽然如上的各实施例所涉及的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,如上的各实施例所涉及的流程图中的至少一部分步骤可以包括多个步骤或者多个阶段,这些步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤中的步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although the steps in the flow charts involved in the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least some of the steps in the flow charts involved in the above embodiments may include multiple steps or stages, and these steps or stages are not necessarily executed at the same time, but may be executed at different times, The execution order of these steps or stages is not necessarily performed sequentially, but may be executed in turn or alternately with other steps or at least a part of steps or stages in other steps.

在一个可选的实施例中,如图12所示,提供了一种物品推荐系统1200,以该系统运行于图1中的服务器104为例进行说明,该物品推荐系统1200包括数据处理模块1220、长尾节点增强模块1240、图神经网络模块1260、推荐模块1280。In an optional embodiment, as shown in FIG. 12 , an item recommendation system 1200 is provided. The system runs on the server 104 in FIG. 1 as an example for illustration. The item recommendation system 1200 includes a data processing module 1220 , a long-tail node enhancement module 1240, a graph neural network module 1260, and a recommendation module 1280.

其中,数据处理模块1220用于根据各用户和各物品的信息生成初始无向无权图。数据处理模块1220包括:将用户和物品建模为节点,将用户对物品的反馈行为以及用户间的交互行为建模为边,得到初始邻接矩阵A;将用户和物品的特征信息独热编码为f维特征向量,得到特征矩阵X;根据邻接矩阵A以及特征矩阵X,构建出初始无向无权图G。Wherein, the data processing module 1220 is used to generate an initial undirected and unweighted graph according to the information of each user and each item. The data processing module 1220 includes: modeling users and items as nodes, modeling user feedback behaviors on items and interaction behaviors between users as edges to obtain an initial adjacency matrix A; one-hot encoding of feature information of users and items as The f-dimensional feature vector obtains the feature matrix X; according to the adjacency matrix A and the feature matrix X, an initial undirected and unweighted graph G is constructed.

其中,长尾节点增强模块1240用于基于初始无向无权图进行长尾节点增强,生成增强后的目标无向无权图。长尾节点增强模块1240包括:对初始无向无权图G中的头部节点进行随机删边处理;根据随机删边后的无向无权图训练更新预设图自编码器模型;使用预设图自编码器模型预测对长尾节点增加的连接边,输出目标无向无权图G’。Wherein, the long-tail node enhancement module 1240 is configured to perform long-tail node enhancement based on the initial undirected and unweighted graph, and generate an enhanced target undirected and unweighted graph. The long-tail node enhancement module 1240 includes: performing random edge deletion processing on the head nodes in the initial undirected and unweighted graph G; updating the preset graph autoencoder model according to the undirected and unweighted graph training after random edge deletion; The graph self-encoder model is set to predict the connection edges added to the long-tail nodes, and the target undirected and unweighted graph G' is output.

其中,图神经网络模块1260用于根据初始无向无权图和目标无向无权图进行嵌入表征矩阵的预测,生成目标嵌入表征矩阵。图神经网络模块1260包括:根据初始无向无权图G和目标无向无权图G’训练更新预设图神经网络模型;将初始无向无权图G输入至预设图神经网络模型中进行处理,输出目标嵌入表征矩阵Z。Wherein, the graph neural network module 1260 is used to predict the embedding representation matrix according to the initial undirected and unweighted graph and the target undirected and unweighted graph, and generate the target embedding representation matrix. The graph neural network module 1260 includes: training and updating the preset graph neural network model according to the initial undirected and unweighted graph G and the target undirected and unweighted graph G'; inputting the initial undirected and unweighted graph G into the preset graph neural network model After processing, the target embedding representation matrix Z is output.

其中,推荐模块1280用于根据长尾用户对应的用户编号i和目标嵌入表征矩阵对对长尾用户进行个性化物品推荐。推荐模块1280包括:计算指定长尾用户i和所有物品的嵌入表征之间的余弦相似度;对物品按照余弦相似度进行排序,并选择前k个物品作为个性化推荐结果输出。Among them, the recommendation module 1280 is used to recommend personalized items to long-tail users according to the user number i corresponding to the long-tail users and the target embedding representation matrix. The recommendation module 1280 includes: calculating the cosine similarity between the specified long-tail user i and the embedded representations of all items; sorting the items according to the cosine similarity, and selecting the top k items as personalized recommendation results for output.

基于同样的发明构思,本申请实施例还提供了一种用于实现上述所涉及的物品推荐方法的物品推荐装置。该装置所提供的解决问题的实现方案与上述方法中所记载的实现方案相似,故下面所提供的一个或多个物品推荐装置实施例中的具体限定可以参见上文中对于物品推荐方法的限定,在此不再赘述。Based on the same inventive concept, an embodiment of the present application further provides an item recommendation device for implementing the above-mentioned item recommendation method. The solution to the problem provided by the device is similar to the implementation described in the above method, so the specific limitations in one or more embodiments of the item recommendation device provided below can refer to the above-mentioned limitations on the item recommendation method, I won't repeat them here.

在一个实施例中,如图13所示,提供了一种物品推荐装置1300,包括:初始无向无权图构建模块1320、目标无向无权图生成模块1340和物品推荐结果生成模块1360,其中:In one embodiment, as shown in FIG. 13 , an item recommendation device 1300 is provided, including: an initial undirected and unweighted graph construction module 1320, a target undirected and unweighted graph generation module 1340, and an item recommendation result generation module 1360, in:

初始无向无权图构建模块1320,用于根据用户节点、与用户节点对应的物品节点、用户节点之间的关系、用户节点与物品节点之间的关系,构建初始无向无权图;用户节点包括与头部用户对应的头部节点及长尾用户对应的长尾节点。The initial undirected and unweighted graph construction module 1320 is used to construct an initial undirected and unweighted graph according to the user nodes, item nodes corresponding to the user nodes, the relationship between user nodes, and the relationship between user nodes and item nodes; The nodes include head nodes corresponding to head users and long tail nodes corresponding to long tail users.

目标无向无权图生成模块1340,用于将初始无向无权图输入至预设图自编码器模型中,对长尾节点与其他节点之间的关系进行更新,生成目标无向无权图。The target undirected and unweighted graph generation module 1340 is used to input the initial undirected and unweighted graph into the preset graph autoencoder model, update the relationship between long tail nodes and other nodes, and generate the target undirected and unweighted graph picture.

物品推荐结果生成模块1360,用于根据初始无向无权图及目标无向无权图,对长尾用户进行物品推荐,生成物品推荐结果。The item recommendation result generating module 1360 is configured to recommend items to long-tail users according to the initial undirected and unweighted graph and the target undirected and unweighted graph, and generate item recommendation results.

在一个实施例中,初始无向无权图构建模块1320包括:In one embodiment, the initial undirected and unweighted graph construction module 1320 includes:

初始邻接矩阵构建单元,用于将用户节点、与用户节点对应的物品节点作为节点,将用户节点之间的关系、用户节点与物品节点之间的关系作为边,构建初始邻接矩阵;The initial adjacency matrix construction unit is used to use user nodes and item nodes corresponding to the user nodes as nodes, and use the relationship between user nodes and the relationship between user nodes and item nodes as edges to construct an initial adjacency matrix;

特征矩阵生成单元,用于获取用户节点的特征向量、物品节点的特征向量,根据用户节点的特征向量、物品节点的特征向量,生成特征矩阵;A feature matrix generation unit is used to obtain the feature vector of the user node and the feature vector of the item node, and generate a feature matrix according to the feature vector of the user node and the feature vector of the item node;

初始无向无权图构建单元,用于根据初始邻接矩阵及特征矩阵,构建初始无向无权图。The initial undirected and unweighted graph construction unit is used to construct the initial undirected and unweighted graph according to the initial adjacency matrix and the feature matrix.

在一个实施例中,物品推荐装置1300还包括:In one embodiment, the item recommendation device 1300 further includes:

新的无向无权图生成模块,用于对初始无向无权图中的头部节点的连接边进行删除,生成新的无向无权图;The new undirected and unweighted graph generation module is used to delete the connection edges of the head nodes in the initial undirected and unweighted graph to generate a new undirected and unweighted graph;

新的邻接矩阵生成模块,用于将新的无向无权图输入至初始图自编码器模型中进行处理,生成新的邻接矩阵;The new adjacency matrix generation module is used to input the new undirected and unweighted graph into the initial graph autoencoder model for processing to generate a new adjacency matrix;

预设图自编码器模型生成模块,用于根据新的邻接矩阵计算初始图自编码器模型的损失函数的值,根据损失函数的值对初始图自编码器模型的模型参数进行更新,生成预设图自编码器模型。The preset graph autoencoder model generation module is used to calculate the value of the loss function of the initial graph autoencoder model according to the new adjacency matrix, update the model parameters of the initial graph autoencoder model according to the value of the loss function, and generate the predicted Build a graph autoencoder model.

在一个实施例中,目标无向无权图生成模块1340包括:In one embodiment, the target undirected and unweighted graph generation module 1340 includes:

目标邻接矩阵生成单元,用于将初始无向无权图输入至预设图自编码器模型中,对长尾节点的待增加连接边进行预测,生成目标邻接矩阵;The target adjacency matrix generation unit is used to input the initial undirected and unweighted graph into the preset graph autoencoder model, predict the connection edges to be added to the long-tail nodes, and generate the target adjacency matrix;

目标无向无权图生成单元,用于根据目标邻接矩阵及特征矩阵,生成目标无向无权图。The target undirected and unweighted graph generation unit is used to generate the target undirected and unweighted graph according to the target adjacency matrix and the feature matrix.

在一个实施例中,物品推荐装置1300还包括:In one embodiment, the item recommendation device 1300 further includes:

第一嵌入表征矩阵生成模块,用于将初始无向无权图输入至初始图神经网络模型中进行图卷积处理,生成初始无向无权图对应的第一嵌入表征矩阵;The first embedding representation matrix generation module is used to input the initial undirected and unweighted graph into the initial graph neural network model to perform graph convolution processing, and generate the first embedding representation matrix corresponding to the initial undirected and unweighted graph;

第二嵌入表征矩阵生成模块,用于将目标无向无权图输入至初始图神经网络模型中进行图卷积处理,生成目标无向无权图对应的第二嵌入表征矩阵;The second embedding representation matrix generation module is used to input the target undirected and unweighted graph into the initial graph neural network model to perform graph convolution processing, and generate the second embedding representation matrix corresponding to the target undirected and unweighted graph;

预设图神经网络模型生成模块,用于根据第一嵌入表征矩阵及第二嵌入表征矩阵计算初始图神经网络模型的损失函数的值,根据损失函数的值对初始图神经网络模型的模型参数进行更新,生成预设图神经网络模型。The preset graph neural network model generation module is used to calculate the value of the loss function of the initial graph neural network model according to the first embedding representation matrix and the second embedding representation matrix, and calculate the model parameters of the initial graph neural network model according to the value of the loss function Update, generate preset graph neural network model.

在一个实施例中,物品推荐结果生成模块1360包括:In one embodiment, the item recommendation result generation module 1360 includes:

目标嵌入表征矩阵生成单元,用于将初始无向无权图输入预设图神经网络模型中进行图卷积处理,生成目标嵌入表征矩阵;预设图神经网络模型为基于初始无向无权图及目标无向无权图进行训练所得;The target embedding representation matrix generation unit is used to input the initial undirected and unweighted graph into the preset graph neural network model for graph convolution processing to generate the target embedded representation matrix; the preset graph neural network model is based on the initial undirected and unweighted graph And the target undirected and unweighted graph is obtained from training;

物品推荐结果生成单元,用于根据目标嵌入表征矩阵对长尾用户进行物品推荐,生成物品推荐结果。The item recommendation result generating unit is configured to recommend items to long-tail users according to the target embedding representation matrix, and generate item recommendation results.

上述物品推荐装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。Each module in the above item recommending device can be fully or partially realized by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, and can also be stored in the memory of the computer device in the form of software, so that the processor can invoke and execute the corresponding operations of the above-mentioned modules.

在一个实施例中,提供了一种计算机设备,该计算机设备可以是服务器,其内部结构图可以如图14所示。该计算机设备包括处理器、存储器、输入/输出接口(Input/Output,简称I/O)和通信接口。其中,处理器、存储器和输入/输出接口通过系统总线连接,通信接口通过输入/输出接口连接到系统总线。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质和内存储器。该非易失性存储介质存储有操作系统、计算机程序和数据库。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的数据库用于存储物品推荐数据。该计算机设备的输入/输出接口用于处理器与外部设备之间交换信息。该计算机设备的通信接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种物品推荐方法。In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure may be as shown in FIG. 14 . The computer device includes a processor, a memory, an input/output interface (Input/Output, I/O for short), and a communication interface. Wherein, the processor, the memory and the input/output interface are connected through the system bus, and the communication interface is connected to the system bus through the input/output interface. Wherein, the processor of the computer device is used to provide calculation and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs and databases. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database of the computer device is used to store item recommendation data. The input/output interface of the computer device is used for exchanging information between the processor and external devices. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, an item recommendation method is realized.

本领域技术人员可以理解,图14中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art can understand that the structure shown in Figure 14 is only a block diagram of a partial structure related to the solution of this application, and does not constitute a limitation on the computer equipment on which the solution of this application is applied. The specific computer equipment can be More or fewer components than shown in the figures may be included, or some components may be combined, or have a different arrangement of components.

在一个实施例中,提供了一种计算机设备,包括存储器和处理器,存储器中存储有计算机程序,该处理器执行计算机程序时实现以下步骤:In one embodiment, a computer device is provided, including a memory and a processor, a computer program is stored in the memory, and the processor implements the following steps when executing the computer program:

根据用户节点、与用户节点对应的物品节点、用户节点之间的关系、用户节点与物品节点之间的关系,构建初始无向无权图;用户节点包括与头部用户对应的头部节点及长尾用户对应的长尾节点;According to the user node, the item node corresponding to the user node, the relationship between the user nodes, and the relationship between the user node and the item node, the initial undirected and unweighted graph is constructed; the user node includes the head node corresponding to the head user and The long-tail node corresponding to the long-tail user;

将初始无向无权图输入至预设图自编码器模型中,对长尾节点与其他节点之间的关系进行更新,生成目标无向无权图;Input the initial undirected and unweighted graph into the preset graph autoencoder model, update the relationship between long-tail nodes and other nodes, and generate the target undirected and unweighted graph;

根据初始无向无权图及目标无向无权图,对长尾用户进行物品推荐,生成物品推荐结果。According to the initial undirected and unweighted graph and the target undirected and unweighted graph, items are recommended for long-tail users, and item recommendation results are generated.

在一个实施例中,根据用户节点、与用户节点对应的物品节点、用户节点之间的关系、用户节点与物品节点之间的关系,构建初始无向无权图,处理器执行计算机程序时还实现以下步骤:In one embodiment, an initial undirected and unweighted graph is constructed according to the user nodes, the item nodes corresponding to the user nodes, the relationship between user nodes, and the relationship between user nodes and item nodes. When the processor executes the computer program, it also Implement the following steps:

将用户节点、与用户节点对应的物品节点作为节点,将用户节点之间的关系、用户节点与物品节点之间的关系作为边,构建初始邻接矩阵;Use user nodes and item nodes corresponding to user nodes as nodes, and use the relationship between user nodes and the relationship between user nodes and item nodes as edges to construct an initial adjacency matrix;

获取用户节点的特征向量、物品节点的特征向量,根据用户节点的特征向量、物品节点的特征向量,生成特征矩阵;Obtain the feature vector of the user node and the feature vector of the item node, and generate a feature matrix according to the feature vector of the user node and the feature vector of the item node;

根据初始邻接矩阵及特征矩阵,构建初始无向无权图。According to the initial adjacency matrix and feature matrix, the initial undirected and unweighted graph is constructed.

在一个实施例中,处理器执行计算机程序时还实现以下步骤:In one embodiment, the following steps are also implemented when the processor executes the computer program:

对初始无向无权图中的头部节点的连接边进行删除,生成新的无向无权图;Delete the connection edges of the head nodes in the initial undirected and unweighted graph to generate a new undirected and unweighted graph;

将新的无向无权图输入至初始图自编码器模型中进行处理,生成新的邻接矩阵;Input the new undirected and unweighted graph into the initial graph autoencoder model for processing to generate a new adjacency matrix;

根据新的邻接矩阵计算初始图自编码器模型的损失函数的值,根据损失函数的值对初始图自编码器模型的模型参数进行更新,生成预设图自编码器模型。Calculate the value of the loss function of the initial graph autoencoder model according to the new adjacency matrix, update the model parameters of the initial graph autoencoder model according to the value of the loss function, and generate a preset graph autoencoder model.

在一个实施例中,将初始无向无权图输入至预设图自编码器模型中,对长尾节点与其他节点之间的关系进行更新,生成目标无向无权图,处理器执行计算机程序时还实现以下步骤:In one embodiment, the initial undirected and unweighted graph is input into the preset graph autoencoder model, and the relationship between the long tail node and other nodes is updated to generate the target undirected and unweighted graph, and the processor executes the computer The procedure also implements the following steps:

将初始无向无权图输入至预设图自编码器模型中,对长尾节点的待增加连接边进行预测,生成目标邻接矩阵;Input the initial undirected and unweighted graph into the preset graph autoencoder model, predict the connection edges to be added to the long-tail nodes, and generate the target adjacency matrix;

根据目标邻接矩阵及特征矩阵,生成目标无向无权图。According to the target adjacency matrix and feature matrix, the target undirected and unweighted graph is generated.

在一个实施例中,处理器执行计算机程序时还实现以下步骤:In one embodiment, the following steps are also implemented when the processor executes the computer program:

将初始无向无权图输入至初始图神经网络模型中进行图卷积处理,生成初始无向无权图对应的第一嵌入表征矩阵;Inputting the initial undirected and unweighted graph into the initial graph neural network model for graph convolution processing to generate a first embedded representation matrix corresponding to the initial undirected and unweighted graph;

将目标无向无权图输入至初始图神经网络模型中进行图卷积处理,生成目标无向无权图对应的第二嵌入表征矩阵;Inputting the target undirected and unweighted graph into the initial graph neural network model for graph convolution processing to generate a second embedded representation matrix corresponding to the target undirected and unweighted graph;

根据第一嵌入表征矩阵及第二嵌入表征矩阵计算初始图神经网络模型的损失函数的值,根据损失函数的值对初始图神经网络模型的模型参数进行更新,生成预设图神经网络模型。Calculate the value of the loss function of the initial graph neural network model according to the first embedded representation matrix and the second embedded representation matrix, update the model parameters of the initial graph neural network model according to the value of the loss function, and generate a preset graph neural network model.

在一个实施例中,根据初始无向无权图及目标无向无权图,对长尾用户进行物品推荐,生成物品推荐结果,处理器执行计算机程序时还实现以下步骤:In one embodiment, according to the initial undirected and unweighted graph and the target undirected and unweighted graph, items are recommended for long-tail users, and item recommendation results are generated. When the processor executes the computer program, the following steps are also implemented:

将初始无向无权图输入预设图神经网络模型中进行图卷积处理,生成目标嵌入表征矩阵;预设图神经网络模型为基于初始无向无权图及目标无向无权图进行训练所得;Input the initial undirected and unweighted graph into the preset graph neural network model for graph convolution processing to generate the target embedding representation matrix; the preset graph neural network model is trained based on the initial undirected and unweighted graph and the target undirected and unweighted graph income;

根据目标嵌入表征矩阵对长尾用户进行物品推荐,生成物品推荐结果。According to the target embedding representation matrix, items are recommended for long-tail users, and item recommendation results are generated.

在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现以下步骤:In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

根据用户节点、与用户节点对应的物品节点、用户节点之间的关系、用户节点与物品节点之间的关系,构建初始无向无权图;用户节点包括与头部用户对应的头部节点及长尾用户对应的长尾节点;According to the user node, the item node corresponding to the user node, the relationship between the user nodes, and the relationship between the user node and the item node, the initial undirected and unweighted graph is constructed; the user node includes the head node corresponding to the head user and The long-tail node corresponding to the long-tail user;

将初始无向无权图输入至预设图自编码器模型中,对长尾节点与其他节点之间的关系进行更新,生成目标无向无权图;Input the initial undirected and unweighted graph into the preset graph autoencoder model, update the relationship between long-tail nodes and other nodes, and generate the target undirected and unweighted graph;

根据初始无向无权图及目标无向无权图,对长尾用户进行物品推荐,生成物品推荐结果。According to the initial undirected and unweighted graph and the target undirected and unweighted graph, items are recommended for long-tail users, and item recommendation results are generated.

在一个实施例中,根据用户节点、与用户节点对应的物品节点、用户节点之间的关系、用户节点与物品节点之间的关系,构建初始无向无权图,计算机程序被处理器执行时还实现以下步骤:In one embodiment, an initial undirected and unweighted graph is constructed according to the user nodes, the item nodes corresponding to the user nodes, the relationship between user nodes, and the relationship between user nodes and item nodes. When the computer program is executed by the processor Also implement the following steps:

将用户节点、与用户节点对应的物品节点作为节点,将用户节点之间的关系、用户节点与物品节点之间的关系作为边,构建初始邻接矩阵;Use user nodes and item nodes corresponding to user nodes as nodes, and use the relationship between user nodes and the relationship between user nodes and item nodes as edges to construct an initial adjacency matrix;

获取用户节点的特征向量、物品节点的特征向量,根据用户节点的特征向量、物品节点的特征向量,生成特征矩阵;Obtain the feature vector of the user node and the feature vector of the item node, and generate a feature matrix according to the feature vector of the user node and the feature vector of the item node;

根据初始邻接矩阵及特征矩阵,构建初始无向无权图。According to the initial adjacency matrix and feature matrix, the initial undirected and unweighted graph is constructed.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by the processor, the following steps are also implemented:

对初始无向无权图中的头部节点的连接边进行删除,生成新的无向无权图;Delete the connection edges of the head nodes in the initial undirected and unweighted graph to generate a new undirected and unweighted graph;

将新的无向无权图输入至初始图自编码器模型中进行处理,生成新的邻接矩阵;Input the new undirected and unweighted graph into the initial graph autoencoder model for processing to generate a new adjacency matrix;

根据新的邻接矩阵计算初始图自编码器模型的损失函数的值,根据损失函数的值对初始图自编码器模型的模型参数进行更新,生成预设图自编码器模型。Calculate the value of the loss function of the initial graph autoencoder model according to the new adjacency matrix, update the model parameters of the initial graph autoencoder model according to the value of the loss function, and generate a preset graph autoencoder model.

在一个实施例中,将初始无向无权图输入至预设图自编码器模型中,对长尾节点与其他节点之间的关系进行更新,生成目标无向无权图,计算机程序被处理器执行时还实现以下步骤:In one embodiment, the initial undirected and unweighted graph is input into the preset graph autoencoder model, the relationship between the long-tail nodes and other nodes is updated, and the target undirected and unweighted graph is generated, and the computer program is processed The following steps are also implemented when the controller executes:

将初始无向无权图输入至预设图自编码器模型中,对长尾节点的待增加连接边进行预测,生成目标邻接矩阵;Input the initial undirected and unweighted graph into the preset graph autoencoder model, predict the connection edges to be added to the long-tail nodes, and generate the target adjacency matrix;

根据目标邻接矩阵及特征矩阵,生成目标无向无权图。According to the target adjacency matrix and feature matrix, the target undirected and unweighted graph is generated.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by the processor, the following steps are also implemented:

将初始无向无权图输入至初始图神经网络模型中进行图卷积处理,生成初始无向无权图对应的第一嵌入表征矩阵;Inputting the initial undirected and unweighted graph into the initial graph neural network model for graph convolution processing to generate a first embedded representation matrix corresponding to the initial undirected and unweighted graph;

将目标无向无权图输入至初始图神经网络模型中进行图卷积处理,生成目标无向无权图对应的第二嵌入表征矩阵;Inputting the target undirected and unweighted graph into the initial graph neural network model for graph convolution processing to generate a second embedded representation matrix corresponding to the target undirected and unweighted graph;

根据第一嵌入表征矩阵及第二嵌入表征矩阵计算初始图神经网络模型的损失函数的值,根据损失函数的值对初始图神经网络模型的模型参数进行更新,生成预设图神经网络模型。Calculate the value of the loss function of the initial graph neural network model according to the first embedded representation matrix and the second embedded representation matrix, update the model parameters of the initial graph neural network model according to the value of the loss function, and generate a preset graph neural network model.

在一个实施例中,根据初始无向无权图及目标无向无权图,对长尾用户进行物品推荐,生成物品推荐结果,计算机程序被处理器执行时还实现以下步骤:In one embodiment, according to the initial undirected and unweighted graph and the target undirected and unweighted graph, items are recommended for long-tail users, and item recommendation results are generated. When the computer program is executed by the processor, the following steps are also implemented:

将初始无向无权图输入预设图神经网络模型中进行图卷积处理,生成目标嵌入表征矩阵;预设图神经网络模型为基于初始无向无权图及目标无向无权图进行训练所得;Input the initial undirected and unweighted graph into the preset graph neural network model for graph convolution processing to generate the target embedding representation matrix; the preset graph neural network model is trained based on the initial undirected and unweighted graph and the target undirected and unweighted graph income;

根据目标嵌入表征矩阵对长尾用户进行物品推荐,生成物品推荐结果。According to the target embedding representation matrix, items are recommended for long-tail users, and item recommendation results are generated.

在一个实施例中,提供了一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现以下步骤:In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

根据用户节点、与用户节点对应的物品节点、用户节点之间的关系、用户节点与物品节点之间的关系,构建初始无向无权图;用户节点包括与头部用户对应的头部节点及长尾用户对应的长尾节点;According to the user node, the item node corresponding to the user node, the relationship between the user nodes, and the relationship between the user node and the item node, the initial undirected and unweighted graph is constructed; the user node includes the head node corresponding to the head user and The long-tail node corresponding to the long-tail user;

将初始无向无权图输入至预设图自编码器模型中,对长尾节点与其他节点之间的关系进行更新,生成目标无向无权图;Input the initial undirected and unweighted graph into the preset graph autoencoder model, update the relationship between long-tail nodes and other nodes, and generate the target undirected and unweighted graph;

根据初始无向无权图及目标无向无权图,对长尾用户进行物品推荐,生成物品推荐结果。According to the initial undirected and unweighted graph and the target undirected and unweighted graph, items are recommended for long-tail users, and item recommendation results are generated.

在一个实施例中,根据用户节点、与用户节点对应的物品节点、用户节点之间的关系、用户节点与物品节点之间的关系,构建初始无向无权图,计算机程序被处理器执行时还实现以下步骤:In one embodiment, an initial undirected and unweighted graph is constructed according to the user nodes, the item nodes corresponding to the user nodes, the relationship between user nodes, and the relationship between user nodes and item nodes. When the computer program is executed by the processor Also implement the following steps:

将用户节点、与用户节点对应的物品节点作为节点,将用户节点之间的关系、用户节点与物品节点之间的关系作为边,构建初始邻接矩阵;Use user nodes and item nodes corresponding to user nodes as nodes, and use the relationship between user nodes and the relationship between user nodes and item nodes as edges to construct an initial adjacency matrix;

获取用户节点的特征向量、物品节点的特征向量,根据用户节点的特征向量、物品节点的特征向量,生成特征矩阵;Obtain the feature vector of the user node and the feature vector of the item node, and generate a feature matrix according to the feature vector of the user node and the feature vector of the item node;

根据初始邻接矩阵及特征矩阵,构建初始无向无权图。According to the initial adjacency matrix and feature matrix, the initial undirected and unweighted graph is constructed.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by the processor, the following steps are also implemented:

对初始无向无权图中的头部节点的连接边进行删除,生成新的无向无权图;Delete the connection edges of the head nodes in the initial undirected and unweighted graph to generate a new undirected and unweighted graph;

将新的无向无权图输入至初始图自编码器模型中进行处理,生成新的邻接矩阵;Input the new undirected and unweighted graph into the initial graph autoencoder model for processing to generate a new adjacency matrix;

根据新的邻接矩阵计算初始图自编码器模型的损失函数的值,根据损失函数的值对初始图自编码器模型的模型参数进行更新,生成预设图自编码器模型。Calculate the value of the loss function of the initial graph autoencoder model according to the new adjacency matrix, update the model parameters of the initial graph autoencoder model according to the value of the loss function, and generate a preset graph autoencoder model.

在一个实施例中,将初始无向无权图输入至预设图自编码器模型中,对长尾节点与其他节点之间的关系进行更新,生成目标无向无权图,计算机程序被处理器执行时还实现以下步骤:In one embodiment, the initial undirected and unweighted graph is input into the preset graph autoencoder model, the relationship between the long-tail nodes and other nodes is updated, and the target undirected and unweighted graph is generated, and the computer program is processed The following steps are also implemented when the controller executes:

将初始无向无权图输入至预设图自编码器模型中,对长尾节点的待增加连接边进行预测,生成目标邻接矩阵;Input the initial undirected and unweighted graph into the preset graph autoencoder model, predict the connection edges to be added to the long-tail nodes, and generate the target adjacency matrix;

根据目标邻接矩阵及特征矩阵,生成目标无向无权图。According to the target adjacency matrix and feature matrix, the target undirected and unweighted graph is generated.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by the processor, the following steps are also implemented:

将初始无向无权图输入至初始图神经网络模型中进行图卷积处理,生成初始无向无权图对应的第一嵌入表征矩阵;Inputting the initial undirected and unweighted graph into the initial graph neural network model for graph convolution processing to generate a first embedded representation matrix corresponding to the initial undirected and unweighted graph;

将目标无向无权图输入至初始图神经网络模型中进行图卷积处理,生成目标无向无权图对应的第二嵌入表征矩阵;Inputting the target undirected and unweighted graph into the initial graph neural network model for graph convolution processing to generate a second embedded representation matrix corresponding to the target undirected and unweighted graph;

根据第一嵌入表征矩阵及第二嵌入表征矩阵计算初始图神经网络模型的损失函数的值,根据损失函数的值对初始图神经网络模型的模型参数进行更新,生成预设图神经网络模型。Calculate the value of the loss function of the initial graph neural network model according to the first embedded representation matrix and the second embedded representation matrix, update the model parameters of the initial graph neural network model according to the value of the loss function, and generate a preset graph neural network model.

在一个实施例中,根据初始无向无权图及目标无向无权图,对长尾用户进行物品推荐,生成物品推荐结果,计算机程序被处理器执行时还实现以下步骤:In one embodiment, according to the initial undirected and unweighted graph and the target undirected and unweighted graph, items are recommended for long-tail users, and item recommendation results are generated. When the computer program is executed by the processor, the following steps are also implemented:

将初始无向无权图输入预设图神经网络模型中进行图卷积处理,生成目标嵌入表征矩阵;预设图神经网络模型为基于初始无向无权图及目标无向无权图进行训练所得;Input the initial undirected and unweighted graph into the preset graph neural network model for graph convolution processing to generate the target embedding representation matrix; the preset graph neural network model is trained based on the initial undirected and unweighted graph and the target undirected and unweighted graph income;

根据目标嵌入表征矩阵对长尾用户进行物品推荐,生成物品推荐结果。According to the target embedding representation matrix, items are recommended for long-tail users, and item recommendation results are generated.

需要说明的是,本申请所涉及的用户信息(包括但不限于用户设备信息、用户个人信息等)和数据(包括但不限于用于分析的数据、存储的数据、展示的数据等),均为经用户授权或者经过各方充分授权的信息和数据,且相关数据的收集、使用和处理需要遵守相关国家和地区的相关法律法规和标准。It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all It is information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.

本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、数据库或其它介质的任何引用,均可包括非易失性和易失性存储器中的至少一种。非易失性存储器可包括只读存储器(Read-OnlyMemory,ROM)、磁带、软盘、闪存、光存储器、高密度嵌入式非易失性存储器、阻变存储器(ReRAM)、磁变存储器(Magnetoresistive Random Access Memory,MRAM)、铁电存储器(Ferroelectric Random Access Memory,FRAM)、相变存储器(Phase Change Memory,PCM)、石墨烯存储器等。易失性存储器可包括随机存取存储器(Random Access Memory,RAM)或外部高速缓冲存储器等。作为说明而非局限,RAM可以是多种形式,比如静态随机存取存储器(Static Random Access Memory,SRAM)或动态随机存取存储器(Dynamic RandomAccess Memory,DRAM)等。本申请所提供的各实施例中所涉及的数据库可包括关系型数据库和非关系型数据库中至少一种。非关系型数据库可包括基于区块链的分布式数据库等,不限于此。本申请所提供的各实施例中所涉及的处理器可为通用处理器、中央处理器、图形处理器、数字信号处理器、可编程逻辑器、基于量子计算的数据处理逻辑器等,不限于此。Those of ordinary skill in the art can understand that realizing all or part of the processes in the methods of the above embodiments can be completed by instructing related hardware through computer programs, and the computer programs can be stored in a non-volatile computer-readable storage medium , when the computer program is executed, it may include the procedures of the embodiments of the above-mentioned methods. Wherein, any reference to storage, database or other media used in the various embodiments provided in the present application may include at least one of non-volatile and volatile storage. Non-volatile memory can include read-only memory (Read-Only Memory, ROM), tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive variable memory (ReRAM), magnetic variable memory (Magnetoresistive Random Access Memory, MRAM), Ferroelectric Random Access Memory (FRAM), Phase Change Memory (Phase Change Memory, PCM), graphene memory, etc. The volatile memory may include random access memory (Random Access Memory, RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the various embodiments provided in this application may include at least one of a relational database and a non-relational database. The non-relational database may include a blockchain-based distributed database, etc., but is not limited thereto. The processors involved in the various embodiments provided by this application can be general-purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, data processing logic devices based on quantum computing, etc., and are not limited to this.

以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments can be combined arbitrarily. To make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be It is considered to be within the range described in this specification.

以上实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请的保护范围应以所附权利要求为准。The above examples only express several implementation modes of the present application, and the description thereof is relatively specific and detailed, but should not be construed as limiting the patent scope of the present application. It should be noted that those skilled in the art can make several modifications and improvements without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be determined by the appended claims.

Claims (10)

1. A method of recommending items, the method comprising:
constructing an initial undirected unowned graph according to user nodes, object nodes corresponding to the user nodes, the relation among the user nodes and the object nodes; the user nodes comprise head nodes corresponding to head users and long-tail nodes corresponding to long-tail users;
Inputting the initial undirected graph into a preset graph self-encoder model, and updating the relation between the long tail node and other nodes to generate a target undirected graph;
and recommending the long-tail user according to the initial undirected graph and the target undirected graph to generate an article recommendation result.
2. The method of claim 1, wherein constructing an initial undirected graph based on user nodes, item nodes corresponding to the user nodes, relationships between the user nodes, and relationships between the user nodes and the item nodes comprises:
taking user nodes and object nodes corresponding to the user nodes as nodes, and taking the relation between the user nodes and the object nodes as edges to construct an initial adjacency matrix;
acquiring the feature vector of the user node and the feature vector of the object node, and generating a feature matrix according to the feature vector of the user node and the feature vector of the object node;
and constructing an initial undirected weight graph according to the initial adjacency matrix and the feature matrix.
3. The method according to claim 2, wherein the method further comprises:
deleting the connecting edges of the head nodes in the initial undirected graph to generate a new undirected graph;
inputting the new undirected weight map into an initial map self-encoder model for processing to generate a new adjacency matrix;
and calculating the value of a loss function of the initial graph self-encoder model according to the new adjacency matrix, and updating the model parameters of the initial graph self-encoder model according to the value of the loss function to generate a preset graph self-encoder model.
4. A method according to claim 2 or 3, wherein the inputting the initial undirected graph into a preset graph self-encoder model updates the relationship between the long tail node and other nodes to generate a target undirected graph, and comprises:
inputting the initial undirected weight-free graph into a preset graph self-encoder model, and predicting the connecting edges to be added of the long tail nodes to generate a target adjacent matrix;
and generating the target undirected unowned graph according to the target adjacency matrix and the feature matrix.
5. A method according to any one of claims 1-3, characterized in that the method further comprises:
inputting the initial undirected graph into an initial graph neural network model to perform graph convolution processing, and generating a first embedded characterization matrix corresponding to the initial undirected graph;
inputting the target undirected graph into an initial graph neural network model to perform graph convolution processing, and generating a second embedded characterization matrix corresponding to the target undirected graph;
calculating the value of a loss function of the initial graph neural network model according to the first embedded characterization matrix and the second embedded characterization matrix, and updating model parameters of the initial graph neural network model according to the value of the loss function to generate a preset graph neural network model.
6. The method of claim 5, wherein the recommending the item to the long-tailed user based on the initial undirected weight graph and the target undirected weight graph, generating an item recommendation result, comprises:
inputting the initial undirected unauthorized graph into a preset graph neural network model to carry out graph convolution processing to generate a target embedded characterization matrix; the preset graph neural network model is trained based on the initial undirected graph and the target undirected graph;
And recommending the long-tail user with the article according to the target embedded characterization matrix, and generating the article recommendation result.
7. An item recommendation device, the device comprising:
the initial undirected weight map construction module is used for constructing an initial undirected weight map according to user nodes, object nodes corresponding to the user nodes, the relation among the user nodes and the object nodes; the user nodes comprise head nodes corresponding to head users and long-tail nodes corresponding to long-tail users;
the target undirected graph generating module is used for inputting the initial undirected graph into a preset graph self-encoder model, updating the relation between the long tail node and other nodes, and generating a target undirected graph;
and the article recommendation result generation module is used for recommending the article to the long-tail user according to the initial undirected graph and the target undirected graph to generate an article recommendation result.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 6 when the computer program is executed.
9. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
CN202310027099.3A 2023-01-09 2023-01-09 Article recommendation method, apparatus, computer equipment, storage medium and program product Pending CN116128575A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310027099.3A CN116128575A (en) 2023-01-09 2023-01-09 Article recommendation method, apparatus, computer equipment, storage medium and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310027099.3A CN116128575A (en) 2023-01-09 2023-01-09 Article recommendation method, apparatus, computer equipment, storage medium and program product

Publications (1)

Publication Number Publication Date
CN116128575A true CN116128575A (en) 2023-05-16

Family

ID=86307651

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310027099.3A Pending CN116128575A (en) 2023-01-09 2023-01-09 Article recommendation method, apparatus, computer equipment, storage medium and program product

Country Status (1)

Country Link
CN (1) CN116128575A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116955836A (en) * 2023-09-21 2023-10-27 腾讯科技(深圳)有限公司 Recommendation method, recommendation device, recommendation apparatus, recommendation computer readable storage medium, and recommendation program product

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116955836A (en) * 2023-09-21 2023-10-27 腾讯科技(深圳)有限公司 Recommendation method, recommendation device, recommendation apparatus, recommendation computer readable storage medium, and recommendation program product
CN116955836B (en) * 2023-09-21 2024-01-02 腾讯科技(深圳)有限公司 Recommendation method, recommendation device, recommendation apparatus, recommendation computer readable storage medium, and recommendation program product

Similar Documents

Publication Publication Date Title
US10248664B1 (en) Zero-shot sketch-based image retrieval techniques using neural networks for sketch-image recognition and retrieval
US9342781B2 (en) Signal processing systems
CN114841161B (en) Event element extraction method, device, equipment, storage medium and program product
CN114417161A (en) Virtual article time sequence recommendation method, device, medium and equipment based on special-purpose map
CN115204984A (en) Business product push method, apparatus, computer equipment and storage medium
CN116127183A (en) Service recommendation method, device, computer equipment and storage medium
CN116128575A (en) Article recommendation method, apparatus, computer equipment, storage medium and program product
CN115758271A (en) Data processing method, device, computer equipment and storage medium
CN115630219A (en) Training method and device of recommendation model and computer equipment
CN114219184A (en) Product transaction data prediction method, device, equipment, medium and program product
CN114782960B (en) Model training method and device, computer equipment and computer readable storage medium
CN115858766B (en) A method, device, computer equipment and storage medium for interest dissemination and recommendation
CN119692443A (en) Link prediction method and device, model training method and device
CN118193822A (en) Collaborative filtering recommendation method, device, equipment and medium based on graph neural network
CN116127195A (en) Package recommendation method, device, computer equipment, storage medium and program product
CN116383441A (en) Community detection method, device, computer equipment and storage medium
CN115470526A (en) Processing method and device for anti-attack data based on black box model
Graham et al. Applying neural networks to a fractal inverse problem
CN115455306B (en) Push model training method, information push device and storage medium
US20240111988A1 (en) Neural graphical models for generic data types
CN120832395A (en) A judicial data cataloging and updating method and system based on information extraction model training
CN115952358A (en) Product recommendation method and device, computer equipment and storage medium
CN116881122A (en) Test case generation method, device, equipment, storage medium and program product
CN119441606A (en) Model training method, item recommendation method, device, server and storage medium
CN117112724A (en) Search pushing method, apparatus, device, storage medium and computer program product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Country or region after: China

Address after: 518000 Room 201, building A, No. 1, Qian Wan Road, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong (Shenzhen Qianhai business secretary Co., Ltd.)

Applicant after: Zhaolian Consumer Finance Co.,Ltd.

Applicant after: SUN YAT-SEN University

Address before: 518000 Room 201, building A, No. 1, Qian Wan Road, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong (Shenzhen Qianhai business secretary Co., Ltd.)

Applicant before: MERCHANTS UNION CONSUMER FINANCE Co.,Ltd.

Country or region before: China

Applicant before: SUN YAT-SEN University

CB02 Change of applicant information