An item recommendation method, system, electronic device and storage medium
By building a multi-layer space and a multi-head attention layer and multi-gating mechanism, the problem of not considering fine-grained emotional and timing information in the existing technology is solved, and the accuracy and dynamicity of item recommendations are improved.
Patent Information
- Application Number
- CN202211697621.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-28
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2042-12-28
AI Technical Summary
The existing product recommendation methods fail to fully consider the fine-grained emotional characteristics of the comments, the user's social relationships and the item similarity relationship, and fail to effectively utilize the timing information, resulting in poor recommendation results.
By constructing user comment space, item space, social relationship space and high-order space, fine-grained emotional features and full-sentence content features are extracted using the BERT model and a multi-layer perceptron network, combining the multi-head attention layer and multi-gating mechanism to integrate timing information to predict the probability of interaction between users and items.
It improves the accuracy of item recommendations, alleviates the problems of cold start and data sparsity, and enhances the dynamic and accuracy of the recommendation system.
Smart Images

Figure CN115858945B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of artificial intelligence, and more specifically, relates to an item recommendation method, system, electronic device, and storage medium. Background Art
[0002] Patent document CN114723522A discloses a graph neural network for review text, which constructs a bipartite graph of users and items, and uses rating information and review information as edge features to construct a graph convolutional model to complete recommendations. However, this technology does not comprehensively mine review information, does not consider deep information such as fine-grained sentiment features, and does not consider more comprehensive relationship networks such as users' social relationships and item similarity relationships, resulting in insufficient effectiveness in alleviating the cold start problem of the recommendation system; at the same time, this model is also a static recommendation method and does not consider the temporal changes of reviews, items, social relationships, etc.
[0003] Patent document CN112650929A discloses a graph neural network recommendation method that fuses review information. It uses a Bidirectional Encoder Representations from Transformers (BERT) model to extract feature vectors of review text data as the content representation vectors of each node, and uses graph convolution and graph attention networks to extract the structural representation vectors of nodes, and finally predicts the recommendation probability. However, this technology only considers basic coarse-grained content information for mining review information, does not consider deeper fine-grained sentiment information, nor does it consider users' social relationships, item similarity relationships, and temporal relationships, and the information captured is limited.
[0004] The prior art provides a graph convolutional neural network recommendation method that fuses social relationships, which enriches the feature representation of users by embedding users' social relationships. It is then fused with the user-item bipartite graph, and information is mined through a graph convolutional neural network, and finally recommendation prediction is performed by means of vector dot product. However, this technology does not consider the role of reviews in the recommendation system, and it is also a static recommendation system that does not consider the reference value of temporal information for decision-making. Therefore, the consideration of temporal information is also an improvement of the present invention compared to other inventions. Summary of the Invention
[0005] Aiming at the defects of the prior art, the purpose of the present invention is to provide an item recommendation method, system, electronic device, and storage medium, aiming to solve the problem that the existing item recommendation method is a static recommendation method, which does not consider the temporal changes of reviews, items, social relationships, etc., and deeper fine-grained sentiment information, nor does it consider users' social relationships, item similarity relationships, and temporal relationships, resulting in poor item recommendation effects.
[0006] To achieve the above object, in a first aspect, the present invention provides an item recommendation method, including the following steps:
[0007] Obtain the comment data set of users on items from the platform business data set, extract the noun with the highest frequency of occurrence in the comment data set as the fine-grained sentiment feature keyword of the user's comment on the item; use the BERT model, attention layer, and multi-layer perceptron layer to extract the fine-grained sentiment feature keyword to obtain the fine-grained sentiment feature of the comment; and use the BERT model to embed the full-sentence word vectors of the comment data set to obtain the full-sentence content feature of the comment;
[0008] Obtain the social data of users and the historical data of the interaction between users and items from the platform business data set, construct the comment space of users according to the relationship of users' comments on items, and the comment space includes: the full-sentence content feature of the comment, the fine-grained sentiment feature of the comment, and the temporal feature of the comment; construct the item space of users according to the interaction relationship between users and items, and the item space includes: the rating data of users on items, the fine-grained sentiment feature of the comment, all item information interacted with the user, and the temporal information when the interaction occurs; construct the social relationship space according to the social data of users, and the social relationship space includes: the friend information of users and the temporal information when the friend relationship is established; construct the high-order space according to the interaction relationship between users and items and the social data of users, and the high-order space includes: all interaction information between users and items and all friend information of users; perform preliminary feature extraction on users from the comment space, item space, social relationship space, and high-order space, and use a multi-gating mechanism to fuse the preliminary user features extracted from each space and the user node feature vector to obtain the user embedding feature vector;
[0009] Obtain the historical data of the interaction between items and users from the platform business data set, construct the comment space according to the relationship between items and users' comments on items, and the comment space includes: the full-sentence content feature of the comment, the fine-grained sentiment feature of the comment, and the temporal data of the comment; construct the user space according to the interaction relationship between users and items, and the user space includes: the rating data of users on items, the fine-grained sentiment feature of the comment, all user information with which the item is interacted, and the temporal information when the interaction occurs; construct the item similarity space according to the attribute relationship of items, and the item similarity space: all attribute information of items; construct the high-order space according to the interaction relationship between users and items and the similarity information of items, and the high-order space includes: all interaction information between users and items and all attribute information of items; perform preliminary feature extraction on items from the comment space, user space, item similarity space, and high-order space; the feature extraction of the item similarity space needs to fuse the neighbor item vectors; use a multi-gating mechanism to fuse the preliminary item features extracted from each space and the item node feature vector to obtain the item embedding feature vector;
[0010] The user embedding feature vector and the item embedding feature vector are concatenated and then input into a multi-layer perceptron network for training to predict the interaction probabilities between the user and each item, so as to recommend items to the user based on the interaction probabilities.
[0011] In an optional example, the process of extracting the fine-grained sentiment features of comments is as follows:
[0012] Extract the comment texts of each user for each item from the comment dataset, and concatenate them with the fine-grained sentiment feature keywords to form the concatenated text data. Use the BERT model to process the concatenated text data, and use the vector representations of each fine-grained sentiment feature keyword to represent the features of the comment at each fine-grained level;
[0013] Utilize the feature representations of the comment at each fine-grained level, and consider the different impacts of the fine-grained sentiment at each level on the user's decision-making through the multi-head attention layer to form the weighted fine-grained sentiment feature representations;
[0014] Aggregate the weighted fine-grained sentiment feature representations through the multi-layer perceptron layer to form the final fine-grained sentiment feature representations of each comment.
[0015] In an optional example, the process of extracting the full-sentence content features of comments is as follows:
[0016] Extract the comment texts of each user for each item from the comment dataset, use the BERT model to convert the comment texts into word vectors, and use average vectorization to aggregate the word vectors into the preliminary comment content representation;
[0017] Utilize the multi-layer perceptron to perform feature dimensionality reduction on the preliminary comment content representation to obtain the final full-sentence content feature representation of the comment.
[0018] In an optional example, the process of extracting the user embedding feature vector is as follows:
[0019] Extract the user-comment data from the comment dataset, construct the sequential comment set of the user according to the comment time of the user; extract the sequential position vectors of each user and their comments based on the sequential comment set of the user; concatenate the fine-grained sentiment feature representation of the comment, the full-sentence content feature representation of the comment, and the sequential position vector of the comment to form the representation vector of each comment of the user, and construct a multi-head attention layer. Aggregate each comment vector by considering the different importance of different comments for the user feature expression through the multi-head attention layer, and input it into the feed-forward neural network for feature processing, and then aggregate all comment vectors through the average pooling layer, and input it into the fully connected layer for dimensionality reduction to obtain the final user comment space feature representation;
[0020] Extract user-item-comment-rating data from the platform business dataset, and construct the item sequence of the user according to the interaction time between the user and the item; extract the temporal position vector of each user and each interactive item based on the user's item sequence; splice the user's rating of the item, the first-order neighbor item feature vector, the fine-grained sentiment feature representation of the comment, and the item temporal position vector, construct a multi-head attention layer, and aggregate each comment vector by considering the different importance of different item interactions for user feature expression through the multi-head attention layer, and input it into the feed-forward neural network for feature processing, and then obtain the user-item space feature representation through dimensionality reduction by the fully connected layer;
[0021] Extract the social relationship data of the user from the platform business dataset, construct the user social relationship network, and construct the friend sequence of each user according to the time when the user establishes the social relationship; extract the temporal position vector of each friend of each user based on the user's friend sequence; splice the first-order neighbor friend feature vector and the temporal position vector, and construct a multi-head attention layer, and aggregate each comment vector by considering the different importance of different friends for user feature expression through the multi-head attention layer, and input it into the feed-forward neural network for feature processing, and then obtain the user social space feature representation through the fully connected layer;
[0022] Extract the interaction information between the user and the item from the platform business dataset, construct the interaction network between the user and the item, and obtain the sparse adjacency matrix between the user and the item; extract the user-friend interaction network established based on the user social relationship from the platform business dataset, and establish the sparse adjacency matrix between the user and the user; construct a graph attention layer to transfer and update node information, process the user-item interaction grid and the user-friend interaction network respectively, splice their output results, and obtain the user high-order space feature vector representation through dimensionality reduction by the fully connected layer;
[0023] Construct a multi-gating mechanism feature fusion layer to fuse the user comment space feature representation, the user-item space feature representation, the user social space feature representation, the user high-order space feature vector representation, and the user node feature vector to obtain the user embedding feature vector.
[0024] In an optional example, the extraction process of the item embedding feature vector is as follows:
[0025] Extract item-comment data from the comment dataset, and construct the comment dataset of the item according to the comment time of the item; extract the temporal position vector of each comment of the item based on the comment dataset of the item; splice the full sentence content feature of the comment, the fine-grained sentiment feature of the comment, and the temporal position vector of the comment, and construct a multi-head attention layer, and aggregate each comment vector by considering the different importance of different comments for item feature expression through the multi-head attention layer, and input it into the feed-forward neural network for feature processing to obtain the item comment space feature representation;
[0026] Extract user-item-comment-rating data from the platform business dataset, and construct the user sequence of items according to the interaction time between users and items; extract the temporal position vectors of each interactive user of each item based on the user sequence of items; splice the rating, the first-order neighbor user feature vector, the comment fine-grained sentiment feature vector and the temporal position vector, construct a multi-head attention layer, and aggregate each comment vector by considering the different importance of different item interactions for item feature expression through the multi-head attention layer, and input it into a feed-forward neural network for feature processing to obtain the item user space feature representation;
[0027] Extract item data and its attribute data from the platform business dataset, and calculate item similarity; construct an item similarity space according to the item similarity relationship, and establish an item similarity network; construct a multi-head attention layer, and aggregate each comment vector by considering the different importance of different related items for item feature expression through the multi-head attention layer based on the item similarity network, and input it into a feed-forward neural network for feature processing to obtain the item similarity space feature representation;
[0028] Extract the interaction information between users and items from the platform business dataset, and establish the first sparse adjacency matrix between users and items; extract the interaction network of similar items established based on the item similarity space from the platform business dataset, and establish the sparse adjacency matrix between items and the second sparse adjacency matrix between users and items; construct a graph attention layer to transfer and update node information, process the information of the first sparse adjacency matrix between users and items, the sparse adjacency matrix between items and the second sparse adjacency matrix between users and items, and splice the output results to obtain the item high-order space feature vector representation;
[0029] Construct a multi-gating mechanism feature fusion layer to fuse the item comment space feature representation, the item user space feature representation, the item similarity space feature representation, the item high-order space feature vector representation and the item node feature vector to obtain the item embedding feature vector.
[0030] In a second aspect, the present invention provides an item recommendation system, including:
[0031] A feature extraction unit, configured to obtain a comment dataset of users on items from the platform business dataset, extract the noun with the highest frequency of occurrence in the comment dataset as the fine-grained sentiment feature keyword of the user's comment on the item; use a BERT model, an attention layer and a multi-layer perceptron layer to extract the fine-grained sentiment feature of the comment, and obtain the fine-grained sentiment feature of the comment; and use the BERT model to embed the full-sentence word vectors of the comment dataset to obtain the full-sentence content feature of the comment;
[0032] The user embedding feature determination unit is used to obtain the social data of the user and the historical data of the user's interaction with items from the platform business dataset, construct the comment space of the user according to the relationship of the user's comments on items, and the comment space includes: the full sentence content feature of the comment, the fine-grained sentiment feature of the comment, and the temporal feature of the comment; construct the item space of the user according to the interaction relationship between the user and the item, and the item space includes: the rating data of the user on the item, the fine-grained sentiment feature of the comment, all item information interacted with the user, and the temporal information of the interaction; construct the social relationship space according to the social data of the user, and the social relationship space includes: the friend information of the user and the temporal information of establishing the friend relationship; construct the high-order space according to the interaction relationship between the user and the item and the social data of the user, and the high-order space includes: all interaction information of the user and the item and all friend information of the user; extract the preliminary features of the user from the comment space, item space, social relationship space, and high-order space, and use a multi-gating mechanism to fuse the preliminary features of the user extracted from each space and the user node feature vector to obtain the user embedding feature vector;
[0033] The item embedding feature determination unit is used to obtain the historical data of the interaction between the item and the user from the platform business dataset, construct the comment space according to the relationship between the item and the user's comments on the item, and the comment space includes: the full sentence content feature of the comment, the fine-grained sentiment feature of the comment, and the temporal data of the comment; construct the user space according to the interaction relationship between the user and the item, and the user space includes: the rating data of the user on the item, the fine-grained sentiment feature of the comment, all user information of the item being interacted, and the temporal information of the interaction; construct the item similarity space according to the attribute relationship of the item, and the item similarity space: all attribute information of the item; construct the high-order space according to the interaction relationship between the user and the item and the similarity information of the item, and the high-order space includes: all interaction information of the user and the item and all attribute information of the item; extract the preliminary features of the item from the comment space, user space, item similarity space, and high-order space; the feature extraction of the item similarity space needs to fuse the neighbor item vectors; use a multi-gating mechanism to fuse the preliminary features of the item extracted from each space and the item node feature vector to obtain the item embedding feature vector;
[0034] The item recommendation unit is used to splice the user embedding feature vector and the item embedding feature vector and input them into a multi-layer perceptron network for training, predict the interaction probability between the user and each item, so as to recommend items to the user based on the interaction probability.
[0035] In a third aspect, the present invention provides an electronic device, including a memory and a processor, where a computer program executable on the processor is stored in the memory, and when the processor executes the computer program, the item recommendation method provided in the first aspect above is implemented.
[0036] In a fourth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the item recommendation method provided in the first aspect above is implemented.
[0037] Generally speaking, compared with the prior art by the above technical solution conceived by the present invention, the following beneficial effects are obtained:
[0038] The present invention provides an item recommendation method, system, electronic device and storage medium, which integrates the content features and fine-grained sentiment features of comments. In previous studies, the processing of comment information mostly embeds comment information and sentiment tendency from a coarse-grained perspective. There are few studies on extracting and embedding the sentiment tendency of different aspects of comments from the fine-grained sentiment perspective of comments, and even fewer studies combine the content features and fine-grained sentiment features of comments as the feature representation of comments. Only considering the content features of comments is difficult to capture the view information of different levels of items in the comments with emphasis, and only considering the fine-grained sentiment tendency cannot comprehensively capture the overall comment tendency of users, resulting in insufficient utilization of useful information in comment information. The present invention integrates the content features and fine-grained sentiment features of comments based on the BERT technology, so as to fully utilize the useful information in comments for recommendation decision-making, alleviate the cold start problem, enhance the accurate expression of users and items, and improve the effect of the recommendation method.
[0039] The present invention provides an item recommendation method, system, electronic device and storage medium, which integrates the social space of users and the item similarity network. Most of the existing studies construct recommendation models from a single user or item dimension, such as the interaction relationship between users and items, a single user social relationship, etc., without fully considering the integration of more user information and item information. The data sparsity problem and cold start problem in the recommendation system always exist. The present invention further mines and integrates user information and item information. In addition to the social relationship space of users, the "social relationship" between items is also considered, and an item similarity space is proposed. By integrating the social space and the item similarity space, the feature representation of users and items is enriched.
[0040] The present invention provides an item recommendation method, system, electronic device and storage medium, which integrates the influence of temporal information on comments, social relationships, and user-item interactions. Previous studies mostly modeled recommendation systems from a static perspective, and few studies considered the influence of temporal relationships on recommendations. However, temporal relationships have an important impact on users' item selection decisions and recommendation decisions. Information that is more recent in time has a greater impact on users' decisions during most user decision-making processes. Therefore, the present invention takes into account the influence of temporal information on comments, social relationships, and user-item interactions, integrates temporal information by constructing temporal vectors, and considers the influence of time series on user decisions by using a multi-head attention mechanism, so as to effectively integrate the influence of different comments, interactions, and relationships on user and item feature representations.
[0041] The present invention provides an item recommendation method, system, electronic device and storage medium, and proposes a multi-gating mechanism feature fusion method for the fusion process of multi-spatial feature information to weightedly fuse features. Previous studies mostly used direct splicing or taking the average value for the fusion of multiple independent feature information. Such a fusion method cannot take into account the contribution differences of different features to the final decision. The present invention proposes a feature fusion method based on a gating mechanism to take into account the contributions of different feature information and achieve weighted fusion. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 is a flowchart of the item recommendation method provided by an embodiment of the present invention;
[0043] Figure 2 is a technical framework diagram provided by Embodiment 1 of the present invention;
[0044] Figure 3 is a flowchart for extracting the fine-grained sentiment level of comments provided by Embodiment 1 of the present invention;
[0045] Figure 4 is a flowchart for representing comment features provided by Embodiment 1 of the present invention;
[0046] Figure 5 is a flowchart for representing user features provided by Embodiment 1 of the present invention;
[0047] Figure 6 is a flowchart for extracting temporal information features provided by Embodiment 1 of the present invention;
[0048] Figure 7 is a flowchart for representing item features provided by Embodiment 1 of the present invention;
[0049] Figure 8 is the overall structure diagram provided by Embodiment 2 of the present invention;
[0050] Figure 9The structure diagram of the training module provided in the second embodiment of the present invention;
[0051] Figure 10 The structure diagram of the recommendation module provided in the second embodiment of the present invention;
[0052] Figure 11 The architecture diagram of the item recommendation system provided in the embodiment of the present invention. Detailed implementation manners
[0053] In order to make the objectives, technical solutions and advantages of the present invention more clear and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0054] Figure 1 The flowchart of the item recommendation method provided in the embodiment of the present invention, as Figure 1 shown, includes the following steps:
[0055] S101, obtain the comment dataset of users on items from the platform business dataset, extract the noun with the highest frequency of occurrence in the comment dataset as the fine-grained sentiment feature keyword of the user's comment on the item; use the BERT model, attention layer and multi-layer perceptron layer to extract the fine-grained sentiment feature keyword to obtain the fine-grained sentiment feature of the comment; and use the BERT model to embed the full-sentence word vectors of the comment dataset to obtain the full-sentence content feature of the comment;
[0056] S102, obtain the social data of users and the historical data of the interaction between users and items from the platform business dataset, construct the comment space of users according to the relationship of the users' comments on items, and the comment space includes: the full-sentence content feature of the comment, the fine-grained sentiment feature of the comment and the time sequence feature of the comment; construct the item space of users according to the interaction relationship between users and items, and the item space includes: the rating data of users on items, the fine-grained sentiment feature of the comment, all item information interacted with users and the time sequence information of the interaction; construct the social relationship space according to the social data of users, and the social relationship space includes: the friend information of users and the time sequence information of establishing friend relationships; construct the high-order space according to the interaction relationship between users and items and the social data of users, and the high-order space includes: all interaction information between users and items and all friend information of users; extract the preliminary features of users from the comment space, item space, social relationship space and high-order space, and use the multi-gating mechanism to fuse the preliminary features of users extracted from each space and the user node feature vector to obtain the user embedding feature vector;
[0057] S103. Obtain the historical data of the interaction between items and users from the platform business dataset, and construct a comment space according to the relationship between items and user comments on the items. The comment space includes: the full-sentence content feature of the comment, the fine-grained sentiment feature of the comment, and the time-series data of the comment; construct a user space according to the interaction relationship between the user and the item. The user space includes: the rating data of the user for the item, the fine-grained sentiment feature of the comment, the information of all users with whom the item has been interacted, and the time-series information of the interaction; construct an item similarity space according to the attribute relationship of the items. The item similarity space: the attribute information of all items; construct a high-order space according to the interaction relationship between the user and the item and the similarity information of the items. The high-order space includes: the interaction information of all users and items and the attribute information of all items; perform preliminary feature extraction on the items from the comment space, user space, item similarity space, and high-order space; the feature extraction of the item similarity space needs to fuse the neighbor item vectors; use a multi-gating mechanism to fuse the preliminary item features extracted from each space and the item node feature vector to obtain the item embedding feature vector;
[0058] S104. Concatenate the user embedding feature vector and the item embedding feature vector and input them into a multi-layer perceptron network for training to predict the interaction probability between the user and each item, so as to recommend items to the user based on the interaction probability.
[0059] In a specific embodiment, the present invention provides a dynamic graph neural network recommendation method and system that fuses content and structural features, which relates to the technical field of recommendation systems. The method includes:
[0060] (1) Comment fine-grained dimension extraction is completed through several steps including word segmentation, stop word removal, selection of high-frequency nouns, and manual screening of fine-grained keywords.
[0061] (2) Extract the comment content features, including the fine-grained sentiment feature and the full-sentence content feature of the comment. Extract the fine-grained sentiment feature of the comment through the use of a BERT encoding layer, an attention layer, and a multi-layer perceptron layer to form a fine-grained sentiment feature vector; use the BERT encoding layer to embed the full-sentence word vectors, and perform an operation on all the embedded word vectors through vector averaging to obtain the comment full-sentence content feature.
[0062] (3) Extract the embedding feature vectors of users and items. For the user embedding feature vectors, preliminary feature extraction is performed from the comment space, item space, social relationship space, and high-order space. For the feature extraction in the comment space, item space, and social relationship space, the time series vector is first fused with the remaining content vectors, and the preliminary feature vectors are obtained through training by the multi-head attention layer and the feed-forward neural network layer. For the high-order space, the high-order network information based on the user social relationship and the user-item relationship needs to be fused, and the graph attention layer is used for preliminary feature vector extraction. After extracting the preliminary feature vectors of each layer, the feature vectors and the user's own vector are input into the multi-gate mechanism vector fusion layer to fuse the preliminary vectors with weights to form the final user embedding feature vector. For the item embedding feature vectors, preliminary feature extraction is performed from the comment space, user space, item similarity space, and high-order space. The preliminary feature extraction methods in the comment space and user space are the same as those in the user's comment space and item space. For the feature extraction in the item similarity space, the neighbor item vectors need to be fused, and the preliminary feature vectors are obtained through training by the multi-head attention layer and the feed-forward neural network layer. For the high-order space of items, the high-order network information based on the user similarity space and the item-user relationship needs to be fused, and the graph attention layer is used for preliminary feature vector extraction. After extracting the preliminary feature vectors of each layer, the feature vectors and the item's own vector are input into the multi-gate mechanism vector fusion layer to fuse the preliminary vectors with weights to form the final item embedding feature vector.
[0063] (4) Rating prediction. The output user embedding feature vector and item embedding feature vector are concatenated and input into the multi-layer perceptron network for training to perform the final rating prediction.
[0064] It should be noted that the item recommendation method provided by the present invention is for some recommendation application scenarios, which require the scenarios to contain the social relationships, the interaction relationships between users and items, and the comment data of users and items required by the model. For example, in the e-commerce scenario: Taobao, etc., there are social relationships, the purchase relationships between users and commodities, and the comment relationships between users and commodities. Another example is the content platform scenario: Douban, etc., there are social relationships, the interaction relationships between users and movies, etc., and the information of user movie reviews. Another example is the travel platform: there are social relationships, the rating relationships between users and scenic spots, and comments. For scenarios with recommendation requirements and application scenarios that contain the data types required by the model, the item recommendation method provided by the present invention can be applied.
[0065] The present invention aims to construct a recommendation method and system that can dynamically weight and embed rich decision-making information and feature information starting from the reference factors when users make item selection decisions. The main technical effects are as follows: It integrates the content features and fine-grained sentiment features of reviews, makes more full use of the opinion information contained in reviews, solves the situation in the field that only coarse-grained sentiment features or only fine-grained sentiment features are considered, and alleviates the cold start problem in the field of recommendation systems to a certain extent. It integrates the user's social relationship network and the similarity space of items, introduces social relationship and item similarity space information in addition to the interaction relationship between users and items, is closer to the real recommendation scenario, and alleviates the cold start and data sparsity problems in the field of recommendation systems. It integrates the influence of temporal information on reviews, social relationships, and user-item interactions, takes into account the influence of reviews, social relationships, and user-item interaction information in different periods on user decisions, is close to the real recommendation scenario, and provides a dynamic recommendation strategy. For the fusion process of multi-space feature information, a multi-gating mechanism feature fusion method is proposed to weight and fuse features. Considering the contribution of different space features to recommendation, they are fused in a weighted form. The multi-gating mechanism feature fusion method proposed by the present invention can better achieve the fusion of multi-feature information and alleviates the problem of rough determination of feature weights in previous studies.
[0066] Embodiment 1 of the present invention provides a commodity recommendation method. Figure 2 It is a flowchart of the dynamic graph neural network recommendation method that integrates content and structural features provided by Embodiment 1 of the present invention. Specifically, the method of the present invention includes:
[0067] (1) Select the fine-grained sentiment level of reviews
[0068] Perform word segmentation, part-of-speech tagging, stop word removal, and frequency statistics on all review data, and select the noun with the highest frequency of occurrence as the alternative dimension of the fine-grained sentiment level; then use the method of manual screening to eliminate inappropriate words from the alternative dimensions, and use the remaining words as the keyword of the fine-grained sentiment dimension of reviews.
[0069] (2) Extract review text features
[0070] Extract the content features and fine-grained sentiment features of the review text. Taking the fine-grained sentiment dimension keywords extracted in (1) as the fine-grained sentiment level of the review, for the fine-grained sentiment features of the review, use the BERT model to initially obtain the representation vectors of each fine-grained sentiment level, then use the multi-head attention mechanism to capture the influence of different sentiment levels on the decision-making, and finally use the multi-layer perceptron network for dimensionality reduction to obtain the final fine-grained sentiment feature representation of the review; for the content features of the review, use the BERT model to initially obtain the word vectors of all words in the text, aggregate the word vectors through the average vectorization method, and then use the multi-layer perceptron network for dimensionality reduction to obtain the final content feature representation of the review text.
[0071] (3) Construct a user review space, user-item space, user social relationship space, and user high-order space that integrate temporal features to learn the multi-source information representation of users, and use the multi-gate mechanism feature selection layer to fuse the multi-source information representation obtained above with the user's current node representation as the user's final embedding feature representation.
[0072] (4) Construct an item review space, item-user space, item similarity space, and item high-order space that integrate temporal features to learn the multi-source information representation of items, and use the multi-gate mechanism feature selection layer to fuse the multi-source information representation obtained above with the item's current node representation as the item's final embedding feature representation.
[0073] (5) Use the final embedding feature representations of users and items obtained in steps (3) and (4) to predict the probability of user interaction with items through a multi-layer perceptron.
[0074] (6) Use the probability of interaction obtained in step (5) as the prediction result for recommendation.
[0075] The specific steps of step (1) are as Figure 3 shown. The specific steps of step (2) are as Figure 4 shown, and the specific steps are as follows:
[0076] (3.1) Extract the fine-grained sentiment features of the review.
[0077] (3.1.1) Extract the review text of each user for each item from the review dataset, and splice it with the fine-grained sentiment level keywords obtained in step (1) to form text data of "[CLS] review text [SEP] sentiment word 1 [MASK] sentiment word 2 [MASK]...... [SEP]". Use the BERT model to process the above text data, and use the vector representation of "[MASK]" corresponding to each sentiment word to represent the features of the review at this fine-grained level, and obtain the content expression as shown in formula (1):
[0078]
[0079] In formula (1), FG ij Refers to the fine-grained sentiment feature matrix of the jth comment of the i-th user in chronological order, rf k Represents the feature vector of the review at the k-th fine-grained sentiment level.
[0080] (3.1.2) Using the fine-grained sentiment feature representations in step (3.1.1), the multi-head attention layer considers the different effects of fine-grained emotions at each level on user decision-making, forming the authorized fine-grained sentiment feature representations, and obtaining the content representations as shown in formulas (2), (3), and (4):
[0081]
[0082] NMAFG ij =LayerNorm(FG ij +MAFG ij ) (3)
[0083] FMAFG ij =ReLU(NMAFG ij ·W1+b1)·W2+b2 (4)
[0084] In formula (2), MAFG ii In formula (3), NMAFG represents the fine-grained sentiment feature representation of the j-th comment of the i-th user outputted by the multi-head attention layer. ij Represents the output of the LayerNormalization layer. In formula (4), FMAFG ii The fine-grained emotional feature representation is finally outputted by the feedforward neural network layer, where ReLU is the activation function of the first layer of the feedforward neural network and the second layer does not use an activation function.
[0085] (3.1.3) Using the output from step (3.1.2), we perform feature aggregation through the multi-layer perceptron layer to form the final fine-grained sentiment feature representation of each comment, and obtain the content representation as shown in formula (5):
[0086]
[0087] In formula (5), FFG ij n It represents the fine-grained sentiment feature representation vector of the final comment of the jth comment of the i-th user output by the n-layer perceptron, where σ represents the activation function of each layer.
[0088] (3.2) Extract the content feature representation of the comments.
[0089] (3.2.1) Extract the review texts of each user for each item from the review data, convert the review texts into word vectors using the BERT model, and aggregate the word vectors into a review content representation using average vectorization to obtain the content representation as shown in formula (6):
[0090]
[0091] In formula (6), CG ij refers to the content feature representation of the j-th review of the i-th user after BERT embedding and word averaging, where BERT(W i ) refers to the word vector obtained by BERT embedding of the i-th word in the review, and N represents the number of words in the review.
[0092] (3.2.2) Use the preliminary review content representation vector obtained in step (3.2.1), and use a multi-layer perceptron for feature dimensionality reduction to obtain the final review content representation, and obtain the content representation as shown in formula (7):
[0093]
[0094] In formula (7), FCG ij n represents the final review content feature representation vector of the j-th review of the i-th user output after n layers of perceptrons, where σ represents the activation function of each layer.
[0095] The specific steps of step (3) are as Figure 5 shown, and the specific steps are as follows:
[0096] (4.1) Randomly initialize the user and item node feature representations, as shown in formula (8):
[0097]
[0098]
[0099] Among them, I_USER and I_ITEM respectively represent the feature representation matrices of users and items, and i_user k and i_item q respectively represent the initial feature representation vectors of a certain user and a certain item, and k and q are the numbers of users and items respectively.
[0100] (4.2) Extract the feature representation of the user review space.
[0101] (4.2.1) Extract user-review data from the dataset and construct a user review dataset according to the review time of the user.
[0102]
[0103] Among them: U_R i represents the sequential comment set of the \(i\)-th user, and \(u_r\) in represents the \(n\)-th comment of the \(i\)-th user arranged in sequence.
[0104] (4.2.2) Extract the sequential position vectors of each comment of the user to obtain the formula:
[0105]
[0106] In formula (10), \(POS_{u_r}\) ij refers to the sequential position vector of the \(j\)-th comment of the \(i\)-th user, and \(pos\) jk refers to the calculation of the position coefficient of the \(j\)-th comment compared to the \(k\)-th comment.
[0107] (4.2.3) Next is the operation on the sequential space. The aggregation process of the sequential space is as Figure 6 shown. Concatenate to form the representation vector of each comment of the user, and construct a multi-head attention layer. Consider the different importance of different comments for the expression of user features through the multi-head attention layer to aggregate each comment vector, and input it into the feed-forward neural network for feature processing. Then, aggregate all comment vectors through the average pooling layer, and input it into the fully connected layer to reduce the dimension to obtain the final user comment space feature representation with dimension \(f_d\), as shown in the formula:
[0108]
[0109]
[0110]
[0111] Among them, in formula (11), \(UR\) ij represents the concatenated comment representation vector of the \(j\)-th comment of the \(i\)-th user. In formula (12), represents the preliminary comment embedding feature representation matrix output by the \(a\)-th attention head of the \(i\)-th user. In formula (13), \(FUR\) i represents the feature vector representation of the comment space output by the \(i\)-th user after passing through the feed-forward neural network connected to the average pooling layer. \(n\) represents the number of attention heads.
[0112] (4.3) Extract the feature representation of the user-item space.
[0113] (4.3.1) Extract user-item-comment-rating data from the dataset to form a data quadruple of [user, item, comment, rating], and construct the item sequence of the user according to the interaction time between the user and the item.
[0114]
[0115] Among them: UI i represents the set of item sequences of the i-th user, and n represents the number of interactive items of user i.
[0116] (4.3.2) Extract the temporal position vectors of each interactive item of each user to obtain the formula:
[0117]
[0118] In formula (15), POSu_i ij refers to the temporal position vector of the j-th interactive item of the i-th user, and pos jk refers to the calculation of the position coefficient of the j-th interactive item compared to the k-th interactive item.
[0119] (4.3.3) Concatenate the score, first-order neighbor (item) feature vector, fine-grained sentiment feature vector, and item temporal position vector to construct a multi-head attention layer. Consider the different importance of different item interactions for user feature expression through the multi-head attention layer to aggregate each comment vector, and input it into a feed-forward neural network for feature processing. After dimensionality reduction via a fully connected layer, obtain the user-item space feature representation with a final dimension of fd, as shown in the formula:
[0120] UI ij ={R ij ||FFG ij ||U_item ij ||POSu_i ij} (16)
[0121]
[0122]
[0123] Among them, in formula (16), UI ij represents the concatenated comment representation vector of the j-th interactive item of the i-th user, and R ij represents the score of the i-th user for its j-th interactive item. In formula (17) represents the preliminary item embedding feature representation matrix output by the a-th attention head of the i-th user. In formula (18), FUI i represents the feature vector representation of the user space output by the i-th user after passing through the feed-forward neural network connected to the average pooling layer, and n represents the number of attention heads.
[0124] (4.4) Extract the feature representation of the user's social space.
[0125] (4.4.1) Extract the social relationship data of users from the dataset, construct the user social relationship network, and construct the friend sequence of each user according to the time when the social relationship is established.
[0126]
[0127] Among them: UU i represents the set of friend sequences of the i-th user, and n represents the number of social friends of user i.
[0128] (4.4.2) Extract the temporal position vectors of each friend of each user to obtain the formula:
[0129]
[0130] In formula (20), POSu_u ij refers to the temporal position vector of the j-th social friend of the i-th user, and pos jk refers to the calculation of the time series position coefficient of the i-th friend compared to the k-th friend.
[0131] (4.4.3) Concatenate the first-order neighbor (friend) feature vectors and the temporal position vectors, and construct a multi-head attention layer. Consider the different importance of different friends for the user feature expression through the multi-head attention layer to aggregate each comment vector, and input it into the feed-forward neural network for feature processing, and then obtain the user social space feature representation with a final dimension of fd through the fully connected layer, as shown in the formula:
[0132] UU ij ={Uuser ij ||POSu_u ij} (21)
[0133]
[0134]
[0135] Among them, in formula (21), UI ij represents the concatenated representation vector of the j-th friend of the i-th user. In formula (22), represents the preliminary friend embedding feature representation matrix output by the a-th attention head of the i-th user. In formula (23), FUU i represents the feature vector representation of the social space output by the i-th user after passing through the feed-forward neural network connected to the average pooling layer, and n represents the number of attention heads.
[0136] (4.5) Extract the feature representation of the user's high-order space.
[0137] (4.5.1) Extract the interaction information of user items from the dataset, construct the [user, item] binary tuple, construct the interaction space of the user-item interaction network, establish the user-item sparse adjacency matrix, and add self-loops to prevent the loss of user's own information during the later node data update. Then, normalize the data to obtain the formula:
[0138]
[0139] In formula (24), A nor_U2I represents the normalized user-item sparse adjacency matrix, represents the diagonal matrix composed of the degrees of each user node, A U2I represents the unnormalized user-item sparse adjacency matrix, represents the diagonal matrix composed of the degrees of each item node.
[0140] (4.5.2) Extract the user friend interaction network established based on user social relationships from the dataset, establish the user-user sparse adjacency matrix, also add self-loops to prevent the loss of user's own information during the later node data update, and then normalize the data to obtain the formula:
[0141]
[0142] In formula (24.1), A nor_U2U represents the normalized user-user sparse adjacency matrix, represents the diagonal matrix composed of the degrees of each user node, A U2u represents the unnormalized user-user sparse adjacency matrix.
[0143] (4.5.3) Construct the graph attention layer to transfer and update node information, process the information of the networks constructed in the above (4.5.1) and (4.5.2), splice their output results, and obtain the user high-order spatial feature vector representation with the final dimension of fd through the fully connected layer for dimensionality reduction, as shown in the formula:
[0144]
[0145]
[0146]
[0147]
[0148] FUH i =[FUHC i ||FUHS i ·W k +b k (29)
[0149] Among them, formula (25) is the operation process of the (L + 1)-th layer graph attention network, representing the aggregation of the feature embeddings of the L-th order user neighbors of the i-th user, and σ is the activation function for calculating the updated result. Here, the ELU function is used, while is the attention weight coefficient of the potential feature influence of user a on user i, and its calculation formula is shown in the following formula (30), user ia refers to the feature representation of user a among the L-th order neighbors of i. Formula (26) aggregates the feature embeddings output by the multi-layer graph attention to obtain the feature representation FUHC of the high-order space of the user-item interaction of user i i , where refers to the attention weight parameter of the k-th graph attention layer, and its calculation formula is shown in the following formula (31). Formulas (27) and (28) are the graph attention operations on the high-order network of the user social relationship, and the operation methods are the same as the above two formulas, which will not be elaborated here. Finally, the feature representation FUHS of the high-order space of user i is output i . Formula (29) concatenates the features of the two networks to obtain the final feature representation FUH of user i in the high-order space i .
[0150]
[0151]
[0152] respectively refer to the set of attention coefficients within the graph attention layer and the set of attention coefficients between the graph attention layers, and the softmax function is used to perform the normalization operation on them.
[0153] (4.6) Fusion of multi-source feature representations to obtain the final embedded feature representation of the user.
[0154] Construct a multi-gating mechanism feature fusion layer, taking the output feature representations of (4.2), (4.3), (4.4), (4.5) and the user's own node feature representation as inputs to complete the feature fusion. The output feature vector is the final user embedded feature representation, as shown in the formula:
[0155] g ab = sigmoid(W ab uf a + W ba uf b ) (32)
[0156]
[0157] FUi = g1 ⊙ U i + g2 ⊙ FUR i + g3 ⊙ FUI i + g4 ⊙ FUU i + g5 ⊙ FUH i (34)
[0158] Among them, in formula (32), uf1, uf2, uf3, uf4, and uf5 respectively refer to the own node features of user i, FUR i , FUI i , FUU i , and FUH i , while g ab refers to the gating factor exponent of uf of the feature vector, and g a for uf b is the gating factor of the feature uf a refers to the coefficient index obtained after normalizing the gating factor of the feature uf a . The final user feature representation vector obtained after multi-gating operation is FU i , which is used as the input for the subsequent prediction.
[0159] The specific steps of step (4) are as Figure 6 shown, and the specific steps are as follows:
[0160] (5.1) Extract the feature representation of the item review space.
[0161] (5.1.1) Extract item-review data from the dataset and construct an item review dataset according to the review time of the item.
[0162]
[0163] Among them: l_R i represents the time-series review set of the i-th item, and i_r in represents the n-th review of the i-th item arranged in time series.
[0164] (5.1.2) Extract the time-series position vectors of each review of the item to obtain formula (36):
[0165]
[0166] In formula (10), POSi_r ij refers to the time-series position vector of the j-th review of the i-th item, and pos jk refers to the calculation of the position coefficient of the j-th review compared to the k-th review.
[0167] (5.1.3) Concatenate to form the representation vector of each comment of the item, and construct a multi-head attention layer. Through the multi-head attention layer, consider the different importance of different comments for the expression of item features to aggregate each comment vector, and input it into the feed-forward neural network for feature processing to obtain the final feature representation of the item comment space, as shown in formulas (37), (38), and (39):
[0168]
[0169]
[0170]
[0171] Among them, IR in formula (11) ij represents the concatenated comment representation vector of the j-th comment of the i-th item. In formula (38), represents the preliminary comment embedding feature representation matrix output by the a-th attention head of the i-th item. In formula (39), FIR i represents the feature vector representation of the comment space output by the i-th item after passing through the feed-forward neural network connected to the average pooling layer. n represents the number of attention heads.
[0172] (5.2) Extract the feature representation of the item user space.
[0173] (5.2.1) Extract user-item-comment-rating data from the dataset to form a [user, item, comment, rating] data quadruple, and construct the user sequence of the item according to the interaction time between the user and the item.
[0174]
[0175] Among them: IU i represents the user sequence set of the i-th item, and n represents the number of interacting users of item i.
[0176] (5.2.2) Extract the temporal position vectors of each interacting user of each item to obtain formula (41):
[0177] POSi_u ij ={pos j1 , pos j2 ,......pos jn}
[0178]
[0179] In formula (41), POSi_u ij refers to the temporal position vector of the j-th interacting user of the i-th item, pos jkIt refers to the calculation of the position coefficient of the j-th interactive user compared to the k-th interactive user.
[0180] (5.2.3) Concatenate the rating, the first-order neighbor (user) feature vector, the fine-grained sentiment feature vector, and the user temporal position vector to construct a multi-head attention layer. Through the multi-head attention layer, consider the different importance of different item interactions for the item feature expression to aggregate each comment vector, and input it into the feed-forward neural network for feature processing to obtain the final item-user space feature representation, as shown in Formulas (42)-(44):
[0181] IU ij ={R ij |FFG ij ||I_user ij ||POSi_u ij}} (42)
[0182]
[0183]
[0184] Among them, in Formula (42), IU ij represents the concatenated representation vector of the j-th interactive user of the i-th item, R ij represents the rating of the i-th item for its j-th interactive user. In Formula (43), represents the preliminary user embedding feature representation matrix output by the a-th attention head of the i-th item. In Formula (44), FIU i represents the feature vector representation of the user space output by the i-th item after passing through the feed-forward neural network connected with the average pooling layer. n represents the number of attention heads.
[0185] (5.3) Extract the feature representation of the item similarity space.
[0186] (5.3.1) Extract the item data and its attribute data from the dataset, and calculate the item similarity, as shown in the formula:
[0187] sim ab =similarity(item a , item b ) (45)
[0188] Among them, in Formula (45), sim ab refers to the similarity between item a and item b. item a refers to the concatenation of the representation vector and the attribute vector of user a. similarity refers to the similarity calculation formula, and here the cosine similarity calculation is selected.
[0189] (5.3.2) Construct an item similarity space based on the item similarity relationship, and establish an item similarity network.
[0190] Select items with similarity greater than the threshold gate as the similarity neighbor nodes of the items, construct an item similarity network, and perform the following feature aggregation.
[0191] (5.3.3) Construct a multi-head attention layer. Through the multi-head attention layer, consider the different importance of different related items for the item feature expression to aggregate each comment vector, and input it into a feed-forward neural network for feature processing to obtain the final item similarity space feature representation, as shown in the formula:
[0192] II ij ={I-item ij} (46)
[0193]
[0194]
[0195] Among them, in formula (16), II ij represents the concatenated representation vector of the j-th similar item of the i-th item. In formula (17), represents the preliminary similar space embedding feature representation matrix output by the a-th attention head of the i-th item. In formula (18), FII i represents the feature vector representation of the similarity space output by the i-th item after passing through the feed-forward neural network connected with the average pooling layer. n represents the number of attention heads.
[0196] (5.4) Extract the feature representation of the user's high-order space.
[0197] (5.4.1) Extract the interaction information of the user's items from the dataset, construct a [user, item] binary group, construct an interaction space of the user-item interaction network, establish a user-item sparse adjacency matrix, and add self-loops to prevent the loss of the item's own information during the later node data update. Then normalize the data to obtain the formula:
[0198]
[0199] In formula (49), Anor_12u represents the normalized item-user sparse adjacency matrix, represents the diagonal matrix composed of the degrees of each user node, A I2U represents the unnormalized user-item sparse adjacency matrix, represents the diagonal matrix composed of the degrees of each item node.
[0200] (5.4.2) Extract the interaction network of similar items established based on the item similarity space from the dataset, establish the item-item sparse adjacency matrix and the user-item sparse adjacency matrix. Similarly, add self-loops to prevent the loss of the item's own information during the later node data update. Then, normalize the data to obtain the formula:
[0201]
[0202] In formula (25), A nor_I2I represents the normalized item-item sparse adjacency matrix, represents the diagonal matrix composed of the degrees of each item node, and A I2I represents the unnormalized item-item sparse adjacency matrix.
[0203] (5.4.3) Construct a graph attention layer to transfer and update node information, process the network constructed in the above (5.4.1) and (5.4.2), and splice its output results to obtain the final high-order spatial feature vector representation of the item, as shown in the formula:
[0204]
[0205]
[0206]
[0207]
[0208] FIH i = [FIHC i || FIHS i ·W q + b q (55)
[0209] Among them, formula (51) is the operation process of the (L + 1)-th layer graph attention network, represents the aggregation of the feature embeddings of the L-th order item neighbors of the i-th item, σ is the activation function for calculating the update result, and here the ELU function is used. is the attention weight coefficient of the potential feature influence of item a on item i, and its calculation formula is shown in the following formula (56), item ia refers to the feature representation of item a among the L-th order neighbors of i. Formula (52) is to aggregate the feature embeddings output by multiple layers of graph attention to obtain the feature representation FIHC of the user-item interaction high-order space of item i i , where Refers to the attention weight parameter of the k-th graph attention layer, and its calculation formula is shown in the following formula (57). Formulas (53) and (54) are graph attention operations on the item similarity space high-order network, and the operation methods are the same as those of the above two formulas, so they will not be elaborated here. Finally, the feature representation FIHS of the user i's social relationship high-order space is output i Formula (29) is to splice the features of the two networks to obtain the final high-order space feature representation FIH of user i i .
[0210]
[0211]
[0212] Among them respectively refer to the set of attention coefficients within the graph attention layer and the set of attention coefficients between graph attention layers, and the softmax function is used to perform a normalization operation on them
[0213] (5.5) Fusion of multi-source feature representations to obtain the final embedded feature representation of the item
[0214] Construct a multi-gated mechanism feature fusion layer, using the output feature representations of (5.1), (5.2), (5.3), (5.4) and the item's own node feature representation as inputs to complete feature fusion. The output feature vector is the final item embedded feature representation, as shown in the formula
[0215] g ab = sigmoid(W ab if a + W ba if b ) (58)
[0216]
[0217] FIi = g1 ⊙ I i + g2 ⊙ FIR i + g3 ⊙ FIU i + g4 ⊙ FII i + g5 ⊙ FIH i (60)
[0218] Among them, in formula (32), if1, if2, if3, if4, if5 respectively refer to the own node feature of item i, FIR i , FIU i , FII i , and FIH i , while g ab refers to the if of the feature vector a For ifb The gating factor index, g a refers to the feature if a The coefficient index obtained after normalizing the gating factor of, and the final item feature representation vector obtained after multi-gating operation is FI i , as the input for subsequent prediction.
[0219] The specific steps of step (5) are as Figure 7 shown, and the specific steps are as follows:
[0220] (6.1) Construct a multi-layer perceptron network to integrate the user's embedding representation and the item's embedding representation, and obtain the formula:
[0221]
[0222] (6.2) Predict the probability of interaction between the user and the item, such as the formula:
[0223] rating ij = w T ·y l-1 (62)
[0224] rating ij represents the probability that user i interacts with item j.
[0225] Embodiment 2 of the present invention provides an item recommendation system. Figure 8 is the structural block diagram of the item recommendation system provided by Embodiment 2 of the present invention. Specifically, it may include:
[0226] (1) A training module for training the item recommendation system, including extracting data preprocessing, fine-grained sentiment level extraction, feature extraction, and model training, and finally obtaining a model that can obtain the embedding feature representations of users and items and can predict the interaction probability between users and items according to their feature representations. (2) A recommendation module for sorting according to the probability of interaction between the user and each item, and selecting items with higher probabilities to generate a Top_N recommendation list.
[0227] The item recommendation system in this example can be used to implement the item recommendation method described in Embodiment 1. The implementation of its training module is similar to that of Embodiment 1 and will not be elaborated here; while the recommendation module is an application of the model trained by the training module, used to predict the interaction probability of a user in the system for a certain item, and at the same time generate a Top_N recommendation list through predicting the interaction probabilities of the user for all items to complete the recommendation.
[0228] The item recommendation system provided in this example uses data such as e-commerce scenarios and content platform scenarios that include social and review relationships as training samples for the model, and then constructs and trains the model through the technical framework mentioned in Example 1. Specifically, it extracts the fine-grained sentiment level of reviews, extracts the fine-grained sentiment features and content features of reviews, constructs multi-source spaces for users and items for feature extraction, fuses the multi-source features of users and items, and trains a prediction model to obtain the final item recommendation prediction model. The trained model can predict the probability of interaction between users and items, and generate a Top-N recommendation list for users based on the predicted results, providing more accurate recommendations for users in all aspects and improving the user experience.
[0229] Further, the training module is as Figure 9 shown, specifically:
[0230] (1) Data preprocessing module: Obtain data information including node information, interaction relationships, social relationships, review information, etc., and perform preprocessing operations on the data before further operations, including constructing user-item graphs, user-item review graphs, user social relationship graphs, etc., and also including operations such as word segmentation of review data. (2) Fine-grained sentiment level extraction module: Perform word segmentation, stop word removal, frequency statistics, selection of high-frequency words, and manual screening operations on the review set to select several keywords at the fine-grained sentiment level of reviews for training with the following model. (3) Feature extraction module: Extract and fuse the multi-source feature representations of users and items according to the technical framework in Example 1, and finally form the embedded feature representation vectors of users and items for training the recommendation model. (4) Recommendation prediction model training module: Input the above embedded feature vectors into a multi-layer perceptron for model training to obtain the final probability prediction model.
[0231] Further, the recommendation module is as Figure 10 shown, specifically: (1) Prediction module: Predict the probability of interaction between the user and the item based on the embedded feature vectors of the user and the item. (2) Top-N recommendation module: Calculate the interaction probabilities between the user and each item, and sort out the final Top-N recommendation list.
[0232] Figure 11 is the architecture diagram of the item recommendation system provided by an embodiment of the present invention, as Figure 11 shown, including:
[0233] A feature extraction unit 1110 is configured to obtain a comment dataset of users on items from the platform business dataset, extract the noun with the highest frequency of occurrence in the comment dataset as the fine-grained sentiment feature keyword of the user's comment on the item; use a BERT model, an attention layer, and a multi-layer perceptron layer to extract the fine-grained sentiment feature keyword to obtain the fine-grained sentiment feature of the comment; and use the BERT model to embed the full-sentence word vectors of the comment dataset to obtain the full-sentence content feature of the comment.
[0234] A user embedding feature determination unit 1120 is configured to obtain the social data of the user and the historical data of the user's interaction with the item from the platform business dataset, construct a comment space of the user according to the relationship of the user's comment on the item, and the comment space includes: the full-sentence content feature of the comment, the fine-grained sentiment feature of the comment, and the temporal feature of the comment; construct an item space of the user according to the interaction relationship between the user and the item, and the item space includes: the rating data of the user on the item, the fine-grained sentiment feature of the comment, all item information interacted with the user, and the temporal information of the interaction; construct a social relationship space according to the social data of the user, and the social relationship space includes: the friend information of the user and the temporal information of establishing the friend relationship; construct a high-order space according to the interaction relationship between the user and the item and the social data of the user, and the high-order space includes: all interaction information of the user and the item and all friend information of the user; perform preliminary feature extraction on the user from the comment space, the item space, the social relationship space, and the high-order space, and use a multi-gating mechanism to fuse the preliminary features of the user extracted from each space and the user node feature vector to obtain the user embedding feature vector.
[0235] An item embedding feature determination unit 1130 is configured to obtain the historical data of the interaction between the item and the user from the platform business dataset, construct a comment space according to the relationship between the item and the user's comment on the item, and the comment space includes: the full-sentence content feature of the comment, the fine-grained sentiment feature of the comment, and the temporal data of the comment; construct a user space according to the interaction relationship between the user and the item, and the user space includes: the rating data of the user on the item, the fine-grained sentiment feature of the comment, all user information with which the item is interacted, and the temporal information of the interaction; construct an item similarity space according to the attribute relationship of the item, and the item similarity space includes: the attribute information of all items; construct a high-order space according to the interaction relationship between the user and the item and the similarity information of the item, and the high-order space includes: all interaction information of the user and the item and all attribute information of the item; perform preliminary feature extraction on the item from the comment space, the user space, the item similarity space, and the high-order space; the feature extraction of the item similarity space needs to fuse the neighbor item vectors; use a multi-gating mechanism to fuse the preliminary features of the item extracted from each space and the item node feature vector to obtain the item embedding feature vector.
[0236] An item recommendation unit 1140 is configured to splice a user embedding feature vector and an item embedding feature vector and then input the result into a multi-layer perceptron network for training to predict the interaction probability between the user and each item, so as to recommend items to the user based on the interaction probability.
[0237] It can be understood that for the detailed function implementation of each of the above units, reference can be made to the introduction in the foregoing method embodiments, and details are not described herein again.
[0238] Those skilled in the art can easily understand that the above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. An item recommendation method, characterized in that, The steps include the following: Obtain the comment dataset of users on items from the platform business dataset, and extract the noun with the highest frequency of occurrence in the comment dataset as the fine-grained sentiment feature keyword for the users' comments on items; Use the BERT model, attention layer, and multi-layer perceptron layer to extract the fine-grained sentiment feature keyword to obtain the fine-grained sentiment feature of the comment; And use the BERT model to embed the full-sentence word vectors of the comment dataset to obtain the full-sentence content feature of the comment; Obtain the social data of users and the historical data of the interaction between users and items from the platform business dataset, construct the comment space of users according to the relationship of users' comments on items, and the comment space includes: the full-sentence content feature of the comment, the fine-grained sentiment feature of the comment, and the temporal feature of the comment; construct the item space of users according to the interaction relationship between users and items, and the item space includes: the rating data of users on items, the fine-grained sentiment feature of the comment, all item information interacted with users, and the temporal information when the interaction occurs; construct the social relationship space according to the social data of users, and the social relationship space includes: the friend information of users and the temporal information when the friend relationship is established; construct the high-order space according to the interaction relationship between users and items and the social data of users, and the high-order space includes: all interaction information between users and items and all friend information of users; perform preliminary feature extraction on users from the comment space, item space, social relationship space, and high-order space, and use a multi-gating mechanism to fuse the preliminary features of users extracted from each space and the user node feature vector to obtain the user embedding feature vector; Obtain the historical data of the interaction between items and users from the platform business dataset, construct the comment space according to the relationship between items and users' comments on items, and the comment space includes: the full-sentence content feature of the comment, the fine-grained sentiment feature of the comment, and the temporal data of the comment; construct the user space according to the interaction relationship between users and items, and the user space includes: the rating data of users on items, the fine-grained sentiment feature of the comment, all user information with which the item is interacted, and the temporal information when the interaction occurs; construct the item similarity space according to the attribute relationship of items, and the item similarity space: all attribute information of items; construct the high-order space according to the interaction relationship between users and items and the similarity information of items, and the high-order space includes: all interaction information between users and items and all attribute information of items; perform preliminary feature extraction on items from the comment space, user space, item similarity space, and high-order space; the extraction of the item similarity space feature needs to fuse the neighbor item vectors; use a multi-gating mechanism to fuse the preliminary features of items extracted from each space and the item node feature vector to obtain the item embedding feature vector; Concatenate the user embedding feature vector and the item embedding feature vector and input them into a multi-layer perceptron network for training to predict the interaction probability between the user and each item, so as to perform item recommendation for the user based on the interaction probability.
2. The method according to claim 1, characterized in that The extraction process of the fine-grained sentiment feature of the comment is as follows: Extract the review texts of each user for each item from the review dataset, and splice them with the fine-grained sentiment feature keywords to form spliced text data. Use the BERT model to process the spliced text data to represent the features of the review at each fine-grained level with the vector representations of the fine-grained sentiment feature keywords; Utilize the feature representations of the review at each fine-grained level, and consider the different impacts of fine-grained sentiment at each level on user decision-making through a multi-head attention layer to form weighted fine-grained sentiment feature representations; Aggregate the weighted fine-grained sentiment feature representations through a multi-layer perceptron layer to form the final fine-grained sentiment feature representations of each review.
3. The method according to claim 1, characterized in that, The process of extracting the feature of the full review sentence is as follows: Extract the review texts of each user for each item from the review dataset, use the BERT model to convert the review texts into word vectors, and use average vectorization to aggregate the word vectors into a preliminary review content representation; Utilize a multi-layer perceptron to perform feature dimensionality reduction on the preliminary review content representation to obtain the final feature representation of the full review sentence.
4. The method according to any one of claims 1 to 3, characterized in that, The process of extracting the user embedding feature vector is as follows: Extract user-review data from the review dataset, and construct a temporal review set for each user according to the review time of the user; extract the temporal position vectors of each user and their respective reviews based on the user's temporal review set; splice the fine-grained sentiment feature representation of the review, the feature representation of the full review sentence, and the review temporal position vector to form a representation vector for each user's review, and construct a multi-head attention layer. Aggregate the review vectors by considering the different importance of different reviews for user feature expression through the multi-head attention layer, and input them into a feed-forward neural network for feature processing. Then, aggregate all the review vectors through an average pooling layer, and input them into a fully connected layer for dimensionality reduction to obtain the final user review space feature representation; Extract user-item-review-rating data from the platform business dataset, and construct an item sequence for each user according to the interaction time between the user and the item; extract the temporal position vectors of each user and each interactive item based on the user's item sequence; splice the rating of the user for the item, the first-order neighbor item feature vector, the fine-grained sentiment feature representation of the review, and the item temporal position vector, construct a multi-head attention layer. Aggregate the review vectors by considering the different importance of different item interactions for user feature expression through the multi-head attention layer, and input them into a feed-forward neural network for feature processing. Then, reduce the dimension through a fully connected layer to obtain the user item space feature representation; Extract the social relationship data of the users from the platform business dataset, construct a user social relationship network, and construct a friend sequence for each user according to the time when the users establish social relationships; Extract the temporal position vectors of each friend of each user based on the user's friend sequence; splice the first-order neighbor friend feature vector and the temporal position vector, and construct a multi-head attention layer. Aggregate the review vectors by considering the different importance of different friends for user feature expression through the multi-head attention layer, and input them into a feed-forward neural network for feature processing. Then, obtain the user social space feature representation through a fully connected layer; Extract the interaction information between users and items from the platform business dataset, construct the interaction network between users and items, and obtain the sparse adjacency matrix of users and items; Extract the interaction network between users and their friends established based on user social relationships from the platform business dataset, and establish the sparse adjacency matrix of users and users; Construct a graph attention layer to transfer and update node information, process the interaction grid between users and items and the interaction network between users and friends respectively, splice their output results, and obtain the high-order spatial feature vector representation of users through dimensionality reduction by a fully connected layer; Construct a multi-gating mechanism feature fusion layer to fuse the user comment space feature representation, user-item space feature representation, user social space feature representation, user high-order spatial feature vector representation, and user node feature vector to obtain the user embedding feature vector.
5. The method according to any one of claims 1 to 3, characterized in that The extraction process of the item embedding feature vector is as follows: Extract item-comment data from the comment dataset, and construct the comment dataset of the item according to the comment time of the item; extract the temporal position vectors of each comment of the item based on the comment dataset of the item; splice the full sentence content feature of the comment, the fine-grained sentiment feature of the comment, and the temporal position vector of the comment, and construct a multi-head attention layer. Aggregate each comment vector by considering the different importance of different comments for item feature expression through the multi-head attention layer, and input it into a feed-forward neural network for feature processing to obtain the item comment space feature representation; Extract user-item-comment-score data from the platform business dataset, and construct the user sequence of the item according to the interaction time of the user and the item; extract the temporal position vectors of each interactive user of each item based on the user sequence of the item; splice the score, the first-order neighbor user feature vector, the comment fine-grained sentiment feature vector, and the temporal position vector, and construct a multi-head attention layer. Aggregate each comment vector by considering the different importance of different item interactions for item feature expression through the multi-head attention layer, and input it into a feed-forward neural network for feature processing to obtain the item user space feature representation; Extract the item data and its attribute data from the platform business dataset, calculate the item similarity; construct the item similarity space according to the item similarity relationship, and establish the item similarity network; construct a multi-head attention layer, and aggregate each comment vector by considering the different importance of different related items for item feature expression through the multi-head attention layer based on the item similarity network, and input it into a feed-forward neural network for feature processing to obtain the item similarity space feature representation; Extract the interaction information between users and items from the platform business dataset, and establish the first sparse adjacency matrix of users and items; Extract the interaction network of similar items established based on the item similarity space from the platform business dataset, and establish the sparse adjacency matrix of items and items and the second sparse adjacency matrix of users and items; construct a graph attention layer to transfer and update node information, process the information of the first sparse adjacency matrix of users and items, the sparse adjacency matrix of items and items, and the second sparse adjacency matrix of users and items, and splice their output results to obtain the high-order spatial feature vector representation of items; Construct a multi-gating mechanism feature fusion layer to fuse the item review space feature representation, item-user space feature representation, item similarity space feature representation, item high-order space feature vector representation, and item node feature vector to obtain an item embedding feature vector.
6. The method according to any one of claims 1 to 3, characterized in that Concatenate the user embedding feature vector and the item embedding feature vector and input them into a multi-layer perceptron network for training to predict the interaction probability between the user and each item, specifically: Construct a multi-layer perceptron network to integrate the user embedding feature vector and the item embedding feature vector: y1=={FU i ||FI j} y2 = σ(W2·y i + b2) y3 = σ(W3 · y2 + b3) …… y l-1 =σ(W l-1 ·y l-2 +b l-1 ) Predict the probability of interaction between a user and an item: rating ij = w T ·y l-1 ; Among them, FU i represents the user embedding feature vector, and FI j represents the item embedding feature vector; y1, y2, ..., y l-1 represents the output vectors of the hidden layers of the perceptron network; W2, W3, ..., W l-1 represents the parameter matrices of the layers of the perceptron neural network; b2, b3, ..., b k-1 represents the bias parameters of the layers of the perceptron neural network; σ represents the activation function of the layers of the perceptron neural network; rating ij represents the probability that user i interacts with item j, and w represents the parameter matrix.
7. An item recommendation system, characterized in that, including: A feature extraction unit for obtaining a dataset of user comments on items from the platform business dataset, and extracting the noun with the highest frequency of occurrence in the comment dataset as the fine-grained sentiment feature keyword of the user's comment on the item; Use a BERT model, an attention layer, and a multi-layer perceptron layer to extract the fine-grained sentiment feature keyword to obtain the fine-grained sentiment feature of the comment; And use the BERT model to embed the full-sentence word vectors of the comment dataset to obtain the full-sentence content feature of the comment; A user embedding feature determination unit for obtaining the social data of the user and the historical data of the user's interaction with items from the platform business dataset, constructing the user's review space according to the relationship between the user's comments on items, where the review space includes: the full-sentence content feature of the comment, the fine-grained sentiment feature of the comment, and the temporal feature of the comment; constructing the user's item space according to the interaction relationship between the user and the item, where the item space includes: the rating data of the user on the item, the fine-grained sentiment feature of the comment, all item information interacting with the user, and the temporal information of the interaction; constructing a social relationship space according to the social data of the user, where the social relationship space includes: the user's friend information and the temporal information of establishing the friendship; constructing a high-order space according to the interaction relationship between the user and the item and the social data of the user, where the high-order space includes: all interaction information between users and items and all friend information of users; perform preliminary feature extraction on the user from the review space, item space, social relationship space, and high-order space, and use a multi-gating mechanism to fuse the user's preliminary features extracted from each space and the user node feature vector to obtain the user embedding feature vector; An item embedding feature determination unit is configured to obtain historical data of the interaction between an item and a user from a platform business dataset, construct a comment space based on the relationship between the item and the user's comments on the item. The comment space includes: the full-sentence content feature of the comment, the fine-grained sentiment feature of the comment, and the time-series data of the comment; construct a user space based on the interaction relationship between the user and the item. The user space includes: the rating data of the user for the item, the fine-grained sentiment feature of the comment, all user information with which the item is interacted, and the time-series information of the interaction; construct an item similarity space based on the attribute relationship of the item. The item similarity space: the attribute information of all items; construct a high-order space based on the interaction relationship between the user and the item and the similarity information of the item. The high-order space includes: all interaction information between users and items and all attribute information of items; perform preliminary feature extraction of the item from the comment space, user space, item similarity space, and high-order space; the feature extraction of the item similarity space needs to fuse the neighbor item vectors; use a multi-gating mechanism to fuse the preliminary item features extracted from each space and the item node feature vector to obtain an item embedding feature vector; An item recommendation unit is configured to splice the user embedding feature vector and the item embedding feature vector and input them into a multi-layer perceptron network for training, and predict the interaction probability between the user and each item, so as to recommend items to the user based on the interaction probability.
8. The system according to claim 7, characterized in that, The feature extraction unit extracts the comment text of each user for each item from the comment dataset, splices it with the fine-grained sentiment feature keywords to form spliced text data, and uses the BERT model to process the spliced text data to represent the features of the comment at each fine-grained level with the vector representation of each fine-grained sentiment feature keyword; utilize the feature representation of the comment at each fine-grained level, consider the different impacts of the fine-grained sentiment at each level on the user's decision through a multi-head attention layer to form a weighted fine-grained sentiment feature representation; and aggregate the features of the weighted fine-grained sentiment feature representation through a multi-layer perceptron layer to form the final fine-grained sentiment feature representation of each comment.
9. An electronic device, comprising a memory and a processor, wherein a computer program that can run on the processor is stored in the memory, characterized in that, When the processor executes the computer program, it implements the item recommendation method according to any one of claims 1 to 6 above.
10. A computer-readable storage medium, characterized in that, A computer program is stored on the storage medium. When the computer program is executed by the processor, it implements the item recommendation method according to any one of claims 1-6.
Citation Information
Patent Citations
Graph neural network recommendation method integrated with comment information
CN112650929A
Comment text-oriented graph neural network recommendation method
CN114723522A
System and method for collaborative shopping, business and entertainment
US20100030578A1
System and method for recommending items in a social network
US20150199715A1