Recommendation method and device, equipment, medium and product
By using dialogue information to generate query information and query dynamic database in a dialogue recommendation system based on large language model, the problem of long and inaccurate recommendation information is solved, and efficient and accurate recommendation results are achieved.
Patent Information
- Application Number
- CN202411944215.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-03-28
AI Technical Summary
A dialogue recommendation system based on a large language model will take a long time to generate recommendation information and may be inaccurate, including the problem of recommending products that have been removed from the shelves.
By inputting the user's dialogue information into the first major language model to generate the first recommendation information, and determining the query information based on the query identification in the first recommendation information, querying the matching results from the dynamically changing query database, and generating the second recommendation information to improve accuracy.
The generated recommendation information is authentic and timely, reducing the time-consuming first word, and improving the user experience and accuracy of recommendation information.
Smart Images

Figure CN119719443A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical fields of artificial intelligence, intelligent customer service, intelligent robots, deep learning, and large language models, and more specifically, to a recommendation method, device, equipment, medium, and product. Background Art
[0002] With the rapid development of artificial intelligence technology, conversational recommendation systems based on large language models have been widely used.
[0003] In a conversational recommendation system based on a large language model, the large language model understands user needs through conversations with users and then generates recommendation information based on user needs. However, it takes a long time for the large language model to generate recommendation information based on user needs, and the recommendation information may also be inaccurate, such as recommending products that have been removed from the shelves to users. Summary of the invention
[0004] In view of this, the present disclosure provides a recommendation method, apparatus, device, medium and product.
[0005] One aspect of the present disclosure provides a recommendation method, including: inputting user conversation information into a first large language model to generate first recommendation information, wherein the conversation information includes at least one round of conversation between the user and the first large language model; in response to determining that the first recommendation information includes a query identifier, determining the query information according to the position of the query identifier in the first recommendation information and the conversation information; determining at least one query result matching the query information from a query library, wherein the information in the query library changes dynamically; and generating second recommendation information according to the at least one query result and the first recommendation information.
[0006] According to an embodiment of the present disclosure, the query information includes query terms and query parameters; in response to the first recommendation information including a query identifier, the query information is determined according to the position of the query identifier in the first recommendation information and the conversation information, including: in response to the first recommendation information including the query identifier, information between two query identifiers in the first recommendation information is determined as a query term; and based on a filtering rule, at least one query parameter is filtered out from the conversation information.
[0007] According to an embodiment of the present disclosure, determining at least one query result that matches the query information from a query library includes: searching the query library for at least one first initial query result that matches the query term; and filtering the at least one first initial query result using at least one query parameter to obtain at least one query result.
[0008] According to an embodiment of the present disclosure, the method also includes: when there is no query result matching the query information in the query library, determining a candidate query word similar to the query word; querying at least one second initial query result matching the candidate query word from the query library; and filtering the at least one second initial query result using at least one query parameter to obtain at least one query result.
[0009] According to an embodiment of the present disclosure, second recommendation information is generated based on at least one query result and first recommendation information, including: replacing query terms in the first recommendation information with candidate query terms to obtain updated first recommendation information; and combining at least one query result and the updated first recommendation information into second recommendation information.
[0010] According to an embodiment of the present disclosure, the candidate query term satisfies preset conditions, which include at least one of the following: the candidate query term and the query term belong to the same category, the semantic similarity between the candidate query term and the query term is greater than a first predetermined threshold, and the repetition rate of the order product corresponding to the candidate query term and the order product corresponding to the query term is greater than a second predetermined threshold.
[0011] According to an embodiment of the present disclosure, the dialogue information is determined in the following manner: the initial question information input by the user is input into the first largest language model, and the user intention is determined by the first largest language model; when the user intention is a recommendation intention, at least one round of dialogue is initiated by the first largest language model; the dialogue information is generated based on the question information of at least one round of dialogue generated by the first largest language model, the user's reply information for at least one round of dialogue, and the initial question information; wherein the question information generated by the first largest language model includes a query tag.
[0012] According to an embodiment of the present disclosure, the user's conversation information is input into the first large language model to generate first recommendation information, including: determining a prompt word template that matches the user; generating prompt information based on the conversation information and the prompt word template; and inputting the prompt information into the first large language model to generate first recommendation information that matches the prompt information.
[0013] According to an embodiment of the present disclosure, the first large language model is determined in the following manner: obtaining a plurality of first dialogue sample information including inquiry tags and query tags; inputting the plurality of first dialogue sample information into a second large language model to generate a plurality of second dialogue sample information, wherein the number of the second dialogue sample information is greater than the number of the first dialogue sample information; and optimizing the pre-trained first large language model using a dialogue sample set consisting of the plurality of second dialogue sample information to obtain a trained first large language model.
[0014] Another aspect of the present disclosure provides a recommendation device, including: a first generation module, used to input user conversation information into a first large language model to generate first recommendation information, wherein the conversation information includes at least one round of conversation between the user and the first large language model; a determination module, used to determine the query information according to the position of the query identifier in the first recommendation information and the conversation information in response to determining that the first recommendation information includes a query identifier; a query module, used to determine at least one query result matching the query information from a query library, wherein the information in the query library changes dynamically; and a second generation module, used to generate second recommendation information based on the at least one query result and the first recommendation information.
[0015] Another aspect of the present disclosure provides an electronic device, including: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the above method.
[0016] Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the above method when executed.
[0017] Another aspect of the present disclosure provides a computer program product, which includes computer executable instructions, and the instructions are used to implement the above method when executed.
[0018] According to the embodiments of the present disclosure, after generating the first recommendation information, query information is generated based on the first recommendation information and the dialogue information, and the query information is used to determine the query results with authenticity and timeliness from the real-time changing query library, and the second recommendation results are generated based on the query results and the first recommendation information, so that the generated second recommendation information is also authentic and timely, and finally the second recommendation information with accuracy is displayed to the user to improve the user experience. In addition, the query identifier in the first recommendation information is used to trigger subsequent query operations, and the query results are combined with the first recommendation information generated by the large language model as the second recommendation information for recommendation, which not only improves the accuracy of the recommendation information, but also eliminates the need to obtain the recommendation object information before making the recommendation, reducing the time consumption of the first word. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0020] Figure 1 Schematically illustrates an exemplary system architecture to which the proposed method and apparatus of the present disclosure may be applied;
[0021] Figure 2 A flowchart of a recommendation method according to an embodiment of the present disclosure is schematically shown;
[0022] Figure 3 A schematic diagram schematically shows generation of query information according to an embodiment of the present disclosure;
[0023] Figure 4 A schematic diagram of generating second recommendation information according to an embodiment of the present disclosure is schematically shown;
[0024] Figure 5A A schematic diagram schematically shows a first large language model initiating a conversation according to a specific embodiment of the present disclosure;
[0025] Figure 5B A schematic diagram schematically shows a first large language model initiating a conversation according to another specific embodiment of the present disclosure;
[0026] Figure 5C A schematic diagram schematically shows generating second recommendation information according to a specific embodiment of the present disclosure;
[0027] Figure 6 A schematic diagram of an architecture for implementing a recommendation method according to a specific embodiment of the present disclosure is shown;
[0028] Figure 7 A schematic diagram schematically shows first conversation sample information according to an embodiment of the present disclosure;
[0029] Figure 8 A block diagram schematically shows a recommendation device according to an embodiment of the present disclosure; and
[0030] Fig. 9 A block diagram of an electronic device 900 suitable for implementing a recommendation method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0031] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0032] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0033] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0034] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0035] In the embodiments of the present disclosure, the collection, updating, analysis, processing, use, transmission, provision, disclosure, storage, etc. of the data involved (for example, including but not limited to user personal information) are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. In particular, necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information, network security, and national security.
[0036] In the embodiments of the present disclosure, the user's authorization or consent is obtained before obtaining or collecting the user's personal information.
[0037] A large language model (LLM) refers to a machine learning model with large-scale parameters and complex computing mechanisms. In a conversational recommendation system under a single large language model mode, the large language model is responsible for communicating with users and generating corresponding recommendation information based on the conversation information. However, when generating recommendation information, the large language model will not only generate recommendation information containing false recommendation objects, such as non-existent products in the recommendation information, but may also fail to perceive the dynamic changes in the recommendation object information in a timely manner, such as dynamic information such as out-of-stock and delisted recommended objects, resulting in the generated recommendation information may include out-of-stock and delisted recommended objects, thereby generating inaccurate recommendation information. Therefore, it is necessary to obtain the background information of the product before making a recommendation. However, obtaining background information will result in a long response time for the large language model, that is, increase the first token latency, and affect the user's willingness to interact.
[0038] In the conversational recommendation system under the multi-language model mode, the large language model responsible for planning tasks can call other large language models responsible for tasks such as asking questions and making recommendations to respond to user requests based on the conversation information with the user. Although the conversational recommendation system under the multi-language model mode can avoid coordination problems through coordination between multiple large language models, the coordination and interaction between multiple large language models not only takes a long time and affects the user's willingness to interact, but also requires a large amount of machine resources, such as the Graphic Progressing Unit (GPU) required to implement a single request, which is a GPU that supports high inference times (LLM inferences per request, LIPR).
[0039] The embodiment of the present disclosure provides a recommendation method, including: inputting the user's dialogue information into a first large language model to generate first recommendation information, wherein the dialogue information includes at least one round of dialogue between the user and the first large language model; in response to determining that the first recommendation information includes a query identifier, determining the query information according to the position of the query identifier in the first recommendation information and the dialogue information; determining at least one query result matching the query information from a query library, wherein the information in the query library is dynamically changing; and generating second recommendation information according to at least one query result and the first recommendation information. In order to solve the above technical problems, the embodiment of the present disclosure only uses a single first large language model to normally generate the first recommendation information according to the input, and when the query identifier is included in the first recommendation information, performs a subsequent query operation, that is, subsequently determines the query information and queries the result based on the query information. Therefore, when the recommendation is really needed, the query result and the first recommendation information are combined into the final second recommendation information for recommendation; and for the normal dialogue process, there is no need to search for background information first and then generate output according to fixed rules every time the output is output, thereby reducing the time consumption of the first word. In addition, unlike the search library within the large language model architecture, the information in the query library outside the large language model architecture in the embodiments of the present disclosure changes dynamically, and therefore, inaccurate recommendations caused by out-of-stock, delisting, etc. can be avoided.
[0040] Figure 1 The following schematically illustrates an exemplary system architecture to which the recommended method and apparatus of the present disclosure can be applied. Figure 1 What is shown is merely an example of a system architecture to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.
[0041] like Figure 1As shown, the system architecture 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is used to provide a medium for a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.
[0042] The user may use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications may be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, query applications, instant messaging tools, email clients, and / or social platform software, etc. (only for example).
[0043] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0044] The server 105 may be a server that provides various services, such as a background management server (only as an example) that provides support for websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.
[0045] It should be noted that the recommendation method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the recommendation device provided in the embodiment of the present disclosure can generally be set in the server 105. The recommendation method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Accordingly, the recommendation device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Alternatively, the recommendation method provided in the embodiment of the present disclosure can also be executed by the first terminal device 101, the second terminal device 102 or the third terminal device 103, or can also be executed by other terminal devices different from the first terminal device 101, the second terminal device 102 or the third terminal device 103.
[0046] For example, the user can use the first terminal device 101, the second terminal device 102 or the third terminal device 103 to conduct at least one round of dialogue with the first language model in the server 105 through the network 104. Then, the server 105 inputs the user's dialogue information into the first language model to generate first recommendation information; in response to determining that the first recommendation information includes a query identifier, the query information is determined according to the first recommendation information and the dialogue information; at least one query result matching the query information is determined from the query library, wherein the information in the query library is dynamically changed; and second recommendation information is generated according to the at least one query result and the first recommendation information. Finally, the server 105 sends the second recommendation information to the user's first terminal device 101, the second terminal device 102 or the third terminal device 103 through the network 104, and displays the second recommendation information on the first terminal device 101, the second terminal device 102 or the third terminal device 103 so that the user can view the second recommendation information.
[0047] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.
[0048] Figure 2 The flowchart of the recommendation method according to the embodiment of the present disclosure is schematically shown.
[0049] like Figure 2 As shown, the recommended method includes operations S210 to S240.
[0050] In operation S210, the user's conversation information is input into a first language model to generate first recommendation information.
[0051] According to an embodiment of the present disclosure, the dialogue information includes at least one round of dialogue between the user and the first language model. When the first language model conducts a dialogue with the user, it can gradually guide the user to improve the needs by conducting at least one round of dialogue with the user.
[0052] For example, when a user needs to buy a razor, the first language model can guide the user to express the type of razor he wants to buy through multiple rounds of conversations with the user.
[0053] For example, when a user needs to buy a birthday gift for his mother, the first language model can guide the user to express the interests and hobbies of the user's mother in the conversation.
[0054] According to an embodiment of the present disclosure, when it is determined that the dialog information includes sufficient user needs, the dialog information can be input into the first large language model so that the first large language model can make recommendations based on the user needs in the dialog information.
[0055] According to an embodiment of the present disclosure, the first recommendation information is the recommendation information generated by using the first language model. For example, the demand expressed by the dialogue information is: the user wants to buy a rotary shaver, and the generated first recommendation information may be "For rotary shavers, I recommend that you consider buying shaver A".
[0056] In operation S220, in response to determining that the first recommendation information includes the query identifier, query information is determined according to a position of the query identifier in the first recommendation information and the conversation information.
[0057] According to an embodiment of the present disclosure, the first large language model can have at least one round of dialogue with the user, that is, the first large language model can have at least one output. However, not every output is used for recommendation, so a query identifier can be added to the first recommendation information to trigger subsequent query operations. For example, when the first recommendation information includes a query identifier, the query information is determined based on the position of the query identifier in the first recommendation information and the dialogue information; when the first recommendation information does not include a query identifier, no subsequent operation is performed.
[0058] According to an embodiment of the present disclosure, the query identifier may be used to mark the recommended product, recommended video, or recommended music in the first recommendation information. For example, the query identifier may be used to mark "razor A" in the first recommendation information.
[0059] According to an embodiment of the present disclosure, the query information is determined based on the position of the query identifier in the first recommendation information and the dialogue information. For example, the query information may include "razor A" in the first recommendation information "for rotary razors, I recommend you to consider buying razor A", and "rotary razor" in the dialogue information.
[0060] According to an embodiment of the present disclosure, the query identifier may exist alone or in pairs. Accordingly, when the query identifier exists alone, the query information may include the information before the query identifier or the information after the query identifier in the first recommended information; when the query identifier exists in pairs, the query information may include the information between each pair of query identifiers in the first recommended information.
[0061] In operation S230, at least one query result matching the query information is determined from the query library.
[0062] According to an embodiment of the present disclosure, the information in the query library is dynamically changing. For example, the query library may store information related to products that are currently on sale and have sufficient inventory. Since the information in the query library is dynamically changing, when a product is removed from the shelves or out of stock, the information related to the removed product or out of stock product may be deleted from the query library.
[0063] According to an embodiment of the present disclosure, the query result may be information in the query library that matches the query information. Specifically, a search engine that matches the query library may be used to search the query library according to the query information, and information of recommended objects that match the query information may be determined as the query result.
[0064] For example, when razor A is a real product, the search engine searches for information about razor A in the query library, and the query results obtained may include a purchase link for razor A and a purchase link for rotary razor B that is similar to razor A.
[0065] For another example, when razor A is a fake product or is out of stock, the search engine searches for information about razor A and rotary razors in the query library, but cannot find information about razor A. At this time, the search engine can search the query library again for products similar to razor A, or other rotary razors, and the query results obtained may include a purchase link for rotary razor B.
[0066] In operation S240, second recommendation information is generated according to the at least one query result and the first recommendation information.
[0067] According to an embodiment of the present disclosure, the second recommendation information is generated based on the query result and the first recommendation information. Specifically, when the query result indicates that the first recommendation information is valid, the second recommendation information may include the first recommendation information and the query result; when the query result indicates that the first recommendation information is invalid, the second recommendation information may include the first recommendation information and the query result modified according to the query result.
[0068] For example, when razor A is a real product and is in sufficient stock, the second recommendation information may include the first recommendation information and a purchase link for razor A.
[0069] For example, when razor A is a fake product or the stock of razor A is insufficient, and the stock of razor B is sufficient, the information related to razor A in the first recommendation information can be modified to information related to razor B to obtain the modified first recommendation information, and the second recommendation information can be generated based on the modified first recommendation information and the purchase link of razor B.
[0070] According to the embodiments of the present disclosure, since the second recommendation information is generated based on the first recommendation information and the query result, the second recommendation information may also include a query identifier, and the query identifier may be used to mark the recommended products, recommended videos, or recommended music in the second recommendation information. For example, the query identifier may be used to mark "razor B" in the second recommendation information.
[0071] According to the embodiments of the present disclosure, after generating the first recommendation information, query information is generated based on the first recommendation information and the dialogue information, and the query information is used to determine the query results with authenticity and timeliness from the real-time changing query library, and the second recommendation results are generated based on the query results and the first recommendation information, so that the generated second recommendation information is also authentic and timely, and finally the second recommendation information with accuracy is displayed to the user to improve the user experience. In addition, the query identifier in the first recommendation information is used to trigger subsequent query operations, and the query results are combined with the first recommendation information generated by the large language model as the second recommendation information for recommendation, which not only improves the accuracy of the recommendation information, but also eliminates the need to obtain the recommendation object information before making the recommendation, reducing the time consumption of the first word.
[0072] According to an embodiment of the present disclosure, in response to the first recommendation information including a query identifier, the query information is determined according to the position of the query identifier in the first recommendation information and the conversation information, including: in response to the first recommendation information including the query identifier, information between two query identifiers in the first recommendation information is determined as a query term; and based on a filtering rule, at least one query parameter is filtered out from the conversation information.
[0073] According to an embodiment of the present disclosure, the query information includes query words and query parameters.
[0074] Specifically, the first recommendation information may be traversed, and in response to the first recommendation information including a query identifier, a query term may be determined from the first recommendation information, and a query parameter may be determined from the dialog information.
[0075] According to an embodiment of the present disclosure, the query word may be information between two query identifiers in the first recommendation information. Specifically, the query identifiers may exist in pairs, and the information between the start query identifier and the end query identifier in the query identifier is determined to be the query word, wherein the start query identifier may be <searchtext> , the end query marker can be< / searchtext> Alternatively, the start query identifier and the end query identifier are the same, and the query terms between them are determined by their appearance in pairs.
[0076] According to an embodiment of the present disclosure, the query terms in the first recommendation information are determined by the first largest language model, and the query identifier is also generated by the first largest language model. Therefore, when training the first largest language model, the ability of the first largest language model to determine query terms and the ability to add query identifiers to the query terms can be trained.
[0077] For example, the first recommendation message could be “For rotary shavers, I recommend you consider buying <searchtext> Razor A< / searchtext>. This shaver adopts a unique blade design, which can be close to the face and provide a more comfortable shaving experience. At the same time, it has a short charging time and a long battery life, which is very suitable for busy daily life." The query term obtained from the first recommended information can be "Shaver A".
[0078] According to an embodiment of the present disclosure, the query parameter can be obtained by filtering the dialog information according to the filtering rule. Specifically, when filtering the query parameter from the dialog information according to the filtering rule, a regular matching method can be used to determine the information in the dialog information related to the user's needs as the query parameter.
[0079] According to an embodiment of the present disclosure, the query parameters may be acquired in real time during the conversation between the user and the first language model, and the acquired query parameters may be saved.
[0080] For example, information such as "rotary" in the dialog information may be determined as a query parameter, or information such as the user's expected price for the razor may be determined as a query parameter.
[0081] In the existing method, large language models pass parameters in the format of a lightweight text data exchange format (JavaScript Object Notation, JSON) to facilitate calling functional tools. However, for large language models, using JSON to make function calls is time-consuming and counterintuitive, which increases the time spent on the first word and interrupts the flow of natural conversation.
[0082] The embodiment of the present disclosure uses query identifiers to mark query words instead of transmitting query words in JSON format, so that function calls can be made in real time without interrupting natural conversations, thereby improving the efficiency of generating the first recommendation information. In addition, query words are determined from the first recommendation information, and query parameters are determined from the conversation information, respectively, to obtain query information including query words and query parameters, so that the query information includes rich and comprehensive information, thereby improving the accuracy of the query results.
[0083] Figure 3 The schematic diagram of generating query information according to an embodiment of the present disclosure is schematically shown.
[0084] like Figure 3 As shown, the dialogue information 301 is input into the first language model M1 to obtain the first recommendation information 302. The query parameter 303 is determined from the dialogue information 301, the query word 304 is determined from the first recommendation information 302, and the query information 305 is obtained according to the query parameter 303 and the query word 304.
[0085] According to an embodiment of the present disclosure, determining at least one query result that matches the query information from a query library includes: searching the query library for at least one first initial query result that matches the query term; and filtering the at least one first initial query result using at least one query parameter to obtain at least one query result.
[0086] According to an embodiment of the present disclosure, when querying a query library, the search engine may query the query library according to the query term to obtain a first initial query result that matches the query term.
[0087] For example, after the search engine performs a query based on the query term "razor A", the first initial query result obtained may include information about razor A.
[0088] According to an embodiment of the present disclosure, since the first initial query result obtained by the search engine based on query word matching may not meet the needs of the user, the query parameters can be used to filter the first initial query result to determine the query result that meets the user's needs.
[0089] For example, the first initial query result may include information about razor A, razor B, and razor C. Both razor A and razor B are rotary razors, and razor C is a clipper razor. After the first initial query result is filtered using the query parameter "rotary", the query result obtained only includes information about razor A and razor B. Alternatively, a query may be performed directly based on the query term and the query parameter to obtain at least one query result.
[0090] According to an embodiment of the present disclosure, the first initial query result is screened using query parameters so that the obtained query result meets the user's needs, thereby improving the accuracy of the second recommended information.
[0091] According to an embodiment of the present disclosure, determining the query result also includes: determining a candidate query term similar to the query term when there is no query result matching the query information in the query library; querying at least one second initial query result matching the candidate query term from the query library; and filtering the at least one second initial query result using at least one query parameter to obtain at least one query result.
[0092] According to an embodiment of the present disclosure, there is no query result matching the query information in the query library, that is, the query term is invalid, which includes: there is no first initial query result matching the query term in the query library; or there is a first initial query result matching the query term in the query library, but after filtering the first initial query result using the query parameters, there is no first initial query result that meets the query parameters.
[0093] For example, when the query word hallucinated by the first language model is a fake product, there is no product information matching the query word in the query library, and thus the search engine may not be able to find the first initial query result matching the query word in the query library based on the query word.
[0094] For example, when the query term is a product that has been removed from the shelves or is out of stock, the search engine may find other similar products based on the query term, but the other products found do not meet the query parameters, resulting in no query results matching the query information in the query library.
[0095] According to an embodiment of the present disclosure, when there is no query result matching the query information in the query library, it means that the query term is invalid, and in this case, the query term needs to be replaced with a candidate query term.
[0096] According to the embodiments of the present disclosure, the candidate query words may be screened from the real query words, the candidate query words are similar to the query words, and the candidate query words may be one or more. For example, the product corresponding to the query word may belong to the same category or brand as the product corresponding to the candidate query word, and the music corresponding to the query word may belong to the same style or be the same singer as the music corresponding to the candidate query word.
[0097] According to an embodiment of the present disclosure, the search engine may query the query library using the candidate search term to obtain the second initial candidate result. For example, the candidate query term may be "razor B", and the second initial query result may include information such as a purchase link for razor B.
[0098] According to an embodiment of the present disclosure, the second initial query result is screened using the query parameter, and then the second initial query result that meets the user's needs is screened out as the query result.
[0099] According to an embodiment of the present disclosure, when a query word is invalid, the query word is replaced with a candidate query word to perform a query, thereby ensuring the validity of the query result and improving the accuracy of the second recommendation information.
[0100] According to an embodiment of the present disclosure, second recommendation information is generated based on at least one query result and first recommendation information, including: replacing query terms in the first recommendation information with candidate query terms to obtain updated first recommendation information; and combining at least one query result and the updated first recommendation information into second recommendation information.
[0101] According to an embodiment of the present disclosure, when the query word is invalid, the first recommendation information including the query word is also invalid, and therefore the first recommendation information needs to be updated.
[0102] According to the embodiments of the present disclosure, since the candidate query words are screened from the real query words, the candidate query words are valid.
[0103] According to an embodiment of the present disclosure, since the candidate query term is valid, and when the query term is invalid, the query result is obtained based on the candidate query term, the valid candidate query term can be used to replace the query term in the first recommendation information, so that the updated first recommendation information is valid and matches the query result.
[0104] According to an embodiment of the present disclosure, the first recommendation information may include other information related to the query term in addition to the query term. Therefore, when updating the first recommendation information, in addition to replacing the query term in the first recommendation information, the information related to the query term also needs to be updated.
[0105] For example, the query word in the first recommendation information is "Razor A", and the first recommendation information also includes information such as an introduction to razor A and an advertising slogan of razor A. When the query word is invalid, when updating the first recommendation information using the candidate query word "Razor B", in addition to replacing "Razor A" with "Razor B", it is also necessary to replace information such as the introduction to razor A and the advertising slogan of razor A with information such as the introduction to razor B and the advertising slogan of razor B.
[0106] According to an embodiment of the present disclosure, when the first recommendation information is invalid, the second recommendation information is composed of the query result and the updated first recommendation information. Specifically, taking the first recommendation information after the above replacement as an example, the second recommendation information may include an introduction to razor B, a slogan of razor B, and a purchase link for razor B.
[0107] According to an embodiment of the present disclosure, the first recommendation information is updated using candidate query words, and the updated first recommendation information is combined with the query result to obtain the second recommendation information, so that the obtained second recommendation information is accurate.
[0108] Figure 4 The diagram schematically shows a schematic diagram of generating second recommendation information according to an embodiment of the present disclosure.
[0109] like Figure 4 As shown, candidate query words 402 similar to query words 401 are determined, and the query library is queried using candidate query words 402 to obtain second initial query results 403. Second initial query results 403 are screened using query parameters 404 to obtain query results 406. First recommendation information 405 is updated using candidate query words 402 to obtain updated first recommendation information 407. Query result 406 and updated first recommendation information 407 are combined to obtain second recommendation information 408.
[0110] According to an embodiment of the present disclosure, the candidate query term satisfies preset conditions, which include at least one of the following: the candidate query term and the query term belong to the same category, the semantic similarity between the candidate query term and the query term is greater than a first predetermined threshold, and the repetition rate of the order product corresponding to the candidate query term and the order product corresponding to the query term is greater than a second predetermined threshold.
[0111] According to the embodiments of the present disclosure, the types of query words and candidate query words can be understood as the types of commodities corresponding to them. Specifically, the commodities corresponding to the candidate query words and the commodities corresponding to the query words can belong to the same third-level commodity category.
[0112] Specifically, when the candidate query term and the query term belong to the same category, the relationship between the candidate query term and the query term can be expressed as the following formula (1):
[0113] Cid3_P(search_query i )=Cid3_P(search_query j ) (1)
[0114] Among them, search_query i Can be a query term, search_query j It can be a candidate query word, and Cid3_P can represent the type of product.
[0115] According to an embodiment of the present disclosure, when the product corresponding to the query word is a product that is no longer available or out of stock, other products under the category of the product corresponding to the query word can be determined as candidate query words. For example, when the query word is "razor A", that is, the category of the query word is razor, the category of the candidate query word should also be razor, such as "razor B".
[0116] According to an embodiment of the present disclosure, determining the semantic similarity between a query term and a candidate query term includes: using an encoder to perform encoding operations on the query term and the candidate query term respectively to obtain encoding features of the query term and encoding features of the candidate query term; and determining the similarity between the encoding features of the query term and the encoding features of the candidate query term as the semantic similarity.
[0117] Specifically, when the semantic similarity between the candidate query term and the query term is greater than a first predetermined threshold, the relationship between the query term and the candidate query term can be expressed as follows:
[0118] (2)
[0119] Among them, search_query iCan be a query term, search_query j can be a candidate query word, Semantic_Sim is a function that calculates the semantic similarity between the query word and the candidate query word, It can be a first predetermined threshold.
[0120] According to an embodiment of the present disclosure, when the product corresponding to the query word is a product that is no longer available or out of stock, other query words with a high semantic similarity to the query word may be determined as candidate query words. For example, when the query word is "rotary shaver", the candidate query word may be "rotary razor" whose semantic similarity to "rotary shaver" is greater than a first predetermined threshold.
[0121] According to an embodiment of the present disclosure, when the product corresponding to the query word is a fake product and there is no product belonging to the same category as the query word, other query words with higher semantic similarity to the query word may also be determined as candidate query words.
[0122] For example, when the query word is "razor A", since there is no such product as razor in real life, that is, razor A is a fake product, "razor" with a semantic similarity greater than a first predetermined threshold can be determined as a candidate query word.
[0123] According to the embodiments of the present disclosure, the ordered products corresponding to the query words can be understood as the products ordered by the user after searching for products using the query words, and the ordered products corresponding to the candidate query words can be understood as the products ordered by the user after searching for products using the candidate query words. If the repetition rate of the ordered products corresponding to the candidate query words and the ordered products corresponding to the query words is high, it means that the candidate query words and the query words are also highly similar.
[0124] Specifically, when the repetition rate of the ordered products corresponding to the candidate query word and the ordered products corresponding to the query word is greater than the second predetermined threshold, the relationship between the query word and the candidate query word can be expressed as follows:
[0125] (3)
[0126] Among them, search_query i Can be a query term, search_query j Can be a candidate query word, sku_name i It can be the ordered product corresponding to the query word, sku_name j It can be the ordered product corresponding to the candidate query term. Semantic_Sim is used to determine whether the ordered product corresponding to the query term and the ordered product corresponding to the candidate query term are similar, but the similarity result is 1 (same) or 0 (different). It can be the total quantity of the ordered products corresponding to the query word and the ordered products corresponding to the candidate query words. It can be a second predetermined threshold.
[0127] Therefore, when the product corresponding to the query word is a discontinued product or an out-of-stock product, other query words whose repetition rate with the ordered products of the query word is greater than the second predetermined threshold can be determined as candidate query words, and then the candidate query words can be used to query other products with a high similarity to the product corresponding to the query word.
[0128] For example, when the query word is "razor", the ordered products corresponding to the query word include razor A, razor B and razor C, and the candidate query word may be "razor", and the ordered products corresponding to the candidate query word include razor A, razor B and razor D. Therefore, even if razor A and razor B are both out of stock or out of stock, razor D with sufficient stock can be found using the candidate query word.
[0129] According to an embodiment of the present disclosure, a plurality of preset conditions can be combined to obtain a combined preset condition, and a candidate query term can be determined using the combined preset condition. Specifically, a query term having a semantic similarity with the query term greater than a first predetermined threshold can be determined as an initial candidate query term, and then an initial candidate query term having a repetition rate of ordered products corresponding to the query term greater than a second predetermined threshold can be determined as a candidate query term.
[0130] According to an embodiment of the present disclosure, in order to ensure the similarity between candidate query words and query words, candidate query words are determined by preset conditions so that the determined candidate query words have a high similarity with the query words, and then the candidate query words can be used to query to obtain query results related to user needs, thereby obtaining more accurate second recommendation information.
[0131] According to an embodiment of the present disclosure, the dialogue information is determined in the following manner: the initial question information input by the user is input into the first largest language model, and the user intention is determined by the first largest language model; when the user intention is a recommendation intention, at least one round of dialogue is initiated by the first largest language model; and the dialogue information is generated based on the question information of at least one round of dialogue generated by the first largest language model, the user's reply information for at least one round of dialogue, and the initial question information.
[0132] According to an embodiment of the present disclosure, the first language model can determine the user intention based on the initial question information. Specifically, the user intention can include recommendation intention, chat intention, etc.
[0133] According to the embodiments of the present disclosure, when the user's intention is to recommend, the first language model can be used to communicate with the user, and the user's needs can be understood during the dialogue process, so as to make recommendations to the user. Specifically, when the user's interests are relatively broad, the first language model can inquire about the user's preferences by asking questions, so as to guide the user to clarify their preferences.
[0134] According to an embodiment of the present disclosure, the question information generated by the first language model includes a query tag, and the query tag can be used to display information between two query tags in the form of options. Specifically, the query tags can exist in pairs, wherein the start query tag can be <clicktext>, the closing query tag can be <\ / ClickText>.
[0135] According to an embodiment of the present disclosure, after the first language model determines that sufficient user preferences have been collected, the conversation between the first language model and the user can be ended. At this time, the conversation information can be generated based on the question information of at least one round of conversation generated by the first language model, the user's reply information to at least one round of conversation, and the initial question information.
[0136] For example, the initial question information input by the user may be "gift box for newborns", the first language model determines that the user's intention is a recommendation intention, and the first language model initiates the first round of dialogue, in which the generated question information may be "Great, gifts for newborns need to take into account the needs of newborns and mothers. It should be healthy, comfortable, and safe. Is the newborn a boy or a girl, or do you want a neutral gift?"\n <clicktext>Boy<\ / ClickText>\n <clicktext>Girl<\ / ClickText>\n <clicktext>Neutral <\ / ClickText>", the user clicks the "girl" option, then the user's answer in the current round can be "girl". At this time, the first language model can initiate a second round of dialogue, and the generated question information can be "Okay, for a gift for a baby girl, we need to consider some specific details. Next, what is your budget? This way I can better recommend a gift that suits you. \n <clicktext>Under 200 yuan<\ / ClickText>\n <clicktext>200-500 yuan<\ / ClickText>\n <clicktext>500-1000 yuan<\ / ClickText>\n <clicktext>More than 1,000 yuan <\ / ClickText>", the user clicks the "500-1,000 yuan" option, then the user's reply information in the current round can be "500-1,000 yuan".
[0137] According to an embodiment of the present disclosure, at least one round of dialogue is initiated through the first language model to guide the user to clarify the needs, so that the dialogue information includes sufficient user needs, thereby improving the accuracy of the recommendation. In addition, by marking the options with a query tag instead of in JSON format, there is no need to interrupt the natural dialogue, thereby improving the efficiency of generating the first recommendation information.
[0138] Figure 5A The figure schematically shows a diagram of initiating a conversation using a first large language model according to a specific embodiment of the present disclosure.
[0139] like Figure 5A As shown, the initial question information 501 input by the user is "What gift is good for Father's Day?", the first language model determines that the user's intention is a recommendation intention, initiates the first round of dialogue, and generates question information 502, wherein the question information 502 includes a text part 5021 and an option part 5022, the text part 5021 is "I'm glad to help you choose a Father's Day gift! We have a lot of choices, you can consider his hobbies (such as smoking, drinking, tea tasting, sports, taking pictures, etc.), needs (such as men's skin care products, clothing, shoes, accessories, etc.), and usage scenarios (such as office, outdoor, home, etc.). What does your father like, or what do you think?", the option part 5022 includes nine options, namely "smoking and drinking", "tea tasting and painting", "sports and fitness", "outdoor travel", "photo recording", "men's skin care", "clothing accessories", "books and music", and "food cooking", as well as an input box displaying "click to enter".
[0140] According to an embodiment of the present disclosure, the user may click on any one of the options in the option part 5022 , and the terminal, in response to the user's clicking operation, uses the information of the clicked option as the user's reply information to the question information 502 .
[0141] According to an embodiment of the present disclosure, the user may also click on the input box and input his father's hobbies in the input box. The terminal responds to the user's input operation and uses the user's input information as the user's reply information to the question information 502 .
[0142] Figure 5B The figure schematically shows a diagram of initiating a conversation using a first large language model according to another specific embodiment of the present disclosure.
[0143] like Figure 5B As shown, the user enters reply information 503 "razor for the elderly, P brand" in response to question information 502. At this time, the first language model needs to further guide the user to clarify the preference, initiate a second round of dialogue, and generate question information 504, wherein question information 504 includes a text portion 5041 and an option portion 5042. The text portion 5041 is "OK, I understand. For the razor, we can consider upgrading his shaving experience. So, which type of razor does your father prefer?", and the option portion 5042 includes three options: "manual razor", "rotary razor", and "clipper razor", as well as an input box for entering user-defined options.
[0144] Figure 5C The following schematic diagram shows a method for generating second recommendation information according to a specific embodiment of the present disclosure.
[0145] like Figure 5C As shown, the user enters the reply information 505 "rotary shaver" in response to the question information 504. At this time, the user's needs have been clarified, and the second recommendation information 506 is generated, wherein the second recommendation information 506 includes a text portion 5061 and a link portion 5062, and the text portion 501 is "OK, I understand. For rotary shavers, I recommend that you consider buying P brand's Q series shavers. This shaver uses a unique blade design that allows it to fit closer to the face, providing a more comfortable shaving experience. At the same time, it has a short charging time and a long battery life, making it very suitable for busy daily life. Moreover, its design is simple and elegant, making it very suitable as a gift. The following are the products recommended for you", and the link portion 5062 includes a purchase link for P brand Q series shavers, a purchase link for P brand M series shavers, and a "product comparison" button, and the purchase link may also include product images, product prices, positive reviews, and other information.
[0146] According to an embodiment of the present disclosure, the underlined text "P brand Q series razor" in the text part 5061 may be a query word, and the purchase links of P brand Q series razor and P brand M series razor in the link part 5062 may be found in the query library based on the query word "P brand Q series razor". In addition, the user may click on the query word "P brand Q series razor", and the page will jump to the query page corresponding to "P brand Q series razor".
[0147] According to an embodiment of the present disclosure, when a user clicks on two product links in the link portion 5062, the page will jump to the purchase page of the product. When a user clicks on the "Product Compare" button, the page will jump to the product comparison page, where the information of the two products can be displayed in two sub-screens in a split screen format, so that the user can compare the product information.
[0148] According to an embodiment of the present disclosure, the user's conversation information is input into the first large language model to generate first recommendation information, including: determining a prompt word template that matches the user; generating prompt information based on the conversation information and the prompt word template; and inputting the prompt information into the first large language model to generate first recommendation information that matches the prompt information.
[0149] According to an embodiment of the present disclosure, since different users have different communication habits, in order to improve user experience, multiple prompt word templates can be set, and different prompt word templates correspond to different communication habits, so that the first recommendation information can be generated using the prompt word template that conforms to the user's communication habits.
[0150] According to an embodiment of the present disclosure, when the user inputs initial question information, the user portrait can be obtained from the user portrait management module, and a prompt word template matching the user can be determined based on the user portrait. Alternatively, after the user has at least one round of dialogue with the first language model, a prompt word template matching the user can be determined based on the dialogue information.
[0151] According to an embodiment of the present disclosure, a user portrait may be a user model abstracted from user behavior data such as likes, comments, and replies, and used to characterize the user's communication habits.
[0152] It should be noted that after collecting data such as users' likes, comments, and replies, we will de-identify the data through technical means.
[0153] According to an embodiment of the present disclosure, prompt information is generated according to the dialogue information and the prompt word template, including: obtaining user demand information from the dialogue information, filling the demand information into the prompt word template, and generating prompt information.
[0154] According to an embodiment of the present disclosure, by setting multiple prompt word templates, different prompt word templates correspond to different communication habits, adapting to the needs of users with different styles, and by determining the prompt word template that matches the user, the generated first recommendation information conforms to the user's style, thereby improving the user experience.
[0155] According to an embodiment of the present disclosure, multiple reply templates may be set, and different reply templates also correspond to different communication habits to meet the needs of users with different styles. Specifically, the first recommendation information may be generated using a reply template that matches the user.
[0156] Figure 6 The following schematically shows an architecture diagram for implementing a recommendation method according to a specific embodiment of the present disclosure.
[0157] like Figure 6 As shown, the architecture for implementing the recommendation method includes a central agent 610 and a search agent 620. The central agent 610 includes a user portrait management module 611, a conversation history management module 612, a query parameter identification module 613, an external interface 614 and a first language model M1, and the search agent 620 includes a query library 621 and a search engine 622.
[0158] According to an embodiment of the present disclosure, the first large language model M1 is used to conduct multiple rounds of dialogue with the user, generate dialogue information, and generate first recommendation information based on the dialogue information. The user portrait management module 611 can be used to store user portraits so as to determine a prompt word template that matches the user based on the user portrait.
[0159] According to an embodiment of the present disclosure, the conversation history management module 612 can be used to store historical conversation information between the first language model M1 and the user. Specifically, the storage service can be provided by an online storage system (Redis), and the user identifier and conversation identifier are used as key information of the historical conversation information, and the initial question information, the question information generated by the first language model, and the user's reply information are used as value information of the historical conversation information, and the historical conversation information is stored in Redis in the form of key-value pairs.
[0160] According to an embodiment of the present disclosure, the query parameter identification module 613 is used to obtain the query parameters generated during the conversation between the first language model M1 and the user. Specifically, the query parameters can be obtained and stored from the conversation history management module 612 by using regular matching, so that the query parameters can be applied to the entire conversation process.
[0161] According to an embodiment of the present disclosure, the external interface 614 may be used to call an external program, for example, to query the weather, time, etc.
[0162] According to an embodiment of the present disclosure, the query library 621 is used to store product information and user order records, and the search engine 622 is used to query the query library 621 according to the query words, and return the query results in the form of a product list. Specifically, the search engine 622 can search the query library 621 for user order records in the past 30 days, including initial candidate query words, product identifiers, product names and order identifiers, etc., and determine candidate query words from the initial candidate query words according to the query words and predetermined conditions.
[0163] According to the embodiment of the present disclosure, after the user has multiple rounds of dialogue with the first large language model M1, dialogue information is generated, and the central agent 610 inputs the dialogue information into the first large language model M1 to obtain the first recommendation information output by the first large language model. At this time, the central agent 610 can obtain the query word from the first recommendation information, and can use the query parameter identification module 613 to determine the query parameter from the dialogue information, and send the query word and the query parameter as query information to the query agent 620. The search engine 622 in the query agent 620 performs a query in the query library 621 according to the query information, and returns the query result to the central agent 610.
[0164] According to an embodiment of the present disclosure, the first large language model is determined in the following manner: obtaining a plurality of first dialogue sample information including inquiry tags and query tags; inputting the plurality of first dialogue sample information into a second large language model to generate a plurality of second dialogue sample information, wherein the number of the second dialogue sample information is greater than the number of the first dialogue sample information; and optimizing the pre-trained first large language model using a dialogue sample set consisting of the plurality of second dialogue sample information to obtain a trained first large language model.
[0165] According to an embodiment of the present disclosure, the first dialogue sample information may be obtained based on actual historical dialogue information between the user and other large language models. Specifically, inquiry tags and query tags may be added on the basis of the actual historical dialogue information to generate the first dialogue sample information.
[0166] Figure 7 The schematic diagram schematically shows the first dialogue sample information according to an embodiment of the present disclosure. Figure 7 As shown, the first dialogue sample information includes historical dialogue information, inquiry tags and query tags.
[0167] According to an embodiment of the present disclosure, since the efficiency of adding inquiry tags and query tags is low, which in turn leads to low efficiency in constructing conversation sample information, a second largest language model can be used to generate second conversation sample information based on the first conversation sample information to quickly increase the amount of conversation sample information.
[0168] According to an embodiment of the present disclosure, after obtaining the second dialogue sample information, in order to avoid the overfitting problem, dialogue sample information including single-choice questions may be added to obtain a dialogue sample set.
[0169] According to an embodiment of the present disclosure, after obtaining a dialogue sample set, the dialogue sample set can be used to train the initial first language model to obtain a trained first language model. Specifically, the dialogue sample set can be used to train and evaluate the first language model, and two rounds of training and a learning rate of 5e-6 are used, so that the trained first language model can freely switch between multiple tasks such as planning, asking questions, recommending, and chatting according to temporary dialogue information and user configuration.
[0170] According to an embodiment of the present disclosure, second dialogue sample information is generated based on first dialogue sample information through a second large language model, thereby improving the efficiency of generating dialogue sample information and further improving the efficiency of training the first large language model.
[0171] Figure 8 The block diagram of a recommendation device according to an embodiment of the present disclosure is schematically shown.
[0172] like Figure 8 As shown, the recommendation device 800 includes a first generating module 810 , a determining module 820 , a query module 830 , and a second generating module 840 .
[0173] The first generating module 810 is used to input the user's dialogue information into the first large language model to generate first recommendation information, wherein the dialogue information includes at least one round of dialogue between the user and the first large language model.
[0174] The determination module 820 is configured to determine the query information according to the position of the query identifier in the first recommendation information and the dialog information in response to determining that the first recommendation information includes the query identifier.
[0175] The query module 830 is used to determine at least one query result matching the query information from the query library, wherein the information in the query library is dynamically changing.
[0176] The second generating module 840 is configured to generate second recommendation information according to at least one query result and the first recommendation information.
[0177] According to an embodiment of the present disclosure, the query information includes query words and query parameters. The determination module 820 includes a first determination submodule and a first screening submodule.
[0178] The first determining submodule is configured to determine, in response to the first recommendation information including a query identifier, information between two query identifiers in the first recommendation information as a query term.
[0179] The first screening submodule is used to screen out at least one query parameter from the dialog information based on a screening rule.
[0180] According to an embodiment of the present disclosure, the query module 830 includes a first query submodule and a second screening submodule.
[0181] The first query submodule is used to query at least one first initial query result matching the query term from the query library.
[0182] The second screening submodule is used to screen at least one first initial query result using at least one query parameter to obtain at least one query result.
[0183] According to an embodiment of the present disclosure, the determination module 820 further includes a candidate determination submodule, a second query submodule and a third screening submodule.
[0184] The candidate determination submodule is used to determine candidate query words similar to the query word when there is no query result matching the query information in the query library.
[0185] The second query submodule is used to query the query library for at least one second initial query result that matches the candidate query term.
[0186] The third screening submodule is used to screen at least one second initial query result using at least one query parameter to obtain at least one query result.
[0187] According to an embodiment of the present disclosure, the determination module 820 further includes a replacement submodule and a composition submodule.
[0188] The replacement submodule is used to replace the query word in the first recommendation information with the candidate query word to obtain the updated first recommendation information.
[0189] The composition submodule is used to combine at least one query result and the updated first recommendation information into second recommendation information.
[0190] According to an embodiment of the present disclosure, the candidate query term satisfies preset conditions, which include at least one of the following: the candidate query term and the query term belong to the same category, the semantic similarity between the candidate query term and the query term is greater than a first predetermined threshold, and the repetition rate of the order product corresponding to the candidate query term and the order product corresponding to the query term is greater than a second predetermined threshold.
[0191] According to an embodiment of the present disclosure, the dialogue information is determined in the following manner: the initial question information input by the user is input into the first largest language model, and the user intention is determined by the first largest language model; when the user intention is a recommendation intention, at least one round of dialogue is initiated by the first largest language model; the dialogue information is generated based on the question information of at least one round of dialogue generated by the first largest language model, the user's reply information for at least one round of dialogue, and the initial question information; wherein the question information generated by the first largest language model includes a query tag.
[0192] According to an embodiment of the present disclosure, the first generation module 810 further includes a template determination submodule, a prompt generation submodule and a recommendation generation submodule.
[0193] The template determination submodule is used to determine the prompt word template that matches the user.
[0194] The prompt generation submodule is used to generate prompt information according to the dialogue information and the prompt word template.
[0195] The recommendation generation submodule is used to input the prompt information into the first language model to generate first recommendation information matching the prompt information.
[0196] According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits, or at least part of the functions of any one of them can be implemented in one module. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be split into multiple modules for implementation. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be at least partially implemented as hardware circuits, such as field programmable gate arrays (FPGAs), programmable logic arrays (PLAs), systems on chips, systems on substrates, systems on packages, application specific integrated circuits (ASICs), or can be implemented by hardware or firmware in any other reasonable way of integrating or packaging circuits, or can be implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, according to the embodiments of the present invention, one or more of the modules, submodules, units, and subunits can be at least partially implemented as computer program modules, and when the computer program modules are run, the corresponding functions can be performed.
[0197] It should be noted that the recommended device part in the embodiments of the present disclosure corresponds to the recommended method part in the embodiments of the present disclosure. The description of the recommended device part specifically refers to the recommended method part, which will not be repeated here.
[0198] Fig. 9 A block diagram of an electronic device 900 suitable for implementing a recommendation method according to an embodiment of the present disclosure is schematically shown. Fig. 9 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0199] like Fig. 9 As shown, the electronic device 900 according to an embodiment of the present disclosure includes a processor 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage part 908 to a random access memory (RAM) 903. The processor 901 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a dedicated microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 901 may also include an onboard memory for caching purposes. The processor 901 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0200] In RAM 903, various programs and data required for the operation of electronic device 900 are stored. Processor 901, ROM 902 and RAM 903 are connected to each other via bus 904. Processor 901 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 902 and / or RAM 903. It should be noted that the program can also be stored in one or more memories other than ROM 902 and RAM 903. Processor 901 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.
[0201] According to an embodiment of the present disclosure, the electronic device 900 may further include an input / output (I / O) interface 905, which is also connected to the bus 904. The electronic device 900 may further include one or more of the following components connected to the input / output (I / O) interface 905: an input portion 906 including a keyboard, a mouse, etc.; an output portion 907 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 908 including a hard disk, etc.; and a communication portion 909 including a network interface card such as a LAN card, a modem, etc. The communication portion 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the input / output (I / O) interface 905 as needed. A removable medium 911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 910 as needed, so that a computer program read therefrom is installed into the storage portion 908 as needed.
[0202] According to an embodiment of the present disclosure, the method flow according to an embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 909, and / or installed from the removable medium 911. When the computer program is executed by the processor 901, the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.
[0203] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0204] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. For example, it may include, but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device.
[0205] For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 902 and / or the RAM 903 described above and / or one or more memories other than the ROM 902 and the RAM 903 .
[0206] An embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains a program code for executing the method provided by the embodiment of the present disclosure. When the computer program product runs on an electronic device, the program code is used to enable the electronic device to implement the recommended method provided by the embodiment of the present disclosure.
[0207] When the computer program is executed by the processor 901, the above functions defined in the system / device of the embodiment of the present disclosure are executed. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0208] In one embodiment, the computer program may be based on a tangible storage medium such as an optical storage device, a magnetic storage device, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of a signal on a network medium, and downloaded and installed through the communication part 909, and / or installed from a removable medium 911. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0209] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0210] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram may represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions. It can be understood by those skilled in the art that the features recorded in the various embodiments of the present disclosure can be combined and / or combined in a variety of ways, even if such a combination or combination is not explicitly recorded in the present disclosure. In particular, without departing from the spirit and teaching of the present disclosure, the features described in the various embodiments of the present disclosure may be combined and / or combined in a variety of ways. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0211] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.< / clicktext> < / clicktext> < / clicktext> < / clicktext> < / clicktext> < / clicktext> < / clicktext> < / clicktext>
Claims
1. A recommendation method, characterized in that: The method comprises: Inputting the user's conversation information into a first large language model to generate first recommendation information, wherein the conversation information includes at least one round of conversation between the user and the first large language model; In response to determining that the first recommendation information includes a query identifier, determining query information according to a position of the query identifier in the first recommendation information and the conversation information; Determining at least one query result matching the query information from a query library, wherein the information in the query library changes dynamically; and Second recommendation information is generated according to at least one of the query results and the first recommendation information.
2. The method according to claim 1, characterized in that The query information includes a query word and a query parameter; the response to the first recommendation information including a query identifier, determining the query information according to the position of the query identifier in the first recommendation information and the dialog information, comprises: In response to the first recommendation information including a query identifier, determining information between two query identifiers in the first recommendation information as the query term; and At least one of the query parameters is filtered out from the dialog information based on a filtering rule.
3. The method according to claim 2, characterized in that The determining, from the query library, at least one query result matching the query information comprises: Searching the query library for at least one first initial query result that matches the query term; and At least one of the first initial query results is screened using at least one of the query parameters to obtain at least one of the query results.
4. The method according to claim 2, characterized in that: The method further comprises: In the case that there is no query result matching the query information in the query library, determining a candidate query word similar to the query word; Searching the query library for at least one second initial query result that matches the candidate query term; At least one of the second initial query results is screened using at least one of the query parameters to obtain at least one of the query results.
5. The method according to claim 4, characterized in that The generating second recommendation information according to at least one of the query results and the first recommendation information includes: replacing the query word in the first recommendation information with the candidate query word to obtain updated first recommendation information; and At least one of the query results and the updated first recommendation information are combined into the second recommendation information.
6. The method according to claim 4, characterized in that The candidate query word satisfies a preset condition, and the preset condition includes at least one of the following: The candidate query term and the query term belong to the same category, a semantic similarity between the candidate query term and the query term is greater than a first predetermined threshold, and a repetition rate between the ordered product corresponding to the candidate query term and the ordered product corresponding to the query term is greater than a second predetermined threshold.
7. The method according to claim 1, characterized in that: The conversation information is determined in the following manner: Inputting the initial question information input by the user into the first language model, and determining the user intention by the first language model; When the user intention is a recommendation intention, the first language model initiates at least one round of the conversation; The conversation information is generated based on question information of at least one round of the conversation generated by the first large language model, reply information of the user to at least one round of the conversation, and the initial question information; wherein the question information generated by the first large language model includes an inquiry tag.
8. The method according to claim 1, characterized in that The step of inputting the user's conversation information into the first language model to generate first recommendation information includes: Determining a prompt word template that matches the user; generating prompt information according to the dialogue information and the prompt word template; and The prompt information is input into the first large language model to generate the first recommendation information matching the prompt information.
9. The method according to any one of claims 1 to 8, characterized in that The first language model is determined in the following manner: Obtaining a plurality of first dialogue sample information including an inquiry tag and a query tag; Inputting a plurality of the first dialogue sample information into a second large language model to generate a plurality of second dialogue sample information, wherein the number of the second dialogue sample information is greater than the number of the first dialogue sample information; The pre-trained first language model is optimized using a dialogue sample set consisting of a plurality of the second dialogue sample information to obtain the trained first language model.
10. A recommendation device, characterized in that: The device comprises: A first generating module, configured to input the user's conversation information into a first large language model to generate first recommendation information, wherein the conversation information includes at least one round of conversation between the user and the first large language model; a determination module, configured to, in response to determining that the first recommendation information includes a query identifier, determine query information according to a position of the query identifier in the first recommendation information and the dialog information; A query module, configured to determine at least one query result matching the query information from a query library, wherein the information in the query library is dynamically changing; and The second generating module is used to generate second recommendation information according to at least one of the query results and the first recommendation information.
11. An electronic device, comprising: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 9.
12. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, enables the processor to implement the method according to any one of claims 1 to 9.
13. 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
Cited By
Recommendation method and apparatus, and device, medium and product
WO2026137887A1