Conversation recommendation and model training method and device, electronic equipment and storage medium

By constructing a graph of recommended objects in a dialogue recommendation system, querying the relationships between recommended elements, and using graph convolutional networks and self-attention layers to process contextual semantics, the problem of inaccurate estimation of user preferences and intent in dialogue recommendation systems is solved, achieving more efficient recommendation results.

CN115408508BActive Publication Date: 2026-01-27ALIBABA (CHINA) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211201931.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-29
Publication Date
2026-01-27
Estimated Expiration
2042-09-29

AI Technical Summary

Technical Problem

Existing dialogue recommendation systems are not accurate enough in estimating user preferences or intentions during topic guidance or recommendation processes, resulting in room for improvement in recommendation efficiency.

Method used

By querying the relationships between multiple recommendation elements in a pre-built recommendation object graph, a preference representation of the current topic of the current dialogue statement is constructed, and the next topic is predicted based on this preference representation. Recommendation objects that match the next topic are recommended, and contextual semantic processing is performed using graph convolutional networks and self-attention layers to generate response statements.

Benefits of technology

This improves the accuracy and efficiency of recommendations, enabling users' preferences and intentions in the current dialogue to be reflected more accurately, and thus more precisely predicting the next topic and recommended objects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115408508B_ABST
    Figure CN115408508B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a dialogue recommendation and model training method and device, electronic equipment and storage medium. The dialogue recommendation method comprises: determining a plurality of recommendation elements in a current dialogue sentence; in a pre-constructed recommendation object graph, querying an association relationship between the plurality of recommendation elements, wherein an entity of the recommendation object graph indicates a recommendation element, and an entity relationship of the recommendation object graph indicates an association relationship between different recommendation elements; at least based on a context semantic association between the plurality of recommendation elements and the association relationship therebetween, constructing a preference representation of a current topic of the current dialogue sentence; based on the preference representation of the current topic, predicting a next topic of the current topic; and recommending a recommendation object matching the next topic. The scheme of the embodiments of the present application further improves the recommendation efficiency while ensuring the accuracy of the recommendation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method, apparatus, electronic device and storage medium for dialogue recommendation and model training. Background Technology

[0002] Conversational Recommender Systems (CRS) enable the recommendation of items, such as products, during conversations with users. Traditional conversational recommendation tasks typically begin by determining user needs using rules or models, then analyze user preferences based on conversational information, and finally recommend items, such as products, to the user.

[0003] With the development of dialogue recommendation systems, dialogue strategy modules have been introduced, which can determine whether to guide the topic or make recommendations directly based on the current dialogue state with the user, further improving the smoothness of the user experience and the accuracy of recommendations. However, current dialogue recommendation systems are not accurate enough in estimating user preferences or intentions during the topic guidance or recommendation process, which means there is still room for improvement in recommendation efficiency. Summary of the Invention

[0004] In view of this, embodiments of the present invention provide a dialogue recommendation and model training method, apparatus, electronic device, and storage medium to at least partially solve the above-mentioned problems.

[0005] According to a first aspect of the present invention, a dialogue recommendation method is provided, comprising: determining a plurality of recommendation elements in a current dialogue statement; querying the relationships between the plurality of recommendation elements in a pre-constructed recommendation object graph, wherein entities in the recommendation object graph indicate recommendation elements, and entity relationships in the recommendation object graph indicate relationships between different recommendation elements; constructing a preference representation of the current topic of the current dialogue statement based at least on the contextual semantic relationships between the plurality of recommendation elements and their relationships; predicting the next topic of the current topic based on the preference representation of the current topic; and recommending recommendation objects that match the next topic.

[0006] In another implementation of the present invention, the recommendation of recommended objects that match the next topic includes: when the next topic matches an object tag, recommending the recommended objects to which the object tag belongs.

[0007] In another implementation of the present invention, recommending the recommended object to which the object tag belongs includes: determining a plurality of candidate recommended objects having the object tag; sorting the plurality of candidate recommended objects based on the similarity between the plurality of candidate recommended objects and the preference representation of the current topic; and selecting a recommended object from the plurality of candidate recommended objects for recommendation based on the sorting of the plurality of candidate recommended objects, wherein the sorting order of the recommended object in the plurality of candidate recommended objects is less than a preset order.

[0008] In another implementation of the present invention, the method further includes: when the next topic does not match the object tag, generating a response statement for the current dialogue statement based on the preference representation of the current topic and the next topic.

[0009] In another implementation of the present invention, the step of constructing a preference representation of the current topic of the current dialogue statement based at least on the contextual semantic association between the plurality of recommendation elements and their association relationships includes: generating a plurality of initial vector representations of the plurality of recommendation elements respectively; performing contextual semantic processing on the plurality of initial vector representations based on the association relationships of the plurality of recommendation elements to obtain a first contextual semantic representation of the plurality of recommendation elements; and constructing a preference representation of the current topic of the current dialogue statement based at least on the first contextual semantic representation.

[0010] In another implementation of the present invention, the step of performing contextual semantic processing on the multiple initial vector representations based on the association relationships of the multiple recommendation elements to obtain the first contextual semantic representation of the multiple recommendation elements includes: constructing an initial matrix representation of the multiple initial vector representations; constructing a relationship matrix and a degree matrix of the multiple initial vectors; encoding the initial matrix representation, the relationship matrix, and the degree matrix and inputting them into a graph convolutional network to obtain the first contextual semantic representation of the multiple recommendation elements, wherein the graph convolutional network is pre-trained using the initial matrix representation, the relationship matrix, the degree matrix, and their classification labels from graph training data.

[0011] In another implementation of the present invention, the method further includes: generating at least one of the following second contextual semantic representations: historical dialogue statements and their historical topics, and dialogue user preferences. The step of constructing a preference representation of the current topic of the current dialogue statement based at least on the first contextual semantic representation includes: inputting the first contextual semantic representation and the various second contextual semantic representations into a pre-trained self-attention layer to obtain a preference representation of the current topic of the current dialogue statement, wherein the self-attention layer is used to perform contextual representation based on the dialogue topic on the first contextual semantic representation and the various second contextual semantic representations.

[0012] In another implementation of the present invention, the output of the self-attention layer is connected to the input of the topic guidance layer, and the self-attention layer and the topic guidance layer constitute a topic guidance model. The topic guidance model is trained through topic guidance relationships of different dialogue statements. Predicting the next topic based on the preference representation of the current topic includes: inputting the preference representation of the current topic into the topic guidance layer to obtain the next topic of the current topic.

[0013] In another implementation of the present invention, the method further includes: generating a response statement for the current dialogue statement based on the preference representation of the current topic and the recommendation object.

[0014] According to a second aspect of the present invention, a model training method is provided, comprising: acquiring dialogue statement samples and their guiding topics; determining multiple recommendation elements in the dialogue statement samples; querying the relationships between the multiple recommendation elements in a pre-constructed recommendation object graph, wherein entities in the recommendation object graph indicate recommendation elements, and entity relationships in the recommendation object graph indicate relationships between different recommendation elements; and training a topic guidance model based at least on the contextual semantic relationships between the multiple recommendation elements and their relationships as input, and using the guiding topic as a supervision condition.

[0015] According to a third aspect of the present invention, a dialogue recommendation apparatus is provided, comprising: a determining module for determining a plurality of recommendation elements in a current dialogue statement; a querying module for querying the relationships between the plurality of recommendation elements in a pre-constructed recommendation object graph, wherein entities in the recommendation object graph indicate recommendation elements, and entity relationships in the recommendation object graph indicate relationships between different recommendation elements; a constructing module for constructing a preference representation of the current topic of the current dialogue statement based at least on the contextual semantic relationships between the plurality of recommendation elements and their relationships; a prediction module for predicting the next topic of the current topic based on the preference representation of the current topic; and a recommending module for recommending recommendation objects that match the next topic.

[0016] According to a fourth aspect of the present invention, a model training apparatus is provided, comprising: an acquisition module for acquiring dialogue statement samples and guiding topics of the dialogue statement samples; a determination module for determining multiple recommendation elements in the dialogue statement samples; a query module for querying the relationships between the multiple recommendation elements in a pre-constructed recommendation object graph, wherein entities in the recommendation object graph indicate recommendation elements, and entity relationships in the recommendation object graph indicate relationships between different recommendation elements; and a training module for training a topic guidance model, at least based on the contextual semantic relationships between the multiple recommendation elements and their relationships as input, and using the guiding topic as a supervision condition.

[0017] According to a fifth aspect of the present invention, an electronic device is provided, comprising: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other via the communication bus; the memory is used to store at least one executable instruction, wherein the executable instruction causes the processor to perform an operation corresponding to the method described in the first or second aspect.

[0018] According to a sixth aspect of the present invention, a computer storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the method as described in the first or second aspect.

[0019] In the embodiment of the present invention, the relationships between multiple recommendation elements of the current dialogue statement are queried in the pre-constructed recommendation object graph, which recalls more information that is beneficial to the recommendation. This makes the preference representation of the current topic of the current dialogue statement more accurately reflect the user's preferences and intentions. Furthermore, based on the preference representation of the current topic, the next topic can be predicted more accurately, which improves the recommendation efficiency while ensuring the accuracy of the recommendation. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings.

[0021] Figure 1 This is a schematic block diagram of a dialogue recommendation system based on an example.

[0022] Figure 2 This is a flowchart illustrating the steps of a dialogue recommendation method according to an embodiment of the present invention.

[0023] Figure 3This is a flowchart of the steps of a model training method according to an embodiment of the present invention.

[0024] Figure 4 for Figure 2 and Figure 3 A schematic block diagram of a dialogue recommendation system to which the embodiments are applicable.

[0025] Figure 5 This is a structural block diagram of a dialogue recommendation device according to another embodiment of the present invention.

[0026] Figure 6 This is a structural block diagram of a model training device according to another embodiment of the present invention.

[0027] Figure 7 This is a schematic diagram of the structure of an electronic device according to another embodiment of the present invention. Detailed Implementation

[0028] To enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be clearly and thoroughly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art should fall within the protection scope of the present invention.

[0029] The specific implementation of the embodiments of the present invention will be further described below with reference to the accompanying drawings.

[0030] Figure 1 This is a schematic block diagram of a dialogue recommendation system based on an example. The dialogue recommendation system includes a user interface 110, a dialogue strategy module 120, a recommendation module 130, a topic guidance module 140, and a dialogue generation module 150.

[0031] Specifically, the user interface 110 is used to acquire the natural language statement input by the user, i.e., the current dialogue statement, and also to provide the response statement for the dialogue recommendation system. The dialogue strategy module 120 is used to decide how to respond based on the current dialogue statement, such as whether to continue to the next topic or directly make a recommendation. The recommendation module 130 is used to provide a corresponding recommendation list or a single recommendation result based on user preferences or intentions. The topic guidance module 140 is used to continue to the next topic. The dialogue generation module 150 is used to generate a response statement based on the recommendation list, a single recommendation result, or the next topic. Current dialogue recommendation systems do not accurately estimate user preferences or intentions during the topic guidance or recommendation process, resulting in room for improvement in recommendation efficiency.

[0032] Figure 2A dialogue recommendation method according to an embodiment of the present invention is illustrated. The scheme of this embodiment can be applied to any suitable electronic device with data processing capabilities, including but not limited to: servers, mobile terminals (such as mobile phones, PADs, etc.), and PCs. For example, in the model training phase of a topic-guided model, a computing device (e.g., a data center) configured with a CPU (processor unit) + GPU (acceleration unit) architecture can be used to train the encoder-decoder model based on training samples. The computing device, such as a data center, can be deployed in cloud servers such as dedicated clouds, private clouds, or hybrid clouds. Correspondingly, in the inference phase of the dialogue recommendation method, a computing device configured with a CPU (processor unit) + GPU (acceleration unit) architecture can also be used for inference operations. The dialogue recommendation method of this embodiment includes:

[0033] S210: Identify multiple recommendation elements in the current dialogue statement.

[0034] It should be understood that multiple recommendation elements can be elements associated with the candidate recommendation objects. When the recommendation object is a product, recommendation elements include, but are not limited to, price, sales volume, brand, store, popularity, etc. When the recommendation object is a knowledge point, recommendation elements include, but are not limited to, experts related to the knowledge point, fields, expert-related information such as nationality, gender, age, books, citation resources, etc.

[0035] It should also be understood that multiple recommendation elements can be recommendation elements that match the keywords of the current dialogue statement, or recommendation elements that match the topic of the current dialogue statement. When identifying multiple recommendation elements appearing in the current dialogue statement, if the current dialogue statement is "I want to buy a cheap electronic product," then keywords such as "electronic product" and "cheap" are recommendation elements. In addition, topic-matching keywords such as "mobile phone," "wristband," "VR glasses," and "cost-effectiveness" are also recommendation elements.

[0036] S220: In the pre-built recommendation object graph, query the relationship between multiple recommendation elements. The entity in the recommendation object graph indicates the recommendation element, and the entity relationship in the recommendation object graph indicates the relationship between different recommendation elements.

[0037] It should be understood that the recommendation object graph can be stored in different ways, and it includes entities and relationships. Different entities may or may not have entity relationships. For example, in the example above, "mobile phone" can have some relationship with "value-for-money product," for example, a certain mobile phone brand is known for its value-for-money products. On the other hand, "mobile phone" and "VR glasses" may not have an association. Yet, "wristband" and "VR glasses" can have some relationship, for example, a wearable device supplier manufactures or sells "wristbands" and "VR glasses." In summary, "a certain mobile phone brand is known for its value-for-money product" and "a certain wearable device supplier manufactures or sells wristbands and VR glasses" are information that does not exist in the current dialogue statement but is closely related to the intent or preference of the current dialogue statement. In other words, the recommendation object graph recalls more and more implicit intent or preference information.

[0038] S230: Construct a preference representation of the current topic of the current dialogue statement based on at least the contextual semantic association between multiple recommendation elements and their relationships.

[0039] It should be understood that the contextual semantic associations between multiple recommendation elements and their relationships can be represented by a pre-trained self-attention matrix, thereby obtaining a preference representation of the current topic of the current dialogue statement. This serves as a reliable and comprehensive intermediate representation, which is beneficial for learning model parameters with stronger generalization ability from supervised conditions.

[0040] S240: Based on the preference representation of the current topic, predict the next topic.

[0041] It should be understood that the next topic can be a sub-topic of the current topic, or a topic at the same level as the current topic, but belonging to a different domain or sub-domain. For example, if the current topic is "electronic products," and its sub-topics are "mobile phones," "laptops," or "smart bracelets," then in the dialogue recommendation process, when "electronic products" is too broad and difficult to accurately determine the recommended object, having a next topic like "mobile phones" helps to more accurately determine the recommended object. Furthermore, when the current topic and the next topic are at the same level, for example, if the current topic is "mobile phones," and due to limited alternative recommended objects, "mobile phones" is not the primary scenario (e.g., the merchant using the dialogue recommendation system is not a mobile phone seller or manufacturer), and the next topic is "smart speakers" or "VR glasses," then the current topic and the next topic are at the same level, both belonging to "electronic products," and the next topic belongs to a different product domain. If the merchant using the dialogue recommendation system can sell "smart speakers" or "VR glasses," then "smart speakers" or "VR glasses" can be recommended. Alternatively, if the merchant using the dialogue recommendation system does not sell "smart speakers" or "VR glasses," then the dialogue strategy module (which can call...) Figure 5 The recommendation and prediction modules can predict the next topic from the next topic until the next topic matches the products sold by merchants using the dialogue recommendation system.

[0042] S250: Recommend objects that match the next topic.

[0043] It should be understood that the dialogue strategy module can invoke a natural language generation model (e.g., GPT or GPT-2) to generate response statements for recommendation or to guide the next topic.

[0044] In the embodiment of the present invention, the relationships between multiple recommendation elements of the current dialogue statement are queried in the pre-constructed recommendation object graph, which recalls more information that is beneficial to the recommendation. This makes the preference representation of the current topic of the current dialogue statement more accurately reflect the user's preferences and intentions. Furthermore, based on the preference representation of the current topic, the next topic can be predicted more accurately, which improves the recommendation efficiency while ensuring the accuracy of the recommendation.

[0045] In other examples, a preference representation of the current topic of the current dialogue statement is constructed based on at least the contextual semantic associations between multiple recommendation elements and their relationships, including: generating multiple initial vector representations of multiple recommendation elements respectively; performing contextual semantic processing on the multiple initial vector representations based on the relationships between multiple recommendation elements to obtain a first contextual semantic representation of multiple recommendation elements; and constructing a preference representation of the current topic of the current dialogue statement based at least on the first contextual semantic representation.

[0046] In other examples, based on the association relationships of multiple recommendation elements, contextual semantic processing is performed on multiple initial vector representations to obtain the first contextual semantic representation of multiple recommendation elements. This includes: constructing an initial matrix representation of multiple initial vector representations; constructing a relationship matrix and a degree matrix of multiple initial vectors; encoding the initial matrix representation, relationship matrix, and degree matrix and inputting them into a graph convolutional network to obtain the first contextual semantic representation of multiple recommendation elements. The graph convolutional network is pre-trained using the initial matrix representation, relationship matrix, degree matrix, and their classification labels from graph training data.

[0047] In other examples, the dialogue recommendation method further includes generating second contextual semantic representations of at least one of the following: historical dialogue statements and their historical topics, and dialogue user preferences. Constructing a preference representation of the current topic of the current dialogue statement, based at least on the first contextual semantic representation, includes: inputting the first contextual semantic representation and each of the second contextual semantic representations into a pre-trained self-attention layer to obtain the preference representation of the current topic of the current dialogue statement. The self-attention layer is used to perform topic-based contextual representations of the first contextual semantic representation and each of the second contextual semantic representations.

[0048] In other examples, the output of the self-attention layer is connected to the input of the topic guidance layer. The self-attention layer and the topic guidance layer together form a topic guidance model, which is trained through the topic guidance relationship of different dialogue statements. Based on the preference representation of the current topic, the next topic is predicted, including: inputting the preference representation of the current topic into the topic guidance layer to obtain the next topic of the current topic.

[0049] Figure 3 This is a flowchart illustrating the steps of a model training method according to an embodiment of the present invention. During the model training phase of the topic-guided model, a computing device (e.g., a data center) configured with a CPU (processor unit) + GPU (acceleration unit) architecture can be used to train the encoder-decoder model based on training samples. The computing device, such as a data center, can be deployed in a cloud server such as a private cloud, a proprietary cloud, or a hybrid cloud.

[0050] The model training method in this embodiment includes:

[0051] S310: Obtain a sample of dialogue statements and the guiding topic for the sample dialogue statements.

[0052] S320; Identify multiple recommendation elements in the dialogue statement sample.

[0053] S330: In the pre-built recommendation object graph, query the relationship between multiple recommendation elements. The entity in the recommendation object graph indicates the recommendation element, and the entity relationship in the recommendation object graph indicates the relationship between different recommendation elements.

[0054] S340: The topic-guided model is trained based on the contextual semantic associations between at least multiple recommendation elements and their relationships as input, and the guiding topic is used as the supervision condition.

[0055] In the embodiment of the present invention, the relationships between multiple recommendation elements of a dialogue statement sample are queried in a pre-constructed recommendation object graph, which recalls more information that is beneficial to recommendation. This allows the contextual semantic relationships between multiple recommendation elements and their relationships to more accurately reflect the user's preferences and intentions in the dialogue statement sample, enabling the trained topic guidance model to execute topic guidance more accurately, thereby improving recommendation efficiency.

[0056] It should be understood that during the end-to-end training phase of the topic guidance model, the input of the topic guidance model includes the contextual semantic associations between multiple recommendation elements and their relationships. The guiding topic, which serves as the supervision condition, is the next topic of the current topic corresponding to the dialogue statement sample. The next topic can be a subordinate topic of the current topic, or a peer topic of the current topic, but belonging to a different domain or subdomain.

[0057] Figure 4 for Figure 2 and Figure 3 A schematic block diagram of a dialogue recommendation system to which the embodiments are applicable. Figure 4 The dialogue recommendation model includes a graph vector encoding module 410 such as a graph encoder, a text encoding model 420 such as a text vector encoder, a topic guidance model 430, a recommendation module 440, and a natural language generation (NLG) module 450.

[0058] Graph encoding module 410 encodes the subgraph using a graph encoder in a Graph Convolutional Network (GCN) to obtain a first context representation. For example, the subgraph can be retrieved from the recommendation object graph. The recommendation object graph, as a knowledge graph, includes entities and entity relationships. Entities in the recommendation object graph indicate recommendation elements, and entity relationships indicate the associations between different recommendation elements. Different entities may or may not have entity relationships. The recommendation object graph can be constructed based on experiential knowledge or data related to the recommendation objects.

[0059] Specifically, each entity in the recommendation object graph can be an object related to the recommended object itself or a related object. For example, when the recommended object is a product, the entities include, but are not limited to, identifiers, brand characteristics, category characteristics, store information, popularity metrics, manufacturing information, and price characteristics. Correspondingly, the relationships between these entities include, but are not limited to, product identifiers, product brand characteristics, product category characteristics, product store information, product popularity metrics, product manufacturing information, and product price characteristics. Generally speaking, if mentioning a product easily evokes a certain thematic feature of that product, it indicates a high relevance between the product and that thematic feature. For example, if mentioning mobile phones easily brings to mind a particular brand and price, it indicates a close relationship between the thematic features of that brand and price and mobile phones.

[0060] Each entity in the subgraph is a subset of each entity in the recommendation object graph, and can be queried in the recommendation object graph using the graph query module 415. For example, firstly, multiple recommendation elements appearing in the current dialogue statement are identified. For instance, if the current dialogue statement is "I want to buy a cheap electronic product," then "electronic product" and "cheap" are both recommendation elements. Accordingly, the entities that match each recommendation element (keyword matching or topic matching) are queried in the recommendation object graph.

[0061] For example, if "electronic products" is an entity in the recommendation object graph, it falls under keyword matching, and the entity "electronic products" is extracted from the recommendation object graph accordingly. Alternatively, if "electronic products" is not an entity in the recommendation object graph, but "mobile phone" is, since "mobile phone" belongs to "electronic products," it falls under topic matching, and the entity "mobile phone" is extracted from the recommendation object graph accordingly. Alternatively, if both "electronic products" and "mobile phone" are entities in the recommendation object graph, then both "electronic products" and "mobile phone" are extracted from the recommendation object graph.

[0062] It should be understood that multiple recommendation elements can be identified from all entities in the recommendation object graph, and the number of recommendation elements can be greater than the number of recommendation elements identified from the current dialogue statement.

[0063] Then, the relationships between multiple recommendation elements are obtained (recalled) from the recommendation object graph. For example, "I want to buy a cheap electronic product" does not include a specific mobile phone brand, but by obtaining "mobile phone" as an entity and "cheap" "brand" related to "mobile phone" from the recommendation object graph, more intent and preference information is obtained than the current dialogue statement itself. More intent and preference information is conducive to more accurate recommendations.

[0064] Furthermore, the text encoding model 420 encodes at least one of the historical dialogue statements and their historical topics, as well as the user preferences, of the current dialogue statement using a text encoder such as the BERT encoder, to obtain their respective second contextual representations. For example, inputting the historical dialogue statements into the BERT encoder yields the second contextual representation of the historical dialogue statements; inputting the user preferences into the BERT encoder yields the second contextual representation of the user preferences; and inputting the historical topics of the user preferences into the BERT encoder yields the second contextual representation of the historical topics.

[0065] In a dialogue example, the GCN encoder, used as an example of a graph encoder, can be encoded using (Formula 1):

[0066] Where A is the adjacency matrix and D is the degree matrix of the nodes. I N It is an N-order identity matrix. yes The corresponding degree matrix, It is a learnable linear converter. It should be understood that the linear converter of the GCN encoder is trained using training samples.

[0067] Furthermore, the first context representation of the graph encoding module 410 and the respective second context representations of the text encoding module 420 are input into the topic guidance model 430. The topic guidance model 430 can be a classification model trained end-to-end. For example, the topic guidance model 430 includes a self-attention layer and a topic guidance layer. The self-attention layer is used to concatenate the first context representation with the respective second context representations to obtain a concatenation matrix representing the concatenated context representation (an example of the preference representation of the current topic). Then, based on the pre-trained self-attention matrix, contextual semantic processing is performed on the concatenation matrix to obtain a more reliable semantic intermediate representation. Each element in the self-attention matrix is ​​a weight value, and the weight value of each element represents the semantic relevance between the two characters corresponding to each element.

[0068] Then, the splicing matrix is ​​processed by a topic guiding layer, such as a decoder, to obtain the next topic.

[0069] The dialogue strategy module determines whether there is an object tag in the object tag set that matches the next topic. If there is, the recommendation module 440 obtains the recommended object mentioned in the object tag. Then, the recommended object (e.g., the text matrix or text vector of the recommended object) and the concatenation matrix of the preference representation (e.g., concatenating the two again) are input into the natural language generation module 450 to obtain the response statement (recommended statement) of the current dialogue statement. The natural language generation module 450 can be implemented using a pre-trained model such as GPT or GPT-2.

[0070] If no object label matches the next topic in the object label set, the next topic (e.g., the text matrix or text vector of the next topic) and the concatenation matrix of the preference representation (e.g., concatenating the two again) are input into the natural language generation module 450 to obtain the response statement for the current dialogue statement.

[0071] Furthermore, the recommendation module 440 can determine multiple candidate object tags to which a corresponding tag belongs from the set of candidate recommendation objects. Then, based on the similarity between the multiple candidate recommendation objects and the preference representation of the current topic, the multiple candidate recommendation objects are sorted. Then, based on the sorting of the multiple candidate recommendation objects, a recommended object is selected from the multiple candidate recommendation objects for recommendation. The sorting order of the recommended object in the multiple candidate recommendation objects is less than a preset order. For example, the first candidate recommendation object is recommended. Thus, by sorting based on similarity, recommendations are made more accurately.

[0072] In a more general case, as an example of recommending objects that match the next topic, the recommended objects to which the object tag belongs can be recommended when the next topic matches the object tag. The next topic can be a sub-topic of the current topic. Recommendations are made when the tags of the sub-topic match the object tag, which improves the efficiency of recommendations.

[0073] Alternatively, when the next topic does not match the object label, a response statement for the current dialogue statement is generated based on the preference representation of the current topic and the next topic. For example, if the next topic is a sub-topic of the current topic, it means that the sub-topic's label still does not match the object label; for example, the sub-topic still cannot accurately focus on the object label. Therefore, the response statement guides the sub-topic again until it matches an object label. Or, for another example, if the next topic is at the same level as the current topic, but belongs to a different domain or subdomain, then the next topic shifts the direction of the dialogue topic, making it more likely to match an object label.

[0074] It should be understood that when constructing the object tag set, you can first label the object tags of all the candidate recommended objects in the candidate recommended object set. Each candidate recommended object can include at least one object tag. Then, count all the object tags of all candidate recommended objects, remove duplicate object tags, and obtain the object tag set.

[0075] Furthermore, Figure 5 A dialogue recommendation device according to another embodiment of the present invention is shown. The dialogue recommendation device of this embodiment is similar to... Figure 2 The corresponding dialogue recommendation methods include:

[0076] Module 510 determines multiple recommendation elements in the current dialogue statement.

[0077] The query module 520 queries the relationships between the multiple recommendation elements in a pre-constructed recommendation object graph. The entities in the recommendation object graph indicate recommendation elements, and the entity relationships in the recommendation object graph indicate the relationships between different recommendation elements.

[0078] The construction module 530 constructs a preference representation of the current topic of the current dialogue statement based at least on the contextual semantic association between the multiple recommendation elements and their relationships.

[0079] The prediction module 540 predicts the next topic based on the preference representation of the current topic;

[0080] The recommendation module 550 recommends objects that match the next topic.

[0081] In the embodiment of the present invention, the relationships between multiple recommendation elements of the current dialogue statement are queried in the pre-constructed recommendation object graph, which recalls more information that is beneficial to the recommendation. This makes the preference representation of the current topic of the current dialogue statement more accurately reflect the user's preferences and intentions. Furthermore, based on the preference representation of the current topic, the next topic can be predicted more accurately, which improves the recommendation efficiency while ensuring the accuracy of the recommendation.

[0082] In other examples, the recommendation module is specifically used to recommend recommended objects to which the object tag belongs when the next topic matches the object tag.

[0083] In other examples, the recommendation module is specifically used to: determine a plurality of candidate recommendation objects having the object label; rank the plurality of candidate recommendation objects based on the similarity between the plurality of candidate recommendation objects and the preference representation of the current topic; and select a recommendation object from the plurality of candidate recommendation objects for recommendation based on the ranking of the plurality of candidate recommendation objects, wherein the ranking ordinal number of the recommendation object in the plurality of candidate recommendation objects is less than a preset ordinal number.

[0084] In other examples, the dialogue recommendation device further includes a dialogue generation module that, when the next topic does not match the object tag, generates a response statement for the current dialogue statement based on the preference representation of the current topic and the next topic.

[0085] In other examples, the construction module is specifically used to: generate multiple initial vector representations of the multiple recommendation elements respectively; perform contextual semantic processing on the multiple initial vector representations based on the association relationship of the multiple recommendation elements to obtain a first contextual semantic representation of the multiple recommendation elements; and construct a preference representation of the current topic of the current dialogue statement based at least on the first contextual semantic representation.

[0086] In other examples, the construction module is specifically used to: construct an initial matrix representation of the plurality of initial vector representations; construct a relation matrix and a degree matrix of the plurality of initial vectors; encode the initial matrix representation, the relation matrix and the degree matrix and input them into a graph convolutional network to obtain a first contextual semantic representation of the plurality of recommendation elements, wherein the graph convolutional network is pre-trained using the initial matrix representation, relation matrix and degree matrix of graph training data and their classification labels.

[0087] In other examples, the construction module is also used to: generate at least one of the following second contextual semantic representations: the historical dialogue statements and their historical topics, and the dialogue user preferences. Specifically, the construction module is used to: input the first contextual semantic representation and the respective second contextual semantic representations into a pre-trained self-attention layer to obtain a preference representation of the current topic of the current dialogue statement. The self-attention layer is used to perform a contextual representation based on the dialogue topic on the first contextual semantic representation and the respective second contextual semantic representations.

[0088] In other examples, the output of the self-attention layer is connected to the input of the topic guidance layer. The self-attention layer and the topic guidance layer together form a topic guidance model, which is trained using topic guidance relationships from different dialogue statements. The prediction module is specifically used to: input the preference representation of the current topic into the topic guidance layer to obtain the next topic for the current topic.

[0089] In other examples, the dialogue generation module further includes generating a response statement for the current dialogue statement based on the preference representation of the current topic and the recommendation object.

[0090] The apparatus of this embodiment is used to implement the corresponding methods in the foregoing method embodiments and has the beneficial effects of the corresponding method embodiments, which will not be repeated here. Furthermore, the functional implementation of each module in the apparatus of this embodiment can be referred to the description of the corresponding part in the foregoing method embodiments, which will also not be repeated here.

[0091] Figure 6 This is a structural block diagram of a model training device according to another embodiment of the present invention.

[0092] The model training device in this embodiment and Figure 3 The corresponding model training methods include:

[0093] The acquisition module 610 acquires a dialogue statement sample and the guiding topic of the dialogue statement sample.

[0094] The determination module 620 determines multiple recommendation elements in the dialogue statement sample.

[0095] The query module 630 queries the relationships between the multiple recommendation elements in a pre-constructed recommendation object graph. The entities in the recommendation object graph indicate recommendation elements, and the entity relationships in the recommendation object graph indicate the relationships between different recommendation elements.

[0096] The training module 640 trains the topic guidance model by taking at least the contextual semantic associations between the multiple recommendation elements and their relationships as input and the guiding topic as the supervision condition.

[0097] In the embodiment of the present invention, the relationships between multiple recommendation elements of a dialogue statement sample are queried in a pre-constructed recommendation object graph, which recalls more information that is beneficial to recommendation. This allows the contextual semantic relationships between multiple recommendation elements and their relationships to more accurately reflect the user's preferences and intentions in the dialogue statement sample, enabling the trained topic guidance model to execute topic guidance more accurately, thereby improving recommendation efficiency.

[0098] Reference Figure 7 The diagram shows a schematic of an electronic device according to another embodiment of the present invention. The specific embodiments of the present invention do not limit the specific implementation of the electronic device.

[0099] like Figure 7 As shown, the electronic device may include: a processor 702, a communications interface 704, a memory 706 storing a program 710, and a communications bus 708.

[0100] The processor, communication interface, and memory communicate with each other via a communication bus.

[0101] A communication interface is used to communicate with other electronic devices or servers.

[0102] The processor is used to execute programs, specifically the relevant steps in the above method embodiments.

[0103] Specifically, the program may include program code, which includes at least one executable instruction.

[0104] The processor may be a CPU, an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention. The one or more processors included in a smart device may be of the same type, such as one or more CPUs; or they may be of different types, such as one or more CPUs and one or more ASICs.

[0105] Memory is used to store programs. Memory may include high-speed RAM, and may also include non-volatile memory, such as at least one disk drive.

[0106] Specifically, the program can be used to cause the processor to execute the following: Figure 2 Dialogue recommendation methods or Figure 3 The model training method.

[0107] Furthermore, the specific implementation of each step in the program can be found in the corresponding descriptions of the steps and units in the above method embodiments, and will not be repeated here. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the devices and modules described above can be referred to the corresponding process descriptions in the foregoing method embodiments, and will not be repeated here.

[0108] It should be noted that, depending on the implementation needs, the various components / steps described in the embodiments of the present invention can be broken down into more components / steps, or two or more components / steps or parts of the operation of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of the present invention.

[0109] The methods described above according to embodiments of the present invention can be implemented in hardware, firmware, or as software or computer code that can be stored in a recording medium (such as a CD-ROM, RAM, floppy disk, hard disk, or magneto-optical disk), or as computer code originally stored on a remote recording medium or a non-transitory machine-readable medium and subsequently stored on a local recording medium, downloaded via a network. Thus, the methods described herein can be processed by software stored on a recording medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware (such as an ASIC or FPGA). It is understood that the computer, processor, microprocessor controller, or programmable hardware includes storage components (e.g., RAM, ROM, flash memory, etc.) capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods described herein. Furthermore, when a general-purpose computer accesses code used to implement the methods shown herein, the execution of the code transforms the general-purpose computer into a dedicated computer for executing the methods shown herein.

[0110] Those skilled in the art will recognize that the units and method steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of the embodiments of the present invention.

[0111] The above embodiments are only used to illustrate the embodiments of the present invention, and are not intended to limit the embodiments of the present invention. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the embodiments of the present invention. Therefore, all equivalent technical solutions also fall within the scope of the embodiments of the present invention, and the patent protection scope of the embodiments of the present invention should be defined by the claims.

Claims

1. A dialogue recommendation method, comprising: Identify multiple recommendation elements in the current dialogue statement; In a pre-constructed recommendation object graph, the relationships between the multiple recommendation elements are queried. The entities in the recommendation object graph indicate recommendation elements, and the entity relationships in the recommendation object graph indicate the relationships between different recommendation elements. Multiple initial vector representations of the multiple recommendation elements are generated respectively. Contextual semantic processing is performed on the multiple initial vector representations based on the association relationship of the multiple recommendation elements to obtain the first contextual semantic representation of the multiple recommendation elements. Second contextual semantic representations of at least one of the historical dialogue statements and their historical topics of the current dialogue statement, and the dialogue user preferences are generated. Based on the first contextual semantic representation and the various second contextual semantic representations, the preference representation of the current topic of the current dialogue statement is obtained. Based on the preference representation of the current topic, predict the next topic of the current topic; Recommended objects that match the next topic.

2. The method according to claim 1, wherein, The recommended objects that match the next topic include: When the next topic matches an object tag, the recommended object to which the object tag belongs is recommended.

3. The method according to claim 2, wherein, The recommendation of the recommended objects to which the object tags belong includes: Identify multiple candidate recommended objects that have the aforementioned object tags; The multiple candidate recommendation objects are ranked based on the similarity between the multiple candidate recommendation objects and the preference representation of the current topic; Based on the ranking of multiple candidate recommendation objects, a recommendation object is selected from the multiple candidate recommendation objects for recommendation, and the ranking number of the recommendation object in the multiple candidate recommendation objects is less than a preset number.

4. The method according to claim 2, wherein, The method further includes: When the next topic does not match the object tag, a response statement for the current dialogue statement is generated based on the preference representation of the current topic and the next topic.

5. The method according to claim 1, wherein, The step of performing contextual semantic processing on the multiple initial vector representations based on the association relationships of the multiple recommendation elements to obtain the first contextual semantic representation of the multiple recommendation elements includes: Construct the initial matrix representation of the multiple initial vector representations; Construct the relationship matrix and degree matrix of the multiple initial vectors; The initial matrix representation, the relation matrix, and the degree matrix are encoded and input into a graph convolutional network to obtain the first contextual semantic representation of the multiple recommendation elements. The graph convolutional network is pre-trained using the initial matrix representation, relation matrix, degree matrix, and their classification labels from the graph training data.

6. The method according to claim 1, wherein, The method further includes: The step of constructing a preference representation of the current topic of the current dialogue statement based at least on the first context semantic representation includes: Based on the first context semantic representation and each of the second context semantic representations, the input is fed into a pre-trained self-attention layer to obtain the current topic preference representation of the current dialogue statement. The self-attention layer is used to perform context representation based on the dialogue topic on the first context semantic representation and each of the second context semantic representations.

7. The method according to claim 6, wherein, The output of the self-attention layer is connected to the input of the topic guidance layer. The self-attention layer and the topic guidance layer together form a topic guidance model. The topic guidance model is trained by the topic guidance relationship of different dialogue statements. The prediction of the next topic based on the preference representation of the current topic includes: The preference representation of the current topic is input into the topic guidance layer to obtain the next topic of the current topic.

8. The method according to claim 6, wherein, The method further includes: Based on the preference representation of the current topic and the recommended objects, a response statement for the current dialogue statement is generated.

9. A model training method, comprising: Obtain a sample of dialogue statements and the guiding topic of the sample dialogue statements; Identify multiple recommendation elements in the dialogue sample; In a pre-constructed recommendation object graph, the relationships between the multiple recommendation elements are queried. The entities in the recommendation object graph indicate recommendation elements, and the entity relationships in the recommendation object graph indicate the relationships between different recommendation elements. Multiple initial vector representations of the multiple recommendation elements are generated respectively. Based on the association relationship of the multiple recommendation elements, the multiple initial vector representations are subjected to contextual semantic processing to obtain the first contextual semantic representation of the multiple recommendation elements. The historical dialogue statement samples and their historical guiding topics, as well as at least one of the sample user preferences, are used to generate the dialogue statement samples. Based on the first context semantic representation and each of the second context semantic representations, the preference representation of the current guiding topic of the dialogue statement sample is obtained; Using the guiding topic as a supervision condition and the preference representation of the current guiding topic as input, the topic guidance model is trained.

10. A dialogue recommendation device, comprising: The module identifies multiple recommendation elements within the current dialogue statement. The query module queries the relationships between multiple recommendation elements in a pre-built recommendation object graph. The entities in the recommendation object graph indicate recommendation elements, and the entity relationships in the recommendation object graph indicate the relationships between different recommendation elements. The construction module generates multiple initial vector representations of the multiple recommendation elements, performs contextual semantic processing on the multiple initial vector representations based on the association relationship of the multiple recommendation elements, obtains the first contextual semantic representation of the multiple recommendation elements, generates each second contextual semantic representation of at least one of the historical dialogue statements and their historical topics of the current dialogue statement, and the preferences of the dialogue users, and obtains the preference representation of the current topic of the current dialogue statement based on the first contextual semantic representation and each second contextual semantic representation. The prediction module predicts the next topic based on the preference representation of the current topic; The recommendation module recommends objects that match the next topic.

11. A model training device, comprising: The acquisition module acquires dialogue statement samples and the guiding topics of the dialogue statement samples; The determination module determines multiple recommendation elements in the dialogue statement sample; The query module generates multiple initial vector representations for the multiple recommendation elements, performs contextual semantic processing on the multiple initial vector representations based on the association relationships of the multiple recommendation elements, and obtains the first contextual semantic representation of the multiple recommendation elements; it generates each second contextual semantic representation of at least one of the historical dialogue statement samples and their historical guiding topics, and the sample user preferences of the dialogue statement sample; based on the first contextual semantic representation and the various second contextual semantic representations, it obtains the preference representation of the current guiding topic of the dialogue statement sample; The training module uses the guiding topic as a supervision condition and the preference representation of the current guiding topic as input to train the topic guidance model.

12. An electronic device, comprising: The processor, memory, communication interface, and communication bus are provided, wherein the processor, memory, and communication interface communicate with each other via the communication bus. The memory is used to store at least one executable instruction that causes the processor to perform the operation corresponding to the method as described in any one of claims 1-9.

13. A computer storage medium having a computer program stored thereon, which, when executed by a processor, implements the method as described in any one of claims 1-9.

Citation Information

Patent Citations

  • Recommendation copywriting generation method and device, electronic equipment and readable storage medium

    CN110765273A

  • Geographically localized recommendations in a computing advice facility

    US20110307478A1