Multi-task recommendation method, device, terminal and medium based on user evaluation information
Through a multi-task recommendation method based on user evaluation information, using multi-task prompt word templates and conditional optimal transmission algorithm training model, the problem of only single recommendation task in the existing technology is solved, and efficient processing of multiple recommendation tasks is achieved and improve accuracy.
Patent Information
- Application Number
- CN202410359262.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-27
- Publication Date
- 2025-01-17
- Estimated Expiration
- 2044-03-27
AI Technical Summary
The existing recommendation system algorithm can only recommend a single recommendation task and cannot meet the needs of multiple recommendation tasks.
Through a multi-task recommendation method based on user evaluation information, a pre-constructed multi-task prompt word template and conditional optimal transmission algorithm is used to train a multi-task recommendation model, and recommendation results can be generated for multiple recommended tasks.
It realizes that a model can complete multiple recommendation tasks at the same time, such as score prediction, sequential recommendation, explanation generation and comment summary, improving the diversified task processing capability and accuracy of the recommendation system.
Smart Images

Figure CN118260411B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of language model technology, and in particular to a multi-task recommendation method, device, terminal and medium based on user evaluation information. Background Art
[0002] In the existing large language model recommendation system, its powerful generalization and reasoning capabilities are mainly used to allow it to understand the relationship between a single user and an item, and thus infer the items that the user may be interested in. However, there are many tasks for recommendation system algorithms, and traditional recommendation system algorithms usually only target one of the multiple tasks. One recommendation algorithm can only complete one recommendation task, and multiple recommendation algorithms are required to achieve multiple recommendation tasks. In other words, traditional recommendation algorithms can only make recommendations for a single recommendation task.
[0003] Therefore, the prior art has defects and needs to be improved and developed. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a multi-task recommendation method, device, terminal and medium based on user evaluation information in view of the above-mentioned defects of the prior art, aiming to solve the problem that the recommendation algorithm in the prior art can only make recommendations for a single recommendation task.
[0005] The technical solution adopted by the present invention to solve the technical problem is as follows:
[0006] A multi-task recommendation method based on user evaluation information, the method comprising:
[0007] Determine the current recommended task and obtain the user evaluation information required for the current recommended task;
[0008] Acquire a pre-built multi-task prompt word template, wherein the multi-task prompt word template includes a correspondence between a plurality of recommended tasks and the prompt word template;
[0009] Searching for the multi-task prompt word template to obtain a target prompt word template corresponding to the current recommended task;
[0010] The user evaluation information and the target prompt word template are input into a pre-trained multi-task recommendation model to obtain a recommendation result corresponding to the current recommendation task.
[0011] In one implementation, the multiple recommendation tasks include: rating prediction, sequential recommendation, explanation generation, comment summary and direct recommendation; the user evaluation information includes: one or more of: user identification, item identification of the evaluated item, rating of the evaluated item, comment record of the evaluated item and number of comment likes of the comment record.
[0012] In one implementation, the training step of the multi-task recommendation model includes:
[0013] Obtaining a training data set, wherein the training data set includes user evaluation data corresponding to a number of users;
[0014] Determine the optimal distance between each user and other users using a conditional optimal transmission algorithm according to each of the user evaluation data;
[0015] Determine a similar user set corresponding to each user according to the optimal distance;
[0016] Obtain a pre-built multi-task prompt word template and a pre-selected initial multi-task recommendation model;
[0017] The initial multi-task recommendation model is trained by using the user evaluation data of each user in the training data set, the similar user set corresponding to the user, and the multi-task prompt word template to obtain a trained multi-task recommendation model.
[0018] In one implementation, the user evaluation data includes: a user ID, and an item ID of an evaluated item corresponding to the user ID, a score of the evaluated item, a comment record of the evaluated item, and the number of comment likes for each comment record.
[0019] In one implementation, determining the optimal distance between each user and other users using a conditional optimal transmission algorithm based on each user evaluation data includes:
[0020] Obtain a user set according to all user identifiers in the training data set, and obtain an item set according to all item identifiers in the training data set;
[0021] A rating matrix is obtained based on the ratings and comment records, and a usefulness matrix is obtained based on the number of likes on the comments. The rating matrix is used to reflect the ratings of each user in the user set on each item in the item set, and the usefulness matrix is used to reflect the usefulness of each comment record;
[0022] Obtaining the probability distribution of preferences of each user in the user set for all items in the item set according to the rating matrix and the usefulness matrix;
[0023] According to the probability distribution of preferences of each user, the optimal distance between each user and other users is calculated using the conditional optimal transmission algorithm.
[0024] In one implementation, determining a similar user set corresponding to each user according to the optimal distance includes:
[0025] For each user, sort the optimal distances between the user and other users in ascending order to obtain a sorting result;
[0026] A preset number of other users ranked first are selected from the ranking results as similar users of the user, and a similar user set corresponding to the user is obtained.
[0027] In one implementation, the initial multi-task recommendation model is trained using the user evaluation data of each user in the training data set, the similar user set corresponding to the user, and the multi-task prompt word template to obtain the trained multi-task recommendation model, including:
[0028] When training is performed using the training data set, matching information required for each recommendation task is selected from the user evaluation data of each user, wherein the matching information includes one or more of: a user ID, an item ID of an evaluated item corresponding to the user ID, a score of the evaluated item, a comment record of the evaluated item, and a number of comment likes for each comment record;
[0029] Input the matching information required for each recommendation task, the prompt word template corresponding to each recommendation task, and the similar user set corresponding to each user into the initial multi-task recommendation model, and train the initial multi-task recommendation model with a preset negative log-likelihood loss function as a target to obtain a trained multi-task recommendation model;
[0030] The initial multi-task recommendation model is a large language model.
[0031] The present invention also discloses a multi-task recommendation device based on user evaluation information, the device comprising:
[0032] A determination module, used to determine the current recommendation task and obtain the user evaluation information required for the current recommendation task;
[0033] An acquisition module, used to acquire a pre-built multi-task prompt word template, wherein the multi-task prompt word template includes a correspondence between a plurality of recommended tasks and the prompt word template;
[0034] A search module, used to search the multi-task prompt word template to obtain a target prompt word template corresponding to the current recommended task;
[0035] The input module is used to input the user evaluation information and the target prompt word template into a pre-trained multi-task recommendation model to obtain a recommendation result corresponding to the current recommendation task.
[0036] The present invention also discloses a terminal, comprising: a memory, a processor, and a multi-task recommendation program based on user evaluation information stored in the memory and executable on the processor, wherein the multi-task recommendation program based on user evaluation information implements the steps of the multi-task recommendation method based on user evaluation information as described above when executed by the processor.
[0037] The present invention also discloses a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program can be executed to implement the steps of the multi-task recommendation method based on user evaluation information as described above.
[0038] The present invention provides a multi-task recommendation method, device, terminal and medium based on user evaluation information, the method comprising: determining the current recommendation task and obtaining the user evaluation information required for the current recommendation task; obtaining a pre-constructed multi-task prompt word template, the multi-task prompt word template including the correspondence between multiple recommendation tasks and prompt word templates; searching the multi-task prompt word template to obtain a target prompt word template corresponding to the current recommendation task; inputting the user evaluation information and the target prompt word template into a pre-trained multi-task recommendation model to obtain a recommendation result corresponding to the current recommendation task. The present invention pre-constructs prompt word templates for multiple recommendation tasks, searches for matching templates when performing recommendation tasks, and obtains recommendation results based on the matching templates, so that multiple recommendation tasks can be implemented through one model, and recommendations can be made for multiple recommendation tasks. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 is a flow chart of a preferred embodiment of a multi-task recommendation method based on user evaluation information in the present invention;
[0040] Figure 2 1 is a diagram of a method for calculating and selecting user distances in a multi-task recommendation method based on user evaluation information of the present invention;
[0041] Figure 3 is a training schematic diagram of a multi-task recommendation method based on user evaluation information of the present invention;
[0042] Figure 4 It is a comparison of the performance of the score prediction task on three datasets;
[0043] Figure 5 It is a comparison of the performance of sequential recommendation tasks on three datasets;
[0044] Figure 6 It is to explain the performance comparison of generation tasks on three datasets;
[0045] Figure 7 It is a comparison of review summary task performance on three datasets;
[0046] Figure 8 It is a direct comparison of recommendation task performance on three datasets;
[0047] Fig. 9 It is a functional principle block diagram of a preferred embodiment of a multi-task recommendation device based on user evaluation information in the present invention;
[0048] Fig.10 It is a functional principle block diagram of a preferred embodiment of the terminal in the present invention. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solution and advantages of the present invention clearer and more specific, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0050] See also Figure 1 , Figure 1 is a flow chart of the multi-task recommendation method based on user evaluation information in the present invention. Figure 1 As shown, the multi-task recommendation method based on user evaluation information according to the embodiment of the present invention includes:
[0051] Step S100: determine the current recommended task, and obtain user evaluation information required for the current recommended task.
[0052] When making recommendations in the embodiment of the present application, the currently performed recommended task is first selected. For example, the system provides multiple recommended task options, and the currently required recommended task is selected.
[0053] like Figure 1 As shown, the multi-task recommendation method based on user evaluation information described in this embodiment also includes:
[0054] Step S200: obtaining a pre-built multi-task prompt word template, wherein the multi-task prompt word template includes a correspondence between a plurality of recommended tasks and the prompt word template.
[0055] In a preferred embodiment of the present application, multiple recommendation tasks include: rating prediction, sequential recommendation, explanation generation, comment summary and direct recommendation; the user evaluation information includes: one or more of: user identification, item identification of the evaluated item, rating of the evaluated item, comment record of the evaluated item and number of comment likes in the comment record.
[0056] In one embodiment, the multi-task prompt template is shown in Table 1:
[0057] Recommended tasks Template Examples Rating prediction "How many stars would user_{} give item_{}? (1 is the lowest, 5 is the highest)" Sequential recommendation "Given the following purchase history of a user:\n{}\nPredict the next item the user might buy?" Explanation Generation "Generate explanation for user _{} about this product: {}" Review Summary "Write a short sentence summarizing the following user review of product_{}:" Direct referral "Is it possible for user_{} to interact with item_{}?"
[0058] Table 1
[0059] Specifically, the user identifier is the user ID, and the item identifier of the evaluated item is the item ID. For rating prediction, the user ID and item ID are input to predict the user's rating of the item; for sequential recommendation, the user's interaction history is input to predict the item ID that the user will buy next; for explanation generation, the user ID and item ID are input to generate the user's explanation of the item; for review summary, the user ID and the user's complete review of an item are input to generate a summary of the review; for direct recommendation, the user ID is input to directly predict the item that the user will buy next, or the user's review of an item is input to determine whether the user likes the item.
[0060] For each major task category, at least ten prompt word templates can be designed, matched according to different scenarios and input data, and then input into the large language model, and its reasoning and generation capabilities can be used for recommendation, which can meet different types of recommendation tasks. This solves the problem that the existing technology has a single function and can only complete a single task in the recommendation task, and cannot meet the diverse recommendation tasks.
[0061] like Figure 1 As shown, the multi-task recommendation method based on user evaluation information described in this embodiment also includes:
[0062] Step S300: searching the multi-task prompt word template to obtain a target prompt word template corresponding to the current recommended task.
[0063] The embodiment of the present application obtains a target prompt word template corresponding to the current recommendation task, so that after the multi-task recommendation model is subsequently input, the user evaluation information is filled into the target prompt word template, so that the model can generate text that meets expectations.
[0064] like Figure 1 As shown, the multi-task recommendation method based on user evaluation information described in this embodiment also includes:
[0065] Step S400: input the user evaluation information and the target prompt word template into a pre-trained multi-task recommendation model to obtain a recommendation result corresponding to the current recommendation task.
[0066] The embodiment of the present application designs prompt word templates for various recommendation tasks, so that various recommendation tasks can be implemented through one model.
[0067] In the existing methods, for multiple users, the inputs are independent and unrelated data, which is extremely dependent on the ability of the large language model itself, so that the effect of the existing large language model recommendation system is not ideal. Specifically, since the traditional recommendation system algorithm usually targets one of the multiple types of tasks, the traditional recommendation system algorithms mainly include: collaborative filtering recommendation, content-based recommendation and knowledge-based recommendation. Since the large language model has strong generalization and reasoning capabilities, researchers now begin to adjust the large language model in the recommendation scenario. There are mainly two ways to make recommendations directly by calling the large language model interface, or to fine-tune the large language model to meet the various tasks of the recommendation system algorithm. Therefore, the traditional recommendation algorithm has the following problems: First, it does not really apply the reasoning or generation capabilities of the large language model, but only increases the model parameters; second, the function is single, and it can only complete the sequential recommendation task in the recommendation task, and cannot meet the diversified recommendation tasks; third, the method of calling the large language model interface and not training it has poor effect in the untrained large language model; fourth, the method of fine-tuning the large language model does not pay attention to the relevant information between users, and completely lets the large language model communicate, which cannot achieve good results.
[0068] Therefore, the embodiment of the present application combines the Conditional Optimal Transport algorithm with the large language model recommendation system algorithm to propose a multi-task recommendation model. The training steps of the multi-task recommendation model include:
[0069] Step A10: obtaining a training data set, wherein the training data set includes user evaluation data corresponding to a number of users;
[0070] Step A20: Determine the optimal distance between each user and other users using a conditional optimal transmission algorithm according to the user evaluation data;
[0071] Step A30: determining a similar user set corresponding to each user according to the optimal distance;
[0072] Step A40: obtaining a pre-built multi-task prompt word template and a pre-selected initial multi-task recommendation model;
[0073] Step A50: train the initial multi-task recommendation model using the user evaluation data of each user in the training data set, the similar user set corresponding to the user, and the multi-task prompt word template to obtain a trained multi-task recommendation model.
[0074] The embodiment of the present application combines the conditional optimal transmission theory with the large language model recommendation system algorithm, deeply mines the useful information of user comments, connects the similarities between users through quantification, and provides more user information for the large language model recommendation system, so that it can better understand the connection between users, accurately reflect the real similarities between users, and provide users with more accurate recommendation information. At the same time, it solves the drawback that the existing recommendation system can only make recommendations for a single recommendation task. It further solves the problem that the existing large language model is used in the recommendation system algorithm, which only relies on the large language model's own understanding ability and ignores the similarities between recommended users, resulting in poor results, and greatly improves the accuracy of the application of the large language model in the recommendation system.
[0075] In one embodiment of the present application, the user evaluation data includes: a user ID, and the item ID of the evaluated item corresponding to the user ID, the score of the evaluated item, the comment record of the evaluated item, and the number of comment likes for each comment record.
[0076] Specifically, the embodiment of the present application first obtains user evaluation data, pre-processes similarity data between users, and then fine-tunes the large language model. By utilizing the reasoning and generation capabilities of the large language model, originally independent users are connected through user similarity distances, so that the large language model can learn patterns from the user evaluation data that has been learned and generate different results for different recommendation tasks.
[0077] In the embodiment of the present application, the step A20 specifically includes:
[0078] Step A21, obtaining a user set according to all user identifiers in the training data set, and obtaining an item set according to all item identifiers in the training data set;
[0079] Step A22: obtaining a rating matrix according to the ratings and comment records, and obtaining a usefulness matrix according to the number of likes on the comments, wherein the rating matrix is used to reflect the ratings of each user in the user set on each item in the item set, and the usefulness matrix is used to reflect the usefulness of each comment record;
[0080] Step A23, obtaining the probability distribution of preferences of each user in the user set for all items in the item set according to the rating matrix and the usefulness matrix;
[0081] Step A24: According to the probability distribution of preferences of each user, the optimal distance between each user and other users is calculated using the conditional optimal transmission algorithm.
[0082] Specifically, through user review data, we can get a user set U and an item set I. The interaction between items and users is represented by a rating matrix Definition: This matrix stores the number of stars of the user's rating. In the embodiment of the present application, for each comment record, the number of likes of the comment is used as the usefulness of the comment, which is expressed as the usefulness matrix
[0083] like Figure 2 As shown, for one user u a ∈U and its set of scoring items I a ∈I, with dimension n. These rating records reflect the user's preferences. If a user rates two items, giving one of them one star and the other five stars, then the user is obviously more interested in the five-star item. In addition, rated items are always more popular than unrated items. At the same time, taking into account the number of likes of other users for the comments as credibility, the user's preferences can be quantitatively described as:
[0084]
[0085] in represents the probability distribution of user a’s preferences. Derive user u of size m b ∈U’s preference probability distribution b. Let x i is the embedding position of item i (obtained by the average of the item description embeddings). The preference distributions of the two users are:
[0086]
[0087] The present invention measures the behavior similarity between two users by the distance between two distributions. Due to the sparsity of user preferences, it is difficult to use KL divergence to measure the distance between two users.
[0088] Therefore, the embodiment of the present application uses conditional optimal transmission (COT) to model the user distance measurement. For each item set size n, m specific user pairs (u a ,u b ), the goal is to find the optimal solution The similarity between users is calculated using the following formula:
[0089]
[0090] in, is the distance matrix between the rated items, and 〈·,·〉 is the inner product. Here, features are captured from the original data and the item distance is calculated by the cosine similarity of their embeddings. Since a and b are probability distributions of preferences, the optimal distance with Kantorovich problem can be found as:
[0091]
[0092]
[0093] Applies the Sinkhorn distance, which uses entropy constraints and Lagrange multipliers for fast optimization.
[0094]
[0095]
[0096] Here h(Γ)=-∑Γ i,j log(Γ i,j ) is the entropy term, and λ is a hyperparameter. Thus, the Lagrangian equation is obtained.
[0097]
[0098] And, the minimum of the Lagrangian function is achieved when the gradient is equal to zero. Therefore, the partial derivatives of each element of Γ are calculated to ensure that the function reaches its minimum when these partial derivatives are equal to zero.
[0099]
[0100] Written in matrix form, the solution is given by:
[0101] Γ λ =diag(φ t )exp(-λD)diag(ψ t )
[0102] Where t represents the number of iterations, The iterative functions of and ψ are given by
[0103] φ t =a / ((exp(-λD)φ t-1 )and Given, the initial value ψ 0 =1 m , and update them in an alternating manner until convergence.
[0104] The embodiment of the present application trains the large language model in the current data set by using the method of fine-tuning all parameters. The training data contains data of multiple recommendation tasks, and different recommendation methods focus on different user preferences, so as to fully understand and learn user behavior. This solves the problem that the method of calling the large language model interface without training it in the prior art has poor effect in the untrained large language model.
[0105] In one embodiment of the present application, step A30 specifically includes:
[0106] Step A31: for each user, sort the optimal distances between the user and other users in ascending order to obtain a sorting result;
[0107] Step A32: Select a preset number of other users ranked first from the ranking results as similar users of the user, and obtain a similar user set corresponding to the user.
[0108] Specifically, the calculated optimal distance will be stored in the user preference distance matrix In the above example, the user with the smallest distance in the preference is selected as the most similar or closest user. Each user has an optimal distance with other users in the user set (i.e., matching users). The smaller the optimal distance, the higher the similarity between the user and other users. Therefore, the optimal distance is sorted from small to large, and the first K users are selected as similar users, so as to serve as enhanced prompts for the user in the future.
[0109] In one embodiment of the present application, step A50 specifically includes:
[0110] Step A51: When training with the training data set, select matching information required for each recommendation task from the user evaluation data of each user, wherein the matching information includes one or more of: a user ID, an item ID of the evaluated item corresponding to the user ID, a score of the evaluated item, a comment record of the evaluated item, and a number of likes for each comment record;
[0111] Step A52: input the matching information required for each recommendation task, the prompt word template corresponding to each recommendation task, and the similar user set corresponding to each user into the initial multi-task recommendation model, and train the initial multi-task recommendation model with a preset negative log-likelihood loss function as the target to obtain a trained multi-task recommendation model.
[0112] The initial multi-task recommendation model is a large language model.
[0113] Specifically, the evaluation information is matched with various prompt word templates. After obtaining the optimal distance, a series of recommendation tasks, including rating, sequential recommendation, explanation, summary, and direct recommendation, are incorporated into a unified framework, and each task contains user-item interaction information from different aspects. Then, templates are designed from user evaluation data, including input and output templates and prompt settings for zero-shot recommendation.
[0114] According to different tasks, interactive attributes are selectively extracted from the user evaluation data of similar users to form adaptive prompt words. Rating prediction refers to the task of predicting the user's rating for a given item. In this task, the existing ratings of similar users on the target item are added to the prompt to predict the direct score of the item. Sequential recommendation involves suggesting the next item to the user based on the user's historical behavior. It captures the temporal dynamics of user preferences and is crucial to improving the overall effectiveness of the recommendation system, and only the IDs of similar users are added to the prompt. For the explanation generation task, using the associated knowledge of similar user explanations, the recommendation system algorithm generates a text explanation to clarify the reasons for recommending such items, thereby enhancing the persuasiveness, explainability and credibility of the recommendation system. Similarly, the evaluation summary task aims to summarize the review record into a concise title. For these tasks, the prompts designed by the present invention include the summary of the target item by users who may be similar. For the direct recommendation task, the present invention selects the correct item from a candidate list containing negative samples, or verifies the recommendation to the selected user, and only provides the IDs of similar users in the template. For all the tasks above, if no similar users interact with the target item for rating or commenting, the "unknown" mask of the template will be used as a substitute.
[0115] like Figure 3 As shown in the figure, the matching information required for the current recommendation task, the prompt word template corresponding to the current recommendation task, and the similar user set corresponding to the current user are input into the initial multi-task recommendation model, and all parameters of the large model are fine-tuned. Through the negative log-likelihood loss function, the specific function expression is:
[0116]
[0117] Here, θ is the parameterized model and when predicting the next token, the model’s decoder estimates the likelihood p θ (y t |y <t ,x). In addition, to enhance comprehensive learning, the recommendation tasks are randomly ordered and pre-trained on five tasks simultaneously.
[0118] Thus, after training, the model is equipped with the ability to directly undertake various tasks using personalized prompts. When dealing with rating, explanation, and summarization tasks, greedy decoding is used to generate answers. In contrast, sequential and direct recommendation tasks require a list of items as output. In the context of sequential recommendation, beam search is used to generate a list of potential next items and is evaluated in the all-item setting. In particular, in direct recommendation, the recommended items are predicted from a set of candidates where only one item is positive. In this case, beam search is also used to decode the list of potential target items with the highest scores, which are then evaluated later.
[0119] like Figure 4 , Figure 5 , Figure 6 , Figure 7 and Figure 8 As shown in the figure, the present invention has the best effect in the comparison between the present recommendation system algorithm and the current recommendation system algorithm in five recommendation tasks on three Amazon data sets (beauty, sports and toys). The smaller the MAE (mean absolute error) and RMSE (root mean square error), the better, and the larger the other indicators, the better.
[0120] In one embodiment, if Fig. 9 As shown, based on the above-mentioned multi-task recommendation method based on user evaluation information, the present invention also provides a multi-task recommendation device based on user evaluation information, including:
[0121] The determination module 100 is used to determine the current recommendation task and obtain the user evaluation information required for the current recommendation task;
[0122] An acquisition module 200 is used to acquire a pre-built multi-task prompt word template, wherein the multi-task prompt word template includes a correspondence between a plurality of recommended tasks and the prompt word template;
[0123] A search module 300 is used to search the multi-task prompt word template to obtain a target prompt word template corresponding to the current recommended task;
[0124] The input module 400 is used to input the user evaluation information and the target prompt word template into a pre-trained multi-task recommendation model to obtain a recommendation result corresponding to the current recommendation task.
[0125] Fig.10 A schematic diagram of the structure of a terminal provided in an embodiment of the present application. The terminal may include:
[0126] A memory 501 , a processor 502 , and a computer program stored in the memory 501 and executable on the processor 502 .
[0127] When the processor 502 executes the program, the multi-task recommendation method based on user evaluation information provided in the above embodiment is implemented.
[0128] Furthermore, the terminal further includes:
[0129] The communication interface 503 is used for communication between the memory 501 and the processor 502 .
[0130] The memory 501 is used to store computer programs that can be executed on the processor 502 .
[0131] The memory 501 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0132] If the memory 501, the processor 502 and the communication interface 503 are implemented independently, the communication interface 503, the memory 501 and the processor 502 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0133] Optionally, in a specific implementation, if the memory 501, the processor 502 and the communication interface 503 are integrated on a chip, the memory 501, the processor 502 and the communication interface 503 can communicate with each other through an internal interface.
[0134] The processor 502 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.
[0135] This embodiment also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the multi-task recommendation method based on user evaluation information is implemented as described above.
[0136] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0137] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0138] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or N executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes additional implementations, in which the order shown or discussed may not be followed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0139] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can read instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or N wirings (electronic devices), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically by optically scanning the paper or other medium and then editing, interpreting or otherwise processing in a suitable manner if necessary and then storing it in a computer memory.
[0140] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above embodiment, the N steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. If implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0141] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiment.
[0142] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0143] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.
[0144] In summary, the multi-task recommendation method, device, terminal and medium based on user evaluation information disclosed in the present invention include: determining the current recommended task and obtaining the user evaluation information required for the current recommended task; obtaining a pre-constructed multi-task prompt word template, wherein the multi-task prompt word template includes the correspondence between multiple recommended tasks and prompt word templates; searching the multi-task prompt word template to obtain the target prompt word template corresponding to the current recommended task; inputting the user evaluation information and the target prompt word template into a pre-trained multi-task recommendation model to obtain the recommendation result corresponding to the current recommended task. The present invention pre-constructs prompt word templates for multiple recommended tasks, searches for matching templates when performing a recommended task, and obtains the recommendation result based on the matching template, so that multiple recommended tasks can be implemented through one model, and recommendations can be made for multiple recommended tasks.
[0145] It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.
Claims
1. A multi-task recommendation method based on user evaluation information, characterized in that: The method comprises: Determine the current recommended task and obtain the user evaluation information required for the current recommended task; Acquire a pre-built multi-task prompt word template, wherein the multi-task prompt word template includes a correspondence between a plurality of recommended tasks and the prompt word template; Searching for the multi-task prompt word template to obtain a target prompt word template corresponding to the current recommended task; Inputting the user evaluation information and the target prompt word template into a pre-trained multi-task recommendation model to obtain a recommendation result corresponding to the current recommendation task; The training steps of the multi-task recommendation model include: Obtaining a training data set, wherein the training data set includes user evaluation data corresponding to a number of users; Determine the optimal distance between each user and other users using a conditional optimal transmission algorithm according to each of the user evaluation data; Determine a similar user set corresponding to each user according to the optimal distance; Obtain a pre-built multi-task prompt word template and a pre-selected initial multi-task recommendation model; Using the user evaluation data of each user in the training data set, the similar user set corresponding to the user, and the multi-task prompt word template, the initial multi-task recommendation model is trained to obtain a trained multi-task recommendation model; The user evaluation data includes: a user ID, and an item ID of the evaluated item corresponding to the user ID, a score of the evaluated item, a comment record of the evaluated item, and the number of comment likes for each comment record; According to each of the user evaluation data, the optimal distance between each user and other users is determined by using a conditional optimal transmission algorithm, including: Obtain a user set according to all user identifiers in the training data set, and obtain an item set according to all item identifiers in the training data set; A rating matrix is obtained based on the ratings and comment records, and a usefulness matrix is obtained based on the number of likes on the comments. The rating matrix is used to reflect the ratings of each user in the user set on each item in the item set, and the usefulness matrix is used to reflect the usefulness of each comment record; Obtaining the probability distribution of preferences of each user in the user set for all items in the item set according to the rating matrix and the usefulness matrix; According to the probability distribution of preferences of each user, the optimal distance between each user and other users is calculated using the conditional optimal transmission algorithm.
2. The multi-task recommendation method based on user evaluation information according to claim 1, characterized in that: The multiple recommendation tasks include: rating prediction, sequential recommendation, explanation generation, comment summary and direct recommendation; the user evaluation information includes: one or more of: user identification, item identification of the evaluated item, rating of the evaluated item, comment record of the evaluated item and number of comment likes of the comment record.
3. The multi-task recommendation method based on user evaluation information according to claim 1, characterized in that: Determining a similar user set corresponding to each user according to the optimal distance includes: For each user, sort the optimal distances between the user and other users in ascending order to obtain a sorting result; A preset number of other users ranked first are selected from the ranking results as similar users of the user, and a similar user set corresponding to the user is obtained.
4. The multi-task recommendation method based on user evaluation information according to claim 1, characterized in that: The method of training the initial multi-task recommendation model by using the user evaluation data of each user in the training data set, the similar user set corresponding to the user, and the multi-task prompt word template to obtain the trained multi-task recommendation model includes: When training is performed using the training data set, matching information required for each recommendation task is selected from the user evaluation data of each user, wherein the matching information includes one or more of: a user ID, an item ID of an evaluated item corresponding to the user ID, a score of the evaluated item, a comment record of the evaluated item, and a number of comment likes for each comment record; Input the matching information required for each recommendation task, the prompt word template corresponding to each recommendation task, and the similar user set corresponding to each user into the initial multi-task recommendation model, and train the initial multi-task recommendation model with a preset negative log-likelihood loss function as a target to obtain a trained multi-task recommendation model; The initial multi-task recommendation model is a large language model.
5. A multi-task recommendation device based on user evaluation information, characterized in that: The device comprises: A determination module, used to determine the current recommendation task and obtain the user evaluation information required for the current recommendation task; An acquisition module, used to acquire a pre-built multi-task prompt word template, wherein the multi-task prompt word template includes a correspondence between a plurality of recommended tasks and the prompt word template; A search module, used to search the multi-task prompt word template to obtain a target prompt word template corresponding to the current recommended task; An input module, used to input the user evaluation information and the target prompt word template into a pre-trained multi-task recommendation model to obtain a recommendation result corresponding to the current recommendation task; The training steps of the multi-task recommendation model include: Obtaining a training data set, wherein the training data set includes user evaluation data corresponding to a number of users; Determine the optimal distance between each user and other users using a conditional optimal transmission algorithm according to each of the user evaluation data; Determine a similar user set corresponding to each user according to the optimal distance; Obtain a pre-built multi-task prompt word template and a pre-selected initial multi-task recommendation model; Using the user evaluation data of each user in the training data set, the similar user set corresponding to the user, and the multi-task prompt word template, the initial multi-task recommendation model is trained to obtain a trained multi-task recommendation model; The user evaluation data includes: a user ID, and an item ID of the evaluated item corresponding to the user ID, a score of the evaluated item, a comment record of the evaluated item, and the number of comment likes for each comment record; According to each of the user evaluation data, the optimal distance between each user and other users is determined by using a conditional optimal transmission algorithm, including: Obtain a user set according to all user identifiers in the training data set, and obtain an item set according to all item identifiers in the training data set; A rating matrix is obtained based on the ratings and comment records, and a usefulness matrix is obtained based on the number of likes on the comments. The rating matrix is used to reflect the ratings of each user in the user set on each item in the item set, and the usefulness matrix is used to reflect the usefulness of each comment record; Obtaining the probability distribution of preferences of each user in the user set for all items in the item set according to the rating matrix and the usefulness matrix; According to the probability distribution of preferences of each user, the optimal distance between each user and other users is calculated using the conditional optimal transmission algorithm.
6. A terminal, characterized in that: include: A memory, a processor, and a multi-task recommendation program based on user evaluation information stored in the memory and executable on the processor, wherein the multi-task recommendation program based on user evaluation information, when executed by the processor, implements the steps of the multi-task recommendation method based on user evaluation information as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program can be executed to implement the steps of the multi-task recommendation method based on user evaluation information as claimed in any one of claims 1 to 4.
Citation Information
Patent Citations
Commodity recommendation method based on neighbor users and comment information
CN112884551A
Shopping guide method and system based on large language model
CN117350825A