[go: up one dir, main page]

CN115408508A - Dialogue recommendation and model training method and device, electronic equipment and storage medium - Google Patents

Dialogue recommendation and model training method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115408508A
CN115408508A CN202211201931.9A CN202211201931A CN115408508A CN 115408508 A CN115408508 A CN 115408508A CN 202211201931 A CN202211201931 A CN 202211201931A CN 115408508 A CN115408508 A CN 115408508A
Authority
CN
China
Prior art keywords
recommended
current
topic
elements
representation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211201931.9A
Other languages
Chinese (zh)
Inventor
董保华
崔恒斌
冯帆
关新宇
樊艳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba China Co Ltd
Original Assignee
Alibaba China Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba China Co Ltd filed Critical Alibaba China Co Ltd
Priority to CN202211201931.9A priority Critical patent/CN115408508A/en
Publication of CN115408508A publication Critical patent/CN115408508A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • G06F16/288Entity relationship models
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/36Creation of semantic tools, e.g. ontology or thesauri
    • G06F16/367Ontology

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Mathematical Physics (AREA)
  • Artificial Intelligence (AREA)
  • Human Computer Interaction (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Animal Behavior & Ethology (AREA)
  • Machine Translation (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention provides a dialogue recommendation and model training method and device, electronic equipment and a storage medium. The conversation recommendation method comprises the following steps: determining a plurality of recommendation elements in the current dialogue statement; querying the incidence relation among the plurality of recommended elements in a pre-constructed recommended object map, wherein the entity of the recommended object map indicates the recommended elements, and the entity relation of the recommended object map indicates the incidence relation among different recommended elements; constructing a preference representation of a current topic of the current dialog statement based on at least the contextual semantic association between the plurality of recommended elements and their associations; predicting a next topic for the current topic based on the preferred representation of the current topic; recommending the recommended object matched with the next theme. The proposal of the embodiment of the invention ensures the accuracy of recommendation and further improves the recommendation efficiency.

Description

对话推荐与模型训练方法、装置、电子设备和存储介质Dialogue recommendation and model training method, device, electronic device and storage medium

技术领域technical field

本发明实施例涉及计算机技术领域,尤其涉及一种对话推荐与模型训练方法、装置、电子设备和存储介质。The embodiments of the present invention relate to the field of computer technology, and in particular, to a dialogue recommendation and model training method, device, electronic device and storage medium.

背景技术Background technique

对话推荐系统(Conversational Recommender System,CRS)能够在与用户的对话过程中,实现了诸如商品的推荐对象的推荐过程。传统的对话推荐任务往往先通过一些规则或模型判定用户需求,然后基于用户的对话信息分析用户偏好,进而向用户推荐诸如商品的推荐对象。The Conversational Recommender System (CRS) can realize the recommendation process of recommended objects such as commodities in the process of dialogue with users. Traditional dialogue recommendation tasks often determine user needs through some rules or models, and then analyze user preferences based on user dialogue information, and then recommend recommended objects such as commodities to users.

随着对话推荐系统的发展,引入了对话策略模块,能够根据与用户的当前对话状态作出主题引导还是直接进行推荐的判断,进一步提高了用户体验的流畅性和推荐的准确度,但是,目前的对话推荐系统在主题引导过程或推荐过程中对用户偏好或意图估计不够准确,导致了推荐效率仍有提高的空间。With the development of the dialogue recommendation system, a dialogue strategy module is introduced, which can make a judgment on topic guidance or direct recommendation according to the current dialogue state with the user, which further improves the fluency of user experience and the accuracy of recommendation. However, the current Dialogue recommendation systems are not accurate enough to estimate user preferences or intentions in the topic guidance process or recommendation process, resulting in room for improvement in recommendation efficiency.

发明内容Contents of the invention

有鉴于此,本发明实施例提供一种对话推荐与模型训练方法、装置、电子设备和存储介质,以至少部分解决上述问题。In view of this, embodiments of the present invention provide a dialog recommendation and model training method, device, electronic device, and storage medium to at least partially solve the above problems.

根据本发明实施例的第一方面,提供了一种对话推荐方法,包括:确定当前对话语句中的多个推荐要素;在预先构建的推荐对象图谱中,查询所述多个推荐要素之间的关联关系,所述推荐对象图谱的实体指示推荐要素,所述推荐对象图谱的实体关系指示不同推荐要素之间的关联关系;至少基于所述多个推荐要素及其关联关系之间的上下文语义关联,构建所述当前对话语句的当前主题的偏好表示;基于所述当前主题的偏好表示,预测所述当前主题的下一主题;推荐与所述下一主题匹配的推荐对象。According to the first aspect of an embodiment of the present invention, a dialogue recommendation method is provided, including: determining a plurality of recommended elements in the current dialogue sentence; Association relationship, the entity of the recommended object graph indicates the recommended element, and the entity relationship of the recommended object graph indicates the association relationship between different recommended elements; at least based on the contextual semantic association between the plurality of recommended elements and their associations Constructing a preference representation of the current topic of the current dialogue sentence; predicting a next topic of the current topic based on the preference representation of the current topic; recommending a recommendation object matching the next topic.

在本发明的另一实现方式中,所述推荐与所述下一主题匹配的推荐对象,包括:在所述下一主题与对象标签匹配时,对所述对象标签所属的推荐对象进行推荐。In another implementation manner of the present invention, the recommending a recommended object that matches the next topic includes: when the next topic matches an object tag, recommending a recommended object to which the object tag belongs.

在本发明的另一实现方式中,所述对所述对象标签所属的推荐对象进行推荐,包括:确定具有所述对象标签的多个备选推荐对象;基于所述多个备选推荐对象与所述当前主题的偏好表示的相似度,对所述多个备选推荐对象进行排序;基于多个备选推荐对象的排序,选择所述多个备选推荐对象中的推荐对象进行推荐,所述推荐对象在所述多个备选推荐对象中的排序序数小于预设序数。In another implementation manner of the present invention, the recommending the recommended object to which the object tag belongs includes: determining a plurality of candidate recommended objects with the object tag; sorting the plurality of candidate recommendation objects based on the similarity of the preference representation of the current topic; selecting a recommendation object among the plurality of candidate recommendation objects for recommendation based on the ranking of the plurality of candidate recommendation objects, and The sorting ordinal number of the recommended object among the plurality of candidate recommended objects is less than a preset ordinal number.

在本发明的另一实现方式中,所述方法还包括:在所述下一主题与所述对象标签不匹配时,基于所述当前主题的偏好表示、以及所述下一主题,生成所述当前对话语句的回复语句。In another implementation manner of the present invention, the method further includes: when the next topic does not match the object label, based on the preference representation of the current topic and the next topic, generating the The reply statement for the current conversation statement.

在本发明的另一实现方式中,所述至少基于所述多个推荐要素及其关联关系之间的上下文语义关联,构建所述当前对话语句的当前主题的偏好表示,包括:分别生成所述多个推荐要素的多个初始向量表示;基于所述多个推荐要素的关联关系,对所述多个初始向量表示进行上下文语义处理,得到所述多个推荐要素的第一上下文语义表示;至少基于所述第一上下文语义表示,构建所述当前对话语句的当前主题的偏好表示。In another implementation manner of the present invention, the constructing the preference representation of the current topic of the current dialogue sentence based at least on the contextual semantic association between the plurality of recommended elements and their associations includes: respectively generating the Multiple initial vector representations of multiple recommended elements; based on the association relationship of the multiple recommended elements, perform contextual semantic processing on the multiple initial vector representations to obtain a first contextual semantic representation of the multiple recommended elements; at least Based on the first contextual semantic representation, a preference representation of the current topic of the current dialogue sentence is constructed.

在本发明的另一实现方式中,所述基于所述多个推荐要素的关联关系,对所述多个初始向量表示进行上下文语义处理,得到所述多个推荐要素的第一上下文语义表示,包括:构建所述多个初始向量表示的初始矩阵表示;构建所述多个初始向量之间的关系矩阵以及度矩阵;将所述初始矩阵表示、所述关系矩阵以及所述度矩阵进行编码输入到图卷积网络中,得到所述多个推荐要素的第一上下文语义表示,所述图卷积网络通过图训练数据的初始矩阵表示、关系矩阵以及度矩阵及其分类标签预先训练得到。In another implementation manner of the present invention, based on the association relationship of the plurality of recommended elements, the context semantic processing is performed on the plurality of initial vector representations to obtain the first context semantic representation of the plurality of recommended elements, Including: constructing an initial matrix representation of the plurality of initial vector representations; constructing a relationship matrix and a degree matrix among the plurality of initial vectors; encoding and inputting the initial matrix representation, the relationship matrix and the degree matrix In the graph convolutional network, the first contextual semantic representation of the plurality of recommended elements is obtained, and the graph convolutional network is pre-trained through the initial matrix representation of the graph training data, the relationship matrix, the degree matrix and its classification labels.

在本发明的另一实现方式中,所述方法还包括:生成所述当前对话语句的历史对话语句及其历史主题、以及对话用户偏好中的至少一者的各个第二上下文语义表示。所述至少基于所述第一上下文语义表示,构建所述当前对话语句的当前主题的偏好表示,包括:基于所述第一上下文语义表示、所述各个第二上下文语义表示输入到预先训练的自注意力层中,得到所述当前对话语句的当前主题的偏好表示,所述自注意力层用于对所述第一上下文语义表示以及所述各个第二上下文语义表示进行基于对话主题的上下文表示。In another implementation manner of the present invention, the method further includes: generating respective second contextual semantic representations of at least one of the historical dialog sentences of the current dialog sentence, their historical topics, and dialog user preferences. The constructing the preference representation of the current topic of the current dialogue sentence based at least on the first contextual semantic representation includes: inputting the first contextual semantic representation and each second contextual semantic representation to a pre-trained automatic In the attention layer, the preference representation of the current topic of the current dialog sentence is obtained, and the self-attention layer is used to perform contextual representation based on the dialog topic for the first contextual semantic representation and each second contextual semantic representation .

在本发明的另一实现方式中,所述自注意力层的输出与主题引导层的输入连接,所述自注意力层与所述主题引导层组成引导主题引导模型,所述主题引导模型通过不同对话语句的主题引导关系训练得到。所述基于所述当前主题的偏好表示,预测所述当前主题的下一主题,包括:将所述当前主题的偏好表示输入到主题引导层,得到所述当前主题的下一主题。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 form a guidance topic guidance model, and the topic guidance model passes The topic-guided relations of different dialogue sentences are trained. The predicting the next topic of the current topic based on the preference representation of the current topic includes: inputting the preference representation of the current topic into a topic guidance layer to obtain the next topic of the current topic.

在本发明的另一实现方式中,所述方法还包括:基于所述当前主题的偏好表示以及所述推荐对象,生成所述当前对话语句的回复语句。In another implementation manner of the present invention, the method further includes: generating a reply sentence to the current dialogue sentence based on the preference expression of the current topic and the recommended object.

根据本发明实施例的第二方面,提供了一种模型训练方法,包括:获取对话语句样本及其所述对话语句样本的引导主题;确定所述对话语句样本中的多个推荐要素;在预先构建的推荐对象图谱中,查询所述多个推荐要素之间的关联关系,所述推荐对象图谱的实体指示推荐要素,所述推荐对象图谱的实体关系指示不同推荐要素之间的关联关系;至少基于所述多个推荐要素及其关联关系之间的上下文语义关联作为输入,以所述引导主题作为监督条件,对主题引导模型进行训练。According to the second aspect of the embodiment of the present invention, there is provided a model training method, including: acquiring a dialogue sentence sample and the guiding theme of the dialogue sentence sample; determining a plurality of recommended elements in the dialogue sentence sample; In the constructed recommendation object graph, the association relationship between the plurality of recommended elements is queried, the entity of the recommendation object graph indicates the recommended element, and the entity relationship of the recommended object graph indicates the association relationship between different recommended elements; at least Based on the contextual semantic association between the plurality of recommended elements and their associations as input, the topic guidance model is trained with the guidance topic as a supervision condition.

根据本发明实施例的第三方面,提供了一种对话推荐装置,包括:确定模块,确定当前对话语句中的多个推荐要素;查询模块,在预先构建的推荐对象图谱中,查询所述多个推荐要素之间的关联关系,所述推荐对象图谱的实体指示推荐要素,所述推荐对象图谱的实体关系指示不同推荐要素之间的关联关系;构建模块,至少基于所述多个推荐要素及其关联关系之间的上下文语义关联,构建所述当前对话语句的当前主题的偏好表示;预测模块,基于所述当前主题的偏好表示,预测所述当前主题的下一主题;推荐模块,推荐与所述下一主题匹配的推荐对象。According to the third aspect of the embodiment of the present invention, there is provided a dialogue recommendation device, including: a determination module, which determines a plurality of recommendation elements in the current dialogue sentence; a query module, which queries the multiple elements in the pre-built recommendation object map An association relationship between recommended elements, the entity of the recommended object graph indicates the recommended element, and the entity relationship of the recommended object graph indicates the association relationship between different recommended elements; the building module is at least based on the plurality of recommended elements and the recommended elements. The contextual semantic association between its associations constructs the preference representation of the current topic of the current dialogue sentence; the prediction module predicts the next topic of the current topic based on the preference representation of the current topic; the recommendation module recommends and A recommendation object matched by the next topic.

根据本发明实施例的第四方面,提供了一种模型训练装置,包括:获取模块,获取对话语句样本及其所述对话语句样本的引导主题;确定模块,确定所述对话语句样本中的多个推荐要素;查询模块,在预先构建的推荐对象图谱中,查询所述多个推荐要素之间的关联关系,所述推荐对象图谱的实体指示推荐要素,所述推荐对象图谱的实体关系指示不同推荐要素之间的关联关系;训练模块,至少基于所述多个推荐要素及其关联关系之间的上下文语义关联作为输入,以所述引导主题作为监督条件,对主题引导模型进行训练。According to a fourth aspect of the embodiments of the present invention, there is provided a model training device, including: an acquisition module, which acquires a dialogue statement sample and the guiding theme of the dialogue statement sample; a determination module, which determines the number of dialogue statement samples recommended elements; the query module, in the pre-built recommended object map, query the association relationship between the plurality of recommended elements, the entity of the recommended object map indicates the recommended element, and the entity relationship of the recommended object map indicates different The association relationship between recommended elements; the training module is at least based on the context semantic association between the plurality of recommended elements and their association relationship as input, and uses the guidance theme as a supervision condition to train the topic guidance model.

根据本发明实施例的第五方面,提供了一种电子设备,包括:处理器、存储器、通信接口和通信总线,所述处理器、所述存储器和所述通信接口通过所述通信总线完成相互间的通信;所述存储器用于存放至少一可执行指令,所述可执行指令使所述处理器执行如第一方面或第二方面所述的方法对应的操作。According to a fifth aspect of the embodiments of the present invention, there is provided an electronic device, including: a processor, a memory, a communication interface, and a communication bus, and the processor, the memory, and the communication interface complete mutual communication through the communication bus The communication among them; the memory is used to store at least one executable instruction, and the executable instruction causes the processor to execute the operation corresponding to the method described in the first aspect or the second aspect.

根据本发明实施例的第六方面,提供了一种计算机存储介质,其上存储有计算机程序,该程序被处理器执行时实现如第一方面或第二方面所述的方法。According to a sixth aspect of the embodiments of the present invention, there is provided a computer storage medium, on which a computer program is stored, and when the program is executed by a processor, the method as described in the first aspect or the second aspect is implemented.

在本发明实施例的方案中,在预先构建的推荐对象图谱中,查询当前对话语句的多个推荐要素之间的关联关系,召回了更多有利于推荐的信息,使得所构建的当前对话语句的当前主题的偏好表示能够更准确地反映了当前对话语句的用户的偏好和意图,进而在基于当前主题的偏好表示能够更准确地预测下一主题,在保证了推荐的准确度的同时进一步地提高了推荐效率。In the scheme of the embodiment of the present invention, in the pre-built recommendation object map, query the relationship between multiple recommended elements of the current dialogue sentence, and recall more information that is conducive to recommendation, so that the constructed current dialogue sentence The preference representation of the current topic can more accurately reflect the user's preference and intention of the current dialogue statement, and then the preference representation based on the current topic can more accurately predict the next topic, while ensuring the accuracy of the recommendation and further improving the Improve recommendation efficiency.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明实施例中记载的一些实施例,对于本领域普通技术人员来讲,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments described in the embodiments of the present invention, and those skilled in the art can also obtain other drawings based on these drawings.

图1为根据一个示例的对话推荐系统的示意性框图。Fig. 1 is a schematic block diagram of a dialog recommendation system according to an example.

图2为根据本发明的一个实施例的对话推荐方法的步骤流程图。Fig. 2 is a flowchart of steps of a dialog recommendation method according to an embodiment of the present invention.

图3为根据本发明的一个实施例的模型训练方法的步骤流程图。Fig. 3 is a flowchart of steps of a model training method according to an embodiment of the present invention.

图4为图2和图3的实施例所适用的对话推荐系统的示意性框图。FIG. 4 is a schematic block diagram of a dialogue recommendation system to which the embodiments of FIG. 2 and FIG. 3 are applied.

图5为根据本发明的另一实施例的对话推荐装置的结构框图。Fig. 5 is a structural block diagram of a dialogue recommendation device according to another embodiment of the present invention.

图6为根据本发明的另一实施例的模型训练装置的结构框图。Fig. 6 is a structural block diagram of a model training device according to another embodiment of the present invention.

图7为根据本发明的另一实施例的电子设备的结构示意图。FIG. 7 is a schematic structural diagram of an electronic device according to another embodiment of the present invention.

具体实施方式Detailed ways

为了使本领域的人员更好地理解本发明实施例中的技术方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、详细地描述,显然,所描述的实施例仅是本发明实施例一部分实施例,而不是全部的实施例。基于本发明实施例中的实施例,本领域普通技术人员所获得的所有其他实施例,都应当属于本发明实施例保护的范围。In order 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 detailedly described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described The embodiments are only some of the embodiments of the present invention, but not all of them. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments in the embodiments of the present invention shall fall within the protection scope of the embodiments of the present invention.

下面结合本发明实施例附图进一步说明本发明实施例具体实现。The specific implementation of the embodiments of the present invention will be further described below in conjunction with the accompanying drawings of the embodiments of the present invention.

图1为根据一个示例的对话推荐系统的示意性框图。对话推荐系统包括用户界面110、对话策略模块120、推荐模块130、主题引导模块140以及对话生成模块150。Fig. 1 is a schematic block diagram of a dialog recommendation system according to 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 .

具体地,用户界面110用于获取用户输入的自然语言语句,即,当前对话语句,也用于给出对话推荐系统的答复语句。对话策略模块120用于根据当前对话语句做出如何回复的决定,比如是继续询问到下一主题还是直接进行推荐。推荐模块130用于根据用户偏好或意图给出相应的推荐列表或者单个推荐结果。主题引导模块140用于继续询问到下一主题。对话生成模块150用于根据推荐列表或者单个推荐结果或者下一主题生成回复语句。目前的对话推荐系统在主题引导过程或推荐过程中对用户偏好或意图估计不够准确,导致了推荐效率仍有提高的空间。Specifically, the user interface 110 is used to obtain the natural language sentence input by the user, that is, the current dialog sentence, and is also used to give the reply sentence of the dialog recommendation system. The dialog strategy module 120 is used to make a decision on how to reply according to the current dialog sentence, such as whether to continue to inquire about the next topic or make a recommendation directly. The recommendation module 130 is used to give a corresponding recommendation list or a single recommendation result according to user preferences or intentions. The topic guidance module 140 is used to continue the query to the next topic. The dialog generation module 150 is used to generate reply sentences according to the recommendation list or a single recommendation result or the next topic. The current dialogue recommendation system is not accurate enough to estimate user preferences or intentions during the topic guidance process or recommendation process, resulting in room for improvement in recommendation efficiency.

图2示出了根据本发明的一个实施例的对话推荐方法。本实施例的方案可以适用于任意适当的具有数据处理能力的电子设备,包括但不限于:服务器、移动终端(如手机、PAD等)和PC机等。例如,在主题引导模型的模型训练(training)阶段,可以利用配置有CPU(处理单元的示例)+GPU(加速单元的示例)架构的计算设备(例如,数据中心)基于训练样本对编码器解码器模型进行训练。诸如数据中心的计算设备可以部署在诸如专有云、私有云、或混合云的云服务器中。相应地,在对话推荐方法的推理(inference)阶段,也可以利用配置有CPU(处理单元的示例)+GPU(加速单元的示例)架构的计算设备进行推理运算。本实施例的对话推荐方法,包括:Fig. 2 shows a dialogue recommendation method according to an embodiment of the present invention. The solution 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 stage of the topic-guided model, a computing device (for example, a data center) configured with a CPU (an example of a processing unit)+GPU (an example of an acceleration unit) architecture can be utilized to decode the encoder based on training samples model for training. Computing devices such as data centers may be deployed in cloud servers such as dedicated clouds, private clouds, or hybrid clouds. Correspondingly, in the inference stage of the dialogue recommendation method, a computing device configured with a CPU (an example of a processing unit)+GPU (an example of an acceleration unit) architecture can also be used to perform inference operations. The dialog recommendation method of this embodiment includes:

S210:确定当前对话语句中的多个推荐要素。S210: Determine multiple recommended elements in the current dialogue sentence.

应理解,多个推荐要素可以是与备选推荐对象关联的要素,在推荐对象为商品时,推荐要素包括但不限于价格、销量、品牌、店铺、热度等。在推荐对象为知识点时,推荐要素包括但不限于与知识点相关的专家、领域、诸如国籍、性别、年龄等专家相关信息、书籍、引文资源等。It should be understood that the multiple recommended elements may be elements associated with candidate recommended objects. When the recommended object is a product, the recommended elements include but are not limited to price, sales volume, brand, store, and popularity. When the recommendation object is a knowledge point, the recommended elements include but are not limited to experts and fields related to the knowledge point, expert-related information such as nationality, gender, age, etc., books, citation resources, etc.

还应理解,多个推荐要素可以是与当前对话语句的关键词匹配的推荐要素,也可以是与当前对话语句的主题匹配的推荐要素。在识别当前对话语句中出现的多个推荐要素时,如果当前对话语句为“想要买一个便宜的电子产品”,则关键词匹配的“电子产品”、“便宜”等属于推荐要素,另外,主题匹配的“手机”、“手环”、“VR眼镜”、“性价比”等也属于推荐要素。It should also be understood that the multiple recommended elements may be recommended elements matching the keywords of the current dialogue sentence, or recommended elements matching the subject of the current dialogue sentence. When identifying multiple recommended elements that appear in the current dialogue sentence, if the current dialogue sentence is "I want to buy a cheap electronic product", then the keywords matching "electronic product" and "cheap" are recommended elements. In addition, the topic Matching "mobile phones", "bracelets", "VR glasses", and "cost-effective" are also recommended elements.

S220:在预先构建的推荐对象图谱中,查询多个推荐要素之间的关联关系,推荐对象图谱的实体指示推荐要素,推荐对象图谱的实体关系指示不同推荐要素之间的关联关系。S220: In the pre-built recommendation object map, query the association relationship between multiple recommendation elements, the entity of the recommendation object map indicates the recommendation element, and the entity relationship of the recommendation object map indicates the association relationship between different recommendation elements.

应理解,推荐对象图谱可以采用不同方式存储,推荐对象图谱包括实体以及实习关系。不同实体之间可以具有实体关系,也可以不具有实体关系。例如,上述示例中的“手机”可以与“性价品”具有某种关系,例如,某个手机品牌以性价品著称。又例如,“手机”与“VR眼镜”可以不具有关联关系。又例如,“手环”与“VR眼镜”之间具有某种关系,例如,某一可穿戴设备供应商生产或售卖“手环”和“VR眼镜”。综上,“某个手机品牌以性价品著称”、“某一可穿戴设备供应商生产或售卖手环和VR眼镜”都是当前对话语句中并不存在,但是与当前对话语句的意图或偏好密切关联的信息,也就是说,通过推荐对象图谱召回了更多且更隐含的意图信息或偏好信息。It should be understood that the recommended object graph can be stored in different ways, and the recommended object graph includes entities and internship relationships. There may or may not be an entity relationship between different entities. For example, "mobile phone" in the above example may have a certain relationship with "value-for-money products", for example, a certain mobile phone brand is famous for value-for-money products. For another example, "mobile phone" and "VR glasses" may not have an association relationship. For another example, there is a certain relationship between "bracelet" and "VR glasses". For example, a wearable device supplier produces or sells "bracelet" and "VR glasses". To sum up, "a certain mobile phone brand is famous for its cost-effective products" and "a certain wearable device supplier produces or sells bracelets and VR glasses" do not exist in the current dialogue sentence, but are related to the intention or Prefer closely related information, that is, more and more implicit intent information or preference information is recalled through the recommended object graph.

S230:至少基于多个推荐要素及其关联关系之间的上下文语义关联,构建当前对话语句的当前主题的偏好表示。S230: Construct a preference representation of the current topic of the current dialogue sentence based at least on the contextual semantic association between the plurality of recommended elements and their associations.

应理解,可以通过预先训练的自注意力矩阵表示多个推荐要素及其关联关系之间的上下文语义关联,得到当前对话语句的当前主题的偏好表示,作为可靠且全面的中间表示,这样的中间表示有利于从监督条件中学习到泛化能力更强的模型参数。It should be understood that the pre-trained self-attention matrix can be used to represent the contextual semantic association between multiple recommended elements and their associations, and the preference representation of the current topic of the current dialogue sentence can be obtained as a reliable and comprehensive intermediate representation. Such an intermediate Representation is conducive to learning model parameters with stronger generalization ability from supervised conditions.

S240:基于当前主题的偏好表示,预测当前主题的下一主题。S240: Based on the preference representation of the current topic, predict the next topic of the current topic.

应理解,下一主题可以是当前主题的下级主题,或者,当前主题的同级主题,但是属于不同的领域或子领域。例如,当前主题为“电子产品”,当前主题的下级主题为“手机”或“笔记本电脑”或“智能手环”,相应地,在对话推荐过程中,由于“电子产品”过于宽泛而不利于准确确定推荐对象时,在下一主题表示“手机”等的情况下,有利于更准确确定推荐对象。另外,在当前主题与下一主题属于同一级别时,例如,当前主题为“手机”时,由于备选推荐对象受限等原因,“手机”不是主推的场景(例如,采用对话推荐系统的商家不是手机售卖商家或厂商),下一主题为“智能音箱”或“VR眼镜”,这是,当前主题与下一主题属于同一级别,都属于“电子产品”,并且下一主题与当前主题属于不同产品领域,这是如果采用对话推荐系统的商家可以售卖“智能音箱”或“VR眼镜”,则可以将“智能音箱”或“VR眼镜”作为推荐对象进行推荐。可替代地,如果采用对话推荐系统的商家不售卖“智能音箱”或“VR眼镜”,则对话策略模块(其能够调用图5的推荐模块和预测模块)可以从下一主题预测下一主题的下一主题,直到下一主题匹配采用对话推荐系统的商家售卖的产品。It should be understood that the next topic may be a subtopic of the current topic, or a topic of the same level as the current topic, but belonging to a different field or subfield. For example, the current topic is "electronic products", and the subordinate topics of the current topic are "mobile phone" or "laptop computer" or "smart bracelet". When accurately specifying the recommended object, it is advantageous to more accurately determine the recommended object when the next topic indicates "mobile phone" or the like. In addition, when the current topic and the next topic belong to the same level, for example, when the current topic is "mobile phone", "mobile phone" is not the main recommended scene due to the limited number of alternative recommendation objects (for example, merchants using dialogue recommendation system Not a mobile phone seller or manufacturer), the next topic is "smart speaker" or "VR glasses", that is, the current topic and the next topic belong to the same level, both belong to "electronic products", and the next topic and the current topic belong to In different product fields, if a merchant using a dialogue recommendation system can sell "smart speakers" or "VR glasses", then "smart speakers" or "VR glasses" can be recommended as recommendation objects. Alternatively, if the merchant using the dialogue recommendation system does not sell "smart speakers" or "VR glasses", the dialogue strategy module (which can call the recommendation module and prediction module in Figure 5) can predict the next topic from the next topic The next topic until the next topic matches the products sold by merchants using the dialogue recommendation system.

S250:推荐与下一主题匹配的推荐对象。S250: Recommend a recommendation object matching the next topic.

应理解,对话策略模块可以调用自然语言生成模型(例如,GPT或GPT-2)生成用于推荐的回复语句或用于引导下一主题的回复语句。It should be understood that the dialogue strategy module may invoke a natural language generation model (for example, GPT or GPT-2) to generate a reply sentence for recommendation or a reply sentence for guiding the next topic.

在本发明实施例的方案中,在预先构建的推荐对象图谱中,查询当前对话语句的多个推荐要素之间的关联关系,召回了更多有利于推荐的信息,使得所构建的当前对话语句的当前主题的偏好表示能够更准确地反映了当前对话语句的用户的偏好和意图,进而在基于当前主题的偏好表示能够更准确地预测下一主题,在保证了推荐的准确度的同时进一步地提高了推荐效率。In the scheme of the embodiment of the present invention, in the pre-built recommendation object map, query the relationship between multiple recommended elements of the current dialogue sentence, and recall more information that is conducive to recommendation, so that the constructed current dialogue sentence The preference representation of the current topic can more accurately reflect the user's preference and intention of the current dialogue statement, and then the preference representation based on the current topic can more accurately predict the next topic, while ensuring the accuracy of the recommendation and further improving the Improve recommendation efficiency.

在另一些示例中,至少基于多个推荐要素及其关联关系之间的上下文语义关联,构建当前对话语句的当前主题的偏好表示,包括:分别生成多个推荐要素的多个初始向量表示;基于多个推荐要素的关联关系,对多个初始向量表示进行上下文语义处理,得到多个推荐要素的第一上下文语义表示;至少基于第一上下文语义表示,构建当前对话语句的当前主题的偏好表示。In some other examples, constructing a preference representation of the current topic of the current dialogue sentence based at least on the contextual semantic association between multiple recommended elements and their associations includes: respectively generating multiple initial vector representations of multiple recommended elements; based on The association relationship of multiple recommended elements, contextual semantic processing is performed on multiple initial vector representations, and the first contextual semantic representation of multiple recommended elements is obtained; at least based on the first contextual semantic representation, a preference representation of the current topic of the current dialogue sentence is constructed.

在另一些示例中,基于多个推荐要素的关联关系,对多个初始向量表示进行上下文语义处理,得到多个推荐要素的第一上下文语义表示,包括:构建多个初始向量表示的初始矩阵表示;构建多个初始向量之间的关系矩阵以及度矩阵;将初始矩阵表示、关系矩阵以及度矩阵进行编码输入到图卷积网络中,得到多个推荐要素的第一上下文语义表示,图卷积网络通过图训练数据的初始矩阵表示、关系矩阵以及度矩阵及其分类标签预先训练得到。In some other examples, based on the association relationship of multiple recommended elements, contextual semantic processing is performed on multiple initial vector representations to obtain the first contextual semantic representation of multiple recommended elements, including: constructing an initial matrix representation of multiple initial vector representations ;Construct the relationship matrix and degree matrix between multiple initial vectors; encode the initial matrix representation, relationship matrix and degree matrix into the graph convolution network to obtain the first context semantic representation of multiple recommended elements, graph convolution The network is pre-trained by the initial matrix representation of the graph training data, relation matrix and degree matrix and their classification labels.

在另一些示例中,对话推荐方法还包括:生成当前对话语句的历史对话语句及其历史主题、以及对话用户偏好中的至少一者的各个第二上下文语义表示。至少基于第一上下文语义表示,构建当前对话语句的当前主题的偏好表示,包括:基于第一上下文语义表示、各个第二上下文语义表示输入到预先训练的自注意力层中,得到当前对话语句的当前主题的偏好表示,自注意力层用于对第一上下文语义表示以及各个第二上下文语义表示进行基于对话主题的上下文表示。In some other examples, the dialog recommendation method further includes: generating each second contextual semantic representation of at least one of the current dialog sentence's historical dialog sentences and their historical topics, and dialog user preferences. Constructing the preference representation of the current topic of the current dialogue sentence based on at least the first context semantic representation, including: inputting the first context semantic representation and each second context semantic representation into a pre-trained self-attention layer to obtain the current dialogue sentence The preference representation of the current topic, the self-attention layer is used for the context representation based on the conversation topic for the first context semantic representation and each second context semantic representation.

在另一些示例中,自注意力层的输出与主题引导层的输入连接,自注意力层与主题引导层组成引导主题引导模型,主题引导模型通过不同对话语句的主题引导关系训练得到;基于当前主题的偏好表示,预测当前主题的下一主题,包括:将当前主题的偏好表示输入到主题引导层,得到当前主题的下一主题。In other examples, the output of the self-attention layer is connected to the input of the topic-guiding layer, and the self-attention layer and the topic-guiding layer form a guiding topic-guiding model. The topic-guiding model is obtained by training the topic-guiding relationship of different dialogue sentences; based on the current The preference representation of the topic predicts the next topic of the current topic, including: inputting the preference representation of the current topic into the topic guidance layer to obtain the next topic of the current topic.

图3为根据本发明的一个实施例的模型训练方法的步骤流程图。在主题引导模型的模型训练(training)阶段,可以利用配置有CPU(处理单元的示例)+GPU(加速单元的示例)架构的计算设备(例如,数据中心)基于训练样本对编码器解码器模型进行训练。诸如数据中心的计算设备可以部署在诸如专有云、私有云、或混合云的云服务器中。Fig. 3 is a flowchart of steps of a model training method according to an embodiment of the present invention. In the model training (training) stage of the topic-guided model, a computing device (for example, a data center) configured with a CPU (an example of a processing unit) + GPU (an example of an acceleration unit) architecture can be used to train the encoder-decoder model based on training samples to train. Computing devices such as data centers may be deployed in cloud servers such as dedicated clouds, private clouds, or hybrid clouds.

本实施例的模型训练方法包括:The model training method of this embodiment includes:

S310:获取对话语句样本及其对话语句样本的引导主题。S310: Acquiring the dialogue statement sample and the guide topic of the dialogue statement sample.

S320;确定对话语句样本中的多个推荐要素。S320: Determine multiple recommended elements in the dialogue sentence sample.

S330:在预先构建的推荐对象图谱中,查询多个推荐要素之间的关联关系,推荐对象图谱的实体指示推荐要素,推荐对象图谱的实体关系指示不同推荐要素之间的关联关系。S330: In the pre-built recommendation object map, query the association relationship between multiple recommendation elements, the entity of the recommendation object map indicates the recommendation element, and the entity relationship of the recommendation object map indicates the association relationship between different recommendation elements.

S340:至少基于多个推荐要素及其关联关系之间的上下文语义关联作为输入,以引导主题作为监督条件,对主题引导模型进行训练。S340: Based on at least the contextual semantic association between multiple recommended elements and their associations as input, and using the guiding topic as a supervision condition, train the topic guiding model.

在本发明实施例的方案中,在预先构建的推荐对象图谱中,查询对话语句样本的多个推荐要素之间的关联关系,召回了更多有利于推荐的信息,使得多个推荐要素及其关联关系之间的上下文语义关联能够更准确地反映了对话语句样本的用户的偏好和意图,使训练后得到的主题引导模型,能够更准确地执行主题引导,进而提高了推荐效率。In the solution of the embodiment of the present invention, in the pre-built recommendation object map, query the relationship between multiple recommended elements of the dialogue statement sample, and recall more information that is conducive to recommendation, so that multiple recommended elements and their The contextual semantic association between association relations can more accurately reflect the user's preferences and intentions of the dialogue sentence samples, so that the topic guidance model obtained after training can perform topic guidance more accurately, thereby improving the recommendation efficiency.

应理解,在主题引导模型的端到端训练阶段,主题引导模型的输入包括多个推荐要素及其关联关系之间的上下文语义关联,作为监督条件的引导主题为对话语句样本所对应的当前主题的下一主题,下一主题可以是当前主题的下级主题,或者,当前主题的同级主题,但是属于不同的领域或子领域。It should be understood that in the end-to-end training phase of the topic-guided model, the input of the topic-guided model includes the contextual semantic association between multiple recommended elements and their associations, and the guiding topic used as the supervision condition is the current topic corresponding to the dialogue sentence sample The next topic of , the next topic can be a subtopic of the current topic, or a topic of the same level as the current topic, but belongs to a different field or subfield.

图4为图2和图3的实施例所适用的对话推荐系统的示意性框图。图4的对话推荐模型包括诸如图编码器的图向量编码模块410、诸如文本向量编码器的文本编码模型420、主题引导模型430、推荐模块440、以及自然语言生成(Natural Language Generation,NLG)模块450。FIG. 4 is a schematic block diagram of a dialogue recommendation system to which the embodiments of FIG. 2 and FIG. 3 are applied. The dialog recommendation model of Figure 4 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 (Natural Language Generation, NLG) module 450.

图编码模块410通过诸图卷积网络(Graph Convolutional Networks,GCN)的图编码器,对子图进行编码,得到第一上下文表示。例如,子图可以从推荐对象图谱查询到。作为知识图谱的推荐对象图谱包括实体和实体关系,推荐对象图谱的实体指示推荐要素,推荐对象图谱的实体关系指示不同推荐要素之间的关联关系。不同的实体之间可以具有实体关系,也可以不具有实体关系。推荐对象图谱可以根据与推荐对象相关的经验知识或数据构建。The graph encoding module 410 encodes the sub-graph through graph encoders of various graph convolutional networks (Graph Convolutional Networks, GCN) to obtain the first context representation. For example, subgraphs can be queried from the recommended object graph. The recommended object graph as a knowledge graph includes entities and entity relationships. The entities in the recommended object graph indicate recommended elements, and the entity relationships in the recommended object graph indicate the relationship between different recommended elements. There may or may not be an entity relationship between different entities. The recommended object graph can be constructed based on empirical knowledge or data related to recommended objects.

具体而言,推荐对象图谱中的各个实体可以是与推荐对象本身或者与推荐对象相关的对象。例如,在推荐对象为商品时,各个实体包括但不限于标识、品牌特征、类别特征、店铺信息、热度指标、出厂信息、价格特征等。相应地,各个实体关系包括但不限于商品的标识、商品的品牌特征、商品的类别特征、商品的店铺信息、商品的热度指标、商品的出厂信息、商品的价格特征等。一般而言,如果一提到某个商品,很容易想到这个商品的某种主题特征,则说明这个商品与这个主题特征的相关度较高。例如,如果一提到手机,人们很容易想到手机的某个品牌及价格,则说明这个品牌和价格的主题特征与手机的关系比较密切。Specifically, each entity in the recommended object graph may be an object related to the recommended object itself or related to the recommended object. For example, when the recommendation object is a product, each entity includes but not limited to logo, brand feature, category feature, store information, popularity index, factory information, price feature, etc. Correspondingly, each entity relationship includes, but is not limited to, product identification, product brand features, product category features, product store information, product popularity indicators, product ex-factory information, product price features, and the like. Generally speaking, if one mentions a product, it is easy to think of a certain theme feature of the product, which means that the product has a high degree of correlation with the theme feature. For example, if one mentions a mobile phone, people easily think of a certain brand and price of the mobile phone, which means that the theme characteristics of the brand and price are closely related to the mobile phone.

子图中的各个实体是推荐对象图谱中的各个实体的子集,可以通过图查询模块415在推荐对象图谱中查询。例如,首先,识别当前对话语句中出现的多个推荐要素,例如,当前对话语句为“想要买一个便宜的电子产品”,则“电子产品”、“便宜”都是推荐要素。相应地,在推荐对象图谱中,查询与各个推荐要素匹配(关键词匹配或主题匹配)的实体。Each entity in the sub-graph is a subset of each entity in the recommended object graph, and can be queried in the recommended object graph through the graph query module 415 . For example, firstly, multiple recommended elements appearing in the current dialogue sentence are identified. For example, if the current dialogue sentence is "I want to buy a cheap electronic product", then "electronic product" and "cheap" are recommended elements. Correspondingly, in the graph of recommended objects, query entities that match (keyword match or topic match) with each recommended element.

例如,如果“电子产品”在推荐对象图谱的实体中,则属于关键词匹配,相应地,从推荐对象图谱中,提取“电子产品”这个实体。可替代地,如果“电子产品”不在推荐对象图谱的实体中,并且“手机”在推荐对象图谱的实体中,因为“手机”属于“电子产品”,则属于主题匹配,相应地,从推荐对象图谱中,提取“手机”这个实体。可替代地,如果“电子产品”和“手机”都在推荐对象图谱的实体中,则从推荐对象图谱中,提取“电子产品”和“手机”。For example, if "electronic product" is in the entity of the recommended object graph, it belongs to keyword matching, and accordingly, the entity "electronic product" is extracted from the recommended object graph. Alternatively, if "electronic product" is not in the entity of the recommended object graph, and "mobile phone" is in the entity of the recommended object graph, because "mobile phone" belongs to "electronic product", it belongs to the topic matching, correspondingly, from the recommended object In the map, extract the entity "mobile phone". Alternatively, if both "electronic product" and "mobile phone" are entities in the recommended object graph, then "electronic product" and "mobile phone" are extracted from the recommended object graph.

应理解,可以从推荐对象图谱中的所有实体中,确定多个推荐要素,多个推荐要素可以比从当前对话语句中识别出的推荐要素的数量更多。It should be understood that multiple recommended elements may be determined from all entities in the recommended object graph, and the multiple recommended elements may be more than the number of recommended elements identified from the current dialogue sentence.

然后,从推荐对象图谱中,获取(召回)多个推荐要素之间的关联关系。例如,“想要买一个便宜的电子产品”中未包括具体的手机品牌,但是,通过从推荐对象图谱中可以获取作为实体的“手机”以及与“手机”相关的“便宜”的“品牌”,从而通过推荐对象图谱提高了比当前对话语句自身更多的意图偏好信息,更多的意图偏好信息有利于更精准的推荐。Then, from the recommended object graph, the association relationship between multiple recommended elements is obtained (recalled). For example, "I want to buy a cheap electronic product" does not include a specific mobile phone brand, but the "mobile phone" as an entity and the "cheap" "brand" related to "mobile phone" can be obtained from the recommended object map, Therefore, more intention preference information than the current dialogue sentence itself is improved through the recommended object map, and more intention preference information is conducive to more accurate recommendations.

此外,文本编码模型420通过诸如BERT编码器的文本编码器,对当前对话语句的历史对话语句及其历史主题、以及对话用户偏好中的至少一者进行编码,得到各自的第二上下文表示。例如,将历史对话语句输入到BERT编码器,得到历史对话语句的第二上下文表示;将对话用户偏好输入到BERT编码器,得到对话用户偏好的第二上下文表示;将对话用户偏好的历史主题输入到BERT编码器,得到历史主题的第二上下文表示。In addition, the text encoding model 420 uses a text encoder such as a BERT encoder to encode at least one of the historical dialogue sentences of the current dialogue statement, its historical topics, and dialogue user preferences to obtain respective second context representations. For example, input the historical dialog sentences into the BERT encoder to obtain the second context representation of the historical dialog sentences; input the dialog user preferences into the BERT encoder to obtain the second context representation of the dialog user preferences; input the historical topics of the dialog user preferences to the BERT encoder to obtain a second contextual representation of historical topics.

在一个对话示例中,采用作为图编码器的示例的GCN编码器可以采用(公式1)进行编码:In a dialog example, a GCN encoder as an example of a graph encoder can be encoded using (Equation 1):

Figure BDA0003872721020000091
其中,A为邻接矩阵,D为节点的度的矩阵,
Figure BDA0003872721020000092
IN是N阶单位矩阵,
Figure BDA0003872721020000093
Figure BDA0003872721020000094
对应的度矩阵,
Figure BDA0003872721020000095
是可学习的线性转换器。应理解,GCN编码器的线性转换器采用训练样本训练得到。
Figure BDA0003872721020000091
Among them, A is the adjacency matrix, D is the matrix of the degree of the node,
Figure BDA0003872721020000092
I N is an identity matrix of order N,
Figure BDA0003872721020000093
Yes
Figure BDA0003872721020000094
The corresponding degree matrix,
Figure BDA0003872721020000095
is a learnable linear converter. It should be understood that the linear converter of the GCN encoder is trained using training samples.

进一步地,图编码模块410的第一上下文表示以及文本编码模块420的各个第二上下文表示输入到主题引导模型430。主题引导模型430可以通过端到端训练得到的分类模型。例如,主题引导模型430包括自注意力层和主题引导层,自注意力层用于拼接第一上下文表示与各个第二上下文表示,得到表示拼接上下文表示的拼接矩阵(当前主题的偏好表示的示例),然后,基于预先训练的自注意力矩阵,对拼接矩阵进行上下文语义处理,得到更可靠的语义中间表示,自注意力矩阵中的每个元素为权重值,每个元素的权重值表示每个元素对应的两个字符之间的语义相关性。Further, the first contextual representation of the graph coding module 410 and the respective second contextual representations of the textual coding module 420 are input to the topic guidance model 430 . The topic guidance model 430 may be a classification model obtained through end-to-end training. For example, the topic guidance model 430 includes a self-attention layer and a topic guidance layer, and the self-attention layer is used to concatenate the first context representation and each second context representation to obtain a concatenation matrix representing the concatenation context representation (an example of the current topic preference representation ), and 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 each Semantic correlation between two characters corresponding to elements.

然后,拼接矩阵通过诸如解码器的主题引导层的处理,得到下一主题。Then, the concatenated matrix is processed by a topic-guided layer such as a decoder to get the next topic.

通过对话策略模块判断在对象标签集合中是否存在与下一主题匹配的对象标签,如果存在,则在推荐模块440中获取与对象标签所述的推荐对象,然后将推荐对象(例如,推荐对象的文本矩阵或文本向量)和偏好表示的拼接矩阵(例如,将两者再次拼接),输入到自然语言生成模块450中,得到当前对话语句的回复语句(推荐语句),这里的自然语言生成模块450可以采用诸如GPT或者GPT-2的预训练模型实现。Judging by the dialog strategy module whether there is an object tag matching the next topic in the object tag collection, if there is, then in the recommendation module 440, the recommended object described in the object tag is obtained, and then the recommended object (for example, the recommended object's text matrix or text vector) and the splicing matrix of preference representation (for example, splicing the two again), input in the natural language generation module 450, obtain the reply sentence (recommended sentence) of current dialogue sentence, the natural language generation module 450 here It can be implemented with a pre-trained model such as GPT or GPT-2.

如果在对象标签集合中不存在与下一主题匹配的对象标签,则将下一主题(例如,下一主题的文本矩阵或文本向量)和偏好表示的拼接矩阵(例如,将两者再次拼接),输入到自然语言生成模块450中,得到当前对话语句的回复语句。If there is no object label matching 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., concatenate the two again) , input into the natural language generation module 450 to obtain the reply sentence of the current dialog sentence.

进一步地,推荐模块440可以在备选推荐对象集合中确定对应标签所属的多个备选对象标签,然后,基于多个备选推荐对象与当前主题的偏好表示的相似度,对多个备选推荐对象进行排序,然后,基于多个备选推荐对象的排序,选择多个备选推荐对象中的推荐对象进行推荐,推荐对象在多个备选推荐对象中的排序序数小于预设序数,例如,推荐首个备选推荐对象,从而通过基于相似度的排序,更加精准地进行推荐。Further, the recommendation module 440 can determine multiple candidate object tags to which the corresponding tag belongs in the set of candidate recommended objects, and then, based on the similarity between the multiple candidate recommended objects and the preference representation of the current topic, The recommended objects are sorted, and then, based on the sorting of multiple candidate recommended objects, the recommended objects among the multiple candidate recommended objects are selected for recommendation. , to recommend the first candidate recommendation object, so as to make recommendations more accurately by sorting based on similarity.

在更一般的情况下,作为推荐与下一主题匹配的推荐对象的示例,可以在下一主题与对象标签匹配时,对所述对象标签所属的推荐对象进行推荐,下一主题可以是当前主题的下级主题,在下级主题的标签与对象标签匹配时进行推荐,提高了推荐的效率。In a more general case, as an example of recommending a recommendation object that matches the next topic, when the next topic matches the object tag, the recommendation object to which the object tag belongs can be recommended, and the next topic can be the current topic The sub-topics are recommended when the tags of the sub-topics match the object tags, which improves the efficiency of recommendation.

可替代地,在下一主题与对象标签不匹配时,基于当前主题的偏好表示、以及下一主题,生成当前对话语句的回复语句。例如,如果下一主题是当前主题的下级主题,说明下级主题的标签仍然与对象标签不匹配,例如,下级主题仍然不能准确地聚焦在对象标签,从而通过回复语句再次引导下级主题,直到与一对象标签匹配为止。又例如,如果下一主题与当前主题的位于同一层级,且下一主题与当前主题属于不同的领域或子领域,则通过下一主题转换了对话主题的方向,更有利于与一对象标签匹配。Alternatively, when the next topic does not match the object label, a reply sentence to the current dialogue sentence is generated based on the preference representation of the current topic and the next topic. For example, if the next topic is a subordinate topic of the current topic, it means that the label of the subordinate topic still does not match the object label. Object tags match. For another example, if the next topic is at the same level as the current topic, and the next topic and the current topic belong to different fields or subfields, then the direction of the conversation topic is changed through the next topic, which is more conducive to matching with an object label .

应理解,在构建对象标签集合时,可首先标注备选推荐对象集合中的所有备选推荐对象的对象标签,每个备选推荐对象可以包括至少一个对象标签,然后,统计所有备选推荐对象的所有对象标签,去除重复对象标签,得到对象标签集合。It should be understood that when constructing the object label set, the object labels of all candidate recommended objects in the candidate recommended object set can be marked first, each candidate recommended object can include at least one object label, and then all the candidate recommended objects can be counted All object labels of , remove duplicate object labels, and obtain a set of object labels.

进一步地,图5示出了根据本发明的另一实施例的对话推荐装置。本实施例的对话推荐装置与图2的对话推荐方法对应,包括:Further, Fig. 5 shows a dialog recommendation device according to another embodiment of the present invention. The dialogue recommendation device in this embodiment corresponds to the dialogue recommendation method in Figure 2, including:

确定模块510,确定当前对话语句中的多个推荐要素。A determining module 510, determining multiple recommended elements in the current dialogue sentence.

查询模块520,在预先构建的推荐对象图谱中,查询所述多个推荐要素之间的关联关系,所述推荐对象图谱的实体指示推荐要素,所述推荐对象图谱的实体关系指示不同推荐要素之间的关联关系。The query module 520, in the pre-built recommended object graph, queries the association relationship between the multiple recommended elements, the entity of the recommended object graph indicates the recommended element, and the entity relationship of the recommended object graph indicates the relationship between different recommended elements. relationship between.

构建模块530,至少基于所述多个推荐要素及其关联关系之间的上下文语义关联,构建所述当前对话语句的当前主题的偏好表示。The construction module 530 constructs a preference representation of the current topic of the current dialogue sentence based at least on the contextual semantic association between the plurality of recommended elements and their associations.

预测模块540,基于所述当前主题的偏好表示,预测所述当前主题的下一主题;Prediction module 540, based on the preference representation of the current topic, predict the next topic of the current topic;

推荐模块550,推荐与所述下一主题匹配的推荐对象。A recommending module 550, recommending recommended objects matching the next topic.

在本发明实施例的方案中,在预先构建的推荐对象图谱中,查询当前对话语句的多个推荐要素之间的关联关系,召回了更多有利于推荐的信息,使得所构建的当前对话语句的当前主题的偏好表示能够更准确地反映了当前对话语句的用户的偏好和意图,进而在基于当前主题的偏好表示能够更准确地预测下一主题,在保证了推荐的准确度的同时进一步地提高了推荐效率。In the scheme of the embodiment of the present invention, in the pre-built recommendation object map, query the relationship between multiple recommended elements of the current dialogue sentence, and recall more information that is conducive to recommendation, so that the constructed current dialogue sentence The preference representation of the current topic can more accurately reflect the user's preference and intention of the current dialogue statement, and then the preference representation based on the current topic can more accurately predict the next topic, while ensuring the accuracy of the recommendation and further improving the Improve recommendation efficiency.

在另一些示例中,推荐模块具体用于:在所述下一主题与对象标签匹配时,对所述对象标签所属的推荐对象进行推荐。In some other examples, the recommendation module is specifically configured to: when the next topic matches the object tag, recommend the recommended object to which the object tag belongs.

在另一些示例中,推荐模块具体用于:确定具有所述对象标签的多个备选推荐对象;基于所述多个备选推荐对象与所述当前主题的偏好表示的相似度,对所述多个备选推荐对象进行排序;基于多个备选推荐对象的排序,选择所述多个备选推荐对象中的推荐对象进行推荐,所述推荐对象在所述多个备选推荐对象中的排序序数小于预设序数。In some other examples, the recommendation module is specifically configured to: determine a plurality of candidate recommended objects with the object label; Sorting a plurality of candidate recommendation objects; based on the ranking of the plurality of candidate recommendation objects, selecting a recommendation object among the plurality of candidate recommendation objects for recommendation, and the recommendation object among the plurality of candidate recommendation objects The sort ordinal is less than the default ordinal.

在另一些示例中,对话推荐装置还包括:对话生成模块,在所述下一主题与所述对象标签不匹配时,基于所述当前主题的偏好表示、以及所述下一主题,生成所述当前对话语句的回复语句。In some other examples, the dialog recommendation device further includes: a dialog generation module that generates the The reply statement for the current conversation statement.

在另一些示例中,构建模块具体用于:分别生成所述多个推荐要素的多个初始向量表示;基于所述多个推荐要素的关联关系,对所述多个初始向量表示进行上下文语义处理,得到所述多个推荐要素的第一上下文语义表示;至少基于所述第一上下文语义表示,构建所述当前对话语句的当前主题的偏好表示。In some other examples, the construction module is specifically configured to: respectively generate multiple initial vector representations of the multiple recommended elements; perform context semantic processing on the multiple initial vector representations based on the association relationship of the multiple recommended elements , obtaining a first contextual semantic representation of the plurality of recommended elements; constructing a preference representation of a current topic of the current dialogue sentence based at least on the first contextual semantic representation.

在另一些示例中,构建模块具体用于:构建所述多个初始向量表示的初始矩阵表示;构建所述多个初始向量之间的关系矩阵以及度矩阵;将所述初始矩阵表示、所述关系矩阵以及所述度矩阵进行编码输入到图卷积网络中,得到所述多个推荐要素的第一上下文语义表示,所述图卷积网络通过图训练数据的初始矩阵表示、关系矩阵以及度矩阵及其分类标签预先训练得到。In some other examples, the construction module is specifically configured to: construct an initial matrix representation represented by the multiple initial vectors; construct a relationship matrix and a degree matrix among the multiple initial vectors; construct the initial matrix representation, the The relationship matrix and the degree matrix are encoded and input into the graph convolutional network to obtain the first contextual semantic representation of the plurality of recommended elements. The graph convolutional network uses the initial matrix representation of the graph training data, the relationship matrix and the The matrix and its classification labels are pre-trained.

在另一些示例中,构建模块还用于:生成所述当前对话语句的历史对话语句及其历史主题、以及对话用户偏好中的至少一者的各个第二上下文语义表示。构建模块具体用于:基于所述第一上下文语义表示、所述各个第二上下文语义表示输入到预先训练的自注意力层中,得到所述当前对话语句的当前主题的偏好表示,所述自注意力层用于对所述第一上下文语义表示以及所述各个第二上下文语义表示进行基于对话主题的上下文表示。In some other examples, the building module is further configured to: generate each second contextual semantic representation of at least one of the historical dialog sentences of the current dialog sentence, their historical topics, and dialog user preferences. The building module is specifically used for: inputting the first contextual semantic representation and the second contextual semantic representations into a pre-trained self-attention layer to obtain the preference representation of the current topic of the current dialog statement, and the self-attention layer The attention layer is used to perform contextual representation based on dialogue topics for the first contextual semantic representation and each of the second contextual semantic representations.

在另一些示例中,所述自注意力层的输出与主题引导层的输入连接,所述自注意力层与所述主题引导层组成引导主题引导模型,所述主题引导模型通过不同对话语句的主题引导关系训练得到。预测模块具体用于:将所述当前主题的偏好表示输入到主题引导层,得到所述当前主题的下一主题。In some other examples, 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 form a guidance topic guidance model, and the topic guidance model passes through different dialogue sentences. Topic-guided relationship training is obtained. The prediction module is specifically configured to: input the preference representation of the current topic to the topic guidance layer to obtain the next topic of the current topic.

在另一些示例中,对话生成模块还包括:基于所述当前主题的偏好表示以及所述推荐对象,生成所述当前对话语句的回复语句。In some other examples, the dialogue generation module further includes: generating a reply statement to the current dialogue statement based on the preference expression of the current topic and the recommended object.

本实施例的装置用于实现前述多个方法实施例中相应的方法,并具有相应的方法实施例的有益效果,在此不再赘述。此外,本实施例的装置中的各个模块的功能实现均可参照前述方法实施例中的相应部分的描述,在此亦不再赘述。The device of this embodiment is used to implement the corresponding methods in the foregoing multiple method embodiments, and has the beneficial effects of the corresponding method embodiments, so details are not repeated here. In addition, for the function implementation of each module in the apparatus of this embodiment, reference may be made to the description of corresponding parts in the foregoing method embodiments, and details are not repeated here.

图6为根据本发明的另一实施例的模型训练装置的结构框图。Fig. 6 is a structural block diagram of a model training device according to another embodiment of the present invention.

本实施例的模型训练装置与图3的模型训练方法对应,包括:The model training device of this embodiment corresponds to the model training method in Figure 3, including:

获取模块610,获取对话语句样本及其所述对话语句样本的引导主题。Obtaining module 610, acquiring a dialogue statement sample and a leading topic of the dialogue statement sample.

确定模块620,确定所述对话语句样本中的多个推荐要素。The determination module 620 is to determine a plurality of recommended elements in the dialogue sentence sample.

查询模块630,在预先构建的推荐对象图谱中,查询所述多个推荐要素之间的关联关系,所述推荐对象图谱的实体指示推荐要素,所述推荐对象图谱的实体关系指示不同推荐要素之间的关联关系。The query module 630, in the pre-built recommended object graph, queries the association relationship between the multiple recommended elements, the entity of the recommended object graph indicates the recommended element, and the entity relationship of the recommended object graph indicates the relationship between different recommended elements relationship between.

训练模块640,至少基于所述多个推荐要素及其关联关系之间的上下文语义关联作为输入,以所述引导主题作为监督条件,对主题引导模型进行训练。The training module 640 is at least based on the contextual semantic association between the plurality of recommended elements and their associations as input, and uses the guiding topic as a supervision condition to train the topic guidance model.

在本发明实施例的方案中,在预先构建的推荐对象图谱中,查询对话语句样本的多个推荐要素之间的关联关系,召回了更多有利于推荐的信息,使得多个推荐要素及其关联关系之间的上下文语义关联能够更准确地反映了对话语句样本的用户的偏好和意图,使训练后得到的主题引导模型,能够更准确地执行主题引导,进而提高了推荐效率。In the solution of the embodiment of the present invention, in the pre-built recommendation object map, query the relationship between multiple recommended elements of the dialogue statement sample, and recall more information that is conducive to recommendation, so that multiple recommended elements and their The contextual semantic association between association relations can more accurately reflect the user's preferences and intentions of the dialogue sentence samples, so that the topic guidance model obtained after training can perform topic guidance more accurately, thereby improving the recommendation efficiency.

参照图7,示出了根据本发明的另一实施例的电子设备的结构示意图,本发明具体实施例并不对电子设备的具体实现做限定。Referring to FIG. 7 , it shows a schematic structural diagram of an electronic device according to another embodiment of the present invention. The specific embodiment of the present invention does not limit the specific implementation of the electronic device.

如图7所示,该电子设备可以包括:处理器(processor)702、通信接口(Communications Interface)704、存储有程序710的存储器(memory)706、以及通信总线708。As shown in FIG. 7 , the electronic device may include: a processor (processor) 702 , a communication interface (Communications Interface) 704 , a memory (memory) 706 storing a program 710 , and a communication bus 708 .

处理器、通信接口、以及存储器通过通信总线完成相互间的通信。The processor, the communication interface, and the memory communicate with each other through the communication bus.

通信接口,用于与其它电子设备或服务器进行通信。The communication interface is used for communicating with other electronic devices or servers.

处理器,用于执行程序,具体可以执行上述方法实施例中的相关步骤。The processor is configured to execute the program, and specifically may execute the relevant steps in the foregoing method embodiments.

具体地,程序可以包括程序代码,该程序代码包括至少一可执行指令。Specifically, the program may include program code, and the program code includes at least one executable instruction.

处理器可能是处理器CPU,或者是特定集成电路ASIC(Application SpecificIntegrated Circuit),或者是被配置成实施本发明实施例的一个或多个集成电路。智能设备包括的一个或多个处理器,可以是同一类型的处理器,如一个或多个CPU;也可以是不同类型的处理器,如一个或多个CPU以及一个或多个ASIC。The processor may be a CPU, or an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present invention. The one or more processors included in the smart device may be of the same type, such as one or more CPUs, or may be different types of processors, such as one or more CPUs and one or more ASICs.

存储器,用于存放程序。存储器可能包含高速RAM存储器,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。Memory for storing programs. The memory may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

程序具体可以用于使得处理器执行以下图2的对话推荐方法或图3的模型训练方法。Specifically, the program can be used to make the processor execute the following dialog recommendation method in FIG. 2 or the model training method in FIG. 3 .

此外,程序中各步骤的具体实现可以参见上述方法实施例中的相应步骤和单元中对应的描述,在此不赘述。所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的设备和模块的具体工作过程,可以参考前述方法实施例中的对应过程描述,在此不再赘述。In addition, for the specific implementation of each step in the program, refer to the corresponding descriptions in the corresponding steps and units in the above method embodiments, and details are not repeated here. Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process of the above-described devices and modules can refer to the corresponding process description in the foregoing method embodiments, and details are not repeated here.

需要指出,根据实施的需要,可将本发明实施例中描述的各个部件/步骤拆分为更多部件/步骤,也可将两个或多个部件/步骤或者部件/步骤的部分操作组合成新的部件/步骤,以实现本发明实施例的目的。It should be pointed out that, according to implementation requirements, each component/step described in the embodiment of the present invention can be divided into more components/steps, and two or more components/steps or partial operations of components/steps can also be combined into New components/steps to achieve the purpose of the embodiments of the present invention.

上述根据本发明实施例的方法可在硬件、固件中实现,或者被实现为可存储在记录介质(诸如CD ROM、RAM、软盘、硬盘或磁光盘)中的软件或计算机代码,或者被实现通过网络下载的原始存储在远程记录介质或非暂时机器可读介质中并将被存储在本地记录介质中的计算机代码,从而在此描述的方法可被存储在使用通用计算机、专用处理器或者可编程或专用硬件(诸如ASIC或FPGA)的记录介质上的这样的软件处理。可以理解,计算机、处理器、微处理器控制器或可编程硬件包括可存储或接收软件或计算机代码的存储组件(例如,RAM、ROM、闪存等),当所述软件或计算机代码被计算机、处理器或硬件访问且执行时,实现在此描述的方法。此外,当通用计算机访问用于实现在此示出的方法的代码时,代码的执行将通用计算机转换为用于执行在此示出的方法的专用计算机。The above method according to the embodiment 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 CD ROM, RAM, floppy disk, hard disk, or magneto-optical disk), or implemented by Computer code downloaded from a network that is originally stored on a remote recording medium or a non-transitory machine-readable medium and will be stored on a local recording medium so that the methods described herein can be stored on a computer code using a general-purpose computer, a dedicated processor, or a programmable Such software processing on a recording medium of dedicated hardware such as ASIC or FPGA. It will be appreciated that a computer, processor, microprocessor controller, or programmable hardware includes memory components (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code that, when When accessed and executed by a processor or hardware, implements the methods described herein. Furthermore, when a general purpose computer accesses code for implementing the methods shown herein, execution of the code transforms the general purpose computer into a special purpose computer for performing the methods shown herein.

本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及方法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明实施例的范围。Those skilled in the art can appreciate that the units and method steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the embodiments of the present invention.

以上实施方式仅用于说明本发明实施例,而并非对本发明实施例的限制,有关技术领域的普通技术人员,在不脱离本发明实施例的精神和范围的情况下,还可以做出各种变化和变型,因此所有等同的技术方案也属于本发明实施例的范畴,本发明实施例的专利保护范围应由权利要求限定。The above embodiments are only used to illustrate the embodiments of the present invention, rather than to limit the embodiments of the present invention. Those of ordinary skill in the relevant technical field can also make various Changes and modifications, so all equivalent technical solutions also belong to the category 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 (14)

1. A conversation recommendation method comprising:
determining a plurality of recommendation elements in the current dialogue statement;
querying the incidence relation among the plurality of recommended elements in a pre-constructed recommended object map, wherein the entity of the recommended object map indicates the recommended elements, and the entity relation of the recommended object map indicates the incidence relation among different recommended elements;
constructing a preference representation of a current topic of the current dialog statement based on at least the contextual semantic association between the plurality of recommended elements and their associations;
predicting a next topic for the current topic based on the preferred representation of the current topic;
recommending the recommended object matched with the next theme.
2. The method of claim 1, wherein the recommending the recommended object that matches the next topic comprises:
and recommending the recommended object to which the object tag belongs when the next theme is matched with the object tag.
3. The method of claim 2, wherein the recommending the recommended object to which the object tag belongs comprises:
determining a plurality of candidate recommended objects with the object tags;
ranking the plurality of candidate recommended objects based on similarity of the plurality of candidate recommended objects to the preference representation of the current topic;
and selecting a recommended object from the multiple candidate recommended objects for recommendation based on the sequence of the multiple candidate recommended objects, wherein the sequence ordinal of the recommended object in the multiple candidate recommended objects is smaller than a preset ordinal.
4. The method of claim 2, wherein the method further comprises:
and when the next theme is not matched with the object label, generating a reply sentence of the current conversation sentence based on the preference representation of the current theme and the next theme.
5. The method of claim 1, wherein said constructing a preferred representation of a current topic of the current conversational sentence based at least on contextual semantic associations between the plurality of recommended elements and their associations comprises:
generating a plurality of initial vector representations of the plurality of recommended elements, respectively;
performing context semantic processing on the plurality of initial vector representations based on the association relation of the plurality of recommended elements to obtain a first context semantic representation of the plurality of recommended elements;
constructing a preference representation of a current topic of the current conversational sentence based on at least the first contextual semantic representation.
6. The method of claim 5, wherein the context semantic processing the initial vector representations based on the association of the recommended elements to obtain a first context semantic representation of the recommended elements comprises:
constructing an initial matrix representation of the plurality of initial vector representations;
constructing a relation matrix and a degree matrix among the plurality of initial vectors;
and coding and inputting the initial matrix representation, the relation matrix and the degree matrix into a graph convolution network to obtain a first context semantic representation of the plurality of recommended elements, wherein the graph convolution network is obtained by pre-training the initial matrix representation, the relation matrix, the degree matrix and classification labels of graph training data.
7. The method of claim 5, wherein the method further comprises:
generating respective second contextual semantic representations of at least one of historical conversation sentences and historical topics thereof, and conversational user preferences of the current conversation sentence;
the constructing of a preference representation of a current topic of the current conversational sentence based on at least the first contextual semantic representation comprises:
and inputting the first context semantic representation and each second context semantic representation into a pre-trained self-attention layer to obtain preference representation of the current topic of the current dialogue statement, wherein the self-attention layer is used for performing context representation based on the dialogue topic on the first context semantic representation and each second context semantic representation.
8. The method of claim 7, wherein the output of the self-attention layer is connected with the input of a theme guide layer, the self-attention layer and the theme guide layer form a guide theme guide model, and the theme guide model is obtained by training theme guide relations of different dialog sentences;
the predicting a next topic for the current topic based on the preferred representation of the current topic comprises:
and inputting the preference representation of the current theme into a theme guide layer to obtain a next theme of the current theme.
9. The method of claim 7, wherein the method further comprises:
and generating a reply sentence of the current dialog sentence based on the preference representation of the current theme and the recommended object.
10. A model training method, comprising:
obtaining a conversation statement sample and a guide theme of the conversation statement sample;
determining a plurality of recommendation elements in the dialog sentence sample;
querying the incidence relation among the plurality of recommended elements in a pre-constructed recommended object map, wherein the entity of the recommended object map indicates the recommended elements, and the entity relation of the recommended object map indicates the incidence relation among different recommended elements;
and training a theme guide model at least based on the context semantic association among the plurality of recommended elements and the association relation thereof as input and the guide theme as a supervision condition.
11. A conversation recommendation apparatus comprising:
the determining module is used for determining a plurality of recommended elements in the current conversation sentence;
the query module is used for querying the incidence relation among the plurality of recommended elements in a pre-constructed recommended object map, wherein the entity of the recommended object map indicates the recommended elements, and the entity relation of the recommended object map indicates the incidence relation among different recommended elements;
the building module is used for building preference expression of the current theme of the current dialogue statement at least based on the context semantic association among the plurality of recommended elements and the association relation thereof;
a prediction module to predict a next topic for the current topic based on the preferred representation of the current topic;
and the recommending module recommends the recommending object matched with the next theme.
12. A model training apparatus comprising:
the acquisition module acquires a conversation statement sample and a guide theme of the conversation statement sample;
the determining module is used for determining a plurality of recommended elements in the dialogue statement sample;
the query module is used for querying the incidence relation among the plurality of recommended elements in a pre-constructed recommended object map, wherein the entity of the recommended object map indicates the recommended elements, and the entity relation of the recommended object map indicates the incidence relation among different recommended elements;
and the training module is used for training the theme guide model at least based on the context semantic association among the plurality of recommended elements and the association relations thereof as input and the guide theme as a supervision condition.
13. An electronic device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus; the memory is used for storing at least one executable instruction, and the executable instruction causes the processor to execute the corresponding operation of the method according to any one of claims 1-10.
14. A computer storage medium having stored thereon a computer program which, when executed by a processor, carries out the method of any one of claims 1-10.
CN202211201931.9A 2022-09-29 2022-09-29 Dialogue recommendation and model training method and device, electronic equipment and storage medium Pending CN115408508A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211201931.9A CN115408508A (en) 2022-09-29 2022-09-29 Dialogue recommendation and model training method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211201931.9A CN115408508A (en) 2022-09-29 2022-09-29 Dialogue recommendation and model training method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115408508A true CN115408508A (en) 2022-11-29

Family

ID=84167819

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211201931.9A Pending CN115408508A (en) 2022-09-29 2022-09-29 Dialogue recommendation and model training method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115408508A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119537540A (en) * 2024-11-08 2025-02-28 深圳市瀚力科技有限公司 Method and system for automatically replying user consultation information based on natural language

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110307478A1 (en) * 2007-11-02 2011-12-15 Thomas Pinckney Geographically localized recommendations in a computing advice facility
KR20180073910A (en) * 2016-12-23 2018-07-03 삼성전자주식회사 Display apparatus, server and control method thereof
CN110765273A (en) * 2019-09-17 2020-02-07 北京三快在线科技有限公司 Recommended document generation method and device, electronic equipment and readable storage medium
CN111127079A (en) * 2019-12-04 2020-05-08 北京奇艺世纪科技有限公司 Method, device, computer equipment and storage medium for issuing commodity resources
CN114187912A (en) * 2021-11-30 2022-03-15 中国平安人寿保险股份有限公司 Knowledge recommendation method, device, device and storage medium based on voice dialogue
CN114550705A (en) * 2022-02-18 2022-05-27 北京百度网讯科技有限公司 Dialogue recommendation method, model training method, device, equipment and medium
CN114880444A (en) * 2022-04-08 2022-08-09 中国人民大学 Dialog recommendation system based on prompt learning

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110307478A1 (en) * 2007-11-02 2011-12-15 Thomas Pinckney Geographically localized recommendations in a computing advice facility
KR20180073910A (en) * 2016-12-23 2018-07-03 삼성전자주식회사 Display apparatus, server and control method thereof
CN110765273A (en) * 2019-09-17 2020-02-07 北京三快在线科技有限公司 Recommended document generation method and device, electronic equipment and readable storage medium
CN111127079A (en) * 2019-12-04 2020-05-08 北京奇艺世纪科技有限公司 Method, device, computer equipment and storage medium for issuing commodity resources
CN114187912A (en) * 2021-11-30 2022-03-15 中国平安人寿保险股份有限公司 Knowledge recommendation method, device, device and storage medium based on voice dialogue
CN114550705A (en) * 2022-02-18 2022-05-27 北京百度网讯科技有限公司 Dialogue recommendation method, model training method, device, equipment and medium
CN114880444A (en) * 2022-04-08 2022-08-09 中国人民大学 Dialog recommendation system based on prompt learning

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
WANLING CAI: "Predicting User Intents and Satisfaction with Dialogue-based Conversational Recommendations", 《ACM》, 13 January 2020 (2020-01-13) *
王旭鹏: "基于知识图谱的人机交互话题推荐方法研究", 《中国优秀硕士学位论文全文数据库》, 15 February 2021 (2021-02-15) *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119537540A (en) * 2024-11-08 2025-02-28 深圳市瀚力科技有限公司 Method and system for automatically replying user consultation information based on natural language

Similar Documents

Publication Publication Date Title
CN111143540B (en) Intelligent question answering method, device, equipment and storage medium
CN109101537B (en) Multi-turn dialogue data classification method and device based on deep learning and electronic equipment
CN110692048B (en) Detection of task changes in sessions
CN109522483B (en) Method and device for pushing information
CN114840671B (en) Dialogue generation method, model training method, device, equipment and medium
CN113407851B (en) Method, device, equipment and medium for determining recommended information based on double-tower model
CN113190702B (en) Method and device for generating information
CN113051380B (en) Information generation method, device, electronic equipment and storage medium
CN112231569A (en) News recommendation method and device, computer equipment and storage medium
CN110858226B (en) Dialogue management method and device
CN113254637A (en) Grammar-fused aspect-level text emotion classification method and system
CN116304007A (en) An information recommendation method, device, storage medium and electronic equipment
CN112036186B (en) Corpus annotation method, device, computer storage medium and electronic device
CN114722164B (en) Intelligent comment reply method and device
CN115146607A (en) Review information emotion preference recognition model training method, recognition method and device
CN117174177B (en) Training method and device for protein sequence generation model and electronic equipment
CN112182126A (en) Model training method and device for determining matching degree, electronic equipment and readable storage medium
CN117609612A (en) Resource recommendation methods, devices, storage media and electronic equipment
CN113343714A (en) Information extraction method, model training method and related equipment
CN116187301A (en) Model generation, entity recognition method, device, electronic device and storage medium
CN111695922B (en) Potential user determination method and device, storage medium and electronic device
JP2023554210A (en) Sort model training method and apparatus for intelligent recommendation, intelligent recommendation method and apparatus, electronic equipment, storage medium, and computer program
CN115408508A (en) Dialogue recommendation and model training method and device, electronic equipment and storage medium
CN119150964A (en) Information processing method, apparatus, device, storage medium, and program product
CN112990292B (en) Method and device for generating dialogue state based on neural network

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination