Conversational recommendation method and system based on user preference

By using random variational Bayesian inference and Transformer encoder in a conversational recommendation system, we separate and integrate users' long-term and short-term preferences, combined with external knowledge graphs, and solve the problem of user preference capture and recommendation effects, achieving more Accurate user preference understanding and recommendation results improve.

CN114840763BActive Publication Date: 2024-12-24SHANDONG UNIV
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202210562367.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-23
Publication Date
2024-12-24
Estimated Expiration
2042-05-23

AI Technical Summary

Technical Problem

A conversational recommendation system based on topic guidance is difficult to fully capture users' long-term preferences, and due to privacy and cost reasons, long-term and short-term interests cannot be obtained through manual annotation, resulting in limited recommendation effects and semantic correlation between topics and recommended items. complex.

Method used

Random variation Bayesian inference method is used to separate user long-term preferences and short-term preferences in the dialogue recommendation model, and integrate user preferences with external knowledge, embedding representation and preference tracking through Transformer encoder and decoder, using R-GCN The network processes knowledge graphs and generates natural language replies.

Benefits of technology

Accurately capture user preferences, improve recommendation and generation effects, solve the problem of user preferences without labels, and enhance the system's recommendation and generation capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114840763B_ABST
    Figure CN114840763B_ABST
Patent Text Reader

Abstract

The present invention discloses a conversational recommendation method and system based on user preferences, including: obtaining a user number, a user conversation context and a conversation topic line to be recommended; inputting the obtained data into a conversational recommendation model after training and testing, and outputting a conversational recommendation result; wherein the working principle of the conversational recommendation model is: first, embedding the obtained data; then, tracking the user's long-term preference and the user's short-term preference for the embedded representation result; then, based on the user's long-term and short-term preference tracking results, outputting a recommendation result; finally, converting the recommendation result into natural language and replying it to the user to be recommended.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of conversational recommendation, and in particular to a conversational recommendation method and system based on user preference. Background Art

[0002] The statements in this section merely mention background art related to the present invention and do not necessarily constitute prior art.

[0003] Recommendation systems have evolved into an important tool for information seekers. Traditional recommendation systems usually predict users' preferences for a certain product by evaluating their previous offline behaviors. In contrast, conversational recommendation systems can more quickly elicit users' current preferences and better understand the reasons behind consumption behaviors through timely multi-round online conversational interactions. Conversational recommender systems (CRS) originated from the development of interactive recommendations and aim to solve recommendation tasks through dialogues between the system and users. Early research on conversational recommendation tasks described the task as a specific application of task-oriented multi-round dialogue systems. Based on different perspectives, conversational recommender systems (CRS) are roughly divided into two categories, such as Figure 1 Shown: Attribute-based conversational recommendation system and topic-guided conversational recommendation system.

[0004] In attribute-based CRS, the system uses template sentences to directly ask users whether they are interested in a certain attribute, and users answer yes or no based on their preferences. If they answer "yes", it means that the user likes the attribute proposed by the system, and vice versa. In this way, after multiple rounds of interaction, the system can obtain the user's explicit preference attribute set and make recommendations based on it.

[0005] CRS based on topic guidance allows both parties to interact in the form of natural language, which has a higher degree of freedom. The conversation usually starts with small talk, and the system gradually guides the topic to recommendation. Unlike attribute-based CRS, this method cannot explicitly obtain user interests through the user's yes or no reply. Instead, in the process of interacting with the user, the user's natural language reply is used to explore the user's implicit interest. When making recommendations, the system makes recommendations based on the obtained user interests.

[0006] Attribute-based conversational recommendation systems focus on strategy selection, including whether to recommend or inquire in this round, which attributes to inquire about, and which items to recommend. Some early works obtained user preferences by directly asking users whether they like a certain item, while other works obtained preferences by asking users whether they like a certain attribute. When deciding when to recommend, some works make recommendations based on a fixed number of rounds of inquiries in the front, while other works train the system to automatically select a suitable round for recommendation. Reinforcement learning is widely used in this type of work. Christakopoulou et al. focus on the cold start problem in conversational recommendation and make a trade-off between continuing to mine user preferences and using user preferences for recommendation. Some recent works focus more on how to let the system autonomously choose the time to recommend. Deng et al. further improve recommendation performance by introducing external knowledge graphs. Attribute-based conversational recommendation systems tend to use concise and clear replies, ignoring the complex interactions between users and systems.

[0007] Topic-guided conversational recommendation systems interact with users through natural language dialogues, emphasizing smooth response generation and accurate recommendations, and have attracted increasing attention. Unlike attribute-aware conversational recommendation systems, this task focuses on making recommendations using natural language text, which has great flexibility and can influence the direction of the conversation. ReDia was the first to propose a dataset in topic-guided conversational recommendation tasks, and used autoencoders for recommendations and hierarchical RNNs to generate responses on this dataset. KBRD further integrated the recommendation subsystem and the conversation subsystem through an end-to-end framework based on ReDial to bridge the information gap between the two subsystems. Subsequently, DCR used pointer networks based on sequence-sequence models to achieve the purpose of integrating GCN-based recommendations and global task control in the response generation task. MGCG is a multi-goal driven conversational generation framework that actively guides the conversation from chat to recommendation by utilizing a goal planning module and a goal-guided response module. Zhou et al. also proposed a topic-guided conversational recommendation method that incorporates the topic clues of the conversation to actively guide users to the final recommendation goal through a modular combination of recommenders and response generators. There is a big limitation in conversational recommendation systems that use an end-to-end framework as a user interface, because only items mentioned in the training corpus can be recommended. To solve this problem, external knowledge is often used to enhance conversation semantics or update user representation. KBRD first proposed to use the knowledge graph DBpedia to enhance the semantic representation of item in context. KGSF further combines the word-oriented knowledge graph ConceptNet and the entity-oriented knowledge graph DBpedia on the basis of KBRD, and bridges the semantic gap between the two knowledge graphs by maximizing mutual information to achieve the purpose of enhancing user representation. CRFR introduces a reinforcement learning model to explicitly perform multi-hop reasoning on two knowledge graphs and fuse multiple knowledge fragments, thereby improving KGSF. CR-Walker also creates a knowledge reasoning tree for recommendation and reply generation tasks by performing tree structure reasoning on the knowledge graph. Summary of the invention

[0008] In order to address the deficiencies of the prior art, the present invention provides a conversational recommendation method and system based on user preferences; the present invention mines user preferences in a topic-guided conversational recommendation system for the first time, and divides user preferences into user long-term preferences and user short-term preferences.

[0009] In a first aspect, the present invention provides a conversational recommendation method based on user preferences;

[0010] Conversational recommendation methods based on user preferences include:

[0011] Obtain the user ID, user conversation context and conversation topic line to be recommended for conversation;

[0012] Input the acquired data into the trained and tested conversational recommendation model, and output the conversational recommendation results;

[0013] The working principle of the conversational recommendation model is: first, embed the acquired data; then, track the user's long-term preferences and short-term preferences based on the embedding results; then, based on the user's long-term and short-term preference tracking results, output the recommendation results; finally, convert the recommendation results into natural language and reply to the user to be recommended.

[0014] In a second aspect, the present invention provides a conversational recommendation system based on user preferences;

[0015] Conversational recommendation system based on user preferences, including:

[0016] An acquisition module is configured to: acquire a user ID, a user conversation context, and a conversation topic line to be recommended for conversation;

[0017] A recommendation module, which is configured to: input the acquired data into the trained and tested conversational recommendation model, and output the conversational recommendation result;

[0018] The working principle of the conversational recommendation model is: first, embed the acquired data; then, track the user's long-term preferences and short-term preferences based on the embedding results; then, based on the user's long-term and short-term preference tracking results, output the recommendation results; finally, convert the recommendation results into natural language and reply to the user to be recommended.

[0019] In a third aspect, the present invention further provides an electronic device, comprising:

[0020] a memory for non-transitory storage of computer-readable instructions; and

[0021] a processor for executing the computer readable instructions,

[0022] When the computer-readable instructions are executed by the processor, the method described in the first aspect is executed.

[0023] In a fourth aspect, the present invention further provides a storage medium that non-temporarily stores computer-readable instructions, wherein when the non-temporary computer-readable instructions are executed by a computer, the instructions of the method described in the first aspect are executed.

[0024] In a fifth aspect, the present invention further provides a computer program product, comprising a computer program, wherein the computer program is used to implement the method described in the first aspect when running on one or more processors.

[0025] Compared with the prior art, the present invention has the following beneficial effects:

[0026] 1. This invention mines user preferences in a topic-guided conversational recommendation system for the first time, and divides user preferences into long-term user preferences and short-term user preferences;

[0027] 2. The present invention uses the random variational Bayesian inference method to solve the problem that the user's long-term preference and the user's short-term preference are unlabeled data, and accurately captures the user's preference;

[0028] 3. The present invention integrates user preferences with external knowledge, improving the recommendation and generation effects of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0030] Figure 1 is a flow chart of the method of embodiment 1;

[0031] Figure 2 This is a diagram of the overall network structure in the training phase of Example 1;

[0032] Figure 3 This is a diagram of the overall network structure during the testing phase of Example 1. DETAILED DESCRIPTION

[0033] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.

[0034] It should be noted that the terms used herein are only for describing specific embodiments, and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that the terms "include" and "have" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0035] In addition, in order to clearly describe the technical solutions of the embodiments of the present invention, in the embodiments of the present invention, the words "first", "second", etc. are used to distinguish the same items or similar items with substantially the same functions and effects. Those skilled in the art can understand that the words "first" and "second" do not limit the quantity and execution order, and the words "first", "second", etc. do not necessarily limit the difference.

[0036] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.

[0037] In this embodiment, all data is obtained in compliance with laws and regulations and based on the user's consent, and is used legally.

[0038] This invention mainly solves several challenging problems currently faced in topic-guided conversational recommendation systems:

[0039] 1. Since the length of a conversation is usually 8 to 12 rounds, in a conversation, users may only express their short-term interests and fail to fully express their long-term, inherent interests.

[0040] 2. Due to privacy and cost reasons, users’ long-term and short-term interests cannot be obtained through manual annotation, which makes it impossible to learn user preferences through supervised training.

[0041] 3. The topics involved in the conversation can help the system more accurately obtain user preferences and make recommendations. There is a complex semantic correlation between the topics and the items to be recommended, so CRS needs to accurately learn this correlation.

[0042] Terminology explanation:

[0043] Latent variable: latent variable, also known as hidden variable, latent variable, represents unobservable random variable in statistics.

[0044] Observed variable: Corresponding to latent variable, it refers to the variable that can be obtained through direct observation or measurement.

[0045] Embodiment 1

[0046] This embodiment provides a conversational recommendation method based on user preferences;

[0047] Conversational recommendation methods based on user preferences include:

[0048] S101: Obtaining the user ID, user conversation context and conversation topic line to be recommended;

[0049] S102: Input the acquired data into the conversational recommendation model after training and testing, and output the conversational recommendation result;

[0050] The working principle of the conversational recommendation model is: first, embed the acquired data; then, track the user's long-term preferences and short-term preferences based on the embedding results; then, based on the user's long-term and short-term preference tracking results, output the recommendation results; finally, convert the recommendation results into natural language and reply to the user to be recommended.

[0051] Furthermore, the user number to be recommended for conversation, for example, the user number is 1347, 2341 and other numbers.

[0052] Furthermore, the user dialogue context, for example: the first t-1 rounds of dialogue between the user and the system (assuming that the current user and the system have conducted a dialogue up to the tth round).

[0053] Furthermore, the topic line of the conversation, for example, is the topic mentioned in the first t-1 rounds of conversation (context). For example, if "nature" is mentioned in the first sentence and "ocean" is mentioned in the second sentence, then "nature" - "ocean" is the topic line of the first two rounds of conversation.

[0054] Furthermore, if Figure 2 As shown, the conversational recommendation model, during the training phase, includes: a first encoder, a second encoder, and a third encoder in parallel;

[0055] The output end of the first encoder is connected to the input end of the first decoder and the input end of the second decoder respectively; the output end of the second encoder is connected to the input end of the third decoder and the input end of the fourth decoder respectively; the output end of the third encoder is connected to the input end of the third decoder and the input end of the fourth decoder respectively;

[0056] The output of the second decoder is connected to the input of the fourth encoder; the input of the fourth decoder is connected to the input of the fifth encoder; the output of the fourth encoder, the output of the fifth encoder, the output of the second encoder, the output of the third encoder and the output of the R-GCN network are all connected to the input of the fifth decoder;

[0057] The output end of the fifth decoder is connected to the input end of the sixth encoder; the output end of the sixth encoder is connected to the input end of the sixth decoder; the input end of the sixth decoder is also respectively connected to the output end of the first encoder, the output end of the second encoder and the output end of the third encoder; the output end of the sixth encoder is connected to the input end of the fourth decoder.

[0058] Furthermore, the first, second, third, fourth, fifth and sixth encoders are all implemented using Transformer encoders; and the first, second, third, fourth, fifth and sixth decoders are all implemented using Transformer decoders.

[0059] Furthermore, the first encoder is used to input a user number ID, and embed the user number ID to obtain a representation of the user number ID.

[0060] Furthermore, the second encoder is used to input the dialogue context, and embed the dialogue context to obtain a representation of the dialogue context.

[0061] Furthermore, the third encoder is used to input a topic line of the dialogue, and embed the topic line of the dialogue to obtain a representation of the topic line of the dialogue.

[0062] It should be understood that the conversation topic line refers to connecting the topic names mentioned during the interaction between the user and the system.

[0063] It should be understood that in this invention, multiple types of input are used, including user ID, conversation context C t and the topic line of the conversation tp t , uniformly encode these input data and obtain their representation. The classic Transformer encoder is used to encode each input. The Transformer encoder contains N identical sub-layers, each of which includes a multi-head self-attention mechanism and a feedforward neural network. After encoding, the embodiment of the present application respectively encodes u, C t and tp t Encoded as the corresponding representation h u , and When encoding these three types of input data, the embodiment of the present application uses three Transformer encoders, and the parameters of these three Transformer encoders are not shared.

[0064] Furthermore, the first decoder serves as a prior long-term preference tracker; it is used to input the representation of the user number ID and output the user's prior long-term preference; the first decoder uses a variational Bayesian algorithm to calculate the probability distribution of the user's long-term preference.

[0065] In theory, variational Bayes is used to solve the problem of unlabeled user preferences. The prior distribution and posterior distribution of user preferences are calculated according to Bayes' theorem. However, the accurate probability distribution form cannot be obtained. Therefore, multiple decoders are used to obtain approximate distributions to fit the accurate probability distribution.

[0066] Using the variational Bayes algorithm, the loss function between the accurate distribution and the approximate distribution is theoretically derived; that is, the first loss function KL loss is calculated between the outputs of the first decoder and the second decoder; the second loss function KL loss is calculated between the outputs of the third decoder and the fourth decoder.

[0067] Furthermore, the second decoder serves as a posterior long-term preference tracker; it is used to input a representation of the user ID, a representation of the conversation context and a representation of the conversation topic line, and output the user's posterior long-term preference; the second decoder uses a variational Bayes algorithm to calculate the probability distribution of the user's long-term preference.

[0068] Furthermore, the first decoder and the second decoder use KL (Kullback-Leibler divergence) distance to shorten the distance between the probability distribution of the prior long-term preference and the posterior long-term preference.

[0069] Furthermore, the third decoder serves as a prior short-term preference tracker; it is used to input the representation of the conversation context, the representation of the conversation topic line and the representation of the user's short-term preferences in the previous round, and output the user's prior short-term preferences; the third decoder uses a variational Bayes algorithm to calculate the probability distribution of the user's short-term preferences.

[0070] Furthermore, the fourth decoder serves as a posterior short-term preference tracker; it takes the representation of the input action as input and outputs the user's posterior short-term preference; the fourth decoder uses a variational Bayesian algorithm to calculate the probability distribution of the user's short-term preference.

[0071] Actions include two categories: the first category is when the system chats with the user, the action is the topic, and the system chats with the user around this topic to further explore the user's preferences; the second category is when the system wants to recommend items to the user, the action is the item that the system wants to recommend, the system will recommend this item to the user and explain the reason for the recommendation to the user.

[0072] Furthermore, the KL distance is used between the third decoder and the fourth decoder to shorten the distance between the probability distribution of the prior short-term preference and the probability distribution of the posterior short-term preference.

[0073] It should be understood that user preferences are unlabeled data, so the embodiment of the present application defines user preferences as latent variables and uses SGVB (stochastic gradient variational Bayesian) to effectively estimate the posterior user preferences. User preferences include long-term user preferences and short-term user preferences.

[0074] Long-term user preference is the preference shown by the user in the historical conversation. It is an inherent and stable preference. The embodiment of the present application uses two Transformer decoders to generate a priori and a posteriori user long-term preference respectively. The a priori long-term preference is only related to the user u. The embodiment of the present application converts the user representation h u As input, and decoded to obtain the probability distribution of prior long-term preferences In order to estimate the posterior user long-term preference, the embodiment of the present application represents the user h u Connected with the representation of historical dialogue as input, the output is the probability distribution of posterior long-term preference The embodiment of the present application uses KLDivergence to shorten the distance between the probability distribution of the prior long-term preference and the probability distribution of the posterior long-term preference.

[0075] Short-term user preferences are preferences expressed by users in the current conversation. They are dynamic and real-time preferences. Unlike long-term preferences, short-term preferences are continuously updated as the conversation progresses. This embodiment of the application also uses two Transformer decoders to generate prior and a posteriori user short-term preferences respectively. For prior short-term preferences, this embodiment of the application connects the context representation Theme line representation and the short-term preference representation of users in the previous round As input, decoding obtains the probability distribution of prior short-term preferences In order to estimate the posterior user short-term preference, the embodiment of the present application additionally adds action A t Representation As input, the output is the probability distribution of the posterior short-term preference KL Divergence is also used to narrow the distance between the probability distribution of prior short-term preferences and posterior short-term preferences.

[0076] Furthermore, the fourth encoder is used to take the sampled result of the user's posterior long-term preference as an input value and output the user's posterior long-term preference representation.

[0077] Furthermore, the fifth encoder is used to take the sampled result of the posterior short-term preference of the posterior language as an input value and output the user's posterior short-term preference representation.

[0078] Furthermore, the R-GCN network (Relational Graph Convolutional Networks) is used to take a subgraph extracted from a knowledge graph as an input value; the knowledge graph includes entity-relationship-entity triples; according to the topic line, the nodes that are two hops adjacent to the topic in the topic line are found on the knowledge graph as subgraphs, and each node in the subgraph is encoded and represented using the R-GCN network, and all the encoding representation results in the subgraph are summarized to obtain the subgraph representation.

[0079] Furthermore, the fifth decoder is used to take the concatenation result of the user's posterior long-term preference representation, the user's posterior short-term preference representation, the dialogue context representation, the dialogue topic line representation and the subgraph representation as input values, and output the recommendation result.

[0080] The loss function used by the fifth decoder is the third loss function NLL.

[0081] It should be understood that, according to the obtained user preferences, the action A generated by the policy module t Contains some topics or some items. t contains some topics, the system chats with the user to get to know the user better; if A t If some items are included in the list, the system recommends these items to the user and explains the reasons for recommending these items.

[0082] In the policy network, the embodiment of the present application introduces an external knowledge graph to improve performance. The knowledge graph is composed of triplets such as (entity, relationship, entity). According to the topic line, the embodiment of the present application searches for nodes that are two hops adjacent to the topic in the topic line on the knowledge graph to form a subgraph, and uses RGCN to encode these nodes to obtain node representations. Finally, the embodiment of the present application connects the representations of these nodes as the representation of the subgraph, that is, Where M is the number of nodes, is the representation of the i-th node, Represents a subgraph.

[0083] In the training phase, the embodiment of the present application samples the a posteriori long-term and short-term preferences to obtain the user's long-term and short-term preferences. q and Then use Transformer encoder to encode them to get long-term and short-term preference representation and In decoding action A t In this embodiment, the Transformer decoder is used, and the context is represented Theme line representation Subgraph Representation Long-term preference representation and short-term preference representation The five connections are input and the output is A. t The probability distribution of

[0084] Furthermore, the sixth encoder is used to input a recommendation result; and output a representation of the recommendation result.

[0085] Furthermore, the sixth decoder is used to input the representation of the recommendation results, the representation of the conversation context, the representation of the conversation topic line and the user encoding representation, and output the final natural language.

[0086] It should be understood that when the policy network generates action A t After that, the reply generation module generates t Generate the reply s for round t t ,This module is also based on the encoder-decoder structure. First, the Transformer encoder is used to encode the action A t get And connect the action representation Contextual Representation Theme line representation And the user indicates h u The four representations are used as the input of the Transformer decoder, and the output is s t The probability distribution of

[0087] Furthermore, the training and testing of the conversational recommendation model specifically includes:

[0088] Constructing a training set; the training set includes user IDs, conversation contexts, and conversation topic lines of known recommendation results;

[0089] Input the training set into the conversational recommendation model, train the model, and stop training when the total loss function value of the model no longer decreases or the number of iterations reaches a set number; obtain the trained conversational recommendation model;

[0090] The conversational recommendation model is fine-tuned, and the fine-tuned model is tested to obtain a tested conversational recommendation model.

[0091] Furthermore, the total loss function is the sum of the first loss function, the second loss function and the third loss function.

[0092] The first loss function is the KL distance between the probability distribution of the priori user long-term preference of the first decoder and the probability distribution of the posterior user long-term preference of the second decoder; the probability distribution of the priori user long-term preference of the first decoder and the probability distribution of the posterior user long-term preference of the second decoder are both calculated by the variational Bayes algorithm;

[0093] The second loss function is the KL distance between the probability distribution of the prior user short-term preference of the third decoder and the probability distribution of the posterior user short-term preference of the fourth decoder; the probability distribution of the prior user short-term preference of the third decoder and the probability distribution of the posterior user short-term preference of the fourth decoder are both calculated by the variational Bayes algorithm;

[0094] The third loss function is the difference between the predicted action and the actual action of the fifth decoder.

[0095] Furthermore, the conversational recommendation model is fine-tuned, including:

[0096] The connection line between the second decoder and the fourth encoder is deleted, and the output end of the first decoder is connected to the input end of the fourth decoder;

[0097] The connection line between the fourth decoder and the fifth encoder is deleted, and the output end of the fourth decoder is connected to the input end of the fifth encoder.

[0098] In order to solve the above three problems in the conversational recommendation task, the present invention proposes a conversational recommendation system based on user preferences. Figure 1 As shown, the invention includes four modules in total, namely input representation, preference tracking, policy network and reply generation. Given the user ID, conversation context and conversation main line, the embodiment of the present application first encodes this information to obtain the corresponding representation. Next, in the stage of tracking user preferences, variational Bayesian inference is used to construct the probability distribution of user long-term preferences and short-term preferences, and the neural network is used to continuously approximate the true posterior distribution. According to the learned user preference representation, the policy network makes a decision to decide the recommended items to the user or the topic of chatting with the user. Finally, according to the decision result of the policy network, the reply generation module generates a natural language reply to the user. In the training stage, the invention uses the posterior preference probability distribution. In the testing stage, since the conditions in the posterior probability are unknown, the invention uses the prior preference probability distribution. The testing stage takes the same steps as the training stage. The only difference is that the embodiment of the present application no longer samples from the posterior long-term and short-term preferences, but samples from the prior long-term and short-term preferences.

[0099] The present invention is described in detail below, which specifically includes the following steps:

[0100] (1) Before training, the present invention first encodes various types of input information, including user ID, conversation context, and conversation topic line;

[0101] (2) The invention tracks the user's long-term preferences and the user's short-term preferences;

[0102] (3) Based on the user's long-term and short-term preferences and the corresponding external knowledge graph, the present invention predicts items or topics that the user may be interested in at this step;

[0103] (4) Based on the related items and topics predicted in the previous step, corresponding replies are generated in this step; steps (1)-(4) are continuously iterated during the training phase until the model converges.

[0104] During the testing phase, the present invention predicts new related items and corresponding responses with reference to steps (3)-(4).

[0105] Embodiment 2

[0106] This embodiment provides a conversational recommendation system based on user preferences;

[0107] Conversational recommendation methods based on user preferences include:

[0108] An acquisition module is configured to: acquire a user ID, a user conversation context, and a conversation topic line to be recommended for conversation;

[0109] A recommendation module, which is configured to: input the acquired data into the trained and tested conversational recommendation model, and output the conversational recommendation result;

[0110] The working principle of the conversational recommendation model is: first, embed the acquired data; then, track the user's long-term preferences and short-term preferences based on the embedding results; then, based on the user's long-term and short-term preference tracking results, output the recommendation results; finally, convert the recommendation results into natural language and reply to the user to be recommended.

[0111] It should be noted that the acquisition module and the recommendation module correspond to steps S101 to S102 in Embodiment 1, and the examples and application scenarios implemented by the modules and the corresponding steps are the same, but are not limited to the contents disclosed in Embodiment 1. It should be noted that the modules as part of the system can be executed in a computer system such as a set of computer executable instructions.

[0112] The description of each embodiment in the above embodiments has different emphases. For parts not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0113] The proposed system can be implemented in other ways. For example, the system embodiment described above is only illustrative, and the division of the modules is only a logical function division. In actual implementation, there may be other division methods, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed.

[0114] Embodiment 3

[0115] This embodiment also provides an electronic device, including: one or more processors, one or more memories, and one or more computer programs; wherein the processor is connected to the memory, and the one or more computer programs are stored in the memory. When the electronic device is running, the processor executes the one or more computer programs stored in the memory so that the electronic device executes the method described in the above embodiment one.

[0116] It should be understood that in this embodiment, the processor may be a central processing unit CPU, and the processor may also be other general-purpose processors, digital signal processors DSP, application-specific integrated circuits ASIC, off-the-shelf programmable gate arrays FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0117] The memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type.

[0118] In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in a processor or an instruction in the form of software.

[0119] The method in the first embodiment can be directly embodied as a hardware processor, or a combination of hardware and software modules in the processor. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware. To avoid repetition, it will not be described in detail here.

[0120] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with this embodiment can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0121] Embodiment 4

[0122] This embodiment further provides a computer-readable storage medium for storing computer instructions. When the computer instructions are executed by a processor, the method described in the first embodiment is completed.

[0123] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A conversational recommendation method based on user preferences, characterized by: include: Obtain the user ID, user conversation context and conversation topic line to be recommended for conversation; Input the acquired data into the trained and tested conversational recommendation model, and output the conversational recommendation results; The working principle of the conversational recommendation model is as follows: first, embed the acquired data; then, track the user's long-term preference and short-term preference based on the embedding results; then, output the recommendation results based on the user's long-term and short-term preference tracking results; finally, convert the recommendation results into natural language and reply to the user to be recommended; The conversational recommendation model, during the training phase, includes: a first encoder, a second encoder, and a third encoder in parallel; The output end of the first encoder is connected to the input end of the first decoder and the input end of the second decoder respectively; the output end of the second encoder is connected to the input end of the third decoder and the input end of the fourth decoder respectively; the output end of the third encoder is connected to the input end of the third decoder and the input end of the fourth decoder respectively; The output of the second decoder is connected to the input of the fourth encoder; the input of the fourth decoder is connected to the input of the fifth encoder; the output of the fourth encoder, the output of the fifth encoder, the output of the second encoder, the output of the third encoder and the output of the R-GCN network are all connected to the input of the fifth decoder; The output end of the fifth decoder is connected to the input end of the sixth encoder; the output end of the sixth encoder is connected to the input end of the sixth decoder; the input end of the sixth decoder is also respectively connected to the output end of the first encoder, the output end of the second encoder and the output end of the third encoder; the output end of the sixth encoder is connected to the input end of the fourth decoder.

2. The conversational recommendation method based on user preference as claimed in claim 1, characterized in that: The first encoder is used to input a user number ID, and embed the user number ID to obtain a representation of the user number ID; The second encoder is used to input the dialogue context and embed the dialogue context to obtain a representation of the dialogue context; The third encoder is used to input the topic line of the dialogue and embed the topic line of the dialogue to obtain a representation of the topic line of the dialogue.

3. The conversational recommendation method based on user preference as claimed in claim 1, characterized in that: The first decoder is used as a priori long-term preference tracker; it is used to input the representation of the user ID and output the user's priori long-term preference; the first decoder uses a variational Bayesian algorithm to calculate the probability distribution of the user's long-term preference; The second decoder is used as a posterior long-term preference tracker; it is used to input the representation of the user ID, the representation of the conversation context and the representation of the conversation topic line, and output the user's posterior long-term preference; the second decoder uses a variational Bayesian algorithm to calculate the probability distribution of the user's long-term preference; The third decoder acts as a priori short-term preference tracker; The third decoder is used to input the representation of the conversation context, the representation of the conversation topic line and the representation of the user's short-term preference in the previous round, and output the user's prior short-term preference; the third decoder uses a variational Bayesian algorithm to calculate the probability distribution of the user's short-term preference; The fourth decoder acts as a posterior short-term preference tracker; The representation of the input action is used as input, and the user's posterior short-term preference is output; the fourth decoder uses a variational Bayesian algorithm to calculate the probability distribution of the user's short-term preference.

4. The conversational recommendation method based on user preference as claimed in claim 1, characterized in that: The fourth encoder is used to take the sampled result of the user's posterior long-term preference as an input value and output the user's posterior long-term preference representation; The fifth encoder is used to take the sampled result of the posterior short-term preference of the posterior language as an input value and output the user's posterior short-term preference representation; The R-GCN network is used to take a subgraph extracted from a knowledge graph as an input value; the knowledge graph includes entity-relationship-entity triples; According to the topic line, find the nodes that are two hops adjacent to the topic in the topic line on the knowledge graph as the subgraph, use the R-GCN network to encode each node in the subgraph, and summarize all the encoding results in the subgraph to get the subgraph representation; The fifth decoder is used to take the concatenation result of the user's posterior long-term preference representation, the user's posterior short-term preference representation, the dialogue context representation, the dialogue topic line representation and the subgraph representation as input values, and output the recommendation result.

5. The conversational recommendation method based on user preference as claimed in claim 1, characterized in that: The conversational recommendation model after training and testing; The specific process includes: Constructing a training set; the training set includes user IDs, conversation contexts, and conversation topic lines of known recommendation results; Input the training set into the conversational recommendation model, train the model, and stop training when the total loss function value of the model no longer decreases or the number of iterations reaches a set number; obtain the trained conversational recommendation model; Fine-tune the conversational recommendation model, test the fine-tuned model, and obtain a tested conversational recommendation model; Fine-tune the conversational recommendation model; specifically: The connection line between the second decoder and the fourth encoder is deleted, and the output end of the first decoder is connected to the input end of the fourth decoder; The connection line between the fourth decoder and the fifth encoder is deleted, and the output end of the fourth decoder is connected to the input end of the fifth encoder.

6. The conversational recommendation method based on user preference as claimed in claim 5, characterized in that: The total loss function is the sum of the first loss function, the second loss function and the third loss function; The first loss function is the KL distance between the probability distribution of the priori user long-term preference of the first decoder and the probability distribution of the posterior user long-term preference of the second decoder; the probability distribution of the priori user long-term preference of the first decoder and the probability distribution of the posterior user long-term preference of the second decoder are both calculated by the variational Bayes algorithm; The second loss function is the KL distance between the probability distribution of the prior user short-term preference of the third decoder and the probability distribution of the posterior user short-term preference of the fourth decoder; the probability distribution of the prior user short-term preference of the third decoder and the probability distribution of the posterior user short-term preference of the fourth decoder are both calculated by the variational Bayes algorithm; The third loss function is the difference between the predicted action and the actual action of the fifth decoder.

7. A conversational recommendation system based on user preferences, characterized by: include: An acquisition module is configured to: acquire a user ID, a user conversation context, and a conversation topic line to be recommended for conversation; A recommendation module, which is configured to: input the acquired data into the trained and tested conversational recommendation model, and output the conversational recommendation result; The working principle of the conversational recommendation model is as follows: first, embed the acquired data; then, track the user's long-term preference and short-term preference based on the embedding results; then, output the recommendation results based on the user's long-term and short-term preference tracking results; finally, convert the recommendation results into natural language and reply to the user to be recommended; The conversational recommendation model, during the training phase, includes: a first encoder, a second encoder, and a third encoder in parallel; The output end of the first encoder is connected to the input end of the first decoder and the input end of the second decoder respectively; the output end of the second encoder is connected to the input end of the third decoder and the input end of the fourth decoder respectively; the output end of the third encoder is connected to the input end of the third decoder and the input end of the fourth decoder respectively; The output of the second decoder is connected to the input of the fourth encoder; the input of the fourth decoder is connected to the input of the fifth encoder; the output of the fourth encoder, the output of the fifth encoder, the output of the second encoder, the output of the third encoder and the output of the R-GCN network are all connected to the input of the fifth decoder; The output end of the fifth decoder is connected to the input end of the sixth encoder; the output end of the sixth encoder is connected to the input end of the sixth decoder; the input end of the sixth decoder is also respectively connected to the output end of the first encoder, the output end of the second encoder and the output end of the third encoder; the output end of the sixth encoder is connected to the input end of the fourth decoder.

8. An electronic device, comprising: a memory for non-transitory storage of computer readable instructions; as well as a processor for executing the computer readable instructions, Wherein, when the computer-readable instructions are executed by the processor, the method described in any one of claims 1 to 6 is executed.

9. A storage medium, characterized in that it non-temporarily stores computer-readable instructions, wherein: When the non-transitory computer-readable instructions are executed by a computer, the instructions of the method according to any one of claims 1 to 6 are executed.

Citation Information

Patent Citations

  • Dialogue-based content recommendation method and device, computer equipment and storage medium

    CN112115246A

  • Broadcasting and TV program recommendation method based on knowledge graph and user microcosmic behaviors

    CN112732936A

  • Interpretable recommendation method based on graph neural network reasoning

    CN113158045A

  • Personalized session recommendation method and system

    CN113569139A

  • Knowledge enhancement dialogue recommendation method based on multi-level attention mechanism

    CN114065047A