Recommendation method and device based on large language model

Through large language model dialogue interaction, the user's recommendation preferences are obtained and recommendation reasons are generated, which solves the accuracy and interpretability problems of the existing recommendation system and improves the accuracy and success rate of recommendations.

CN118535800APending Publication Date: 2024-08-23BEIJING BAIDU NETCOM SCI & TECH CO LTD

Patent Information

Application Number
CN202410650079.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-23
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

Existing recommendation systems rely on users' historical clicks or browsing behaviors to make recommendations, resulting in low accuracy and poor interpretability of recommendations, which affects the success rate of recommendations.

Method used

A recommendation method based on a large language model is used to determine the dialogue needs through the initial text input by the user, conduct at least one round of dialogue to obtain the user's recommendation preferences, and generate candidate recommendation objects and their recommendation reasons for display.

Benefits of technology

It improves the accuracy of recommendation preferences and candidate recommendation objects, enhances the interpretability of recommendations, and thereby increases the success rate of recommendations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118535800A
    Figure CN118535800A
Patent Text Reader

Abstract

The invention provides a recommendation method based on a large language model, and relates to the technical field of artificial intelligence such as large language models, natural language processing and deep learning. The recommendation method based on the large language model comprises the steps that an initial text input by a user is input into the large language model, and the dialogue requirement of the user is determined through the large language model; under the condition that the dialogue demand is determined to be recommended to the object, initiating at least one round of dialogue to the user by the large language model; according to a reply text input by the user for at least one round of dialogue, recommendation preferences of the user are obtained through the large language model; obtaining at least one candidate recommendation object corresponding to the recommendation preference, and generating a recommendation reason of the at least one candidate recommendation object by a large language model; and displaying the at least one candidate recommendation object and the corresponding recommendation reason as a recommendation result. According to the method and the device, the accuracy of the obtained recommendation preference and the candidate recommendation object can be improved, the interpretability during object recommendation is enhanced, and the success rate of recommendation is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of Internet technology, and in particular to the field of artificial intelligence technology such as large language models, natural language processing, and deep learning. A recommendation method, device, electronic device, and readable storage medium based on a large language model are provided. Background Art

[0002] In recent years, recommendation systems have achieved great success in the Internet industry. Recommendation systems learn user preferences based on user personal information and knowledge such as click and browse behaviors, and recommend suitable objects to users based on their preferences. However, recommendation systems in the prior art usually use "implicit feedback" such as user historical clicks or browsing behaviors to learn user preferences, which has inaccurate problems, resulting in technical problems such as low accuracy of objects recommended to users by recommendation systems, and recommendation systems usually only directly recommend corresponding objects to users, and the interpretability of recommendations is low, which in turn affects the success rate of recommendations. Summary of the invention

[0003] According to a first aspect of the present disclosure, a recommendation method based on a large language model is provided, comprising: inputting an initial text input by a user into a large language model, and determining, by the large language model, a conversation requirement of the user; in a case where it is determined that the conversation requirement is an object recommendation, initiating, by the large language model, at least one round of conversation with the user; obtaining, by the large language model, a recommendation preference of the user based on a reply text input by the user for the at least one round of conversation; obtaining at least one candidate recommendation object corresponding to the recommendation preference, and generating, by the large language model, a recommendation reason for the at least one candidate recommendation object; and presenting the at least one candidate recommendation object and its corresponding recommendation reason as a recommendation result to the user.

[0004] According to the second method of the present disclosure, a recommendation device based on a large language model is provided, comprising: a determination unit, used to input an initial text input by a user into a large language model, and the large language model determines the dialogue needs of the user; a dialogue unit, used to initiate at least one round of dialogue with the user by the large language model when the dialogue need is determined to be an object recommendation; a processing unit, used to obtain the user's recommendation preference by the large language model based on the reply text input by the user for the at least one round of dialogue; a generation unit, used to obtain at least one candidate recommendation object corresponding to the recommendation preference, and the large language model generates a recommendation reason for the at least one candidate recommendation object; a recommendation unit, used to display the at least one candidate recommendation object and its corresponding recommendation reason as a recommendation result to the user.

[0005] According to a third aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method as described above.

[0006] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the method as described above.

[0007] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein the computer program implements the method as described above when executed by a processor.

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

[0009] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0010] Figure 1 is a schematic diagram according to a first embodiment of the present disclosure;

[0011] Figure 2 is a schematic diagram according to a second embodiment of the present disclosure;

[0012] Figure 3 is a schematic diagram according to a third embodiment of the present disclosure;

[0013] Figure 4 is a schematic diagram according to a fourth embodiment of the present disclosure;

[0014] Figure 5 The invention is a block diagram of an electronic device for implementing the recommendation method based on a large language model according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0015] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and mechanisms is omitted in the following description.

[0016] Figure 1Schematic diagram of the first embodiment of the present disclosure. Figure 1 As shown, the recommendation method based on the large language model of this embodiment specifically includes the following steps:

[0017] S101, inputting an initial text input by a user into a large language model, and determining the dialogue requirements of the user by the large language model;

[0018] S102: When it is determined that the conversation requirement is object recommendation, the large language model initiates at least one round of conversation with the user;

[0019] S103, obtaining the user's recommendation preference by the large language model according to the reply text input by the user for the at least one round of dialogue;

[0020] S104, obtaining at least one candidate recommendation object corresponding to the recommendation preference, and generating a recommendation reason for the at least one candidate recommendation object by the large language model;

[0021] S105: Display the at least one candidate recommendation object and its corresponding recommendation reason as a recommendation result to the user.

[0022] The recommendation method based on the large language model of this embodiment, on the one hand, initiates at least one round of dialogue with the user through the large language model during the recommendation process, and the large language model obtains the user's recommendation preferences in real time based on the reply text input by the user for each round of dialogue, so that the obtained recommendation preferences are more in line with the user's current needs, which can improve the accuracy of the obtained recommendation preferences, and then improve the accuracy of the candidate recommendation objects obtained according to the recommendation preferences; on the other hand, during the recommendation process, the large language model generates recommendation reasons for the candidate recommendation objects, and recommends them to the user together with the candidate recommendation objects as recommendation results, which can enhance the explainability of the recommendation objects and then improve the success rate of the recommendation.

[0023] The Large Language Model (LLM) in this embodiment is a deep learning model trained based on massive text data. It can not only generate natural language text, but also deeply understand the meaning of the text, so it can be used to process various natural language tasks, such as text summary generation, question answering, translation, etc.

[0024] In this embodiment, the objects recommended based on the large language model can be different types of commodities such as clothing, food, automobiles, digital products, etc., or different types of multimedia content such as books, music, videos, etc.; this embodiment can be used to recommend only one type of object, such as only clothing, or only music, etc., or it can be used to recommend multiple types of objects at the same time, such as recommending clothing and automobiles at the same time, recommending music and food at the same time, or recommending automobiles, clothing and videos at the same time, etc.

[0025] The execution subject of the recommendation method based on the large language model of this embodiment can be an application software (APP) in the terminal; for example, when recommending objects such as clothing, food, digital products, etc., the execution subject in this embodiment can be an e-commerce APP, when recommending objects such as cars, the execution subject in this embodiment can be a vehicle APP, and when recommending objects such as books, music, videos, etc., the execution subject in this embodiment can be a multimedia APP.

[0026] In addition, before making recommendations based on the large language model, this embodiment can also obtain object information corresponding to different types of objects and build an object database, so that the large language model can obtain the object information of the object from the object database; in this embodiment, the acquired object information includes an introduction to the object (such as the launch time or release time of the object, the author or manufacturer of the object, etc.), the attributes of the object (such as the color of the object, the material of the object, the type of the object, the price level of the object), relevant knowledge of the object (such as how to use the object, precautions for the object), etc.

[0027] In this embodiment, when executing S101, the dialogue requirements determined by the large language model for the initial text input by the user may include, in addition to object recommendation, one of small talk and knowledge question and answer.

[0028] When executing S101 in this embodiment, the large language model can first extract keywords from the initial text, and then determine the user's dialogue needs based on the extracted keywords; the large language model in this embodiment can extract words with preset parts of speech (such as verbs) from the initial text as keywords.

[0029] For example, if the keywords extracted from the initial text are "want", "want to buy", "recommend", etc., the large language model in this embodiment can determine that the user's conversation need is object recommendation when executing S101; if the keywords extracted from the initial text are "introduction", "explanation", "answer", etc., the large language model in this embodiment can determine that the user's conversation need is knowledge question and answer when executing S101; if the keywords extracted from the initial text are "like", "chat", etc., the large language model in this embodiment can determine that the user's conversation need is chatting when executing S101.

[0030] In this embodiment, after executing S101, the large language model determines the dialogue demand of the user, and then executes S102, when it is determined that the dialogue demand is an object recommendation, the large language model initiates at least one round of dialogue with the user.

[0031] When executing S102, the large language model in this embodiment can directly obtain at least one preset text to initiate at least one round of dialogue with the user, that is, the large language model in this embodiment can use the existing text to initiate a dialogue with the user.

[0032] In addition, when executing S102 and initiating at least one round of dialogue with the user by the large language model, this embodiment can adopt the following implementation method: the large language model generates at least one preference question text based on at least one target preference option obtained from the initial text; and uses the at least one preference question text to initiate at least one round of dialogue with the user.

[0033] That is to say, this embodiment can also make use of the generation capability of the large language model to generate preference question texts corresponding to different target preference options in real time according to at least one target preference option obtained from the initial text, thereby initiating at least one round of dialogue with the user.

[0034] When executing S102, the large language model in this embodiment can use each generated preference question text to initiate different rounds of dialogue with the user, that is, one preference question text corresponds to one round of dialogue, and the number of initiated dialogue rounds is the same as the number of generated preference question texts.

[0035] It is understandable that, in this embodiment, when executing S102, the large language model may also directly obtain a preset preference option as at least one target preference option, and then generate different preference question texts according to different target preference options.

[0036] However, in actual application scenarios, when an APP in a terminal makes recommendations based on a large language model, it can usually only support the recommendation of a small number of objects. For example, a music APP only supports music recommendations, and an e-commerce APP only supports clothing, food, etc. However, users may input the demand for clothing recommendations in a music APP, or input the demand for music recommendations in an e-commerce APP, etc.

[0037] Therefore, when executing S102 in which the large language model obtains at least one target preference option based on the initial text to generate at least one preference question text, the following implementation method can be adopted in this embodiment: the large language model extracts the entity words contained in the initial text, and determines the type of object to be recommended based on the extracted entity words; when it is determined that the type of object to be recommended is a preset type, obtains a preset preference option corresponding to the preset type as at least one target preference option, and different preset types correspond to different preset preference options in this embodiment; the large language model generates at least one preference question text based on at least one target preference option; different target preference options correspond to different preference question texts in this embodiment, and each preference question text is used to conduct a round of dialogue with the user.

[0038] That is to say, the large language model in this embodiment obtains the preset preference option corresponding to the preset type as at least one target preference option only when it is determined that the type of the recommended object corresponding to the initial text is consistent with the preset type, and then generates different preference question texts, which can improve the accuracy of the obtained target preference options and the generated preference question texts, thereby improving the success rate of the recommendation.

[0039] For example, if the initial text is "I want to buy a car", the entity word extracted by the large language model from the initial text is "car", thereby determining that "car" is the type of object to be recommended. If the preset type in this embodiment is "car", the large language model in this embodiment will obtain the preset preference option corresponding to "car" as at least one target preference option when executing S102; if the preset type in this embodiment is "music", the type of object to be recommended does not match the preset type, and the large language model in this embodiment will output the corresponding text, prompting the user that "car" cannot be recommended, and only "music" can be recommended.

[0040] When the large language model of this embodiment executes S102 to generate different preference question texts according to different target preference options, it can select different target preference options for each round of dialogue, and then generate a preference question text corresponding to the current round of dialogue according to the selected target preference options.

[0041] For example, if the target preference options include option 1 and option 2, the large language model of this embodiment can generate a preference question text corresponding to the first round of dialogue according to option 1, and generate a preference question text corresponding to the second round of dialogue according to option 2 when executing S102; wherein, when the type of object to be recommended is "car", option 1 can be "SUV or sedan", option 2 can be "is the vehicle grade A, B or C", and the generated preference question text corresponding to option 1 can be "is the vehicle you want to buy an SUV or a sedan", and the generated preference question text corresponding to option 2 can be "is the vehicle you want to buy an A, B or C".

[0042] When the large language model of this embodiment executes S102 to generate at least one preference question text according to at least one target preference option, it may also include the following contents: acquiring the speaking style of the salesperson; and generating at least one preference question text by the large language model according to the acquired speaking style and at least one target preference option.

[0043] That is to say, this embodiment can make the generated preference question text more consistent with the speaking style of sales personnel in real scenarios, thereby enhancing the dialogue effect between the large language model and the user.

[0044] When executing S101, the large language model may determine that the conversation needs include other than object recommendation, that is, the initial text input by the user includes multiple conversation needs. When executing S102, the large language model may only determine that the conversation need of the user is object recommendation, or the large language model may simultaneously determine multiple conversation needs, thereby generating a corresponding reply text for each conversation need according to the initial text.

[0045] In addition, when executing S102, this embodiment may also include the following content: when it is determined that the dialogue requirement is not a dialogue recommendation, the large language model obtains a recommendation guide text and displays it to the user, and the recommendation guide text is used to guide the user to input text related to the recommendation.

[0046] Among them, when executing S102 in this embodiment, the large language model can obtain the preset recommendation guidance text, and can also generate the recommendation guidance text in real time according to the preset type; for example, if the preset type is "vehicle", the recommendation guidance text generated by the large language model of this embodiment can be "I can't answer your question, you can enter "Recommend a vehicle to me"".

[0047] It is understandable that, since the large language model itself has rich knowledge and strong text generation capabilities, when it is determined that the dialogue requirement is not recommended for dialogue, the large language model in this embodiment can also generate corresponding reply text based on the initial text entered by the user.

[0048] For example, when the dialogue requirement is "small talk", the large language model generates chat text based on the initial text entered by the user; when the dialogue requirement is "knowledge question and answer", the large language model queries for relevant content based on the initial text entered by the user, and then generates answer text based on the query results.

[0049] In this embodiment, the large language model can answer questions raised by users based on a knowledge base corresponding to a preset type, for example, using a vehicle knowledge base to answer vehicle-related questions raised by users, and using a music knowledge base to answer music-related questions raised by users; if the question entered by the user exceeds the scope of the knowledge base (for example, when the knowledge base corresponds to vehicle knowledge, the user enters a question related to music), the large language model may choose not to answer and use recommended guidance text to guide the user.

[0050] In this embodiment, after executing S102, the large language model initiates at least one round of dialogue with the user, and then executes S103 to obtain the user's recommended preference based on the reply text input by the user for at least one round of dialogue. In this embodiment, the reply text input by the user for each round of dialogue is the reply text input by the user for the preference question text corresponding to each round of dialogue.

[0051] When executing S103, the large language model in this embodiment can merge the selection results contained in the reply text input by the user for each round of dialogue (ie, each preference question text), and use the merged result as the user's recommended preference.

[0052] For example, if the user inputs the reply text "sedan" for the preference question text corresponding to the first round of dialogue, and if the user inputs the reply text "B-class car" for the preference question text corresponding to the second round of dialogue, then the large language model of this embodiment can use "B-class car" as the user's recommended preference when executing S103.

[0053] When executing S103 to obtain the user's recommendation preference by the large language model based on the reply text input by the user for at least one round of dialogue, this embodiment may also include the following contents: determining the initial recommendation preference based on the reply text input by the user for at least one round of dialogue; obtaining the preference modification text input by the user; and obtaining the user's recommendation preference by the large language model by adjusting the determined initial recommendation preference based on the obtained preference modification text.

[0054] That is to say, the large language model in this embodiment can also modify the text according to the preferences entered by the user after completing the conversation, adjust the preferences determined by the reply text entered by the user during the conversation, and then use the adjusted preferences as the final recommended preferences of the corresponding user, thereby improving the flexibility in determining the recommended preferences and the accuracy of the determined recommended preferences.

[0055] For example, if the determined initial recommendation preference is "B-class sedan", and if the preference adjustment text input by the user is "I want a C-class car", the large language model in this embodiment may use "C-class sedan" as the user's recommendation preference when executing S103.

[0056] After executing S103 to obtain the user's recommendation preference from the large language model, this embodiment executes S104 to obtain at least one candidate recommendation object corresponding to the recommendation preference, and generates a recommendation reason for the at least one candidate recommendation object from the large language model.

[0057] When executing S104, this embodiment can combine the existing recommendation method to obtain at least one candidate recommendation object corresponding to the recommendation preference from the object database, for example, the recommendation objects in the object database that are ranked in the top N in terms of matching degree with the recommendation preference are used as candidate recommendation objects, where N is a positive integer greater than or equal to 1.

[0058] In this embodiment, when executing S104 to generate a recommendation reason for at least one candidate recommendation object by the large language model, the user's recommendation preference and the object information of each candidate recommendation object can be input into the large language model, so that the large language model generates a recommendation reason for the candidate recommendation object.

[0059] It is understandable that, when executing S104, this embodiment can also obtain a preset prompt text (i.e., prompt), such as "Please explain why you recommend this object based on the object information and recommendation preferences entered", and input the obtained preset text together with the object information and recommendation preferences into the large language model.

[0060] In this embodiment, S104 is performed to generate a recommendation reason by the large language model, which is used to reflect the degree of match between the candidate recommendation object and the user's recommendation preference, thereby explaining to the user why the candidate recommendation object is recommended.

[0061] When executing S104, this embodiment may also obtain the user's historical preferences, and then the large language model generates a recommendation reason for at least one candidate recommendation object based on the obtained historical preferences, the object information of at least one candidate recommendation object, and the recommendation preferences.

[0062] That is to say, the large language model of this embodiment can also combine the user's historical preferences to generate recommendation reasons for candidate recommendation objects, so that the generated recommendation reasons contain richer content, thereby improving the success rate of the recommendation.

[0063] For example, if the user's recommendation preference is "C-class sedan", and if the historical preference obtained based on the user's historical browsing behavior, historical clicking behavior, etc. is "family sedan", when the large language model of this embodiment executes S104, in addition to the two perspectives of vehicle grade and vehicle type of the candidate recommendation object, it will also combine the perspective of vehicle purpose to jointly generate the recommendation reason for the candidate recommendation object.

[0064] For example, the generated recommendation reason may be "the car has a luxurious appearance, elegant interior, strong power and excellent handling, meets the standards of a C-class car, and has ample interior space, and the trunk capacity is sufficient to meet family outings or daily cargo needs"; if no historical preferences are obtained, the generated recommendation reason does not include "and the interior space is relatively ample, and the trunk capacity is sufficient to meet family outings or daily cargo needs".

[0065] In this embodiment, after executing S104 to generate a recommendation reason for at least one candidate recommendation object by the large language model, executing S105 to display the at least one candidate recommendation object and its corresponding recommendation reason as a recommendation result to the user.

[0066] That is to say, when executing S105 to display the recommendation results to the user, this embodiment will not only display the candidate recommendation objects corresponding to the user's recommendation preferences, but also display the recommendation reasons for the candidate recommendation objects, so that the user can more clearly understand the reasons for recommending the candidate recommendation objects.

[0067] When executing S105 and taking the candidate recommendation object and its corresponding recommendation reason as the recommendation result, this embodiment can further obtain the link corresponding to the candidate recommendation object and display it to the user together. The user can enter the purchase page or viewing interface of the candidate recommendation object by clicking the link.

[0068] Figure 2 is a schematic diagram according to the second embodiment of the present disclosure. Figure 2 As shown, in this embodiment, when "generating at least one preference question text by the large language model according to at least one target preference option obtained from the initial text", the following implementation method can be adopted:

[0069] S201, extracting entity words from the initial text by the large language model, and determining the type of object to be recommended according to the entity words;

[0070] S202: generating at least one target preference option according to the type of the object to be recommended;

[0071] S203: Generate at least one preference question text according to the at least one target preference option.

[0072] That is to say, this embodiment, with the help of the generation capability of the large language model itself, generates in real time at least one target preference option corresponding to the type of object to be recommended determined from the initial text, thereby overcoming the problem that a terminal APP only supports the recommendation of a small number of objects, thereby improving the scope of application of object recommendation.

[0073] When executing S202, the large language model in this embodiment can first obtain a preset prompt text (i.e., prompt), such as "Please generate corresponding preference options based on the input type of object to be recommended", and then input the obtained preset prompt text and the type of object to be recommended into the large language model.

[0074] For example, if the type of object to be recommended is "music", when the large language model of this embodiment is on paper S202, the target preference options generated for "music" may include option 1 and option 2, option 1 may be "male singer or female singer", option 2 may be "song type is lyrical, dynamic or quiet", etc.

[0075] Figure 3 is a schematic diagram according to the third embodiment of the present disclosure. Figure 3 As shown, in this embodiment, when "generating the at least one preference question text by the large language model according to the at least one target preference option", the following implementation method can be adopted:

[0076] S301, when generating a preference question text corresponding to the current round of dialogue, the large language model obtains a reply text input by the user for the previous round of dialogue;

[0077] S302: Generate a preference question text corresponding to the current round of dialogue according to the reply text and the target preference options corresponding to the current round of dialogue.

[0078] That is to say, this embodiment can rewrite the preference question texts corresponding to different rounds of conversations, thereby improving the fluency of conversations with users, and the preference question texts corresponding to the current round of conversations include the preferences determined by the user in the previous conversation process, and can also make it easier for the user to modify the previously determined preferences during the current round of conversations.

[0079] For example, if the preference question text corresponding to the first round of dialogue is "Do you want to buy an SUV or a sedan?", and if the user inputs the reply text "sedan" for the preference question text, then the large language model in this embodiment may generate the preference question text corresponding to the second round of dialogue as "Do you want to buy an A-class, B-class, or C-class sedan?".

[0080] Based on the above embodiments, when generating a preference question text, this embodiment can first generate at least one target preference option by a large language model based on the type of object to be recommended corresponding to the entity words in the initial text, and then generate a preference question text corresponding to the current round of dialogue based on different target preference options and the reply text entered by the user for the previous round of dialogue.

[0081] Figure 4 is a schematic diagram according to the fourth embodiment of the present disclosure. Figure 4 As shown, the recommendation device 400 based on the large language model of this embodiment includes:

[0082] The determining unit 401 is used to input the initial text input by the user into the large language model, and the large language model determines the dialogue demand of the user;

[0083] A dialogue unit 402 is configured to initiate at least one round of dialogue with the user by the large language model when determining that the dialogue requirement is an object recommendation;

[0084] The processing unit 403 is configured to obtain the user's recommendation preference from the large language model according to the reply text input by the user for the at least one round of dialogue;

[0085] A generating unit 404 is configured to obtain at least one candidate recommendation object corresponding to the recommendation preference, and generate a recommendation reason for the at least one candidate recommendation object by the large language model;

[0086] The recommendation unit 405 is used to display the at least one candidate recommendation object and its corresponding recommendation reason as a recommendation result to the user.

[0087] The large language model in the determination unit 401 determines the dialogue requirements based on the initial text input by the user, which may include, in addition to object recommendation, one of small talk and knowledge question and answer.

[0088] The large language model in the determination unit 401 can first extract keywords from the initial text, and then determine the user's dialogue needs based on the extracted keywords; the large language model in this embodiment can extract words with preset parts of speech (such as verbs) from the initial text as keywords.

[0089] In this embodiment, after the determination unit 401 determines the user's dialogue demand through the large language model, the dialogue unit 402 initiates at least one round of dialogue with the user through the large language model when determining that the dialogue demand is an object recommendation.

[0090] The dialogue unit 402 can directly obtain at least one preset text from the large language model to initiate at least one round of dialogue with the user, that is, the large language model in this embodiment can use the existing text to initiate a dialogue with the user.

[0091] In addition, when the dialogue unit 402 initiates at least one round of dialogue with the user by the large language model, the following implementation method can be adopted: the large language model generates at least one preference question text based on at least one target preference option obtained from the initial text; and uses the at least one preference question text to initiate at least one round of dialogue with the user.

[0092] That is to say, the dialogue unit 402 can also use the generation capability of the large language model to generate preference question texts corresponding to different target preference options in real time according to at least one target preference option obtained from the initial text, and then initiate at least one round of dialogue with the user.

[0093] After generating at least one preference question text by the large language model, the dialogue unit 402 can use each generated preference question text to initiate different rounds of dialogues with the user, and the number of initiated dialogue rounds is the same as the number of generated preference question texts.

[0094] It is understandable that the dialogue unit 402 can directly obtain a preset preference option from the large language model as at least one target preference option, and then generate different preference question texts according to different target preference options.

[0095] However, in actual application scenarios, when an APP in a terminal makes recommendations based on a large language model, it can usually only support the recommendation of a small number of objects. For example, a music APP only supports music recommendations, and an e-commerce APP only supports clothing, food, etc. However, users may input the demand for clothing recommendations in a music APP, or input the demand for music recommendations in an e-commerce APP, etc.

[0096] Therefore, when the dialogue unit 402 generates at least one preference question text based on at least one target preference option obtained by the large language model according to the initial text, the following implementation method can be adopted: the large language model extracts the entity words contained in the initial text, and determines the type of object to be recommended according to the extracted entity words; when it is determined that the type of object to be recommended is a preset type, obtains the preset preference option corresponding to the preset type as at least one target preference option; generates at least one preference question text according to the at least one target preference option; in this embodiment, different target preference options correspond to different preference question texts, and each preference question text corresponds to a round of dialogue with the user.

[0097] That is to say, the dialogue unit 402 obtains the preset preference option corresponding to the preset type as at least one target preference option only when it is determined that the type of the recommended object corresponding to the initial text is consistent with the preset type, and then generates different preference question texts, which can improve the accuracy of the obtained target preference options and the generated preference question texts, thereby improving the success rate of the recommendation.

[0098] When the dialogue unit 402 generates different preference question texts according to different target preference options by the large language model, the large language model can select different target preference options for each round of dialogue, and then generate a preference question text corresponding to the current round of dialogue according to the selected target preference options.

[0099] When the dialogue unit 402 generates at least one preference question text according to at least one target preference option by the large language model, it may also include the following contents: acquiring the speaking style of the salesperson; and generating at least one preference question text according to the acquired speaking style and at least one target preference option by the large language model.

[0100] That is to say, the dialogue unit 402 can make the generated preference question text more consistent with the speaking style of sales personnel in real scenarios, thereby enhancing the dialogue effect between the large language model and the user.

[0101] The determination unit 401 of this embodiment may determine other dialogue requirements in addition to object recommendation by the large language model. That is, the initial text input by the user contains multiple dialogue requirements. The dialogue unit 402 may determine only the user's dialogue requirement as object recommendation by the large language model, or may determine multiple dialogue requirements at the same time by the large language model, so as to generate a corresponding reply text according to the initial text for each dialogue requirement.

[0102] In addition, the large language model-based recommendation device 400 of this embodiment may also include a guidance unit 406 for executing the following contents: when it is determined that the dialogue requirement is not a dialogue recommendation, the large language model obtains a recommendation guidance text and displays it to the user, and the recommendation guidance text is used to guide the user to input text related to the recommendation.

[0103] The guiding unit 406 may obtain a preset recommended guiding text, or may generate a recommended guiding text in real time according to a preset type by a large language model.

[0104] It is understandable that, since the large language model itself has rich knowledge and strong text generation capabilities, when it is determined that the dialogue requirement is not recommended for dialogue, the dialogue unit 402 can also generate a corresponding reply text based on the initial text input by the user by the large language model.

[0105] When the dialogue unit 402 generates at least one preference question text based on at least one target preference option obtained by the large language model according to the initial text, the following implementation method can also be adopted: the large language model extracts entity words from the initial text, and determines the type of object to be recommended according to the entity words; generates at least one target preference option according to the type of object to be recommended; and generates at least one preference question text according to the at least one target preference option.

[0106] That is to say, the dialogue unit 402, with the help of the generation capability of the large language model itself, generates in real time at least one target preference option corresponding to the type of object to be recommended according to the type of object to be recommended determined from the initial text, thereby overcoming the problem that a terminal APP only supports a small number of object recommendations, thereby improving the scope of application of object recommendations.

[0107] The dialogue unit 402 may first obtain a preset prompt text (i.e., prompt), such as "Please generate corresponding preference options based on the input type of object to be recommended", and then input the obtained preset prompt text and the type of object to be recommended into the large language model to generate target preference options.

[0108] When the dialogue unit 402 generates at least one preference question text according to at least one target preference option by the large language model, it may also include the following content: when generating the preference question text corresponding to the current round of dialogue, the large language model obtains the reply text input by the user for the previous round of dialogue; based on the reply text and the target preference option corresponding to the current round of dialogue, the preference question text corresponding to the current round of dialogue is generated.

[0109] That is to say, the dialogue unit 402 can rewrite the preference question text corresponding to different rounds of dialogue, thereby improving the fluency of the dialogue with the user, and the preference question text corresponding to the current round of dialogue includes the preferences determined by the user in the previous dialogue process, and can also make it easier for the user to modify the previously determined preferences during the current round of dialogue.

[0110] In this embodiment, after the dialogue unit 402 initiates at least one round of dialogue with the user using at least one preference question text, the processing unit 403 obtains the user's recommended preferences from the large language model based on the reply text input by the user for at least one round of dialogue.

[0111] The processing unit 403 may use a large language model to merge the selection results contained in the reply text input by the user for each round of dialogue (ie, each preference question text), and use the merged result as the user's recommended preference.

[0112] When the processing unit 403 obtains the user's recommendation preference by the large language model based on the reply text input by the user for at least one round of dialogue, it can also include the following contents: determining the initial recommendation preference according to the reply text input by the user for at least one round of dialogue; obtaining the preference modification text input by the user; and adjusting the determined initial recommendation preference by the large language model according to the obtained preference modification text to obtain the user's recommendation preference.

[0113] That is to say, the processing unit 403 can also modify the text according to the preferences entered by the user after completing the conversation by the large language model, adjust the preferences determined by the reply text entered by the user during the conversation, and then use the adjusted preferences as the final recommended preferences of the corresponding user, thereby improving the flexibility in determining the recommended preferences and the accuracy of the determined recommended preferences.

[0114] In this embodiment, after the processing unit 403 obtains the user's recommendation preference from the large language model, the generating unit 404 obtains at least one candidate recommendation object corresponding to the recommendation preference, and generates a recommendation reason for at least one candidate recommendation object from the large language model.

[0115] The generation unit 404 can combine the existing recommendation methods to obtain at least one candidate recommendation object corresponding to the recommendation preference from the object database, for example, the recommendation objects in the object database that are ranked in the top N in terms of matching degree with the recommendation preference are used as candidate recommendation objects, where N is a positive integer greater than or equal to 1.

[0116] When the generation unit 404 generates a recommendation reason for at least one candidate recommendation object by the large language model, it can input the user's recommendation preference and the object information of the candidate recommendation object into the large language model for each candidate recommendation object, so that the large language model generates a recommendation reason for the candidate recommendation object.

[0117] It is understandable that the generation unit 404 can also obtain a preset prompt text (i.e., prompt), such as "Please explain why you recommend this object based on the object information and recommendation preferences entered", and input the obtained preset text together with the object information and recommendation preferences into the large language model.

[0118] The recommendation reason generated by the large language model by the generating unit 404 is used to reflect the matching degree between the candidate recommendation object and the user's recommendation preference, so as to explain to the user why the candidate recommendation object is recommended.

[0119] The generating unit 404 may also obtain the historical preferences of the user, and then the large language model generates a recommendation reason for at least one candidate recommendation object according to the obtained historical preferences, the object information of at least one candidate recommendation object, and the recommendation preferences.

[0120] In this embodiment, after the generating unit 404 generates a recommendation reason for at least one candidate recommendation object, the display unit 405 displays the at least one candidate recommendation object and its corresponding recommendation reason as a recommendation result to the user.

[0121] That is to say, when the display unit 405 displays the recommendation results to the user, in addition to displaying the candidate recommendation objects corresponding to the user's recommendation preferences, it also displays the recommendation reasons for the candidate recommendation objects, so that the user can more clearly understand the reasons for recommending the candidate recommendation objects.

[0122] When the display unit 405 uses the candidate recommendation object and its corresponding recommendation reason as the recommendation result, it can further obtain the link corresponding to the candidate recommendation object and display it to the user together. The user can enter the purchase page or viewing interface of the candidate recommendation object by clicking the link.

[0123] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0124] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0125] like Figure 5, is a block diagram of an electronic device according to a recommendation method based on a large language model according to an embodiment of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0126] like Figure 5 As shown, the device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the device 500 can also be stored. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0127] A number of components in the device 500 are connected to the I / O interface 505, including: an input unit 506, such as a keyboard, a mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a disk, an optical disk, etc.; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0128] The computing unit 501 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 501 performs the various methods and processes described above, such as a recommendation method based on a large language model. For example, in some embodiments, the recommendation method based on a large language model may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 508.

[0129] In some embodiments, part or all of the computer program may be loaded and / or installed on the device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps of the recommendation method based on the large language model described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform the recommendation method based on the large language model in any other appropriate manner (e.g., by means of firmware).

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

[0131] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable large language model-based recommendation device, so that the program code, when executed by the processor or controller, implements the functions / operations specified in the flow chart and / or block diagram. The program code may be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.

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

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

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

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

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

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

Claims

1. A recommendation method based on a large language model, comprising: Inputting the initial text input by the user into the large language model, and determining the dialogue demand of the user by the large language model; In a case where it is determined that the dialogue requirement is object recommendation, the large language model initiates at least one round of dialogue with the user; Obtaining the user's recommendation preference by the large language model according to the reply text input by the user for the at least one round of dialogue; Acquire at least one candidate recommendation object corresponding to the recommendation preference, and generate a recommendation reason for the at least one candidate recommendation object by the large language model; The at least one candidate recommendation object and its corresponding recommendation reason are presented to the user as a recommendation result.

2. The method according to claim 1, wherein: The initiating at least one round of dialogue with the user by the large language model comprises: The large language model generates at least one preference question text according to at least one target preference option obtained from the initial text; At least one round of dialogue is initiated with the user according to the at least one preference question text.

3. The method according to claim 2, wherein: The generating of at least one preference question text by the large language model according to at least one target preference option acquired from the initial text comprises: The large language model extracts entity words from the initial text, and determines the type of object to be recommended according to the entity words; generating at least one target preference option according to the type of the object to be recommended; The at least one preference question text is generated according to the at least one target preference option.

4. The method according to claim 1, wherein: The step of obtaining the user's recommendation preference by the large language model according to the reply text input by the user for the at least one round of dialogue includes: Determining, by the large language model, an initial recommendation preference according to a reply text input by the user for the at least one round of dialogue; Obtaining the preference modification text input by the user; The initial recommended preference is adjusted according to the preference modification text, and the adjustment result is used as the recommended preference.

5. The method according to claim 1, wherein: The recommendation reason for generating the at least one candidate recommendation object by the large language model includes: The large language model generates a recommendation reason for the at least one candidate recommendation object based on the object information of the at least one candidate recommendation object and the recommendation preference.

6. The method according to claim 6, wherein: The generating, by the large language model according to the object information of the at least one candidate recommendation object and the recommendation preference, a recommendation reason for the at least one candidate recommendation object comprises: Obtaining the user's historical preferences; The large language model generates a recommendation reason for the at least one candidate recommendation object based on the historical preference, the object information of the at least one candidate recommendation object and the recommendation preference.

7. The method according to claim 1, further comprising: When it is determined that the dialogue requirement is not a dialogue recommendation, the large language model obtains a recommendation guide text and displays it to the user, where the recommendation guide text is used to guide the user to input text related to the recommendation into the large language model.

8. The method according to claim 2, wherein: The generating of at least one preference question text by the large language model according to at least one target preference option acquired from the initial text comprises: The large language model extracts entity words from the initial text, and determines the type of object to be recommended according to the entity words; In the case where it is determined that the type of the object to be recommended is a preset type, obtaining a preset preference option corresponding to the preset type as the at least one target preference option; The at least one preference question text is generated according to the at least one target preference option.

9. The method according to claim 3 or claim 8, wherein: The step of generating the at least one preference question text by the large language model according to the at least one target preference option comprises: When generating a preference question text corresponding to the current round of dialogue, obtaining a reply text input by the user for the previous round of dialogue; The large language model generates a preference question text corresponding to the current round of dialogue based on the reply text and the target preference options corresponding to the current round of dialogue.

10. A recommendation device based on a large language model, comprising: a determination unit, configured to input an initial text input by a user into a large language model, and determine the dialogue requirement of the user by the large language model; a dialogue unit, configured to, when determining that the dialogue requirement is an object recommendation, initiate at least one round of dialogue with the user by the large language model; a processing unit, configured to obtain the user's recommendation preference from the large language model according to a reply text input by the user for the at least one round of dialogue; a generating unit, configured to obtain at least one candidate recommendation object corresponding to the recommendation preference, and generate a recommendation reason for the at least one candidate recommendation object by the large language model; The recommendation unit is used to display the at least one candidate recommendation object and its corresponding recommendation reason as a recommendation result to the user.

11. The device according to claim 10, wherein: When the large language model initiates at least one round of dialogue with the user, the dialogue unit specifically performs: The large language model generates at least one preference question text according to at least one target preference option obtained from the initial text; At least one round of dialogue is initiated with the user using the at least one preference question text.

12. The device according to claim 11, wherein When the dialogue unit generates at least one preference question text based on at least one target preference option obtained by the large language model according to the initial text, the dialogue unit specifically performs: The large language model extracts entity words from the initial text, and determines the type of object to be recommended according to the entity words; generating at least one target preference option according to the type of the object to be recommended; The at least one preference question text is generated according to the at least one target preference option.

13. The device according to claim 10, wherein: When the processing unit obtains the user's recommendation preference from the large language model according to the reply text input by the user for the at least one round of dialogue, the processing unit specifically performs: Determining, by the large language model, an initial recommendation preference according to a reply text input by the user for the at least one round of dialogue; Obtaining the preference modification text input by the user; The initial recommended preference is adjusted according to the preference modification text, and the adjustment result is used as the recommended preference.

14. The device according to claim 10, wherein: When the generating unit generates the recommendation reason for the at least one candidate recommendation object by the large language model, the generating unit specifically performs: The large language model generates a recommendation reason for the at least one candidate recommendation object based on the object information of the at least one candidate recommendation object and the recommendation preference.

15. The device according to claim 14, wherein: When the large language model generates a recommendation reason for the at least one candidate recommendation object according to the object information of the at least one candidate recommendation object and the recommendation preference, the following is specifically performed: Obtaining the user's historical preferences; The large language model generates a recommendation reason for the at least one candidate recommendation object based on the historical preference, the object information of the at least one candidate recommendation object and the recommendation preference.

16. The apparatus according to claim 10, further comprising a guiding unit, configured to perform: When it is determined that the dialogue requirement is not a dialogue recommendation, the large language model obtains a recommendation guide text and displays it to the user, where the recommendation guide text is used to guide the user to input text related to the recommendation into the large language model.

17. The device according to claim 11, wherein: When the dialogue unit generates at least one preference question text based on at least one target preference option obtained by the large language model according to the initial text, the dialogue unit specifically performs: The large language model extracts entity words from the initial text, and determines the type of object to be recommended according to the entity words; In the case where it is determined that the type of the object to be recommended is a preset type, obtaining a preset preference option corresponding to the preset type as the at least one target preference option; The at least one preference question text is generated according to the at least one target preference option.

18. The device according to claim 12 or claim 17, wherein: When the large language model generates the at least one preference question text according to the at least one target preference option, the dialogue unit specifically performs: When generating a preference question text corresponding to the current round of dialogue, obtaining a reply text input by the user for the previous round of dialogue; The large language model generates a preference question text corresponding to the current round of dialogue based on the reply text and the target preference options corresponding to the current round of dialogue.

19. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 9.

20. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 9.

21. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Information recommendation method based on generative large language model and related device

    CN116932733A

  • Home decoration designer recommendation method fusing large language model and dynamic dialogue intention

    CN117407595A

  • Generative recommendation system and method based on user personalized feedback

    CN117829950A

  • Interactive recommendation method and interactive recommendation system based on large language model

    CN117932142A

  • Human-computer interaction method and device, electronic equipment and storage medium

    CN117935788A

Cited By

  • Information recommendation method and device, storage medium and electronic equipment

    CN120429506A

  • Image processing method and device based on artificial intelligence and electronic equipment

    CN120783094A

  • Content recommendation method and device, electronic equipment, storage medium and program product

    CN121166967A

  • Object recommendation method and device, electronic equipment, medium and computer program product

    CN121167034A

  • Chat control system, chat control method, and program

    JP2026042456A