Preference data recommendation method and device, equipment, storage medium and program product
Through the combination of pre-trained models and prompt templates, a collection of recall elements is directly generated, which solves the problem of insufficient user behavior data, improves the accuracy of recommendations and model generalization, and reduces the computational burden.
Patent Information
- Application Number
- CN202410763362.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-13
- Publication Date
- 2024-09-24
AI Technical Summary
When the existing technology recommends preference data to users, it increases the computational burden and reduces the generalization of the model. When there is insufficient user behavior data, the model is not fully adjusted, reducing the accuracy of recommendations.
Using a pre-trained model based on massive data training in advance, combined with direct recall or a small number of learning prompt templates, target prompt information is generated based on the user's historical interaction element sequence and full candidate element set, and the recall element set is output through the pre-trained model for recommendation, avoiding Fine-tuning process of user behavior data.
Save computing resources, improve the generalization of the model, and ensure the accuracy of recommendations without considering the adequacy of user behavior data.
Smart Images

Figure 00000000_0000
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a preference data recommendation method, device, equipment, storage medium and program product. Background Art
[0002] With the continuous development of the Internet and data processing technology, various Internet products have become more personalized. It is necessary to analyze the specific circumstances of users' use of Internet products and recommend more suitable preference data to users based on the analysis results to improve the user experience.
[0003] Currently, when recommending preference data for users, a corresponding pre-trained model is generally established based on the recommendation scenario in advance, and then the user behavior data corresponding to the user is obtained, and the user behavior data is used to fine-tune the parameters of the pre-trained model, so that the pre-trained model outputs the user's corresponding preference data based on the fine-tuning results.
[0004] However, there are often multiple recommendation scenarios and users, which requires not only the establishment of multiple pre-trained models, but also the fine-tuning of each pre-trained model based on different user behavior data, which increases the computational burden and reduces the generalization of the model. Moreover, when there is less user behavior data corresponding to a certain user, the model will not be fully adjusted, reducing the accuracy of the recommendation. Summary of the invention
[0005] The present application provides a preference data recommendation method, apparatus, device, storage medium and program product to solve the technical problems in the prior art of increasing the computational burden, reducing the generalization of the model, and when the user behavior data corresponding to a certain user is small, the model will not be fully adjusted, thereby reducing the accuracy of the recommendation.
[0006] In a first aspect, the present application provides a preference data recommendation method, comprising: receiving a preference data recommendation instruction sent by a target user through an operation interface corresponding to an Internet product, and acquiring a historical interaction element sequence corresponding to the target user according to the preference data recommendation instruction; the historical interaction element sequence is a sequence formed by historical interaction elements that the target user has interacted with within a preset time threshold and are arranged according to the interaction time;
[0007] Obtain a pre-trained model, a full candidate element set, and a preset prompt template; the pre-trained model is a model that is pre-trained based on massive data corresponding to Internet products and can understand natural language text; the full candidate element set includes all candidate elements that the target user may interact with; the preset prompt template is a direct recall prompt template or a small amount of learning prompt template; the direct recall prompt template is a template that instructs the pre-trained model to directly recall, and the small amount of learning prompt template is a template that instructs the pre-trained model to recall based on a small amount of learning results;
[0008] Generate target prompt information corresponding to the target user according to the historical interaction element sequence corresponding to the target user, the full candidate element set and the preset prompt template;
[0009] Inputting the target prompt information into a pre-trained model, and using the pre-trained model to output a set of recall elements corresponding to the target user according to the target prompt information;
[0010] Preference data is recommended for a target user according to the recalled element set, wherein the preference data is determined according to a final weight value corresponding to each recalled element in the recalled element set.
[0011] In one possible design, the preference data recommendation instruction includes target user information; obtaining the historical interaction element sequence corresponding to the target user according to the preference data recommendation instruction includes: obtaining all historical interaction elements corresponding to the target user according to the target user information; determining the interaction time corresponding to each historical interaction element, and extracting the historical interaction elements within a preset time threshold from all the historical interaction elements according to each interaction time; and sorting the historical interaction elements within the preset time threshold to obtain the historical interaction element sequence corresponding to the target user.
[0012] In one possible design, the preset prompt template is a direct recall prompt template; the target prompt information corresponding to the target user is generated according to the historical interaction element sequence corresponding to the target user, the full candidate element set and the preset prompt template, including: using a preset construction strategy to construct first embedding information according to the historical interaction element sequence; arranging the full candidate element set in a preset order to obtain second embedding information; embedding the first embedding information and the second embedding information into corresponding positions of the direct recall prompt template to generate target prompt information corresponding to the target user.
[0013] In one possible design, the first embedded information is constructed according to the historical interaction element sequence using a preset construction strategy, including: obtaining the historical interaction element sequence, and determining the latest interaction element based on all historical interaction elements corresponding to the target user; performing context learning according to the historical interaction element sequence and the latest interaction element to obtain a learning result; and determining the historical interaction element sequence, the latest interaction element, and the learning result as the first embedded information.
[0014] In one possible design, the pre-trained model is used to output a recall element set corresponding to the target user according to the target prompt information, including: calculating the latest weight value corresponding to each candidate element based on the indication content of the first embedded information based on the pre-trained model; obtaining a first number of candidate elements from each candidate element according to the size of each latest weight value, and determining the set formed by the first number of candidate elements as the recall element set corresponding to the target user.
[0015] In a possible design, the preset prompt template is a small amount of learning prompt template; the target prompt information corresponding to the target user is generated according to the historical interaction element sequence corresponding to the target user, the full candidate element set and the preset prompt template, including: obtaining preset task description information and preset format indication information; embedding the preset task description information and the preset format indication information into the corresponding position of the small amount of learning prompt template, and injecting the historical interaction element sequence and the full candidate element set based on the embedded small amount of learning prompt template; determining the injected small amount of learning prompt template as the target prompt information corresponding to the target user.
[0016] In one possible design, the small amount of learning prompt template includes a first prompt part and a second prompt part; the injecting of the historical interaction element sequence and the full candidate element set based on the embedded small amount of learning prompt template includes: embedding the historical interaction element sequence and the full candidate element set into the first prompt part; obtaining the historical recommendation results corresponding to the preset user, and embedding the historical recommendation results, historical interaction element sequence and the full candidate element set corresponding to the preset user into the second prompt part.
[0017] In one possible design, the pre-trained model is used to output a recall element set corresponding to a target user according to target prompt information, including: calculating the latest weight value corresponding to each candidate element based on the injected content of the first prompt part based on the pre-trained model, and obtaining a first number of candidate elements from each candidate element according to the size of each latest weight value; determining candidate elements to be adjusted from each candidate element according to the injected content of the second prompt part, and adjusting the latest weight values corresponding to the candidate elements to be adjusted; updating the first number of candidate elements according to the adjusted latest weight values, and determining the set formed by the updated first number of candidate elements as the recall element set corresponding to the target user.
[0018] In one possible design, the pre-trained model includes multiple preset generators, which are used to calculate the latest weight values; the calculation of the latest weight values corresponding to each candidate element includes: calculating the latest weight values corresponding to each candidate element according to the calculation order corresponding to each preset generator to obtain multiple latest weight values corresponding to each candidate element; calculating the average value of the multiple latest weight values corresponding to each candidate element to obtain the average latest weight value corresponding to each candidate element; and determining the average latest weight value corresponding to each candidate element as the latest weight value corresponding to each candidate element.
[0019] In one possible design, recommending preference data to a target user based on the recalled element set includes: obtaining each recalled element based on the recalled element set corresponding to the target user; calculating a final weight value corresponding to each recalled element based on all historical interaction elements corresponding to the target user, and sorting each recalled element according to the size of each final weight value; obtaining a second number of recalled elements according to the sorting result, and displaying the second number of recalled elements on an operation interface corresponding to the target user, so as to recommend preference data to the target user.
[0020] In a possible design, after displaying the second number of recalled elements on the operation interface corresponding to the target user, it also includes: receiving a preference data re-recommendation instruction sent by the target user through the operation interface corresponding to the Internet product, the preference data re-recommendation instruction including erroneous recalled elements that do not match the target user; re-executing the preference data recommendation process, and reducing the latest weight value corresponding to the erroneous recalled element when calculating the latest weight value corresponding to each candidate element, so as to re-recommend the preference data to the target user.
[0021] In one possible design, after displaying the second number of recall elements on the operation interface corresponding to the target user, it also includes: in response to at least one recall element being selected by the target user, obtaining the selected recall element, and increasing the latest weight value corresponding to the selected recall element when recommending preference data to the target user next time; in response to at least one recall element not being selected by the target user, obtaining the unselected recall element, and reducing the latest weight value corresponding to the unselected recall element when recommending preference data to the target user next time.
[0022] In a second aspect, the present application provides a preference data recommendation device, comprising: a receiving module, configured to receive a preference data recommendation instruction sent by a target user through a corresponding operation interface of an Internet product;
[0023] An acquisition module, configured to acquire a historical interaction element sequence corresponding to a target user according to the preference data recommendation instruction; the historical interaction element sequence is a sequence formed by historical interaction elements that the target user has interacted with within a preset time threshold and are arranged according to interaction time;
[0024] The acquisition module is further used to acquire a pre-trained model, a full candidate element set, and a preset prompt template; the pre-trained model is a model that is pre-trained based on a large amount of data corresponding to an Internet product and can understand natural language text; the full candidate element set includes all candidate elements that the target user may interact with; the preset prompt template is a direct recall prompt template or a small amount of learning prompt template; the direct recall prompt template is a template that instructs the pre-trained model to directly recall, and the small amount of learning prompt template is a template that instructs the pre-trained model to recall based on a small amount of learning results;
[0025] A generating module, configured to generate target prompt information corresponding to the target user according to the historical interaction element sequence corresponding to the target user, the full candidate element set and the preset prompt template;
[0026] An input module, used for inputting the target prompt information into a pre-trained model;
[0027] An output module, used to output a recall element set corresponding to a target user according to target prompt information using the pre-trained model;
[0028] The recommendation module is used to recommend preference data to a target user according to the recalled element set, wherein the preference data is determined according to a final weight value corresponding to each recalled element in the recalled element set.
[0029] In a third aspect, an embodiment of the present application provides an electronic device, comprising: at least one processor and a memory; the memory stores computer execution instructions; the at least one processor executes the computer execution instructions stored in the memory, so that the at least one processor executes the preference data recommendation method described in the first aspect and various possible designs of the first aspect.
[0030] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the preference data recommendation method described in the first aspect and various possible designs of the first aspect is implemented.
[0031] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements the preference data recommendation method described in the first aspect and various possible designs of the first aspect.
[0032] The preference data recommendation method, apparatus, device, storage medium and program product provided in the present application receive a preference data recommendation instruction sent by a target user through an operation interface corresponding to an Internet product, and obtain a historical interaction element sequence corresponding to the target user according to the preference data recommendation instruction; the historical interaction element sequence is a sequence formed by historical interaction elements that the target user has interacted with within a preset time threshold and are arranged according to the interaction time; a pre-trained model, a full candidate element set and a preset prompt template are obtained; the pre-trained model is a model that is pre-trained based on massive data corresponding to the Internet product and can understand natural language text; the full candidate element set includes all candidate elements that the target user may interact with; the preset prompt template is A direct recall prompt template or a small amount of learning prompt template; the direct recall prompt template is a template that instructs the pre-trained model to directly recall, and the small amount of learning prompt template is a template that instructs the pre-trained model to recall based on the small amount of learning results; generating target prompt information corresponding to the target user according to the historical interaction element sequence corresponding to the target user, the full candidate element set and the preset prompt template; inputting the target prompt information into the pre-trained model, and using the pre-trained model to output the recall element set corresponding to the target user according to the target prompt information; recommending preference data for the target user according to the recall element set, the preference data is determined according to the final weight value corresponding to each recall element in the recall element set. Since the corresponding preset prompt template is set in advance based on the direct recall prompt method or the small amount of learning prompt method, and a unique pre-trained model is obtained based on the corresponding massive data of the Internet product, by receiving the preference data recommendation instruction triggered by the target user in the corresponding operation interface of the Internet product, the historical interaction element sequence that the target user has interacted with within a preset time threshold and arranged according to the interaction time can be obtained based on the instruction. By obtaining the pre-trained model, the preset prompt template, and the full candidate element set that the target user may interact with, the target prompt information corresponding to the target user can be generated according to the historical interaction element sequence corresponding to the target user, the full candidate element set, and the direct recall prompt template or a small number of learning prompt templates, thereby improving the flexibility of the generated prompt information, and the target prompt information can be input into the pre-trained model, so that the pre-trained model is used to output the recall element set corresponding to the target user according to the target prompt information, and the target user's preference data is recommended according to the final weight value corresponding to each recall element in the recall element set. It saves computing resources and improves the generalization of the model. And there is no need to consider whether the user behavior data is sufficient, which improves the accuracy of the recommendation. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0034] Figure 1 An application scenario diagram of the preference data recommendation method provided in an embodiment of the present application;
[0035] Figure 2 The process of the preference data recommendation method provided in the embodiment of the present application Figure 1 ;
[0036] Figure 3 The process of the preference data recommendation method provided in the embodiment of the present application Figure 2 ;
[0037] Figure 4 The process of the preference data recommendation method provided in the embodiment of the present application Figure 3 ;
[0038] Figure 5 The process of the preference data recommendation method provided in the embodiment of the present application Figure 4 ;
[0039] Figure 6 The process of the preference data recommendation method provided in the embodiment of the present application Figure 5 ;
[0040] Figure 7 The process of the preference data recommendation method provided in the embodiment of the present application Figure 6 ;
[0041] Figure 8 A complete flow chart of the preference data recommendation method provided in the embodiment of the present application;
[0042] Fig. 9 A schematic diagram of the structure of a preference data recommendation device provided in an embodiment of the present application;
[0043] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0044] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0045] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0046] In the technical solution of this application, the collection, storage, use, processing, transmission, provision and disclosure of information such as financial data or user data involved shall comply with the provisions of relevant laws and regulations and shall not violate public order and good morals.
[0047] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0048] In the prior art, when recommending preference data for users, it is generally necessary to predetermine the recommendation scenarios included in the Internet product, and then use the data corresponding to each recommendation scenario to train the large model, and establish a pre-trained model corresponding to each recommendation scenario. Then, when a certain user enters a certain recommendation scenario, the user behavior data corresponding to the user is obtained, and then the corresponding user behavior data is input into the corresponding pre-trained model, and the corresponding pre-trained model is used to fine-tune the parameters according to the corresponding user behavior data, so as to output the preference data corresponding to the user based on the fine-tuning result. However, the number of recommendation scenarios included in Internet products is often multiple, and the number of users required to be served by each recommendation scenario is also multiple, which requires not only the establishment of multiple pre-trained models based on multiple recommendation scenarios, but also the need for each pre-trained model to be fine-tuned based on different user behavior data, which increases the computational burden and reduces the generalization of the model. And when the user behavior data corresponding to a certain user is less, the model will not be fully adjusted, reducing the accuracy of the recommendation.
[0049] In response to the above technical problems, the present application proposes the following technical concept: In order to reduce the computational burden, instead of establishing multiple pre-trained models based on multiple recommendation scenarios, a large model is trained using massive data corresponding to Internet products to establish a pre-trained model. In order to improve the generalization of the model, instead of fine-tuning each pre-trained model based on different user behavior data, a prompt template is pre-determined, and a prompt template is used to form different prompt information according to different user behavior data, so that the established pre-trained model outputs a recall element according to the prompt information, thereby recommending preference data to the user based on the recall element. It can be seen that there is no need for fine-tuning in the entire recommendation process, and there is no need to consider the amount of user behavior data corresponding to the user, thereby improving the accuracy of the recommendation. Then, when a user enters a recommendation scenario, the pre-established pre-trained model, the user behavior data corresponding to the user, all the elements to be recommended that the user may be interested in, and the prompt template are obtained, and the user behavior data corresponding to the user and all the elements to be recommended that the user may be interested in are poured into the prompt template to form prompt information. Then the prompt information is input into the pre-trained model, and the pre-trained model is used to output the recall element corresponding to the user according to the prompt information, so as to recommend the preference data for the user according to the recall element. This saves computing resources and improves the generalization of the model. In addition, there is no need to consider whether the user behavior data is sufficient, which improves the accuracy of the recommendation.
[0050] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0051] Figure 1 This is an application scenario diagram of the preference data recommendation method provided in the embodiment of the present application. Figure 1As shown, the application scenario includes: a user terminal 1, an electronic device 2, and a database 3. The user terminal 1 is a user terminal including an Internet product, and the database 3 is a database corresponding to the electronic device 2. The Internet product is any product that can provide Internet services, such as an online store. The electronic device 2 is respectively connected to the user terminal 1 and the database 3 in communication. First, the target user selects an Internet product through the user terminal 1 to enter the operation interface corresponding to the Internet product, and triggers a preference data recommendation instruction through the operation interface. Then, in response to receiving the preference data recommendation instruction triggered by the target user, the electronic device 2 obtains a sequence of historical interaction elements in the database 3 that the target user has interacted with within a preset time threshold and arranged according to the interaction time. And further based on database 3, a pre-trained model that can understand natural language text, a full set of candidate elements that the target user may interact with, and a preset prompt template that are obtained by pre-training based on massive data corresponding to Internet products, and then the target prompt information corresponding to the target user is generated according to the historical interaction element sequence corresponding to the target user, the full set of candidate elements, and the preset prompt template, and the target prompt information is input into the pre-trained model, so that the pre-trained model is used to output the recall element set corresponding to the target user according to the target prompt information, thereby recommending preference data for the target user according to the recall element set. Among them, the preference data is determined according to the final weight value corresponding to each recall element in the recall element set. The preset prompt template is a direct recall prompt template or a small amount of learning prompt template; the direct recall prompt template is a template that instructs the pre-trained model to directly recall, and the small amount of learning prompt template is a template that instructs the pre-trained model to recall based on a small amount of learning results.
[0052] based on Figure 1 In the application scenario shown, the embodiment of the present application also provides a preference data recommendation method. Figure 2 The process of the preference data recommendation method provided in the embodiment of the present application Figure 1 .like Figure 2 As shown, the preference data recommendation method includes:
[0053] S201, receiving a preference data recommendation instruction sent by a target user through a corresponding operation interface of an Internet product, and obtaining a historical interaction element sequence corresponding to the target user according to the preference data recommendation instruction. The historical interaction element sequence is a sequence formed by historical interaction elements that the target user has interacted with within a preset time threshold and are arranged according to the interaction time.
[0054] The target users are those who have demand for Internet products and services. Internet products are any product that can provide related services, such as online stores, online financial products, etc.
[0055] The preference data recommendation instruction is an instruction to instruct the electronic device to recommend preference data to the target user. The preference data is data that better meets the expectations of the target user.
[0056] For example, if the Internet product is an online store, the target user's preference data may be products that better meet the target user's expectations.
[0057] The historical interaction element sequence is a sequence of historical interaction elements that the target user has interacted with within a preset time threshold and arranged according to the interaction time. The preset time threshold is a pre-set time period, such as the past three months. The historical interaction element is any element that the target user has interacted with in an Internet product.
[0058] For example, if the Internet product is an online store, the historical interaction element can be any product that the target user has purchased in the online store, such as badminton and badminton shoes from store A.
[0059] In this embodiment, the target user can trigger the preference data recommendation instruction based on the corresponding operation interface of the Internet product in advance, and send the preference data recommendation instruction to the electronic device. Then, in response to the preference data recommendation instruction being triggered, the electronic device receives the preference data recommendation instruction and determines to recommend the preference data to the target user according to the instruction. Based on this, the historical interaction element sequence corresponding to the target user is obtained.
[0060] The scenario in which the target user triggers the preference data recommendation instruction may specifically be: when the target user enters the corresponding operation interface of the Internet product, the preference data recommendation instruction is triggered. Alternatively, when the target user enters any recommendation scenario through the corresponding operation interface of the Internet product, the preference data recommendation instruction is triggered.
[0061] The recommended scenario is any scenario included in the Internet product. For example, if the Internet product is an online store, the recommended scenario may be sports products, daily chemical products, etc.
[0062] It should be understood that the above examples are merely examples and should not constitute any limitation to the present application.
[0063] S202, obtaining a pre-trained model, a full candidate element set, and a preset prompt template. The pre-trained model is a model that is pre-trained based on massive data corresponding to Internet products and can understand natural language text. The full candidate element set includes all candidate elements that the target user may interact with. The preset prompt template is a direct recall prompt template or a small amount of learning prompt template; the direct recall prompt template is a template that instructs the pre-trained model to directly recall, and the small amount of learning prompt template is a template that instructs the pre-trained model to recall based on a small amount of learning results.
[0064] Among them, the pre-trained model is a pre-stored model that can understand natural language text. Specifically, it is a model that is pre-trained based on massive data corresponding to Internet products.
[0065] The full candidate element set is a set of candidate elements for selection by the pre-trained model, specifically including all candidate elements that the target user may interact with. The candidate elements are the elements that the target user may interact with.
[0066] Among them, the preset prompt template is a preset prompt template that guides the pre-trained model to perform recommendation-related processes, and specifically can be a direct recall prompt template or a small amount of learning prompt template.
[0067] Among them, the direct recall prompt template is a template that allows the pre-trained model to recall directly based on the target prompt information.
[0068] Among them, the small amount of learning prompt template is a template that allows the pre-trained model to further learn a small amount of samples based on direct recall based on the target prompt information.
[0069] In this embodiment, a large amount of data corresponding to the Internet product can be obtained in advance, and the model training can be performed using the large amount of data to obtain a pre-trained model. A full set of candidate elements can be determined in advance based on all elements included in the Internet product. A preset prompt template for guiding the pre-trained model can also be set in advance, that is, a direct recall prompt template or a small amount of learning prompt template. Based on this, after obtaining the historical interaction element sequence corresponding to the target user, the pre-trained model, the full set of candidate elements, and the preset prompt template are obtained.
[0070] Among them, when using massive data for model training and obtaining a pre-trained model, the Transformer language architecture can be constructed at the bottom layer through the massive data corresponding to the Internet product, and the probability of the next word or word component appearing can be predicted for training.
[0071] Optionally, when determining the full candidate element set, in order to narrow the number range of candidate elements in the full candidate element set, the full candidate element set can also be determined based on the elements that the target user has interacted with. Specifically, all elements that the target user has interacted with in the Internet product are determined, and the categories to which each element belongs and all the elements contained in each category are further determined, so that the set formed by all the elements that have been interacted with and all the elements contained in each category are determined as the full candidate element set corresponding to the target user. Alternatively, the associated categories corresponding to each category and all the elements contained in the associated categories can also be determined, and the set formed by all the elements that have been interacted with, all the elements contained in each category, and all the elements contained in the associated categories are determined as the full candidate element set corresponding to the target user. This can improve the flexibility of determining the full candidate element set.
[0072] S203: Generate target prompt information corresponding to the target user according to the historical interaction element sequence corresponding to the target user, the entire candidate element set, and a preset prompt template.
[0073] Among them, the target prompt information is specific information that guides the pre-trained model to perform recommendation-related processes.
[0074] It is understandable that the preset prompt template may include pre-written content, ie, content pre-written in the preset prompt template, and content to be embedded, ie, blank content to be embedded in the preset prompt template.
[0075] In this embodiment, based on obtaining the historical interaction element sequence corresponding to the target user, the full candidate element set and the preset prompt template, the position of the content to be embedded in the preset prompt template is determined, and the content to be embedded is determined according to the historical interaction element sequence corresponding to the target user and the full candidate element set, so as to embed the determined content to be embedded into the corresponding position to generate the target prompt information corresponding to the target user.
[0076] It can be understood that since the preset prompt template can be a direct recall prompt template or a small amount of learning prompt template, the generated target prompt information can be prompt information formed based on the direct recall prompt template or prompt information formed based on a small amount of learning prompt template.
[0077] S204, inputting the target prompt information into the pre-trained model, and using the pre-trained model to output a set of recall elements corresponding to the target user according to the target prompt information;
[0078] The recall element set is a set of recall elements determined by the pre-training model from the entire candidate element set. The recall element is an element that relatively meets the expectations of the target user from the entire candidate element set.
[0079] It can be understood that the content to be embedded in the target prompt information is determined based on the historical interaction element sequence corresponding to the target user and the full candidate element set. Therefore, after obtaining the target prompt information corresponding to the target user, by inputting the target prompt information into the pre-trained model, the pre-trained model can be used to determine the recall element that relatively meets the target user's expectations in the full candidate element set based on the specific prompt content in the target prompt information, that is, the content determined by the historical interaction element sequence corresponding to the target user and the full candidate element set, and output the recall element set corresponding to the target user.
[0080] Among them, when outputting the recall element set corresponding to the target user, it can be specifically as follows: obtain the natural language text output by the pre-trained model, and use the substring matching algorithm to parse the text information corresponding to each recall element in the output natural language text. Store the text information corresponding to each recall element as a set to form the recall element set corresponding to the target user. Alternatively, assign an index to each candidate element in the full candidate element set in advance, and instruct the pre-trained model to output the index of each recall element. Store the index of each recall element as a set to form the recall element set corresponding to the target user. Thereby improving the accuracy of the output recall element set.
[0081] S205 . Recommend preference data to the target user according to the recalled element set, where the preference data is determined according to the final weight value corresponding to each recalled element in the recalled element set.
[0082] The final weight value is a weight value calculated by an accurate calculation method, such as factor analysis, etc. This embodiment does not limit the specific accurate calculation method.
[0083] In this embodiment, based on obtaining the recall element set corresponding to the target user, the weight value of each recall element in the recall element set is accurately calculated to obtain the final weight value corresponding to each recall element. Then, a certain number of recall elements are obtained according to the size of each final weight value, and these recall elements are recommended to the target user as preference data.
[0084] The preference data recommendation method provided in this embodiment receives a preference data recommendation instruction sent by a target user through an operation interface corresponding to an Internet product, and obtains a historical interaction element sequence corresponding to the target user according to the preference data recommendation instruction; the historical interaction element sequence is a sequence formed by historical interaction elements that the target user has interacted with within a preset time threshold and are arranged according to the interaction time; obtains a pre-trained model, a full candidate element set, and a preset prompt template; the pre-trained model is a model that is pre-trained based on massive data corresponding to the Internet product and can understand natural language text; the full candidate element set includes all candidate elements that the target user may interact with; the preset prompt template is a direct Recall prompt template or small amount of learning prompt template; direct recall prompt template is a template that instructs the pre-trained model to directly recall, and small amount of learning prompt template is a template that instructs the pre-trained model to recall based on the small amount of learning results; generate target prompt information corresponding to the target user according to the historical interaction element sequence corresponding to the target user, the full candidate element set and the preset prompt template; input the target prompt information into the pre-trained model, and use the pre-trained model to output the recall element set corresponding to the target user according to the target prompt information; recommend preference data to the target user according to the recall element set, and the preference data is determined according to the final weight value corresponding to each recall element in the recall element set. Since the corresponding preset prompt template is set in advance based on the direct recall prompt method and the small amount of learning prompt method, and a unique pre-training model is obtained based on the corresponding massive data of the Internet product, by receiving the preference data recommendation instruction triggered by the target user in the corresponding operation interface of the Internet product, the historical interaction element sequence that the target user has interacted with within the preset time threshold and arranged according to the interaction time can be obtained based on the instruction. By obtaining the pre-trained model, the preset prompt template, and the full candidate element set that the target user may interact with, the target prompt information corresponding to the target user can be generated according to the historical interaction element sequence corresponding to the target user, the full candidate element set, and the direct recall prompt template or a small number of learning prompt templates, thereby improving the flexibility of the generated prompt information, and the target prompt information can be input into the pre-trained model, so that the pre-trained model is used to output the recall element set corresponding to the target user according to the target prompt information, and the target user's preference data is recommended according to the final weight value corresponding to each recall element in the recall element set. It saves computing resources and improves the generalization of the model. And there is no need to consider whether the user behavior data is sufficient, which improves the accuracy of the recommendation.
[0085] Figure 3 The process of the preference data recommendation method provided in the embodiment of the present application Figure 2 .like Figure 3As shown, based on the above embodiment, this embodiment further refines the content included in the preference data recommendation instruction, and further refines the process of obtaining the historical interaction element sequence corresponding to the target user according to the preference data recommendation instruction. In this embodiment, the preference data recommendation instruction includes the target user information. When obtaining the historical interaction element sequence corresponding to the target user according to the preference data recommendation instruction, the following steps are specifically included:
[0086] S301. Acquire all historical interaction elements corresponding to the target user according to the target user information.
[0087] The target user information is information representing the identity of the target user, such as the name and number of the target user, and this example is only for example, and this embodiment does not limit the specific information form.
[0088] It is understandable that the historical interaction elements in the historical interaction element sequence are elements that the target user has interacted with within a preset time threshold. Therefore, the premise for obtaining the historical interaction element sequence corresponding to the target user is that all historical interaction elements that the target user has interacted with have been obtained.
[0089] Based on this, a mapping relationship can be established in advance between the target user information and all the historical interaction elements corresponding to the target user, and when it is determined that the target user triggers the preference data recommendation instruction, the target user information is stored in the instruction. Then, in response to obtaining the sequence of historical interaction elements corresponding to the target user according to the preference data recommendation instruction, the target user information in the preference data recommendation instruction is obtained, and the historical interaction elements with a mapping relationship with the information are obtained according to the target user information, and the historical interaction elements with a mapping relationship are determined to be all the historical interaction elements corresponding to the target user.
[0090] S302: Determine the interaction time corresponding to each historical interaction element, and extract the historical interaction elements within a preset time threshold from all the historical interaction elements according to each interaction time.
[0091] Among them, the interaction time is the specific time when the target user interacts with the historical interactive elements in the Internet product.
[0092] For example, if the target user purchases badminton in an online store, the interaction time is the specific time when the target user places an order for the badminton.
[0093] In this embodiment, the current time can be obtained in advance when the target user interacts with the historical interaction element, and the current time can be determined as the interaction time corresponding to the historical interaction element, and then an association can be established between the historical interaction element and the corresponding interaction time. Then, after all the historical interaction elements corresponding to the target user are obtained, the interaction time corresponding to each historical interaction element is determined according to the above association relationship, and the historical interaction elements within the preset time threshold are extracted from all the historical interaction elements according to the interaction time corresponding to each historical interaction element.
[0094] Exemplarily, if the historical interaction elements are badminton, badminton shoes, badminton racket, and badminton cap, the interaction time corresponding to badminton is January 23, the interaction time corresponding to badminton shoes is February 12, the interaction time corresponding to badminton racket is March 24, the interaction time corresponding to badminton cap is March 31, and the preset time threshold is February to March, then according to the interaction time corresponding to badminton, badminton shoes, badminton racket, and badminton cap, the historical interaction elements from February to March are extracted from badminton, badminton shoes, badminton racket, and badminton cap.
[0095] It is understandable that the above examples of interaction time can also be accurate to hours, minutes, seconds, etc., and this embodiment does not limit this. The above examples are only examples and should not constitute any limitation to this application.
[0096] S303: Sort the historical interaction elements within a preset time threshold to obtain a historical interaction element sequence corresponding to the target user.
[0097] In this embodiment, after extracting the historical interaction elements within a preset time threshold, the historical interaction elements are sorted in order from recent to far according to the interaction time corresponding to the historical interaction elements, thereby obtaining a historical interaction element sequence corresponding to the target user.
[0098] Exemplarily, if the historical interaction elements within the preset time threshold are badminton shoes, badminton rackets, and badminton caps, and the corresponding interaction times are February 12, March 24, and March 31, respectively, then the badminton shoes, badminton rackets, and badminton caps are sorted in order from near to far as badminton caps, badminton rackets, and badminton shoes.
[0099] It should be understood that the above examples are merely illustrative and should not constitute any limitation to the present application.
[0100] In the preference data recommendation method provided in this embodiment, the preference data recommendation instruction includes target user information. When obtaining the historical interaction element sequence corresponding to the target user according to the preference data recommendation instruction, all historical interaction elements corresponding to the target user are obtained according to the target user information; the interaction time corresponding to each historical interaction element is determined, and the historical interaction elements within the preset time threshold are extracted from all historical interaction elements according to each interaction time; the historical interaction elements within the preset time threshold are sorted to obtain the historical interaction element sequence corresponding to the target user. Since the target user information is stored in the preference data recommendation instruction, all historical interaction elements corresponding to the target user can be obtained through the target user information, and the interaction time corresponding to each historical interaction element can be determined. Therefore, the historical interaction elements within the preset time threshold can be extracted from all historical interaction elements according to each interaction time, and the historical interaction elements within the preset time threshold can be sorted, thereby quickly obtaining the historical interaction element sequence corresponding to the target user, and improving the efficiency of obtaining the historical interaction element sequence.
[0101] Figure 4 The process of the preference data recommendation method provided in the embodiment of the present application Figure 3 .like Figure 4 As shown, in this embodiment Figure 2 On the basis of the corresponding embodiment, the preset prompt template is further refined, and the target prompt information corresponding to the target user is generated according to the historical interaction element sequence corresponding to the target user, the full candidate element set and the preset prompt template. In this embodiment, the preset prompt template is a direct recall prompt template. When the target prompt information corresponding to the target user is generated according to the historical interaction element sequence corresponding to the target user, the full candidate element set and the preset prompt template, the following steps are specifically included:
[0102] S401: Construct first embedded information according to a historical interactive element sequence using a preset construction strategy.
[0103] In this embodiment, the preset prompt template is a direct recall prompt template, which is in response to generating target prompt information corresponding to the target user based on the historical interaction element sequence corresponding to the target user, the full candidate element set and the preset prompt template, and generating target prompt information corresponding to the target user based on the historical interaction element sequence corresponding to the target user, the full candidate element set and the direct recall prompt template.
[0104] Among them, the preset construction strategy is a strategy for constructing relevant information based on a sequence of historical interaction elements.
[0105] The first embedded information is information determined from historical interaction elements and needs to be embedded in the direct recall prompt template.
[0106] Specifically, a pre-stored preset construction strategy is obtained, and the preset construction strategy is adopted to construct the first embedded information based on the historical interaction element sequence.
[0107] S402: Arrange all candidate element sets in a preset order to obtain second embedding information.
[0108] The preset order is a preset order for arranging the entire candidate element set, such as time order, name initials order, default order or random order, and the above examples are only examples, and this embodiment does not limit the specific preset order.
[0109] The second embedded information is related information formed by the arranged candidate elements.
[0110] In this embodiment, a preset sequence and all candidate elements in the entire candidate element set are acquired, and all candidate elements are arranged according to the preset sequence to obtain the second embedding information.
[0111] S403: embed the first embedded information and the second embedded information into corresponding positions of the direct recall prompt template to generate target prompt information corresponding to the target user.
[0112] In this embodiment, the first embedded information can be used as a content to be embedded in advance, a corresponding position can be set for it in the direct recall prompt template, and a mapping relationship can be established between the corresponding position and the format of the first embedded information. Similarly, the second embedded information can be used as another content to be embedded, a corresponding position can be set for it in the direct recall prompt template, and a mapping relationship can be established between the corresponding position and the format of the second embedded information.
[0113] Based on this, after obtaining the first embedded information and the second embedded information, the first embedded information and the second embedded information are respectively embedded into the corresponding positions of the direct recall prompt template according to the mapping relationship, so as to generate the target prompt information corresponding to the target user.
[0114] The preference data recommendation method provided in this embodiment has a preset prompt template as a direct recall prompt template. When generating target prompt information corresponding to the target user according to the historical interaction element sequence corresponding to the target user, the full candidate element set and the preset prompt template, a preset construction strategy is used to construct the first embedded information according to the historical interaction element sequence; the full candidate element set is arranged in a preset order to obtain the second embedded information; the first embedded information and the second embedded information are embedded in the corresponding position of the direct recall prompt template to generate the target prompt information corresponding to the target user. Since the preset construction strategy is pre-stored, when it is determined that the preset prompt template is a direct recall prompt template, the first embedded information is constructed according to the historical interaction element sequence by adopting the preset construction strategy, and the second embedded information is obtained by arranging the full candidate element set in a preset order, and the first embedded information and the second embedded information can be embedded in the corresponding position of the direct recall prompt template, thereby smoothly generating the target prompt information corresponding to the target user based on direct recall, thereby improving the success rate of subsequent recommendations based on the target prompt information.
[0115] As an optional embodiment, this embodiment further refines S401 on the basis of the above embodiment. In this embodiment, when the preset construction strategy is adopted to construct the first embedded information according to the historical interactive element sequence, the following steps are specifically included:
[0116] Step a1: Obtain a historical interaction element sequence, and determine the latest interaction element based on all historical interaction elements corresponding to the target user.
[0117] The latest interaction element is the historical interaction element of the target user's latest interaction.
[0118] In this embodiment, in response to using a preset construction strategy to construct the first embedded information according to the historical interaction element sequence, the historical interaction element sequence is obtained, and the interaction time corresponding to each historical interaction element in all the historical interaction elements corresponding to the target user is determined. The specific determination method is similar to the method for determining the interaction time corresponding to each historical interaction element in S302, and will not be repeated here. Then the historical interaction element closest to the current time is determined as the latest interaction element.
[0119] It is understandable that the historical interaction element sequence is a sequence of historical interaction elements within a certain preset time threshold, and the preset time threshold can be a time threshold with the current time as the end time, or it can be any time period. For example, if the current time is May, the preset time threshold can be the past three months, that is, March-May, or February-April, and the above examples are only examples, and this embodiment does not limit the specific preset time threshold.
[0120] Based on this, after obtaining the historical interaction element sequence, it can be determined whether the historical interaction element sequence is a historical interaction element sequence with the current time as the end time. If so, based on the characteristic that the historical interaction element sequence is arranged in order from recent to far, the historical interaction element at the first position is determined as the latest interaction element. If not, the interaction time corresponding to each historical interaction element in all historical interaction elements corresponding to the target user is determined, and the historical interaction element closest to the current time is determined as the latest interaction element.
[0121] Step a2: Perform context learning based on the historical interaction element sequence and the latest interaction element to obtain a learning result.
[0122] Contextual learning refers to learning the interaction rules presented by the historical interaction element sequence and the latest interaction element. The learning result is the interaction rule determined by combining the historical interaction element sequence and the latest interaction element.
[0123] It is understandable that users will show certain regularity when selecting elements. That is, when a user has interacted with certain elements in a certain order, the user may continue to interact with the elements in this order, or may select a specific element under this premise.
[0124] Based on this, after extracting the latest interactive elements, determine which elements the target user has interacted with in which order according to the historical interactive element sequence, and determine the specific elements selected by the target user under this premise according to the extracted latest interactive elements, so as to perform contextual learning and obtain learning results.
[0125] For example, if the current time is May, and the target user's historical interaction element sequence from February to April is "0-A, 1-B, 2-C", it can be determined that the target user has interacted with A, B, and C in order from recent to distant from February to April. If the latest interaction element corresponding to the target user in this advance is D, it can be determined that the specific element selected by the target user is D, assuming that the target user has interacted with A, B, and C in order from recent to distant from February to April. Then, by performing contextual learning on the above content, we can obtain the learning result that "if the target user interacted with the elements in the following order: 0-A, 1-B, 2-C, then D should be the most recommended."
[0126] It should be understood that the above examples are only for illustrative purposes and should not constitute any limitation to the present application.
[0127] Step a3: Determine the historical interaction element sequence, the latest interaction element and the learning result as the first embedding information.
[0128] In this embodiment, based on obtaining the historical interaction element sequence, the latest interaction element and the learning result, it is determined as the first embedded information.
[0129] In order to more clearly illustrate the target prompt information generated when the preset prompt template is a direct recall prompt template, a specific example is used for explanation below:
[0130] If the historical interaction element sequence is "0-A, 1-B, 2-C", the latest interaction element is "D", and the learning result is "D should be recommended the most", then the first embedded information is "If the target user interacted with the elements in the following order: 0-A, 1-B, 2-C, and the latest interaction was D, then D should be recommended the most"
[0131] If in the above scenario, the entire candidate element set is "B, E, C, A, D, F", then by sorting by the first letters, the second embedded information "A, B, C, D, E, F" can be obtained.
[0132] If in the above scenario, the direct recall prompt template is "[first embedded information] & [second embedded information], based on my interaction history, please speculate the elements that I most likely want to interact with and rank them. You must rank the given candidate elements. You cannot generate elements that are not in the given candidate list.", then after the first embedded information and the second embedded information are embedded in the corresponding positions of the direct recall prompt template, the final target prompt information can be obtained as "[If the target user interacted with the elements in the following order: 0-A, 1-B, 2-C, and the most recent interaction was D, then D should be recommended most] & [A, B, C, D, E, F], based on my interaction history, please speculate the elements that I most likely want to interact with and rank them. You must rank the given candidate elements. You cannot generate elements that are not in the given candidate list."
[0133] It should be understood that the above examples are merely illustrative and should not constitute any limitation to the present application.
[0134] The preference data recommendation method provided in this embodiment, when constructing the first embedded information according to the historical interaction element sequence using a preset construction strategy, obtains the historical interaction element sequence, and determines the latest interaction element based on all the historical interaction elements corresponding to the target user; performs context learning based on the historical interaction element sequence and the latest interaction element to obtain a learning result; and determines the historical interaction element sequence, the latest interaction element, and the learning result as the first embedded information. By obtaining the historical interaction element sequence and determining the latest interaction element from all the historical interaction elements, context learning can be performed on the above historical interaction element sequence and the latest interaction element to obtain a learning result, so that the obtained historical interaction element sequence, the latest interaction element, and the learning result can be determined as the first embedded information, thereby improving the completeness and accuracy of the content indicated by the first embedded information.
[0135] Figure 5 The process of the preference data recommendation method provided in the embodiment of the present application Figure 4 .like Figure 5 As shown, based on the above embodiment, this embodiment further refines the method of using a pre-trained model to output a set of recalled elements corresponding to a target user according to target prompt information. In this embodiment, when using a pre-trained model to output a set of recalled elements corresponding to a target user according to target prompt information, the following steps are specifically included:
[0136] S501: Calculate the latest weight value corresponding to each candidate element based on the pre-trained model according to the indication content of the first embedding information.
[0137] The latest weight value is the weight value calculated the most recently. The weight value is the preference of each candidate element for the target user compared with other candidate elements.
[0138] It can be understood that each candidate element in the entire candidate element set is an element that the target user may interact with. Before the latest weight value is calculated, the weight value corresponding to each candidate element is the same fixed value, such as 0.5, that is, each candidate element has a 50% chance of interacting with the target user. Therefore, calculating the latest weight value corresponding to each candidate element is actually calculated based on the fixed value corresponding to each candidate element.
[0139] Based on this, in response to using the pre-trained model to output the recall element set corresponding to the target user according to the target prompt information, the pre-trained model is used to determine the second embedded information contained in the target prompt information, that is, the candidate elements arranged in a preset order, and the indication content of the first embedded information, that is, the historical interaction element sequence, the latest interaction element and the learning result. Then, the latest weight value corresponding to each candidate element is calculated according to the historical interaction element sequence, the latest interaction element and the learning result.
[0140] Exemplarily, if the indication content of the first embedded information is "If the target user interacted with the elements in the following order: 0-A, 1-B, 2-C, and the most recent interaction was D, then D should be recommended most]", and the candidate elements are "[A, B, C, D, E, F]", then the latest weight value corresponding to each candidate element can be calculated according to the indicated content based on the fixed value corresponding to each candidate element, that is, "A=0.8, B=0.7, C=0.6, D=0.9, E=0.5, F=0.5".
[0141] It should be understood that the above examples are only for illustrative purposes and should not constitute any limitation to the present application.
[0142] S502: Obtain a first number of candidate elements from each candidate element according to the size of each latest weight value, and determine a set formed by the first number of candidate elements as a recall element set corresponding to the target user.
[0143] The first number is a preset number of candidate elements to be selected.
[0144] In this embodiment, after obtaining the latest weight value corresponding to each candidate element, a predetermined first number is obtained, and the candidate elements are sorted in the order of the latest weight value from large to small, or from small to large, according to the size of each latest weight value. Then, the candidate elements with larger latest weight values and the first number are obtained from the sorted candidate elements, the above candidate elements are stored as a set, and the set is determined as the recall element set corresponding to the target user.
[0145] Exemplarily, if the first number is 3, and the latest weight values corresponding to each candidate element are "A=0.8, B=0.7, C=0.6, D=0.9, E=0.5, F=0.5", then the first number of candidate elements are "D=0.9, A=0.8, B=0.7".
[0146] It should be understood that the above examples are only for illustrative purposes and should not constitute any limitation to the present application.
[0147] The preference data recommendation method provided in this embodiment, when using a pre-trained model to output the recall element set corresponding to the target user according to the target prompt information, calculates the latest weight value corresponding to each candidate element based on the pre-trained model according to the indication content of the first embedded information; obtains a first number of candidate elements from each candidate element according to the size of each latest weight value, and determines the set formed by the first number of candidate elements as the recall element set corresponding to the target user. Since the target prompt information contains the historical interaction rules corresponding to the target user, that is, the indication content of the first embedded information, and contains each candidate element that the target user may interact with, the latest weight value corresponding to each candidate element can be calculated according to the indication content of the first embedded information through the pre-trained model, and the first number of candidate elements can be obtained from each candidate element according to the size of each latest weight value, and the set formed by the first number of candidate elements can be determined as the recall element set corresponding to the target user, thereby calculating the latest weight value of each candidate element based on the interaction rule of the target user, thereby improving the matching of the determined recall element with the target user.
[0148] Figure 6 The process of the preference data recommendation method provided in the embodiment of the present application Figure 5 .like Figure 6 As shown, in this embodiment Figure 2 On the basis of the corresponding embodiment, the preset prompt template is further refined, and the target prompt information corresponding to the target user is generated according to the historical interaction element sequence corresponding to the target user, the full candidate element set and the preset prompt template. In this embodiment, the preset prompt template is a small number of learning prompt templates. When the target prompt information corresponding to the target user is generated according to the historical interaction element sequence corresponding to the target user, the full candidate element set and the preset prompt template, the following steps are specifically included:
[0149] S601: Obtain preset task description information and preset format indication information.
[0150] In this embodiment, the preset prompt template is a small number of learned prompt templates, which is responsive to generating target prompt information corresponding to the target user based on the historical interaction element sequence corresponding to the target user, the full candidate element set and the preset prompt template, and generating target prompt information corresponding to the target user based on the historical interaction element sequence corresponding to the target user, the full candidate element set and the small number of learned prompt templates.
[0151] The preset task description information is preset information that describes the currently executed recommended task, and the preset format indication information is preset information that indicates the format of the target prompt information.
[0152] For example, the preset task description information may be "Required: Select 10 recall elements for recommendation and sort them from low to high by score, output as a list, without explaining the reason and without other content". The preset format indication information may be "Recommend the element with the highest score. There is no sorting rule for the recall elements in the recall element set".
[0153] It should be understood that the above examples are only for illustrative purposes and should not constitute any limitation to the present application.
[0154] Specifically, the preset task description information and the preset format indication information can be determined in advance by the R&D personnel and stored. When the target prompt information corresponding to the target user is generated according to the historical interaction element sequence corresponding to the target user, the full candidate element set and a small number of learning prompt templates, the pre-stored preset task description information and the preset format indication information are obtained.
[0155] S602: embed preset task description information and preset format indication information into corresponding positions of a small amount of learning prompt templates, and inject a historical interaction element sequence and a full candidate element set based on the embedded small amount of learning prompt templates.
[0156] In this embodiment, the preset task description information can be used as a content to be embedded in advance, a corresponding position can be set for it in a small number of learning prompt templates, and a mapping relationship can be established between the corresponding position and the format of the preset task description information. Similarly, the preset format indication information can be used as another content to be embedded, a corresponding position can be set for it in a small number of learning prompt templates, and a mapping relationship can be established between the corresponding position and the format of the preset format indication information.
[0157] Based on this, after obtaining the preset task description information and the preset format indication information, the preset task description information and the preset format indication information are respectively embedded into the corresponding positions of a small number of learning prompt templates according to the mapping relationship to obtain the embedded small number of learning prompt templates, and the historical interaction element sequence and the full candidate element set are injected based on the embedded small number of learning prompt templates.
[0158] S603: Determine the injected small amount of learning prompt templates as target prompt information corresponding to the target user.
[0159] In this embodiment, after injecting the historical interaction element sequence and the full candidate element set into a small number of learning prompt templates, they can be determined as the target prompt information corresponding to the target user.
[0160] The preference data recommendation method provided in this embodiment is that the preset prompt template is a small amount of learning prompt template. When generating the target prompt information corresponding to the target user according to the historical interaction element sequence, the full candidate element set and the preset prompt template corresponding to the target user, the preset task description information and the preset format indication information are obtained; the preset task description information and the preset format indication information are embedded in the corresponding position of the small amount of learning prompt template, and the historical interaction element sequence and the full candidate element set are injected based on the embedded small amount of learning prompt template; the injected small amount of learning prompt template is determined as the target prompt information corresponding to the target user. Since the preset task description information and the preset format indication information are determined in advance, when determining that the preset prompt template is a small amount of learning prompt template, by obtaining the preset task description information and the preset format indication information, and embedding the preset task description information and the preset format indication information in the corresponding position of the small amount of learning prompt template, the historical interaction element sequence and the full candidate element set can be injected based on the embedded small amount of learning prompt template, so that the injected small amount of learning prompt template is determined as the target prompt information corresponding to the target user. In this way, the target prompt information based on small amount of learning corresponding to the target user is smoothly generated, and the success rate of subsequent recommendation based on the target prompt information is improved.
[0161] As an optional embodiment, this embodiment further refines S602 on the basis of the above embodiment. In this embodiment, the small amount of learning prompt template includes a first prompt part and a second prompt part. When injecting the historical interaction element sequence and the full candidate element set based on the embedded small amount of learning prompt template, the following steps are specifically included:
[0162] Step b1: embed the historical interaction element sequence and the entire candidate element set into the first prompt part.
[0163] It can be understood that the target prompt information formed based on the small amount of learning prompt template is information that allows the pre-trained model to further learn a small amount of samples based on direct recall. Therefore, the small amount of learning prompt template should include two parts, namely the first prompt part and the second prompt part.
[0164] Among them, the first prompt part is the prompt part related to direct recall.
[0165] The second prompt part is a prompt part related to learning with a small number of samples.
[0166] In this embodiment, in response to injecting the historical interaction element sequence and the full candidate element set based on the embedded small amount of learning prompt template, the historical interaction element sequence and the full candidate element set are obtained, and the historical interaction element sequence and the full candidate element set are embedded in the corresponding position of the first prompt part in the small amount of learning prompt template. The specific embedding method is similar to the method of embedding preset task description information and preset format indication information in S602, and will not be repeated here.
[0167] Step b2: Obtain the historical recommendation results corresponding to the preset user, and embed the historical recommendation results corresponding to the preset user, the historical interaction element sequence, and the entire candidate element set into the second prompt part.
[0168] The preset user is a user who has similar preferences to the target user and has been recommended to the target user. The historical recommendation result is the result of the element that the preset user finally interacted with when recommending to the preset user.
[0169] In this embodiment, a small number of samples for the pre-trained model to learn, that is, the historical recommendation results corresponding to the preset user, can be predetermined. Then, in response to injecting the historical interaction element sequence and the full candidate element set based on the embedded small number of learning prompt templates, the historical interaction element sequence, the full candidate element set and the historical recommendation results corresponding to the preset user are obtained and embedded one by one in the corresponding position of the second prompt part.
[0170] In order to more clearly illustrate the target prompt information generated when the preset prompt template is a small number of learning prompt templates, a specific example is used for explanation below:
[0171] If a small amount of learning prompt template is:
[0172] "First prompt part: [preset task description information], element set that the target user has interacted with: [historical interaction element sequence], please select [preset format instruction information] from the candidate set [all candidate element sets].
[0173] The second prompt part: [preset task description information], the set of elements that the target user has interacted with: [historical interaction element sequence], given [historical recommendation results corresponding to the preset user], please [preset format indication information] for the target user from the candidate set [all candidate element sets]. "
[0174] And under this assumption, the preset task description information is "Required: Select 10 recalled elements for recommendation and sort them from low to high by score, output as a list, do not explain the reason, and do not contain other content." The preset format indication information is "Recommend the element with the highest score. There is no sorting rule for the recalled elements in the recalled element set." The historical interaction element sequence is "0-A, 1-B, 2-C." The full candidate element set is "B, E, C, A, D, F." The historical recommendation result corresponding to the preset user is "The preset user has seen C, A, D from the candidate set 'B, E, C, A, D, F'."
[0175] The target prompt information obtained is:
[0176] "First prompt: [Required: Select 10 recall elements for recommendation and sort them from low to high by score, output as a list, do not explain the reason, do not include other content], the set of elements that the target user has interacted with: [0-A, 1-B, 2-C], please [recommend the element with the highest score from the candidate set [B, E, C, A, D, F]. There is no sorting rule for the recall elements in the recall element set].
[0177] The second prompt part: [Required: Select 10 recalled elements for recommendation and sort them from low to high by score, output as a list, do not explain the reason, and do not include other content], the set of elements that the target user has interacted with: [0-A, 1-B, 2-C], it is known that [the preset user has seen C, A, D from the candidate set 'B, E, C, A, D, F'], please [recommend the element with the highest score from the candidate set [B, E, C, A, D, F] for the target user. There is no sorting rule for the recalled elements in the recalled element set]."
[0178] In the preference data recommendation method provided in the present embodiment, the small amount of learning prompt template includes a first prompt part and a second prompt part. When the historical interaction element sequence and the full candidate element set are injected based on the embedded small amount of learning prompt template, the historical interaction element sequence and the full candidate element set are embedded in the first prompt part; the historical recommendation results corresponding to the preset user are obtained, and the historical recommendation results, historical interaction element sequence and the full candidate element set corresponding to the preset user are embedded in the second prompt part. Since the first prompt part reflecting direct recall and the second prompt part reflecting small amount of learning are divided in the small amount of learning prompt template based on the characteristics of small amount of learning, by embedding the historical interaction element sequence and the full candidate element set in the first prompt part, and by acquiring the historical recommendation results corresponding to the preset user, the historical recommendation results, historical interaction element sequence and the full candidate element set corresponding to the preset user are embedded in the second prompt part, relevant information can be quickly injected into the embedded small amount of learning prompt template, thereby improving the efficiency of generating target prompt information based on small amount of learning.
[0179] Figure 7 The process of the preference data recommendation method provided in the embodiment of the present application Figure 6 .like Figure 7 As shown, based on the above embodiment, this embodiment further refines the method of using a pre-trained model to output a set of recalled elements corresponding to a target user according to target prompt information. In this embodiment, when using a pre-trained model to output a set of recalled elements corresponding to a target user according to target prompt information, the following steps are specifically included:
[0180] S701. Calculate the latest weight value corresponding to each candidate element according to the injected content of the first prompt part based on the pre-trained model, and obtain a first number of candidate elements from each candidate element according to the size of each latest weight value.
[0181] It is understandable that since the target prompt information formed based on a small amount of learning is prompt information that allows the pre-trained model to learn a small amount of samples based on direct recall and then make recommendations, it is necessary to first determine the first prompt part related to direct recall and then determine the second prompt part related to learning a small amount of samples in the above order.
[0182] Based on this, in response to using a pre-trained model to output a set of recalled elements corresponding to the target user according to the target prompt information, the pre-trained model is used to determine the injected content of the first prompt part in the target prompt information, that is, the entire candidate element set and the historical interaction element sequence, and then the latest weight value corresponding to each candidate element in the entire candidate element set is calculated according to the historical interaction element sequence, and the first number of candidate elements is obtained from each candidate element according to the size of each latest weight value.
[0183] When calculating the latest weight value corresponding to each candidate element in the entire candidate element set according to the historical interaction element sequence, the calculation can be performed according to the following example:
[0184] If the fixed value of the weight value corresponding to each candidate element is 0.5, the historical interaction element sequence is "0-A, 1-B, 2-C", and the candidate elements are "B, E, C, A, D, F", then based on the order of interaction time between each element in the historical interaction element sequence and the target user, the fixed value corresponding to each candidate element is adjusted to obtain the latest weight value corresponding to each candidate element, that is, "B=0.7, E=0.5, C=0.6, A=0.8, D=0.5, F=0.5".
[0185] It can be understood that after obtaining the latest weight value corresponding to each candidate element, the first number of candidate elements can be obtained from each candidate element according to the size of each latest weight value. The specific acquisition method is similar to the method of obtaining the first number of candidate elements from each candidate element according to the size of each latest weight value in step S502, and will not be repeated here.
[0186] S702: Determine a candidate element to be adjusted from among the candidate elements according to the injected content of the second prompt part, and adjust the latest weight value corresponding to the candidate element to be adjusted.
[0187] The candidate elements to be adjusted are candidate elements whose latest weight values need to be adjusted, which are determined based on a small amount of learning results.
[0188] It is understandable that after determining the first number of candidate elements based on the first prompt part related to direct recall, the first number of candidate elements needs to be adjusted according to the result of learning the historical recommendation results corresponding to the preset user.
[0189] In this embodiment, based on the injected content of the second prompt part, that is, the entire candidate element set, the historical interaction element sequence and the historical recommendation results corresponding to the preset user, the candidate elements that exist in the historical recommendation results corresponding to the preset user are determined among the candidate elements in the entire candidate element set, and the above-mentioned candidate elements are determined as the candidate elements to be adjusted, so that the latest weight values corresponding to the candidate elements to be adjusted are adjusted.
[0190] When determining the candidate element to be adjusted that exists in the historical recommendation result corresponding to the preset user from among the candidate elements in the entire candidate element set, the determination may be made specifically according to the following example:
[0191] If the historical interaction element sequence is "0-A, 1-B, 2-C", the candidate elements are "B, E, C, A, D, F", and the historical recommendation result corresponding to the preset user is "the preset user has viewed B and D from the candidate set 'B, E, C, A, D, F'", then B and D can be determined as the candidate elements to be adjusted.
[0192] When recalculating the latest weight value corresponding to the candidate element to be adjusted, the calculation may be performed according to the following example:
[0193] Based on the above example, if the latest weight values corresponding to each candidate element are "B=0.7, E=0.5, C=0.6, A=0.8, D=0.5, F=0.5", and B and D are candidate elements to be adjusted, then B=0.7 and D=0.5 are adjusted to obtain B=0.9 and D=0.7.
[0194] S703: Update the first number of candidate elements according to the adjusted latest weight values, and determine the set formed by the updated first number of candidate elements as the recalled element set corresponding to the target user.
[0195] In this embodiment, after adjusting the latest weight values corresponding to the candidate elements to be adjusted, the latest weight values corresponding to each candidate element are first updated using the adjusted latest weight values corresponding to the candidate elements to be adjusted, that is, the latest weight values corresponding to the candidate elements that are identical to them are replaced, and the first number of candidate elements are re-determined based on the latest weight values corresponding to each updated candidate element, thereby completing the update of the first number of candidate elements.
[0196] Based on the example in S702, if the latest weight values corresponding to each candidate element are "B=0.7, E=0.5, C=0.6, A=0.8, D=0.5, F=0.5", and the first number of candidate elements are "A=0.8, B=0.7, C=0.6".
[0197] Then, based on B=0.9 and D=0.7 to be adjusted, the latest weight values corresponding to the updated candidate elements can be obtained as "B=0.9, E=0.5, C=0.6, A=0.8, D=0.7, F=0.5". Further, the first number of candidate elements are re-determined, and the final first number of candidate elements are "B=0.9, A=0.8, D=0.7".
[0198] It can be understood that after the first number of candidate elements are updated, the set formed by the updated first number of candidate elements can be determined as the recalled element set corresponding to the target user.
[0199] The preference data recommendation method provided in this embodiment, when using a pre-trained model to output a recall element set corresponding to the target user according to the target prompt information, calculates the latest weight value corresponding to each candidate element based on the pre-trained model according to the injected content of the first prompt part, and obtains the first number of candidate elements from each candidate element according to the size of each latest weight value; determines the candidate elements to be adjusted from each candidate element according to the injected content of the second prompt part, and adjusts the latest weight value corresponding to the candidate elements to be adjusted; updates the first number of candidate elements according to the adjusted latest weight value, and determines the set formed by the updated first number of candidate elements as the recall element set corresponding to the target user. Since the target prompt information contains the first prompt information related to direct recall and the second prompt information related to small amount learning, the latest weight value corresponding to each candidate element is calculated by the pre-trained model according to the injected content of the first prompt part, and the first number of candidate elements can be obtained from each candidate element according to the size of each latest weight value. By determining the candidate elements to be adjusted among the candidate elements according to the injected content of the second prompt part, the latest weight values corresponding to the candidate elements to be adjusted can be recalculated, so that the first number of candidate elements can be updated according to the adjusted latest weight values, and the set formed by the updated first number of candidate elements can be determined as the recall element set corresponding to the target user. In this way, the results of a small amount of learning can be considered on the basis of direct recall, and the matching of the determined recall elements with the target user can be further improved.
[0200] As an optional embodiment, in this embodiment Figure 5 Corresponding embodiments and Figure 7 On the basis of the corresponding embodiment, the content included in the pre-trained model is further refined, and the calculation of the latest weight value corresponding to each candidate element is further refined. In this embodiment, the pre-trained model includes multiple preset generators, and the preset generator is used to calculate the latest weight value. When calculating the latest weight value corresponding to each candidate element, the following contents are specifically included:
[0201] Step c1: Calculate the latest weight value corresponding to each candidate element according to the calculation order corresponding to each preset generator to obtain multiple latest weight values corresponding to each candidate element.
[0202] In this embodiment, the pre-trained model includes a plurality of preset generators, wherein the preset generator is a generator pre-set in the pre-trained model and used to calculate the latest weight value.
[0203] It is understandable that there are multiple candidate elements in the entire candidate element set, and each candidate element is randomly ordered. Therefore, in order to avoid the calculation result being affected by the order, multiple preset generators are set in the pre-trained model, and different preset generators calculate the latest weight values corresponding to each candidate element in different orders. For example, preset generator A calculates from front to back in the order of arrangement of each candidate element in the entire candidate element set, and preset generator B calculates from back to front in the order of arrangement of each candidate element in the entire candidate element set. The above examples are only for example, and this embodiment does not limit the calculation order of specific preset generators.
[0204] Based on this, in response to calculating the latest weight value corresponding to each candidate element, multiple pre-selected preset generators are obtained, and each preset generator is used to calculate the latest weight value corresponding to each candidate element in a corresponding calculation order, thereby obtaining multiple latest weight values corresponding to each candidate element.
[0205] Step c2: Calculate the average value of multiple latest weight values corresponding to each candidate element to obtain the average latest weight value corresponding to each candidate element.
[0206] The average latest weight value is the average of multiple latest weight values.
[0207] In this embodiment, after obtaining multiple latest weight values corresponding to each candidate element, the multiple latest weight values corresponding to each candidate element are first added up, and then the specific number of the above multiple latest weight values is determined, and the sum calculation result is divided by the specific number of the multiple latest weight values to obtain the average latest weight value corresponding to each candidate element.
[0208] Step c3: Determine the average latest weight value corresponding to each candidate element as the latest weight value corresponding to each candidate element.
[0209] In this embodiment, after obtaining the average latest weight value corresponding to each candidate element, each average latest weight may be determined as the latest weight value corresponding to each candidate element.
[0210] The preference data recommendation method provided in this embodiment, the pre-training model includes multiple preset generators, the preset generators are used to calculate the latest weight value, when calculating the latest weight value corresponding to each candidate element, the latest weight value corresponding to each candidate element is calculated according to the calculation order corresponding to each preset generator, so as to obtain multiple latest weight values corresponding to each candidate element; the average value of the multiple latest weight values corresponding to each candidate element is calculated to obtain the average latest weight value corresponding to each candidate element; the average latest weight value corresponding to each candidate element is determined as the latest weight value corresponding to each candidate element. Since multiple preset generators are set in the pre-training model, and the calculation order of each preset generator is different, by calculating the latest weight value corresponding to each candidate element according to the calculation order corresponding to each preset generator, multiple latest weight values corresponding to each candidate element can be obtained. And by calculating the average value of multiple latest weight values, the average latest weight value corresponding to each candidate element can be obtained, so that each average latest weight value is determined as the latest weight value corresponding to each candidate element. This avoids the influence of the element sorting in the full candidate element set on the final calculation result, and improves the accuracy of calculating the latest weight value.
[0211] As an optional embodiment, in this embodiment Figure 5 Corresponding embodiments and Figure 7 Based on the corresponding embodiment, S205 is refined, and when the preference data is recommended for the target user according to the recalled element set, the following steps are specifically included:
[0212] Step d1: Obtain each recall element based on the recall element set corresponding to the target user.
[0213] It can be understood that the recommendation-related process specifically includes a recall process and a sorting process. Based on the above embodiment, a recall element set corresponding to the target user has been obtained. Then, in order to determine the final recommendation result, it is also necessary to accurately calculate and sort the weight value of each recall element in the recall element set corresponding to the target user, so as to output the final recommendation result for the target user.
[0214] Based on this, after using the pre-trained model to output the recall element set corresponding to the target user according to the target prompt information, each recall element in the set is obtained.
[0215] Step d2: Calculate the final weight value corresponding to each recalled element according to all historical interaction elements corresponding to the target user, and sort the recalled elements according to the size of each final weight value.
[0216] In this embodiment, based on the acquisition of each recalled element, all historical interaction elements corresponding to the target user are acquired, and the number of times the recalled element appears and the interaction time when it appears are searched in all historical interaction elements. Then, the latest weight value corresponding to each recalled element is further adjusted according to the above number and corresponding interaction time to obtain the final weight value corresponding to each recalled element.
[0217] Based on this, the final weight value corresponding to each recalled element is obtained, and the recalled elements are sorted in order from large to small or from small to large according to the size of each final weight value.
[0218] Step d3: obtaining a second number of recalled elements according to the sorting result, and displaying the second number of recalled elements on an operation interface corresponding to the target user, so as to recommend preference data to the target user.
[0219] The second number is a preset number of selected recalled elements.
[0220] In this embodiment, after obtaining the sorted recalled elements, a preset second quantity is obtained, and recalled elements with larger final weight values are obtained according to the indication of the second quantity to obtain the recalled elements of the second quantity. The recalled elements of the second quantity are then determined as the recommended results for the target user, and are displayed on the operation interface corresponding to the target user, thereby recommending preference data for the target user.
[0221] The preference data recommendation method provided in this embodiment, when recommending preference data for a target user based on a recall element set, obtains each recall element based on the recall element set corresponding to the target user; calculates the final weight value corresponding to each recall element based on all historical interaction elements corresponding to the target user, and sorts each recall element according to the size of each final weight value; obtains a second number of recall elements according to the sorting result, and displays the second number of recall elements on the operation interface corresponding to the target user, so as to recommend preference data to the target user. Since it is necessary to determine the final recommendation result among each recall element, by obtaining each recall element, the final weight value corresponding to each recall element can be calculated according to all historical interaction elements corresponding to the target user. And by sorting each recall element according to the size of each final weight value, the second number of recall elements can be obtained according to the sorting result, and can be displayed on the operation interface corresponding to the target user, thereby completing the process of recommending preference data for the target user, and further improving the success rate of recommendation.
[0222] As an optional embodiment, based on the above embodiment, after displaying the second number of recall elements on the operation interface corresponding to the target user, this embodiment further includes the following steps:
[0223] Step e1: receiving a preference data re-recommendation instruction sent by a target user through a corresponding operation interface of an Internet product, wherein the preference data re-recommendation instruction includes an error recall element that does not match the target user.
[0224] The preference data re-recommendation instruction is an instruction to instruct the electronic device to re-recommend preference data for the target user, and specifically includes an erroneous recall element that does not match the target user.
[0225] Among them, the wrong recalled elements are recalled elements that target users feedback and do not want to be recommended.
[0226] In this embodiment, based on displaying the second number of recall elements on the operation interface corresponding to the target user, the target user determines the erroneous recall elements that do not match him / her according to the display results, and triggers the preference data re-recommendation instruction on the operation interface corresponding to the Internet product based on the determination result, thereby sending the instruction to the electronic device.
[0227] Based on this, the preference data re-recommendation instructions sent by the target user through the corresponding operation interface of the Internet product are received.
[0228] Step e2: re-execute the preference data recommendation process, and reduce the latest weight value corresponding to the falsely recalled element when calculating the latest weight value corresponding to each candidate element, so as to re-recommend the preference data for the target user.
[0229] In this embodiment, based on receiving the preference data re-recommendation instruction, the error recall element stored in the instruction is further obtained, and it is determined to re-execute the preference data recommendation process.
[0230] Specifically, according to the acquired historical interaction element sequence corresponding to the target user, the pre-trained model, the full candidate element set and the preset prompt template, the target prompt information corresponding to the target user is generated, and the target prompt information is input into the pre-trained model. The pre-trained model is used to output the recall element set corresponding to the target user according to the target prompt information, so as to re-recommend the preference data for the target user according to the recall element set. The specific execution method is similar to S202-S204, and will not be repeated here.
[0231] It should be noted that when using the pre-trained model to output the recall element set corresponding to the target user according to the target prompt information, it involves calculating the latest weight value corresponding to each candidate element. In order to avoid recommending the wrong recall element to the target user again, when calculating the latest weight value corresponding to each candidate element, the latest weight value corresponding to the wrong recall element is obtained from each latest weight value, and the latest weight value corresponding to the wrong recall element is reduced.
[0232] The preference data recommendation method provided in this embodiment, after displaying the second number of recall elements on the operation interface corresponding to the target user, receives a preference data re-recommendation instruction sent by the target user through the operation interface corresponding to the Internet product, and the preference data re-recommendation instruction includes the erroneous recall elements that do not match the target user; re-executes the preference data recommendation process, and reduces the latest weight value corresponding to the erroneous recall element when calculating the latest weight value corresponding to each candidate element, so as to re-recommend the preference data to the target user. Since the erroneous recall elements that do not match the target user are stored in the preference data re-recommendation instruction, the erroneous recall elements corresponding to the target user can be obtained by receiving the preference data re-recommendation instruction sent by the target user through the operation interface corresponding to the Internet product, and the preference data recommendation process can be re-executed, so as to reduce the latest weight value corresponding to the erroneous recall element when calculating the latest weight value corresponding to each candidate element, thereby re-recommending the preference data to the target user, solving the problem of recommending erroneous elements caused by the unevenness of each candidate element in the entire candidate element set, and improving the user experience.
[0233] As an optional embodiment, based on the above embodiment, after displaying the second number of recall elements on the operation interface corresponding to the target user, this embodiment further includes the following steps:
[0234] Step f1: in response to at least one recalled element being selected by the target user, the selected recalled element is obtained, and the latest weight value corresponding to the selected recalled element is increased when the preference data is recommended to the target user next time.
[0235] In this embodiment, based on displaying the second number of recalled elements on the operation interface corresponding to the target user, it is determined whether the target user has performed a selection operation in the second number of recalled elements. In response to the existence of at least one recalled element being selected by the target user, indicating that the selected recalled element meets the expectations of the target user, the selected recalled element is obtained, and the latest weight value corresponding to the selected recalled element is increased the next time the preference data is recommended for the target user, for example, when the target user enters the Internet product again, or enters a recommendation scene of the Internet product.
[0236] Step f2: In response to at least one recalled element not being selected by the target user, the unselected recalled elements are acquired, and the latest weight value corresponding to the unselected recalled elements is reduced when the preference data is recommended to the target user next time.
[0237] In this embodiment, based on determining whether the target user has performed a selection operation among the second number of recalled elements, in response to the fact that at least one recalled element has not been selected by the target user, indicating that the selected recalled element does not meet the expectations of the target user, the unselected recalled elements are obtained, and the next time preference data is recommended to the target user, a reduction operation is performed on the latest weight value corresponding to the unselected recalled element.
[0238] The preference data recommendation method provided in this embodiment, after displaying the second number of recall elements on the operation interface corresponding to the target user, in response to at least one recall element being selected by the target user, the selected recall element is obtained, and the latest weight value corresponding to the selected recall element is increased when the preference data is recommended to the target user next time; in response to at least one recall element not being selected by the target user, the unselected recall element is obtained, and the latest weight value corresponding to the unselected recall element is reduced when the preference data is recommended to the target user next time. Since the selection operation of the target user is monitored, the selected recall element can be obtained when it is determined that at least one recall element is selected by the target user, and the latest weight value corresponding to the selected recall element can be increased when the next recommendation is made, and the unselected recall element can be obtained when it is determined that at least one recall element is not selected by the target user, and the latest weight value corresponding to the selected recall element can be reduced when the next recommendation is made, thereby using whether it is selected as a reference for calculating the latest weight value, further improving the accuracy of the recommendation.
[0239] Figure 8 This is a complete flow chart of the preference data recommendation method provided in the embodiment of the present application. Figure 8 As shown, the preference data recommendation method provided in this embodiment includes the following steps:
[0240] S801. Receive a preference data recommendation instruction sent by a target user through a corresponding operation interface of an Internet product.
[0241] S802: Obtain a historical interaction element sequence corresponding to the target user according to the preference data recommendation instruction.
[0242] The historical interaction element sequence is a sequence formed by historical interaction elements that the target user has interacted with within a preset time threshold and are arranged according to the interaction time.
[0243] Among them, the preference data recommendation instruction includes target user information.
[0244] Specifically, when obtaining the historical interaction element sequence corresponding to the target user according to the preference data recommendation instruction, all historical interaction elements corresponding to the target user are obtained according to the target user information. The interaction time corresponding to each historical interaction element is determined, and the historical interaction elements within the preset time threshold are extracted from all the historical interaction elements according to each interaction time. The historical interaction elements within the preset time threshold are sorted to obtain the historical interaction element sequence corresponding to the target user.
[0245] S803, obtaining a pre-trained model, a full candidate element set, and a preset prompt template.
[0246] Among them, the pre-trained model is a model that is pre-trained based on massive data corresponding to Internet products and can understand natural language text. The full candidate element set includes all candidate elements that the target user may interact with. The preset prompt template is a direct recall prompt template or a small amount of learning prompt template. The direct recall prompt template is a template that instructs the pre-trained model to recall directly, and the small amount of learning prompt template is a template that instructs the pre-trained model to recall based on the small amount of learning results.
[0247] S804: Generate target prompt information corresponding to the target user according to the historical interaction element sequence corresponding to the target user, the entire candidate element set, and a preset prompt template.
[0248] Optionally, the preset prompt template is a direct recall prompt template.
[0249] Based on this, when generating target prompt information corresponding to the target user according to the historical interaction element sequence corresponding to the target user, the full candidate element set and the preset prompt template, a preset construction strategy is adopted to construct the first embedding information according to the historical interaction element sequence. The full candidate element set is arranged in a preset order to obtain the second embedding information. The first embedding information and the second embedding information are embedded in the corresponding positions of the direct recall prompt template to generate the target prompt information corresponding to the target user.
[0250] When the first embedding information is constructed according to the historical interaction element sequence using the preset construction strategy, the historical interaction element sequence is obtained, and the latest interaction element is determined based on all the historical interaction elements corresponding to the target user. Context learning is performed according to the historical interaction element sequence and the latest interaction element to obtain a learning result. The historical interaction element sequence, the latest interaction element, and the learning result are determined as the first embedding information.
[0251] Optionally, the preset prompt template is a small number of learning prompt templates.
[0252] Based on this, when generating the target prompt information corresponding to the target user according to the historical interaction element sequence, the full candidate element set and the preset prompt template corresponding to the target user, the preset task description information and the preset format indication information are obtained. The preset task description information and the preset format indication information are embedded in the corresponding position of the small amount of learning prompt template, and the historical interaction element sequence and the full candidate element set are injected based on the embedded small amount of learning prompt template. The injected small amount of learning prompt template is determined as the target prompt information corresponding to the target user.
[0253] The small amount of learning prompt template includes a first prompt part and a second prompt part. When injecting the historical interaction element sequence and the full candidate element set based on the embedded small amount of learning prompt template, the historical interaction element sequence and the full candidate element set are embedded in the first prompt part. The historical recommendation results corresponding to the preset user are obtained, and the historical recommendation results, historical interaction element sequence and the full candidate element set corresponding to the preset user are embedded in the second prompt part.
[0254] S805: Input the target prompt information into the pre-trained model.
[0255] S806: Use the pre-trained model to output a set of recalled elements corresponding to the target user according to the target prompt information.
[0256] Optionally, if the preset prompt template is a direct recall prompt template, when the pre-trained model is used to output the recall element set corresponding to the target user according to the target prompt information, the latest weight value corresponding to each candidate element is calculated based on the pre-trained model according to the indication content of the first embedded information. A first number of candidate elements are obtained from each candidate element according to the size of each latest weight value, and the set formed by the first number of candidate elements is determined as the recall element set corresponding to the target user.
[0257] Optionally, if the preset prompt template is a small number of sampling prompt templates, when the pre-trained model is used to output the recall element set corresponding to the target user according to the target prompt information, the latest weight value corresponding to each candidate element is calculated based on the pre-trained model according to the injected content of the first prompt part, and the first number of candidate elements is obtained from each candidate element according to the size of each latest weight value. The candidate elements to be adjusted are determined from each candidate element according to the injected content of the second prompt part, and the latest weight values corresponding to the candidate elements to be adjusted are adjusted. The first number of candidate elements are updated according to the adjusted latest weight values, and the set formed by the updated first number of candidate elements is determined as the recall element set corresponding to the target user.
[0258] Among them, the pre-trained model includes multiple preset generators, and the preset generators are used to calculate the latest weight values. When calculating the latest weight values corresponding to each candidate element, the latest weight values corresponding to each candidate element are calculated according to the calculation order corresponding to each preset generator to obtain multiple latest weight values corresponding to each candidate element. The average value of the multiple latest weight values corresponding to each candidate element is calculated to obtain the average latest weight value corresponding to each candidate element. The average latest weight value corresponding to each candidate element is determined as the latest weight value corresponding to each candidate element.
[0259] S807: Recommend preference data to the target user according to the recalled element set.
[0260] The preference data is determined according to the final weight value corresponding to each recalled element in the recalled element set.
[0261] Specifically, each recalled element is obtained based on the recalled element set corresponding to the target user. The latest weight value corresponding to each recalled element is calculated again according to all historical interaction elements corresponding to the target user. Each recalled element is sorted according to the size of each latest weight value. A second number of recalled elements is obtained according to the sorting result. The second number of recalled elements is displayed on the operation interface corresponding to the target user.
[0262] S808: Receive a preference data re-recommendation instruction sent by the target user through the corresponding operation interface of the Internet product.
[0263] Among them, the preference data re-recommendation instruction includes an erroneous recall element that does not match the target user.
[0264] S809: Re-execute the preference data recommendation process.
[0265] S810. When calculating the latest weight value corresponding to each candidate element, reduce the latest weight value corresponding to the erroneously recalled element.
[0266] At the same time, S811, determine whether each recalled element is selected by the target user, if so, execute S812-S813, if not, execute S814-S815.
[0267] S812: In response to at least one recall element being selected by the target user, obtain the selected recall element.
[0268] S813. When recommending preference data to the target user next time, increase the latest weight value corresponding to the selected recalled element.
[0269] S814: In response to at least one recalled element not being selected by the target user, obtain the unselected recalled element.
[0270] S815. When recommending preference data to the target user next time, reduce the latest weight value corresponding to the unselected recalled element.
[0271] Fig. 9 This is a schematic diagram of the structure of the preference data recommendation device provided in the embodiment of the present application. Fig. 9 As shown, the preference data recommendation device 90 includes: a receiving module 91, an acquisition module 92, a generation module 93, an input module 94, an output module 95, and a recommendation module 96.
[0272] Among them, the receiving module 91 is used to receive the preference data recommendation instruction sent by the target user through the corresponding operation interface of the Internet product; the acquisition module 92 is used to obtain the historical interaction element sequence corresponding to the target user according to the preference data recommendation instruction; the historical interaction element sequence is a sequence formed by the historical interaction elements that the target user has interacted with within a preset time threshold and arranged according to the interaction time; the acquisition module 92 is also used to obtain the pre-trained model, the full candidate element set and the preset prompt template; the pre-trained model is a model that is pre-trained based on the massive data corresponding to the Internet product and can understand natural language text; the full candidate element set includes all candidate elements that the target user may interact with; the preset prompt template is a direct recall prompt template or a small amount of learning prompt template. The direct recall prompt template is a template that instructs the pre-trained model to directly recall, and the small amount of learning prompt template is a template that instructs the pre-trained model to recall based on the small amount of learning results. A generation module 93 is used to generate target prompt information corresponding to the target user according to the historical interaction element sequence, the full candidate element set and the preset prompt template corresponding to the target user; an input module 94 is used to input the target prompt information into the pre-trained model; an output module 95 is used to output the recall element set corresponding to the target user according to the target prompt information using the pre-trained model; a recommendation module 96 is used to recommend preference data for the target user according to the recall element set, and the preference data is determined according to the final weight value corresponding to each recall element in the recall element set. In some embodiments, the preference data recommendation instruction includes the target user information;
[0273] Accordingly, when acquiring the historical interaction element sequence corresponding to the target user according to the preference data recommendation instruction, the acquisition module 92 is specifically configured to:
[0274] All historical interaction elements corresponding to the target user are obtained according to the target user information; the interaction time corresponding to each historical interaction element is determined, and the historical interaction elements within a preset time threshold are extracted from all historical interaction elements according to each interaction time; the historical interaction elements within the preset time threshold are sorted to obtain a historical interaction element sequence corresponding to the target user.
[0275] In some embodiments, the preset prompt template is a direct recall prompt template;
[0276] Accordingly, when generating target prompt information corresponding to the target user according to the historical interaction element sequence corresponding to the target user, the entire candidate element set and the preset prompt template, the generating module 93 is specifically used to:
[0277] A preset construction strategy is adopted to construct the first embedding information according to the historical interaction element sequence; the entire candidate element set is arranged in a preset order to obtain the second embedding information; the first embedding information and the second embedding information are embedded in the corresponding positions of the direct recall prompt template to generate the target prompt information corresponding to the target user.
[0278] In some embodiments, when the generation module 93 adopts a preset construction strategy to construct the first embedded information according to the historical interactive element sequence, it is specifically used to:
[0279] Acquire a historical interaction element sequence, and determine a latest interaction element based on all historical interaction elements corresponding to a target user; perform context learning based on the historical interaction element sequence and the latest interaction element to obtain a learning result; determine the historical interaction element sequence, the latest interaction element, and the learning result as first embedding information.
[0280] In some embodiments, when the output module 95 uses the pre-trained model to output the recall element set corresponding to the target user according to the target prompt information, it is specifically used to:
[0281] Based on the pre-trained model, the latest weight value corresponding to each candidate element is calculated according to the indication content of the first embedded information; according to the size of each latest weight value, a first number of candidate elements are obtained from each candidate element, and the set formed by the first number of candidate elements is determined as the recall element set corresponding to the target user.
[0282] In some embodiments, the preset prompt template is a small number of learning prompt templates;
[0283] Accordingly, when generating target prompt information corresponding to the target user according to the historical interaction element sequence corresponding to the target user, the entire candidate element set and the preset prompt template, the generating module 93 is specifically used to:
[0284] Obtain preset task description information and preset format indication information; embed the preset task description information and preset format indication information into corresponding positions of a small number of learning prompt templates, and inject a historical interaction element sequence and a full candidate element set based on the embedded small number of learning prompt templates; determine the injected small number of learning prompt templates as target prompt information corresponding to the target user.
[0285] In some embodiments, the small amount of learning prompt template includes a first prompt portion and a second prompt portion;
[0286] Accordingly, when injecting the historical interaction element sequence and the full candidate element set based on the embedded small amount of learning prompt templates, the generating module 93 is specifically used to:
[0287] The historical interaction element sequence and the entire candidate element set are embedded in the first prompt part; the historical recommendation results corresponding to the preset user are obtained, and the historical recommendation results, the historical interaction element sequence and the entire candidate element set corresponding to the preset user are embedded in the second prompt part.
[0288] In some embodiments, when the output module 95 uses the pre-trained model to output the recall element set corresponding to the target user according to the target prompt information, it is specifically used to:
[0289] Based on the pre-trained model, the latest weight value corresponding to each candidate element is calculated according to the injected content of the first prompt part, and a first number of candidate elements is obtained from each candidate element according to the size of each latest weight value; the candidate elements to be adjusted are determined from each candidate element according to the injected content of the second prompt part, and the latest weight values corresponding to the candidate elements to be adjusted are adjusted; the first number of candidate elements are updated according to the adjusted latest weight values, and the set formed by the updated first number of candidate elements is determined as the recall element set corresponding to the target user.
[0290] In some embodiments, the pre-trained model includes a plurality of preset generators, and the preset generators are used to calculate the latest weight values;
[0291] Accordingly, when calculating the latest weight value corresponding to each candidate element, the output module 95 is specifically used to:
[0292] The latest weight value corresponding to each candidate element is calculated according to the calculation order corresponding to each preset generator to obtain multiple latest weight values corresponding to each candidate element; the average value of the multiple latest weight values corresponding to each candidate element is calculated to obtain the average latest weight value corresponding to each candidate element; the average latest weight value corresponding to each candidate element is determined as the latest weight value corresponding to each candidate element.
[0293] Optionally, the recommendation module 96, when recommending preference data for a target user according to the recalled element set, is specifically configured to:
[0294] Acquire each recalled element based on the recalled element set corresponding to the target user; recalculate the latest weight value corresponding to each recalled element according to all historical interaction elements corresponding to the target user, and sort each recalled element according to the size of each latest weight value; acquire a second number of recalled elements according to the sorting result, and display the second number of recalled elements on the operation interface corresponding to the target user, so as to recommend preference data to the target user.
[0295] The preference data recommendation device provided in this embodiment further includes: an execution module and a reduction module.
[0296] Among them, the receiving module 91 is also used to receive the preference data re-recommendation instruction sent by the target user through the corresponding operation interface of the Internet product after the display module displays the second number of recalled elements on the operation interface corresponding to the target user, and the preference data re-recommendation instruction includes the erroneous recalled elements that do not match the target user; the execution module is used to re-execute the preference data recommendation process, and the reduction module is used to reduce the latest weight value corresponding to the erroneous recalled element when calculating the latest weight value corresponding to each candidate element, so as to re-recommend the preference data to the target user.
[0297] The preference data recommendation device provided in this embodiment further includes: an improvement module.
[0298] Among them, the acquisition module 92 is also used to, after the display module displays the second number of recall elements on the operation interface corresponding to the target user, in response to at least one recall element being selected by the target user, acquire the selected recall element, and the improvement module is used to increase the latest weight value corresponding to the selected recall element when recommending preference data to the target user next time; the acquisition module 92 is also used to, in response to at least one recall element not being selected by the target user, acquire the unselected recall elements, and the reduction module is also used to reduce the latest weight value corresponding to the unselected recall element when recommending preference data to the target user next time.
[0299] The preference data recommendation device provided in the embodiment of the present application can be used to execute the technical solution of the preference data recommendation method in the above embodiment. Its implementation principle and technical effect are similar and will not be repeated here.
[0300] It should be noted that it should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software called by processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. For example, the acquisition module 92 can be a separately established processing element, or it can be integrated in a chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and called and executed by a processing element of the above device. The function of the above acquisition module 92. The implementation of other modules is similar. In addition, all or part of these modules can be integrated together, or they can be implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.
[0301] Fig.10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Fig.10 As shown, the electronic device may include: a transceiver 1001 , a processor 1002 , and a memory 1003 .
[0302] The processor 1002 executes the computer execution instructions stored in the memory, so that the processor 1002 executes the scheme in the above embodiment. The processor 1002 can be a general-purpose processor, including a central processing unit CPU, a network processor (network processor, NP), etc.; it can also be a digital signal processor DSP, an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0303] The memory 1003 is connected to the processor 1002 via a system bus and completes communication between them. The memory 1003 is used to store computer program instructions.
[0304] The transceiver 1001 may be used to transmit and receive data.
[0305] The system bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The system bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The transceiver is used to realize the communication between the database access device and other computers (such as clients, read-write libraries, and read-only libraries). The memory may include random access memory (RAM) and may also include non-volatile memory.
[0306] The electronic device provided in the embodiment of the present application may be the terminal device of the above embodiment.
[0307] An embodiment of the present application also provides a chip for running instructions, which is used to execute the technical solution of the preference data recommendation method in the above embodiment.
[0308] An embodiment of the present application further provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on a computer, the computer executes the technical solution of the preference data recommendation method of the above embodiment.
[0309] An embodiment of the present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When at least one processor executes the computer program, it can implement the technical solution of the preference data recommendation method in the above embodiment.
[0310] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.
[0311] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to implement the solution of this embodiment.
[0312] In addition, each functional module in each embodiment of the present application can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The above-mentioned module-composed unit can be implemented in the form of hardware or in the form of hardware plus software functional units.
[0313] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the methods of various embodiments of the present application.
[0314] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor.
[0315] The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk or an optical disk, etc.
[0316] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.
[0317] The above storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special purpose computer.
[0318] An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the storage medium can also exist as discrete components in an electronic control unit or a main control device.
[0319] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0320] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for recommending preference data, characterized in that: include: Receiving a preference data recommendation instruction sent by a target user through a corresponding operation interface of an Internet product, and acquiring a historical interaction element sequence corresponding to the target user according to the preference data recommendation instruction; the historical interaction element sequence is a sequence formed by historical interaction elements that the target user has interacted with within a preset time threshold and are arranged according to the interaction time; Get the pre-trained model, the full candidate element set, and the preset prompt template; The pre-trained model is a model that is pre-trained based on massive data corresponding to Internet products and can understand natural language text; the full candidate element set includes all candidate elements that the target user may interact with; The preset prompt template is a direct recall prompt template or a small amount of learning prompt template; The direct recall prompt template is a template that instructs the pre-trained model to directly recall, and the small amount of learning prompt template is a template that instructs the pre-trained model to recall based on a small amount of learning results; Generate target prompt information corresponding to the target user according to the historical interaction element sequence corresponding to the target user, the full candidate element set and the preset prompt template; Inputting the target prompt information into a pre-trained model, and using the pre-trained model to output a set of recall elements corresponding to the target user according to the target prompt information; Preference data is recommended for a target user according to the recalled element set, wherein the preference data is determined according to a final weight value corresponding to each recalled element in the recalled element set.
2. The method according to claim 1, characterized in that The preference data recommendation instruction includes target user information; The acquiring a historical interaction element sequence corresponding to the target user according to the preference data recommendation instruction includes: Acquire all historical interaction elements corresponding to the target user according to the target user information; Determine the interaction time corresponding to each historical interaction element, and extract the historical interaction elements within a preset time threshold from all the historical interaction elements according to each interaction time; The historical interaction elements within the preset time threshold are sorted to obtain a historical interaction element sequence corresponding to the target user.
3. The method according to claim 2, characterized in that The preset prompt template is a direct recall prompt template; The generating target prompt information corresponding to the target user according to the historical interaction element sequence corresponding to the target user, the full candidate element set and the preset prompt template includes: Constructing first embedded information according to the historical interaction element sequence using a preset construction strategy; Arranging the entire candidate element set in a preset order to obtain second embedding information; The first embedded information and the second embedded information are embedded in corresponding positions of the direct recall prompt template to generate target prompt information corresponding to the target user.
4. The method according to claim 3, characterized in that The step of constructing the first embedded information according to the historical interactive element sequence by using a preset construction strategy includes: Acquire the historical interaction element sequence, and determine the latest interaction element based on all historical interaction elements corresponding to the target user; Performing context learning according to the historical interaction element sequence and the latest interaction element to obtain a learning result; The historical interaction element sequence, the latest interaction element and the learning result are determined as first embedded information.
5. The method according to claim 4, characterized in that The using the pre-trained model to output a recall element set corresponding to the target user according to the target prompt information includes: Calculate the latest weight value corresponding to each candidate element based on the pre-trained model according to the indication content of the first embedded information; A first number of candidate elements are obtained from each candidate element according to the size of each latest weight value, and a set formed by the first number of candidate elements is determined as a recall element set corresponding to the target user.
6. The method according to claim 2, characterized in that The preset prompt template is a small number of learning prompt templates; The generating target prompt information corresponding to the target user according to the historical interaction element sequence corresponding to the target user, the full candidate element set and the preset prompt template includes: Obtaining preset task description information and preset format instruction information; Embed the preset task description information and the preset format indication information into the corresponding position of the small amount of learning prompt template, and inject the historical interaction element sequence and the full candidate element set based on the embedded small amount of learning prompt template; The injected small amount of learning prompt templates are determined as target prompt information corresponding to the target user.
7. The method according to claim 6, characterized in that The small amount of learning prompt template includes a first prompt part and a second prompt part; The embedding-based small amount of learning prompt templates injects historical interaction element sequences and all candidate element sets, including: Embed the historical interaction element sequence and the full candidate element set into the first prompt part; The historical recommendation results corresponding to the preset user are obtained, and the historical recommendation results corresponding to the preset user, the historical interaction element sequence, and the entire candidate element set are embedded in the second prompt part.
8. The method according to claim 7, characterized in that The using the pre-trained model to output a recall element set corresponding to the target user according to the target prompt information includes: Calculating the latest weight value corresponding to each candidate element according to the injected content of the first prompt part based on the pre-trained model, and obtaining a first number of candidate elements from each candidate element according to the size of each latest weight value; Determine a candidate element to be adjusted from among the candidate elements according to the injected content of the second prompt part, and adjust the latest weight value corresponding to the candidate element to be adjusted; The first number of candidate elements is updated according to the adjusted latest weight value, and a set formed by the updated first number of candidate elements is determined as a recall element set corresponding to the target user.
9. The method according to claim 5 or 8, characterized in that: The pre-training model includes a plurality of preset generators, and the preset generators are used to calculate the latest weight values; The calculating the latest weight value corresponding to each candidate element includes: Calculate the latest weight value corresponding to each candidate element according to the calculation order corresponding to each preset generator to obtain multiple latest weight values corresponding to each candidate element; Calculate the average value of multiple latest weight values corresponding to each candidate element to obtain the average latest weight value corresponding to each candidate element; The average latest weight value corresponding to each candidate element is determined as the latest weight value corresponding to each candidate element.
10. The method according to claim 5 or 8, characterized in that: The recommending preference data for the target user according to the recalled element set includes: Acquire each recall element based on the recall element set corresponding to the target user; Calculate the final weight value corresponding to each recall element according to all historical interaction elements corresponding to the target user, and sort the recall elements according to the size of each final weight value; A second number of recalled elements is obtained according to the sorting result, and the second number of recalled elements is displayed on an operation interface corresponding to the target user to recommend preference data to the target user.
11. The method according to claim 10, characterized in that After displaying the second number of recall elements on the operation interface corresponding to the target user, the method further includes: receiving a preference data re-recommendation instruction sent by a target user through an operation interface corresponding to an Internet product, wherein the preference data re-recommendation instruction includes an error recall element that does not match the target user; The preference data recommendation process is re-executed, and the latest weight value corresponding to the erroneously recalled element is reduced when calculating the latest weight value corresponding to each candidate element, so as to re-recommend the preference data for the target user.
12. The method according to claim 10, characterized in that After displaying the second number of recall elements on the operation interface corresponding to the target user, the method further includes: In response to at least one recalled element being selected by the target user, the selected recalled element is obtained, and a latest weight value corresponding to the selected recalled element is increased when the preference data is recommended to the target user next time; In response to at least one recalled element not being selected by the target user, the unselected recalled element is acquired, and the latest weight value corresponding to the unselected recalled element is reduced when the preference data is recommended to the target user next time.
13. A preference data recommendation device, characterized in that: include: A receiving module, used to receive a preference data recommendation instruction sent by a target user through a corresponding operation interface of an Internet product; An acquisition module, configured to acquire a historical interaction element sequence corresponding to a target user according to the preference data recommendation instruction; the historical interaction element sequence is a sequence formed by historical interaction elements that the target user has interacted with within a preset time threshold and are arranged according to interaction time; The acquisition module is also used to acquire a pre-trained model, a full candidate element set, and a preset prompt template; The pre-trained model is a model that is pre-trained based on massive data corresponding to Internet products and can understand natural language text; The full candidate element set includes all candidate elements that the target user may interact with; The preset prompt template is a direct recall prompt template or a small amount of learning prompt template; The direct recall prompt template is a template that instructs the pre-trained model to directly recall, and the small amount of learning prompt template is a template that instructs the pre-trained model to recall based on a small amount of learning results; A generating module, configured to generate target prompt information corresponding to the target user according to the historical interaction element sequence corresponding to the target user, the full candidate element set and the preset prompt template; An input module, used for inputting the target prompt information into a pre-trained model; An output module, used to output a recall element set corresponding to a target user according to target prompt information using the pre-trained model; The recommendation module is used to recommend preference data to a target user according to the recalled element set, wherein the preference data is determined according to a final weight value corresponding to each recalled element in the recalled element set.
14. An electronic device, characterized in that: include: A processor, a memory and a transceiver communicatively connected to the processor; The memory stores computer-executable instructions; the transceiver is used to send and receive data; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 12.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 12 when executed by a processor.
16. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 12 when being executed by a processor.
Citation Information
Patent Citations
Content recommendation method and device, electronic equipment and storage medium
CN116955817A
Sequence recommendation method and device
CN117909592A
Recommendation method and device, electronic equipment and computer readable storage medium
CN118069827A
Method for presenting information, electronic device, and storage medium
US20220300573A1
