Recommendation method and apparatus, and device, medium and product
By embedding query identifiers into the recommendation information generated by the large language model and using a dynamic query library to generate accurate second recommendation information, the problem of long generation time and inaccuracy of information generated by the large language model is solved, and efficient and accurate recommendation is achieved.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- BEIJING WODONG TIANJUN INFORMATION TECH CO LTD
- Filing Date
- 2025-08-12
- Publication Date
- 2026-07-02
Smart Images

Figure CN2025114120_02072026_PF_FP_ABST
Abstract
Description
Recommended methods, apparatus, equipment, media and products
[0001] This disclosure claims priority to Chinese Patent Application No. 202411944215.9, filed on December 26, 2024, the contents of which are incorporated herein by reference. Technical Field
[0002] This disclosure relates to the fields of artificial intelligence, intelligent customer service, intelligent robots, deep learning, and large language model technology, and more specifically, to a recommendation method, apparatus, device, medium, and product. Background Technology
[0003] With the rapid development of artificial intelligence technology, conversational recommendation systems based on large language models have been widely used.
[0004] In conversational recommendation systems based on large language models, the large language model understands user needs through dialogue and then generates recommendations accordingly. However, generating recommendations based on user needs takes a long time, and the recommendations may be inaccurate, such as recommending products that are no longer available. Summary of the Invention
[0005] In view of the above, this disclosure provides a recommended method, apparatus, device, medium, and product.
[0006] One aspect of this disclosure provides a recommendation method, comprising: inputting user 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 query information based on 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 database, wherein the information in the query database is dynamically changing; and generating second recommendation information based on the at least one query result and the first recommendation information.
[0007] According to embodiments of this disclosure, the query information includes query terms and query parameters; in response to the first recommendation information including query identifiers, determining the query information based on the position of the query identifiers in the first recommendation information and the dialogue information includes: in response to the first recommendation information including query identifiers, determining the information between two query identifiers in the first recommendation information as query terms; and filtering at least one query parameter from the dialogue information based on filtering rules.
[0008] According to embodiments of this disclosure, determining at least one query result that matches query information from a query database includes: querying at least one first initial query result that matches the query term from the query database; and filtering the at least one first initial query result using at least one query parameter to obtain at least one query result.
[0009] According to embodiments of this disclosure, the method further includes: determining candidate query terms similar to the query terms when no query result matching the query information exists in the query database; querying at least one second initial query result matching the candidate query terms from the query database; and filtering the at least one second initial query result using at least one query parameter to obtain at least one query result.
[0010] According to embodiments of this disclosure, generating second recommendation information based on at least one query result and first recommendation information includes: 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 to form second recommendation information.
[0011] According to embodiments of this disclosure, candidate query terms meet 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 between 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.
[0012] According to embodiments of this disclosure, dialogue information is determined as follows: initial question information input by the user is input into a first language model, and the first language model determines the user's intent; if the user's intent is a recommendation intent, the first language model initiates at least one round of dialogue; dialogue information is generated based on the question information of the at least one round of dialogue generated by the first language model, the user's response information to the at least one round of dialogue, and the initial question information; wherein, the question information generated by the first language model includes inquiry tags.
[0013] According to embodiments of this disclosure, inputting user dialogue information into a first language model to generate first recommendation information includes: determining a prompt word template that matches the user; generating prompt information based on the dialogue information and the prompt word template; and inputting the prompt information into the first language model to generate first recommendation information that matches the prompt information.
[0014] According to an embodiment of this disclosure, the first major language model is determined by: obtaining multiple first dialogue sample information including query tags and inquiry tags; inputting the multiple first dialogue sample information into a second major language model to generate multiple second dialogue sample information, wherein the number of second dialogue sample information is greater than the number of first dialogue sample information; and optimizing the pre-trained first major language model using the dialogue sample set composed of the multiple second dialogue sample information to obtain a trained first major language model.
[0015] Another aspect of this disclosure provides a recommendation apparatus, comprising: a first generation module for inputting user 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; a determination module for determining query information based on the position of the query identifier in the first recommendation information and the dialogue information in response to determining that the first recommendation information includes a query identifier; a query module for determining at least one query result matching the query information from a query database, wherein the information in the query database is dynamically changing; and a second generation module for generating second recommendation information based on at least one query result and the first recommendation information.
[0016] Another aspect of this disclosure provides an electronic device comprising: 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 cause the one or more processors to implement the methods described above.
[0017] Another aspect of this disclosure provides a computer-readable storage medium storing computer-executable instructions that, when executed, are used to implement the methods described above.
[0018] Another aspect of this disclosure provides a computer program product including computer-executable instructions that, when executed, are used to implement the methods described above. Attached Figure Description
[0019] The above and other objects, features and advantages of this disclosure will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:
[0020] Figure 1 schematically illustrates an exemplary system architecture to which the recommended methods and apparatus of this disclosure can be applied;
[0021] Figure 2 schematically illustrates a flowchart of a recommended method according to an embodiment of the present disclosure;
[0022] Figure 3 schematically illustrates a diagram of generating query information according to an embodiment of the present disclosure;
[0023] Figure 4 schematically illustrates a diagram of generating second recommendation information according to an embodiment of the present disclosure;
[0024] Figure 5A schematically illustrates a diagram of a first language model initiating a dialogue according to a specific embodiment of the present disclosure;
[0025] Figure 5B schematically illustrates a diagram of a first language model initiating a dialogue according to another specific embodiment of the present disclosure;
[0026] Figure 5C schematically illustrates a diagram of generating second recommendation information according to a specific embodiment of the present disclosure;
[0027] Figure 6 schematically illustrates the architecture of a recommended method according to a specific embodiment of the present disclosure;
[0028] Figure 7 schematically illustrates a diagram of first dialogue sample information according to an embodiment of the present disclosure;
[0029] Figure 8 schematically illustrates a block diagram of a recommended apparatus according to an embodiment of the present disclosure; and
[0030] Figure 9 schematically illustrates a block diagram of an electronic device 900 suitable for implementing the recommended method according to an embodiment of the present disclosure. Detailed Implementation
[0031] The embodiments of the present disclosure will now 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 disclosure. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the present disclosure for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts of the present disclosure.
[0032] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0033] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0034] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).
[0035] In the embodiments disclosed herein, the collection, updating, analysis, processing, use, transmission, provision, disclosure, and storage of data (e.g., including but not limited to user personal information) comply with relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. In particular, necessary measures have been taken to prevent unauthorized access to user personal information data and to safeguard user personal information security, network security, and national security.
[0036] In the embodiments disclosed herein, user authorization or consent is obtained before acquiring or collecting user personal information.
[0037] A Large Language Model (LLM) is a machine learning model with a large number of parameters and complex computational mechanisms. In a dialogue recommendation system using a single LLM model, the LLM is responsible for engaging in dialogue with the user and generating corresponding recommendations based on the dialogue information. However, when generating recommendations, the LLM may not only generate recommendations containing false information, such as non-existent products, but it may also fail to promptly perceive dynamic changes in the information of recommended products, such as out-of-stock or delisted items. This can lead to inaccurate recommendations, as they may include out-of-stock or delisted products. Therefore, it is necessary to obtain background information about the products before making recommendations. However, obtaining background information increases the response time of the LLM, i.e., increases first-to-toe latency, which affects the user's willingness to interact.
[0038] In a dialogue recommendation system with multiple large language models, the large language model responsible for planning tasks can invoke other large language models responsible for tasks such as asking questions and making recommendations based on dialogue information with the user. Although dialogue recommendation systems with multiple large language models can avoid coordination problems through coordination among multiple large language models, the coordination and interaction between multiple large language models not only takes a long time, affecting the user's willingness to interact, but also requires a large investment of machine resources, such as the GPU (Graphics Progressing Unit) required to achieve high inference times per request (LIPR).
[0039] This disclosure provides a recommendation method, comprising: inputting user dialogue information into a first language model to generate first recommendation information, wherein the dialogue information includes at least one round of dialogue between the user and the first language model; in response to determining that the first recommendation information includes a query identifier, determining query information based on 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 database, wherein the information in the query database is dynamically changing; and generating second recommendation information based on at least one query result and the first recommendation information. To address the aforementioned technical problems, embodiments of this disclosure utilize only a single first language model to normally generate the first recommendation information based on the input, and when the first recommendation information includes a query identifier, perform subsequent query operations, i.e., subsequently determine the query information and query results based on the query information. Therefore, when a recommendation is truly needed, the query results and the first recommendation information are combined into the final second recommendation information for recommendation; and for normal dialogue flows, it is unnecessary to perform background information search and then generate output according to fixed rules for each output, thereby reducing the time consumed by the first character. Furthermore, 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 this disclosure is dynamically changing. Therefore, inaccurate recommendations due to stockouts, product removals, etc., can be avoided.
[0040] Figure 1 schematically illustrates an exemplary system architecture to which the recommended methods and apparatus of this disclosure can be applied. It should be noted that Figure 1 is merely an example of a system architecture to which embodiments of this disclosure can be applied, to help those skilled in the art understand the technical content of this disclosure, but does not imply that embodiments of this disclosure cannot be used in other devices, systems, environments, or scenarios.
[0041] As shown in Figure 1, 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 serves as a medium for providing communication links 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] Users can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 via the network 104 to receive or send messages, etc. Various communication client applications can 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 media platform software (for example only).
[0043] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be various electronic devices with displays and support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0044] Server 105 can be a server that provides various services, such as a backend management server that supports websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103 (this is just an example). The backend management server can analyze and process data such as received 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 devices.
[0045] It should be noted that the recommendation method provided in this embodiment can generally be executed by server 105. Correspondingly, the recommendation device provided in this embodiment can generally be located in server 105. The recommendation method provided in this embodiment can also be executed by a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105. Correspondingly, the recommendation device provided in this embodiment can also be located in a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105. Alternatively, the recommendation method provided in this embodiment can also be executed by the first terminal device 101, the second terminal device 102, or the third terminal device 103, or 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, a user can use a first terminal device 101, a second terminal device 102, or a third terminal device 103 to conduct at least one round of dialogue with a first large language model in server 105 via network 104. Then, server 105 inputs the user's dialogue information into the first large language model to generate first recommendation information; in response to determining that the first recommendation information includes a query identifier, it determines query information based on the first recommendation information and the dialogue information; it determines at least one query result matching the query information from a query database, wherein the information in the query database is dynamically changing; and it generates second recommendation information based on at least one query result and the first recommendation information. Finally, server 105 sends the second recommendation information to the user's first terminal device 101, second terminal device 102, or third terminal device 103 via network 104, displaying the second recommendation information on the first terminal device 101, second terminal device 102, or third terminal device 103 so that the user can view the second recommendation information.
[0047] It should be understood that the number of terminal devices, networks, and servers shown in Figure 1 is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0048] Figure 2 schematically illustrates a flowchart of a recommended method according to an embodiment of the present disclosure.
[0049] As shown in Figure 2, the recommended method includes operations S210~S240.
[0050] In operation S210, the user's dialogue information is input into the first language model to generate the first recommendation information.
[0051] According to embodiments of this disclosure, the dialogue information includes at least one round of dialogue between the user and the first language model. When engaging in dialogue with the user, the first language model can gradually guide the user to refine their needs through at least one round of conversation.
[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 they want to buy through multiple rounds of dialogue.
[0053] For example, when a user needs to buy a birthday gift for their mother, the first language model can guide the user to express their mother's interests and hobbies during the conversation.
[0054] According to embodiments of this disclosure, when it is determined that the dialogue information includes sufficient user needs, the dialogue information can be input into a first language model so that the first language model can make recommendations based on the user needs in the dialogue information.
[0055] According to embodiments of this disclosure, the first recommendation information is recommendation information generated using a first large language model. For example, if the dialogue information expresses a need that the user wants to buy a rotary shaver, the generated first recommendation information could 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 a query identifier, query information is determined based on the position of the query identifier in the first recommendation information and the dialogue information.
[0057] According to embodiments of this disclosure, the first language model can engage in at least one round of dialogue with the user, meaning the first language model can produce at least one output. However, not every output is used for recommendation; therefore, 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, 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 operations are performed.
[0058] According to embodiments of this disclosure, a query identifier can be used to mark recommended products, recommended videos, or recommended music in the first recommendation information. For example, a query identifier can be used to mark "razor A" in the first recommendation information.
[0059] According to embodiments of this 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 "shaver A" in the first recommendation information "For rotary shavers, I recommend you consider purchasing shaver A", and information such as "rotary shaver" in the dialogue information.
[0060] According to embodiments of this disclosure, query identifiers can exist individually or in pairs. Accordingly, when a query identifier exists individually, the query information may include information in the first recommendation information that precedes or follows the query identifier; when query identifiers exist in pairs, the query information may include information between each pair of query identifiers in the first recommendation information.
[0061] In operation S230, at least one query result that matches the query information is determined from the query database.
[0062] According to embodiments of this disclosure, the information in the query database is dynamically changing. For example, the query database may store information about products that are currently being sold and have sufficient stock. Because the information in the query database is dynamically changing, information related to delisted or out-of-stock products can be deleted from the query database when a product is taken off the shelves or becomes out of stock.
[0063] According to embodiments of this disclosure, the query results can be information in a query database that matches the query information. Specifically, a search engine matching the query database can be used to perform a query in the database based on the query information, and the information of recommended objects that match the query information can be determined as the query results.
[0064] For example, when razor A is a real product, the search engine queries the query database for information about razor A. The query results may include purchase links for razor A, as well as purchase links for rotary razors B that are similar to razor A.
[0065] For example, if razor A is a counterfeit product or out of stock, the search engine will search its database for information on razor A and rotary razors. If it cannot find information on razor A, the search engine can then search its database for similar products or other rotary razors. The search results may include purchase links for rotary razor B.
[0066] In operation S240, second recommendation information is generated based on at least one query result and the first recommendation information.
[0067] According to embodiments of this disclosure, the second recommendation information is generated based on the query results and the first recommendation information. Specifically, if the query results indicate that the first recommendation information is valid, the second recommendation information may include the first recommendation information and the query results; if the query results indicate that the first recommendation information is invalid, the second recommendation information may include the first recommendation information modified according to the query results and the query results.
[0068] For example, if razor A is a genuine product and is in ample stock, the second recommendation information can include the first recommendation information, as well as a purchase link for razor A.
[0069] For example, if razor A is a counterfeit product or razor A is out of stock, but razor B is in stock, the information related to razor A in the first recommendation can be modified to information related to razor B, resulting in a modified first recommendation. Then, based on the modified first recommendation and the purchase link for razor B, a second recommendation is generated.
[0070] According to embodiments of this disclosure, since the second recommendation information is generated based on the first recommendation information and the query results, the second recommendation information may also include a query identifier. The query identifier can be used to mark recommended products, recommended videos, or recommended music in the second recommendation information. For example, the query identifier can be used to mark "razor B" in the second recommendation information.
[0071] According to embodiments of this disclosure, after generating first recommendation information, query information is generated based on the first recommendation information and dialogue information. The query information is used to determine query results with authenticity and timeliness from a constantly changing query database. A second recommendation result is then generated based on the query result and the first recommendation information, ensuring that the generated second recommendation information also possesses authenticity and timeliness. Finally, accurate second recommendation information is displayed to the user, improving the user experience. Furthermore, subsequent query operations are triggered using the query identifier in the first recommendation information, and the query result is combined with the first recommendation information generated by the large language model to form the second recommendation information for recommendation. This not only improves the accuracy of the recommendation information but also eliminates the need to first obtain the recommendation object information before making a recommendation, reducing the time spent on the first character.
[0072] According to embodiments of this disclosure, in response to the first recommendation information including a query identifier, determining query information based on the position of the query identifier in the first recommendation information and dialogue information includes: in response to the first recommendation information including a query identifier, determining the information between two query identifiers in the first recommendation information as a query term; and filtering at least one query parameter from the dialogue information based on filtering rules.
[0073] According to embodiments of this disclosure, the query information includes query terms and query parameters.
[0074] Specifically, the first recommendation information can be traversed. In response to the first recommendation information including the query identifier, the query term can be determined from the first recommendation information, and the query parameters can be determined from the dialogue information.
[0075] According to embodiments of this disclosure, the query term can be the information between two query identifiers in the first recommendation information. Specifically, query identifiers can exist in pairs, and the information between the start query identifier and the end query identifier is determined as the query term, wherein the start query identifier can be... <searchtext>The query end indicator can be...< / searchtext> Alternatively, the start and end query identifiers are the same, and the query terms between them are identified by their pairing.
[0076] According to embodiments of this disclosure, the query terms in the first recommendation information are determined by the first large language model, and the query identifier is also generated by the first large language model. Therefore, when training the first large language model, the ability of the first large language model to determine query terms and the ability to add query identifiers to query terms can be trained.
[0077] For example, the first recommendation could be, "For rotary shavers, I recommend you consider purchasing..." <searchtext> Shaver A< / searchtext>This shaver features a unique head design that closely follows the face, providing a more comfortable shaving experience. It also boasts a short charging time and long battery life, making it ideal for busy daily life. The search term obtained from the first recommended information could be "shaver A".
[0078] According to embodiments of this disclosure, query parameters can be obtained by filtering dialogue information based on filtering rules. Specifically, when filtering query parameters from dialogue information according to filtering rules, regular expression matching can be used to determine information in the dialogue information related to user needs as query parameters.
[0079] According to embodiments of this disclosure, query parameters can be obtained in real time during the user's dialogue with the first language model, and the obtained query parameters can be saved.
[0080] For example, information such as "rotary" in the dialogue can be identified as query parameters, or information such as the user's expected price for the razor can be identified as query parameters.
[0081] In this approach, large language models pass parameters in a lightweight text data exchange format (JavaScript Object Notation, JSON) to facilitate calling functional tools. However, for large language models, using JSON for function calls is both time-consuming and counterintuitive, increasing the time spent on the first character and interrupting the flow of natural dialogue.
[0082] The embodiments of this disclosure use query identifiers to mark query terms instead of transmitting query terms in JSON format, enabling real-time function calls without interrupting natural dialogue and improving the efficiency of generating the first recommendation information. Furthermore, by determining query terms from the first recommendation information and query parameters from the dialogue information, query information including both query terms and query parameters is obtained, resulting in richer and more comprehensive information in the query results, thereby improving the accuracy of the query results.
[0083] Figure 3 schematically illustrates a diagram of generating query information according to an embodiment of the present disclosure.
[0084] As shown in Figure 3, the dialogue information 301 is input into the first large language model M1 to obtain the first recommendation information 302. The query parameter 303 is determined from the dialogue information 301, the query term 304 is determined from the first recommendation information 302, and the query information 305 is obtained based on the query parameter 303 and the query term 304.
[0085] According to embodiments of this disclosure, determining at least one query result that matches query information from a query database includes: querying at least one first initial query result that matches the query term from the query database; 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 embodiments of this disclosure, when querying a query database, the search engine can query the query database based on query terms to obtain a first initial query result that matches the query terms.
[0087] For example, when a search engine performs a search based on the query term "razor A", the first initial search results may include information about razor A.
[0088] According to embodiments of this disclosure, since the first initial query results obtained by the search engine based on the query terms may not meet the user's needs, query parameters can be used to filter the first initial query results and determine the query results that meet the user's needs.
[0089] For example, the first initial query result may include information about razor A, razor B, and razor C. Razor A and razor B are rotary razors, while razor C is a clipper razor. After filtering the first initial query result using the query parameter "rotary," the resulting query result will only include information about razor A and razor B. Alternatively, a single query can be performed based on the query terms and query parameters to obtain at least one query result.
[0090] According to embodiments of this disclosure, query parameters are used to filter the first initial query results so that the obtained query results meet the user's needs, thereby improving the accuracy of the second recommendation information.
[0091] According to embodiments of this disclosure, determining the query result further includes: if no query result matching the query information exists in the query database, determining candidate query terms similar to the query term; querying at least one second initial query result matching the candidate query term from the query database; 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 embodiments of this disclosure, if there is no query result matching the query information in the query database, i.e. the query term is invalid, this situation includes: there is no first initial query result matching the query term in the query database; or there is a first initial query result matching the query term in the query database, but after filtering the first initial query result using query parameters, there is no first initial query result that satisfies the query parameters.
[0093] For example, if the query term output by the first language model is a fake product, there is no product information in the query database that matches the query term. As a result, the search engine may not be able to find the first initial query result that matches the query term in the query database.
[0094] For example, if the query term is a product that is no longer available or out of stock, the search engine may find other similar products based on the query term. However, the other products found may not meet the query parameters, resulting in no query results matching the query information in the query database.
[0095] According to embodiments of this disclosure, if no matching query result exists in the query database, it indicates that the query term is invalid. In this case, it is necessary to replace the query term with candidate query terms.
[0096] According to embodiments of this disclosure, candidate query terms can be selected from real query terms. Candidate query terms are similar to the query term, and there can be one or more candidate query terms. For example, the product corresponding to the query term can belong to the same category or brand as the product corresponding to the candidate query term, and the music corresponding to the query term can belong to the same style or be by the same artist as the music corresponding to the candidate query term.
[0097] According to embodiments of this disclosure, a search engine can use candidate search terms to query a query database and obtain second initial candidate results. For example, the candidate search term could be "razor B", and the second initial query results could include information such as a purchase link for razor B.
[0098] According to embodiments of this disclosure, query parameters are used to filter the second initial query results, thereby selecting the second initial query results that meet the user's needs as the query results.
[0099] According to embodiments of this disclosure, when a query term is invalid, the validity of the query results is ensured by replacing the query term with a candidate query term, thereby improving the accuracy of the second recommendation information.
[0100] According to embodiments of this disclosure, generating second recommendation information based on at least one query result and first recommendation information includes: 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 to form second recommendation information.
[0101] According to embodiments of this disclosure, if the query term is invalid, the first recommendation information containing the query term is also invalid, and therefore the first recommendation information needs to be updated.
[0102] According to embodiments of this disclosure, candidate query terms are valid because they are selected from real query terms.
[0103] According to embodiments of this disclosure, since the candidate query terms are valid, and the query results are obtained based on the candidate query terms even when the query terms are invalid, the query terms in the first recommendation information can be replaced with valid candidate query terms, so that the updated first recommendation information is valid and matches the query results.
[0104] According to embodiments of this disclosure, the first recommendation information may include not only the query term but also other information related to the query term. Therefore, when updating the first recommendation information, in addition to replacing the query term in the first recommendation information, it is also necessary to update the information related to the query term.
[0105] For example, if the query term in the first recommended information is "razor A", and the first recommended information also includes information such as the introduction of razor A and its advertising slogan, when the query term is invalid, when updating the first recommended information using the candidate query term "razor B", in addition to replacing "razor A" with "razor B", it is also necessary to replace the information such as the introduction of razor A and its advertising slogan with the information such as the introduction of razor B and its advertising slogan.
[0106] According to embodiments of this disclosure, in the event that the first recommendation information is invalid, the second recommendation information consists of the query results and the updated first recommendation information. Specifically, taking the aforementioned replaced first recommendation information as an example, the second recommendation information may include an introduction to razor B, advertising slogans for razor B, and a purchase link for razor B, etc.
[0107] According to embodiments of this disclosure, the first recommendation information is updated using candidate query terms, and the updated first recommendation information and query results are combined to obtain the second recommendation information, thereby ensuring the accuracy of the obtained second recommendation information.
[0108] Figure 4 schematically illustrates a diagram of generating second recommendation information according to an embodiment of the present disclosure.
[0109] As shown in Figure 4, candidate query terms 402 similar to query term 401 are identified, and the query database is queried using candidate query term 402 to obtain a second initial query result 403. The second initial query result 403 is filtered using query parameters 404 to obtain query result 406. The first recommendation information 405 is updated using candidate query term 402 to obtain updated first recommendation information 407. The query result 406 and the updated first recommendation information 407 are combined to obtain second recommendation information 408.
[0110] According to embodiments of this disclosure, candidate query terms meet 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 between 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 embodiments of this disclosure, the types of query terms and candidate query terms can be understood as the types of goods they correspond to. Specifically, the goods corresponding to the candidate query terms and the goods corresponding to the query terms can belong to the same third-level product 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 shown by the following formula (1):
[0113] Cid3_P(search_query i )=Cid3_P(search_query j (1)
[0114] Among them, search_query i You can specify the query term, search_query j Can be candidate query terms, and Cid3_P can represent the type of product.
[0115] According to embodiments of this disclosure, when the product corresponding to the query term is a delisted or out-of-stock product, other products within that product category can be identified as candidate query terms based on the product category corresponding to the query term. For example, when the query term is "razor A," meaning the category of the query term is razor, the category of candidate query terms should also be razor, such as "razor B."
[0116] According to embodiments of this disclosure, determining the semantic similarity between a query term and a candidate query term includes: using an encoder to encode the query term and the candidate query term respectively to obtain the encoded features of the query term and the encoded features of the candidate query term; and determining the similarity between the encoded features of the query term and the encoded 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 represented by the following formula (2):
[0118] Semantic_Sim(search_query i ,search_query j )>δ (2)
[0119] Among them, search_query i You can specify the query term, search_query j Can be candidate query terms, Semantic_Sim is a function to calculate the semantic similarity between the query term and the candidate query terms, and δ can be a first predetermined threshold.
[0120] According to embodiments of this disclosure, when the product corresponding to the query term is a delisted or out-of-stock product, other query terms with high semantic similarity to the query term can be identified as candidate query terms. For example, when the query term is "rotary razor", the candidate query term could be "rotary shaver" which has a semantic similarity to "rotary razor" greater than a first predetermined threshold.
[0121] According to embodiments of this disclosure, when the product corresponding to the query term is a fake product, there is no product of the same type as the query term. In this case, other query terms with high semantic similarity to the query term can also be identified as candidate query terms.
[0122] For example, when the query term is "razor A", since there is no such product as razor in real life, i.e., razor A is a fake product, "razor" with a semantic similarity greater than a first predetermined threshold can be identified as a candidate query term.
[0123] According to embodiments of this disclosure, the ordered product corresponding to the query term can be understood as the product ordered by the user after searching for the product using the query term, and the ordered product corresponding to the candidate query term can be understood as the product ordered by the user after searching for the product using the candidate query term. If the order product corresponding to the candidate query term and the order product corresponding to the query term have a high repetition rate, it indicates that the candidate query term and the query term also have a high similarity.
[0124] Specifically, when the repetition rate between the order product corresponding to the candidate query term and the order product corresponding to the query term is greater than the second predetermined threshold, the relationship between the query term and the candidate query term can be shown by the following formula (3):
[0125]
[0126] Among them, search_query i You can specify the query term, search_query j Can be candidate query terms, sku_name i You can select the product to order based on the query term, sku_name jThe Semantic_Sim can be the order product corresponding to the candidate query term. It is used to determine whether the order product corresponding to the query term is similar to the order product corresponding to the candidate query term. However, the similarity result is 1 (same) or 0 (different). You can specify the number of items ordered corresponding to the query term and the total number of items ordered corresponding to the candidate query terms. A second predetermined threshold can be set.
[0127] Therefore, when the product corresponding to the query term is a delisted or out-of-stock product, other query terms with a repetition rate of the ordered product with the query term greater than the second predetermined threshold can be identified as candidate query terms. Then, other products with a high similarity to the product corresponding to the query term can be found using the candidate query terms.
[0128] For example, when the query term is "razor," the corresponding orderable products include razor A, razor B, and razor C. A candidate query term could be "shaving razor," and the corresponding orderable products would be razor A, razor B, and razor D. Therefore, even if razor A and razor B are unavailable or out of stock, razor D, which is in ample stock, can be found using the candidate query term.
[0129] According to embodiments of this disclosure, multiple preset conditions can be combined to obtain combined preset conditions, and candidate query terms can be determined using the combined preset conditions. Specifically, query terms with a semantic similarity greater than a first predetermined threshold can be determined as initial candidate query terms, and then initial candidate query terms with a repetition rate of the ordered products corresponding to the query terms greater than a second predetermined threshold can be determined as candidate query terms.
[0130] According to embodiments of this disclosure, in order to ensure the similarity between candidate query terms and query terms, candidate query terms are determined by preset conditions, so that the determined candidate query terms have a high similarity with the query terms, and thus the query results related to the user's needs can be obtained by using the candidate query terms, thereby obtaining more accurate second recommendation information.
[0131] According to embodiments of this disclosure, dialogue information is determined as follows: initial question information input by the user is input into a first language model, and the first language model determines the user's intent; if the user's intent is a recommendation intent, the first language model initiates at least one round of dialogue; and dialogue information is generated based on the question information of the at least one round of dialogue generated by the first language model, the user's response information to the at least one round of dialogue, and the initial question information.
[0132] According to embodiments of this disclosure, a first language model can determine the user's intent based on initial question information. Specifically, the user's intent may include a recommendation intent, a casual conversation intent, etc.
[0133] According to embodiments of this disclosure, when the user's intent is to make recommendations, a first language model can be used to engage in dialogue with the user, understanding their needs during the dialogue to facilitate recommendations. Specifically, when the user's interests are broad, the first language model can ask questions to inquire about the user's preferences, guiding them to clarify their own.
[0134] According to embodiments of this disclosure, the question information generated by the first language model includes question tags, which can be used to display information between two question tags in the form of options. Specifically, question tags can exist in pairs, wherein the starting question tag can be... <clicktext>The closing tag for the query can be < / ClickText>.
[0135] According to embodiments of this disclosure, once the first language model determines that it has collected sufficient user preferences, the dialogue between the first language model and the user can be terminated. At this point, dialogue information can be generated based on the question information from at least one round of dialogue generated by the first language model, the user's response information to at least one round of dialogue, and the initial question information.
[0136] For example, the initial question input by the user could be "newborn gift box." The first language model determines the user's intent as a recommendation intent and initiates the first round of dialogue. The generated question could be: "Great, a newborn gift needs to consider the needs of both the newborn and the mother. It should be healthy, comfortable, and safe. Is the newborn a boy or a girl, or would you like a gender-neutral gift?" <clicktext>Boy< / ClickText>\n <clicktext>Girl< / ClickText>\n <clicktext>"Neutral ClickText". If the user clicks the "Girl" option, the user's response for the current round can be "Girl". At this point, the first language model can initiate a second round of dialogue, generating a question like, "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 suitable gift for you." <clicktext>Under 200 yuan <clicktext>200-500 yuan<\ / ClickText>\n <clicktext>500-1000 yuan<\ / ClickText>\n <clicktext>"1000 yuan or more"< / ClickText>"If a user clicks the "500-1000 yuan" option, the user's response information for the current round can be "500-1000 yuan".
[0137] According to embodiments of this disclosure, at least one round of dialogue is initiated through a first major language model to guide the user to clarify their needs, ensuring that the dialogue information includes sufficient user requirements, thereby improving the accuracy of recommendations. Furthermore, by using query tags to mark options instead of JSON format, the natural dialogue is not interrupted, improving the efficiency of generating the first recommendation information.
[0138] Figure 5A schematically illustrates a diagram of a first language model initiating a dialogue according to a specific embodiment of the present disclosure.
[0139] As shown in Figure 5A, the initial question 501 entered by the user is "What's a good gift for Father's Day?". The first language model determines that the user's intent is recommendation intent, initiates the first round of dialogue, and generates question 502. Question 502 includes a text part 5021 and an option part 5022. The text part 5021 is "It's great to help you choose a Father's Day gift! We have a wide range of choices, which can be considered from his hobbies (such as smoking, drinking, tea drinking, sports, photography, etc.), needs (such as men's skincare products, clothing, shoes, accessories, etc.), and usage scenarios (such as office, outdoor, home, etc.). What does your dad like, or do you have any ideas?" The option part 5022 includes nine options: "Smoking and drinking," "Tea drinking and painting," "Sports and fitness," "Outdoor travel," "Photography," "Men's skincare," "Clothing and accessories," "Books and music," and "Food and cooking," as well as an input box displaying "Click to enter."
[0140] According to an embodiment of this disclosure, a user can click on any option in the option section 5022, and the terminal responds to the user's click operation by using the information of the clicked option as the user's response to the question information 502.
[0141] According to an embodiment of this disclosure, the user can also click the input box and enter the 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 to the question information 502.
[0142] Figure 5B schematically illustrates a diagram of a first language model initiating a dialogue according to another specific embodiment of the present disclosure.
[0143] As shown in Figure 5B, in response to question 502, the user inputs reply 503, "The old man's razor, brand P." At this point, the first language model needs to further guide the user to clarify their preferences, initiate a second round of dialogue, and generate question 504. Question 504 includes a text portion 5041 and an option portion 5042. The text portion 5041 is, "Okay, I understand. Regarding the razor, we can consider upgrading his shaving experience. So, what type of razor does your father prefer?" The option portion 5042 includes three options: "manual razor," "rotary razor," and "trimmer razor," as well as an input box for inputting user-defined options.
[0144] Figure 5C schematically illustrates a diagram of generating second recommendation information according to a specific embodiment of the present disclosure.
[0145] As shown in Figure 5C, in response to question 504, the user inputs reply 505 "rotary shaver." The user's needs are now clear, and a second recommendation 506 is generated. This second recommendation 506 includes a text section 5061 and a link section 5062. The text section 501 reads, "Okay, I understand. For rotary shavers, I recommend you consider purchasing the P brand Q series shaver. This shaver features a unique head design that gets closer to the face, providing a more comfortable shaving experience. It also has a short charging time and long battery life, making it ideal for busy daily life. Moreover, its simple and elegant design makes it a perfect gift. Here are some recommended products for you." The link section 5062 includes purchase links for the P brand Q series shaver and the P brand M series shaver, as well as a "Product Comparison" button. The purchase links can also include product images, prices, and customer reviews.
[0146] According to embodiments of this disclosure, in text portion 5061, the underlined text "P brand Q series shaver" can be a query term, and the purchase links for P brand Q series shavers and P brand M series shavers in link portion 5062 can be found in a query database based on the query term "P brand Q series shaver". Furthermore, users can click on the query term "P brand Q series shaver", and the page will redirect to the query page corresponding to "P brand Q series shaver".
[0147] According to embodiments of this disclosure, when a user clicks on two product links in link section 5062, the page will redirect to the product purchase page. Clicking the "Product Comparison" button will redirect to a product comparison page, where information about the two products can be displayed in two separate sub-screens, facilitating comparison of product information by the user.
[0148] According to embodiments of this disclosure, inputting user dialogue information into a first language model to generate first recommendation information includes: determining a prompt word template that matches the user; generating prompt information based on the dialogue information and the prompt word template; and inputting the prompt information into the first language model to generate first recommendation information that matches the prompt information.
[0149] According to embodiments of this disclosure, since different users have different communication habits, multiple prompt word templates can be set to improve user experience. Different prompt word templates correspond to different communication habits, so as to generate first recommendation information using prompt word templates that conform to the user's communication habits.
[0150] According to embodiments of this disclosure, a user profile can be obtained from the user profile management module when the user inputs initial question information, and a prompt word template matching the user can be determined based on the user profile. Alternatively, a prompt word template matching the user can be determined based on the dialogue information after the user has engaged in at least one round of dialogue with the first language model.
[0151] According to embodiments of this disclosure, a user profile can be a user model abstracted from user behavior data such as likes, comments, and replies, used to characterize the user's communication habits.
[0152] It should be noted that after collecting user likes, comments, and replies, we will use technical means to de-identify the data.
[0153] According to embodiments of this disclosure, generating prompt information based on dialogue information and prompt word template includes: obtaining user demand information from dialogue information, filling the demand information into prompt word template, and generating prompt information.
[0154] According to embodiments of this 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 embodiments of this disclosure, multiple reply templates can be set, each corresponding to different communication habits to suit the needs of users with different styles. Specifically, a first recommendation message can be generated using a reply template matched to the user.
[0156] Figure 6 schematically illustrates the architecture of a recommended method according to a specific embodiment of the present disclosure.
[0157] As shown in Figure 6, the architecture for implementing the recommendation method includes a central agent 610 and a search agent 620. The central agent 610 includes a user profile management module 611, a dialogue history management module 612, a query parameter recognition module 613, an external interface 614, and a first large language model M1. The search agent 620 includes a query library 621 and a search engine 622.
[0158] According to embodiments of this disclosure, a first large language model M1 is used to engage in multi-turn dialogues with the user, generate dialogue information, and generate first recommendation information based on the dialogue information. A user profile management module 611 can be used to store user profiles to facilitate the determination of prompt word templates matching the user based on the user profile.
[0159] According to embodiments of this disclosure, the dialogue history management module 612 can be used to store historical dialogue information between the first major language model M1 and the user. Specifically, the storage service can be provided by an online storage system (Redis), using the user identifier and dialogue identifier as key information of the historical dialogue information, and the initial question information, the question information generated by the first major language model, and the user's reply information as value information of the historical dialogue information, storing the historical dialogue information in Redis in the form of key-value pairs.
[0160] According to an embodiment of this disclosure, the query parameter identification module 613 is used to obtain query parameters generated during the dialogue between the first large language model M1 and the user. Specifically, the query parameters can be obtained and stored from the dialogue history management module 612 using regular expression matching, so that the query parameters can be applied to the entire dialogue process.
[0161] According to embodiments of this disclosure, external interface 614 can be used to call external programs, such as querying weather, time, etc.
[0162] According to embodiments of this disclosure, the query database 621 is used to store product information and user order records, while the search engine 622 is used to perform queries in the query database 621 based on query terms and return the query results in the form of a product list. Specifically, the search engine 622 can search the query database 621 for user order records of the past 30 days, including initial candidate query terms, product identifiers, product names, and order identifiers, and determine candidate query terms from the initial candidate query terms based on the query terms and predetermined conditions.
[0163] According to embodiments of this disclosure, after a user engages in multiple rounds of dialogue with a first large language model M1, dialogue information is generated. The central agent 610 inputs this dialogue information into the first large language model M1 to obtain first recommended information output by the first large language model. At this time, the central agent 610 can obtain query terms from the first recommended information and, using the query parameter recognition module 613, determine query parameters from the dialogue information. The query terms and query parameters are then sent as query information to the query agent 620. The search engine 622 in the query agent 620 performs a query in the query database 621 based on the query information and returns the obtained query results to the central agent 610.
[0164] According to an embodiment of this disclosure, the first major language model is determined by: obtaining multiple first dialogue sample information including query tags and inquiry tags; inputting the multiple first dialogue sample information into a second major language model to generate multiple second dialogue sample information, wherein the number of second dialogue sample information is greater than the number of first dialogue sample information; and optimizing the pre-trained first major language model using the dialogue sample set composed of the multiple second dialogue sample information to obtain a trained first major language model.
[0165] According to embodiments of this disclosure, the first dialogue sample information can be obtained based on the actual historical dialogue information between the user and other large language models. Specifically, query tags and inquiry tags can be added to the actual historical dialogue information to generate the first dialogue sample information.
[0166] Figure 7 schematically illustrates a first dialogue sample information according to an embodiment of the present disclosure. As shown in Figure 7, the first dialogue sample information includes historical dialogue information, inquiry tags, and query tags.
[0167] According to embodiments of this disclosure, since adding query tags and inquiry tags is inefficient, resulting in low efficiency in constructing dialogue sample information, a second language model can be used to generate second dialogue sample information based on the first dialogue sample information to quickly increase the number of dialogue sample information.
[0168] According to embodiments of this disclosure, after obtaining the second dialogue sample information, in order to avoid overfitting, dialogue sample information containing single-choice questions can be added to obtain a dialogue sample set.
[0169] According to embodiments of this disclosure, after obtaining a dialogue sample set, the initial first language model can be trained using the dialogue sample set to obtain a trained first language model. Specifically, the first language model can be trained and evaluated using the dialogue sample set, and two rounds of training with a learning rate of 5e-6 can be employed, enabling the trained first language model to freely switch between multiple tasks such as planning, questioning, recommendation, and small talk based on temporary dialogue information and user configuration.
[0170] According to embodiments of this disclosure, a second dialogue sample is generated based on the first dialogue sample information using a second language model, thereby improving the efficiency of generating dialogue sample information and thus improving the training efficiency of the first language model.
[0171] Figure 8 schematically illustrates a block diagram of a recommended apparatus according to an embodiment of the present disclosure.
[0172] As shown in Figure 8, the recommendation device 800 includes a first generation module 810, a determination module 820, a query module 830, and a second generation module 840.
[0173] The first generation module 810 is used to input the user's dialogue information into the first large language model to generate the 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 used to determine query information in response to determining that the first recommendation information includes a query identifier, based on the position of the query identifier in the first recommendation information and the dialogue information.
[0175] The query module 830 is used to determine at least one query result that matches the query information from the query database, wherein the information in the query database is dynamically changing.
[0176] The second generation module 840 is used to generate second recommendation information based on at least one query result and the first recommendation information.
[0177] According to embodiments of this disclosure, the query information includes query terms and query parameters. The determination module 820 includes a first determination submodule and a first filtering submodule.
[0178] The first determination submodule is used to determine the information between two query identifiers in the first recommendation information as query terms in response to the first recommendation information including query identifiers.
[0179] The first filtering submodule is used to filter out at least one query parameter from the dialogue information based on filtering rules.
[0180] According to embodiments of this disclosure, the query module 830 includes a first query submodule and a second filtering submodule.
[0181] The first query submodule is used to retrieve at least one initial query result that matches the query term from the query database.
[0182] The second filtering submodule is used to filter at least one first initial query result using at least one query parameter to obtain at least one query result.
[0183] According to embodiments of this disclosure, the determining module 820 further includes a candidate determining submodule, a second query submodule, and a third filtering submodule.
[0184] The candidate determination submodule is used to determine candidate query terms that are similar to the query terms when no query results matching the query information exist in the query database.
[0185] The second query submodule is used to retrieve at least one second initial query result from the query database that matches the candidate query terms.
[0186] The third filtering submodule is used to filter at least one second initial query result using at least one query parameter to obtain at least one query result.
[0187] According to embodiments of this disclosure, the determining module 820 further includes a replacement submodule and a composition submodule.
[0188] The replacement submodule is used to replace the query terms in the first recommendation information with candidate query terms to obtain the updated first recommendation information.
[0189] The component submodule is used to combine at least one query result and the updated first recommendation information to form the second recommendation information.
[0190] According to embodiments of this disclosure, the candidate query term meets 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 between 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 embodiments of this disclosure, dialogue information is determined as follows: initial question information input by the user is input into a first language model, and the first language model determines the user's intent; if the user's intent is a recommendation intent, the first language model initiates at least one round of dialogue; dialogue information is generated based on the question information of the at least one round of dialogue generated by the first language model, the user's response information to the at least one round of dialogue, and the initial question information; wherein, the question information generated by the first language model includes inquiry tags.
[0192] According to embodiments of this 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 based on dialogue information and prompt word templates.
[0195] The recommendation generation submodule is used to input the prompt information into the first language model and generate the first recommendation information that matches the prompt information.
[0196] Any one or more of the modules, submodules, units, and subunits according to embodiments of the present disclosure, or at least part of the functions of any one or more of them, can be implemented in one module. Any one or more of the modules, submodules, units, and subunits according to embodiments of the present disclosure can be implemented by dividing them into multiple modules. Any one or more of the modules, submodules, units, and subunits according to embodiments of the present disclosure can be at least partially implemented as hardware circuitry, such as a Field-Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a System-on-Chip, a System-on-a-Substrate, a System-on-Package, an Application-Specific Integrated Circuit (ASIC), or implemented in hardware or firmware by any other reasonable means of integrating or packaging circuitry, or implemented in software, hardware, or firmware, or in any suitable combination of any of these three implementation methods. Alternatively, one or more of the modules, submodules, units, and subunits according to embodiments of the present disclosure can be at least partially implemented as computer program modules, which, when run, can perform corresponding functions.
[0197] It should be noted that the recommended device part in the embodiments of this disclosure corresponds to the recommended method part in the embodiments of this disclosure. The specific description of the recommended device part is referred to in the recommended method part, and will not be repeated here.
[0198] Figure 9 schematically illustrates a block diagram of an electronic device 900 suitable for implementing the recommended method according to an embodiment of the present disclosure. The electronic device shown in Figure 9 is merely an example and should not be construed as limiting the functionality and scope of the embodiments of the present disclosure.
[0199] As shown in FIG9, an 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 portion 908 into 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 an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 901 may also include 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] RAM 903 stores various programs and data required for the operation of electronic device 900. Processor 901, ROM 902, and RAM 903 are interconnected via bus 904. Processor 901 performs various operations of the method flow according to embodiments of the present disclosure by executing programs in ROM 902 and / or RAM 903. It should be noted that the programs may also be stored in one or more memories other than ROM 902 and RAM 903. Processor 901 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in said one or more memories.
[0201] According to embodiments of this disclosure, the electronic device 900 may further include an input / output (I / O) interface 905, which is also connected to a bus 904. The electronic device 900 may also include one or more of the following components connected to the input / output (I / O) interface 905: an input section 906 including a keyboard, mouse, etc.; an output section 907 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 908 including a hard disk, etc.; and a communication section 909 including a network interface card such as a LAN card, modem, etc. The communication section 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 disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 910 as needed so that computer programs read from it can be installed into the storage section 908 as needed.
[0202] According to embodiments of this disclosure, the method flow according to embodiments of this disclosure can be implemented as a computer software program. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable storage medium, the computer program containing program code for performing the methods shown in the flowchart. In such embodiments, the computer program can be downloaded and installed from a network via communication section 909, and / or installed from removable medium 911. When the computer program is executed by processor 901, it performs the functions defined in the system of embodiments of this disclosure. According to embodiments of this disclosure, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0203] This disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs that, when executed, implement the method according to the embodiments of this disclosure.
[0204] According to embodiments of this disclosure, the computer-readable storage medium can be a non-volatile computer-readable storage medium. Examples include, but are not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0205] For example, according to embodiments of this disclosure, a computer-readable storage medium may include the ROM 902 and / or RAM 903 described above and / or one or more memories other than ROM 902 and RAM 903.
[0206] Embodiments of this disclosure also include a computer program product comprising a computer program containing program code for performing the methods provided in the embodiments of this disclosure. When the computer program product is run on an electronic device, the program code is used to enable the electronic device to implement the recommended methods provided in the embodiments of this disclosure.
[0207] When the computer program is executed by the processor 901, it performs the functions defined in the system / apparatus of this disclosure embodiments. According to embodiments of this disclosure, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0208] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and downloaded and installed via the communication section 909, and / or installed from a removable medium 911. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0209] According to embodiments of this disclosure, program code for executing the computer programs provided in embodiments of this disclosure can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C", or similar programming languages. The program code can execute entirely on a user's computing device, partially on a user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0210] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions. Those skilled in the art will understand that the features described in the various embodiments of the present disclosure can be combined and / or combined in various ways, even if such combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments of this disclosure may be combined and / or combined in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or combinations fall within the scope of this disclosure.
[0211] The embodiments of this disclosure have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of this disclosure. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of this disclosure, and all such substitutions and modifications should fall within the scope of this disclosure.< / clicktext> < / clicktext> < / clicktext> < / clicktext> < / clicktext> < / clicktext> < / clicktext> < / clicktext>
Claims
1. A recommendation method, comprising: The user's dialogue information is input into the first language model to generate the first recommendation information, wherein the dialogue information includes at least one round of dialogue between the user and the first language model; In response to determining that the first recommendation information includes a query identifier, query information is determined based on the position of the query identifier in the first recommendation information and the dialogue information; Determine at least one query result from a query database that matches the query information, wherein the information in the query database is dynamically changing; and Based on at least one of the query results and the first recommendation information, generate second recommendation information.
2. The method according to claim 1, wherein, The query information includes query terms and query parameters; the response to the first recommendation information includes a query identifier, and the query information is determined based on the position of the query identifier in the first recommendation information and the dialogue information, including: In response to the first recommendation information including a query identifier, the information between the two query identifiers in the first recommendation information is determined as the query term; and Based on the filtering rules, at least one of the query parameters is filtered out from the dialogue information.
3. The method according to claim 2, wherein, Determining at least one query result from the query database that matches the query information includes: Retrieve at least one first initial query result from the query database that matches the query term; and At least one of the first initial query results is filtered using at least one of the query parameters to obtain at least one query result.
4. The method according to claim 2, further comprising: If no query result matching the query information exists in the query database, candidate query terms similar to the query term are determined; Retrieve at least one second initial query result from the query database that matches the candidate query term; At least one of the second initial query results is filtered using at least one of the query parameters to obtain at least one of the query results.
5. The method according to claim 4, wherein, The step of generating second recommendation information based on at least one of the query results and the first recommendation information includes: The candidate query terms are used to replace the query terms in the first recommendation information to obtain the updated first recommendation information; and The second recommendation information is composed of at least one of the query results and the updated first recommendation information.
6. The method according to claim 4, wherein, The candidate query terms satisfy preset conditions, which include at least one of the following: The candidate query term belongs to the same category as the query term, the semantic similarity between the candidate query term and the query term is greater than a first predetermined threshold, and the repetition rate between 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.
7. The method according to claim 1, wherein, The dialogue information is determined in the following way: The initial question information input by the user is fed into the first large language model, which then determines the user's intent. If the user's intent is a recommendation intent, the first large language model initiates at least one round of the dialogue. The dialogue information is generated based on the question information from at least one round of the dialogue generated by the first large language model, the user's response information to at least one round of the dialogue, and the initial question information; wherein the question information generated by the first large language model includes question tags.
8. The method according to claim 1, wherein, The step of inputting the user's dialogue information into the first language model to generate the first recommendation information includes: Determine a prompt word template that matches the user; Based on the dialogue information and the prompt word template, generate prompt information; and The prompt information is input into the first large language model to generate the first recommendation information that matches the prompt information.
9. The method according to any one of claims 1 to 8, wherein, The first major language model was determined in the following way: Obtain multiple first-dialogue sample information, including inquiry tags and query tags; Multiple first dialogue sample information are input into the second language model to generate multiple second dialogue sample information, the number of second dialogue sample information is greater than the number of first dialogue sample information. The first large language model after pre-training is optimized using a dialogue sample set composed of multiple second dialogue sample information to obtain the trained first large language model.
10. A recommended device, comprising: The first generation module is used to input the user's dialogue information into the first large language model and generate the first recommendation information, wherein the dialogue information includes at least one round of dialogue between the user and the first large language model; A determination module is configured to determine query information based on the position of the query identifier in the first recommendation information and the dialogue information in response to determining that the first recommendation information includes a query identifier; A query module is used to determine at least one query result matching the query information from a query database, wherein the information in the query database is dynamically changing; and The second generation module is used to generate second recommendation information based on at least one of the query results and the first recommendation information.
11. An electronic device, comprising: One or more processors; Memory, used to store 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 method of any one of claims 1 to 9.
12. A computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to perform the method of any one of claims 1 to 9.
13. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-9.