Recommendation method and device combining large model and user commodity attribute behavior

By combining large models with user product attribute behaviors, and using the multi-head attention mechanism and neural matrix decomposition model, the problem of low accuracy of product recommendations on online trading platforms has been solved, and more accurate user portraits and recommendation effects have been achieved.

CN118586987APending Publication Date: 2024-09-03DATAGRAND TECH INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410816953.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-24
Publication Date
2024-09-03

AI Technical Summary

Technical Problem

Existing online trading platforms have problems with low accuracy in product recommendations, especially poor performance in capturing users' potential intentions and coping with long-tail effects, resulting in inaccurate recommendation results.

Method used

Using a method that combines large models with user product attribute behaviors, by obtaining product characteristics and user historical behavior data, the multi-head attention mechanism is used to generate user vectors, and combined with the neural matrix decomposition model to train the product recommendation model, and output goals that match the target users. commodity.

Benefits of technology

It improves the accuracy of product recommendation results, can more accurately portray the portrait of users and products, and enhances the robustness and generalization ability of the recommendation model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118586987A
    Figure CN118586987A
Patent Text Reader

Abstract

The invention discloses a big model and user commodity attribute behavior combined recommendation method and device, and the method comprises the steps: obtaining commodity characteristics corresponding to a plurality of commodities, inputting the commodity characteristics corresponding to each commodity into a big language model, and obtaining a commodity vector corresponding to each commodity; acquiring historical forward behavior data corresponding to a plurality of users, and generating a user vector according to the commodity vector and the historical forward behavior data by adopting a multi-head attention mechanism; inputting the commodity vector, the user vector and all user behavior data into a neural matrix decomposition model, and training the neural matrix decomposition model to obtain a commodity recommendation model; and outputting a target commodity matched with the target user by using the commodity recommendation model. According to the technical scheme, the accuracy of the commodity recommendation result can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a recommendation method and device combining a large model with user commodity attribute behavior. Background Art

[0002] With the continuous development of electronic technology and network technology, more and more users like online shopping, and various online trading platforms are increasing. In order to provide users with a high-quality shopping experience, online trading platforms usually recommend products to users based on user preferences or browsing history to increase the click-through rate and conversion rate of products.

[0003] In the prior art, when online trading platforms recommend products to users, they usually collect user behavior data on the platform, and then use collaborative filtering, matrix decomposition or deep learning models to analyze the user behavior data, and determine the products that meet the user's shopping needs based on the analysis results.

[0004] However, although the existing recommendation methods have solved the problem of user personalized needs to a certain extent, they still have limitations in capturing user potential intentions, dealing with long-tail effects, and generating novel recommendation content, resulting in low accuracy of recommendation results. Summary of the invention

[0005] The present invention provides a recommendation method and device combining a large model with user commodity attribute behavior, which can improve the accuracy of commodity recommendation results.

[0006] According to one aspect of the present invention, a recommendation method combining a large model with user commodity attribute behavior is provided, the method comprising:

[0007] Obtain product features corresponding to multiple products respectively, input the product features corresponding to each product into the large language model, and obtain the product vector corresponding to each product;

[0008] Obtain historical positive behavior data corresponding to multiple users respectively, and use a multi-head attention mechanism to generate a user vector according to the product vector and the historical positive behavior data;

[0009] Inputting the product vector, user vector and all user behavior data into a neural matrix decomposition model, and training the neural matrix decomposition model to obtain a product recommendation model;

[0010] The product recommendation model is used to output target products that match the target user.

[0011] Optionally, the product features corresponding to each product are input into the large language model to obtain the product vector corresponding to each product, including:

[0012] Inputting multiple product features corresponding to each product into a large language model, and outputting multiple feature vectors corresponding to each product through the large language model;

[0013] The multiple feature vectors corresponding to each product are summed up to obtain the product vector corresponding to each product.

[0014] Optionally, a multi-head attention mechanism is used to generate a user vector according to the product vector and historical positive behavior data, including:

[0015] Constructing a user matrix and a product matrix according to the product vector and historical positive behavior data;

[0016] Obtain multiple linear transformation matrices preset by the multi-head attention mechanism, and generate a query matrix, a key matrix, and a value matrix according to the user matrix, the product matrix, and the multiple linear transformation matrices;

[0017] A multi-head attention mechanism is adopted to generate a user vector according to the query matrix, key matrix and value matrix.

[0018] Optionally, constructing a user matrix and a product matrix according to the product vector and historical positive behavior data includes:

[0019] Store the product vector corresponding to each product as a field in the preset dictionary;

[0020] According to the historical positive behavior data corresponding to the multiple users, multiple behavior samples corresponding to each user are constructed; each behavior sample includes a mapping relationship between a user identifier and a positive behavior product;

[0021] According to the multiple behavior samples corresponding to each user, the product vector corresponding to each user is obtained from the dictionary, and a user matrix is ​​constructed according to the product vector corresponding to each user;

[0022] A product matrix is ​​constructed according to the product vector corresponding to each product in the dictionary and the total number of products.

[0023] Optionally, multiple linear transformation matrices preset by the multi-head attention mechanism are obtained, and a query matrix, a key matrix, and a value matrix are generated according to the user matrix, the product matrix, and the multiple linear transformation matrices, including:

[0024] Obtain the first linear transformation matrix, the second linear transformation matrix, and the third linear transformation matrix preset by the multi-head attention mechanism;

[0025] Multiplying the first linear transformation matrix by the user matrix to obtain a query matrix;

[0026] The product matrix is ​​multiplied with the second linear transformation matrix and the third linear transformation matrix respectively to obtain a key matrix and a value matrix.

[0027] Optionally, a multi-head attention mechanism is used to generate a user vector according to the query matrix, the key matrix, and the value matrix, including:

[0028] The query matrix is ​​multiplied by the key matrix and normalized to obtain an attention matrix between the user and the product;

[0029] Normalizing the attention matrix to obtain multiple attention weight distribution results between the query matrix and the key matrix;

[0030] According to the multiple attention weight distribution results, weighted summation is performed on the value vectors in the value matrix to obtain context vectors corresponding to the multiple attention heads respectively;

[0031] The context vectors corresponding to the multiple attention heads are concatenated and linearly processed to obtain a user vector.

[0032] Optionally, using the product recommendation model to output a target product that matches a target user includes:

[0033] Inputting the identification information of the target user and the identification information of the candidate products into the product recommendation model, and outputting the scoring result of the target user for each candidate product through the product recommendation model;

[0034] According to the scoring result, a target product matching the target user is determined.

[0035] According to another aspect of the present invention, a recommendation device combining a large model with user commodity attribute behavior is provided, the device comprising:

[0036] A product vector determination module is used to obtain product features corresponding to multiple products, input the product features corresponding to each product into the large language model, and obtain a product vector corresponding to each product;

[0037] A user vector determination module, used to obtain historical positive behavior data corresponding to multiple users, and generate user vectors according to the product vectors and the historical positive behavior data using a multi-head attention mechanism;

[0038] A model training module, used to input the product vector, user vector and all user behavior data into a neural matrix decomposition model, and train the neural matrix decomposition model to obtain a product recommendation model;

[0039] The model application module is used to use the product recommendation model to output target products that match the target users.

[0040] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0041] at least one processor; and

[0042] a memory communicatively connected to the at least one processor; wherein,

[0043] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the recommendation method combining the big model with the user's product attribute behavior as described in any embodiment of the present invention.

[0044] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the recommendation method combining the large model with the user's product attribute behavior as described in any embodiment of the present invention when executed.

[0045] The technical solution provided by the embodiment of the present invention obtains product features corresponding to multiple products, inputs the product features corresponding to each product into a large language model, obtains a product vector corresponding to each product, obtains historical positive behavior data corresponding to multiple users, uses a multi-head attention mechanism to generate a user vector based on the product vector and the historical positive behavior data, inputs the product vector, user vector and all user behavior data into a neural matrix decomposition model, and trains the neural matrix decomposition model to obtain a product recommendation model. Using the product recommendation model, a technical means of outputting a target product that matches a target user can improve the accuracy of product recommendation results.

[0046] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0048] Figure 1 is a flow chart of a recommendation method combining a large model with user commodity attribute behavior provided in an embodiment of the present invention;

[0049] Figure 2is a flow chart of another recommendation method combining a large model with user commodity attribute behavior provided according to an embodiment of the present invention;

[0050] Figure 3 It is a schematic diagram of the structure of a recommendation device combining a large model with user commodity attribute behavior provided by an embodiment of the present invention;

[0051] Figure 4 It is a structural schematic diagram of an electronic device for implementing a recommendation method combining a large model with user commodity attribute behavior according to an embodiment of the present invention. DETAILED DESCRIPTION

[0052] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0053] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0054] Figure 1 This is a flowchart of a recommendation method combining a large model with user product attribute behavior provided by an embodiment of the present invention. This embodiment can be applied to the case of recommending products that meet the needs of users. The method can be executed by a recommendation device combining a large model with user product attribute behavior. The device can be implemented in the form of hardware and / or software and can be configured in an electronic device. Figure 1 As shown, the method includes:

[0055] Step 110: Obtain product features corresponding to a plurality of products, input the product feature corresponding to each product into the large language model, and obtain a product vector corresponding to each product.

[0056] In this embodiment, the multiple commodities may be commodities to be recommended in an online trading platform, and the commodity features may be features of commodities with text information, such as commodity titles, commodity categories, commodity tags, and commodity text, etc. The large language model may be a large model (LLMs) with high-dimensional expression capabilities.

[0057] After the product features corresponding to each product are input into the large language model, the large language model can learn the rich and complex semantics and contextual information in the product features, and generate a product vector with high dimensions and deep semantic features.

[0058] The advantage of this setting is that since the large language model can be exposed to a large amount of sample data during the pre-training process, the generated product vectors can be better generalized to the recommendation field.

[0059] Step 120: Obtain historical positive behavior data corresponding to multiple users, and use a multi-head attention mechanism to generate a user vector based on the product vector and the historical positive behavior data.

[0060] In this embodiment, the historical positive behavior data may be data of positive behaviors (such as clicks, purchases, favorites, and forwarding) of users on products in a historical period of time. After obtaining the historical positive behavior data, a multi-head attention mechanism may be used to generate a user vector for characterizing user behavior based on the product vector and the historical positive behavior data.

[0061] The essence of the attention mechanism comes from the human visual attention mechanism. When people perceive things, they usually do not watch a scene from beginning to end every time, but often pay attention to a specific part according to their needs. And when people find that a scene often has something they want to observe in a certain part, they will learn to pay attention to that part when similar scenes appear in the future. The attention mechanism can be understood as a mapping from a query to a series of (key-value) pairs. Imagine the constituent elements in Source as a series of<Key,Value> The data pairs are composed of a certain element Query in the Target. By calculating the similarity or correlation between the Query and each Key, the weight coefficient of the Value corresponding to each Key is obtained. After normalization by softmax, the weight and the corresponding Value are weighted and summed to obtain the final attention value. The multi-head attention mechanism uses multiple queries to calculate multiple attention values ​​in parallel, and then splices these attention values ​​to obtain the result of multi-head attention, that is, the user vector. Among them, each attention head focuses on different parts of the input information.

[0062] The advantage of this setting is that since user-side features often have problems such as missing information and poor accuracy in the actual implementation process, by adopting the self-attention mechanism to combine the product vector obtained by the large language model with the user's historical behavior to construct the user vector, it is possible to capture the correlation between different user behaviors, so that the user vector maintains semantic consistency between similar inputs, and enhances the robustness of the subsequent product recommendation model to input changes.

[0063] Step 130: Input the product vector, user vector and all user behavior data into a neural matrix decomposition model, and train the neural matrix decomposition model to obtain a product recommendation model.

[0064] In this step, all the user behavior data may include data on the user's positive behavior towards the product, as well as the user's behavior data on the product with only exposure records (i.e., reverse behavior data). Specifically, a neural matrix factorization (NeuMF) model can be constructed using Tensorflow, wherein the matrix factorization layer (MF) in the NeuMF model is used to use the inner product between the product vector and the user vector as the matching degree, and the multilayer perceptron (MLP) part captures nonlinear relationships through a multi-layer fully connected network to improve the generalization ability of the model. Optionally, the loss function corresponding to the NeuMF model can be a binary cross entropy (BCE) loss function.

[0065] In a specific embodiment, when creating a NeuMF model structure, the Embedding initialization part in the NeuMF model can be changed to the pre-trained product vector and user vector mentioned above, so that the features obtained by the large language model can be integrated into the NeuMF model, and then the NeuMF model is iteratively trained to enable the NeuMF model to learn the relationship between users and products, and the trained NeuMF model is used as a product recommendation model.

[0066] Step 140: Use the product recommendation model to output target products that match the target user.

[0067] In traditional product recommendation methods, user data and product data are usually high-dimensional discrete features, and there is a serious sparsity problem. In this embodiment, the vector generated by the large language model is input into the neural matrix decomposition model, which can map the discrete data features to the low-dimensional continuous vector space, thereby reducing the data dimension and solving the sparsity problem. In addition, by combining the multi-layer nonlinear transformation of MLP, potential high-level interactive features can be further extracted and utilized based on the potential semantics contained in the large language model.

[0068] The technical solution provided by the embodiment of the present invention obtains product features corresponding to multiple products, inputs the product features corresponding to each product into a large language model, obtains a product vector corresponding to each product, obtains historical positive behavior data corresponding to multiple users, uses a multi-head attention mechanism to generate a user vector based on the product vector and the historical positive behavior data, inputs the product vector, user vector and all user behavior data into a neural matrix decomposition model, and trains the neural matrix decomposition model to obtain a product recommendation model. Using the product recommendation model, a technical means of outputting a target product that matches a target user can enable the product recommendation model to have the information obtained by the large language model, so that the product recommendation model can accurately portray the portraits of users and products, thereby improving the accuracy of recommendation results.

[0069] Figure 2 A flowchart of another recommendation method combining a large model with user product attribute behavior provided by an embodiment of the present invention, such as Figure 2 As shown, the method includes:

[0070] Step 210: Obtain product features corresponding to a plurality of products, input the plurality of product features corresponding to each product into a large language model, and output a plurality of feature vectors corresponding to each product through the large language model.

[0071] In this step, multiple product features corresponding to each product can be traversed and input into the large language model, and multiple feature vectors corresponding to each product can be output through the large language model, and the multiple feature vectors corresponding to each product can be added to the corresponding list emb_list.

[0072] Step 220: Sum multiple feature vectors corresponding to each product to obtain a product vector corresponding to each product.

[0073] In this step, specifically, the feature vectors in the list emb_list corresponding to each product can be summed to obtain the product vector corresponding to each product. Assuming that the number of products is i and the length of the product vector is embedding_size, the size of all product vectors is i*embedding_size.

[0074] Step 230: Obtain historical positive behavior data corresponding to a plurality of users, and construct a user matrix and a product matrix according to the product vectors and the historical positive behavior data.

[0075] In one implementation of the present embodiment, a user matrix and a product matrix are constructed according to the product vector and the historical positive behavior data, including: storing the product vector corresponding to each product as a field in a preset dictionary; constructing multiple behavior samples corresponding to each user according to the historical positive behavior data corresponding to multiple users; each behavior sample includes a mapping relationship between a user identifier and a positive behavior product; according to the multiple behavior samples corresponding to each user, obtaining the product vector corresponding to each user from the dictionary, and constructing a user matrix according to the product vector corresponding to each user; and constructing a product matrix according to the product vector corresponding to each product in the dictionary and the total number of products.

[0076] In a specific embodiment, the product vector corresponding to each product can be stored in the dictionary as a field in the following format: {itemid:item_embedding}, where itemid is the identification information of the product and item_embedding is the corresponding product vector. After collecting the user's historical positive behavior data, the behavior samples corresponding to the user can be constructed, such as (userid-itemid_1), (userid-itemid_2) and (userid-itemid_n), etc. Each behavior sample includes the user ID and the corresponding product when the user triggers the positive behavior. Optionally, for each user, 10 products that triggered positive behavior in the recent time period can be retained. The specific value can be adjusted according to the actual situation, and this embodiment does not limit this.

[0077] After constructing multiple behavior samples corresponding to each user in the above manner, the item vector item_embedding corresponding to each user can be obtained from the dictionary according to the mapping relationship between users and items in the behavior samples, and the user matrix M_q can be constructed according to the item vector corresponding to each user, where M_q=10*Item_Embedding.

[0078] In this embodiment, specifically, assuming that the total number of commodities is In, a commodity matrix M_k may be constructed through commodity vectors of all commodities in the dictionary, where M_k=In*Item_Embedding.

[0079] Step 240: Obtain multiple linear transformation matrices preset by the multi-head attention mechanism, and generate a query matrix, a key matrix, and a value matrix according to the user matrix, the product matrix, and the multiple linear transformation matrices.

[0080] In this step, optionally, a multi-head attention mechanism can be used to perform linear or nonlinear processing on the user matrix, the product matrix, and multiple linear transformation matrices to generate a query matrix Q, a key matrix K, and a value matrix V.

[0081] In one implementation of the present embodiment, multiple linear transformation matrices preset by the multi-head attention mechanism are obtained, and a query matrix, a key matrix, and a value matrix are generated according to the user matrix, the product matrix, and the multiple linear transformation matrices, including: obtaining a first linear transformation matrix, a second linear transformation matrix, and a third linear transformation matrix preset by the multi-head attention mechanism; multiplying the first linear transformation matrix with the user matrix to obtain a query matrix; and multiplying the product matrix with the second linear transformation matrix and the third linear transformation matrix, respectively, to obtain a key matrix and a value matrix.

[0082] In a specific embodiment, the linear transformation matrices W_q, W_k and W_v preset by the multi-head attention mechanism can be obtained, and then the query matrix Q, the key matrix K and the value matrix V can be determined in the following way:

[0083] Q=M_q*W_q

[0084] K=M_k*W_k

[0085] V=M_k*W_v

[0086] Step 250: Use a multi-head attention mechanism to generate a user vector according to the query matrix, key matrix, and value matrix.

[0087] In one implementation of the present embodiment, a multi-head attention mechanism is adopted to generate a user vector according to the query matrix, key matrix and value matrix, including: multiplying the query matrix with the key matrix and normalizing it to obtain an attention matrix between the user and the product; normalizing the attention matrix to obtain multiple attention weight distribution results between the query matrix and the key matrix; weighted summing the value vectors in the value matrix according to the multiple attention weight distribution results to obtain context vectors corresponding to multiple attention heads; concatenating the context vectors corresponding to the multiple attention heads and performing linear processing to obtain a user vector.

[0088] In a specific embodiment, the query matrix Q and the key matrix K may be multiplied and processed by a softmax function to obtain an attention matrix between the user and the product, as shown in the following formula:

[0089] Score(Q,K)=softmax(qk ∧ T / sqrt(embedding_size))

[0090] Then, the compatibility score obtained by the above attention matrix is ​​normalized by the softmax function to obtain the attention weight distribution result between each query and all keys. The formula is as follows:

[0091] Attention(Q,K)=Softmax(Score(Q,K))

[0092] After obtaining the attention weight distribution result, the value vectors in the value matrix V can be weighted and summed according to the attention weight distribution result to obtain the context vectors corresponding to the multiple attention heads. The formula is as follows:

[0093] Head_output_j=Attention(Q,K)·V

[0094] Then, the context vectors Head_output_j corresponding to all attention heads can be concatenated and processed by the linear layer. The formula is as follows:

[0095] MultiHead_Attention(Q,K,V)=

[0096] Concat(Head_outputs_1,…,Head_outputs_j)*W_O

[0097] Finally, the second dimension in MultiHead_Attention(Q, K, V) can be tiled as a user vector, with the goal of aggregating the features of items of interest to the user as user features.

[0098] Step 260: Input the product vector, user vector and all user behavior data into a neural matrix decomposition model, and train the neural matrix decomposition model to obtain a product recommendation model.

[0099] Step 270: Input the identification information of the target user and the identification information of the candidate products into the product recommendation model, and output the scoring result of the target user for each candidate product through the product recommendation model.

[0100] Step 280: Determine a target product that matches the target user based on the scoring result.

[0101] The technical solution provided by the embodiment of the present invention obtains product features corresponding to multiple products respectively, inputs the multiple product features corresponding to each product into a large language model, outputs multiple feature vectors corresponding to each product through the large language model, sums the multiple feature vectors corresponding to each product to obtain the product vector corresponding to each product, obtains historical positive behavior data corresponding to multiple users respectively, constructs a user matrix and a product matrix according to the product vectors and the historical positive behavior data, obtains multiple linear transformation matrices preset by a multi-head attention mechanism, generates a query matrix, a key matrix and a value matrix according to the user matrix, the product matrix and the multiple linear transformation matrices, uses a multi-head attention mechanism to generate a user vector according to the query matrix, the key matrix and the value matrix, inputs the product vector, the user vector and all user behavior data into a neural matrix decomposition model, trains the neural matrix decomposition model to obtain a product recommendation model, inputs the identification information of the target user and the identification information of the candidate products into the product recommendation model, outputs the target user's scoring result for each candidate product through the product recommendation model, and determines the target product matching the target user according to the scoring result. The technical means can improve the accuracy of the product recommendation results.

[0102] Figure 3 A schematic diagram of a recommendation device combining a large model with user product attribute behavior provided by an embodiment of the present invention, wherein the device is applied to an electronic device, such as Figure 3 As shown, the device includes: a product vector determination module 310, a user vector determination module 320, a model training module 330 and a model application module 340.

[0103] The product vector determination module 310 is used to obtain product features corresponding to a plurality of products, input the product features corresponding to each product into the large language model, and obtain a product vector corresponding to each product;

[0104] A user vector determination module 320, for obtaining historical positive behavior data corresponding to a plurality of users, and generating a user vector according to the product vector and the historical positive behavior data using a multi-head attention mechanism;

[0105] A model training module 330 is used to input the product vector, user vector and all user behavior data into a neural matrix decomposition model, and train the neural matrix decomposition model to obtain a product recommendation model;

[0106] The model application module 340 is used to use the product recommendation model to output target products that match the target users.

[0107] The technical solution provided by the embodiment of the present invention obtains product features corresponding to multiple products, inputs the product features corresponding to each product into a large language model, obtains a product vector corresponding to each product, obtains historical positive behavior data corresponding to multiple users, uses a multi-head attention mechanism to generate a user vector based on the product vector and the historical positive behavior data, inputs the product vector, user vector and all user behavior data into a neural matrix decomposition model, and trains the neural matrix decomposition model to obtain a product recommendation model. Using the product recommendation model, a technical means of outputting a target product that matches a target user can improve the accuracy of product recommendation results.

[0108] Based on the above embodiment, the product vector determination module 310 includes:

[0109] A feature vector output unit, used to input multiple product features corresponding to each product into the large language model, and output multiple feature vectors corresponding to each product through the large language model;

[0110] The feature vector summing unit is used to sum the multiple feature vectors corresponding to each product to obtain the product vector corresponding to each product.

[0111] The user vector determination module 320 includes:

[0112] A matrix construction unit is used to construct a user matrix and a product matrix according to the product vector and the historical positive behavior data; obtain multiple linear transformation matrices preset by the multi-head attention mechanism, and generate a query matrix, a key matrix and a value matrix according to the user matrix, the product matrix and the multiple linear transformation matrices;

[0113] A user vector generating unit, configured to generate a user vector according to the query matrix, the key matrix and the value matrix by adopting a multi-head attention mechanism;

[0114] A dictionary construction unit is used to store the product vector corresponding to each product as a field in a preset dictionary;

[0115] A sample construction unit, used to construct a plurality of behavior samples corresponding to each user according to the historical positive behavior data corresponding to the plurality of users; each behavior sample includes a mapping relationship between a user identifier and a positive behavior commodity;

[0116] A user matrix construction unit, configured to obtain a product vector corresponding to each user from the dictionary according to a plurality of behavior samples corresponding to each user, and to construct a user matrix according to the product vector corresponding to each user;

[0117] A commodity matrix construction unit, used to construct a commodity matrix according to the commodity vector corresponding to each commodity in the dictionary and the total quantity of commodities;

[0118] A transformation matrix acquisition unit, used to obtain a first linear transformation matrix, a second linear transformation matrix, and a third linear transformation matrix preset by the multi-head attention mechanism;

[0119] A matrix processing unit, configured to multiply the first linear transformation matrix with the user matrix to obtain a query matrix; and to multiply the product matrix with the second linear transformation matrix and the third linear transformation matrix to obtain a key matrix and a value matrix;

[0120] An attention matrix generating unit, used for multiplying the query matrix and the key matrix and performing normalization processing to obtain an attention matrix between the user and the product;

[0121] A weight determination unit, used for normalizing the attention matrix to obtain a plurality of attention weight distribution results between the query matrix and the key matrix;

[0122] A context vector determination unit, configured to perform weighted summation on the value vectors in the value matrix according to the plurality of attention weight distribution results, to obtain context vectors corresponding to the plurality of attention heads respectively;

[0123] The vector concatenation unit is used to concatenate the context vectors corresponding to the multiple attention heads and perform linear processing to obtain a user vector.

[0124] The model application module 340 includes:

[0125] An identification information input unit, used to input the identification information of the target user and the identification information of the candidate products into the product recommendation model, and output the scoring result of the target user for each candidate product through the product recommendation model;

[0126] The scoring processing unit is used to determine the target product that matches the target user according to the scoring result.

[0127] The above device can execute the methods provided by all the above embodiments of the present invention, and has the corresponding functional modules and beneficial effects of executing the above methods. For technical details not fully described in the embodiments of the present invention, please refer to the methods provided by all the above embodiments of the present invention.

[0128] Figure 4A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0129] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0130] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0131] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a recommendation method combining a large model with user product attribute behavior.

[0132] In some embodiments, the recommendation method combining the big model with the user's product attribute behavior can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the recommendation method combining the big model with the user's product attribute behavior described above can be executed. Alternatively, in other embodiments, the processor 11 can be configured to execute the recommendation method combining the big model with the user's product attribute behavior in any other appropriate manner (for example, by means of firmware).

[0133] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0134] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0135] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0136] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0137] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0138] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0139] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0140] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A recommendation method combining a large model with user product attribute behavior, characterized in that: The method comprises: Obtain product features corresponding to multiple products respectively, input the product features corresponding to each product into the large language model, and obtain the product vector corresponding to each product; Obtain historical positive behavior data corresponding to multiple users respectively, and use a multi-head attention mechanism to generate a user vector according to the product vector and the historical positive behavior data; Inputting the product vector, user vector and all user behavior data into a neural matrix decomposition model, and training the neural matrix decomposition model to obtain a product recommendation model; The product recommendation model is used to output target products that match the target user.

2. The method according to claim 1, characterized in that Input the product features corresponding to each product into the large language model to obtain the product vector corresponding to each product, including: Inputting multiple product features corresponding to each product into a large language model, and outputting multiple feature vectors corresponding to each product through the large language model; The multiple feature vectors corresponding to each product are summed up to obtain the product vector corresponding to each product.

3. The method according to claim 1, characterized in that A multi-head attention mechanism is used to generate a user vector based on the product vector and historical positive behavior data, including: Constructing a user matrix and a product matrix according to the product vector and historical positive behavior data; Obtain multiple linear transformation matrices preset by the multi-head attention mechanism, and generate a query matrix, a key matrix, and a value matrix according to the user matrix, the product matrix, and the multiple linear transformation matrices; A multi-head attention mechanism is adopted to generate a user vector according to the query matrix, key matrix and value matrix.

4. The method according to claim 3, characterized in that According to the product vector and historical positive behavior data, a user matrix and a product matrix are constructed, including: Store the product vector corresponding to each product as a field in the preset dictionary; According to the historical positive behavior data corresponding to the multiple users, multiple behavior samples corresponding to each user are constructed; each behavior sample includes a mapping relationship between a user identifier and a positive behavior product; According to the multiple behavior samples corresponding to each user, the product vector corresponding to each user is obtained from the dictionary, and a user matrix is ​​constructed according to the product vector corresponding to each user; A product matrix is ​​constructed according to the product vector corresponding to each product in the dictionary and the total number of products.

5. The method according to claim 3, characterized in that: Obtain multiple linear transformation matrices preset by the multi-head attention mechanism, and generate a query matrix, a key matrix, and a value matrix according to the user matrix, the product matrix, and the multiple linear transformation matrices, including: Obtain the first linear transformation matrix, the second linear transformation matrix, and the third linear transformation matrix preset by the multi-head attention mechanism; Multiplying the first linear transformation matrix by the user matrix to obtain a query matrix; The product matrix is ​​multiplied with the second linear transformation matrix and the third linear transformation matrix respectively to obtain a key matrix and a value matrix.

6. The method according to claim 3, characterized in that Using a multi-head attention mechanism, generating a user vector according to the query matrix, key matrix and value matrix includes: The query matrix is ​​multiplied by the key matrix and normalized to obtain an attention matrix between the user and the product; Normalizing the attention matrix to obtain multiple attention weight distribution results between the query matrix and the key matrix; According to the multiple attention weight distribution results, weighted summation is performed on the value vectors in the value matrix to obtain context vectors corresponding to the multiple attention heads respectively; The context vectors corresponding to the multiple attention heads are concatenated and linearly processed to obtain a user vector.

7. The method according to claim 1, characterized in that Using the product recommendation model, outputting target products matching the target user, including: Inputting the identification information of the target user and the identification information of the candidate products into the product recommendation model, and outputting the scoring result of the target user for each candidate product through the product recommendation model; According to the scoring result, a target product matching the target user is determined.

8. A recommendation device combining a large model with user product attribute behavior, characterized in that: The device comprises: A product vector determination module is used to obtain product features corresponding to multiple products, input the product features corresponding to each product into the large language model, and obtain a product vector corresponding to each product; A user vector determination module, used to obtain historical positive behavior data corresponding to multiple users, and generate user vectors according to the product vectors and the historical positive behavior data using a multi-head attention mechanism; A model training module, used to input the product vector, user vector and all user behavior data into a neural matrix decomposition model, and train the neural matrix decomposition model to obtain a product recommendation model; The model application module is used to use the product recommendation model to output target products that match the target users.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the recommendation method combining the large model and the user's product attribute behavior as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the recommendation method of combining the large model and the user's commodity attribute behavior as described in any one of claims 1 to 7 when executed.