Model training method, topic segmentation method in multi-turn dialogue, medium and device

CN115935182BActive Publication Date: 2026-09-18HANGZHOU NETEASE ZHIQI TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211458128.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-21
Publication Date
2026-09-18
Estimated Expiration
2042-11-21

AI Technical Summary

Benefits of technology

[0012] In this embodiment, a candidate conversation set is selected from a historical conversation set, wherein the semantic similarity between any two candidate conversations in the candidate conversation set is less than a preset threshold. Then, topic tags are generated for the candidate conversations, and the candidate conversation set is concatenated based on these topic tags to form training data. A target model is trained based on this training data, and the target model is used to segment the conversation content of multi-turn conversations into topics. Here, this embodiment utilizes the idea of ​​model training to provide a method for segmenting the conversation content of multi-turn conversations into topics. This not only segments the conversation into topics, obtaining more granular information in the dialogue, such as one or more topics involved in the conversation, but also allows for a more accurate understanding of user needs based on these topics, providing more accurate data recommendations and improving user experience. Furthermore, this embodiment uses semantic similarity to distinguish different conversations to construct candidate conversations, saving the cost of manually constructing data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115935182B_ABST
    Figure CN115935182B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure provide a model training method, a topic segmentation method in a multi-turn dialogue, a medium and an apparatus, wherein the model training method comprises: screening a candidate conversation set from a historical conversation set, wherein the semantic similarity between each two candidate conversations in the candidate conversation set is less than a preset threshold, then generating a topic label for the candidate conversation, and splicing the candidate conversation set based on the topic label to form training data, training a target model based on the training data, wherein the target model is used for topic segmentation of conversation content of a multi-turn conversation, thereby obtaining more fine-grained information in the dialogue, such as obtaining one or more topics involved in the conversation, thereby more accurately understanding the user's needs according to the obtained one or more topics, providing more accurate data recommendation for the user based on the needs, and improving the user experience. In addition, the embodiments of the present disclosure provide a computing device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this disclosure relate to the field of data processing technology, and more specifically, to model training methods, topic segmentation methods in multi-turn dialogues, media, and apparatus. Background Technology

[0002] This section is intended to provide background or context for the embodiments of this disclosure as set forth in the claims. The description herein is not intended to be a prior art simply because it is included in this section.

[0003] In related technologies, in order to gain a deeper understanding of language, the research focus in the field of language processing has gradually shifted from the level of characters, words, and sentences to larger semantic units such as paragraphs and texts. Topic segmentation has seen unprecedented development in the field of language processing and has become one of the most active research directions.

[0004] In real-life scenarios, consider a multi-turn conversation between a customer service agent and a visitor about a particular item. This conversation might involve topics such as greetings, inquiring about stock availability, confirming sizes, placing an order, confirming shipping costs, and closing remarks. Without topic segmentation, performing visitor sentiment recognition on this conversation might only yield partial information, such as indicating the visitor had concerns about shipping costs during the shipping cost confirmation. However, the visitor might actually be satisfied with the item's style and size during the size confirmation. Therefore, how to perform topic segmentation to obtain more granular information from the conversation becomes a pressing issue. Summary of the Invention

[0005] This disclosure provides a model training method, a topic segmentation method in multi-turn dialogue, a medium, and an apparatus for performing topic segmentation on a conversation to obtain more granular information from the dialogue.

[0006] In a first aspect of the present disclosure, a model training method is provided, comprising: selecting a candidate conversation set from a historical conversation set, wherein the semantic similarity between any two candidate conversations in the candidate conversation set is less than a preset threshold; generating topic tags for the candidate conversations, and concatenating the candidate conversation set based on the topic tags to form training data; and training a target model based on the training data, wherein the target model is used to perform topic segmentation on the conversation content of multi-turn conversations.

[0007] In a second aspect of the present disclosure, a topic segmentation method for multi-turn dialogue is provided, comprising: inputting the conversation content of the multi-turn dialogue into a target model, and having the target model process the content to obtain a topic segmentation result corresponding to the conversation content, wherein the target model is trained according to the model training method provided in the first aspect.

[0008] In a third aspect of the present disclosure, a computer-readable storage medium is provided, which stores computer-executable instructions that, when executed by a processor, implement the model training method provided in the first aspect, and / or implement the topic segmentation method in a multi-turn dialogue provided in the second aspect.

[0009] In a fourth aspect of the present disclosure, a model training apparatus is provided, comprising: a filtering module for filtering candidate conversation sets from a historical conversation set, wherein the semantic similarity between any two candidate conversations in the candidate conversation set is less than a preset threshold; a generation module for generating topic tags for the candidate conversations and concatenating the candidate conversation sets based on the topic tags to form training data; and a training module for training a target model based on the training data, wherein the target model is used to perform topic segmentation on the conversation content of multi-turn conversations.

[0010] In a fifth aspect of the present disclosure, a topic segmentation apparatus for multi-turn dialogue is provided, comprising: a segmentation module for inputting conversation content from a multi-turn dialogue into a target model, which processes the conversation content to obtain a topic segmentation result corresponding to the conversation content, wherein the target model is trained according to the model training method provided in the first aspect.

[0011] In a sixth aspect of the present disclosure, a computing device is provided, comprising: at least one processor and a memory; the memory storing computer execution instructions; the at least one processor executing the computer execution instructions stored in the memory, such that the at least one processor performs a model training method as provided in the first aspect, and / or, such that the at least one processor performs a topic segmentation method in a multi-turn dialogue as provided in the second aspect.

[0012] In this embodiment, a candidate conversation set is selected from a historical conversation set, wherein the semantic similarity between any two candidate conversations in the candidate conversation set is less than a preset threshold. Then, topic tags are generated for the candidate conversations, and the candidate conversation set is concatenated based on these topic tags to form training data. A target model is trained based on this training data, and the target model is used to segment the conversation content of multi-turn conversations into topics. Here, this embodiment utilizes the idea of ​​model training to provide a method for segmenting the conversation content of multi-turn conversations into topics. This not only segments the conversation into topics, obtaining more granular information in the dialogue, such as one or more topics involved in the conversation, but also allows for a more accurate understanding of user needs based on these topics, providing more accurate data recommendations and improving user experience. Furthermore, this embodiment uses semantic similarity to distinguish different conversations to construct candidate conversations, saving the cost of manually constructing data. Attached Figure Description

[0013] The above and other objects, features, and advantages of this disclosure will become readily apparent from the following detailed description of exemplary embodiments, taken in conjunction with the accompanying drawings. Several embodiments of this disclosure are illustrated in the drawings by way of example and not limitation, in which:

[0014] Figure 1 A schematic diagram illustrating an application scenario provided according to an embodiment of this disclosure is shown.

[0015] Figure 2 A schematic flowchart of a model training method according to an embodiment of the present disclosure is shown.

[0016] Figure 3 A schematic diagram of a historical session set provided according to an embodiment of the present disclosure is shown.

[0017] Figure 4 A schematic flowchart of a model training method provided according to another embodiment of the present disclosure is shown.

[0018] Figure 5 A schematic diagram illustrating session similarity according to an embodiment of the present disclosure is shown.

[0019] Figure 6 A schematic flowchart of a model training method provided according to another embodiment of the present disclosure is shown.

[0020] Figure 7 A schematic diagram of topic tags for a conversation provided according to an embodiment of the present disclosure is shown.

[0021] Figure 8 A schematic flowchart of a model training method according to yet another embodiment of the present disclosure is shown.

[0022] Figure 9 A schematic diagram of a target model provided according to an embodiment of the present disclosure is shown;

[0023] Figure 10 A schematic diagram of a target model provided according to another embodiment of the present disclosure is shown;

[0024] Figure 11 A schematic flowchart illustrating a topic segmentation method in a multi-turn dialogue according to an embodiment of the present disclosure is shown.

[0025] Figure 12 A schematic diagram of the structure of a storage medium provided according to an embodiment of the present disclosure is shown.

[0026] Figure 13A schematic diagram of the structure of a model training apparatus provided according to an embodiment of the present disclosure is shown.

[0027] Figure 14 A schematic diagram of the structure of a topic segmentation device in a multi-turn dialogue according to an embodiment of the present disclosure is shown.

[0028] Figure 15 A schematic diagram of the structure of a computing device provided according to an embodiment of the present disclosure is shown.

[0029] In the accompanying drawings, the same or corresponding reference numerals indicate the same or corresponding parts. Detailed Implementation

[0030] The principles and spirit of this disclosure will now be described with reference to several exemplary embodiments. It should be understood that these embodiments are given merely to enable those skilled in the art to better understand and implement this disclosure, and are not intended to limit the scope of this disclosure in any way. Rather, these embodiments are provided to make this disclosure more thorough and complete, and to fully convey the scope of this disclosure to those skilled in the art.

[0031] Those skilled in the art will recognize that embodiments of this disclosure can be implemented as a system, apparatus, device, method, or computer program product. Therefore, this disclosure can be specifically implemented in the following forms: entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.

[0032] According to embodiments of this disclosure, a model training method, a topic segmentation method in multi-turn dialogue, a medium, and an apparatus are proposed.

[0033] In this article, it is important to understand the following terms and their meanings:

[0034] Topic segmentation: Multi-turn conversations often involve multiple different topics. Topic segmentation refers to the identification of different topics within a conversation, thereby obtaining more granular information in the dialogue, which can be used to improve downstream text processing (such as dialogue classification, user emotion recognition, etc.).

[0035] Furthermore, the number of any elements in the accompanying drawings is for illustrative purposes only and not for limitation, and any naming is for distinction only and has no limiting meaning.

[0036] The principles and spirit of this disclosure will be explained in detail below with reference to several representative embodiments. Invention Overview

[0038] The inventors have discovered that in customer service scenarios, multi-turn dialogues between agents and visitors regarding a particular item, such as those involving greetings, inquiries about inventory, size confirmation, order placement, shipping confirmation, and closing remarks, can be categorized in various ways.

[0039] (1) Seat: Hello, how can I help you?

[0040] (2) Visitor: This dress is so cute, is it still in stock?

[0041] (3) Seating: Yes, some are available.

[0042] (4) Seating: What size do you need?

[0043] (5) Visitor: 170cm, 65kg, what size should I wear?

[0044] (6) Seating: This style runs small, so we recommend you buy size L.

[0045] (7) Visitor: Great, I'll place the order right away.

[0046] (8) Seat: Yes, thank you for your support.

[0047] (9) Visitor: Why is there a postage fee?

[0048] (10) Seating: Dear customer, we offer free shipping on orders over 99!

[0049] (11) Visitor: Never mind, I'll take another look.

[0050] (12) Seating: Okay, welcome back again.

[0051] In the multi-turn dialogue between the agent and the visitor, (1) involves a welcome greeting, (2)-(3) involve inquiring about inventory, (4)-(6) involve confirming the size, (7)-(8) involve placing an order, (9)-(10) involve confirming the postage, and (11)-(12) involve a closing remark. Assuming there is no topic segmentation, performing visitor sentiment recognition on the above dialogue might only yield partial information, such as the visitor expressing dissatisfaction with the postage when confirming it. However, the visitor was actually very satisfied with the style and size of the item when confirming the size. Therefore, it is necessary to consider how to perform topic segmentation on the conversation to obtain more granular information, such as identifying one or more topics involved in the conversation. For example, the above conversations (1)-(12) can be segmented into topics to obtain the topics involved in the conversation, such as welcome, inquiring about inventory, confirming size, placing an order, confirming postage, and closing remarks. These topics can be used to understand the user's needs more accurately. For example, it can be learned that the above visitors are satisfied with the style and size of the items when confirming the size. Then, based on this information, more accurate data recommendations can be provided to the user, such as optimizing the postage of the above items and recommending items with optimized postage to the above visitors.

[0052] Based on the idea of ​​topic segmentation in conversations, this disclosure utilizes model training to train a target model capable of topic segmentation. This target model allows for topic segmentation of conversations, yielding more granular information from the dialogue. For example, topic segmentation identifies one or more topics involved in the conversation, enabling a more precise understanding of user needs and providing more accurate data recommendations based on these needs. For instance, optimizing shipping costs for items allows recommending items with optimized shipping to visitors, thus improving user experience. Furthermore, this embodiment uses semantic similarity to distinguish different conversations to construct candidate conversations, and uses these candidate conversations to generate training data to train the target model, saving the cost of manually constructing data.

[0053] After introducing the basic principles of this disclosure, various non-limiting embodiments of this disclosure will be described in detail below.

[0054] Application Scenarios Overview

[0055] The embodiments disclosed herein are applicable to scenarios including model training scenarios and / or topic segmentation scenarios in multi-turn dialogues.

[0056] First refer to Figure 1 , Figure 1 The illustration shows an application scenario provided according to an embodiment of the present disclosure, in which the device involved includes a server 101.

[0057] When the application scenario is model training: server 101 can collect training data and deploy the model to be trained, thereby training the model based on the training data.

[0058] When the application scenario is topic segmentation in multi-turn dialogues: Server 101 stores multi-turn dialogues to be segmented and deploys trained models. Based on the relevant content of the multi-turn dialogues and the trained models, topic segmentation can be performed on the multi-turn dialogues on Server 101.

[0059] Optionally, the devices involved in the application scenario also include terminal 102, and server 101 and terminal 102 can communicate via a network.

[0060] In this scenario, a user can open an application, such as a shopping application, on terminal 102 to purchase an item and engage in conversation with an agent associated with that item to learn about its details. With the user's authorization, terminal 102 can record the conversation between the user and the agent and send the recorded conversation to server 101 for use in model training and / or for topic segmentation of the conversation.

[0061] Exemplary methods

[0062] The following is combined with Figure 1 Application scenarios, refer to Figures 2-11 This document describes a model training method and a topic segmentation method in multi-turn dialogue provided according to exemplary embodiments of this disclosure. It should be noted that the above application scenarios are shown only to facilitate understanding of the spirit and principles of this disclosure, and the embodiments of this disclosure are not limited in any way. Rather, the embodiments of this disclosure can be applied to any applicable scenario.

[0063] It should be noted that the embodiments of this disclosure can be applied to electronic devices, which can be terminals or servers, that is, the model training method and / or topic segmentation method in multi-turn dialogue provided by the exemplary embodiments of this disclosure can be executed on the terminal or server.

[0064] The terminal can be a personal digital assistant (PDA) device, a handheld device with wireless communication capabilities (such as a smartphone or tablet), a computing device (such as a personal computer or PC), an in-vehicle device, a wearable device (such as a smartwatch or smart bracelet), or a smart home device (such as a smart display device).

[0065] Servers can be monolithic servers or distributed servers spanning multiple computers or computer data centers. Servers can also be of various categories, such as, but not limited to, web servers, application servers, database servers, or proxy servers.

[0066] Optionally, a server may include hardware, software, or embedded logic components for performing suitable functions supported or implemented by the server, or a combination of two or more such components. For example, a server may be a blade server, a cloud server, or a server group consisting of multiple servers, which may include one or more of the above-mentioned categories of servers, etc.

[0067] It should be noted that the model training method and topic segmentation method in multi-turn dialogue provided by the exemplary embodiments of this disclosure can be executed on the same device or on different devices.

[0068] refer to Figure 2 , Figure 2 A schematic flowchart illustrating a model training method according to an embodiment of this disclosure is shown. Figure 2 As shown, the model training methods include:

[0069] S201. Select a candidate session set from the historical session set, wherein the semantic similarity between any two candidate sessions in the candidate session set is less than a preset threshold.

[0070] Here, the aforementioned historical conversation set includes multiple historical conversations, each of which is a conversation formed based on a question about a single item and the corresponding answer. For example, the multi-turn dialogue (1)-(12) between the agent and the visitor is a conversation formed based on a question about a single item and the corresponding answer. In this embodiment, it can be considered as a historical conversation in the aforementioned historical conversation set.

[0071] In this embodiment, if the semantic similarity between any two candidate sessions in the aforementioned candidate session set is less than a preset threshold, it indicates that the semantic similarity between the two candidate sessions is low, and the probability that they are sessions on different topics is high. This embodiment obtains multiple sessions involving a single topic to construct training data. Based on this training data, a target model for topic segmentation of multi-turn conversation content is trained. The preset threshold can be set according to actual conditions; for example, in this embodiment, 0.3 is set as the threshold.

[0072] Optionally, before selecting a candidate session set from the historical session set, this embodiment may further preprocess the historical session set. This preprocessing includes filtering preset statements and / or filtering sessions whose length exceeds a preset length. The preset statements can be set according to actual conditions. For example, in this embodiment, a welcome message (e.g., "Hello, how can I help you?") and a closing message (e.g., "Okay, welcome back again") are set with the preset statements. This filters out the welcome and closing messages from each historical session in the historical session set, allowing for a more accurate determination of the semantic similarity between the filtered historical sessions. Based on this semantic similarity, a candidate session set meeting the requirements is selected from the historical session set.

[0073] Furthermore, the aforementioned session length can be understood as the number of characters contained in the session. The aforementioned preset length is the number of characters contained, which can be set according to actual conditions. For example, in this embodiment, the aforementioned preset length can be set to contain 60 characters. This embodiment filters out sessions in the aforementioned historical session set whose session length is greater than the preset length, such as filtering out sessions in each historical session that contain more than 60 characters. Figure 3 As shown, the aforementioned historical conversation set includes conversation 1, conversation 2, conversation 3, conversation 4, and conversation 5. Conversations 1, 2, 3, and 4 with a conversation length less than or equal to a preset length (i.e., containing fewer than or equal to the preset number of characters, such as 60 characters) are more likely to involve a single topic and can be retained. Conversation 5 with a conversation length greater than the preset length (i.e., containing more than the preset number of characters, such as 60 characters) is more likely to involve multiple topics and should therefore be filtered out. This is to obtain multiple conversations involving a single topic for constructing training data.

[0074] In this embodiment, in addition to filtering preset statements and / or filtering sessions with a session length greater than a preset length, the preprocessing may also include other processing, such as filtering abnormal sessions. Abnormal sessions may include sessions containing video and / or audio, so that the candidate session set that meets the requirements can be selected more accurately from the processed historical session set.

[0075] S202. Generate topic tags for the above candidate sessions, and concatenate the above candidate session set based on the topic tags to form training data.

[0076] The aforementioned topic tags include the starting statement tag for each topic's conversation. Additionally, the topic tags also include tags for the speakers of each statement within the conversation, and tags for the middle statements within the conversation.

[0077] In this embodiment, after generating topic tags for the aforementioned candidate sessions, the candidate sessions can be concatenated one by one according to the topic tags to form the aforementioned training data. For example, taking the candidate session set as including session 1 and session 2, this embodiment can first generate topic tags for session 1 and session 2, and then concatenate session 1 and session 2 according to the topic tags, such as concatenating the statement corresponding to the starting statement tag of session 2 after the last sentence of session 1 to form the aforementioned training data.

[0078] S203. The target model is trained based on the above training data. The target model is used to segment the conversation content of multi-turn conversations into topics.

[0079] Here, in the training data, candidate sessions are used as input data for the target model, and the topic labels of the candidate sessions are used as label data for the target model. The target model is trained in a supervised manner so that the topics predicted by the target model for the candidate sessions are close to the topic labels of the candidate sessions, thereby improving the accuracy of the trained target model. In turn, the accuracy of topic segmentation prediction of the conversation content of multi-turn conversations using the trained target model is improved.

[0080] In this embodiment, a candidate conversation set is selected from a historical conversation set. Topic tags are then generated for these candidate conversations, and the candidate conversation set is concatenated based on these topic tags to form training data. This training data is then used to train a target model. The trained target model then performs topic segmentation on the content of multi-turn conversations, obtaining more granular information from the dialogue, such as one or more topics involved in the conversation. Based on these topics, the user's needs are more accurately understood, and more accurate data recommendations are provided to the user, improving the user experience. Furthermore, this embodiment uses semantic similarity to distinguish different conversations to construct candidate conversations, saving the cost of manually constructing data.

[0081] In addition, when selecting candidate conversation sets from the historical conversation set, this embodiment of the present disclosure also considers calculating the cosine similarity between historical conversations in the historical conversation set. Then, based on the cosine similarity, the semantic similarity between historical conversations in the historical conversation set is determined. Based on the semantic similarity, candidate conversation sets are selected from the historical conversation set. This achieves the purpose of constructing candidate conversations by distinguishing different dialogues based on semantic similarity, without the need for manual intervention, thus saving the cost of manually constructing data. Figure 4 This is a flowchart illustrating a model training method provided in another embodiment of the present disclosure, as shown below. Figure 4 As shown, the method includes:

[0082] S401. Calculate the cosine similarity between historical sessions in the historical session set.

[0083] Optionally, in this embodiment, when calculating the cosine similarity between historical sessions in the historical session set, the historical sessions in the set can first be vectorized to obtain the session vectors corresponding to the historical sessions. Then, based on the session vectors corresponding to the historical sessions, the cosine similarity between the historical sessions can be calculated. Here, the cosine similarity uses the cosine value of the angle between two vectors in the vector space as a measure of the magnitude of the difference between two individuals.

[0084] In this embodiment, a preset model (such as a sentence semantic similarity judgment model trained on a dual-tower network based on BERT (Sentence Embeddings using Siamese Bert-Networks, Sentence-BERT)) can be used to vectorize the historical sessions in the aforementioned historical session set, thereby obtaining the session vectors corresponding to the historical sessions.

[0085] S402. Based on the cosine similarity mentioned above, determine the semantic similarity between historical sessions in the aforementioned historical session set.

[0086] Here, in this embodiment, the cosine similarity between the aforementioned historical sessions can be used as the semantic similarity between historical sessions. Furthermore, this embodiment can also calculate other parameters, such as the Euclidean distance or Manhattan distance between historical sessions, and then determine the semantic similarity between historical sessions in the aforementioned historical session set based on the Euclidean distance or Manhattan distance. For example, the Euclidean distance between the aforementioned historical sessions can be used as the semantic similarity between historical sessions, or the Manhattan distance between the aforementioned historical sessions can be used as the semantic similarity between historical sessions, thereby meeting the different needs for calculating the semantic similarity between sessions in different scenarios.

[0087] S403. Based on the semantic similarity between historical sessions in the aforementioned historical session set, a candidate session set is selected from the aforementioned historical session set, wherein the semantic similarity between any two candidate sessions in the candidate session set is less than a preset threshold.

[0088] For example, in this embodiment, two historical sessions can be selected from the aforementioned historical session set, and it can be determined whether the semantic similarity between these two historical sessions is less than the aforementioned preset threshold. If the semantic similarity between the two historical sessions is less than the aforementioned preset threshold, then from the remaining sessions in the aforementioned historical session set excluding the two historical sessions, historical sessions with semantic similarity less than the aforementioned preset threshold with the two historical sessions are selected, until the number of historical sessions selected from the aforementioned historical session set reaches a first preset number, at which point the selection stops.

[0089] Here, in this embodiment, two historical conversations can be randomly selected from the aforementioned historical conversation set. If the semantic similarity between these two randomly selected historical conversations is less than the aforementioned preset threshold, it indicates that the semantic similarity between the two historical conversations is low, and the probability that they are conversations on different topics is high. For example Figure 5 As shown, in this embodiment, conversations 1, 2, 3, and 4 are vectorized to obtain conversation vectors corresponding to each conversation. The cosine similarity between each conversation vector is calculated and used as the semantic similarity between the conversations. If two historical conversations are randomly selected from the set, such as conversations 1 and 3, the semantic similarity between these two conversations is 0.23, which is low, indicating a high probability that conversations 1 and 3 are conversations on different topics. Further, this embodiment continues to select historical conversations from the remaining historical conversations whose semantic similarity to the two historical conversations is less than the preset threshold, until the number of historical conversations selected from the set reaches a first preset number, at which point the selection stops. Thus, a first preset number of conversations on different topics are selected from the historical conversation set as a candidate conversation set to constitute training data. This training data is then used to train a target model for topic segmentation of conversation content in multi-turn conversations, obtaining more granular information in multi-turn conversations and providing users with more accurate data recommendations. Moreover, this process requires no manual intervention, saving the cost of manually constructing data. The first preset number can be set according to actual conditions, such as 100.

[0090] Here, after determining whether the semantic similarity between the two historical conversations is less than a preset threshold, if the semantic similarity between the two historical conversations is greater than or equal to the preset threshold, it indicates that the semantic similarity between the two historical conversations is high, and the probability that they are conversations on the same topic is high. For example Figure 5As shown, the semantic similarity between conversation 1 and conversation 4 is 0.92, which is relatively high, indicating that conversation 1 and conversation 4 are likely to be conversations on the same topic. At this point, it is necessary to continue selecting historical conversations from the remaining historical conversations, i.e., selecting conversations on different topics. In this embodiment, various methods can be used to continue selecting historical conversations. For example, one of the two historical conversations can be retained, such as retaining either conversation 1 or conversation 4, i.e., retaining conversation 1 or conversation 4. From the remaining conversations, historical conversations with a semantic similarity less than the preset threshold with one of the two historical conversations (such as conversation 1 or conversation 4) can be selected until the number of selected historical conversations reaches the first preset number, at which point the selection stops. Alternatively, the two historical conversations can be deleted, such as deleting conversation 1 and conversation 4. Historical conversations can be selected from the remaining conversations, and the selected historical conversations can be used as the two historical conversations. The step of determining whether the semantic similarity between the two historical conversations is less than the preset threshold is repeated until a first preset number of conversations on different topics are obtained from the historical conversation set as a candidate conversation set, at which point the selection stops.

[0091] In addition, to reduce data resource waste, when the semantic similarity between the two historical sessions is greater than or equal to the preset threshold, this embodiment can also store the two historical sessions in two separate datasets, as described above. Figure 5 If the semantic similarity between sessions 1 and 4 is greater than or equal to the aforementioned preset threshold, then session 1 can be placed in dataset 1 and session 4 in dataset 2. Then, historical sessions are selected from the remaining sessions, and the semantic similarity between the selected historical sessions and the historical sessions in each of the aforementioned datasets is calculated. If the semantic similarity between the selected historical session and a historical session in one of the aforementioned datasets is less than the aforementioned preset threshold, then the selected historical session is stored in that dataset. Similarly, if the semantic similarity between the selected historical session and a historical session in dataset 1 is less than the aforementioned preset threshold, then the selected historical session is stored in dataset 1. Or, if the semantic similarity between the selected historical session and a historical session in dataset 2 is less than the aforementioned preset threshold, then the selected historical session is stored in dataset 2. This process continues until the number of historical sessions in each dataset reaches a second preset number, at which point the selection stops. In this way, this embodiment obtains multiple datasets from the aforementioned historical session set, and the historical sessions in each dataset can be used as candidate session sets to construct training data, reducing data resource waste. The aforementioned second preset number can be set according to actual conditions, for example, 50.

[0092] Here, after calculating the semantic similarity between the selected historical sessions and the historical sessions in each of the aforementioned datasets, if the semantic similarity between the selected historical sessions and the historical sessions in each of the aforementioned datasets is greater than or equal to the aforementioned preset threshold, this embodiment can store the selected historical sessions in a new dataset, such as... Figure 5 If the semantic similarity between selected session 2 and historical sessions in datasets 1 and 2 is greater than or equal to the preset threshold, session 2 can be placed in a new dataset, such as dataset 3. The process of selecting historical sessions continues, and the step of calculating the semantic similarity between the selected historical sessions and historical sessions in each dataset is repeated until the number of historical sessions in each dataset reaches a second preset number, at which point the selection stops. Specifically, when the semantic similarity between a selected session and sessions in existing datasets is greater than or equal to the preset threshold, the selected session is placed in a new dataset. This provides multiple datasets for constructing training data, reducing data resource waste.

[0093] S404. Generate topic tags for the above candidate sessions, and concatenate the above candidate session set based on the topic tags to form training data.

[0094] S405. The target model is trained based on the above training data. The target model is used to segment the conversation content of multi-turn conversations into topics.

[0095] The implementation methods for steps S404-S405 are described in [reference needed]. Figure 2 The relevant descriptions in the embodiments will not be repeated here.

[0096] In this embodiment, when selecting a candidate session set from the historical session set, the cosine similarity between historical sessions in the historical session set is calculated. Then, based on this cosine similarity, the semantic similarity between historical sessions in the historical session set is determined. Thus, based on the semantic similarity between historical sessions in the historical session set, a candidate session set is selected from the historical session set. This achieves the goal of constructing candidate sessions by distinguishing different dialogues based on semantic similarity, saving the cost of manually constructing data. Furthermore, this embodiment can employ various methods to select the candidate session set from the historical session set to meet different application needs.

[0097] In addition, the aforementioned topic tags include the starting statement tag for each topic's conversation, and may also include tags for the speakers of each statement within the conversation, as well as tags for the middle statements within the conversation. Different topic tags can serve as different task tags for the conversation topic segmentation results, for example... Figure 6As shown, in this embodiment, the starting statement label and the middle statement label of the conversation under each topic are set as the main task labels of the conversation topic segmentation result, and the labels of the speakers of each statement in the conversation under each topic are set as the auxiliary task labels of the conversation topic segmentation result. Thus, when training the model, auxiliary tasks can be used for multi-task learning, which improves the accuracy of the main task. For example, the auxiliary tasks help the main task find more suitable parameters during the model training process, and finally obtain a better model. Figure 6 This is a flowchart illustrating a model training method provided in another embodiment of the present disclosure, as shown below. Figure 6 As shown, the method includes:

[0098] S601. Select a candidate session set from the historical session set, wherein the semantic similarity between any two candidate sessions in the candidate session set is less than a preset threshold.

[0099] The implementation method of step S601 is described in [reference needed]. Figure 2 The relevant descriptions in the embodiments will not be repeated here.

[0100] S602. Determine the starting statement in the above candidate session, and determine the remaining statements in the above candidate session excluding the starting statement. Use the remaining statements as the intermediate statements in the above candidate session, and obtain the identity identifier of the speaker corresponding to each statement in the above candidate session.

[0101] S603. Add a starting statement tag to the starting statement in the above candidate sessions, and add an intermediate statement tag to the intermediate statements in the above candidate sessions. Based on the identity identifier of the speaker corresponding to each statement in the above candidate sessions, add the speaker's tag to each statement in the above candidate sessions to generate topic tags for the above candidate sessions. Based on the topic tags, the above candidate session set is concatenated to form training data.

[0102] Here, suppose the candidate session set selected from the above historical session set includes Figure 2In this embodiment, the starting statements in each of the candidate sessions 1, 3, and 2 can be determined. For example, the starting statement of session 1 is "Why hasn't the clothing been shipped yet?", the starting statement of session 3 is "Why is this clothing so small?", and the starting statement of session 2 is "Hello, why are there so many loose threads on this clothing?". The remaining statements in the candidate sessions, excluding the starting statements, are then used as the intermediate statements of the candidate sessions. For example, the intermediate statements of session 1 are "Hello, due to the recent epidemic, the shipment is delayed by 2 days," "Hurry up!!", etc., the intermediate statements of session 3 are "I'm very sorry, is the size not right?", "It's too tight," etc., and the intermediate statements of session 2 are "I'm very sorry, can I offer 10 yuan compensation?", "Okay," etc. Furthermore... It is possible to obtain the identity identifier of the speaker for each statement in the above candidate sessions. For example, the speaker identifier for the starting statement of session 1, "Why hasn't the clothing been shipped yet?", is a visitor; the speaker identifier for the middle statement, "Hello, due to the recent epidemic, the shipment is delayed by 2 days," is an agent, etc.; the speaker identifier for the starting statement of session 3, "Why is this clothing so small?", is a visitor; the speaker identifier for the middle statement, "I'm very sorry, is the size not suitable?", is an agent, etc.; the speaker identifier for the starting statement of session 2, "Hello, why are there so many loose threads on this clothing?", is a visitor; the speaker identifier for the middle statement, "I'm very sorry, can I offer 10 yuan compensation?", is an agent, etc.

[0103] Furthermore, in this embodiment, after determining the starting statement and intermediate statements in the candidate sessions, and obtaining the identity identifiers of the speakers corresponding to each statement in the candidate sessions, a starting statement tag can be added to the starting statement in the candidate sessions, such as according to B-TOPIC (labeling according to BIO mode); an intermediate statement tag can be added to the intermediate statements in the candidate sessions, such as I-TOPIC; and based on the identity identifiers of the speakers corresponding to each statement in the candidate sessions, a speaker tag can be added to each statement in the candidate sessions, such as adding "seat" for speakers who are agents and "visitor" for speakers who are visitors. This generates topic tags for the candidate sessions, and the candidate session set is then concatenated based on these topic tags to form training data. For example, as shown below... Figure 7 As shown.

[0104] S604. The target model is trained based on the above training data. The target model is used to segment the conversation content of multi-turn conversations into topics.

[0105] In this embodiment, the starting statement label (e.g., B-TOPIC) and the middle statement label (e.g., I-TOPIC) of each topic's conversation can be set as the main task labels for the conversation topic segmentation results. The labels of the speakers of each statement in each topic's conversation (e.g., agents and visitors) can be set as the auxiliary task labels for the conversation topic segmentation results. In this way, auxiliary tasks can be used for multi-task learning during subsequent model training, which improves the accuracy of the main task.

[0106] In this embodiment of the disclosure, taking the topic tags, which include the starting statement tag of each conversation under each topic, the speaker's tag for each statement in each conversation under each topic, and the middle statement tag of each conversation under each topic, as an example, a candidate conversation set is selected from the historical conversation set, the starting statement and the middle statement of the candidate conversation are determined, and the identity identifier of the corresponding speaker for each statement in the candidate conversation is obtained. Then, a starting statement tag is added to the starting statement of the candidate conversation, a middle statement tag is added to the middle statement of the candidate conversation, and a speaker's tag is added to each statement in the candidate conversation. Topic tags for the candidate conversation are generated, and the candidate conversation set is concatenated based on the topic tags to form training data. In this way, when performing subsequent model training, the starting statement tag and the middle statement tag of each conversation under each topic can be set as the main task tags of the conversation topic segmentation result, and the speaker's tag for each statement in each conversation under each topic can be set as the auxiliary task tags of the conversation topic segmentation result. Thus, multi-task learning is performed using auxiliary tasks, which improves the accuracy of the main task.

[0107] In addition, when training the target model based on the above training data, this embodiment of the present disclosure also considers inputting the above training data into the target model to obtain the topic segmentation result of the above training data. Then, based on the topic tags of the above candidate sessions and the topic segmentation result of the above training data, the model parameters of the target model are adjusted so that the similarity between the topic segmentation result of the above training data obtained based on the adjusted target model and the session under each topic determined based on the topic tags of the above candidate sessions reaches a preset similarity, thereby obtaining a trained target model for topic segmentation of the conversation content of multi-turn conversations. Figure 8 A schematic flowchart of a model training method provided in another embodiment of this disclosure is shown below. Figure 8 As shown, the method includes:

[0108] S801. Select a candidate session set from the historical session set, wherein the semantic similarity between any two candidate sessions in the candidate session set is less than a preset threshold.

[0109] S802. Generate topic tags for the above candidate sessions, and concatenate the above candidate session set based on the topic tags to form training data.

[0110] The implementation methods for steps S801-S802 are described in [reference needed]. Figure 2 The relevant descriptions in the embodiments will not be repeated here.

[0111] S803. Input the above training data into the target model to obtain the topic segmentation result of the above training data. The target model is used to segment the conversation content of multi-turn conversations into topics.

[0112] Here, the target model described above can include an input layer, a feature extraction layer, and an output layer. The input layer is used to vectorize the input conversations to obtain the corresponding conversation vectors. The feature extraction layer is used to extract features from the conversation vectors to obtain the hidden layer feature representation of the conversation vectors. The output layer determines the topic segmentation result corresponding to the conversation based on the hidden layer feature representation of the conversation vectors. In this embodiment, the training data can be input into the input layer to vectorize the training data and obtain the corresponding conversation vectors. Then, the feature extraction layer extracts features from the conversation vectors corresponding to the training data to obtain the hidden layer feature representation of the conversation vectors corresponding to the training data. Finally, the hidden layer feature representation of the conversation vectors corresponding to the training data is input into the output layer to obtain the topic segmentation result of the training data.

[0113] For example, such as Figure 9 As shown, in the above input layer, the input session can be converted into a vector representation in the real number space using a recurrent neural network (RNN) or a bidirectional encoder model based on self-attention, the Transformer. For example, "Why haven't the clothes been shipped yet?" can be converted into a fixed-dimensional vector e1, specifically represented as [0.67, 0.26, 0.28, ..., 0.68, 0.09, 0.13]. Then, as... Figure 7 The 14 sentences shown are represented by S1, S2, ..., S j-1 ,S j ,S j+1 ,,....S 14 Representing 14 sentences, after passing through the above input layer, we can obtain 14 vectors of the same dimension, such as e1, e2, ..., e j -1,e j, e j+1, ....,e 14In the feature extraction layer described above, an RNN or Transformer model can also be used to extract features from all vectors in the input layer, obtaining the hidden layer feature representations of the corresponding vectors, such as h1, h2, ..., h1. j -1,h j, h j+1, ....,h 14 In the output layer described above, the topic segmentation result corresponding to the session can be determined based on all the hidden layer feature representations obtained above, such as calculating the starting statement label of the session under each topic.

[0114] The output layer may include a first fully connected layer, which determines the starting statement label of the conversation under each topic based on the hidden layer feature representation of the conversation vector. In this embodiment, the hidden layer feature representation of the conversation vector corresponding to the training data can be input into the first fully connected layer to obtain the starting statement label of the conversation under each topic in the training data.

[0115] Optionally, the topic segmentation result may further include the labels of the speakers of each statement in the conversation under each topic. The output layer may also include a second fully connected layer, which determines the labels of the speakers of each statement in the conversation under each topic based on the hidden layer feature representation of the conversation vector. In this embodiment, the hidden layer feature representation of the conversation vector corresponding to the training data can be input into the first and second fully connected layers respectively to obtain the starting statement label of the conversation under each topic in the training data, and the labels of the speakers of each statement in the conversation under each topic in the training data.

[0116] Furthermore, the topic segmentation results described above may also include the intermediate statement labels of the conversations under each topic. The output layer may also include a third fully connected layer, which determines the intermediate statement labels of the conversations under each topic based on the hidden layer feature representation of the conversation vectors. The intermediate statements of the conversations under each topic are the remaining statements in the conversations under that topic, excluding the initial statement. In this embodiment, the hidden layer feature representations of the conversation vectors corresponding to the training data can be input into the first, second, and third fully connected layers respectively to obtain the initial statement labels of the conversations under each topic in the training data, the intermediate statement labels of the conversations under each topic in the training data, and the labels of the speakers for each statement in the conversations under each topic in the training data.

[0117] In this embodiment, the starting statement label and the middle statement label of each conversation under each topic can be set as the main task labels for the conversation topic segmentation result, and the labels of the speakers of each statement in each conversation under each topic can be set as the auxiliary task labels for the conversation topic segmentation result. Thus, when training the target model based on the aforementioned training data, auxiliary tasks can be used for multi-task learning to improve the accuracy of the main task. For example, ... Figure 10 As shown, S1,S2,...,S j-1 ,S j ,S j+1 ,,....S 1n Representing n sentences, after passing through the above input layer, we can obtain n vectors of the same dimension, such as e1, e2, ..., e j-1, e j, e j+1, ....,e n Then, through the aforementioned feature extraction layer, features are extracted from all vectors of the input layer to obtain the hidden layer feature representations of the corresponding vectors, such as h1, h2, ..., h1, h2, h3, h4, h5, h6, h7, h8, h9, h1, h1, h2 ...1, h2, h1, h2 j-1, h j, h j+1, ....,h n Finally, based on all the hidden layer feature representations obtained above, the topic segmentation result corresponding to the session is determined through the above output layer. For example, the hidden layer feature representation is passed to the fully connected layers of the main task and auxiliary task (such as the first fully connected layer, the second fully connected layer and the third fully connected layer above). Finally, the labels of the two tasks are calculated (such as the starting sentence label of the session under each topic above, the middle sentence label of the session under each topic in the above training data, and the label of the speaker of each sentence in the session under each topic in the above training data).

[0118] S804. Based on the topic tags of the candidate sessions and the topic segmentation results of the training data, adjust the model parameters of the target model so that the similarity between the topic segmentation results of the training data obtained based on the adjusted target model and the sessions under each topic determined based on the topic tags of the candidate sessions reaches a preset similarity.

[0119] The aforementioned preset similarity can be set according to actual conditions, such as 90%. In this embodiment, candidate sessions from the training data are input into the target model to obtain topic segmentation results corresponding to multiple candidate sessions. Then, based on the topic segmentation results and the topic tags of the candidate sessions, the model parameters of the target model are adjusted to obtain a trained target model. For example, in this embodiment, the model parameters of the target model can be adjusted according to the difference between the topic segmentation results and the topic tags of the candidate sessions, so that the similarity between the topic segmentation results of the training data obtained based on the adjusted target model and the sessions under each topic determined based on the topic tags of the candidate sessions reaches the preset similarity, and finally, the trained target model is obtained.

[0120] In this embodiment of the disclosure, the above-mentioned training data is input into the above-mentioned target model to obtain the topic segmentation result of the above-mentioned training data. Then, according to the topic tags of the above-mentioned candidate sessions and the topic segmentation result of the above-mentioned training data, the model parameters of the above-mentioned target model are adjusted so that the similarity between the topic segmentation result of the above-mentioned training data obtained based on the adjusted target model and the session under each topic determined based on the topic tags of the above-mentioned candidate sessions reaches a preset similarity, thereby obtaining a trained target model to better segment the topic of multi-turn conversations.

[0121] Subsequently, several implementation examples of applying the target model to topic segmentation in multi-turn dialogues are provided.

[0122] refer to Figure 11 , Figure 11 The schematic diagram illustrates a flowchart of a topic segmentation method in a multi-turn dialogue according to an embodiment of the present disclosure, such as... Figure 11 As shown, topic segmentation methods in multi-turn dialogues include:

[0123] S1101. Input the conversation content from the multi-turn dialogue into the target model, and have the target model process it to obtain the topic segmentation result corresponding to the above conversation content.

[0124] The target model mentioned above is trained according to the model training method provided in any of the foregoing embodiments. For details, please refer to the foregoing embodiments, which will not be repeated here.

[0125] In this embodiment, the conversation content in the multi-turn dialogue can be input into the target model, and the target model can perform topic segmentation based on the conversation content in the multi-turn dialogue to obtain the topic segmentation result predicted by the target model.

[0126] The target model comprises an input layer, a feature extraction layer, and an output layer. The input layer vectorizes the input conversation to obtain a conversation vector. The feature extraction layer extracts features from the conversation vector to obtain a hidden layer feature representation. The output layer determines the topic segmentation result based on the hidden layer feature representation of the conversation vector. In this embodiment, the conversation content is input into the input layer for vectorization to obtain a conversation vector. Then, the feature extraction layer extracts features from the conversation vector to obtain a hidden layer feature representation. Finally, the hidden layer feature representation of the conversation vector is input into the output layer to obtain the topic segmentation result.

[0127] The topic segmentation results described above may include the starting statement tag of the conversation under each topic. The output layer may include a first fully connected layer, which determines the starting statement tag of the conversation under each topic based on the hidden layer feature representation of the conversation vector. In this embodiment, the hidden layer feature representation of the conversation vector corresponding to the conversation content can be input into the first fully connected layer to obtain the starting statement tag of the conversation under each topic in the conversation content.

[0128] Optionally, the topic segmentation result may further include the labels of the speakers of each statement in the conversation under each topic. The output layer may also include a second fully connected layer, which determines the labels of the speakers of each statement in the conversation under each topic based on the hidden layer feature representation of the conversation vector. In this embodiment, the hidden layer feature representation of the conversation vector corresponding to the conversation content can be input into the first and second fully connected layers respectively to obtain the starting statement label of the conversation under each topic in the conversation content, and the labels of the speakers of each statement in the conversation under each topic in the conversation content.

[0129] Furthermore, the topic segmentation results described above may also include intermediate statement labels for each topic's conversation. The output layer may also include a third fully connected layer, which determines the intermediate statement labels for each topic's conversation based on the hidden layer feature representation of the conversation vector. The intermediate statements for each topic's conversation are the remaining statements in the conversation excluding the initial statement. In this embodiment, the hidden layer feature representation of the conversation vector corresponding to the above conversation content can be input into the first, second, and third fully connected layers respectively to obtain the initial statement label for each topic's conversation in the above conversation content, the intermediate statement labels for each topic's conversation in the above conversation content, and the labels of the speakers for each statement in each topic's conversation in the above conversation content.

[0130] In this embodiment of the disclosure, the conversation content in the multi-turn dialogue and the pre-trained target model are used to segment the multi-turn dialogue into topics, thereby obtaining more granular information in the dialogue, such as one or more topics involved in the conversation. Based on the obtained one or more topics, the user's needs are understood more accurately, and more accurate data recommendations are provided to the user based on these needs, thereby improving the user experience.

[0131] Exemplary media

[0132] After introducing the methods of exemplary embodiments of this disclosure, the following references are made. Figure 12 The storage medium of the exemplary embodiments of this disclosure will be described.

[0133] refer to Figure 12 As shown, the storage medium 120 stores a program product for implementing the above-described method according to embodiments of the present disclosure. This program product may be a portable compact disc read-only memory (CD-ROM) and includes program code, and can run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto.

[0134] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0135] A readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying readable program code. This propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium.

[0136] Program code for performing the operations disclosed herein can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing devices can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN).

[0137] Exemplary device

[0138] Having introduced the medium of exemplary embodiments of this disclosure, the following references are made to... Figures 13-14 The exemplary embodiments of the present disclosure of the model training device and the topic segmentation device in multi-turn dialogue will be described. The model training device is used to implement the model training method provided in any of the above method embodiments, and the topic segmentation device in multi-turn dialogue is used to implement the topic segmentation method in multi-turn dialogue provided in any of the above method embodiments. Their implementation principles and technical effects are similar, and will not be repeated here.

[0139] refer to Figure 13 , Figure 13 This is a schematic diagram of the structure of a model training device provided in an embodiment of this disclosure. Figure 13 As shown, the model training device includes:

[0140] The filtering module 1301 is used to filter out a candidate session set from the historical session set, wherein the semantic similarity between any two candidate sessions in the candidate session set is less than a preset threshold.

[0141] The generation module 1302 is used to generate topic tags for the candidate sessions and to concatenate the candidate session set based on the topic tags to form training data.

[0142] The training module 1303 is used to train the target model based on the training data, and the target model is used to perform topic segmentation on the conversation content of multi-turn conversations.

[0143] In one embodiment of this disclosure, the historical session set includes multiple historical sessions, each historical session being a session formed based on a question about a single item and the corresponding answer to the question.

[0144] In yet another embodiment of this disclosure, the filtering module 1301 is specifically used for:

[0145] The historical session set is preprocessed, including filtering preset statements and / or filtering sessions whose session length is greater than a preset length; the candidate session set is then selected from the preprocessed historical session set.

[0146] In yet another embodiment of this disclosure, the filtering module 1301 is specifically used for:

[0147] Calculate the cosine similarity between historical sessions in the historical session set; determine the semantic similarity between historical sessions in the historical session set based on the cosine similarity; and select a candidate session set from the historical session set based on the semantic similarity between historical sessions in the historical session set.

[0148] In yet another embodiment of this disclosure, the filtering module 1301 is specifically used for:

[0149] Two historical sessions are selected from the historical session set, and it is determined whether the semantic similarity between the two historical sessions is less than the preset threshold. If the semantic similarity between the two historical sessions is less than the preset threshold, then from the remaining sessions in the historical session set other than the two historical sessions, historical sessions with semantic similarity less than the preset threshold with the two historical sessions are selected until the number of historical sessions selected from the historical session set reaches a first preset number, and then the selection stops.

[0150] In yet another embodiment of this disclosure, the filtering module 1301 is further configured to:

[0151] If the semantic similarity between the two historical sessions is greater than or equal to the preset threshold, then from the remaining sessions in the historical session set excluding the two historical sessions, continue to select historical sessions whose semantic similarity with one of the two historical sessions is less than the preset threshold, until the number of historical sessions selected from the historical session set reaches the first preset number, and then stop selecting.

[0152] In yet another embodiment of this disclosure, the filtering module 1301 is further configured to:

[0153] If the semantic similarity between the two historical sessions is greater than or equal to the preset threshold, then from the remaining sessions in the historical session set excluding the two historical sessions, another historical session is selected, and the selected historical session is used as the two historical sessions. The step of determining whether the semantic similarity between the two historical sessions is less than the preset threshold is then executed again.

[0154] In yet another embodiment of this disclosure, the filtering module 1301 is further configured to:

[0155] If the semantic similarity between the two historical sessions is greater than or equal to the preset threshold, the two historical sessions are stored in two separate datasets. From the remaining sessions in the historical session set excluding the two historical sessions, historical sessions are selected, and the semantic similarity between the selected historical sessions and the historical sessions in each dataset is calculated. If the semantic similarity between the selected historical session and the historical sessions in one dataset of each dataset is less than the preset threshold, the selected historical session is stored in that dataset, and the selection of historical sessions continues until the number of historical sessions in each dataset reaches a second preset number, at which point the selection stops.

[0156] In yet another embodiment of this disclosure, the filtering module 1301 is further configured to:

[0157] If the semantic similarity between the selected historical session and the historical sessions in each dataset is greater than or equal to the preset threshold, the selected historical session is stored in a new dataset, and historical sessions are selected again, and the step of calculating the semantic similarity between the selected historical session and the historical sessions in each dataset is repeated.

[0158] In yet another embodiment of this disclosure, the topic tags include the starting statement tags for each topic's conversation.

[0159] The generation module 1302 is specifically used for:

[0160] Determine the starting statement in the candidate session; add a starting statement tag to the starting statement in the candidate session to generate topic tags for the candidate session.

[0161] In yet another embodiment of this disclosure, the topic tags also include tags for the speakers of each statement in the conversation under each topic.

[0162] The generation module 1302 is specifically used for:

[0163] Obtain the speaker's identity identifier for each statement in the candidate session; add a starting statement tag to the starting statement in the candidate session, and add speaker tags to each statement in the candidate session based on the speaker's identity identifier for each statement in the candidate session, so as to generate topic tags for the candidate session.

[0164] In yet another embodiment of this disclosure, the topic tags include intermediate statement tags for each topic's conversation.

[0165] The generation module 1302 is specifically used for:

[0166] The remaining statements in the candidate session, excluding the starting statement, are identified and used as intermediate statements of the candidate session. A starting statement tag is added to the starting statement in the candidate session, an intermediate statement tag is added to the intermediate statements in the candidate session, and a speaker tag is added to each statement in the candidate session based on the speaker's identity identifier, so as to generate topic tags for the candidate session.

[0167] In yet another embodiment of this disclosure, the training module 1303 is specifically used for:

[0168] The training data is input into the target model to obtain the topic segmentation result of the training data; based on the topic tags of the candidate sessions and the topic segmentation result of the training data, the model parameters of the target model are adjusted so that the similarity between the topic segmentation result of the training data obtained based on the adjusted target model and the sessions under each topic determined based on the topic tags of the candidate sessions reaches a preset similarity.

[0169] In another embodiment of this disclosure, the target model includes an input layer, a feature extraction layer, and an output layer. The input layer is used to vectorize the input session to obtain the session vector. The feature extraction layer is used to extract features from the session vector to obtain the hidden layer feature representation of the session vector. The output layer determines the topic segmentation result corresponding to the session based on the hidden layer feature representation of the session vector.

[0170] In yet another embodiment of this disclosure, the training module 1303 is specifically used for:

[0171] The training data is input into the input layer to vectorize the training data and obtain the session vector corresponding to the training data; the feature extraction layer extracts features from the session vector corresponding to the training data to obtain the hidden layer feature representation of the session vector corresponding to the training data; the hidden layer feature representation of the session vector corresponding to the training data is input into the output layer to obtain the topic segmentation result of the training data.

[0172] In another embodiment of this disclosure, the topic segmentation result includes the starting statement tag of the conversation under each topic, and the output layer includes a first fully connected layer, which determines the starting statement tag of the conversation under each topic based on the hidden layer feature representation of the conversation vector.

[0173] In yet another embodiment of this disclosure, the training module 1303 is specifically used for:

[0174] The hidden layer feature representation of the session vector corresponding to the training data is input into the first fully connected layer to obtain the starting statement label of the session under each topic in the training data.

[0175] In yet another embodiment of this disclosure, the topic segmentation result further includes the labels of the speakers of each statement in the conversation under each topic, and the output layer further includes a second fully connected layer, which determines the labels of the speakers of each statement in the conversation under each topic based on the hidden layer feature representation of the conversation vector.

[0176] In yet another embodiment of this disclosure, the training module 1303 is specifically used for:

[0177] The hidden layer feature representations of the session vectors corresponding to the training data are input into the first fully connected layer and the second fully connected layer, respectively, to obtain the starting statement label of the session under each topic in the training data, and the label of the speaker of each statement in the session under each topic in the training data.

[0178] In another embodiment of this disclosure, the topic segmentation result includes intermediate statement tags of the conversation under each topic, and the output layer further includes a third fully connected layer. The third fully connected layer determines the intermediate statement tags of the conversation under each topic based on the hidden layer feature representation of the conversation vector. The intermediate statements of the conversation under each topic are the statements remaining in the conversation under the corresponding topic excluding the starting statement.

[0179] In yet another embodiment of this disclosure, the training module 1303 is specifically used for:

[0180] The hidden layer feature representations of the session vectors corresponding to the training data are respectively input into the first fully connected layer, the second fully connected layer, and the third fully connected layer to obtain the starting statement label of the session under each topic in the training data, the middle statement label of the session under each topic in the training data, and the label of the speaker of each statement in the session under each topic in the training data.

[0181] refer to Figure 14 , Figure 14 This is a schematic diagram of the structure of a topic segmentation device in a multi-turn dialogue provided in an embodiment of this disclosure. Figure 14 As shown, the topic segmentation device in a multi-turn dialogue includes:

[0182] The segmentation module 1401 is used to input the conversation content in a multi-turn dialogue into the target model, and the target model processes it to obtain the topic segmentation result corresponding to the conversation content.

[0183] The target model is trained according to the model training method provided in any of the foregoing embodiments.

[0184] In one embodiment of this disclosure, the target model includes an input layer, a feature extraction layer, and an output layer. The input layer is used to vectorize the input session to obtain the session vector. The feature extraction layer is used to extract features from the session vector to obtain the hidden layer feature representation of the session vector. The output layer determines the topic segmentation result corresponding to the session based on the hidden layer feature representation of the session vector.

[0185] In yet another embodiment of this disclosure, the segmentation module 1401 is specifically used for:

[0186] The conversation content is input into the input layer to vectorize the conversation content and obtain the conversation vector corresponding to the conversation content; through the feature extraction layer, features are extracted from the conversation vector corresponding to the conversation content to obtain the hidden layer feature representation of the conversation vector corresponding to the conversation content; the hidden layer feature representation of the conversation vector corresponding to the conversation content is input into the output layer to obtain the topic segmentation result corresponding to the conversation content.

[0187] In another embodiment of this disclosure, the topic segmentation result includes the starting statement tag of the conversation under each topic, and the output layer includes a first fully connected layer, which determines the starting statement tag of the conversation under each topic based on the hidden layer feature representation of the conversation vector.

[0188] In yet another embodiment of this disclosure, the segmentation module 1401 is specifically used for:

[0189] The hidden layer feature representation of the conversation vector corresponding to the conversation content is input into the first fully connected layer to obtain the starting statement label of the conversation under each topic in the conversation content.

[0190] In yet another embodiment of this disclosure, the topic segmentation result further includes the labels of the speakers of each statement in the conversation under each topic, and the output layer further includes a second fully connected layer, which determines the labels of the speakers of each statement in the conversation under each topic based on the hidden layer feature representation of the conversation vector.

[0191] In yet another embodiment of this disclosure, the segmentation module 1401 is specifically used for:

[0192] The hidden layer feature representations of the conversation vectors corresponding to the conversation content are input into the first fully connected layer and the second fully connected layer, respectively, to obtain the starting statement label of the conversation under each topic in the conversation content, and the labels of the speakers of each statement in the conversation under each topic in the conversation content.

[0193] In another embodiment of this disclosure, the topic segmentation result includes intermediate statement tags of the conversation under each topic, and the output layer further includes a third fully connected layer. The third fully connected layer determines the intermediate statement tags of the conversation under each topic based on the hidden layer feature representation of the conversation vector. The intermediate statements of the conversation under each topic are the statements remaining in the conversation under the corresponding topic excluding the starting statement.

[0194] In yet another embodiment of this disclosure, the segmentation module 1401 is specifically used for:

[0195] The hidden layer feature representations of the conversation vectors corresponding to the conversation content are input into the first fully connected layer, the second fully connected layer, and the third fully connected layer, respectively, to obtain the starting statement label of the conversation under each topic in the conversation content, the middle statement label of the conversation under each topic in the conversation content, and the label of the speaker of each statement in the conversation under each topic in the conversation content.

[0196] Exemplary computing device

[0197] Having described the methods, media, and apparatus of exemplary embodiments of this disclosure, the following references... Figure 15 A computing device according to an exemplary embodiment of the present disclosure will be described.

[0198] Figure 15 The computing device 150 shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0199] like Figure 15 As shown, the computing device 150 is presented in the form of a general-purpose computing device. The components of the computing device 150 may include, but are not limited to: at least one processing unit 1501, at least one storage unit 1502, and a bus 1503 connecting different system components (including the processing unit 1501 and the storage unit 1502).

[0200] Bus 1503 includes a data bus, a control bus, and an address bus.

[0201] Storage unit 1502 may include readable media in the form of volatile memory, such as random access memory (RAM) 15021 and / or cache memory 15022, and may further include readable media in the form of non-volatile memory, such as read-only memory (ROM) 15023.

[0202] Storage unit 1502 may also include a program / utility 15025 having a set (at least one) of program modules 15024, such program modules 15024 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.

[0203] The computing device 150 can also communicate with one or more external devices 1504 (e.g., keyboard, pointing device, etc.). This communication can be performed via input / output (I / O) interface 1505. Furthermore, the computing device 150 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 1506. Figure 15 As shown, network adapter 1506 communicates with other modules of computing device 150 via bus 1503. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with computing device 150, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0204] It should be noted that although several units / modules or sub-units / modules of the model training device and the topic segmentation device in multi-turn dialogue have been mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided and embodied by multiple units / modules.

[0205] Furthermore, although the operations of the methods disclosed herein are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all of the operations shown must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.

[0206] While the spirit and principles of this disclosure have been described with reference to several specific embodiments, it should be understood that this disclosure is not limited to the disclosed specific embodiments, and the division of aspects does not imply that features in these aspects cannot be combined for benefit; such division is merely for convenience of expression. This disclosure is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.

Claims

1. A model training method, characterized in that, include: Calculate the cosine similarity between historical sessions in the historical session set; Based on the cosine similarity, the semantic similarity between historical sessions in the historical session set is determined; Based on the semantic similarity between historical sessions in the historical session set, a candidate session set is selected from the historical session set, wherein the semantic similarity between any two candidate sessions in the candidate session set is less than a preset threshold; Generate topic tags for the candidate sessions, and concatenate the candidate session set based on the topic tags to form training data; The target model is trained based on the training data, and the target model is used to segment the conversation content of multi-turn conversations into topics. The step of selecting a candidate session set from the historical session set based on the semantic similarity between historical sessions in the historical session set includes: Two historical sessions are selected from the historical session set, and it is determined whether the semantic similarity between the two historical sessions is less than the preset threshold. If the semantic similarity between the two historical sessions is greater than or equal to the preset threshold, then from the remaining sessions in the historical session set excluding the two historical sessions, continue to select historical sessions whose semantic similarity with one of the two historical sessions is less than the preset threshold, until the number of historical sessions selected from the historical session set reaches a first preset number, and then stop selecting.

2. The model training method according to claim 1, characterized in that, The historical session set includes multiple historical sessions, each of which is a session based on a question about a single item and the corresponding answer to that question.

3. The model training method according to claim 2, characterized in that, Before selecting a candidate session set from the historical session set, the following steps are also included: The historical session set is preprocessed, and the preprocessing includes filtering preset statements and / or filtering sessions whose session length is greater than a preset length; The process of selecting a candidate session set from the historical session set includes: The candidate session set is selected from the preprocessed historical session set.

4. The model training method according to claim 1, characterized in that, After determining whether the semantic similarity between the two historical sessions is less than a preset threshold, the method further includes: If the semantic similarity between the two historical sessions is less than the preset threshold, then from the remaining sessions in the historical session set excluding the two historical sessions, continue to select historical sessions with a semantic similarity less than the preset threshold with the two historical sessions, until the number of historical sessions selected from the historical session set reaches a first preset number, and then stop selecting.

5. The model training method according to claim 4, characterized in that, After determining whether the semantic similarity between the two historical sessions is less than a preset threshold, the method further includes: If the semantic similarity between the two historical sessions is greater than or equal to the preset threshold, then from the remaining sessions in the historical session set excluding the two historical sessions, another historical session is selected, and the selected historical session is used as the two historical sessions. The step of determining whether the semantic similarity between the two historical sessions is less than the preset threshold is then executed again.

6. The model training method according to claim 4, characterized in that, After determining whether the semantic similarity between the two historical sessions is less than a preset threshold, the method further includes: If the semantic similarity between the two historical sessions is greater than or equal to the preset threshold, the two historical sessions are stored in two datasets respectively. From the remaining sessions in the historical session set excluding the two historical sessions, historical sessions are selected, and the semantic similarity between the selected historical sessions and the historical sessions in each dataset is calculated respectively. If the semantic similarity between the selected historical session and a historical session in one of the datasets is less than the preset threshold, the selected historical session is stored in that dataset, and the selection of historical sessions continues until the number of historical sessions in each dataset reaches the second preset number, at which point the selection stops.

7. The model training method according to claim 6, characterized in that, After calculating the semantic similarity between the selected historical sessions and the historical sessions in each dataset, the method further includes: If the semantic similarity between the selected historical session and the historical sessions in each dataset is greater than or equal to the preset threshold, the selected historical session is stored in a new dataset, and historical sessions are selected again, and the step of calculating the semantic similarity between the selected historical session and the historical sessions in each dataset is repeated.

8. The model training method according to any one of claims 1 to 3, characterized in that, The topic tags include the starting statement tags for each topic's conversation; The generation of topic tags for the candidate sessions includes: Determine the starting statement in the candidate session; Add a start statement tag to the start statement in the candidate session to generate topic tags for the candidate session.

9. The model training method according to claim 8, characterized in that, The topic tags also include the tags of the speakers for each statement in the conversation under each topic; The step of adding start statement tags to the start statements in the candidate sessions to generate topic tags for the candidate sessions includes: Obtain the identity identifier of the speaker corresponding to each statement in the candidate session; A starting statement tag is added to the starting statement in the candidate session, and a speaker tag is added to each statement in the candidate session based on the speaker's identity identifier, so as to generate topic tags for the candidate session.

10. The model training method according to claim 9, characterized in that, The topic tags include the intermediate statement tags of the conversation under each topic; The step of adding a starting statement tag to the starting statement in the candidate session, and adding a speaker tag to each statement in the candidate session based on the speaker's identity identifier, to generate topic tags for the candidate session, includes: Identify the remaining statements in the candidate session excluding the starting statement, and use the remaining statements as the intermediate statements of the candidate session; A start statement tag is added to the starting statement in the candidate session, an intermediate statement tag is added to the intermediate statement in the candidate session, and a speaker tag is added to each statement in the candidate session based on the speaker's identity identifier, so as to generate topic tags for the candidate session.

11. The model training method according to any one of claims 1 to 3, characterized in that, The training of the target model based on the training data includes: The training data is input into the target model to obtain the topic segmentation result of the training data; Based on the topic tags of the candidate sessions and the topic segmentation results of the training data, the model parameters of the target model are adjusted so that the similarity between the topic segmentation results of the training data obtained based on the adjusted target model and the sessions under each topic determined based on the topic tags of the candidate sessions reaches a preset similarity.

12. The model training method according to claim 11, characterized in that, The target model includes an input layer, a feature extraction layer, and an output layer. The input layer is used to vectorize the input sessions to obtain the session vectors corresponding to the sessions. The feature extraction layer is used to extract features from the session vectors to obtain the hidden layer feature representations of the session vectors. The output layer determines the topic segmentation result corresponding to the sessions based on the hidden layer feature representations of the session vectors.

13. The model training method according to claim 12, characterized in that, The step of inputting the training data into the target model to obtain the topic segmentation result of the training data includes: The training data is input into the input layer to perform vectorization processing on the training data, thereby obtaining the session vector corresponding to the training data; Through the feature extraction layer, features are extracted from the session vectors corresponding to the training data to obtain the hidden layer feature representation of the session vectors corresponding to the training data; The hidden layer feature representation of the session vector corresponding to the training data is input into the output layer to obtain the topic segmentation result of the training data.

14. The model training method according to claim 13, characterized in that, The topic segmentation result includes the starting statement label of the conversation under each topic. The output layer includes a first fully connected layer, which determines the starting statement label of the conversation under each topic based on the hidden layer feature representation of the conversation vector.

15. The model training method according to claim 14, characterized in that, The step of inputting the hidden layer feature representation of the session vector corresponding to the training data into the output layer to obtain the topic segmentation result of the training data includes: The hidden layer feature representation of the session vector corresponding to the training data is input into the first fully connected layer to obtain the starting statement label of the session under each topic in the training data.

16. The model training method according to claim 15, characterized in that, The topic segmentation result also includes the labels of the speakers of each statement in the conversation under each topic. The output layer also includes a second fully connected layer, which determines the labels of the speakers of each statement in the conversation under each topic based on the hidden layer feature representation of the conversation vector.

17. The model training method according to claim 16, characterized in that, The step of inputting the hidden layer feature representation of the session vector corresponding to the training data into the output layer to obtain the topic segmentation result of the training data includes: The hidden layer feature representations of the session vectors corresponding to the training data are input into the first fully connected layer and the second fully connected layer, respectively, to obtain the starting statement label of the session under each topic in the training data, and the label of the speaker of each statement in the session under each topic in the training data.

18. The model training method according to claim 17, characterized in that, The topic segmentation result includes the intermediate statement labels of the conversation under each topic. The output layer also includes a third fully connected layer. The third fully connected layer determines the intermediate statement labels of the conversation under each topic based on the hidden layer feature representation of the conversation vector. The intermediate statement of the conversation under each topic is the statement remaining in the conversation under the corresponding topic excluding the starting statement.

19. The model training method according to claim 18, characterized in that, The step of inputting the hidden layer feature representation of the session vector corresponding to the training data into the output layer to obtain the topic segmentation result of the training data includes: The hidden layer feature representations of the session vectors corresponding to the training data are respectively input into the first fully connected layer, the second fully connected layer, and the third fully connected layer to obtain the starting statement label of the session under each topic in the training data, the middle statement label of the session under each topic in the training data, and the label of the speaker of each statement in the session under each topic in the training data.

20. A topic segmentation method in multi-turn dialogue, characterized in that, include: The conversation content from a multi-turn dialogue is input into a target model, which processes the content to obtain a topic segmentation result corresponding to the conversation content. The target model is trained using the model training method according to any one of claims 1 to 19.

21. The topic segmentation method in multi-turn dialogue according to claim 20, characterized in that, The target model includes an input layer, a feature extraction layer, and an output layer. The input layer is used to vectorize the input sessions to obtain the session vectors corresponding to the sessions. The feature extraction layer is used to extract features from the session vectors to obtain the hidden layer feature representations of the session vectors. The output layer determines the topic segmentation result corresponding to the sessions based on the hidden layer feature representations of the session vectors.

22. The topic segmentation method in multi-turn dialogue according to claim 21, characterized in that, The step of inputting the conversation content from multi-turn dialogues into the target model, and having the target model process it to obtain the topic segmentation result corresponding to the conversation content, includes: The conversation content is input into the input layer to perform vectorization processing on the conversation content and obtain the conversation vector corresponding to the conversation content; Through the feature extraction layer, features are extracted from the session vector corresponding to the session content to obtain the hidden layer feature representation of the session vector corresponding to the session content; The hidden layer feature representation of the conversation vector corresponding to the conversation content is input into the output layer to obtain the topic segmentation result corresponding to the conversation content.

23. The topic segmentation method in multi-turn dialogue according to claim 22, characterized in that, The topic segmentation result includes the starting statement label of the conversation under each topic. The output layer includes a first fully connected layer, which determines the starting statement label of the conversation under each topic based on the hidden layer feature representation of the conversation vector.

24. The topic segmentation method in multi-turn dialogue according to claim 23, characterized in that, The step of inputting the hidden layer feature representation of the conversation vector corresponding to the conversation content into the output layer to obtain the topic segmentation result corresponding to the conversation content includes: The hidden layer feature representation of the conversation vector corresponding to the conversation content is input into the first fully connected layer to obtain the starting statement label of the conversation under each topic in the conversation content.

25. The topic segmentation method in multi-turn dialogue according to claim 24, characterized in that, The topic segmentation result also includes the labels of the speakers of each statement in the conversation under each topic. The output layer also includes a second fully connected layer, which determines the labels of the speakers of each statement in the conversation under each topic based on the hidden layer feature representation of the conversation vector.

26. The topic segmentation method in multi-turn dialogue according to claim 25, characterized in that, The step of inputting the hidden layer feature representation of the conversation vector corresponding to the conversation content into the output layer to obtain the topic segmentation result corresponding to the conversation content includes: The hidden layer feature representations of the conversation vectors corresponding to the conversation content are input into the first fully connected layer and the second fully connected layer, respectively, to obtain the starting statement label of the conversation under each topic in the conversation content, and the labels of the speakers of each statement in the conversation under each topic in the conversation content.

27. The topic segmentation method in multi-turn dialogue according to claim 26, characterized in that, The topic segmentation result includes the intermediate statement labels of the conversation under each topic. The output layer also includes a third fully connected layer. The third fully connected layer determines the intermediate statement labels of the conversation under each topic based on the hidden layer feature representation of the conversation vector. The intermediate statement of the conversation under each topic is the statement remaining in the conversation under the corresponding topic excluding the starting statement.

28. The topic segmentation method in multi-turn dialogue according to claim 27, characterized in that, The step of inputting the hidden layer feature representation of the conversation vector corresponding to the conversation content into the output layer to obtain the topic segmentation result corresponding to the conversation content includes: The hidden layer feature representations of the conversation vectors corresponding to the conversation content are input into the first fully connected layer, the second fully connected layer, and the third fully connected layer, respectively, to obtain the starting statement label of the conversation under each topic in the conversation content, the middle statement label of the conversation under each topic in the conversation content, and the label of the speaker of each statement in the conversation under each topic in the conversation content.

29. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by the processor, implement the model training method as described in any one of claims 1 to 19, and / or implement the topic segmentation method as described in any one of claims 20 to 28.

30. A model training device, characterized in that, include: The filtering module is used to calculate the cosine similarity between historical sessions in the historical session set. Based on the cosine similarity, the semantic similarity between historical sessions in the historical session set is determined; Based on the semantic similarity between historical sessions in the historical session set, candidate sessions are selected from the historical session set, wherein the semantic similarity between any two candidate sessions in the candidate session set is less than a preset threshold; The generation module is used to generate topic tags for the candidate sessions and to concatenate the candidate session set based on the topic tags to form training data. The training module is used to train the target model based on the training data, and the target model is used to perform topic segmentation on the conversation content of multi-turn conversations; The filtering module is specifically used for: Two historical sessions are selected from the historical session set, and it is determined whether the semantic similarity between the two historical sessions is less than the preset threshold. If the semantic similarity between the two historical sessions is greater than or equal to the preset threshold, then from the remaining sessions in the historical session set excluding the two historical sessions, continue to select historical sessions whose semantic similarity with one of the two historical sessions is less than the preset threshold, until the number of historical sessions selected from the historical session set reaches a first preset number, and then stop selecting.

31. The model training apparatus according to claim 30, characterized in that, The historical session set includes multiple historical sessions, each of which is a session based on a question about a single item and the corresponding answer to that question.

32. The model training apparatus according to claim 31, characterized in that, The filtering module is specifically used for: The historical session set is preprocessed, and the preprocessing includes filtering preset statements and / or filtering sessions whose session length is greater than a preset length; The candidate session set is selected from the preprocessed historical session set.

33. The model training apparatus according to claim 30, characterized in that, The filtering module is also used for: If the semantic similarity between the two historical sessions is less than the preset threshold, then from the remaining sessions in the historical session set excluding the two historical sessions, continue to select historical sessions with a semantic similarity less than the preset threshold with the two historical sessions, until the number of historical sessions selected from the historical session set reaches a first preset number, and then stop selecting.

34. The model training apparatus according to claim 30, characterized in that, The filtering module is also used for: If the semantic similarity between the two historical sessions is greater than or equal to the preset threshold, then from the remaining sessions in the historical session set excluding the two historical sessions, another historical session is selected, and the selected historical session is used as the two historical sessions. The step of determining whether the semantic similarity between the two historical sessions is less than the preset threshold is then executed again.

35. The model training apparatus according to claim 34, characterized in that, The filtering module is also used for: If the semantic similarity between the two historical sessions is greater than or equal to the preset threshold, the two historical sessions are stored in two datasets respectively. From the remaining sessions in the historical session set excluding the two historical sessions, historical sessions are selected, and the semantic similarity between the selected historical sessions and the historical sessions in each dataset is calculated respectively. If the semantic similarity between the selected historical session and a historical session in one of the datasets is less than the preset threshold, the selected historical session is stored in that dataset, and the selection of historical sessions continues until the number of historical sessions in each dataset reaches the second preset number, at which point the selection stops.

36. The model training apparatus according to claim 35, characterized in that, The filtering module is also used for: If the semantic similarity between the selected historical session and the historical sessions in each dataset is greater than or equal to the preset threshold, the selected historical session is stored in a new dataset, and historical sessions are selected again, and the step of calculating the semantic similarity between the selected historical session and the historical sessions in each dataset is repeated.

37. The model training apparatus according to any one of claims 30 to 32, characterized in that, The topic tags include the starting statement tags for each topic's conversation; The generation module is specifically used for: Determine the starting statement in the candidate session; Add a start statement tag to the start statement in the candidate session to generate topic tags for the candidate session.

38. The model training apparatus according to claim 37, characterized in that, The topic tags also include the tags of the speakers for each statement in the conversation under each topic; The generation module is specifically used for: Obtain the identity identifier of the speaker corresponding to each statement in the candidate session; A starting statement tag is added to the starting statement in the candidate session, and a speaker tag is added to each statement in the candidate session based on the speaker's identity identifier, so as to generate topic tags for the candidate session.

39. The model training apparatus according to claim 38, characterized in that, The topic tags include the intermediate statement tags of the conversation under each topic; The generation module is specifically used for: Identify the remaining statements in the candidate session excluding the starting statement, and use the remaining statements as the intermediate statements of the candidate session; A start statement tag is added to the starting statement in the candidate session, an intermediate statement tag is added to the intermediate statement in the candidate session, and a speaker tag is added to each statement in the candidate session based on the speaker's identity identifier, so as to generate topic tags for the candidate session.

40. The model training apparatus according to any one of claims 30 to 32, characterized in that, The training module is specifically used for: The training data is input into the target model to obtain the topic segmentation result of the training data; Based on the topic tags of the candidate sessions and the topic segmentation results of the training data, the model parameters of the target model are adjusted so that the similarity between the topic segmentation results of the training data obtained based on the adjusted target model and the sessions under each topic determined based on the topic tags of the candidate sessions reaches a preset similarity.

41. The model training apparatus according to claim 40, characterized in that, The target model includes an input layer, a feature extraction layer, and an output layer. The input layer is used to vectorize the input sessions to obtain the session vectors corresponding to the sessions. The feature extraction layer is used to extract features from the session vectors to obtain the hidden layer feature representations of the session vectors. The output layer determines the topic segmentation result corresponding to the sessions based on the hidden layer feature representations of the session vectors.

42. The model training apparatus according to claim 41, characterized in that, The training module is specifically used for: The training data is input into the input layer to perform vectorization processing on the training data, thereby obtaining the session vector corresponding to the training data; Through the feature extraction layer, features are extracted from the session vectors corresponding to the training data to obtain the hidden layer feature representation of the session vectors corresponding to the training data; The hidden layer feature representation of the session vector corresponding to the training data is input into the output layer to obtain the topic segmentation result of the training data.

43. The model training apparatus according to claim 42, characterized in that, The topic segmentation result includes the starting statement label of the conversation under each topic. The output layer includes a first fully connected layer, which determines the starting statement label of the conversation under each topic based on the hidden layer feature representation of the conversation vector.

44. The model training apparatus according to claim 43, characterized in that, The training module is specifically used for: The hidden layer feature representation of the session vector corresponding to the training data is input into the first fully connected layer to obtain the starting statement label of the session under each topic in the training data.

45. The model training apparatus according to claim 44, characterized in that, The topic segmentation result also includes the labels of the speakers of each statement in the conversation under each topic. The output layer also includes a second fully connected layer, which determines the labels of the speakers of each statement in the conversation under each topic based on the hidden layer feature representation of the conversation vector.

46. ​​The model training apparatus according to claim 45, characterized in that, The training module is specifically used for: The hidden layer feature representations of the session vectors corresponding to the training data are input into the first fully connected layer and the second fully connected layer, respectively, to obtain the starting statement label of the session under each topic in the training data, and the label of the speaker of each statement in the session under each topic in the training data.

47. The model training apparatus according to claim 46, characterized in that, The topic segmentation result includes the intermediate statement labels of the conversation under each topic. The output layer also includes a third fully connected layer. The third fully connected layer determines the intermediate statement labels of the conversation under each topic based on the hidden layer feature representation of the conversation vector. The intermediate statement of the conversation under each topic is the statement remaining in the conversation under the corresponding topic excluding the starting statement.

48. The model training apparatus according to claim 47, characterized in that, The training module is specifically used for: The hidden layer feature representations of the session vectors corresponding to the training data are respectively input into the first fully connected layer, the second fully connected layer, and the third fully connected layer to obtain the starting statement label of the session under each topic in the training data, the middle statement label of the session under each topic in the training data, and the label of the speaker of each statement in the session under each topic in the training data.

49. A topic segmentation device for multi-turn dialogue, characterized in that, include: A segmentation module is used to input the conversation content from a multi-turn dialogue into a target model, which processes the content to obtain a topic segmentation result corresponding to the conversation content. The target model is trained using the model training method according to any one of claims 1 to 19.

50. The topic segmentation device in a multi-turn dialogue according to claim 49, characterized in that, The target model includes an input layer, a feature extraction layer, and an output layer. The input layer is used to vectorize the input sessions to obtain the session vectors corresponding to the sessions. The feature extraction layer is used to extract features from the session vectors to obtain the hidden layer feature representations of the session vectors. The output layer determines the topic segmentation result corresponding to the sessions based on the hidden layer feature representations of the session vectors.

51. The topic segmentation device in a multi-turn dialogue according to claim 50, characterized in that, The segmentation module is specifically used for: The conversation content is input into the input layer to perform vectorization processing on the conversation content and obtain the conversation vector corresponding to the conversation content; Through the feature extraction layer, features are extracted from the session vector corresponding to the session content to obtain the hidden layer feature representation of the session vector corresponding to the session content; The hidden layer feature representation of the conversation vector corresponding to the conversation content is input into the output layer to obtain the topic segmentation result corresponding to the conversation content.

52. The topic segmentation device in a multi-turn dialogue according to claim 51, characterized in that, The topic segmentation result includes the starting statement label of the conversation under each topic. The output layer includes a first fully connected layer, which determines the starting statement label of the conversation under each topic based on the hidden layer feature representation of the conversation vector.

53. The topic segmentation device in a multi-turn dialogue according to claim 52, characterized in that, The segmentation module is specifically used for: The hidden layer feature representation of the conversation vector corresponding to the conversation content is input into the first fully connected layer to obtain the starting statement label of the conversation under each topic in the conversation content.

54. The topic segmentation device in a multi-turn dialogue according to claim 53, characterized in that, The topic segmentation result also includes the labels of the speakers of each statement in the conversation under each topic. The output layer also includes a second fully connected layer, which determines the labels of the speakers of each statement in the conversation under each topic based on the hidden layer feature representation of the conversation vector.

55. The topic segmentation device in a multi-turn dialogue according to claim 54, characterized in that, The segmentation module is specifically used for: The hidden layer feature representations of the conversation vectors corresponding to the conversation content are input into the first fully connected layer and the second fully connected layer, respectively, to obtain the starting statement label of the conversation under each topic in the conversation content, and the labels of the speakers of each statement in the conversation under each topic in the conversation content.

56. The topic segmentation device in a multi-turn dialogue according to claim 55, characterized in that, The topic segmentation result includes the intermediate statement labels of the conversation under each topic. The output layer also includes a third fully connected layer. The third fully connected layer determines the intermediate statement labels of the conversation under each topic based on the hidden layer feature representation of the conversation vector. The intermediate statement of the conversation under each topic is the statement remaining in the conversation under the corresponding topic excluding the starting statement.

57. The topic segmentation device in a multi-turn dialogue according to claim 56, characterized in that, The segmentation module is specifically used for: The hidden layer feature representations of the conversation vectors corresponding to the conversation content are input into the first fully connected layer, the second fully connected layer, and the third fully connected layer, respectively, to obtain the starting statement label of the conversation under each topic in the conversation content, the middle statement label of the conversation under each topic in the conversation content, and the label of the speaker of each statement in the conversation under each topic in the conversation content.

58. A computing device, comprising: At least one processor and memory; The memory stores computer-executed instructions; The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the model training method as described in any one of claims 1 to 19, and / or causing the at least one processor to perform the topic segmentation method as described in any one of claims 20 to 28.

Citation Information

Patent Citations

  • Dialogue topic partitioning method and system based on context correlation

    CN107480143A

  • Dialogue system training data construction method and device, electronic equipment and storage medium

    CN109947924A

  • Session routing method and device

    CN113626570A