Recommendation method, recommendation device, electronic equipment, medium and product
Through the encoding and analysis of product and user interaction data by large language models, the problem of insufficient relationship modeling in the recommendation system based on product ID is solved, and more accurate user interest capture and recommendation effects are achieved.
Patent Information
- Application Number
- CN202411026574.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-29
- Publication Date
- 2024-12-10
AI Technical Summary
The product ID-based recommendation system cannot use product attributes or semantic information in user portraits, resulting in insufficient modeling of the relationship between users and products and low recommendation accuracy.
The large language model is used to encode the attribute description text of candidate objects and historical interaction objects, generate text representations, and determine the objects to be recommended based on the attributes of user portraits and historical interaction objects, and recommend products through similarity analysis.
It improves the accuracy of the recommendation system, can capture user interests and product relevance more accurately, alleviate the cold start problem of new products, and improve user experience.
Smart Images

Figure CN119107141A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to the field of large language model technology. More specifically, the present disclosure provides a recommendation method, a recommendation device, an electronic device, a medium, and a product. Background Art
[0002] In recommendation systems based on product IDs (identity documents), products and users are usually calculated in the form of ID sequences, which makes it impossible to utilize the semantic information contained in product attributes or user profiles, resulting in insufficient modeling of the relationship between users and products and low recommendation accuracy. Summary of the invention
[0003] In view of this, the present disclosure provides a recommendation method, a recommendation device, an electronic device, a medium and a product.
[0004] One aspect of the present disclosure provides a recommendation method, including: using a large model to encode the attribute description text of at least one first candidate object to obtain at least one first text representation of the at least one first candidate object; using the large model to encode the attribute description text of the first historical interaction object to obtain a second text representation of the first historical interaction object, wherein the first historical interaction object and the first user meet a predetermined interaction condition; determining an object to be recommended from the first historical interaction object based on the similarity between the at least one first text representation and the second text representation; the large model is obtained by sample training based on a user portrait of the second user and the attributes of the second historical interaction object corresponding to the second user.
[0005] According to an embodiment of the present disclosure, samples include positive samples and negative samples, wherein the positive samples represent the attributes of objects that meet the preferences of the second user, and the negative samples represent the attributes of objects that differ from the preferences of the second user, and the preferences of the second user are related to the user portrait of the second user and the second historical interaction object.
[0006] According to an embodiment of the present disclosure, the process of generating negative samples includes: determining a first category of objects that differ from the preferences of the second user from multiple second candidate objects based on the user portrait of the second user and the attributes of N second historical interaction objects that meet predetermined interaction conditions with the second user; N is an integer greater than or equal to 1; and determining negative samples based on the attribute description text of the first category of objects.
[0007] According to an embodiment of the present disclosure, based on the user portrait of the second user and the attributes of N second historical interaction objects that meet predetermined interaction conditions with the second user, determining the first category of objects that differ from the preferences of the second user from multiple second candidate objects includes: combining N attribute description texts of the N second historical interaction objects, the portrait description text of the user portrait, the attribute description text of the second candidate objects, and a predetermined prompt text template to obtain input text; inputting the input text into a large language model to obtain an output result; and determining the first category of objects based on the output result.
[0008] According to an embodiment of the present disclosure, a predetermined prompt text template representation is provided: a large language model is used to determine whether a second candidate object meets the preference of a second user based on N attribute description texts and a portrait description text; wherein, according to the output result, determining the first category of objects includes: determining the second candidate object that the large language model determines as not meeting the preference of the second user as a first category of objects.
[0009] According to an embodiment of the present disclosure, the negative sample generation process further includes: determining a plurality of second candidate objects that meet the second user's preference from an object library based on the N second historical interaction objects.
[0010] According to an embodiment of the present disclosure, the process of generating a positive sample includes: determining a second category object from at least one second historical interaction object based on time information of an interaction between a second user and at least one corresponding second historical interaction object; and determining a positive sample based on an attribute description text of the second category object.
[0011] According to an embodiment of the present disclosure, the sample also includes an anchor sample, and the generation process of the anchor sample includes: determining at least one attribute description text of at least one second historical interaction object corresponding to the second user; determining the anchor sample based on the at least one attribute description text, so as to train the large model based on the difference between the anchor sample and the positive sample, and the difference between the anchor sample and the negative sample.
[0012] According to an embodiment of the present disclosure, determining an anchor point sample based on at least one attribute description text includes: sorting the at least one attribute description text based on time information of an interaction between the second user and at least one second historical interaction object; and determining the anchor point sample based on the sorted at least one attribute description text.
[0013] According to an embodiment of the present disclosure, the attribute description text is determined in the following manner: for each of the multiple sub-attributes contained in the attribute, the text of the attribute name and the text of the attribute value are combined into a text pair as a text pair associated with the sub-attribute; and the attribute description text is determined based on the multiple text pairs associated with the multiple sub-attributes.
[0014] Another aspect of the present disclosure also provides a recommendation device, including: a first encoding module, used to use a large model to encode the attribute description text of at least one first candidate object to obtain at least one first text representation of the at least one first candidate object; a second encoding module, used to use the large model to encode the attribute description text of the first historical interaction object to obtain a second text representation of the first historical interaction object, wherein the first historical interaction object and the first user meet a predetermined interaction condition; a determination module, used to determine an object to be recommended from the first historical interaction object according to the similarity between at least one first text representation and the second text representation; the large model is obtained by sample training based on the user portrait of the second user and the attribute determination of the second historical interaction object corresponding to the second user.
[0015] Another aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the above method.
[0016] Another aspect of the present disclosure further provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to perform the above method.
[0017] Another aspect of the present disclosure further provides a computer program product, including a computer program, which implements the above method when executed by a processor.
[0018] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0020] Figure 1 A flowchart of a recommendation method according to an embodiment of the present disclosure is schematically shown;
[0021] Figure 2 A schematic diagram schematically illustrates a recommended method according to an embodiment of the present disclosure;
[0022] Figure 3A A schematic diagram schematically shows generation of a first type of object according to an embodiment of the present disclosure;
[0023] Figure 3B A schematic diagram schematically shows an input text input into a large language model according to an embodiment of the present disclosure;
[0024] Figure 4 A schematic diagram of large model training according to an embodiment of the present disclosure is schematically shown;
[0025] Figure 5 A schematic diagram of large model training according to another embodiment of the present disclosure is schematically shown;
[0026] Figure 6 A structural block diagram of a recommendation device according to an embodiment of the present disclosure is schematically shown; and
[0027] Figure 7 A schematic block diagram of an electronic device that can be used to implement the recommended method of an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0028] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. Various details of the embodiments of the present disclosure are included to facilitate understanding, and they should be considered as merely exemplary. Therefore, it should be appreciated by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Likewise, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0029] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision, disclosure and application of the data involved (including but not limited to user personal information) comply with the provisions of relevant laws and regulations, take necessary confidentiality measures, and do not violate public order and good morals.
[0030] Figure 1 The flowchart of the recommendation method according to the embodiment of the present disclosure is schematically shown.
[0031] like Figure 1 As shown, the recommended method of this embodiment includes operations S110 - S130 .
[0032] In operation S110, the attribute description text of at least one first candidate object is encoded using the large model to obtain at least one first text representation of the at least one first candidate object.
[0033] In an embodiment of the present disclosure, the category of the large model may be, for example, a large language model (LLM). The large model can encode the text used to describe the attributes of the object to obtain a multi-dimensional vector. The first candidate object may refer to a newly added object in the object library, or any object in the object library. The object may be a commodity and multimedia resources, etc. Multimedia resources may include short videos, novels, film and television works, etc. The present disclosure does not limit the category of the object, and the following description will be taken as an example where the object is a commodity. Attribute description text refers to text information that can describe the attributes of an object. The first text representation is obtained by vectorizing the attribute description text of the first candidate object by the large model, and the semantics of the attribute description text is represented in the form of a numerical vector.
[0034] For example, the first candidate object is a laptop computer, and the specific information of the laptop computer is: the product number is 015, the product name is A-brand thin and light notebook, and the memory is 16G. Based on the above information, it can be determined that the attribute description text of the first candidate object is "Product number: 015, product name: A-brand thin and light notebook, memory: 16G". Through large model encoding, the attribute description text is vectorized to obtain the first text representation of the first candidate object.
[0035] In operation S120, the attribute description text of the first historical interaction object is encoded using the large model to obtain a second text representation of the first historical interaction object, wherein the first historical interaction object and the first user meet a predetermined interaction condition.
[0036] In an embodiment of the present disclosure, the first historical interaction object may refer to a commodity that the first user has clicked, browsed, collected or purchased. The second text representation is obtained by vectorizing the attribute description text of the first historical interaction object by the large model.
[0037] For example, the predetermined interaction condition may be related to the interaction time range, the number of interactions, and the interaction type, and the interaction type may include click, browse, collect, purchase, etc. The predetermined interaction condition is characterized by a historical interaction object within five days, and the first historical interaction object that meets the predetermined interaction condition includes the goods that the first user has clicked, browsed, collected, or purchased within five days.
[0038] In operation S130, an object to be recommended is determined from the first historical interaction object according to the similarity between at least one first text representation and a second text representation; the large model is obtained by sample training based on a user portrait of the second user and an attribute of a second historical interaction object corresponding to the second user.
[0039] In the embodiments of the present disclosure, similarity refers to the degree of similarity of multiple vectors between the first text representation and the second text representation, and the object to be recommended refers to an object recommended to the first user and in which the first user may be interested.
[0040] For example, when a first text representation has a high similarity with a second text representation, it means that the first candidate object corresponding to the first text representation has similar attributes to the first historical interaction object. Since the first historical interaction object is a product that the first user has clicked, purchased, or collected, the first candidate object corresponding to the first text representation is likely to be of interest to the first user, and the first candidate object with a high similarity can be recommended to the first user as a to-be-recommended object.
[0041] According to an embodiment of the present disclosure, the large model can perform vectorization processing based on the attribute description text, give multiple first text representations and second text representations, and determine the object to be recommended from the first historical interaction object based on the first text representation and the second text representation.
[0042] In addition, it should be noted that before the large model is put into use, it needs to be trained based on samples.
[0043] In the embodiment of the present disclosure, the user portrait of the second user refers to the user information used as a sample for training, which may be the user's identity information, preferences, etc. The second historical interaction object refers to the commodities that the second user has historically clicked, browsed, purchased, or collected.
[0044] For example, the user profile of the second user may be “Gender: Male; Age: 25; Occupation: Programmer; Hobby: Console Games”. The second historical interaction object may be a commodity such as a high-performance computer, a keyboard, and a controller.
[0045] According to the embodiments of the present disclosure, the large model is trained based on the user portrait and the second historical interaction object as samples, which can improve the accuracy of the large model vectorization processing. During the large model usage stage, the large model can represent the rich semantic information in the product through vectors, so as to select the products that the user may be interested in from the candidate products for recommendation based on the information of the candidate products and the user's historical interaction products. Compared with identification and recommendation only by product number, the large model can capture user interests more accurately, and use the large model's strong understanding ability and rich knowledge system to understand the complex interaction relationship between users and products, such as user preferences, behavior patterns, etc., so as to better predict the correlation between user behavior and products, and can also help alleviate the cold start problem of new products.
[0046] Next, combine Figure 2 The recommended method of the embodiment of the present disclosure is further described.
[0047] Figure 2 The figure schematically shows a recommended method according to an embodiment of the present disclosure.
[0048] like Figure 2 As shown, the first candidate object 1 201_1, ..., the first candidate object N 201_N are encoded using the large model to obtain the first text representation 1 202_1, ..., the first text representation N 202_N in vector form respectively. The first historical interaction object 211 is encoded using the large model to obtain the corresponding second text representation 212 in vector form. The similarity between the first text representation and the second text representation can be determined based on the vector.
[0049] In the embodiment of the present disclosure, when the distance between the two vectors is relatively close, it indicates that the similarity between the corresponding first text representation and the second text representation is relatively high. When the distance between the two vectors is relatively far, it indicates that the similarity between the corresponding first text representation and the second text representation is relatively low.
[0050] For example, Figure 2 As shown, the similarity between the Nth first text representation 212_N and the second text representation is relatively high, indicating that the first candidate object 201_N corresponding to the Nth first text representation 212_N can be determined as the object to be recommended to the first user.
[0051] For example, the similarity between the first first text representation 212_1 and the second text representation is small, indicating that the first candidate object 201_1 corresponding to the first first text representation 212_1 may not be a product that the first user is interested in.
[0052] According to another embodiment of the present disclosure, the samples used to train the large model may include positive samples and negative samples, wherein the positive samples represent the attributes of the object that meet the preferences of the second user, and the negative samples represent the attributes of the object that differ from the preferences of the second user, and the preferences of the second user are related to at least one of the user portrait of the second user and the second historical interaction object.
[0053] In the embodiments of the present disclosure, positive samples refer to commodity attributes that the second user may be interested in or commodity attributes that are more consistent with the user profile of the second user, and negative samples refer to commodity attributes that the second user is less interested in or that are different from the user profile of the second user. The preference of the second user can be determined based on the user profile of the second user, or based on the second historical interaction objects that the second user has browsed and purchased, or based on the user profile of the second user and the second historical interaction objects.
[0054] For example, based on the user portrait of the second user, it can be determined that the second user's preference is for product attributes related to electronic games, and based on the second historical interaction objects that the second user has browsed and purchased, it can be determined that the second user's preference is for product attributes related to electronic equipment, gaming equipment, etc. Based on the above preferences of the second user, product attributes of games and electronics can be determined as positive samples, while other product attributes (such as clothing, maternal and child products, etc.) can be determined as negative samples.
[0055] Figure 3A The schematic diagram schematically shows the generation of the first type of object according to an embodiment of the present disclosure.
[0056] According to an embodiment of the present disclosure, the process of generating negative samples may include: determining a plurality of second candidate objects that meet the second user's preference from an object library based on N second historical interaction objects.
[0057] In the embodiment of the present disclosure, the object library 306 includes objects of various types and attributes, and new objects are constantly added to the object library 306. When selecting multiple objects from the object library 306 as the second candidate objects 303, the second historical interaction objects of the second user that meet the predetermined interaction condition may be referenced.
[0058] In the absence of the second historical interaction object 302, the second candidate object 303 may be selected from the object library 306 by random sampling. In the case where the second historical interaction object 302 is used as a reference, a portion of the second candidate objects 303 may also be selected from the object library 306 by random sampling, and objects matching the second historical interaction object may be selectively determined as the second candidate objects according to a collaborative filtering model (e.g., matrix decomposition, a graph convolutional network model based on deep learning).
[0059] In the embodiment of the present disclosure, objects may be obtained by randomly extracting the object library 306 , and objects related to the second historical interaction object 302 may be obtained according to the collaborative filtering model, and the above multiple objects may be used as the second candidate objects 303 .
[0060] According to an embodiment of the present disclosure, the process of generating negative samples may also include: determining a first category of objects that differ from the preferences of the second user from multiple second candidate objects based on the user portrait of the second user and the attributes of N second historical interaction objects that meet predetermined interaction conditions with the second user; N is an integer greater than or equal to 1; and determining negative samples based on the attribute description text of the first category of objects.
[0061] In the embodiment of the present disclosure, the negative sample is determined from the second candidate object 303. Figure 3AAs shown, based on the user portrait of the second user, the attributes of the second historical interaction object, and multiple second candidate objects, the interest relationship between the user and the product can be modeled according to the semantic information therein, so as to determine the first type of object 304 that is different from the preference of the second user from the second candidate objects 303. The negative sample includes the attribute description text of the first type of object 304.
[0062] For example, based on the user portrait of the second user, it can be determined that the second user's preference is for the attributes of electronic game-related products, and the second historical interaction objects that the second user has browsed and purchased are console games, computer controllers, keyboards, and other products. When multiple second candidate objects are electronic equipment, jewelry, and food, the first category of objects that differ from the second user's preferences can be determined from the above second candidate objects to be jewelry and food products, and the corresponding attribute description text (e.g., "Product Number: 010 Product Name: Necklace Product Material: Silver") can be used as a negative sample.
[0063] According to an embodiment of the present disclosure, based on the user portrait of the second user and the attributes of N second historical interaction objects that meet predetermined interaction conditions with the second user, determining the first category of objects that differ from the preferences of the second user from multiple second candidate objects includes: combining N attribute description texts of the N second historical interaction objects, the portrait description text of the user portrait, the attribute description text of the second candidate objects, and a predetermined prompt text template to obtain input text; inputting the input text into a large language model to obtain an output result; and determining the first category of objects based on the output result.
[0064] In the embodiment of the present disclosure, the input text 305 is a combination of the attribute description texts of the second historical interaction objects 302, the portrait description text of the user portrait 301, and the attribute description text of the second candidate object 303 according to a predetermined prompt text template. The obtained input text 305 is input into the large language model, and according to the judgment of the large language model, the object in the second candidate object that deviates from the preference of the second user is determined as the first category object 304.
[0065] Figure 3B The figure schematically shows a schematic diagram of input text into a large language model according to an embodiment of the present disclosure.
[0066] According to an embodiment of the present disclosure, a predetermined prompt text template representation is provided: a large language model is used to determine whether a second candidate object meets the preference of a second user based on N attribute description texts and a portrait description text; wherein, according to the output result, determining the first category of objects includes: determining the second candidate object that the large language model determines as not meeting the preference of the second user as a first category of objects.
[0067] For example, the attribute description texts of multiple second historical interaction objects, the portrait description texts of the user portrait, the attribute description texts of the second candidate objects, and the predetermined prompt text template are combined as input text. After receiving the input text, the large model can determine that product No. 0010 among the second candidate objects meets the second user's preferences, while product No. 0020 does not meet the second user's preferences, and therefore determines product No. 0020 as a first-category object.
[0068] According to the embodiments of the present disclosure, a large language model is used to perform negative sample sampling based on user portraits and historical interaction records. For each user, the input text is constructed according to the user portrait, and several negative samples that do not meet the preferences can be selected from the candidate product set. This application uses a large language model and its flexible prompt mechanism to model user preferences, which can more accurately capture user interests, avoid products that users are not interested in, and improve user experience.
[0069] According to another embodiment of the present disclosure, the process of generating positive samples includes: determining a second category of objects from at least one second historical interaction object based on time information of an interaction between a second user and at least one corresponding second historical interaction object; and determining a positive sample based on an attribute description text of the second category of objects.
[0070] In the embodiments of the present disclosure, the time information refers to the time when the second user interacts with the second historical interaction object. Since the second historical interaction object is a commodity browsed and purchased by the second user, the second historical interaction object is often an object that the second user is interested in. The second category object refers to a commodity that the second user may be interested in. Therefore, the attribute description text of the second category object can be used as a positive sample for model training.
[0071] For example, the second type of object may be a commodity that the second user has interacted with most recently in the second historical interaction object, and may represent a commodity type that the second user is more interested in.
[0072] According to the embodiments of the present disclosure, since the products that the user has recently interacted with are of high importance for predicting the products to be recommended, selecting positive samples based on time information can ensure the timeliness of the samples and improve the accuracy of the output results of the large model.
[0073] According to another embodiment of the present disclosure, the sample may further include an anchor sample, and the generation process of the anchor sample includes: determining at least one attribute description text of at least one second historical interaction object corresponding to the second user; and determining the anchor sample according to the at least one attribute description text. For example, the attribute description texts may be sorted according to a predetermined rule and used as the anchor sample.
[0074] According to an embodiment of the present disclosure, determining an anchor point sample based on at least one attribute description text includes: sorting the at least one attribute description text based on time information of an interaction between the second user and at least one second historical interaction object; and determining the anchor point sample based on the sorted at least one attribute description text.
[0075] In an embodiment of the present disclosure, when determining anchor point samples according to the attribute description texts of a plurality of second history interaction objects, the second history interaction objects may be sorted according to the time sequence.
[0076] For example, the second historical interaction objects may be reversely sorted according to the time sequence of the interaction history. In this case, it can be ensured that the second historical interaction object with the highest timeliness and the most important is arranged at the front.
[0077] Figure 4 A schematic diagram of large model training according to an embodiment of the present disclosure is schematically shown.
[0078] In this embodiment, the samples for training the large model may include positive samples, negative samples and anchor samples. The large model may be trained by contrastive learning. During the contrastive learning process, the loss value may be calculated based on the difference between the anchor sample and the positive sample, and the difference between the anchor sample and the negative sample, and the parameters of the large model may be adjusted based on the loss value until the large model converges.
[0079] In the embodiments of the present disclosure, the attribute description texts of the second user's multiple second historical interaction objects can be used as anchor samples. The second historical interaction objects, as commodities that the second user has browsed and purchased, can reflect the preferences of the second user, which is conducive to the large model to model the interest relationship between the second user and the commodity, and to train through comparative learning of positive samples and negative samples.
[0080] Next, the training process of the large model is explained in detail.
[0081] First, taking the example that the second historical interaction object includes k sub-attributes, each of which includes an attribute name and an attribute value, the attribute description text of the second historical interaction object can be expressed as:
[0082]
[0083] The sequence of multiple second historical interaction objects interacted by the second user from time 1 to time t can be expressed as:
[0084]
[0085] Among them, I1, I2, …, I tThey respectively represent the attribute description texts corresponding to the second historical interaction objects from the 1st moment to the tth moment, and H represents a sequence of attribute description texts of multiple second historical objects from the 1st moment to the tth moment.
[0086] Since the objects interacted with most recently in the second historical interaction objects are more important for predicting user preferences, the second historical interaction objects from the first moment to the tth moment can be reversely sorted to obtain:
[0087]
[0088] Here, H' represents a sequence of attribute description texts of multiple second historical objects after the reverse sorting process. It can be seen that the sequence H' after the reverse sorting process is the anchor point sample.
[0089] Next, a large model with an encoding module can be used to encode positive samples, negative samples, and anchor samples respectively to obtain text representations of positive samples, negative samples, and anchor samples.
[0090] Next, the loss value of the large model can be calculated based on a predetermined loss function. For example, the loss value of the large model can be calculated in the following way:
[0091]
[0092] Among them, Loss CL is the loss value of the large model, h i is the text representation of any sample in the positive sample and the negative sample, h i + represents the text representation of the positive sample, h H is the text representation of the anchor sample, 𝜏 is the temperature parameter, I is the set of positive samples and negative samples, and sim is the similarity calculation function. It can be seen that when the similarity between the positive sample and the anchor sample is higher and the similarity between the negative sample and the anchor sample is lower, the loss value is smaller.
[0093] For example, the similarity calculation function sim may use cosine similarity. For example, the expression of the similarity calculation function sim is as follows:
[0094]
[0095] The loss value of the large model can be calculated by the above formula, and then the parameters of the large model can be adjusted based on the loss value until the large model converges, thereby obtaining a trained large model.
[0096] According to an embodiment of the present disclosure, the attribute description text is determined in the following manner: for each of the multiple sub-attributes contained in the attribute, the text of the attribute name and the text of the attribute value are combined into a text pair as a text pair associated with the sub-attribute; and the attribute description text is determined based on the multiple text pairs associated with the multiple sub-attributes.
[0097] In the embodiments of the present disclosure, different objects may include various types of attributes and attribute information, and each attribute may be used as a sub-attribute in the attribute description text, thereby making a unified text representation of the object. The attribute description text of an object may include multiple text pairs associated with the sub-attributes. Each text pair includes the text of the attribute name and the text of the attribute value.
[0098] For example, if an object has k sub-attributes, the text pairs associated with the sub-attributes can be: <attribute name 1>:<attribute value 1>, <attribute name 2>:<attribute value 2>, ⋯, <attribute name k>:<attribute value k>.
[0099] For example, the attribute description text can be the attribute description text of the first candidate object, the attribute description text of the second candidate object, the attribute description text of the first historical interaction object, the attribute description text of the second historical interaction object, the attribute description text of the first category object, and the attribute description text of the second category object.
[0100] Figure 5 A schematic diagram of large model training according to another embodiment of the present disclosure is schematically shown.
[0101] like Figure 5 As shown, objects can be obtained by randomly extracting an object library 501, or objects similar to the second historical interaction objects 5021 and 5022 can be obtained from the object library 501 according to a collaborative filtering model 511 or other models, and the above multiple objects are used as second candidate objects 503. The above collaborative filtering model 511 can be a GCN (Graph Convolutional Network), which is not limited in this embodiment.
[0102] In the embodiment of the present disclosure, the input text 505 for inputting into the large language model is obtained through a predetermined prompt text template according to the second candidate object 503, the user portrait 504 and the second historical interaction object 5021. Through the judgment of the large language model, the first type of object that deviates from the preference of the second user can be selected from the second candidate object 503, and the attribute description text of the first type of object is used as a negative sample, for example, a negative sample 5061 and a negative sample 5062 are obtained.
[0103] In an embodiment of the present disclosure, the second historical interaction object 5021 may be determined based on the interaction history time of the second user.
[0104] For example, the interaction objects from the first moment to the Tth moment can be used as the second historical interaction object. The interaction object at the T+1th moment is used as the second type of object, and the attribute description text of the second type of object is used as the positive sample 5022.
[0105] The positive sample 5022, the negative sample 5061, and the negative sample 5062 are respectively encoded using the large model to obtain the corresponding multiple text representations 508, 5091, and 5092. In addition, the attribute description texts 507 of the multiple second historical interaction objects can be sorted in a positive order or a reverse order to obtain the anchor sample 507. The anchor sample 507 can also be encoded using the large model to obtain the text representation 510 of the anchor sample 507. It can be understood that the above text representations 508, 5091, 5092, and 510 can all be vectors.
[0106] Then the large model can be trained by contrastive learning, for example, by calculating the similarity S1 between the text representation 510 of the anchor sample 508 and the text representation 508 corresponding to the positive sample 5022, calculating the similarity S2 between the text representation 510 and the text representation 5091 of the negative sample 5061, and calculating the similarity S3 between the text representation 510 and the text representation 5092 of the negative sample 5062. Next, the loss value of the large model can be calculated based on the similarities S1, S2, and S3, and then the parameters of the large model can be adjusted based on the loss value. It can be understood that if the loss value of the adjusted large model is less than the predetermined loss value after multiple iterations, it can be considered that the large model converges and the trained large model is obtained. It can be seen that since the large model converges after adjusting the parameters, the accuracy of the large model is relatively high. In the model reasoning stage, the large model can accurately determine the similarity between the first text representation of the first candidate object and the second text representation of the first historical interaction object, and then accurately determine the object to be recommended.
[0107] Figure 6 The structural block diagram of the recommendation device according to an embodiment of the present disclosure is schematically shown.
[0108] like Figure 6 As shown, the recommendation device 600 of this embodiment includes a first encoding module 610 , a second encoding module 620 and a determination module 630 .
[0109] The first encoding module 610 is used to encode the attribute description text of at least one first candidate object using the large model to obtain at least one first text representation of the at least one first candidate object. In one embodiment, the first encoding module 610 can be used to perform the operation S110 described above, which will not be repeated here.
[0110] The second encoding module 620 is used to encode the attribute description text of the first historical interaction object using the large model to obtain a second text representation of the first historical interaction object, wherein the first historical interaction object and the first user meet a predetermined interaction condition. In one embodiment, the second encoding module 620 can be used to perform the operation S120 described above, which will not be repeated here.
[0111] The determination module 630 is used to determine the object to be recommended from the first historical interaction object according to the similarity between at least one first text representation and the second text representation; the large model is obtained by sample training based on the user portrait of the second user and the attribute of the second historical interaction object corresponding to the second user. In one embodiment, the determination module 630 can be used to perform the operation S130 described above, which will not be repeated here.
[0112] According to an embodiment of the present disclosure, samples include positive samples and negative samples, wherein the positive samples represent the attributes of objects that meet the preferences of the second user, and the negative samples represent the attributes of objects that differ from the preferences of the second user, and the preferences of the second user are related to the user portrait of the second user and the second historical interaction object.
[0113] According to an embodiment of the present disclosure, negative samples are generated by the following submodules: A first-category object determination submodule, which is used to determine a first-category object that differs from the second user's preference from a plurality of second candidate objects based on the user portrait of the second user and the attributes of N second historical interaction objects that meet a predetermined interaction condition with the second user; N is an integer greater than or equal to 1. A negative sample determination submodule, which is used to determine a negative sample based on the attribute description text of the first-category object.
[0114] According to an embodiment of the present disclosure, the first-category object determination submodule includes an input text determination unit, an output unit, and a first-category object determination unit. The input text determination unit is used to combine N attribute description texts of N second historical interaction objects, a portrait description text of a user portrait, an attribute description text of a second candidate object, and a predetermined prompt text template to obtain an input text. The output unit is used to input the input text into a large language model to obtain an output result. The first-category object determination unit is used to determine the first-category object according to the output result.
[0115] According to an embodiment of the present disclosure, a predetermined prompt text template representation is provided: a large language model is used to determine whether a second candidate object meets the preference of a second user based on N attribute description texts and a portrait description text; wherein a first-category object determination unit includes a first-category object determination subunit, which is used to determine a second candidate object that is determined by the large language model to not meet the preference of the second user as a first-category object.
[0116] According to an embodiment of the present disclosure, negative samples may also be generated by the following submodules: a candidate object determination submodule, configured to determine a plurality of second candidate objects that meet the second user's preference from an object library based on the N second historical interaction objects.
[0117] According to an embodiment of the present disclosure, positive samples are generated by the following submodules: a second-category object determination submodule, configured to determine a second-category object from at least one second historical interaction object according to time information of an interaction between a second user and the corresponding at least one second historical interaction object. A positive sample determination submodule, configured to determine a positive sample according to an attribute description text of the second-category object.
[0118] According to an embodiment of the present disclosure, the sample further includes an anchor sample, which is generated by the following submodules: a text determination submodule, which is used to determine at least one attribute description text of at least one second historical interaction object corresponding to the second user. An anchor sample determination submodule, which is used to determine the anchor sample based on the at least one attribute description text, so as to train the large model based on the difference between the anchor sample and the positive sample, and the difference between the anchor sample and the negative sample.
[0119] According to an embodiment of the present disclosure, the anchor sample determination submodule includes a sorting unit and an anchor sample determination unit. The sorting unit is used to sort at least one attribute description text according to the time information of the second user interacting with at least one second historical interaction object. The anchor sample determination unit is used to determine the anchor sample according to the sorted at least one attribute description text.
[0120] According to an embodiment of the present disclosure, the attribute description text is determined by the following submodules. A text pair determination submodule is used to combine the text of the attribute name and the text of the attribute value into a text pair for each of the multiple sub-attributes contained in the attribute as a text pair associated with the sub-attribute. An attribute description text determination submodule is used to determine the attribute description text based on multiple text pairs associated with the multiple sub-attributes.
[0121] Figure 7 A schematic block diagram of an electronic device that can be used to implement the data processing method of an embodiment of the present disclosure is schematically shown.
[0122] like Figure 7As shown, the electronic device 700 according to an embodiment of the present disclosure includes a processor 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage part 708 to a random access memory (RAM) 703. The processor 701 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 701 may also include an onboard memory for caching purposes. The processor 701 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0123] In RAM 703, various programs and data required for the operation of the electronic device 700 are stored. The processor 701, ROM 702, and RAM 703 are connected to each other through a bus 704. The processor 701 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 702 and / or RAM 703. It should be noted that the program can also be stored in one or more memories other than ROM 702 and RAM 703. The processor 701 can also perform the following operations by executing the program stored in the one or more memories: obtaining at least one historical search path for the index map, the index map includes at least two layers, each layer includes at least two nodes, and each historical search path includes at least two nodes in at least two layers; according to at least one historical search path, determining the path information and time information of at least one target node in the index map, wherein the path information of the target node represents the distance from the search start point of at least one historical search path to the target node; based on the path information and time information of the target node, determining the importance of the target node; according to the importance of the target node, adjusting the layer level of the target node in the index map and adjusting the connection relationship between nodes in the same layer.
[0124] According to an embodiment of the present disclosure, the electronic device 700 may further include an input / output (I / O) interface 705, which is also connected to the bus 704. The electronic device 700 may further include one or more of the following components connected to the I / O interface 705: an input portion 706 including a keyboard, a mouse, etc.; an output portion 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 708 including a hard disk, etc.; and a communication portion 709 including a network interface card such as a LAN card, a modem, etc. The communication portion 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed, so that a computer program read therefrom is installed into the storage portion 708 as needed.
[0125] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0126] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, it may include but is not limited to: 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), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 702 and / or RAM 703 described above and / or one or more memories other than ROM 702 and RAM 703.
[0127] The embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the method provided by the embodiment of the present disclosure.
[0128] The above functions defined in the system / device of the embodiment of the present disclosure are performed when the computer program is executed by the processor 701. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0129] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 709, and / or installed from the removable medium 711. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0130] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the processor 701, the above functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.
[0131] It should be noted that the collection, storage, use, processing, transmission, provision, disclosure and application of user personal information involved in the technical solution of this disclosure are in compliance with the provisions of relevant laws and regulations, necessary confidentiality measures have been taken, and they do not violate public order and good morals. In the technical solution of this disclosure, the user's authorization or consent is obtained before obtaining or collecting user personal information.
[0132] According to an embodiment of the present invention, the program code for executing the computer program provided by the embodiment of the present invention can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).
[0133] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0134] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present invention may be combined and / or coupled in a variety of ways, even if such combinations and / or couplings are not explicitly described in the present invention. In particular, the features described in the various embodiments and / or claims of the present invention may be combined and / or coupled in a variety of ways without departing from the spirit and teachings of the present invention. All of these combinations and / or couplings fall within the scope of the present invention.
[0135] The embodiments of the present invention have been described above. However, these embodiments are only for the purpose of illustration, and are not intended to limit the scope of the present invention. Although each embodiment has been described above, this does not mean that the measures in each embodiment cannot be advantageously used in combination. The scope of the present invention is limited by the appended claims and their equivalents. Without departing from the scope of the present invention, those skilled in the art may make various substitutions and modifications, which should all fall within the scope of the present invention.
Claims
1. A recommendation method, comprising: Using the large model, encoding the attribute description text of at least one first candidate object to obtain at least one first text representation of the at least one first candidate object; Using the large model, encoding the attribute description text of the first historical interaction object to obtain a second text representation of the first historical interaction object, wherein the first historical interaction object and the first user meet a predetermined interaction condition; determining an object to be recommended from the first historical interaction object according to a similarity between the at least one first text representation and the second text representation; The large model is obtained by sample training based on a user portrait of the second user and attributes of a second historical interaction object corresponding to the second user.
2. The method according to claim 1, wherein the samples include positive samples and negative samples, wherein: The positive sample represents the attributes of the object that meets the preferences of the second user, and the negative sample represents the attributes of the object that are different from the preferences of the second user. The preferences of the second user are related to the user portrait of the second user and the second historical interaction object.
3. According to the method of claim 2, the process of generating negative samples comprises: Determine, from a plurality of second candidate objects, a first category of objects that differ from the preferences of the second user according to the user portrait of the second user and the attributes of N second historical interaction objects that meet a predetermined interaction condition with the second user; N is an integer greater than or equal to 1; as well as The negative sample is determined according to the attribute description text of the first category of objects.
4. The method according to claim 3, wherein determining, from a plurality of second candidate objects, a first category of objects that differ from the preferences of the second user based on the user portrait of the second user and the attributes of the N second historical interaction objects that meet a predetermined interaction condition with the second user comprises: Combine the N attribute description texts of the N second historical interaction objects, the portrait description text of the user portrait, the attribute description text of the second candidate object, and a predetermined prompt text template to obtain an input text; Inputting the input text into a large language model to obtain an output result; According to the output result, the first category of objects is determined.
5. The method according to claim 4, wherein the predetermined prompt text template represents: the large language model is used to determine whether the second candidate object meets the preference of the second user based on the N attribute description texts and the portrait description text; in, Determining the first category of objects according to the output result includes: The second candidate object determined by the large language model as not meeting the preference of the second user is determined as the first category object.
6. According to the method of claim 3, the process of generating negative samples further comprises: The plurality of second candidate objects that meet the second user's preference are determined from an object library according to the N second historical interaction objects.
7. According to the method of claim 2, the process of generating the positive sample comprises: Determine a second category of objects from the at least one second historical interaction object according to time information of the interaction between the second user and the corresponding at least one second historical interaction object; The positive sample is determined according to the attribute description text of the second category object.
8. The method according to claim 2, wherein the sample further comprises an anchor point sample, and the generation process of the anchor point sample comprises: determining at least one attribute description text of at least one second historical interaction object corresponding to the second user; An anchor sample is determined according to the at least one attribute description text, so as to train the large model based on the difference between the anchor sample and the positive sample, and the difference between the anchor sample and the negative sample.
9. The method according to claim 8, wherein determining the anchor point sample according to the at least one attribute description text comprises: sorting the at least one attribute description text according to time information of the interaction between the second user and the at least one second historical interaction object; The anchor point sample is determined according to the sorted at least one attribute description text.
10. The method according to any one of claims 1 to 9, wherein the attribute description text is determined by: For each of the multiple sub-attributes included in the attribute, combining the text of the attribute name and the text of the attribute value into a text pair as a text pair associated with the sub-attribute; The attribute description text is determined according to a plurality of text pairs associated with the plurality of sub-attributes.
Citation Information
Cited By
Recommendation information generation method and device, equipment, medium and program product
CN121365168A
