A User Personalized Preference Modeling Method Based on Contrastive Learning for Product Reviews
By combining comparative learning and large language model (LLM) with user inference network, the problem of low user preference mining efficiency in the prior art is solved, and the effect of efficiently mining personalized user preferences in product reviews is achieved.
Patent Information
- Application Number
- CN202510582692.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2045-05-07
AI Technical Summary
Existing user preference mining methods are difficult to effectively use text data to mine personalized user preferences, especially on large-scale data sets, and traditional methods have high computational overhead and poor scalability.
Using a method based on contrast learning, a large language model (LLM) is used to enhance data and assign topics to product review texts, combined with the user inference network, and optimize user preference modeling by minimizing contrast learning loss and related alignment loss.
It realizes efficient exploration of personalized user preferences in product reviews, and improves the effectiveness of topic modeling and the diversity and interpretability of user preference representations.
Smart Images

Figure CN120104885B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of natural language processing, and specifically relates to a user personalized preference modeling method based on contrastive learning for commodity reviews. Background Art
[0002] The mining of user preferences has experienced a transformation from traditional algorithms to modern text mining techniques, which has promoted the continuous development of personalized analysis methods. In the early stage, traditional user preference analysis methods mainly relied on user behavior data, especially user log data, and inferred users' interests and preferences by analyzing users' behavior patterns such as clicks, purchases, and browsing. Although these methods can capture users' basic preferences, their limitation is that they rely on explicit behavior data and ignore users' emotions, attitudes, and needs at a deeper level. Therefore, with the rise of social media and online review platforms, modern user preference mining methods have begun to shift to using text data for analysis. By deeply analyzing user-generated content (such as reviews, posts, feedback, etc.), modern methods can more comprehensively understand users' emotional tendencies and opinions.
[0003] As an important text mining tool, topic models have been widely used in the analysis of text data. Topic models can automatically discover latent topics in text through unsupervised learning of large-scale text data and model the topic distribution of documents. The Latent Dirichlet Allocation (LDA) model is one of the most classic topic modeling methods, and it has achieved remarkable success in topic recognition and text analysis. However, the inference process of the LDA model is relatively complex and computationally expensive, which makes it have certain scalability problems when dealing with large-scale datasets. To solve this problem, with the rise of deep learning technology, neural topic models (such as neural network topic models and variational autoencoders, etc.) have gradually attracted the attention of researchers. These models can combine the powerful learning ability of deep neural networks to automatically learn complex patterns in text, thereby improving the effect of topic modeling.
[0004] However, although neural topic modeling has the potential to handle complex text data, due to the lack of explicit user modeling, these new methods are still difficult to effectively mine personalized user preferences. Summary of the Invention
[0005] To solve the problems existing in the prior art, this application provides a user personalized preference modeling method based on contrastive learning for commodity reviews. This method uses the large language model LLM to assign topics to documents, which helps to mine interpretable topics. During the training process of the user inference network, a contrastive learning method is adopted, combined with relevant alignment losses to optimize the user inference network, and finally personalized user preferences are obtained through the user inference network.
[0006] To achieve the above object, the present application is implemented through the following technical solutions:
[0007] The present application is a user personalized preference modeling method based on contrastive learning for product reviews, and the user personalized preference modeling method includes the following steps:
[0008] Step 1: Construct a dataset by screening review texts with product category information, and perform data preprocessing on the constructed dataset;
[0009] Step 2: Use synonym replacement to perform data augmentation on the review texts in Step 1 to obtain pairs of semantically similar review texts;
[0010] Step 3: Assign topics to the pairs of semantically similar review texts obtained after data augmentation in Step 2 through a large language model LLM;
[0011] Step 4: Create a user recommendation network, input the user index into the user inference network to obtain the user preference distribution, assign topics to the user review texts through the large language model LLM to obtain the document-topic distribution, and multiply the document-topic distribution by the user preference distribution to obtain the user personalized document-topic distribution;
[0012] Step 5: Train the user inference network by minimizing the contrastive learning loss and the relevant alignment loss.
[0013] A further improvement of the present application is that in Step 1, the dataset is the review texts on the Amazon platform, each review text has author id information and product information, the product information includes the category information corresponding to the review text, and three datasets, namely Books, Sports, and Movies, are constructed based on the author id information and the categories of the category information. The data preprocessing includes: removing special characters, removing some punctuation marks, lemmatization, spelling check, and removing short documents.
[0014] A further improvement of the present application is that in Step 2, synonym replacement is used to perform data augmentation on the review texts to obtain pairs of semantically similar review texts, which specifically includes the following steps:
[0015] Step 2.1: For each review text published by the user on the product , select three words and replace them with their synonyms respectively;
[0016] Step 2.2: Perform the first synonym replacement on the review text to complete data augmentation and obtain the first data augmentation document , and after the first data augmentation of all review texts in the dataset, a first data augmentation document set is obtained Perform a second synonym replacement on the review text to complete data augmentation and obtain a second data-augmented document After performing the second data augmentation on all the review texts in the dataset, a set of second data-augmented documents is obtained After two rounds of data augmentation, positive sample pairs with similar semantics are obtained ( , ).
[0017] A further improvement of this application lies in: In step 3, the enhanced review text pairs with similar semantics obtained in step 2 are assigned topics through a large language model LLM, which specifically includes the following steps:
[0018] Step 3.1: Through constructing a prompt instruction, assign each word in the document sample , in the positive sample pair ( ) to the predefined category set, i.e., the topic, to which the word belongs;
[0019] Step 3.2: For each document sample, generate a vector with the same dimension as the number of topics and all elements initialized to zero as the initial document-topic vector of this document sample. The topic assignment of each word in each document sample adopts a counting form. If a word is assigned to the category to which the word belongs, the value at the corresponding topic index position of the document-topic vector of this document sample is incremented by 1. After the statistics are completed, the document-topic vector is calculated through the softmax function to obtain the document-topic distribution vector of the document sample :
[0020]
[0021]
[0022]
[0023]
[0024] where is the count assigned to the th topic of the document sample , is the th word in the document sample , is the th topic in the dataset is the document sample , is the The value of a position is a judgment function.
[0025] A further improvement of this application lies in: in step 4, the user inference network is constructed by a neural network with an encoder architecture, and the encoder consists of an embedding layer, a linear layer, a ReLU activation function layer, and a softmax function layer.
[0026] A further improvement of this application lies in: step 4 specifically includes the following steps:
[0027] Step 4.1, Model the user as an embedded representation:
[0028]
[0029] Wherein, is the embedding layer of the user inference network, is the user index;
[0030] Step 4.2, Input the user index into the embedding layer of the user inference network to obtain the user embedding ;
[0031] Step 4.3, Map the user embedding obtained in step 4.2 to a user preference distribution of dimension :
[0032]
[0033] Wherein, is the weight matrix of the fully connected layer, is the dimension, is the size of the hidden layer of the user recommendation network, is the bias term, is the number of topics, is the activation function, used to convert the document-topic vector into a probability distribution;
[0034] Step 4.4, For the first time, enhance the document to assign topics through the large language model LLM to obtain the document-topic distribution ;
[0035] Step 4.5, Combine the user preference distribution in step 4.3 with the user 's first enhanced document of the review text published on the product to the document-topic distribution of the first enhanced document Dot product to obtain The user personalized document - topic distribution of dimension :
[0036]
[0037] Among them, is the dot product, is The user personalized document - topic distribution of dimension
[0038] A further improvement of this application lies in: In the step 5, the specific calculation process of the user perception contrast learning loss is as follows:
[0039] Given the first data - augmented document set and the second data - augmented document set , for each first data - augmented document , select the corresponding second data - augmented document to construct a positive sample pair ( , ), in the first data - augmented document set and the second data - augmented document set , only select the product category information different from that commented by the first data - augmented document and the comments of different posting users corresponding to the first data - augmented document to construct a negative sample pair ( ), where and and , therefore, the user perception contrast learning loss function of the first data - augmented document , the user perception contrast learning loss function of the second data - augmented document : :
[0040]
[0041]
[0042]
[0043] Among them, is the cosine similarity, is the temperature parameter of the user perception contrast learning, is The user personalized document - topic distribution of dimension is the negative sample judgment function, The first data - augmented document and the second data - augmented document Corresponding products and products When the categories are different and the corresponding users are different, 1 is a negative sample, the current first data enhancement document And the second data enhancement document Corresponding products and products If the categories are different and the corresponding users are the same, If it is 0, it is a non-negative sample. If the current data is enhanced for the first time, And the second data enhancement document Corresponding products and products If the categories are the same and the corresponding users are different, 0 is a non-negative sample;
[0044] Loss function based on user perception contrast learning , the first data augmentation document collection and the second data augmentation document collection The user-perceived contrastive learning loss is as follows:
[0045]
[0046] in, is the batch size, For Documents The contrastive learning loss of the first augmented document, For Documents The contrastive learning loss of the second augmented document is a user, is the entire user set, Is the document index.
[0047] A further improvement of the present application is that in step 5, the specific calculation process of the relevant alignment loss is: given A personalized document-topic distribution set of size and from the Dirichlet distribution The sampled Prior distribution of size , the estimated relevant alignment loss is:
[0048]
[0049]
[0050]
[0051] in, It is a personalized document-topic distribution set The covariance matrix of is the prior distribution The covariance matrix of is the number of topics, for and The square of the Frobenius norm obtained by subtraction, is the transpose operation of the matrix, is the correlation alignment loss;
[0052] The total loss of the user inference network training is:
[0053]
[0054] in, is a hyperparameter for user inference network training.
[0055] A further improvement of the present application is that the training of the user inference network in step 5 specifically includes the following steps:
[0056] Step 5.1: Construct a user inference network and use the optimizer. The loss function of the user inference network is user perception contrast learning loss. and related alignment loss ;
[0057] Step 5.2: Sample from the dataset and obtain the document-topic distribution through the large language model (LLM). At the same time, sample the corresponding user index and input it into the user inference network. The user-personalized document-topic distribution is obtained by multiplying the obtained document-topic distribution with the user preference distribution, and the user-personalized document-topic distribution is obtained from the subject parameter Dirichlet distribution Sampling from the prior distribution ;
[0058] Step 5.4: Repeat steps 5.2 and 5.3 until the user infers that the network converges.
[0059] The beneficial effects of this application are: this application provides the entire process of mining topics and user preferences in product reviews, including starting from data construction and preprocessing of data; in addition, by minimizing the maximum mean deviation loss between the learned representation and the Dirichlet prior distribution, the representation is made diverse and interpretable; for common problems in contrastive learning such as the selection of positive and negative examples, this application uses the category of the product corresponding to the review and the user who posted the review as the basis for selecting positive and negative examples to learn user personalized preferences.
[0060] In summary, the present application provides steps for obtaining from data construction to theme representation, and also provides all steps for mining different user preferences. Description of the Drawings
[0061] Figure 1 is the model structure diagram of the present application.
[0062] Figure 2 is the flow chart of the present application.
[0063] Figure 3 is the user inference network architecture diagram of the present application. Detailed Implementation Manner
[0064] The present application will be further clarified below in conjunction with the accompanying drawings and specific implementation methods. It should be understood that the following specific examples are only used to illustrate the present application and are not used to limit the scope of the present application. After reading the present application, various equivalent forms of modification by those skilled in the art fall within the scope defined by the appended claims of the present application.
[0065] As Figure 1 , 2 shown, the present invention is a user personalized preference modeling method based on contrastive learning for commodity reviews, which specifically includes the following steps:
[0066] Step 1: Construct a data set by screening review texts with commodity category information, and perform data preprocessing on the constructed data set. In the present application, the data set is the review texts on the Amazon platform. Each review text has author id information and commodity information. The commodity information includes the category information corresponding to the review text. Three data sets, namely Books, Sports, and Movies, are constructed based on the author id information and the categories of the category information. The data preprocessing includes: removing special characters, removing some punctuation marks, lemmatization, spelling check, and removing short documents.
[0067] Step 2: Use synonym replacement to perform data augmentation on the review texts in Step 1 to obtain review text pairs with similar semantics, which specifically includes the following steps:
[0068] Step 2.1: Use document augmentation to generate document pairs that are semantically similar to the original document. Specifically, for each review text published by the user on the product , randomly select three words and replace them with their synonyms respectively. The synonyms are from the WordNet synonym set;
[0069] Step 2.2: Perform the first synonym replacement on the review text to complete data augmentation and obtain the first data-augmented document , the first data augmentation is performed on all review texts in the dataset to obtain the first data augmentation document set , for the review text perform the second synonym replacement to complete the data augmentation and obtain the second data augmentation document , the second data augmentation is performed on all review texts in the dataset to obtain the second data augmentation document set , after two data augmentations, obtain positive sample pairs with similar semantics ( , ).
[0070] Step 3. Assign the data-augmented review text pairs with similar semantics obtained in Step 2 to topics through the large language model LLM; specifically, it includes the following steps:
[0071] Step 3.1. To infer the document-topic distribution vector of the augmented pair, use the large language model LLM to perform topic assignment. Specifically, by constructing a prompt instruction, assign each word in the document sample in the positive sample pair ( , ) to the predefined category set that the word belongs to, that is, the topic;
[0072] Step 3.2. For each document sample, generate a vector with the same dimension as the number of topics and all elements initialized to zero as the initial document-topic vector of the document sample. The topic assignment of each word in each document sample adopts a counting form. If the word is assigned to the category that the word belongs to, the position of the corresponding topic index in the document-topic vector of the document sample is incremented by 1. After the statistics are completed, calculate the document-topic distribution vector of the document sample through the softmax function: :
[0073]
[0074]
[0075]
[0076]
[0077] Among them, is the count assigned to the th topic of the document sample , is the th word in the document sample , is the th topic in the dataset. is the number of words in the document sample and is the value at the -th position of the document-topic vector and
[0078] Step 4. Create a user recommendation network. Input the user index into the user inference network to obtain the user preference distribution. The user review text is assigned a topic by the large language model LLM to obtain the document-topic distribution. Multiply the document-topic distribution by the user preference distribution to obtain the user personalized document-topic distribution. Among them, as Figure 3 shown, the user inference network is constructed by a neural network with an encoder architecture, and the encoder consists of an embedding layer, a linear layer, a ReLU activation function layer, and a softmax function layer. The specific steps of Step 4 are as follows:
[0079] Step 4.1. Model the user as an embedded representation:
[0080]
[0081] where is the embedding layer of the user inference network and
[0082] is the user index; Step 4.2. Input the user index into the embedding layer of the user inference network to obtain the corresponding user embedding[[ID=�7]]
[0083] ; Step 4.3. Map the user embedding obtained in Step 4.2 to a
[0084] -dimensional user preference distribution
[0085] : where is the weight matrix of the fully connected layer is the dimension is the size of the hidden layer of the user recommendation network is the number of topics is the activation function used to convert the document-topic vector into a probability distribution;
[0086] Step 4.4. Augment the document for the first time by assigning a topic through the large language model LLM to obtain the document-topic distribution
[0087] Step 4.5: Multiply the user preference distribution in Step 4.3 with the user 's first enhanced document of the review text published for the product by the document-topic distribution to obtain the user personalized document-topic distribution of dimension :
[0088]
[0089] wherein, is the dot product, is the user personalized document-topic distribution of dimension
[0090] Step 5: Train the user inference network by minimizing the contrastive learning loss and the related alignment loss. Determine the category of the product corresponding to different review texts and the corresponding users as the basis for contrastive learning. For example, if the categories of the products corresponding to two review documents, i.e., the first data enhancement document and the second data enhancement document , are different and are published by two different users, then it is considered that the obtained personalized document-topic distributions should be as different as possible, serving as negative sample pairs in contrastive learning, while the positive sample pairs are a pair of enhanced samples for each review text. Specifically, the specific calculation process of the user-aware contrastive learning loss is as follows: Given the first data enhancement document set and the second data enhancement document set , for each first data enhancement document , select the corresponding second data enhancement document to construct the positive sample pair ( , ). For the selection of negative sample pairs, only select the review in the first data enhancement document set and the second data enhancement document set that has different product category information from the product reviewed by the first data enhancement document and the review corresponding to a different posting user from the first data enhancement document to construct the negative sample pair ( ), where , and thus, the user-aware contrastive learning loss function of the first data enhancement document , the user-aware contrastive learning loss function of the second data enhancement document :
[0091]
[0092]
[0093]
[0094] Among them, is the cosine similarity, is the temperature parameter of user-aware contrastive learning, is the user's personalized document-topic distribution in dimension is the negative sample judgment function, The first data-augmented document and the second data-augmented document corresponding product and product have different categories and different corresponding users, is 1, i.e., a negative sample. The current first data-augmented document and the second data-augmented document corresponding product and product have different categories and the same corresponding users, is 0, i.e., a non-negative sample. If the current first data-augmented document and the second data-augmented document corresponding product and product have the same category and different corresponding users, is 0, i.e., a non-negative sample;
[0095] Based on the user-aware contrastive learning loss function , the user-aware contrastive learning loss of the first data-augmented document set and the second data-augmented document set is as follows:
[0096]
[0097] Among them, is the batch size, is the contrastive learning loss of the document after the first augmentation of the document, is the contrastive learning loss of the document after the second augmentation of the document. is the user, is the entire user set, is the document index.
[0098] Model the personalized document - topic distribution with Dirichlet distribution, and adopt relevant alignment in the user - perception contrast learning process to align the inferred personalized document - topic distribution with the Dirichlet prior. The specific calculation process of the relevant alignment loss is as follows: Given a set of personalized document - topic distributions of size and a prior distribution of size randomly sampled from the Dirichlet distribution , estimate the relevant alignment loss as:
[0099]
[0100]
[0101]
[0102] where is the covariance matrix of the set of personalized document - topic distributions , is the covariance matrix of the set of distributions sampled from the Dirichlet distribution, is the number of topics, is the square of the Frobenius norm obtained by subtracting from is the transpose operation of the matrix, is the relevant alignment loss;
[0103] The total loss of training the user inference network is:
[0104]
[0105] where, is the hyperparameter for training the user inference network.
[0106] In this step, training the user inference network specifically includes the following steps:
[0107] Step 5.1, construct the user inference network, use the optimizer, and the loss function of the user inference network training is the user - perception contrast learning loss and the relevant alignment loss ;
[0108] Step 5.2: Randomly sample from the dataset and obtain the document-topic distribution through the large language model LLM. At the same time, sample the corresponding user index and input it into the user inference network. Multiply the obtained document-topic distribution and the user preference distribution to obtain the user personalized document-topic distribution, and sample the prior distribution from the Dirichlet distribution with parameter ; ;
[0109] Step 5.3: Perform stochastic gradient descent by optimizing the user-aware contrastive learning loss and the related alignment loss to update the parameters of the user inference network;
[0110] Step 5.4: Repeat Step 5.2 and Step 5.3 until the user inference network converges.
[0111] To verify this application, experiments were conducted on the review data of the Amazon platform. The relevant experimental data on the Books dataset are shown in Table 1 as follows:
[0112] Table 1
[0113]
[0114] As shown in Table 1, the topic consistency values of this application tested on the Books dataset are as follows: CP is 0.502, NPMI is 0.121, UCI is 1.187, and UT is 0.890. All the metrics are higher than those of the comparative experiments. Among them, the highest values in the comparative experiments are CP is 0.346, NPMI is 0.065, UCI is 0.165, and UT is 0.842. The comparative models used in this experiment are Comparative Example 1, Comparative Example 2, and Comparative Example 3. The specific model sources are:
[0115] Comparative Example 1 is the LDA method; Comparative Example 2 is the BERTopic method; Comparative Example 3 is the CWTM method.
[0116] In the comparative experiment results of this application, the calculation method of the UT metric used is , where represents the total number of uniquely occurring topic words; while the CP, NPMI, and UCI metrics are common topic quality assessment metrics used to measure the semantic consistency and coherence of topics.
[0117] The above are only the preferred embodiments of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present invention.
Claims
1. A user personalized preference modeling method based on contrastive learning for commodity reviews, characterized in that: The user personalized preference modeling method includes the following steps: Step 1: Construct a dataset by screening review texts with product category information, and perform data preprocessing on the constructed dataset; Step 2: Use synonym replacement to perform data augmentation on the review texts in Step 1 to obtain semantically similar review text pairs; Step 3: Assign topics to the semantically similar review text pairs obtained after data augmentation in Step 2 through the large language model LLM, which specifically includes the following steps: Step 3.
1. Assign each word in the document sample x in the positive sample pair to the predefined category set to which the word belongs, by constructing a prompt instruction; a ∪X b ) Step 3.2: For each document sample, generate a vector with the same dimension as the number of topics and all elements initialized to zero as the initial document-topic vector of the document sample. The topic assignment of each word in each document sample is in the form of counting. If a word is assigned to the category to which the word belongs, then the value at the corresponding topic index of the document-topic vector of the document sample is incremented by 1. After the statistics are completed, the document-topic distribution vector δ(w m ,t j ) of the document sample x is obtained by calculating through the softmax function: Among them, is the count assigned to the j-th topic of the document sample x, w m is the m-th word in the document sample x, t j is the j-th topic in the dataset, N is the number of words in the document sample x, is the value at the j-th position of the document-topic vector, δ(w m , t j ) is the judgment function; Step 4: Create a user inference network, input the user index into the user inference network to obtain the user preference distribution, assign topics to the user review texts through the large language model LLM to obtain the document-topic distribution, and multiply the document-topic distribution by the user preference distribution to obtain the user personalized document-topic distribution; specifically includes the following steps: Step 4.1: Model the user u as an embedded representation: where U is the embedding layer of the user inference network, and Id[u] is the user index; Step 4.2: Input the user index Id[u] into the embedding layer of the user inference network to obtain the user embedding E u ; Step 4.
3. Map the user embedding E obtained in Step 4.2 u to a K-dimensional user preference distribution Among them, is the weight matrix of the fully connected layer, R is the dimension, H u is the size of the hidden layer of the user recommendation network, b3 is the bias term, K is the number of topics, ReLU(·) is the activation function, and Softmax(·) is used to convert the document-topic vector into a probability distribution; Step 4.4: Use the first data augmentation document Assign topics through the large language model LLM to obtain the document-topic distribution Step 4.5: Multiply the user preference distribution in Step 4.3 by the document-topic distribution of the first data augmentation document of the review text published by user u on product i in Step 4.4 to obtain a K-dimensional user personalized document-topic distribution Among them, is the dot product, is the K-dimensional user personalized document-topic distribution; Step 5: Train the user inference network by minimizing the contrastive learning loss and the relevant alignment loss; specifically includes the following steps: Step 5.
1. Construct a user inference network and use an optimizer. The loss function of the user inference network training is the user perception contrastive learning loss L U and the relevant alignment loss Step 5.2: Sample from the dataset and obtain the document-topic distribution through the large language model LLM. At the same time, sample the corresponding user index and input it into the user inference network. Obtain the user personalized document-topic distribution by multiplying the obtained document-topic distribution and the user preference distribution, and sample the prior distribution Θ” from the Dirichlet distribution with parameter ; Step 5.
3. Update the parameters of the user inference network by performing stochastic gradient descent on the optimized user perception contrastive learning loss L U and the relevant alignment loss ; Step 5.4: Repeat Step 5.2 and Step 5.3 until the user inference network converges.
2. The user personalized preference modeling method based on contrastive learning for product reviews according to claim 1, wherein: In Step 1, the dataset is the review texts on the Amazon platform. Each review text has author id information and product information. The product information includes the category information corresponding to the review text. Three datasets, namely Books, Sports, and Movies, are constructed based on the author id information and the categories of the category information. The data preprocessing includes: removing special characters, removing some punctuation marks, lemmatization, spelling check, and removing short documents.
3. The user personalized preference modeling method based on contrastive learning for product reviews according to claim 1, characterized in that: In Step 2, synonym replacement is used to perform data augmentation on the review texts to obtain semantically similar review text pairs, which specifically includes the following steps: Step 2.1: For each review text x published by user u on product i i,u , select three words and replace them with synonyms of the review text x i,u respectively; Step 2.2: Perform the first synonym replacement on the review text x i,u to complete data augmentation and obtain the first data-augmented document After performing the first data augmentation on all review texts in the dataset, the first data-augmented document set X is obtained a , perform the second synonym replacement on the review text x i,u to complete data augmentation and obtain the second data-augmented document After performing the second data augmentation on all review texts in the dataset, the second data-augmented document set X is obtained b , obtain pairs of review texts with similar semantics, i.e., positive sample pairs, through two data augmentations 4. The user personalized preference modeling method based on contrastive learning for commodity reviews according to claim 1, wherein: In Step 4, the user inference network is constructed using a neural network with an encoder architecture. The encoder consists of an embedding layer, a linear layer, a ReLU activation function layer, and a softmax function layer.
5. The user personalized preference modeling method based on contrastive learning for product reviews according to claim 1, wherein: In step 5, the specific calculation process of the user perception contrast learning loss is as follows: Given the first data augmentation document set X a and the second data augmentation document set X b , for each first data augmentation document select the corresponding second data augmentation document to construct a positive sample pair In the first data augmentation document set X a and the second data augmentation document set X b , only select the product category information different from that commented on by the first data augmentation document and the comments of different posting users corresponding to the first data augmentation document to construct a negative sample pair where i ≠ i and u + ≠ u. Therefore, the user perception contrast learning loss function of the first data augmentation document + the user perception contrast learning loss function of the second data augmentation document where s(·,·) is the cosine similarity, and τ u is the temperature parameter of user-aware contrastive learning, is the K-dimensional user personalized document-topic distribution, and I u (i,j) is the negative sample judgment function. When the u first data-augmented document and the second data-augmented document correspond to different categories of products i and j and different corresponding users, u (i,j) is 1, that is, a negative sample. When the current first data-augmented document and the second data-augmented document correspond to different categories of products i and j and the same corresponding user, u (i,j) is 0, that is, a non-negative sample. If the current first data-augmented document and the second data-augmented document correspond to the same category of products i and j and different corresponding users, u (i,j) is 0, that is, a non-negative sample. User Perception-based Contrastive Learning Loss Function The first data augmentation document set X a and the second data augmentation document set X b The user perception-based contrastive learning loss is as follows: where M is the batch size, is the contrastive learning loss of the document after the first enhancement of document l, is the contrastive learning loss of the document after the second enhancement of document l, u is the user, U is the entire user set, and l is the document index.
6. The user personalized preference modeling method based on contrastive learning for product reviews according to claim 5, wherein: In step 5, the specific calculation process of the relevant alignment loss is as follows: Given a personalized document-topic distribution set of size 2M and a prior distribution of size 2M sampled from the Dirichlet distribution the relevant alignment loss is estimated as: where C Θ' is the covariance matrix of the personalized document-topic distribution set Θ', C Θ” is the covariance matrix of the prior distribution Θ", d is the number of topics, is the square of the Frobenius norm obtained by subtracting C Θ' from C Θ” , T is the transpose operation of the matrix, is the relevant alignment loss; The total loss of the training of the user inference network is: where λ1 is a hyperparameter for training the user inference network.
Citation Information
Patent Citations
A model construction method and system for score prediction
CN109903099A
E-commerce consumer preference prediction method and system based on machine learning
CN118379084A