Commodity comment-oriented user personalized preference modeling method based on comparative learning
By applying a method based on comparison learning in product reviews, using a large language model to assign topics to the comment text, and combining user inference networks and comparison learning to optimize user preference modeling, it solves the problem of difficulty in exploring personalized user preferences in the existing technology, and achieves efficient user preference modeling.
Patent Information
- Application Number
- CN202510582692.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2045-05-07
AI Technical Summary
The prior art is difficult to effectively tap personalized user preferences, especially when processing complex text data, and lacks clear user modeling.
The user's personalized preference modeling method based on contrast learning for product reviews is adopted, and the comment text is assigned topics using the large language model LLM, and the user's inference network is combined with contrast learning and related alignment losses to optimize user preference modeling.
It realizes the mining of explainable topics and personalized user preferences in product reviews, improving the effectiveness and efficiency of user preference modeling.
Smart Images

Figure CN120104885A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of natural language processing, and specifically relates to a user personalized preference modeling method based on contrastive learning for product reviews. Background Art
[0002] User preference mining has undergone a transformation from traditional algorithms to modern text mining technology, which has promoted the continuous development of personalized analysis methods. In the early days, traditional user preference analysis methods mainly relied on user behavior data, especially user log data, and inferred user interests and preferences by analyzing user 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 turn to the use of text data for analysis. Through in-depth analysis of user-generated content (such as comments, 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 potential topics in text and model the topic distribution of documents through unsupervised learning of large-scale text data. The Latent Dirichlet Allocation (LDA) model is one of the most classic topic modeling methods, which has achieved remarkable success in topic identification and text analysis. However, the inference process of the LDA model is relatively complex and has high computational overhead, which makes it have certain scalability problems when processing large-scale data sets. In order to solve this problem, with the rise of deep learning technology, neural topic models (such as neural network topic models and variational autoencoders) 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, despite the potential of neural topic modeling in processing complex text data, these new methods still have difficulty in effectively mining personalized user preferences due to the lack of explicit user modeling. Summary of the invention
[0005] In order to solve the problems existing in the prior art, the present application provides a user personalized preference modeling method based on contrastive learning for product reviews. This method uses a large language model (LLM) to assign topics to documents, which helps to mine explainable topics. In the user inference network training process, a contrastive learning method is adopted, combined with relevant alignment loss to optimize the user inference network, and finally personalized user preferences are obtained through the user inference network.
[0006] In order to achieve the above objectives, this 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 comprises the following steps:
[0008] Step 1: Construct a data set by filtering review texts with product category information and perform data preprocessing on the constructed data set;
[0009] Step 2: Use synonym replacement to perform data augmentation on the comment text in step 1 to obtain semantically similar comment text pairs;
[0010] Step 3: The semantically similar review text pairs obtained after data enhancement in step 2 are assigned topics through the large language model LLM;
[0011] Step 4: Create a user recommendation network, input the user index into the user inference network, obtain the user preference distribution, assign topics to the user comment text through the large language model LLM, obtain the document-topic distribution, multiply the document-topic distribution by the user preference distribution, and 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 data set is the review text of the Amazon platform, each review text has author id information and product information, the product information includes category information corresponding to the review text, and three data sets are constructed based on the author id information and the category information, namely Books, Sports, and Movies, and data preprocessing includes: removing special characters, removing some punctuation marks, word form restoration, spell checking, and removing short documents.
[0014] A further improvement of the present application is that: the step 2 uses synonym replacement to perform data enhancement on the comment text to obtain a pair of comment texts with similar semantics, which specifically includes the following steps:
[0015] Step 2.1: Target users About Products The text of each comment posted , select three words and replace them with their synonyms respectively;
[0016] Step 2.2: Comment on the text Perform the first synonym replacement to complete data enhancement and obtain the first data enhancement document , after the first data enhancement of all comment texts in the dataset, the first data enhancement document set is obtained , for the comment text Perform the second synonym replacement to complete data enhancement and obtain the second data enhancement document , after the second data enhancement of all the comment texts in the dataset, the second data enhancement document set is obtained , after two data enhancements, we obtain semantically similar positive sample pairs ( , ).
[0017] A further improvement of the present application is that in step 3, the enhanced semantically similar comment text pairs obtained in step 2 are assigned topics through a large language model LLM, which specifically includes the following steps:
[0018] Step 3.1, construct the prompt instruction to convert the positive sample pair ( , ) Each word in is assigned to a predefined set of categories, i.e., topics, 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 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, the position of the corresponding topic index of the document-topic vector of the document sample is increased by 1. After the statistics are completed, the document-topic vector is calculated by the softmax function to obtain the document sample The document-topic distribution vector :
[0020]
[0021]
[0022]
[0023]
[0024] in, It is a sample document No. The count of topics assigned to them, It is a sample document Middle words, It is the first Themes, It is a sample document The number of words in is the document-topic vector The value of the position, is the judgment function.
[0025] A further improvement of the present application is that in step 4, the user inference network is constructed using a neural network with an encoder architecture, and the encoder is composed of an embedding layer, a linear layer, a ReLU activation function layer, and a softmax function layer.
[0026] A further improvement of the present application is that step 4 specifically includes the following steps:
[0027] Step 4.1: User Modeled as an embedding representation:
[0028]
[0029] in, is the embedding layer of the user inference network, is the user index;
[0030] Step 4.2: Index the user Input the embedding layer of the user inference network to obtain the user embedding ;
[0031] Step 4.3: Embed the user obtained in step 4.2 Mapping User preference distribution of :
[0032]
[0033] in, 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 document-topic vectors into probability distributions;
[0034] Step 4.4: First data augmentation document Assign topics through the large language model LLM to obtain document-topic distribution ;
[0035] Step 4.5: Distribute the user preferences in step 4.3 As in step 4.4, the user About Products First enhancement of the text of published comments Document-topic distribution of Dot product User personalized documents-topic distribution :
[0036]
[0037] in, is the dot product, yes User personalized document-topic distribution based on dimension.
[0038] A further improvement of the present application is that in step 5, the specific calculation process of the user perceived contrastive learning loss is:
[0039] Given the first data augmentation document collection And the second data augmentation document collection , for each first data augmentation document , select the corresponding second data enhancement document To construct positive sample pairs ( , ), in the first data augmentation document collection And the second data augmentation document collection Only select the documents with the first data augmentation The different product category information reviewed and the first data enhancement document Comments from different posting users To construct negative sample pairs ( ),in and , so the first data augmentation document User-perceived contrastive learning loss function , Second data enhancement document User-perceived contrastive learning loss function :
[0040]
[0041]
[0042]
[0043] in, is the cosine similarity, is the temperature parameter of user-perceived contrast learning, yes User personalized document-topic distribution of dimension, is the negative sample judgment function, First Data Augmentation Document And the second data enhancement 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, 0 means 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 means 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 Documentation The contrastive learning loss of the first augmented document, For Documentation The contrastive learning loss of the second augmented document is a user, is the entire set of users, 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 collection of size and from the Dirichlet distribution The sampled Prior distribution of size , the estimated relevant alignment loss is:
[0048]
[0049]
[0050]
[0051] in, Is a personalized document-topic distribution collection 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 training is user perception contrast learning loss. and the 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 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 the present application are as follows: the present application provides a whole process for mining topics and user preferences in product reviews, including starting from constructing data, preprocessing data, etc.; 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, the present 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, so as to learn the personalized preferences of users.
[0060] In summary, this application provides steps from data construction to obtaining topic representation, and also provides all steps for mining different user preferences. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] Figure 1 It is a model structure diagram of this application.
[0062] Figure 2 It is a flow chart of this application.
[0063] Figure 3 This is the user inference network architecture diagram of this application. DETAILED DESCRIPTION
[0064] The present application is further explained 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 modifications to the present application by technicians in this field all fall within the scope defined by the claims attached to the present application.
[0065] like Figure 1 , 2 As shown, the present invention is a user personalized preference modeling method based on contrastive learning for product reviews, which specifically includes the following steps:
[0066] Step 1. Construct a data set by screening review texts with product category information, and perform data preprocessing on the constructed data set. In this application, the data set is the review text of the Amazon platform. Each review text has author id information and product information. The product information includes category information corresponding to the review text. Three data sets are constructed based on the author id information and the category information, namely Books, Sports, and Movies. Data preprocessing includes: removing special characters, removing some punctuation marks, word form restoration, spell checking, and removing short documents.
[0067] Step 2: Use synonym replacement to perform data enhancement on the comment text in step 1 to obtain semantically similar comment text pairs, which specifically includes the following steps:
[0068] Step 2.1: Use document enhancement to generate document pairs that are semantically similar to the original document. Specifically, for user About Products The text of each comment posted , randomly select three words and replace them with their synonyms, the synonyms come from the WordNet synset;
[0069] Step 2.2: Comment on the text Perform the first synonym replacement to complete data enhancement and obtain the first data enhancement document , after the first data enhancement of all comment texts in the dataset, the first data enhancement document set is obtained , for the comment text Perform the second synonym replacement to complete data enhancement and obtain the second data enhancement document , after the second data enhancement of all the comment texts in the dataset, the second data enhancement document set is obtained , after two data enhancements, we obtain semantically similar positive sample pairs ( , ).
[0070] Step 3: The semantically similar review text pairs obtained after data enhancement in step 2 are assigned topics through the large language model LLM; specifically, the steps include:
[0071] Step 3.1: In order to infer the document-topic distribution vector of the enhanced pair, the large language model LLM is used to perform topic assignment. Specifically, the positive sample pair ( , ) Each word in is assigned to a predefined set of categories, i.e., topics, to which the word belongs;
[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 is in the form of counting. If a word is assigned to the category to which the word belongs, the position of the corresponding topic index of the document-topic vector of the document sample is increased by 1. After the statistics are completed, the document-topic vector is calculated by the softmax function to obtain the document sample The document-topic distribution vector :
[0073]
[0074]
[0075]
[0076]
[0077] in, It is a sample document No. The count of topics assigned to them, It is a sample document Middle words, It is the first Themes, It is a sample document The number of words in is the document-topic vector The value of the position, is the judgment function.
[0078] Step 4: Create a user recommendation network, input the user index into the user inference network, obtain the user preference distribution, assign topics to the user comment text through the large language model LLM, obtain the document-topic distribution, multiply the document-topic distribution by the user preference distribution, and obtain the user personalized document-topic distribution. Figure 3 As shown, the user inference network is constructed using a neural network with an encoder architecture, and the encoder is composed of an embedding layer, a linear layer, a ReLU activation function layer, and a softmax function layer. Step 4 specifically includes the following steps:
[0079] Step 4.1: User Modeled as an embedding representation:
[0080]
[0081] in, is the embedding layer of the user inference network, is the user index;
[0082] Step 4.2: Index the user Input the embedding layer of the user inference network to obtain the corresponding user embedding ;
[0083] Step 4.3: Embed the user obtained in step 4.2 Mapping User preference distribution of :
[0084]
[0085] in, 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 document-topic vectors into probability distributions;
[0086] Step 4.4: First data augmentation document Assign topics through the large language model LLM to obtain document-topic distribution
[0087] Step 4.5: Distribute the user preferences in step 4.3 As in step 4.4, the user About Products First enhancement document of published review text Document-topic distribution of Dot product User personalized documents-topic distribution :
[0088]
[0089] in, is the dot product, yes User personalized document-topic distribution based on dimension.
[0090] Step 5: Train the user inference network by minimizing the contrastive learning loss and the relevant alignment loss. The contrastive learning is based on judging the product categories and users corresponding to different review texts. For example, two review documents are the first data augmentation documents. And the second data enhancement document If the categories of the corresponding products are different and they are published by two different users, then it is considered that the personalized document-topic distributions should be as different as possible, which serves as the negative sample pair in contrastive learning, while the positive sample pair is a pair of enhanced samples for each comment text. Specifically, the specific calculation process of user-perceived contrastive learning loss is: given the first data augmentation document set And the second data augmentation document collection , for each first data augmentation document , select the corresponding second data enhancement document To construct positive sample pairs ( , ), for the selection of negative sample pairs, in the first data augmentation document set And the second data augmentation document collection Only select the documents with the first data augmentation The different product category information reviewed and the first data enhancement document Comments from different posting users To construct negative sample pairs ( ),in and , so the first data augmentation document User-perceived contrastive learning loss function , Second data enhancement document User-perceived contrastive learning loss function :
[0091]
[0092]
[0093]
[0094] in, is the cosine similarity, is the temperature parameter of user-perceived contrast learning, yes User personalized documents-topic distribution of dimensions, is the negative sample judgment function, First Data Augmentation Document And the second data enhancement 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, 0 means 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 means non-negative sample;
[0095] 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:
[0096]
[0097] in, is the batch size, For Documentation The contrastive learning loss of the first augmented document, For Documentation The contrastive learning loss of the second enhanced document is the user, is the entire set of users, Is the document index.
[0098] The Dirichlet distribution is used to model the personalized document-topic distribution. In the user-aware contrastive learning process, correlation alignment is used to align the inferred personalized document-topic distribution with the Dirichlet prior. The specific calculation process of the correlation alignment loss is: given A personalized document-topic distribution collection of size and from the Dirichlet distribution Randomly sampled from Prior distribution of size , the estimated relevant alignment loss is:
[0099]
[0100]
[0101]
[0102] in, is a personalized document-topic distribution collection The covariance matrix of is the set of distributions sampled from the Dirichlet 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;
[0103] The total loss of the user inference network training is:
[0104]
[0105] in, is a hyperparameter for user inference network training.
[0106] In this step, training the user inference network specifically includes the following steps:
[0107] Step 5.1: Construct a user inference network and use the optimizer. The loss function of the user inference network training is user perception contrast learning loss. And the related 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. The user-personalized document-topic distribution is obtained by multiplying the obtained document-topic distribution with the user preference distribution, and the distribution is obtained from the subject parameter Dirichlet distribution Sampling from the prior distribution ;
[0109] Step 5.3: Optimizing user-perceived contrastive learning loss and the related alignment loss Perform stochastic gradient descent to update the parameters of the user inference network;
[0110] Step 5.4: Repeat steps 5.2 and 5.3 until the user infers that the 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 is shown in Table 1:
[0112] Table 1
[0113]
[0114] As shown in Table 1, the subject 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. The indicators are all higher than the comparative experiments, among which the highest in the comparative experiments are CP 0.346, NPMI 0.065, UCI 0.165, and UT 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 experimental results of this application, the UT index calculation method used is ,in It represents the total number of uniquely occurring subject terms; CP, NPMI and UCI indicators are commonly used topic quality assessment indicators, which are used to measure the semantic consistency and coherence of topics.
[0117] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A user personalized preference modeling method based on contrastive learning for product reviews, characterized by: The user personalized preference modeling method comprises the following steps: Step 1: Construct a data set by filtering review texts with product category information and perform data preprocessing on the constructed data set; Step 2: Use synonym replacement to perform data augmentation on the comment text in step 1 to obtain semantically similar comment text pairs; Step 3: The semantically similar review text pairs obtained after data enhancement in step 2 are assigned topics through the large language model LLM; Step 4: Create a user inference network, input the user index into the user inference network, obtain the user preference distribution, assign topics to the user comment text through the large language model LLM, obtain the document-topic distribution, multiply the document-topic distribution by the user preference distribution, and obtain the user personalized document-topic distribution; Step 5: Train the user inference network by minimizing the contrastive learning loss and the relevant alignment loss.
2. The user personalized preference modeling method based on contrastive learning for product reviews according to claim 1 is characterized by: In step 1, the data set is the review text of the Amazon platform. Each review text has author ID information and product information. The product information includes category information corresponding to the review text. Three data sets are constructed based on the author ID information and the category information, namely Books, Sports, and Movies. Data preprocessing includes: removing special characters, removing some punctuation marks, word form restoration, spell checking, and removing short documents.
3. The user personalized preference modeling method based on contrastive learning for product reviews according to claim 1 is characterized by: Step 2 uses synonym replacement to perform data enhancement on the comment text to obtain semantically similar comment text pairs, which specifically includes the following steps: Step 2.1: Target users About Products The text of each comment posted , select three words and replace them with the comment text Synonyms of; Step 2.2: Comment on the text Perform the first synonym replacement to complete data enhancement and obtain the first data enhancement document , after the first data enhancement of all comment texts in the dataset, the first data enhancement document set is obtained , for the comment text Perform the second synonym replacement to complete the data enhancement and obtain the second data enhancement document , after the second data enhancement of all the comment texts in the dataset, the second data enhancement document set is obtained After two data enhancements, we obtain semantically similar review text pairs, namely positive sample pairs ( , ).
4. The user personalized preference modeling method based on contrastive learning for product reviews according to claim 3 is characterized by: In step 3, the enhanced semantically similar comment text pairs obtained in step 2, i.e., positive sample pairs, are assigned topics through the large language model LLM, which specifically includes the following steps: Step 3.1, construct the prompt instruction to convert the positive sample pair ( , ) Each word in is assigned to a predefined set of categories to which the word belongs; 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, the position of the corresponding topic index of the document-topic vector of the document sample is increased by 1. After the statistics are completed, the document-topic vector is calculated by the softmax function to obtain the document sample The document-topic distribution vector : ; ; ; ; in, It is a document sample No. The count of topics assigned to them, It is a sample document Middle words, It is the first Themes, It is a document sample The number of words in is the document-topic vector The value of the position, is the judgment function.
5. The user personalized preference modeling method based on contrastive learning for product reviews according to claim 4 is characterized by: In step 4, the user inference network is constructed using 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.
6. The user personalized preference modeling method based on contrastive learning for product reviews according to claim 5 is characterized by: The step 4 specifically includes the following steps: Step 4.1: User Modeled as an embedding representation: ; in, is the embedding layer of the user inference network, is the user index; Step 4.2: Index the user Input the embedding layer of the user inference network to obtain the user embedding ; Step 4.3: Embed the user obtained in step 4.2 Mapping User preference distribution of : ; in, 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 document-topic vectors into probability distributions; Step 4.4: Use the first data to enhance the document Assign topics through the large language model LLM to obtain document-topic distribution ; Step 4.5: Distribute the user preferences in step 4.3 As in step 4.4, the user About Products The first data augmentation document for published review text Document-topic distribution of Dot product User personalized documents-topic distribution : ; in, is the dot product, yes User personalized document-topic distribution based on dimension.
7. The user personalized preference modeling method based on contrastive learning for product reviews according to claim 6 is characterized by: In step 5, the specific calculation process of user perceived contrastive learning loss is as follows: given the first data augmentation document set And the second data augmentation document collection , for each first data augmentation document , select the corresponding second data enhancement document To construct positive sample pairs ( , ), in the first data augmentation document collection And the second data augmentation document collection Only select the documents with the first data augmentation The different product category information reviewed and the first data enhancement document Comments from different posting users To construct negative sample pairs ( ),in and , so the first data augmentation document User-perceived contrastive learning loss function , Second data enhancement document User-perceived contrastive learning loss function : ; ; ; in, is the cosine similarity, is the temperature parameter of user-perceived contrast learning, yes User personalized document-topic distribution of dimension, is the negative sample judgment function, First Data Augmentation Document And the second data enhancement 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, 0 means 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, is 0, which is a non-negative sample. 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: ; in, is the batch size, For Documentation The contrastive learning loss of the first augmented document, For Documentation The contrastive learning loss of the second augmented document, is a user, is the entire set of users, Is the document index.
8. The user personalized preference modeling method based on contrastive learning for product reviews according to claim 7 is characterized by: In step 5, the specific calculation process of the relevant alignment loss is: given A personalized document-topic distribution collection of size and from the Dirichlet distribution The sampled Prior distribution of size , the estimated relevant alignment loss is: ; ; ; in, is a personalized document-topic distribution collection 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; The total loss of the user inference network training is: ; in, is a hyperparameter for user inference network training.
9. The user personalized preference modeling method based on contrastive learning for product reviews according to claim 8 is characterized by: The training of the user inference network in step 5 specifically includes the following steps: Step 5.1: Construct a user inference network and use the optimizer. The loss function of the user inference network training is user perception contrast learning loss. and the related 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. The user-personalized document-topic distribution is obtained by multiplying the obtained document-topic distribution with the user preference distribution, and the distribution is obtained from the subject parameter Dirichlet distribution Sampling from the prior distribution ; Step 5.3: Optimizing user-perceived contrastive learning loss and the related alignment loss Perform stochastic gradient descent to update the parameters of the user inference network; Step 5.4: Repeat steps 5.2 and 5.3 until the user infers that the network converges.
Citation Information
Patent Citations
A model construction method and system for score prediction
CN109903099A
Multi-modal comment information fused user personalized demand prediction method
CN116150480A
E-commerce consumer preference prediction method and system based on machine learning
CN118379084A
Cited By
Multi-modal topic modeling method based on semantic consistency driving
CN121859997A
A multi-modal topic modeling method based on semantic consistency driving
CN121859997B