Recommendation method and device, equipment, storage medium and product
By receiving inquiry information and using preset recommendation models to perform secondary recall of semantic correlation evaluation, the problem of poor recommendation effects caused by large amount of user behavior data and material diversity in traditional recommendation models is solved, and more accurate candidate display and user experience improvement are achieved.
Patent Information
- Application Number
- CN202510646010.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-19
- Publication Date
- 2025-08-29
AI Technical Summary
Traditional recommendation models have poor recommendation results due to the large amount of user behavior data, diverse materials, and difficulty in capturing niche associations. It is difficult for large models to reject irrelevant content when recommending, high inference costs, difficult to fine-tune model parameters, and poor user experience.
By receiving inquiry information, obtaining candidate object information, using the preset recommendation model to perform secondary recall based on the degree of semantic correlation, selecting candidate objects that are more relevant to the target object to display, and combining the trained large language model for judgment and recall.
It improves the accuracy and user experience of recommendations, reduces waste of computing resources, and improves the generalization ability and recommendation effect of the model.
Smart Images

Figure CN120563199A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to, but is not limited to, the field of natural language processing technology, and in particular to a recommendation method, apparatus, device, storage medium, and product. Background Art
[0002] Currently, when recommending items or information that users may be interested in based on analysis of data such as user historical behavior, personal information, or item feature information, this is usually achieved by training a recommendation model. However, traditional recommendation models have poor recommendation effects due to the large amount of user behavior data or the large number of items. Summary of the Invention
[0003] In view of this, embodiments of the present application provide at least one recommendation method, apparatus, device, storage medium, and product.
[0004] The technical solution of the embodiment of the present application is implemented as follows:
[0005] On the one hand, an embodiment of the present application provides a recommendation method, which includes: receiving first query information; when the first query information is used to request a recommendation for a target object, obtaining object information of at least two first candidate objects related to the target object; using a first preset recommendation model, based on the degree of semantic relevance between the first query information and the object information of each candidate object, determining a second candidate object from at least two first candidate objects; and displaying the second candidate object.
[0006] On the other hand, an embodiment of the present application provides a recommendation device, which includes: a receiving module for receiving first query information; an acquisition module for acquiring object information of at least two first candidate objects related to the target object when the first query information is used to request a recommendation for the target object; a determination module for determining a second candidate object from at least two first candidate objects based on the degree of semantic relevance between the first query information and the object information of each candidate object; and a display module for displaying the second candidate object.
[0007] On the other hand, an embodiment of the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, it implements some or all of the steps in the above method.
[0008] On the other hand, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which implements some or all of the steps in the above-mentioned recommended method when executed by a processor.
[0009] On the other hand, an embodiment of the present application provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements some or all of the steps in the above-mentioned recommended method.
[0010] In an embodiment of the present application, when the recommendation device receives the first query information, it needs to first determine whether the first query information is information requesting a recommendation for the target object, and then recall at least two first candidate objects related to the target object. Finally, based on the object information of the target object in the first query information and the degree of semantic relevance between the object information of the at least two first candidate objects, the second candidate object that is more relevant to the target object is selected again from the recalled at least two first candidate objects and displayed. Through the technical solution of the present application, more accurate candidate objects can be recommended to users through secondary recall, thereby improving the user experience.
[0011] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and do not limit the technical solutions of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The drawings herein are incorporated into and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and, together with the specification, are used to illustrate the technical solutions of the present application.
[0013] Figure 1 A schematic diagram of an implementation flow of a recommended method provided in an embodiment of the present application;
[0014] Figure 2 A schematic diagram of an implementation flow of a determination method provided in an embodiment of the present application;
[0015] Figure 3 A schematic diagram of an implementation flow of a method for obtaining at least two first candidate objects provided in an embodiment of the present application;
[0016] Figure 4 A schematic diagram of an implementation flow of a method for determining a second candidate object provided in an embodiment of the present application;
[0017] Figure 5 A schematic diagram of an implementation flow of a method for displaying a second candidate object provided in an embodiment of the present application;
[0018] Figure 6 Schematic diagram of the implementation process of a model training method provided in the embodiment of the present application Figure 1 ;
[0019] Figure 7 Schematic diagram of the implementation process of a model training method provided in the embodiment of the present application Figure 2 ;
[0020] Figure 8 A schematic diagram of the structure of a recommended device provided in an embodiment of the present application;
[0021] Figure 9 A hardware entity diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0022] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions of this application are further elaborated in detail below with reference to the accompanying drawings and embodiments. The described embodiments should not be regarded as limiting this application. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0023] In the following description, references to "some embodiments" describe a subset of all possible embodiments. However, it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict. The terms "first / second / third" are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It is understood that the specific order or sequence of "first / second / third" may be interchanged where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0024] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing this application only and are not intended to limit this application.
[0025] Recommendation refers to recommending items or information that may be of interest to users based on analysis of data such as user history, personal information, or item features. This is done by predicting user preferences. Traditional recommendation methods have different technical issues at the following levels:
[0026] 1. User level
[0027] Due to the large scale of users (usually hundreds of millions), diverse behaviors (each user's behavior may be different), and the possibility of being affected by unpredictable external factors, it is very difficult to model users.
[0028] 2. Material level
[0029] The associations between different materials are very niche and usually difficult to capture (which can be understood as the low frequency of co-occurrence). For example: Why did this user buy these two items at the same time? Why did this user watch these two videos at the same time? The reasons for this problem may be very niche and are also a challenge to model.
[0030] 3. Model level
[0031] In terms of models, there is a big generalization problem. On many video platforms we are familiar with, different users upload a large number of new videos every day, which generates a lot of new low-frequency associations and new materials. In this case, the model may have poor recommendation effects for new materials. The generalization problem has been a serious problem that has plagued traditional recommendation methods that mainly rely on identifier (ID) features for many years.
[0032] In addition to the technical problems at the three levels mentioned above, traditional recommendation methods are also difficult to interact with users, resulting in poor user experience.
[0033] Furthermore, if only the Big Model is used for recommendation, the following technical problems will also arise:
[0034] 1. If we directly use the in-context learning method in the large model to make recommendations, if the large model is a Generative Pre-trained Transformer (GPT) large model, a prominent problem is that the GPT large model is highly security-optimized, so it is difficult for the GPT large model to reject users, that is, it is difficult to say no. In this case, if we use the independent processing (point-wise) method, give the GPT large model a list and ask it whether to recommend these to the user, it is difficult for it to say no. There is a high probability that it will directly say yes to many users, that is, recommend everything correctly.
[0035] 2. The cost of reasoning is high.
[0036] 3. It is difficult to fine-tune model parameters.
[0037] To address the above technical issues, embodiments of the present application provide a recommendation method that can be executed by a processor of a computer device. The computer device may include a server, laptop, tablet, desktop computer, smart TV, set-top box, mobile device (e.g., mobile phone, portable video player, personal digital assistant, dedicated messaging device, portable gaming device), or other device with data processing capabilities.
[0038] Figure 1 A schematic diagram of the implementation flow of a recommendation method provided in an embodiment of the present application is applied to a recommendation device, such as Figure 1 As shown, the method includes the following steps S101 to S104:
[0039] Step S101: Receive first inquiry information.
[0040] In an embodiment of the present application, the user inputs first query information on the display interface of the recommendation device, and the recommendation device can recommend related objects to the user on the display interface based on the first query information, or the recommendation device can generate the first query information based on the user's historical log information, thereby eliminating the need for the user to input the first query information on the display interface and directly recommending related objects to the user on the display interface.
[0041] In some embodiments, the first query information may be a request text input by the user to the recommendation device.
[0042] For example, the first inquiry information is "Please recommend me a pair of comfortable sports shoes", or "Please recommend me a good Sichuan dish", or "Please recommend me a fun tourist attraction", etc. The user can input the corresponding request text to the recommendation device according to his or her own needs; the specific first inquiry information can be determined according to the actual situation, and the embodiment of this application does not make any specific limitations here.
[0043] In some embodiments, the first query information may also be historical log information of the user.
[0044] Exemplarily, for a shopping platform, the first inquiry information may be the user's historical purchase information, that is, the category of goods that the user purchases more frequently is used as the first inquiry information. For example, the user frequently purchases sports products on the shopping platform, specifically sports shoes, sportswear, or sports equipment, etc. Therefore, the first inquiry information can be generated based on the product information of sports shoes, sportswear, or sports equipment.
[0045] As another example, for a food recipe platform, the first query information may be the user's historical click information, that is, the recipe category that the user clicks on more frequently is used as the first query information. For example, the user frequently clicks on Sichuan cuisine recipes on the food recipe platform, which may be fish-flavored shredded pork, Maoxuewang, or Bobo chicken, etc. Therefore, the first query information can be generated based on the recipe information of fish-flavored shredded pork, Maoxuewang, or Bobo chicken.
[0046] As another example, for a travel guide platform, the first query information can be the user's historical browsing information, that is, the travel guide that the user browses more frequently is used as the first query information. For example, the user frequently browses the travel guide to the south on the travel guide platform, specifically the travel guide to Sanya, Hunan or Yunnan. Therefore, the first query information can be generated based on the travel guide to Sanya, Hunan or Yunnan. At this time, the user does not need to enter the request text, and the recommendation device can generate the corresponding first query information by itself. The specific first query information can be determined according to the actual situation, and the embodiment of the present application does not make specific limitations here.
[0047] Step S102: When the first query information is used to request a recommendation for a target object, obtain object information of at least two first candidate objects related to the target object.
[0048] In an embodiment of the present application, after receiving the first query information, the recommendation device needs to first determine whether the first query information is used to request a recommendation for the target object. Only when it is determined that the first query information is used to request a recommendation for the target object, the object information of at least two first candidate objects related to the target object is obtained.
[0049] For example, if the first inquiry information is “Hello, what’s your name?”, it can be determined that “Hello, what’s your name?” is not used to request a recommendation for a target object.
[0050] As another example, if the first inquiry information is “recommend me a pair of comfortable sports shoes”, then it can be determined that “recommend me a pair of comfortable sports shoes” is used to request a recommendation for a target object.
[0051] In some embodiments, when the recommendation device determines that the first query information is used to request a recommendation for a target object, it can match at least two first candidate objects that are text-related or semantically related to the target object based on the text features or semantic features of the target object, and at the same time, it is also necessary to obtain object information of the at least two first candidate objects.
[0052] In some embodiments, the object information of at least two first candidate objects can be the description information of each first candidate object in the at least two first candidate objects, or the object name; the specific object information can be determined according to actual conditions, and the embodiments of the present application do not make specific limitations here.
[0053] In some embodiments, when obtaining object information of at least two first candidate objects related to the target object, the recommendation device can input the first query information into a trained second preset recommendation model, and recall at least two first candidate objects related to the target object and the object information of at least two first candidate objects through the second preset recommendation model; wherein the second preset recommendation model can be a traditional recommendation model trained based on historical log data, such as a pre-trained language representation model (Bidirectional Encoder Representations from Transformers, BERT).
[0054] In some embodiments, the first query information is a request text input by the user to the recommendation device.
[0055] For example, if the first inquiry information is "Please recommend me a pair of comfortable sports shoes", at this time, if it is determined that the first inquiry information is information for requesting recommendations for "sports shoes" and the target object is "sports shoes", at this time, at least two first candidate objects related to "sports shoes" can be obtained, that is, product information of at least two sports shoes of the same or different brands and styles can be obtained.
[0056] As another example, if the first inquiry information is "Please recommend me a Sichuan dish that is easy to cook", at this time, if it is determined that the first inquiry information is information for requesting a recommendation for "Sichuan cuisine", and the target object is "Sichuan cuisine", at this time, at least two first candidate objects related to "Sichuan cuisine" can be obtained, that is, descriptive information of at least two Sichuan dishes can be obtained.
[0057] As another example, if the first inquiry information is "Please recommend me a fun tourist attraction", at this time, if it is determined that the first inquiry information is information for requesting recommendations for "tourist attractions", and the target object is "tourist attractions", at this time, object information of at least two first candidate objects related to "tourist attractions" can be obtained, that is, attraction information of at least two different tourist attractions can be obtained.
[0058] In some embodiments, the first query information is the user's historical log information.
[0059] Exemplarily, for a shopping platform, if the first query information is generated based on product information of sports shoes, sportswear, or sports equipment purchased by the user in history, then the first query information may be information for requesting recommendations for "sports shoes", with the target object being "sports shoes"; or, the first query information may be information for requesting recommendations for "sportswear", with the target object being "sportswear"; or, the first query information may be information for requesting recommendations for "sports equipment", with the target object being "sports equipment"; at this time, object information of at least two first candidate objects related to "sports shoes" may be obtained, that is, at least two sports shoes of the same or different brands but different styles may be obtained; or object information of at least two first candidate objects related to "sportswear" may be obtained, that is, at least two sportswear of the same or different brands but different styles may be obtained; object information of at least two first candidate objects related to "sports equipment", that is, product information of at least two sports equipment of the same or different brands but different styles may be obtained.
[0060] As another example, for a food recipe platform, if the first query information is generated based on the user's frequent clicks on the recipe information of foods such as Fish-Flavored Shredded Pork, Maoxuewang, or Bobo Chicken, then the first query information may be information for requesting recommendations for "Fish-Flavored Shredded Pork", with the target object being "Fish-Flavored Shredded Pork"; or, the first query information may be information for requesting recommendations for "Maoxuewang", with the target object being "Maoxuewang"; or, the first query information may be information for requesting recommendations for "Bobo Chicken", with the target object being "Bobo Chicken"; at this time, object information of at least two first candidate objects related to "Fish-Flavored Shredded Pork", "Maoxuewang", or "Bobo Chicken" may be obtained. Since "Fish-Flavored Shredded Pork", "Maoxuewang", or "Bobo Chicken" are all Sichuan dishes, that is, recipe information of at least two Sichuan dishes is obtained.
[0061] As another example, for a travel guide platform, if the first query information is generated based on the user's historical reference to travel guides for Sanya, Hunan, Yunnan, etc., then the first query information may be information for requesting recommendations for "Sanya", with the target object being "Sanya"; or, the first query information may be information for requesting recommendations for "Hunan", with the target object being "Hunan"; or, the first query information may be information for requesting recommendations for "Yunnan", with the target object being "Yunnan"; at this time, object information of at least two first candidate objects related to "Sanya", "Hunan", or "Yunnan" may be obtained. Since "Sanya", "Hunan", or "Yunnan" are all tourist destinations in the south, that is, at least two travel guides for the south and other places may be obtained.
[0062] Step S103 : using the first preset recommendation model, based on the semantic relevance between the first query information and the object information of each candidate object, determine a second candidate object from at least two first candidate objects.
[0063] In an embodiment of the present application, the recommendation device uses a first preset recommendation model to determine one or more first candidate objects with a higher degree of semantic correlation among at least two first candidate objects as second candidate objects based on the degree of semantic correlation between the object information of the target object in the first query information and the object information of each candidate object in at least two first candidate objects.
[0064] In some embodiments, the recommendation device inputs the first query information into a trained second preset recommendation model, recalls at least two first candidate objects related to the target object and object information of at least two first candidate objects through the second preset recommendation model, and then inputs the object information of at least two first candidate objects into the trained first preset recommendation model, and selects a second candidate object with a higher degree of semantic relevance to the target object from the at least two first candidate objects through the first preset recommendation model based on the object information of the target object and the degree of semantic relevance between the object information of the target object and the object information of each of the at least two first candidate objects.
[0065] In some embodiments, when determining the second candidate object from at least two first candidate objects, the recommendation device can input the object information of the at least two first candidate objects into a trained first preset recommendation model, and select the second candidate object with a higher degree of semantic relevance to the target object from the at least two first candidate objects based on the degree of semantic relevance between the object information of the target object and each candidate object through the first preset recommendation model; wherein the first preset recommendation model can be an open source large model, such as a large language model (LLM), or a baichuan2-13B model, or a chatglm-6b model, etc.
[0066] For example, if the target object is "sports shoes" and at least two first candidate objects are at least two sports shoes of the same or different brands but different styles, then one or more sports shoes can be selected from at least two sports shoes of the same or different brands but different styles based on the degree of semantic relevance between the product description information of the at least two sports shoes of the same or different brands but different styles and "sports shoes".
[0067] As another example, if the target object is "Sichuan cuisine" and at least two first candidate objects are at least two Sichuan dishes, then one or more Sichuan dishes can be selected from the at least two Sichuan dishes based on the semantic relevance between the names of the at least two Sichuan dishes and the recipes and "Sichuan cuisine".
[0068] As another example, if the target object is "tourist attractions" and at least two first candidate objects are at least two different tourist attractions, then one or more tourist attractions can be selected from at least two different tourist attractions based on the degree of semantic relevance between the attraction introductions of the at least two different tourist attractions and "tourist attractions".
[0069] It is understandable that the recommendation device can screen out the candidate objects with the highest degree of relevance to the target object through the joint recommendation method of the first recall and the second recall, thereby further improving the recommendation effect.
[0070] Step S104: Display the second candidate object.
[0071] In the embodiment of the present application, when the recommendation device determines the second candidate object to be recommended to the user, the recommendation device may display the second candidate object to the user on the display interface for the user to browse.
[0072] In some embodiments, a user inputs a first query information for requesting a recommendation into the recommendation device. First, the recommendation device recalls at least two related first candidate objects based on the first query information input by the user. Then, the recommendation device determines a second candidate object from the at least two first candidate objects based on the degree of semantic relevance between the object information of the at least two first candidate objects and the target object. Finally, the recommendation device displays the second candidate object to the user. It can be understood that the user only needs to input the first query information into the recommendation device, and the recommendation device will display the second candidate object to the user.
[0073] In some embodiments, for the shopping platform, the user does not need to input any information, and the shopping platform can directly generate the first query information according to the user's historical purchase information. Based on this, first, the recommendation device on the shopping platform first recalls at least two related products according to the generated first query information, and then the recommendation device determines one or more products from at least two products according to the semantic relevance between the product information of the at least two products and the target object, and finally, the recommendation device displays one or more products to the user. It can be understood that on the shopping platform, the user does not need to input the first query information, and the shopping platform can directly display one or more products to the user; for the food recipe platform, the user does not need to input any information, and the food recipe platform can directly generate the first query information according to the user's historical click information. Based on this, first, the recommendation device on the food recipe platform first recalls at least two related food recipes according to the generated first query information, and then the recommendation device determines the semantic relevance between the at least two food recipes and the target object. The recommendation device determines one or more food recipes from at least two food recipes based on the semantic relevance between the at least two food recipes and the target object. Finally, the recommendation device displays one or more food recipes to the user. It can be understood that on the food recipe platform, the user does not need to input the first query information, and the food recipe platform can directly display one or more food recipes to the user. For the travel guide platform, the user does not need to input any information, and the travel guide platform can directly generate the first query information based on the user's historical reference information. Based on this, first, the recommendation device on the travel guide platform recalls at least two related travel guides according to the generated first query information. Then, the recommendation device determines one or more travel guides from at least two travel guides based on the semantic relevance between the at least two travel guides and the target object. Finally, the recommendation device displays one or more travel guides to the user. It can be understood that on the travel guide platform, the user does not need to input the first query information, and the shopping platform can directly display one or more travel guides to the user.
[0074] In an embodiment of the present application, when the recommendation device receives the first query information, it needs to first determine whether the first query information is information requesting a recommendation for the target object, and then recall at least two first candidate objects related to the target object. Finally, based on the object information of the target object in the first query information and the degree of semantic relevance between the object information of the at least two first candidate objects, the second candidate object that is more relevant to the target object is selected again from the recalled at least two first candidate objects and displayed. Through the technical solution of the present application, more accurate candidate objects can be recommended to users through secondary recall, thereby improving the user experience.
[0075] Optionally, with respect to the above step S101, after receiving the first query information, the recommendation device also needs to determine whether the first query information is information requesting recommendation for the target object, referring to Figure 2 , specifically including the following steps S201 to S202:
[0076] Step S201: Generate a first determination request based on first query information and a first request text; the first determination request is used to determine whether the first query information is used to request a recommendation for a target object.
[0077] In an embodiment of the present application, after receiving the first query information, the recommendation device generates a first determination request based on the first query information and the first request text; the first determination request is used to determine whether the first query information is used to request a recommendation for the target object.
[0078] In some embodiments, the first request text may be a wording requesting a judgment on a certain text. For example, the first request text may be "Help me determine whether this sentence should be recommended" or "Help me determine whether this sentence is true or false", etc. Based on this, the recommendation device may use the first request text to request a judgment on the first inquiry information; the specific first request text may be determined based on actual conditions, and the embodiments of the present application do not make any specific limitations here.
[0079] In some embodiments, the first query information and the first request text are combined to directly generate a first judgment request, that is, the first judgment request can be "first request text + first query information". The function of the first judgment request is to judge the first query information based on the first request text to obtain a corresponding judgment result. Then, the recommendation device can execute corresponding steps for different judgment results; the specific first judgment request can be generated according to actual conditions, and the embodiments of this application do not make specific limitations here.
[0080] For example, the first inquiry information is "Hello, what should I call you", and the first request text is "Help me judge whether this sentence should be recommended. The sentence is: ". At this time, the first judgment request generated based on the first inquiry information and the first request text is "Help me judge whether this sentence should be recommended. The sentence is: Hello, what should I call you".
[0081] For example, the first inquiry information is "Please recommend me a pair of comfortable sports shoes", and the first request text is "Please help me judge whether this sentence should be recommended. The sentence is: ". At this time, the first judgment request generated based on the first inquiry information and the first request text is "Please help me judge whether this sentence should be recommended. The sentence is: Please recommend me a pair of comfortable sports shoes."
[0082] For example, the first inquiry information is "Please recommend me a Sichuan dish that is easy to make", and the first request text is "Please help me judge whether this sentence should be recommended. The sentence is: ". At this time, the first judgment request generated based on the first inquiry information and the first request text is "Please help me judge whether this sentence should be recommended. The sentence is: Please recommend me a Sichuan dish that is easy to make.
[0083] For example, the first inquiry information is "Please recommend me a fun tourist attraction", and the first request text is "Please help me determine whether this sentence should be recommended. The sentence is: ". At this time, the first judgment request generated based on the first inquiry information and the first request text is "Please help me determine whether this sentence should be recommended. The sentence is: Please recommend me a fun tourist attraction."
[0084] Step S202: When the determination result of the first determination request is the first result, determine that the first query information is used to request a recommendation for the target object.
[0085] In an embodiment of the present application, the recommendation device inputs the first judgment request into a preset judgment model and outputs a judgment result for the first judgment request. If the judgment result is the first result, it is determined that the first query information is used to request a recommendation for the target object; wherein the preset judgment model can be an open source large model, such as a large language model (LLM), or a baichuan2-13B model, or a chatglm-6b model, etc.
[0086] In some embodiments, if the judgment result is the second result, it is determined that the first inquiry information is not used to request a recommendation for the target object; wherein, the first result and the second result can be text or represented by numbers, for example, the first result is "yes" and the second result is "no", or the first result is "1" and the second result is "0". The specific first result and second result can be determined according to actual conditions, and the embodiments of the present application do not make specific limitations here.
[0087] Exemplarily, the first judgment request is "Help me determine whether this sentence should be recommended. The sentence is: Hello, what should I call you." At this time, "Help me determine whether this sentence should be recommended. The sentence is: Hello, what should I call you" is input into the LLM model, and a second result different from the first result is obtained. At this time, it is determined that "Hello, what should I call you" is not used to request a recommendation for the target object.
[0088] As another example, the first judgment request is "Help me judge whether this sentence should be recommended. The sentence is: Recommend me a pair of comfortable sports shoes." At this time, "Help me judge whether this sentence should be recommended. The sentence is: Recommend me a pair of comfortable sports shoes" is input into the LLM model, and the judgment result obtained is the first result. At this time, it is determined that "Help me recommend me a pair of comfortable sports shoes" is used to request a recommendation for the target object.
[0089] For example, the first judgment request is "Help me judge whether this sentence should be recommended. The sentence is: Help me recommend a good Sichuan dish." At this time, "Help me judge whether this sentence should be recommended. The sentence is: Help me recommend a good Sichuan dish" is input into the LLM model, and the judgment result obtained is the first result. At this time, it is determined that "Help me recommend a good Sichuan dish" is used to request a recommendation for the target object.
[0090] As another example, the first judgment request is "Help me determine whether this sentence should be recommended. The sentence is: Help me recommend a fun tourist attraction." At this time, "Help me determine whether this sentence should be recommended. The sentence is: Help me recommend a fun tourist attraction" is input into the LLM model, and the judgment result obtained is the first result. At this time, it is determined that "Help me recommend a fun tourist attraction" is used to request a recommendation for the target object.
[0091] It is understandable that when the recommendation device receives the first query information, it can first determine the first query information, and only perform the recommendation step when the first query information requests a recommendation for the target object, thereby avoiding wasting computing resources.
[0092] Optionally, with respect to the above step S102, the recommendation device obtains object information of at least two first candidate objects related to the target object, referring to Figure 3 , specifically including the following steps S301 to S302:
[0093] Step S301: Determine a plurality of first candidate objects in a preset object library that are associated with a target object.
[0094] In an embodiment of the present application, when the first query information is used to request a recommendation for a target object, the recommendation device determines a plurality of first candidate objects in a preset object library that have an association relationship with the target object.
[0095] In some embodiments, the preset object library can be understood as a database containing different materials generated by the recommendation device based on historical log data; the specific preset object library can be determined according to actual conditions, and the embodiments of the present application do not make specific limitations here.
[0096] In some embodiments, the association relationship can be understood as a textual or semantic association relationship with the target object. Therefore, the recommendation device can select multiple first candidate objects that are textually or semantically related to the target object from a preset object library.
[0097] Exemplarily, when the first query information is used to request a recommendation for a target object, the recommendation device inputs the first query information into the second preset recommendation model. Assuming that the first query information is "recommend me a pair of comfortable sports shoes", at this time, the second preset recommendation model can select multiple first candidate objects that have an association with "sports shoes" from the preset object library based on semantic similarity or combined click frequency, such as "sports equipment", "sports backpacks", "sportswear", "sports pants", "sports socks", "sports water bottles", "sports bracelets", etc.
[0098] As another example, when the first query information is used to request a recommendation for a target object, the recommendation device inputs the first query information into the second preset recommendation model. Assuming that the first query information is "Please recommend me a Sichuan dish that is easy to make", at this time, the second preset recommendation model can select multiple first candidate objects that are associated with "Sichuan cuisine" from the preset object library based on semantic similarity or combined click frequency, such as "Fish-flavored Shredded Pork", "Mapo Tofu", "Maoxuewang", "Twice-cooked Pork", "Bobo Chicken", "Kung Pao Chicken", "Spicy Chicken", etc.
[0099] As another example, when the first query information is used to request a recommendation for a target object, the recommendation device inputs the first query information into the second preset recommendation model. Assuming that the first query information is "Please recommend me a fun tourist attraction", the second preset recommendation model can select multiple first candidate objects that have an association with "tourist attractions" from the preset object library based on semantic similarity or combined click frequency, for example, "Kanas, Xinjiang", "Jiuzhaigou, Sichuan", "Ejina Banner, Inner Mongolia", "Chenzhou, Hunan", "Lijiang, Yunnan", "Huashan, Shaanxi", "Xiaoxitian, Shanxi", etc.
[0100] Step S302: Determine, among the multiple first candidate objects, candidate objects whose correlation with the target object is greater than a first threshold as at least two first candidate objects; and obtain object information of the at least two first candidate objects.
[0101] In some embodiments, the recommendation device may first determine the correlation between multiple first candidate objects and the target object, and then determine the first candidate objects with greater correlation with the target object among the multiple first candidate objects as at least two first candidate objects, wherein the correlation may be text correlation or semantic correlation; the specific correlation may be determined based on actual conditions, and the embodiments of the present application do not make specific limitations here.
[0102] In some embodiments, when the recommendation device determines at least two first candidate objects based on the first query information, it can input the first query information into a trained second preset recommendation model. The second preset recommendation model first determines multiple first candidate objects in the preset object library that have an association relationship with the target object. Then, the second preset recommendation model determines the candidate objects among the multiple first candidate objects whose correlation with the target object is greater than the first threshold value as at least two first candidate objects; the specific first threshold value can be set according to actual conditions, and the embodiments of the present application do not make specific limitations here.
[0103] Exemplarily, after the recommendation device uses the second preset recommendation model to select "sports equipment", "sports backpack", "sports clothes", "sports pants", "sports socks", "sports bottle", and "sports bracelet" that are associated with "sports shoes" from the preset object library, it is necessary to determine the candidate objects among "sports equipment", "sports backpack", "sports clothes", "sports pants", "sports socks", "sports bottle", and "sports bracelet" whose correlation with "sports shoes" is greater than the first threshold value, thereby obtaining "sports clothes", "sports pants", "sports socks", and "sports bracelet", and at the same time, it is also necessary to obtain the object information of each candidate object.
[0104] As another example, after the recommendation device uses the second preset recommendation model to select "Fish-flavored Shredded Pork", "Mapo Tofu", "Maoxuewang", "Twice-cooked Pork", "Bobo Chicken", "Kung Pao Chicken", and "Spicy Chicken" that are associated with "Sichuan cuisine" from the preset object library, it is necessary to determine the candidate objects among "Fish-flavored Shredded Pork", "Mapo Tofu", "Maoxuewang", "Twice-cooked Pork", "Bobo Chicken", "Kung Pao Chicken", and "Spicy Chicken" whose correlation with "Sichuan cuisine" is greater than the first threshold value, thereby obtaining "Mapo Tofu", "Twice-cooked Pork", "Kung Pao Chicken", and "Spicy Chicken", and at the same time, it is necessary to obtain the object information of each candidate object.
[0105] As another example, after the recommendation device uses the second preset recommendation model to select "Xinjiang Kanas", "Sichuan Jiuzhaigou", "Ejina Banner, Inner Mongolia", "Chenzhou, Hunan", "Lijiang, Yunnan", "Huashan, Shaanxi", and "Xiaoxitian, Shanxi" that are associated with "tourist attractions" from the preset object library, it is necessary to determine the candidate objects among "Xinjiang Kanas", "Sichuan Jiuzhaigou", "Ejina Banner, Inner Mongolia", "Chenzhou, Hunan", "Lijiang, Yunnan", "Huashan, Shaanxi", and "Xiaoxitian, Shanxi" whose correlation with "tourist attractions" is greater than the first threshold value, thereby obtaining "Xinjiang Kanas", "Sichuan Jiuzhaigou", "Yunnan Lijiang" and "Shaanxi Huashan", and at the same time, it is necessary to obtain the object information of each candidate object.
[0106] Optionally, with respect to the above step S103, the recommendation device determines a second candidate object from at least two first candidate objects based on the semantic relevance between the first query information and the object information of each candidate object, referring to Figure 4 , specifically including the following steps S401 to S403:
[0107] Step S401: Obtain object information of the target object in the first inquiry information.
[0108] In an embodiment of the present application, after selecting at least two first candidate objects associated with the target object from a preset object library using a second preset recommendation model, the recommendation device determines object information of the at least two first candidate objects and simultaneously obtains object information of the target object.
[0109] In some embodiments, for a shopping platform, the object information may be a product introduction of the target object or the first candidate object; for a food recipe platform, the object information may be a recipe introduction of the target object or the first candidate object; for a travel guide platform, the object information may be a guide introduction of the target object or the first candidate object; the specific object information can be determined based on actual conditions, and the embodiments of this application do not make specific limitations here.
[0110] Step S402: Determine the semantic correlation between the object information of the target object and the object information of each candidate object, and obtain at least two semantic correlations corresponding to at least two first candidate objects.
[0111] In some embodiments, the degree of semantic relevance can be understood as the degree of closeness in meaning between the object information of the target object and the object information of each candidate object of at least two first candidate objects. A variety of methods can be used to determine the degree of semantic relevance. For example, it can be determined by using a bag-of-words model, deep learning, or a knowledge graph. The specific method for determining the degree of semantic relevance can be selected according to actual conditions, and the embodiments of this application do not make specific limitations here.
[0112] In some embodiments, the recommendation device can also generate a corresponding request based on the object information of the target object and the object information of each candidate object, and then input the request into the first preset recommendation model, requesting the first preset recommendation model to determine the degree of semantic relevance between the target object and each candidate object based on the object information of the target object and the object information of each candidate object.
[0113] For example, for a shopping platform, the target object is "sports shoes", and at least two first candidate objects include "sportswear", "sports pants", "sports socks" and "sports bracelets". Among them, the object information of "sports shoes" is "a certain brand of men's sports shoes, summer dad shoes, men's mesh and leather casual shoes, breathable and lightweight running shoes for men", the object information of "sportswear" is "a certain brand of short-sleeved men's summer men's running breathable fitness ice silk quick-drying clothes T-shirts for men's sports tops", the object information of "sports pants" is "ice silk black casual pants for men's summer thin straight loose quick-drying breathable sports trousers with drape and wide legs", the object information of "sports socks" is "a certain brand of socks for men and women, mid-tube summer sports socks, long socks, basketball socks, spring and autumn pure cotton white short tube", and the object information of "sports bracelets" is "a certain brand of bracelet 9 NFC smart sports men and women, sleep heart rate, blood oxygen health monitoring, swimming waterproof multifunctional 8". Based on this, the recommendation device can generate the following request:
[0114] I have a target audience, the content is: a certain brand of sports shoes for men, summer dad shoes for men, mesh and leather casual shoes, breathable and lightweight running shoes for men, the content of the candidate audience is as follows:
[0115] (1) A certain brand of short-sleeved men's summer running breathable fitness ice silk quick-drying T-shirt men's sports top.
[0116] (2) Ice silk black casual pants for men in summer, thin straight loose quick-drying breathable sports trousers with drape and wide legs.
[0117] (3) A certain brand of socks for men and women, mid-length summer sports socks, long socks, basketball socks, spring and autumn pure cotton white short socks.
[0118] (4) A certain brand of wristband 9 NFC smart sports bracelet for men and women, sleep, heart rate, blood oxygen health monitoring, swimming, waterproof and multifunctional 8.
[0119] Please help me sort the above candidate objects and target objects by relevance, and output the sorting results as the corresponding candidate object serial numbers.
[0120] For example, for a food recipe platform, the target object is "Sichuan cuisine", and at least two first candidate objects include "Mapo Tofu", "Twice-Cooked Pork", "Kung Pao Chicken" and "Spicy Chicken". Among them, the object information of "Mapo Tofu" is "Mapo Tofu is one of the traditional famous dishes in Sichuan, and is deeply loved by people for its unique spicy taste and rich taste", the object information of "Twice-Cooked Pork" is "Twice-Cooked Pork is a traditional dish with a strong Sichuan flavor, and is widely loved for its unique taste and bright red color, fat but not greasy characteristics", the object information of "Kung Pao Chicken" is "Kung Pao Chicken is a famous traditional dish that belongs to Sichuan cuisine or Guizhou cuisine", and the object information of "Spicy Chicken" is "Spicy Chicken is a classic dish with a strong Sichuan flavor, and is widely loved for its fresh, fragrant, spicy and numbing taste". Based on this, the recommendation device can generate the following request:
[0121] Please recommend me a good Sichuan dish. I have the following candidates:
[0122] (1) Mapo tofu is one of the traditional famous dishes in Sichuan. It is loved by people for its unique spicy taste and rich taste.
[0123] (2) Twice-cooked pork is a traditional Sichuan dish that is popular for its unique taste, bright red color, and fat but not greasy.
[0124] (3) Kung Pao Chicken is a famous traditional dish that is well-known both at home and abroad. It belongs to the Sichuan cuisine or Guizhou cuisine.
[0125] (4) Spicy diced chicken is a classic dish with a strong Sichuan flavor, and is widely loved for its fresh, fragrant, spicy and numbing taste.
[0126] Please help me sort the above candidate objects and output the sorting results as the corresponding candidate object serial numbers.
[0127] For example, for a travel guide platform, the target object is "tourist attractions", and at least two first candidate objects include "Kanas, Xinjiang", "Jiuzhaigou, Sichuan", "Lijiang, Yunnan" and "Huashan, Shaanxi". Among them, the object information of "Kanas, Xinjiang" is "Kanas, Xinjiang, that is, Kanas Scenic Area, is a national tourist destination integrating natural scenery, cultural landscape and ecological protection", the object information of "Jiuzhaigou, Sichuan" is "Jiuzhaigou, Sichuan is a famous scenic spot, located in Jiuzhaigou County, Aba Tibetan and Qiang Autonomous Prefecture, Sichuan Province. It is famous for its unique natural scenery and rich biodiversity", the object information of "Lijiang, Yunnan" is "Lijiang, Yunnan is a charming tourist destination with rich natural landscapes, profound cultural heritage and unique ethnic customs", and the object information of "Huashan, Shaanxi, formerly known as "Xiyue" and elegantly called "Taihua Mountain", is famous for its steepness and has the reputation of "the most dangerous mountain in the world". Based on this, the recommendation device can generate the following request:
[0128] Please recommend me a fun tourist attraction. I have the following candidates:
[0129] (1) Kanas in Xinjiang, also known as Kanas Scenic Area, is a national-level tourist destination that integrates natural scenery, cultural landscape and ecological protection.
[0130] (2) Jiuzhaigou, Sichuan Province is a famous scenic spot located in Jiuzhaigou County, Aba Tibetan and Qiang Autonomous Prefecture, Sichuan Province. It is famous for its unique natural scenery and rich biodiversity.
[0131] (3) Lijiang, Yunnan is a charming tourist destination with rich natural scenery, profound cultural heritage and unique ethnic customs.
[0132] (4) Huashan Mountain in Shaanxi Province, formerly known as "Xiyue" and elegantly called "Taihua Mountain", is famous for its steepness and has the reputation of being "the most dangerous mountain in the world".
[0133] Please help me sort the above candidate objects and output the sorting results as the corresponding candidate object serial numbers.
[0134] Step S403: Determine the first candidate object corresponding to the semantic relevance greater than the second threshold value among the at least two semantic relevance levels as the second candidate object.
[0135] In some embodiments, the recommendation device determines one or more first candidate objects with a greater degree of semantic relevance to the target object among at least two first candidate objects as second candidate objects. That is, the second candidate object is the candidate object with the highest relevance to the target object after two screenings in the preset object library.
[0136] In some embodiments, the recommendation device inputs the above-generated request into the first preset recommendation model, and after the first preset recommendation model determines the degree of semantic relevance between the target object and each candidate object, the first preset recommendation model can also select a candidate object with a semantic relevance greater than a second threshold value from at least two first candidate objects as the second candidate object based on the degree of semantic relevance; the specific second threshold value can be set according to actual conditions, and the embodiments of the present application do not make specific limitations here.
[0137] Optionally, for the above step S104, the recommendation device displays the second candidate object, referring to Figure 5 , specifically including the following steps S501 to S502:
[0138] Step S501: sort at least one second candidate object based on the semantic relevance corresponding to each second candidate object in the at least one second candidate object to obtain at least one sorted second candidate object.
[0139] In an embodiment of the present application, after determining at least one second candidate object, the recommendation device sorts the at least one second candidate object based on the semantic relevance corresponding to each second candidate object in the at least one second candidate object to obtain at least one sorted second candidate object.
[0140] In some embodiments, when sorting at least one second candidate object, the at least one second candidate object can be sorted from high to low according to the degree of semantic relevance; the specific sorting method can be selected according to actual conditions, and the embodiments of the present application do not make specific limitations here.
[0141] Step S502: display at least one ranked second candidate object.
[0142] In some embodiments, after the recommendation device selects at least one second candidate object to be recommended for the user based on the first query information input by the user on the display interface and sorts the at least one second candidate object according to the degree of semantic relevance, the recommendation device displays the at least one sorted second candidate object on the display interface.
[0143] For example, for a shopping platform, after selecting at least one product (second candidate object), the recommendation device can sort the at least one product from high to low according to the degree of semantic relevance between each of the at least one product and the target object, thereby displaying products with higher semantic relevance to users first.
[0144] As another example, for a food recipe platform, after selecting at least one recipe (second candidate object), the recommendation device can sort the at least one recipe from high to low according to the degree of semantic relevance between each recipe in the at least one recipe and the target object, thereby displaying recipes with higher semantic relevance to the user first.
[0145] As another example, for a travel guide platform, after selecting at least one tourist attraction (second candidate object), the recommendation device can sort at least one tourist attraction from high to low according to the degree of semantic relevance between each tourist attraction and the target object, thereby displaying tourist attractions with higher semantic relevance to users first.
[0146] It is understandable that after screening out the second candidate objects, the recommendation device sorts the second candidate objects according to their semantic relevance and displays the objects with higher semantic relevance first, which can improve the user experience when browsing.
[0147] Optionally, with respect to the above step S102, the recommendation device obtains object information of at least two first candidate objects related to the target object as completed by the second preset recommendation model in the recommendation device, and the recommendation device determines that the second candidate object is completed by the first preset recommendation model in the recommendation device from the at least two first candidate objects based on the semantic relevance between the first query information and the object information of each candidate object. After displaying the second candidate object, the recommendation device refers to Figure 6 , further comprising the following steps S601 to S603:
[0148] Step S601: Obtain feedback information for the second candidate object.
[0149] In the embodiment of the present application, after displaying the second candidate object, the recommendation device obtains feedback information on the second candidate object.
[0150] In some embodiments, the feedback information may be the user's click status and browsing information for the second candidate object, and may also be the user's score for the recommendation of the second candidate object; the specific feedback information can be determined based on actual conditions, and the embodiments of this application do not make specific limitations here.
[0151] Step S602: Determine the recommendation accuracy of the second candidate object according to the feedback information.
[0152] In some embodiments, the recommendation accuracy can be understood as whether the second candidate object recommended to the user is accurate, which indirectly represents the recommendation effect of the recommendation device. The recommendation accuracy can be determined based on feedback information; the specific recommendation accuracy can be determined based on actual conditions, and the embodiments of this application do not make specific limitations here.
[0153] Exemplarily, after obtaining the user's click and / or browsing status for the second candidate object, the recommendation device can obtain the user's click and / or browsing status for multiple second candidate objects, since there may be multiple second candidate objects, and then determine the recommendation accuracy of the second candidate object based on the sorting of the multiple second candidate objects and the user's click and / or browsing status for multiple second subsequent objects; similarly, after obtaining the user's score for the recommendation of the second candidate object, the recommendation device can determine the recommendation accuracy of the second candidate object based on the score.
[0154] Step S603: When the recommendation accuracy is less than the third threshold value, the second preset recommendation model and / or the first preset recommendation model are trained again.
[0155] In some embodiments, when the recommendation device determines that the recommendation accuracy is poor, it can choose to retrain the trained second preset recommendation model alone, or it can choose to retrain the trained first preset recommendation model alone, or it can retrain the trained second preset recommendation model and the first preset recommendation model at the same time; the specific training process can be selected according to actual conditions, and the embodiments of the present application do not make specific limitations here.
[0156] Optionally, with respect to the above step S603, the recommendation device trains the second preset recommendation model and / or the first preset recommendation model again, referring to Figure 7 , including the following steps S701 to S702:
[0157] Step S701: Mining sample log data to obtain mined log data; the sample log data is used to train the first initial recommendation model and the second initial recommendation model to obtain the second preset recommendation model and the first preset recommendation model.
[0158] In an embodiment of the present application, when the recommendation accuracy is less than a third threshold value, the recommendation device mines the sample log data to obtain mined log data; the sample log data is used to train the first initial recommendation model and the second initial recommendation model to obtain the second preset recommendation model and the first preset recommendation model. Training data.
[0159] In some embodiments, the sample log data may include historical purchase records, historical browsing records, historical search records, user portraits of different users, and historical click records, etc. of different users on different platforms; specific sample log data can be generated according to actual conditions, and the embodiments of this application do not make specific limitations here.
[0160] In some embodiments, the recommendation device first trains a first initial recommendation model and a second initial recommendation model based on sample log data to obtain a trained second preset recommendation model and a first preset recommendation model. Then, when the recommendation effect of the second preset recommendation model and the first preset recommendation model is poor, the sample log data is mined, and the mined log data is used to train the second preset recommendation model and / or the first preset recommendation model again, thereby improving the recommendation effect of the second preset recommendation model and the first preset recommendation model.
[0161] Step S702: Use the mined log data to fine-tune the model parameters in the second preset recommendation model and / or the first preset recommendation model to train the second preset recommendation model and / or the first preset recommendation model.
[0162] In some embodiments, after the recommendation device obtains the mined log data, it can use the mined log data alone to fine-tune the model parameters in the second preset recommendation model, or use the mined log data alone to fine-tune the model parameters in the first preset recommendation model, or use the mined log data to fine-tune the model parameters in both the second preset recommendation model and the first preset recommendation model at the same time; the specific fine-tuning method can be selected according to actual conditions, and the embodiments of the present application do not make specific limitations here.
[0163] Exemplarily, assuming that the second preset recommendation model is a BERT model, when fine-tuning the BERT model, only some parameters of the BERT model can be fine-tuned, such as the parameters of the output layer or a specific layer; assuming that the first preset recommendation model is an LLM model, when fine-tuning the LLM model, the model parameters of the LLM model can be adjusted by using the Low-Rank Adaptation of Large Language Models (LoRA) fine-tuning method; the specific fine-tuning method for the second preset recommendation model and / or the first preset recommendation model can be selected according to actual conditions, and the embodiments of the present application do not make specific limitations here.
[0164] It is understandable that the recommendation device in the present application can fine-tune the model parameters in the second preset recommendation model and / or the first preset recommendation model in real time according to the recommendation effect, which can further improve the recommendation effect of the model.
[0165] The above introduces the recommendation method provided in the embodiment of the present application. To facilitate understanding of the embodiment of the present application, the following introduces possible implementation solutions of the recommendation method applicable to the embodiment of the present application in the e-commerce scenario and the food recipe recommendation scenario.
[0166] 1. E-commerce Scenario
[0167] 1. Mine sample log data to find related materials or related users, and use this data to train a traditional recommendation model (the second preset recommendation model in the above embodiment). The model can be a BERT model or other models.
[0168] 2. Prepare an open source large model (the first preset recommendation model in the above embodiment), for example: baichuan2-13B.
[0169] 3. If the user has purchased "sports shoes" before, a first query information can be generated based on the user's historical purchase information of "sports shoes". The first query information can be input into the traditional recommendation model to recall a batch of related products, such as "sportswear", "sportspants", "sports socks" and "sports bracelets".
[0170] 4. Extract the title or description of each product (the object information in the above embodiment). Take the title as an example:
[0171] Sports shoes title: a certain brand of sports shoes for men, summer dad shoes for men, mesh and leather casual shoes, breathable and lightweight running shoes for men;
[0172] Sportswear title: A certain brand of short-sleeved men's summer running breathable fitness ice silk quick-drying T-shirt men's sports tops;
[0173] Sports pants title: Ice silk black casual pants men's summer thin straight loose quick-drying breathable sports long pants drape wide leg;
[0174] Sports socks title: a certain brand of socks, men's and women's mid-tube summer sports socks, long socks, basketball socks, spring and autumn pure cotton white short tube;
[0175] Sports bracelet title: A certain brand of bracelet 9NFC smart sports men and women sleep heart rate blood oxygen health monitoring swimming waterproof multi-function 8.
[0176] Generate the following request based on the title of each product:
[0177] I have a title (the object information of the target object in the above embodiment) that reads: A certain brand of sports shoes for men, summer dad shoes for men, mesh and leather casual shoes, breathable and lightweight running shoes for men. The candidate titles (the object information of at least two first candidate objects in the above embodiment) are as follows:
[0178] (1) A certain brand of short-sleeved men's summer running breathable fitness ice silk quick-drying T-shirt men's sports top.
[0179] (2) Ice silk black casual pants for men in summer, thin straight loose quick-drying breathable sports trousers with drape and wide legs.
[0180] (3) A certain brand of socks for men and women, mid-length summer sports socks, long socks, basketball socks, spring and autumn pure cotton white short socks.
[0181] (4) A certain brand of wristband 9 NFC smart sports bracelet for men and women, sleep, heart rate, blood oxygen health monitoring, swimming, waterproof and multifunctional 8.
[0182] Please help me sort the candidate titles and titles by relevance, and output the sorting results as the corresponding candidate title numbers, such as (2)(4)(1)(3).
[0183] 5. Input the above request into baichuan2-13B, output the sorting results, select the first few products (second candidate objects) and return them to the front end for display.
[0184] 6. If the recommendation effect of the model in step 5 is poor, you can mine sample log data to fine-tune the traditional recommendation model and / or baichuan2-13B LoRA.
[0185] 2. Recommended food recipe scenarios
[0186] 1. Input a query (the first query information in the above embodiment) and use the prompt + LLM model (the preset judgment model in the above embodiment) to determine whether the query needs to be recommended. For example:
[0187] (1) Query1 is "Hello, what should I call you" and prompt is "Help me determine whether this sentence should be recommended, sentence:", then the input is prompt + Query1, that is, "Help me determine whether this sentence should be recommended, sentence: Hello, what should I call you". This sentence is obviously not a recommendation, and the LLM can directly return the judgment result.
[0188] (2) Query2 is "Please recommend me a Sichuan dish that is easy to make", prompt is "Please help me determine whether this sentence should be recommended, sentence:", then the input is prpmpt+Query2, that is, "Please help me determine whether this sentence should be recommended, sentence: Please recommend me a Sichuan dish that is easy to make". If this sentence needs to be recommended, then proceed to the following steps.
[0189] 2. Input Query 2 "Recommend me a good Sichuan dish" into the traditional recommendation model, and use the traditional recommendation model to return results related to "Sichuan cuisine" in "Recommend me a good Sichuan dish" (at least two first-place candidates), such as "Mapo Tofu", "Twice-Cooked Pork", "Kung Pao Chicken", and "Spicy Chicken".
[0190] 3. Based on the recall results and Query 2, "Recommend me a good Sichuan dish," the following request is generated:
[0191] Please recommend me a Sichuan dish that is easy to make. I have the following candidates: Mapo Tofu, Twice-Cooked Pork, Kung Pao Chicken, and Spicy Chicken. Please sort these candidates.
[0192] 4. Input the above request into baichuan2-13B, output the sorting result, select the first few Sichuan dishes (second candidate objects) and return them to the front end, that is, display them on the front end.
[0193] 5. If the recommendation effect of the model in step 4 is poor, you can mine sample log data to fine-tune the traditional recommendation model and / or baichuan2-13B LoRA.
[0194] Furthermore, the traditional recommendation model and baichuan2-13B can be deployed as two services respectively, providing two interfaces. Calling the model through the interfaces can improve fault tolerance.
[0195] Based on the foregoing embodiments, an embodiment of the present application provides a recommended device, which includes the various units included and the various modules included in each unit, and can be implemented by a processor in a computer device; of course, it can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA), etc.
[0196] Figure 8 A schematic diagram of the structure of a recommended device provided in an embodiment of the present application is shown in FIG. Figure 8 As shown, the recommendation device 800 includes: a receiving module 810, an acquisition module 820, a determination module 830 and a display module 840, wherein:
[0197] The receiving module 810 is configured to receive first inquiry information;
[0198] The acquisition module 820 is configured to acquire object information of at least two first candidate objects related to the target object when the first query information is used to request a recommendation for the target object;
[0199] The determining module 830 is configured to determine a second candidate object from the at least two first candidate objects based on the semantic relevance between the first query information and the object information of each candidate object by using a first preset recommendation model;
[0200] The display module 840 is configured to display the second candidate object.
[0201] In some embodiments, the acquisition module 820 is further configured to:
[0202] generating a first determination request based on the first query information and the first request text; the first determination request is used to determine whether the first query information is used to request a recommendation for the target object;
[0203] When the determination result of the first determination request is the first result, it is determined that the first query information is used to request a recommendation for a target object.
[0204] In some embodiments, the acquisition module 820 is further configured to:
[0205] Determining a plurality of first candidate objects in a preset object library that have an association relationship with the target object;
[0206] The candidate objects among the multiple first candidate objects whose correlation with the target object is greater than a first threshold are determined as the at least two first candidate objects; and object information of the at least two first candidate objects is acquired.
[0207] In some embodiments, the determining module 830 is further configured to:
[0208] Obtaining object information of the target object in the first inquiry information;
[0209] Determining a semantic correlation between the object information of the target object and the object information of each candidate object, and obtaining at least two semantic correlations corresponding to the at least two first candidate objects;
[0210] The first candidate object corresponding to the semantic relevance degree greater than the second threshold value among the at least two semantic relevance degrees is determined as the second candidate object.
[0211] In some embodiments, the display module 840 is further configured to:
[0212] sorting the at least one second candidate object based on the semantic relevance corresponding to each second candidate object in the at least one second candidate object to obtain at least one sorted second candidate object;
[0213] The at least one ranked second candidate object is displayed.
[0214] In some embodiments, the acquiring of object information of at least two first candidate objects related to the target object is completed using a second preset recommendation model, and the determining of a second candidate object from the at least two first candidate objects based on the semantic relevance between the first query information and the object information of each candidate object is completed using the first preset recommendation model. The acquiring module 820 is further configured to:
[0215] Obtaining feedback information for the second candidate object;
[0216] determining a recommendation accuracy of the second candidate object according to the feedback information;
[0217] When the recommendation accuracy is less than a third threshold, the second preset recommendation model and / or the first preset recommendation model are trained again.
[0218] In some embodiments, the acquisition module 820 is further configured to:
[0219] Mining the sample log data to obtain mined log data; the sample log data is used as training data for training the first initial recommendation model and the second initial recommendation model to obtain the second preset recommendation model and the first preset recommendation model;
[0220] The mined log data is used to fine-tune model parameters in the second preset recommendation model and / or the first preset recommendation model to train the second preset recommendation model and / or the first preset recommendation model.
[0221] The description of the above device embodiment is similar to the description of the above method embodiment and has similar beneficial effects as the method embodiment. In some embodiments, the functions or modules included in the device provided in the embodiments of the present application can be used to perform the methods described in the above method embodiments. For technical details not disclosed in the device embodiments of the present application, please refer to the description of the method embodiments of the present application for understanding.
[0222] It should be noted that, in the embodiment of the present application, if the above-mentioned recommended method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application, or the part that contributes to the relevant technology, can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk. In this way, the embodiment of the present application is not limited to any specific hardware, software or firmware, or any combination of hardware, software and firmware.
[0223] An embodiment of the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, some or all of the steps in the above method are implemented.
[0224] The present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements some or all of the steps in the above method. The computer-readable storage medium may be transient or non-transient.
[0225] An embodiment of the present application provides a computer program, including computer-readable code. When the computer-readable code is run in a computer device, a processor in the computer device executes some or all of the steps for implementing the above method.
[0226] An embodiment of the present application provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and when the computer program is read and executed by a computer, implements some or all of the steps in the above method. The computer program product can be implemented specifically by hardware, software, or a combination thereof. In some embodiments, the computer program product is embodied as a computer storage medium. In other embodiments, the computer program product is embodied as a software product, such as a software development kit (SDK), etc.
[0227] It should be noted that the descriptions of the various embodiments above tend to emphasize the differences between the various embodiments, and their similarities or similarities can be referenced to each other. The descriptions of the above device, storage medium, computer program, and computer program product embodiments are similar to the descriptions of the above method embodiments and have similar beneficial effects as the method embodiments. For technical details not disclosed in the embodiments of the device, storage medium, computer program, and computer program product of this application, please refer to the description of the method embodiments of this application for understanding.
[0228] Figure 9 A hardware entity diagram of a computer device provided in an embodiment of the present application is shown as follows: Figure 9 As shown, the hardware entity of the computer device 900 includes: a processor 901 and a memory 902, wherein the memory 902 stores a computer program that can be run on the processor 901, and the processor 901 implements the steps of the method of any of the above embodiments when executing the program.
[0229] The memory 902 stores computer programs that can be run on the processor. The memory 902 is configured to store instructions and applications executable by the processor 901. It can also cache data to be processed or processed by the processor 901 and various modules in the computer device 900 (for example, image data, audio data, voice communication data, and video communication data). This can be implemented through flash memory (FLASH) or random access memory (RAM).
[0230] When the processor 901 executes the program, the steps of any of the above-mentioned recommended methods are implemented. The processor 901 generally controls the overall operation of the computer device 900.
[0231] An embodiment of the present application provides a computer storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the steps of the recommended method in any of the above embodiments.
[0232] An embodiment of the present application provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements some or all of the steps in the above-mentioned recommended method.
[0233] It should be noted that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.
[0234] The processor may be at least one of an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a central processing unit (CPU), a controller, a microcontroller, and a microprocessor. It is understood that the electronic device that implements the functions of the processor may also be other electronic devices, which are not specifically limited in the embodiments of the present application.
[0235] The above-mentioned computer storage medium / memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory (Flash Memory), a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); it can also be various terminals including one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.
[0236] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned steps / processes does not mean the order of execution, and the execution order of each step / process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The above-mentioned serial numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments.
[0237] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.
[0238] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0239] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed across multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the scheme of this embodiment.
[0240] In addition, all functional units in the embodiments of the present application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the above-mentioned integrated units can be implemented in the form of hardware or in the form of hardware plus software functional units.
[0241] Those skilled in the art will understand that all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM), magnetic disks or optical disks, and other media that can store program codes.
[0242] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the relevant technology, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0243] The above is only an implementation method of the present application, but the scope of protection of the present application is not limited thereto. Any technician familiar with this technical field can easily think of changes or replacements within the technical scope disclosed in this application, which should be covered by the scope of protection of the present application.
Claims
1. A recommendation method, characterized in that: include: receiving a first inquiry message; When the first query information is used to request a recommendation for a target object, obtaining object information of at least two first candidate objects related to the target object; Determining a second candidate object from the at least two first candidate objects based on a semantic relevance between the first query information and the object information of each candidate object using a first preset recommendation model; The second candidate object is displayed.
2. The method according to claim 1, characterized in that After receiving the first inquiry information, the method further includes: generating a first determination request based on the first query information and the first request text; the first determination request is used to determine whether the first query information is used to request a recommendation for the target object; When the determination result of the first determination request is the first result, it is determined that the first query information is used to request a recommendation for a target object.
3. The method according to claim 1, characterized in that The acquiring object information of at least two first candidate objects related to the target object includes: Determining a plurality of first candidate objects in a preset object library that have an association relationship with the target object; The candidate objects among the multiple first candidate objects whose correlation with the target object is greater than a first threshold are determined as the at least two first candidate objects; and object information of the at least two first candidate objects is acquired.
4. The method according to claim 1, wherein The determining of a second candidate object from the at least two first candidate objects based on the semantic relevance between the first query information and the object information of each candidate object includes: Obtaining object information of the target object in the first inquiry information; Determining a semantic correlation between the object information of the target object and the object information of each candidate object, and obtaining at least two semantic correlations corresponding to the at least two first candidate objects; The first candidate object corresponding to the semantic relevance degree greater than the second threshold value among the at least two semantic relevance degrees is determined as the second candidate object.
5. The method according to claim 4, characterized in that The second candidate objects include at least one second candidate object, and the displaying of the second candidate objects includes: sorting the at least one second candidate object based on the semantic relevance corresponding to each second candidate object in the at least one second candidate object to obtain at least one sorted second candidate object; The at least one ranked second candidate object is displayed.
6. The method according to any one of claims 1 to 5, characterized in that The acquiring of object information of at least two first candidate objects related to the target object is completed by a second preset recommendation model.
7. The method according to claim 6, characterized in that The method further comprises: Obtaining feedback information for the second candidate object; determining a recommendation accuracy of the second candidate object according to the feedback information; When the recommendation accuracy is less than a third threshold, the second preset recommendation model and / or the first preset recommendation model are trained again.
8. The method according to claim 7, characterized in that The retraining of the second preset recommendation model and / or the first preset recommendation model includes: Mining the sample log data to obtain mined log data; the sample log data is used as training data for training the first initial recommendation model and the second initial recommendation model to obtain the second preset recommendation model and the first preset recommendation model; The mined log data is used to fine-tune model parameters in the second preset recommendation model and / or the first preset recommendation model to train the second preset recommendation model and / or the first preset recommendation model.
9. A recommendation device, characterized in that: The device comprises: A receiving module, configured to receive first inquiry information; an acquisition module, configured to, when the first query information is used to request a recommendation for a target object, acquire object information of at least two first candidate objects related to the target object; a determination module, configured to determine a second candidate object from the at least two first candidate objects based on a semantic relevance between the first query information and the object information of each candidate object; A display module is used to display the second candidate object.
10. A computer device, characterized in that: The device includes: a processor, a memory, and a communication bus; when the processor executes the running program stored in the memory, the method according to any one of claims 1 to 8 is implemented.
11. A computer-readable storage medium, characterized in that A computer program is stored thereon, and when the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
12. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the method according to any one of claims 1 to 8 is implemented.