Product recommendation model training method, product recommendation method
By extracting keywords from conversation information on e-commerce platforms and building keyword product groups, we trained a product recommendation model, solving the problem of customer service being unable to recommend products quickly and accurately, achieving more efficient product recommendations and improving user experience.
Patent Information
- Application Number
- CN202510750023.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-06
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2045-06-06
AI Technical Summary
Existing e-commerce platform customer service is unable to quickly and accurately identify user personalization, resulting in product recommendations that do not meet user needs and long waiting times for users.
By obtaining conversation information between users and customer service, extracting keywords for target products and building keyword-product groups, the product recommendation model is trained to learn to recommend products based on keywords.
It improves the accuracy and efficiency of product recommendations, reduces user waiting time, and enhances the interactive experience between users and customer service.
Smart Images

Figure CN120278795B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this specification relate to the field of computer technology, and in particular to a product recommendation model training method and a product recommendation method. Background Art
[0002] In the healthcare consumer sector, e-commerce platforms generate a large amount of daily conversation data between users and customer service representatives. Users communicate with customer service representatives through the platforms, and customer service representatives recommend suitable products. In practice, e-commerce platform customer service representatives use large language models to recommend products based on the information provided by users.
[0003] On current e-commerce platforms, customer service representatives using large language models to provide product recommendations are unable to effectively and quickly identify users' individual preferences based on the information they provide, nor can they accurately and quickly recommend suitable products. This results in long wait times for users, and sometimes the recommended products do not meet their needs. Therefore, a new method is urgently needed to enrich the capabilities of large language models so that they can quickly and accurately provide users with suitable products based on the information they provide, thereby improving the user experience. Summary of the Invention
[0004] In view of this, embodiments of this specification provide a product recommendation model training method and a product recommendation method. One or more embodiments of this specification also relate to a computing device, a computer-readable storage medium, and a computer program product to address technical deficiencies in the prior art.
[0005] According to a first aspect of an embodiment of this specification, a method for training a product recommendation model is provided, comprising:
[0006] Acquiring dialogue information to be processed, wherein the dialogue information to be processed includes a target product and an interactive dialogue text corresponding to the target product;
[0007] extracting at least one target keyword corresponding to the target product from the interactive dialogue text, and constructing a keyword-product group based on each target keyword and the target product;
[0008] A product recommendation model is trained based on the keyword-product group, so that the product recommendation model learns to recommend target products according to target keywords.
[0009] According to a second aspect of the embodiments of this specification, a product recommendation method is provided, including:
[0010] receiving interactive dialogue text to be processed;
[0011] Extracting at least one target keyword from the interactive dialogue text to be processed, and constructing product recommendation prompt words based on each target keyword;
[0012] The product recommendation prompt words are input into the product recommendation model to obtain the target recommended product output by the product recommendation model, wherein the product recommendation model is trained by the product recommendation model training method.
[0013] According to a third aspect of an embodiment of this specification, a computing device is provided, including:
[0014] memory and processor;
[0015] The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor, the steps of the above method are implemented.
[0016] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores a computer program / instruction, and the computer program / instruction implements the steps of the above method when executed by a processor.
[0017] According to a fifth aspect of the embodiments of this specification, a computer program product is provided, comprising a computer program / instruction, which implements the steps of the above method when executed by a processor.
[0018] The methods provided in the embodiments of this specification extract target keywords associated with target products from conversation messages and construct keyword-product groups based on these target keywords and products. By injecting keyword-product groups into a product recommendation model, the trained product recommendation model can provide users with more targeted product recommendations based on the keyword-product group information, reducing user wait time, providing customer service with more professional responses, and improving the interactive experience between users and customer service. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 This is a flowchart of a method for training a product recommendation model provided by one embodiment of this specification;
[0020] Figure 2 This is a flowchart of a processing process of a training method for a product recommendation model applied to medical scenarios provided by one embodiment of this specification;
[0021] Figure 3 This is a schematic diagram of the structure of a training device for a product recommendation model provided by one embodiment of this specification;
[0022] Figure 4 This is a flowchart of a product recommendation method provided by one embodiment of this specification;
[0023] Figure 5 This is an architectural diagram of a product recommendation system provided by one embodiment of this specification;
[0024] Figure 6 This is a structural block diagram of a computing device provided by one embodiment of this specification. DETAILED DESCRIPTION
[0025] The following description sets forth many specific details to facilitate a thorough understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the scope of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.
[0026] The terms used in one or more embodiments of this specification are for the purpose of describing specific embodiments only and are not intended to limit one or more embodiments of this specification. The singular forms "a," "the," and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0027] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0028] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this manual are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant regions, and corresponding operation entrances must be provided for users to choose to authorize or refuse.
[0029] In one or more embodiments of this specification, a large model refers to a deep learning model with large-scale model parameters, typically containing hundreds of millions, tens of billions, hundreds of billions, trillions, or even more than ten trillion model parameters. A large model can also be called a foundation model. It is pre-trained on a large amount of unlabeled corpus to produce a pre-trained model with more than 100 million parameters. This model can adapt to a wide range of downstream tasks and has good generalization capabilities, such as large language models (LLMs) and multi-modal pre-training models.
[0030] When large models are used in practice, only a small number of samples are needed to fine-tune the pre-trained model and it can be applied to different tasks. Large models can be widely used in natural language processing (NLP), computer vision and other fields. Specifically, they can be applied to computer vision tasks such as visual question answering (VQA), image caption (IC), and image generation, as well as natural language processing tasks such as text-based sentiment classification, text summary generation, and machine translation. The main application scenarios of large models include digital assistants, intelligent robots, search, online education, office software, e-commerce, and intelligent design.
[0031] First, the terms involved in one or more embodiments of this specification are explained.
[0032] TF-IDF: term frequency–inverse document frequency, is a commonly used weighting technique for information retrieval and text mining. It is mainly used to evaluate the importance of a word to a document collection or a document in a corpus.
[0033] N-gram segmentation: It is a statistical method of word segmentation that predicts the probability distribution of the next word by considering n consecutive words.
[0034] This specification provides a training method for a product recommendation model and a product recommendation method. This specification also involves a computing device, a computer-readable storage medium, and a computer program product, which are described in detail one by one in the following embodiments.
[0035] See also Figure 1 , Figure 1A flowchart of a method for training a product recommendation model according to an embodiment of this specification is shown, which specifically includes the following steps.
[0036] Step 102: Acquire dialogue information to be processed, wherein the dialogue information to be processed includes a target product and an interactive dialogue text corresponding to the target product.
[0037] Among them, the dialogue information to be processed can be understood as the dialogue interaction information between users and customer service on the e-commerce platform. The dialogue information to be processed is a complete dialogue interaction information. In the training method of the product recommendation model provided in the embodiment of this specification, there can be multiple dialogue information to be processed. For the sake of convenience of explanation, one dialogue information to be processed is used as an example for explanation.
[0038] It should be noted that the product recommendation model training method provided in the embodiments of this specification is intended for training a product recommendation model. The training data used to train the product recommendation model must include the target product. Therefore, in the methods provided in the embodiments of this specification, the conversation information to be processed must include the target product and the text of the interactive conversation in which the customer service representative recommends the target product.
[0039] In practice, users can engage in conversations with customer service on e-commerce platforms. During these conversations, users may have diverse needs, such as product inquiries, requests for urgent delivery, or refunds. The methods provided in the embodiments of this specification utilize conversations in which customer service recommends products to users. Therefore, the conversation information to be processed refers to interactive conversation data involving product recommendations.
[0040] In a specific implementation provided in this specification, obtaining the conversation information to be processed includes:
[0041] Obtaining initial conversation information and analyzing the conversation intent of the initial conversation information;
[0042] When the conversation intention is product recommendation and the initial conversation information includes a target product, the initial conversation information is determined to be conversation information to be processed.
[0043] In practical applications, initial conversation information can be obtained from the e-commerce platform. Initial conversation information can be understood as each conversation record stored on the e-commerce platform. There are usually multiple initial conversation information. In the method provided in the embodiments of this specification, multiple initial conversation information can also be obtained from the conversation log database of the e-commerce platform.
[0044] After obtaining the initial conversation information, the conversation intent of the initial conversation information can be further analyzed. The conversation intent refers to what the initial conversation information intends to do. For example, if the user communicates with customer service about requesting a refund, the conversation intent is refund; if the user communicates with customer service about expediting delivery, the conversation intent is expediting delivery; if the user communicates with customer service about product inquiries, the conversation intent is product recommendations, and so on. In practical applications, a conversation intent model can be pre-trained to identify the corresponding conversation intent based on the initial conversation information. The methods provided in the embodiments of this specification do not limit how to parse the conversation intent of the initial conversation information.
[0045] After determining the conversation intent corresponding to the initial conversation information, the initial conversation information can be screened according to the conversation intent. The initial conversation information with the conversation intent of product recommendation is treated as the conversation information to be processed. However, in actual applications, it is possible that although the conversation intent of the initial conversation information is product recommendation, the customer service staff ultimately fails to successfully recommend the corresponding product to the user. Such initial conversation information cannot be used as training data for the method provided in the embodiment of this specification. Therefore, in the method provided in the embodiment of this specification, in addition to the conversation intent of product recommendation, it is also necessary to ensure that the target product successfully recommended by the customer service staff to the user is included in the initial conversation data. Based on this, the initial conversation information can be determined as the conversation information to be processed.
[0046] Through the methods provided in the embodiments of this specification, conversations with the intent of recommending a product and containing a recommended target product are selected from multiple initial conversations as pending conversation information, providing data support for the subsequent construction of training data. This screening of the initial conversation data also improves the quality of the pending conversation data.
[0047] Step 104: extract at least one target keyword corresponding to the target product from the interactive dialogue text, and construct a keyword-product group based on each target keyword and the target product.
[0048] After determining the conversation data to be processed, at least one target keyword can be extracted from the interactive conversation text in the conversation data to be processed. The target keyword corresponds to the target product. Specifically, the target keyword refers to a keyword extracted from the interactive conversation text that is related to the target product. For example, if the target product is cold medicine, the target keyword is a keyword related to cold medicine. For another example, if the target product is a sweeping robot, the target keyword is a keyword related to sweeping robots.
[0049] After extracting the target keywords corresponding to the target product from the interactive dialogue text, a keyword product group can be constructed based on each target keyword and target product. For example, if the target keywords are "elderly, COPD" and the target product is "bi-level ventilator", then a keyword product group [elderly, COPD-bi-level ventilator] can be constructed; for another example, if the target keywords are "20-year-old female, snoring" and the target product is "mono-level ventilator", then a keyword product group [20-year-old female, snoring-mono-level ventilator] can be constructed. In the above example, the format of the keyword product group is the target keyword in front and the target product in the back. It can also be the target product in front and the target keyword after the disaster. In the method provided in the example of this specification, the format of the keyword product group is not limited, and it can be kept unified.
[0050] In a specific embodiment provided in this specification, extracting at least one target keyword corresponding to the target product from the interactive dialogue text includes S1042-S1046:
[0051] S1042: Extract at least one initial keyword from the interactive dialogue text, and identify the initial keyword category corresponding to each initial keyword based on the business knowledge graph.
[0052] In the method provided in the embodiments of this specification, at least one initial keyword can be extracted from the interactive conversation text, and the initial keyword category corresponding to each initial keyword can be identified. The initial keyword can be understood as a keyword related to the target product extracted from the interactive conversation text. The initial keyword category can be understood as the category corresponding to each initial keyword. In the method provided in the embodiments of this specification, a business knowledge graph is used to identify the initial keyword category corresponding to each initial keyword.
[0053] The business knowledge graph can be understood as a pre-created knowledge graph related to the target business scenario. For example, taking the medical field as an example, the business knowledge graph is the medical knowledge graph, which includes entity information such as population, symptoms, and diseases. After extracting at least one initial keyword from the interactive dialogue text, each initial keyword can be mapped to the medical knowledge graph for identification, and the initial keyword category corresponding to each initial keyword in the medical knowledge graph is obtained. For example, if the initial keyword is "elderly", its initial keyword category can be determined to be "population"; for example, if the initial keyword is "dyspnea", its initial keyword category can be determined to be "symptoms"; for example, if the initial keyword is "chronic obstructive pulmonary disease", its initial keyword category can be determined to be "disease"; for initial keywords that cannot be identified as corresponding categories based on the business knowledge graph, their initial keyword categories are set to other categories.
[0054] In a specific embodiment provided in this specification, extracting at least one initial keyword from the interactive dialogue text includes:
[0055] Processing the interactive dialogue text based on a preset word segmentation model to obtain at least one reference initial keyword;
[0056] Calculating a keyword weight value of each reference initial keyword in the interactive dialogue text;
[0057] An initial keyword is determined from among the reference initial keywords according to the weight value of each keyword.
[0058] In practical applications, interactive conversation text often contains numerous keywords. In the methods provided in the embodiments of this specification, a preliminary keyword screening can be performed to reduce the amount of data required for subsequent processing. Specifically, the interactive conversation text can be processed based on a preset word segmentation model to obtain at least one reference initial keyword. The reference initial keyword can be understood as a keyword directly extracted from the interactive conversation text without undergoing screening. The preset word segmentation model can be any word segmentation model.
[0059] In the method provided in the embodiment of this specification, the preset word segmentation model is an n-gram word segmentation model as an example for explanation. The n-gram word segmentation model is a statistical-based language model, which is commonly used in natural language processing tasks. It usually considers n words that appear consecutively to predict the distribution probability of the next word. N-gram refers to n items that appear consecutively in a text. According to different values of n, n-grams can be divided into different types. In the method provided in the embodiment of this specification, the value of n can be greater than 2 and less than 5. In actual applications, the specific value of n can be set according to actual conditions, and this is not limited in this specification. The n-gram model generates word segmentation results by setting a sliding window, and each word segmentation result is a reference to the initial keyword.
[0060] After obtaining the reference initial keywords, in order to filter out some unimportant keywords, the keyword weight values of the reference initial keywords in the interactive dialogue text can be calculated, and the reference initial keywords can be screened according to the keyword weight values to select the initial keywords.
[0061] The method for calculating the keyword weight value of each reference initial keyword in the interactive dialogue text can be the TF-IDF (Term Frequency-Inverse Document Frequency) algorithm, the CRITIC weight method, the AHP (Analytic Hierarchy Process) hierarchical method, etc. In the method provided in the embodiment of this specification, the specific algorithm for calculating the keyword weight value is not limited.
[0062] In one specific embodiment provided herein, using the TF-IDF algorithm as an example, keyword weights for each reference initial keyword in the interactive dialogue text are calculated, and the reference initial keywords are then filtered using a preset keyword weight threshold to obtain initial keywords. For example, the TF-IDF value of each reference initial keyword is calculated using the TF-IDF algorithm, and the TF-IDF value is compared with a preset keyword weight threshold (e.g., 0.15). Reference initial keywords with TF-IDF values greater than 0.15 are determined as initial keywords, while reference initial keywords with TF-IDF values less than or equal to 0.15 are filtered out.
[0063] After obtaining the initial keywords, the keyword category of each initial keyword can be identified. In practical applications, a pre-set keyword classification model can be used to identify each initial keyword. In the method provided in the embodiment of this specification, a business knowledge graph has been created in advance, but there is no entity information related to the target product in the business knowledge graph. In order to further enrich the business knowledge graph, the method provided in the embodiment of this specification uses the business knowledge graph to identify the initial keyword category of each initial keyword. In subsequent processing, the target product can also be added to the business knowledge graph to enrich the dimension of the business knowledge graph and increase the amount of information in the business knowledge graph.
[0064] In a specific embodiment provided in this specification, identifying the initial keyword category corresponding to each initial keyword based on the business knowledge graph includes:
[0065] Determining a target initial keyword among the initial keywords, wherein the target initial keyword is any one of the initial keywords;
[0066] When the target initial keyword matches an entity in the business knowledge graph, determining the initial keyword category corresponding to the target initial keyword according to the matched entity;
[0067] When the target initial keyword does not match an entity in the business knowledge graph, it is determined that the initial keyword category corresponding to the target initial keyword is other categories.
[0068] In this embodiment, there are many initial keywords, and the processing method for each initial keyword is the same. Here, we take one of the initial keywords as an example to explain, that is, to determine the target initial keyword among the initial keywords. The target initial keyword is the keyword identified by the business knowledge graph. The target initial keyword can be any one of the initial keywords.
[0069] Once the target initial keyword is determined, a matching operation can be performed on the target initial keyword in the business knowledge graph. If the target initial keyword matches an entity in the business knowledge graph, the initial keyword category of the target initial keyword can be determined based on the matched entity. For example, taking the business knowledge graph as a medical knowledge graph as an example for explanation, the target initial keyword is "dyspnea", and the corresponding entity is matched in the business knowledge graph. The corresponding type of the entity is symptom, which means that the initial keyword category of the target initial keyword "dyspnea" can be determined as "symptom".
[0070] If the target initial keyword does not match an entity in the business knowledge graph, it can be determined that the corresponding initial keyword category is other categories.
[0071] Taking the medical knowledge graph as an example, the business knowledge graph can be used to match the initial keywords with corresponding initial keyword categories including "population", "symptoms", and "disease". For some initial keywords, if the relevant entities cannot be matched in the business knowledge graph, the initial keyword category that can be determined for them can be "other categories".
[0072] S1044: training a keyword classification model according to each initial keyword and the initial keyword category corresponding to each initial keyword.
[0073] After determining each initial keyword and the initial keyword category corresponding to each initial keyword in the above steps, the initial keyword category also includes "other categories". The initial keyword category is determined for the initial keyword in the above steps using the business knowledge graph. For some initial keywords in the "other categories", it may be that no corresponding entity is found in the business knowledge graph, but it may also be a category that can be identified in the business knowledge graph. Therefore, a keyword classification model can be further trained to further classify the initial keywords in the "other categories".
[0074] Based on this, a keyword classification model can be trained based on each initial keyword and each initial keyword category. The keyword classification model is trained to determine the corresponding keyword category based on the input keyword.
[0075] Specifically, in a specific implementation provided in this specification, the initial keyword categories include business categories and other categories;
[0076] The keyword classification model is trained according to each initial keyword and the initial keyword category corresponding to each initial keyword, including:
[0077] Determining training initial keywords from each initial keyword according to each initial keyword category, and training an initial keyword classification model according to the training initial keywords and the training keyword categories corresponding to the training initial keywords;
[0078] Add predicted category information for initial keywords whose initial keyword categories are other categories according to the initial keyword classification model;
[0079] The initial keyword category corresponding to the initial keyword is updated using each predicted category information, and the initial keyword classification model is continuously trained using each initial keyword and the initial keyword category corresponding to each initial keyword to obtain a keyword classification model.
[0080] In this embodiment, the training initial keywords are first determined from each initial keyword according to each initial keyword category. The specific confirmation method can be to sample the various initial keyword categories according to a preset category ratio, so that the number of training initial keywords corresponding to each initial keyword category meets the preset ratio. For example, in a medical scenario, the initial keyword categories include "population", "symptoms", "diseases", and "other categories", among which the number of initial keywords corresponding to symptoms is relatively large, the number of initial keywords corresponding to population is second, and the number of initial keywords corresponding to diseases is relatively small. Then, the training initial keywords can be selected from the initial keywords corresponding to each initial keyword category according to the preset category ratio (such as the value of population: symptoms: disease: other categories is 2:3:1:1). It should be noted that the preset category ratio can be set according to the actual situation, and this is not limited in this manual.
[0081] After the initial training keywords are determined, the initial keyword classification model can be trained based on the initial training keywords and the training keyword categories corresponding to the initial training keywords. In practical applications, the Bert model or the RoBERTa-wwm model can be used to construct the initial keyword classification model. In the methods provided in the embodiments of this specification, the model architecture of the initial keyword classification model is not limited.
[0082] According to the trained initial keyword classification model, the initial keywords that have not participated in the training and whose initial keyword categories are other categories are classified, and predicted category information is added to the initial keywords of other categories, wherein the predicted category information refers to the predicted category added to the initial keywords of other categories after being identified by the initial keyword classification model.
[0083] When the initial keyword classification model outputs predicted category information for initial keywords in other categories, it also outputs the corresponding confidence level. The confidence level of the predicted category information is used to determine the classification weight of the predicted category information. In the method provided in the embodiments of this specification, predicted category information with a confidence level greater than a preset confidence threshold is retained. The predicted category information is then updated with the initial keyword category of the corresponding initial keyword.
[0084] After executing the above steps, return to execute again to train the initial keyword classification model using each initial keyword and the initial keyword category corresponding to each initial keyword until all data have participated in the model training of the initial keyword classification model, thereby obtaining a trained keyword classification model.
[0085] After all data has participated in the model training of the initial keyword classification model, the trained keyword classification model can be used to re-predict initial keywords whose initial keyword categories are other categories, and pseudo-label categories can be added to the initial keywords of each other category. Each pseudo-label category is sorted according to the corresponding confidence level, and a preset number of initial keywords with higher confidence levels are obtained. The initial keywords with the pseudo-label category are replaced with the initial keywords of other categories. The keyword classification model is then trained continuously, and the weight of the pseudo-label category is adjusted using exponential decay measurement in each round of training to reduce the influence of the pseudo-label category on the keyword classification model.
[0086] When the number of pseudo-label categories below the preset confidence threshold in consecutive preset number of rounds of model training is less than the preset number threshold, the keyword classification model training is considered completed.
[0087] S1046: Identify the predicted keyword category of each initial keyword according to the trained keyword classification model, and determine at least one target keyword from each initial keyword based on the predicted keyword category.
[0088] After obtaining the trained keyword classification model, each initial keyword is identified based on the trained keyword classification model to obtain the predicted keyword category corresponding to each initial keyword. Keywords with the predicted keyword category being the preset keyword category are used as target keywords.
[0089] Specifically, in actual applications, after obtaining the predicted keyword category corresponding to each initial keyword, the data of each initial keyword can be normalized according to the predicted keyword category, such as removing duplicate records and formatting to ensure the standardization and integrity of the data, thereby obtaining the final target keyword.
[0090] In another specific embodiment provided in this specification, a keyword-product group is constructed based on each target keyword and the target product, including:
[0091] Constructing an initial keyword-product group based on each target keyword and the target product;
[0092] Data verification for the initial keyword-product group is received, and the initial keyword-product group that passes the data verification is determined to be the keyword-product group.
[0093] In the method provided in the embodiments of this specification, after the target keyword is determined, it can be combined with the target product in the dialogue information to be processed to construct a keyword-product group.
[0094] In actual applications, there may be correlation between target keywords and target products. In order to better improve the relevance and logic between target keywords and target products, the method provided in the embodiments of this specification also provides a data verification operation. Specifically, an initial keyword product group is constructed based on each target keyword and target product.
[0095] Receive data validation for the initial keyword-product group. Data validation is used to determine the accuracy of the target keywords in the initial keyword-product group, the rationality of the product recommendations, and the logic between the two. Data validation can be implemented by data validation rules jointly designed by professional business and product teams. Initial keyword-product groups that pass data validation will be determined as keyword-product groups.
[0096] Step 106: Training a product recommendation model based on the keyword-product group, so that the product recommendation model learns to recommend target products according to target keywords.
[0097] After obtaining the keyword-product group, the keyword-product group can be used to further train the product recommendation model. In the methods provided in the embodiments of this specification, the product recommendation model can be a large language model. After training with the keyword-product group, the product recommendation model has the ability to accurately match the corresponding target products based on the relevant target keywords.
[0098] In a specific embodiment provided in this specification, training a product recommendation model based on the keyword product group so that the product recommendation model learns to recommend target products based on target keywords includes:
[0099] Constructing information injection prompt words based on the keyword product group;
[0100] The information is injected into the prompt word and inputted into the product recommendation model so that the product recommendation model can learn to recommend target products according to the target keywords.
[0101] In this embodiment, information injection prompt words for information injection can be constructed based on keyword product groups, and the recommended solutions corresponding to the keyword product groups can be converted into prompts in natural language form. The information injection prompt words will generate corresponding information according to the type of target keywords.
[0102] The information injection prompt words are input into the product recommendation model to guide the product recommendation model to incorporate relevant knowledge when generating product recommendations.
[0103] For example, in the medical scenario, the keyword product group is [COPD, respiratory failure, carbon dioxide retention, moderate to severe sleep apnea syndrome - bi-level ventilator]. The information injection prompt words generated based on this are:
[0104] “Question: What type of ventilator should patients with COPD use?
[0105] Answer: For patients with chronic obstructive pulmonary disease (COPD), a bi-level ventilator (BiPAP) is usually recommended rather than a CPAP machine.
[0106] Bi-level ventilator (BiPAP)
[0107] Working principle:
[0108] Provides two pressure values, inspiratory pressure (IPAP) and expiratory pressure (EPAP), to help patients breathe more easily through the pressure difference.
[0109] Applicable scenarios:
[0110] Suitable for patients with COPD, especially those with respiratory failure and carbon dioxide retention.
[0111] It is suitable for patients with moderate to severe sleep apnea syndrome, especially those who do not respond well to CPAP.
[0112] advantage:
[0113] Breathing is more natural, which can effectively improve breathing difficulties and reduce the work of respiratory muscles.
[0114] Why are bi-level ventilators more suitable for patients with COPD?
[0115] COPD patients often experience respiratory muscle fatigue and carbon dioxide retention. Bi-level ventilators provide different inspiratory and expiratory pressures to help patients expel carbon dioxide more effectively and reduce the burden of breathing.
[0116] Injecting information injection prompts into the product recommendation model enables model training of the product recommendation model, allowing the product recommendation model to incorporate relevant knowledge when generating answers.
[0117] Specifically, the Instruct Gpt method can be used to provide the above-mentioned information injection prompt words to the product recommendation model, so that the product recommendation model learns the examples in the information injection prompt words and learns how to generate samples that meet the requirements based on the prompts.
[0118] In addition, the data in the information injection prompt word can be added to the fine-tuning training task of the existing general task. This can fully utilize the correlation between different tasks and improve the overall performance of the product recommendation model.
[0119] In multi-task learning, we can also design corresponding loss functions to balance the weights between tasks and ensure that the information injection task receives sufficient attention.
[0120] During the training process of the product recommendation model, reinforcement learning strategies can be introduced to enhance the product recommendation model's ability to understand and distinguish knowledge. By constructing positive and negative sample pairs, the model learns how to map similar knowledge points to similar semantic spaces and distinguish different knowledge points, thereby improving product recommendation capabilities.
[0121] In another specific embodiment provided in this specification, the method further comprises:
[0122] The business knowledge graph is updated according to the keyword product group to add the target product to the business knowledge graph.
[0123] In the specific implementations provided in the examples of this specification, a business knowledge graph is used to identify the initial keyword categories corresponding to each initial keyword. After obtaining the keyword-product group, the keyword-product group can be used to update the business knowledge graph, adding target product information to the business knowledge graph, adding entities and relationships related to the target product, and constructing a product-business knowledge graph. This enriches the content of the knowledge graph.
[0124] The methods provided in the embodiments of this specification extract target keywords associated with target products from conversation messages and construct keyword-product groups based on these target keywords and products. By injecting keyword-product groups into a product recommendation model, the trained product recommendation model can provide users with more targeted product recommendations based on the keyword-product group information, reducing user wait time, providing customer service with more professional responses, and improving the interactive experience between users and customer service.
[0125] The following combined Figure 2 , taking the application of the training method of the product recommendation model provided in this specification in the medical scenario as an example, the training method of the product recommendation model is further explained. Figure 2A flowchart of a processing process of a training method for a product recommendation model applied to a medical scenario provided by an embodiment of this specification is shown, which specifically includes the following steps.
[0126] Step 202: Acquire initial conversation information and analyze the conversation intention of the initial conversation information.
[0127] Step 204: When the conversation intention is product recommendation and the initial conversation information includes a target medical product, the initial conversation information is determined to be conversation information to be processed.
[0128] Step 206: Segment the dialogue information to be processed using an n-gram segmentation strategy to obtain at least one reference initial keyword.
[0129] Step 208: Calculate the tf-idf value of each reference initial keyword, and retain the initial keywords whose tf-idf value is greater than a preset threshold.
[0130] Step 210: Based on the medical knowledge graph, add population, symptoms, diseases, and other labels to the initial keywords.
[0131] Step 212: sampling the data corresponding to the above four types of labels according to a preset ratio to obtain initial training keywords, and training the initial keyword classification model based on the initial training keywords.
[0132] Step 214: Label the data that did not participate in the model training according to the initial keyword classification model, and filter out the data with a confidence level less than the confidence threshold.
[0133] Step 216: Continue to determine training keywords to train the initial keyword model until all initial keywords participate in the model training to obtain a keyword classification model.
[0134] Step 218: Use the keyword classification model to predict other types of initial keywords, obtain corresponding pseudo-label data, and obtain a preset number of pseudo-label data with a confidence level greater than a preset number threshold. The pseudo-label data is used to continue training the keyword classification model.
[0135] Step 220: Use exponential decay measurement to adjust the label weight of the pseudo-label data in the sample data, and continue to train the keyword classification model until the confidence of the pseudo-label data predicted in three consecutive rounds is less than the confidence threshold.
[0136] Step 222: Use the keyword classification model to re-identify each initial keyword, obtain the population, symptoms, and disease types corresponding to each initial keyword, remove duplicate records, correct format inconsistencies, ensure data standardization, and obtain target keywords.
[0137] Step 224: Construct a keyword product group based on the target medical product and the target keyword, and update the medical knowledge graph based on the keyword product group, and add entities and relationships related to the medical product to the medical knowledge graph.
[0138] Step 226: Construct information injection prompt words based on the keyword product group, and input the information injection prompt words into the product recommendation model so that the product recommendation model learns to recommend target medical products based on the target keywords.
[0139] The method provided in the embodiments of this specification extracts target keywords associated with target medical products from conversation messages and constructs keyword-product groups based on these target keywords and target medical products. By injecting keyword-product groups into a product recommendation model, the trained product recommendation model can provide users with more targeted medical product recommendations based on the information in the keyword-product groups, reducing user wait times, providing customer service with more professional responses, and improving the interactive experience between users and customer service.
[0140] At the same time, the medical knowledge graph can be updated based on the keyword product group to enrich the knowledge content in the medical knowledge graph and provide data support for subsequent data processing.
[0141] Corresponding to the above method embodiment, this specification also provides an embodiment of a training device for a product recommendation model. Figure 3 FIG1 shows a schematic diagram of a training device for a product recommendation model provided by an embodiment of this specification. Figure 3 As shown, the device includes:
[0142] An acquisition module 302 is configured to acquire dialogue information to be processed, wherein the dialogue information to be processed includes a target product and an interactive dialogue text corresponding to the target product;
[0143] A construction module 304 is configured to extract at least one target keyword corresponding to the target product from the interactive dialogue text, and construct a keyword-product group based on each target keyword and the target product;
[0144] The training module 306 is configured to train a product recommendation model based on the keyword-product group, so that the product recommendation model learns to recommend target products according to target keywords.
[0145] Optionally, the acquisition module 302 is further configured to:
[0146] Obtaining initial conversation information and analyzing the conversation intent of the initial conversation information;
[0147] When the conversation intention is product recommendation and the initial conversation information includes a target product, the initial conversation information is determined to be conversation information to be processed.
[0148] Optionally, the construction module 304 is further configured to:
[0149] Extracting at least one initial keyword from the interactive dialogue text, and identifying an initial keyword category corresponding to each initial keyword based on a business knowledge graph;
[0150] Training a keyword classification model based on each initial keyword and the initial keyword category corresponding to each initial keyword;
[0151] The predicted keyword category of each initial keyword is identified according to the trained keyword classification model, and at least one target keyword is determined from each initial keyword based on the predicted keyword category.
[0152] Optionally, the construction module 304 is further configured to:
[0153] Processing the interactive dialogue text based on a preset word segmentation model to obtain at least one reference initial keyword;
[0154] Calculating a keyword weight value of each reference initial keyword in the interactive dialogue text;
[0155] An initial keyword is determined from among the reference initial keywords according to the weight value of each keyword.
[0156] Optionally, the construction module 304 is further configured to:
[0157] Determining a target initial keyword among the initial keywords, wherein the target initial keyword is any one of the initial keywords;
[0158] When the target initial keyword matches an entity in the business knowledge graph, determining the initial keyword category corresponding to the target initial keyword according to the matched entity;
[0159] When the target initial keyword does not match an entity in the business knowledge graph, it is determined that the initial keyword category corresponding to the target initial keyword is other categories.
[0160] Optionally, the initial keyword categories include business categories and other categories;
[0161] The construction module 304 is further configured to:
[0162] Determining training initial keywords from each initial keyword according to each initial keyword category, and training an initial keyword classification model according to the training initial keywords and the training keyword categories corresponding to the training initial keywords;
[0163] Add predicted category information for initial keywords whose initial keyword categories are other categories according to the initial keyword classification model;
[0164] The initial keyword category corresponding to the initial keyword is updated using each predicted category information, and the initial keyword classification model is continuously trained using each initial keyword and the initial keyword category corresponding to each initial keyword to obtain a keyword classification model.
[0165] Optionally, the apparatus further includes a knowledge graph updating module configured to:
[0166] The business knowledge graph is updated according to the keyword product group to add the target product to the business knowledge graph.
[0167] Optionally, the construction module 304 is further configured to:
[0168] Constructing an initial keyword-product group based on each target keyword and the target product;
[0169] Data verification for the initial keyword-product group is received, and the initial keyword-product group that passes the data verification is determined to be the keyword-product group.
[0170] Optionally, the training module 306 is further configured to:
[0171] Constructing information injection prompt words based on the keyword product group;
[0172] The information is injected into the prompt word and inputted into the product recommendation model so that the product recommendation model can learn to recommend target products according to the target keywords.
[0173] The device provided in the embodiments of this specification extracts target keywords associated with target products from conversation messages and constructs keyword-product groups based on the target keywords and target products. By injecting the keyword-product groups into a product recommendation model, the trained product recommendation model can provide users with more targeted product recommendations based on the keyword-product group information, reducing user wait time, providing customer service with more professional responses, and improving the interactive experience between users and customer service.
[0174] The above is a schematic diagram of a product recommendation model training device according to this embodiment. It should be noted that the technical solution of this product recommendation model training device and the technical solution of the product recommendation model training method described above are based on the same concept. For details not described in detail in the technical solution of the product recommendation model training device, please refer to the description of the technical solution of the product recommendation model training method described above.
[0175] See also Figure 4 , Figure 4 A flowchart of a product recommendation method provided by an embodiment of this specification is shown, which specifically includes the following steps.
[0176] Step 402: Receive the interactive dialogue text to be processed.
[0177] Step 404: extract at least one target keyword from the interactive dialogue text to be processed, and construct product recommendation prompt words based on each target keyword.
[0178] Step 406: Input the product recommendation prompt words into the product recommendation model to obtain the target recommended product output by the product recommendation model, wherein the product recommendation model is trained using the above-mentioned product recommendation model training method.
[0179] See also Figure 5 , Figure 5 The following is an architecture diagram of a product recommendation system provided by an embodiment of the present specification. The product recommendation system may include a client 100 and a server 200;
[0180] The client 100 is used to send the interactive dialogue text to be processed to the server 200;
[0181] The server 200 is configured to extract at least one target keyword from the interactive dialogue text to be processed, and construct product recommendation prompts based on each target keyword; input the product recommendation prompts into a product recommendation model to obtain target recommended products output by the product recommendation model, wherein the product recommendation model is trained using the product recommendation model training method described above; and send the target recommended products to the client 100;
[0182] The client 100 is also used to receive target recommended products sent by the server 200.
[0183] The product recommendation system can include multiple clients 100 and a server 200. The clients 100 can be referred to as end-side devices, and the server 200 can be referred to as cloud-side devices. The multiple clients 100 can establish a communication connection through the server 200. In the medical product recommendation scenario, the server 200 is used to provide medical product recommendation services to the multiple clients 100. The multiple clients 100 can act as either senders or receivers, communicating through the server 200.
[0184] Users can interact with the server 200 through the client 100 to receive data sent by other clients 100, or send data to other clients 100. In the medical product recommendation scenario, users can publish data streams to the server 200 through the client 100. The server 200 generates target medical product recommendations based on the data stream and pushes the target medical product recommendations to other clients with which communication has been established.
[0185] The client 100 and the server 200 are connected via a network. The network provides a medium for the communication link between the client 100 and the server 200. The network can include various connection types, such as wired or wireless communication links or fiber optic cables. The data transmitted by the client 100 may need to be encoded, transcoded, compressed, or other processing before being released to the server 200.
[0186] The client 100 can be a browser, an application (APP), a web application such as an H5 (HyperText Markup Language 5) application, a lightweight application (also known as a mini-program, a type of lightweight application), or a cloud application. The client 100 can be developed based on the software development kit (SDK) of the corresponding service provided by the server 200, such as a real-time communication (RTC) SDK. The client 100 can be deployed on a computing device and rely on the device or certain applications on the device to run. For example, the computing device can have a display screen and support information browsing, such as a personal mobile terminal such as a mobile phone, tablet computer, or personal computer. Various other types of applications can also be configured on the computing device, such as human-computer interaction applications, model training applications, text processing applications, web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0187] The server 200 may include servers that provide various services, such as servers that provide communication services to multiple clients, servers that support backend training for models used on clients, and servers that process data sent by clients. It should be noted that the server 200 can be implemented as a distributed server cluster consisting of multiple servers or as a single server. The server can also be a server in a distributed system or a server integrated with blockchain. The server can also be a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), big data and artificial intelligence platforms, or intelligent cloud computing servers or intelligent cloud hosts equipped with artificial intelligence technology.
[0188] It is worth noting that the product recommendation methods provided in the embodiments of this specification are generally executed by the server. However, in other embodiments of this specification, the client may also have similar functions to the server and thus execute the product recommendation methods provided in the embodiments of this specification. In other embodiments, the product recommendation methods provided in the embodiments of this specification may also be executed jointly by the client and the server.
[0189] Figure 6 6 shows a block diagram of a computing device 600 according to an embodiment of the present application. Components of the computing device 600 include, but are not limited to, a memory 610 and a processor 620. The processor 620 is connected to the memory 610 via a bus 630, and a database 650 is used to store data.
[0190] The computing device 600 also includes an access device 640 that enables the computing device 600 to communicate via one or more networks 660. Examples of such networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 640 may include one or more of any type of network interface (e.g., a network interface controller (NIC)) whether wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.
[0191] In one embodiment of the present application, the above components of the computing device 600 and Figure 6 Other components not shown in the figure may also be connected to each other, for example, via a bus. Figure 6 The computing device structure block diagram shown is for illustrative purposes only and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as needed.
[0192] Computing device 600 can be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, personal digital assistant, laptop computer, notebook computer, netbook computer, etc.), a mobile phone (e.g., a smartphone), a wearable computing device (e.g., a smartwatch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or personal computer (PC). Computing device 600 can also be a mobile or stationary server.
[0193] The processor 620 is configured to execute the following computer program / instructions, which, when executed by the processor, implement the steps of the training method and product recommendation method of the above-mentioned product recommendation model.
[0194] The above is a schematic diagram of a computing device according to this embodiment. It should be noted that the technical solution of this computing device is based on the same concept as the aforementioned product recommendation model training method and product recommendation method. For details not described in detail in the technical solution of the computing device, please refer to the description of the aforementioned product recommendation model training method and product recommendation method.
[0195] An embodiment of this specification also provides a computer-readable storage medium storing a computer program / instruction, which, when executed by a processor, implements the training method of the above-mentioned product recommendation model and the steps of the product recommendation method.
[0196] Each embodiment in this specification is described in a progressive manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences from other embodiments. In particular, the computer-readable storage medium embodiment is generally similar to the product recommendation model training method and product recommendation method embodiments, so the description is relatively simple. For relevant parts, refer to the partial description of the product recommendation model training method and product recommendation method embodiments.
[0197] An embodiment of this specification also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the training method of the above-mentioned product recommendation model and the steps of the product recommendation method.
[0198] The above is a schematic diagram of a computer program product according to this embodiment. It should be noted that the technical solution of this computer program product shares the same concept as the aforementioned product recommendation model training method and product recommendation method. For details not described in detail in the technical solution of the computer program product, please refer to the description of the aforementioned product recommendation model training method and product recommendation method.
[0199] The foregoing description of this specification describes specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0200] The computer instructions include computer program code, which may be in source code form, object code form, executable file, or some intermediate form. The computer-readable medium may include any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal, and software distribution medium. It should be noted that the content of the computer-readable medium may be appropriately increased or decreased based on the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media does not include electric carrier signals and telecommunication signals.
[0201] It should be noted that the above description is of specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multi-tasking and parallel processing are also possible or may be advantageous. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.
[0202] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0203] The preferred embodiments disclosed above are intended only to help illustrate this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and variations can be made based on the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that those skilled in the art can better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.
Claims
1. A product recommendation model training method, comprising: Acquiring dialogue information to be processed, wherein the dialogue information to be processed includes a target product and an interactive dialogue text corresponding to the target product; Extract at least one initial keyword from the interactive dialogue text, and identify the initial keyword category corresponding to each initial keyword based on the business knowledge graph; train a keyword classification model based on each initial keyword and the initial keyword category corresponding to each initial keyword; identify the predicted keyword category of each initial keyword based on the trained keyword classification model, use the initial keyword whose predicted keyword category is a preset keyword category as a target keyword, and construct a keyword product group based on each target keyword and the target product, wherein the initial keyword category includes business category and other categories, and train the keyword classification model based on each initial keyword and the initial keyword category corresponding to each initial keyword, including: determining a training initial keyword from each initial keyword based on each initial keyword category, and training the initial keyword classification model based on the training initial keyword and the training keyword category corresponding to the training initial keyword; adding predicted category information to the initial keyword whose initial keyword category is other categories based on the initial keyword classification model; updating the initial keyword category corresponding to the initial keyword with each predicted category information, and continuing to train the initial keyword classification model with each initial keyword and the initial keyword category corresponding to each initial keyword to obtain a keyword classification model; A product recommendation model is trained based on the keyword-product group so that the product recommendation model learns to recommend target products based on target keywords, and the business knowledge graph is updated based on the keyword-product group to add the target product to the business knowledge graph.
2. The method according to claim 1, wherein the step of constructing a keyword-product group based on each target keyword and the target product comprises: Constructing an initial keyword-product group based on each target keyword and the target product; Data verification for the initial keyword-product group is received, and the initial keyword-product group that passes the data verification is determined to be the keyword-product group.
3. The method of claim 1, wherein training a product recommendation model based on the keyword-product group so that the product recommendation model learns to recommend target products based on target keywords comprises: Constructing information injection prompt words based on the keyword product group; The information is injected into the prompt word and inputted into the product recommendation model so that the product recommendation model can learn to recommend target products according to the target keywords.
4. A product recommendation method, comprising: receiving interactive dialogue text to be processed; Extracting at least one target keyword from the interactive dialogue text to be processed, and constructing product recommendation prompt words based on each target keyword; Input the product recommendation prompt words into the product recommendation model to obtain the target recommended product output by the product recommendation model, wherein the product recommendation model is trained by the training method according to any one of claims 1 to 3.
5. A computing device comprising: memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer program / instructions are executed by the processor, the steps of the method according to any one of claims 1 to 4 are implemented.
6. A computer-readable storage medium storing a computer program / instruction, wherein the computer program / instruction, when executed by a processor, implements the steps of the method according to any one of claims 1 to 4.
7. A computer program product comprising a computer program / instruction, which implements the steps of the method according to any one of claims 1 to 4 when executed by a processor.
Citation Information
Patent Citations
Keyword corpus annotation training extraction tool
CN110298033A
Product recommendation method and device, equipment and computer readable storage medium
CN113888265A