Intelligent man-machine dialogue method and device, storage medium and intelligent device

By using a topic consistency model and topic graph in chatbots, appropriate switching and natural transitions in conversation topics are achieved, solving the problem of monotonous chatbot conversation flow and improving users' chat interest and interaction effects.

CN116226337BActive Publication Date: 2025-12-09UBTECH ROBOTICS CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211096207.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-08
Publication Date
2025-12-09
Estimated Expiration
2042-09-08

AI Technical Summary

Technical Problem

The existing chatbots have a monotonous and rigid human-computer dialogue process, which leads to a continuous decline in users' interest in chatting and low effectiveness of human-computer dialogue interaction.

Method used

By acquiring the current user's statement and the system statement from the previous round, the trained topic consistency model is used to determine topic consistency, and system statements are generated in conjunction with a preset topic graph to achieve appropriate switching and natural transfer of topics.

Benefits of technology

It effectively avoids rigid, purely reactive dialogues, increases user interest in conversational interaction, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116226337B_ABST
    Figure CN116226337B_ABST
Patent Text Reader

Abstract

The application is suitable for the field of artificial intelligence technology, and provides an intelligent man-machine conversation method and device, a storage medium and an intelligent device, which comprises the following steps: acquiring a current user statement and a system statement of a previous round, wherein the current user statement is a user statement of a current round; inputting the current user statement and the system statement of the previous round into a trained theme consistency model to obtain a theme consistency judgment result, wherein the theme consistency model is used for detecting whether the theme of a statement is consistent; and generating and outputting a system statement of the current round according to the current user statement, the theme consistency judgment result and a preset topic graph. The application can avoid a stiff and pure response type conversation, determine a suitable conversation theme, and effectively, controllably and naturally realize topic transfer, so as to improve the interest of user conversation interaction and enhance user experience.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence, and in particular to an intelligent man-machine conversation method and device, a storage medium and an intelligent device. BACKGROUND

[0002] With the development of Internet technology and AI technology, chat robots have emerged like mushrooms after rain. Chat robots are widely used in various electronic devices, such as mobile phones, televisions, vehicle terminals, and sound systems. In addition to performing instruction-based functional interactions, chat robots also play an important role in exchanging knowledge and emotions with users.

[0003] However, in the prior art, chat robots only respond to user inputs, and the conversation process between users and chat robots is single and rigid, which leads to a continuous decline in user interest in chatting and low effectiveness of man-machine conversation interaction. SUMMARY

[0004] The embodiments of the present application provide an intelligent man-machine conversation method, device, storage medium and intelligent device, which can solve the problem of single and rigid man-machine conversation process, leading to a continuous decline in user interest in chatting and low effectiveness of man-machine conversation interaction.

[0005] In a first aspect, the embodiments of the present application provide an intelligent man-machine conversation method, comprising:

[0006] obtaining a current user statement and a previous round system statement, the current user statement being a user statement of a current round;

[0007] inputting the current user statement and the previous round system statement into a trained topic consistency model to obtain a topic consistency judgment result, the topic consistency model being used to detect whether the topics of the statements are consistent;

[0008] generating and outputting a system statement of the current round according to the current user statement, the topic consistency judgment result and a preset topic graph.

[0009] In a possible implementation manner of the first aspect, the step of generating and outputting a system statement of the current round according to the current user statement, the topic consistency judgment result and a preset topic graph comprises:

[0010] extracting an entity in the current user statement, and determining a topic of a current round user topic and a domain to which the topic belongs based on the entity and a preset topic graph;

[0011] determine the theme of the system topic of the current turn according to the theme consistency determination result, the preset topic graph, and the theme of the user topic of the current turn and the field to which the theme belongs;

[0012] generate and output the system statement of the current turn based on the theme of the system topic of the current turn.

[0013] In a possible implementation manner of the first aspect, the step of determining the theme of the system topic of the current turn according to the theme consistency determination result, the preset topic graph, and the theme of the user topic of the current turn and the field to which the theme belongs includes:

[0014] if the theme of the user topic of the current turn is consistent with the theme of the system statement of the previous turn, obtaining the number of dialogue turns between the intelligent device and the current user;

[0015] when the number of dialogue turns reaches a first specified number of turns, obtaining a historical theme, the historical theme being the theme of each round of dialogue except the current user statement;

[0016] if the historical theme is the same as the theme of the user topic of the current turn, performing same-field theme switching according to the preset topic graph and the field to which the theme of the user topic of the current turn belongs;

[0017] determining the switched theme as the theme of the system topic of the current turn.

[0018] In a possible implementation manner of the first aspect, the preset topic graph includes multiple themes under a same field.

[0019] The step of performing same-field theme switching according to the preset topic graph and the field to which the theme of the user topic of the current turn belongs includes:

[0020] randomly selecting a theme from the multiple themes under the field to which the theme of the user topic of the current turn belongs based on the preset topic graph, and switching the theme.

[0021] In a possible implementation manner of the first aspect, the step of determining the theme of the system topic of the current turn according to the theme consistency determination result, the preset topic graph, and the theme of the user topic of the current turn and the field to which the theme belongs includes:

[0022] if the theme of the user topic of the current turn is consistent with the theme of the system statement of the previous turn, obtaining the number of dialogue turns between the intelligent device and the current user;

[0023] when the number of the dialog turns reaches a second specified number of turns, obtaining a historical topic and a historical domain to which the historical topic belongs, the historical topic being a topic of each turn of dialog other than the current user statement, and the historical domain being a domain to which the historical topic belongs;

[0024] obtaining a number of continuous topics, the number of continuous topics being a number of historical topics in the dialog of the second specified number of turns, the historical topics being the same as a domain to which a topic of the current turn user topic belongs;

[0025] if the number of continuous topics reaches a preset number of topics, performing cross-domain topic switching according to the preset topic graph, the topic of the current turn user topic, and a domain to which the topic belongs;

[0026] determining the switched topic as a topic of a current turn system topic.

[0027] In a possible implementation of the first aspect, the intelligent man-machine dialog method further includes:

[0028] if the topic of the current turn user topic is inconsistent with a topic of a system statement of a previous turn, determining the topic of the current turn user topic as a topic of a current turn system topic;

[0029] generating and outputting a system statement of the current turn based on the topic of the current turn system topic.

[0030] In a possible implementation of the first aspect, the intelligent man-machine dialog method further includes:

[0031] if a system statement of the current turn cannot be generated according to the current user statement, the topic consistency determination result, and a preset topic graph, randomly extracting a preset statement from a preset corpus;

[0032] determining the preset statement as the system statement of the current turn for output.

[0033] In a second aspect, an embodiment of the present application provides an intelligent man-machine dialog device, including:

[0034] a user statement obtaining unit, configured to obtain a current user statement and a system statement of a previous turn, the current user statement being a user statement of a current turn;

[0035] a topic consistency determination unit, configured to input the current user statement and the system statement of the previous turn into a trained topic consistency model to obtain a topic consistency determination result, the topic consistency model being used to detect whether topics of statements are consistent;

[0036] A system statement generation and output unit is configured to generate and output a system statement of a current round according to the current user statement, the topic consistency determination result, and a preset topic graph.

[0037] In a third aspect, an embodiment of the present application provides an intelligent device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the intelligent man-machine dialogue method according to the first aspect.

[0038] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executable on a processor to implement the intelligent man-machine dialogue method according to the first aspect.

[0039] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when executed on an intelligent device, causes the intelligent device to implement the intelligent man-machine dialogue method according to the first aspect.

[0040] In the embodiment of the present application, the current user statement and the system statement of the previous round are obtained, and then the current user statement and the system statement of the previous round are input into the trained topic consistency model to obtain a topic consistency determination result. Then, the system statement of the current round is generated and output according to the current user statement, the topic consistency determination result, and the preset topic graph. By judging whether the topic of the current dialogue changes, the current user statement and the preset topic graph are combined to determine and output the system statement, which can avoid a rigid and pure response dialogue, determine a suitable dialogue topic, and effectively, controllably and naturally realize topic shift, thereby improving the interest of user dialogue interaction and enhancing user experience. It can be understood that the beneficial effects of the above-mentioned second aspect to the fifth aspect can be referred to the related description in the first aspect, which will not be repeated here. BRIEF DESCRIPTION OF DRAWINGS

[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0042] Figure 1 is the implementation flowchart of the intelligent man-machine dialogue method provided by the embodiments of the present application;

[0043] Figure 2 is a schematic diagram of the preset topic graph in the intelligent man-machine dialogue method provided by the embodiments of the present application;

[0044] Figure 3 is a specific implementation flowchart of the intelligent man-machine conversation method S103 provided by the embodiments of the present application;

[0045] Figure 4 is a specific implementation flowchart of one of the methods for determining the theme of the system topic in the intelligent man-machine conversation method provided by the embodiments of the present application;

[0046] Figure 5 is a specific implementation flowchart of another of the methods for determining the theme of the system topic in the intelligent man-machine conversation method provided by the embodiments of the present application;

[0047] Figure 6 is a specific implementation flowchart of the method for determining the system statement of the current round in the intelligent man-machine conversation method provided by the embodiments of the present application;

[0048] Figure 7 is a structural block diagram of the intelligent man-machine conversation device provided by the embodiments of the present application;

[0049] Figure 8 is a schematic diagram of the intelligent device provided by the embodiments of the present application. DETAILED DESCRIPTION

[0050] In the following description, specific details are set forth in order to provide a thorough understanding of the embodiments of the present application. However, persons skilled in the art will understand that the present application can be practiced without these specific details. In other instances, well-known structures, devices, circuits, and methods have not been described in detail in order to avoid obscuring the description of the present application.

[0051] It should be understood that, when used in the specification and the appended claims of the present application, the term "comprising" indicates the presence of the described features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0052] It should also be understood that the term "and / or" used in the specification and the appended claims of the present application means any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.

[0053] As used in the specification and the appended claims, the term "if' can be interpreted as meaning "when" or "upon" or "in response to determining" or "in response to detecting" depending on the context. Similarly, the phrase "if it is determined" or "if [the described condition or event] is detected" can be interpreted to mean "upon determining" or "in response to determining" or "upon detecting [the described condition or event]" or "in response to detecting [the described condition or event]" depending on the context.

[0054] In addition, in the description of the present application and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0055] In the present application, the reference "one embodiment" or "some embodiments" and the like means that the specific features, structures or characteristics described in connection with the embodiment are included in one or more embodiments of the present application. Therefore, the statements "in one embodiment", "in some embodiments", "in other some embodiments", "in further some embodiments" and the like appearing in different places in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized. The terms "include", "contain", "have" and their variants mean "include but not limited to", unless otherwise specifically emphasized.

[0056] The intelligent man-machine conversation method provided by the embodiments of the present application can be applied to intelligent devices such as mobile devices and intelligent robots, and the embodiments of the present application do not make any limitation on the specific types of intelligent devices.

[0057] Figure 1 The implementation flow of the intelligent man-machine conversation method provided by the embodiments of the present application is shown, and the method flow includes steps S101 to S103. The specific implementation principles of each step are as follows:

[0058] S101: Obtain a current user statement and a system statement of a previous round, the current user statement being a user statement of a current round.

[0059] In the embodiments of the present application, the intelligent device receives a current user statement input by a user in a multi-round dialogue with the user, that is, a current user statement. One round of human-computer dialogue consists of one user statement and one system statement. The current round is a non-first round in the multi-round dialogue, and the current user statement is a user statement in a non-first round dialogue in the process of the multi-round dialogue. Once the intelligent device receives the current user statement, it obtains a system statement in a previous round of human-computer dialogue from historical dialogue information of the multi-round dialogue. The system statement in the previous round of human-computer dialogue is a feedback of the intelligent device to the user statement in the previous round of human-computer dialogue.

[0060] S102: input the current user statement and the system statement of the previous round into the trained topic consistency model to obtain a topic consistency judgment result, the topic consistency model being used for detecting whether the topics of statements are consistent.

[0061] In the embodiments of the present application, the topic consistency model is a pre-trained network model used for detecting whether the topics of statements are consistent. Whether the topics are consistent means whether the topics are the same. By inputting the current user statement and the system statement of the previous round into the trained topic consistency model, it is verified whether the topics of the current user statement and the system statement of the previous round are consistent.

[0062] In the embodiments, the purpose of verifying whether the topics of the current user statement and the system statement of the previous round are consistent is to provide a reference for whether the intelligent device shifts the topic in the current round of dialogue.

[0063] S103: generate and output a system statement of the current round according to the current user statement, the topic consistency judgment result, and a preset topic graph.

[0064] In the embodiments of the present application, the topic graph is pre-constructed. The topic graph can be constructed according to the application scene of human-computer dialogue and the function of the intelligent device. The topic graph is essentially a network structure describing the relationship between domains, topics, and entities of numerous topics. The topic graph is divided into three levels of domain, topic, and entity. One topic graph includes multiple domains, each domain has multiple topics, each topic includes an entity list, and the entity list has specific entity names.

[0065] The topic graph is generally generated by offline processing, but can be updated in real time according to user requirements. In some embodiments, the domain, topic, entity, and transfer probability are added or deleted according to the task scene, for example, applied to a certain take-out intelligent customer service, the probability of chatting about food can be increased.

[0066] In this embodiment, "domain" refers to broad categories. Common chat topics are divided into several broad categories (i.e., domains) based on certain commonalities. For example, domains include: sports, entertainment, food, learning, and emotions. Each domain contains several chat topics. For instance, the sports domain includes balls, basketball, table tennis, athletes, events, clubs, etc., while the entertainment domain includes movies, television, music, actors, games, etc. Each topic contains an entity list, where the entities are specific objects in the chat conversation. For example, the entity list corresponding to the athlete topic includes: Cristiano Ronaldo, Lionel Messi, LeBron James, James Harden… and Su Bingtian.

[0067] In the embodiments of this application, there are implicit connections between different topics in the same field, and explicit connections between topics in different fields.

[0068] For example, such as Figure 2 As shown, the ellipse represents the domain level, and domains are not directly connected; the rectangle in the domain represents the topic level, and different domains are explicitly connected through topics, while all topics under the same domain are implicitly connected, and the connection between topics is bidirectional; the black dot in the topic represents the entity level, and each topic has several entity lists, which contain specific objects in the chat.

[0069] In this embodiment, the connection format between topics is [topic1, topic2, template]. topic1 and topic2 are the two connected topics. The template consists of two parts: a template corpus for topic transfer and the weights of the two topics, i.e., the transfer probabilities. Some topics may be transferable to multiple topics, and their transfer probabilities may differ. Topics within the same domain are implicitly connected because they share certain commonalities and can be directly switched; the template can also be shared. Topics in different domains are explicitly connected, and these connections are made through specific topics, requiring template corpora designed for each topic. Topics with implicit connections have the same transfer probability, meaning that the topic can switch to any other topic within the same domain with equal probability. Topics in different domains are explicitly connected, with visible transfer paths, indicating that the topic can transfer to other connected topics within other domains. The template also includes transfer probabilities, representing the probability of the topic transferring to other domains.

[0070] In this embodiment, the transfer probability is preset, but it can be updated based on the user profile. For example, a basic topic transfer probability can be obtained through a relevance model. Then, based on the user profile, if a user is particularly interested in certain areas, the probability of transferring to those areas is increased on top of the basic transfer probability, while the probability of transferring to other areas is decreased accordingly.

[0071] Whether it is implicit connection or explicit connection, the connection between topics is bidirectional. For example, the topic switching from sports to food field needs to go through the path of football-athlete-nutrition meal-Sichuan cuisine, and the topic switching from food to sports field can go through the path of Sichuan cuisine-nutrition meal-athlete-football in reverse.

[0072] In some embodiments, the preset topic graph is stored in the form of a dictionary. The dictionary consists of two parts, key and value. The field is the highest level key, and the value corresponding to each field is a dictionary. The key is a number of topics and an implicit connection, and the value corresponding to the implicit connection is a set of template corpora with slots for all topics under the field. The slots can be replaced by topics; the value corresponding to each topic is also a dictionary, the key is an entity and an explicit connection, the value corresponding to the entity is an entity list, and the entity list contains specific entity names, such as athlete names under the athlete topic, C. Ronaldo, Messi, etc. Each entity has its own attributes, which are not explicitly shown in the topic graph but exist in the knowledge base. The value corresponding to the explicit connection is also a dictionary, the key is a number of other topics that can be transferred to other fields, and the value contains a list containing the transferred template corpus and transfer probability.

[0073] As a possible implementation of the present application, Figure 3 The specific implementation process of the intelligent man-machine conversation method provided by the embodiment of the present application is shown in step S103, which is described in detail as follows:

[0074] A1: Extract the entity in the current user sentence, and determine the topic of the current round of user topic and the field to which it belongs based on the entity and the preset topic graph.

[0075] In the embodiment of the present application, the key information contained in the current user sentence is extracted, wherein the key information specifically refers to the entity words contained in the user sentence. The entity extraction method can refer to the prior art, for example, a sequence labeling model such as BiLSTM+CRF can be used to extract the entity words in the user sentence, and the extraction method adopted is not limited here.

[0076] A2: According to the topic consistency judgment result, the preset topic graph and the topic of the current round of user topic and the field to which it belongs, determine the topic of the current round of system topic. The topic consistency judgment result includes topic consistency and topic inconsistency.

[0077] As a possible implementation of the present application, if the topic of the current round of user topic is inconsistent with the topic of the system statement of the previous round, the topic of the current round of user topic is directly determined as the topic of the current round of system topic, and the system statement of the current round is generated and output based on the topic of the current round of system topic. In this embodiment, the topic of the current user statement is inconsistent with the topic of the previous round of system statement, which means that the user has switched the topic, and the intelligent device determines the topic of the current round of user topic as the topic of the current round of system topic, so as to ensure the fluency of the dialogue and enhance the user experience.

[0078] As a possible implementation of the present application, Figure 4 It is shown that in the intelligent human-computer dialogue method provided by the embodiment of the present application, according to the topic consistency judgment result, the preset topic graph, the topic of the current round of user topic and the field thereof, a specific implementation process of determining the topic of the current round of system topic is determined, which is described in detail as follows:

[0079] B1: If the topic of the current round of user topic is consistent with the topic of the system statement of the previous round, the dialogue round number of the intelligent device and the current user is obtained. The dialogue round number is the dialogue round number of the user and the intelligent device up to the present.

[0080] B2: When the dialogue round number reaches the first specified round number, the historical topic is obtained, which is the topic of each round of dialogue except the current user statement. The topic of a round of dialogue includes the topic of the user topic and the topic of the system topic.

[0081] B3: If the historical topic is the same as the topic of the current round of user topic, the same field topic switching is performed according to the preset topic graph and the field of the topic of the current round of user topic.

[0082] In the embodiment of the present application, the topic switching is among the topics in the same field. In the preset topic graph, there are multiple topics in the same field, and the transition probability is the same. In a possible implementation, based on the preset topic graph, a topic is randomly selected from the multiple topics in the field of the topic of the current round of user topic for switching.

[0083] In the embodiment of the present application, the topics in the same field can be directly and randomly switched. For example, when the user and the intelligent device have dialogued for 3 rounds with football as the topic, at this time, the intelligent device switches the topic to basketball in the same field and outputs the system statement "Do you like basketball?", realizing the natural switching of the topic.

[0084] B4: The switched topic is determined as the topic of the current round of system topic.

[0085] In the embodiment of the present application, when the number of rounds of dialogue between the user and the intelligent device on the same topic reaches the first specified number of rounds, the topic switching in the same field is performed, the topic switching is naturally completed, the topic is effectively extended, and the interest of the user in the dialogue is improved.

[0086] As a possible implementation of the present application, Figure 5 Another specific implementation process of determining the topic of the current round of system topic according to the topic consistency judgment result, the preset topic graph, the topic of the current round of user topic and the field thereof, in the intelligent human-computer dialogue method provided by the embodiment of the present application is shown, and is described in detail as follows:

[0087] C1: If the topic of the current round of user topic is consistent with the topic of the previous round of system statement, the number of dialogue rounds between the intelligent device and the current user is obtained.

[0088] C2: When the number of dialogue rounds reaches the second specified number of rounds, the historical topic and the historical field thereof are obtained, the historical topic refers to the topic of each round of dialogue except the current user statement, and the historical field refers to the field to which the historical topic belongs. The second specified number of rounds is greater than or equal to the first specified number of rounds.

[0089] C3: The number of continuous topics is obtained, the number of continuous topics refers to the number of historical topics in which the historical field is the same as the field to which the topic of the current round of user topic belongs in the dialogue of the second specified number of rounds.

[0090] The continuous topic refers to the topic of a field in several rounds of dialogue, for example, the user and the intelligent device continuously dialogue for 10 rounds about football, volleyball and basketball in the sports field, and the number of topics involved is 3, and the number of continuous topics of the 10 rounds is 3.

[0091] C4: If the number of continuous topics reaches a preset number of topics, cross-field topic switching is performed according to the preset topic graph, the topic of the current round of user topic and the field thereof.

[0092] In the embodiment of the present application, the topic switching is among the topics in different fields, and the field to which the topic after the switching belongs is different from the field to which the topic of the current round of user topic belongs. The cross-field topic switching needs to be transitioned through a specific topic. Specifically, a specific topic in the field to which the topic of the current round of user topic belongs is determined according to the preset topic graph, the specific topic has a display connection with a topic in another field, and the topic is switched to the topic in the other field according to the specific topic and the display connection.

[0093] The specific topic can have display connections with multiple other-domain topics, with visible transfer paths and including transfer probabilities. When performing cross-domain topic switching, the other-domain topic corresponding to the display connection with the highest transfer probability is generally selected.

[0094] C5: determining the switched topic as the topic of the current round system topic.

[0095] Different-domain topic switching requires a specific topic to transition, for example, transitioning from the sports domain to the food domain, and the previous conversation is about football. The smart device outputs "What do you think of Sichuan cuisine?" The topic switching from football to Sichuan cuisine is abrupt and unnatural. The embodiments of the present application can naturally complete topic transfer through the transition of a specific topic. Illustratively, "The nutrition meals of football players are very light, and I still prefer Sichuan cuisine. Do you like it?", the smart device naturally transitions the topic from football in the sports domain to Sichuan cuisine in the food domain based on the specific topic of nutrition meals, implements cross-domain topic switching, effectively extends the topic, and thus improves the user's interest in the conversation.

[0096] In one possible implementation, the topic switching paths of system statements in a multi-round conversation process are recorded, and in the current conversation with the user, a repeated topic switching path is not selected. For example, if the record contains a topic switching path from topic A to topic B, the topic switching paths of A-B and B-A will not be triggered.

[0097] A3: generating and outputting a system statement of the current round based on the topic of the current round system topic.

[0098] In the embodiments of the present application, after determining the topic of the current round system topic, the smart device can generate and output a system statement of the current round according to the topic corpus template.

[0099] In the embodiments of the present application, the user can input a user statement in a voice manner or a text manner, and the smart device can output a system statement in a voice manner or a text manner.

[0100] In some embodiments, the output manner of the smart device system statement can be determined according to the manner of the user statement, that is, the output manner of the system statement is consistent with the input manner of the user statement. Illustratively, if the user statement is a text input, the smart device can output the system statement in a text output manner; if the user statement is a voice input, the smart device can output the system statement in a voice output manner.

[0101] In some other embodiments, the output mode of the system statement can be customized by the user, and the output mode of the system statement is irrelevant to the input mode of the user statement. For example, the user customizes the output mode of the system statement as voice, and the intelligent device outputs the system statement in voice mode regardless of whether the user inputs the user statement in voice mode or text mode.

[0102] As a possible implementation of the present application, as shown in Figure 6 The intelligent human-computer conversation method provided by the embodiment of the present application further includes:

[0103] D1: If the current round of system statement cannot be generated according to the current user statement, the theme consistency judgment result and the preset topic graph, a preset statement is randomly extracted from the preset corpus

[0104] D2: The preset statement is determined as the system statement output of the current round.

[0105] The preset corpus includes a plurality of preset statements, and the entities and themes in the preset statements are entities and themes in the preset topic graph. For example, when the current round of system statement cannot be generated according to the current user statement, the theme consistency judgment result and the preset topic graph, the intelligent device extracts a preset statement "I don't understand what you said, are you interested in XXX?" from the preset corpus, where XXX is a domain, theme or entity name in the topic graph.

[0106] In the embodiment of the present application, for the user statement from which the entity words cannot be extracted, the entity words of the user statement can be directly set as empty. If the topic thrown by the user does not belong to the domain, theme or entity in the topic graph, a preset statement is randomly extracted from the preset corpus as the system statement output of the current round, and the current conversation is guided to the domain covered by the preset topic graph, so as to ensure the fluency of the human-computer conversation.

[0107] In the embodiment of the present application, the current user statement and the system statement of the previous round are obtained, and then the current user statement and the system statement of the previous round are input into the trained theme consistency model to obtain a theme consistency judgment result. Then, the current round of system statement is generated and output according to the current user statement, the theme consistency judgment result and the preset topic graph. By judging whether the theme of the current conversation changes, combining the current user statement and the preset topic graph to determine and output the system statement, the present application can avoid the rigid and pure response type conversation, determine the appropriate conversation theme, and effectively, controllably and naturally realize the topic shift, so as to improve the interest of the user in the conversation interaction and enhance the user experience.

[0108] It should be understood that the size of the serial number of each step in the above embodiments does not mean the order of execution, and the execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0109] According to the intelligent man-machine conversation method described in the above embodiments, Figure 7 The structural block diagram of the intelligent man-machine conversation device provided by the embodiments of the present application is shown, and only the parts related to the embodiments of the present application are shown for ease of illustration.

[0110] Referring to Figure 7 The intelligent man-machine conversation device includes a user sentence acquisition unit 71, a theme consistency judgment unit 72, and a system sentence generation and output unit 73, wherein:

[0111] The user sentence acquisition unit 71 is configured to acquire a current user sentence and a system sentence of a previous round, and the current user sentence is a user sentence of a current round.

[0112] The theme consistency judgment unit 72 is configured to input the current user sentence and the system sentence of the previous round into a trained theme consistency model to obtain a theme consistency judgment result, and the theme consistency model is configured to detect whether the themes of the sentences are consistent.

[0113] The system sentence generation and output unit 73 is configured to generate and output a system sentence of the current round according to the current user sentence, the theme consistency judgment result, and a preset topic graph.

[0114] As a possible implementation of the present application, the system sentence generation and output unit 73 includes:

[0115] A user topic information determination module is configured to extract an entity in the current user sentence, and determine a theme of a current round user topic and a field to which the theme belongs based on the entity and a preset topic graph.

[0116] A system theme determination module is configured to determine a theme of a current round system topic according to the theme consistency judgment result, the preset topic graph, the theme of the current round user topic, and the field to which the theme belongs.

[0117] A system sentence generation and output module is configured to generate and output a system sentence of the current round based on the theme of the current round system topic.

[0118] As a possible implementation of the present application, the system theme determination module specifically includes:

[0119] The first dialogue round number acquisition module is configured to acquire a dialogue round number between the intelligent device and the current user if the topic of the current round user topic is consistent with the topic of the system statement of the previous round.

[0120] The first historical information acquisition module is configured to acquire historical topics when the dialogue round number reaches a first specified round number, the historical topics being topics of each round of dialogue other than the current user statement.

[0121] The first topic switching module is configured to perform same-domain topic switching according to the preset topic graph and the domain to which the topic of the current round user topic belongs if the historical topics are all the same as the topic of the current round user topic; and determine the switched topic as the topic of the current round system topic.

[0122] As a possible implementation of the present application, the preset topic graph has multiple topics under the same domain; and the first topic switching module is specifically configured to:

[0123] Randomly select a topic from the multiple topics under the domain to which the topic of the current round user topic belongs based on the preset topic graph and switch the topic.

[0124] As a possible implementation of the present application, the system statement generation and output unit 73 includes:

[0125] The second dialogue round number acquisition module is configured to acquire a dialogue round number between the intelligent device and the current user if the topic of the current round user topic is consistent with the topic of the system statement of the previous round.

[0126] The second historical information acquisition module is configured to acquire historical topics and their historical domains when the dialogue round number reaches a second specified round number, the historical topics being topics of each round of dialogue other than the current user statement, and the historical domains being domains to which the historical topics belong.

[0127] The continuous topic number acquisition module is configured to acquire a continuous topic number, the continuous topic number being a number of historical topics whose historical domains are the same as the domain to which the topic of the current round user topic belongs in the dialogue of the second specified round number.

[0128] The second topic switching module is configured to perform cross-domain topic switching according to the preset topic graph and the topic of the current round user topic and its domain if the continuous topic number reaches a preset topic number; and determine the switched topic as the topic of the current round system topic.

[0129] As a possible implementation of the present application, the intelligent man-machine dialogue device further includes:

[0130] a third topic switching module, configured to determine the topic of the current round of user topics as the topic of the current round of system topics if the topic of the current round of user topics is inconsistent with the topic of the system statement of the previous round;

[0131] a statement output module, configured to generate and output a system statement of the current round based on the topic of the current round of system topics.

[0132] As a possible implementation form of the present application, the intelligent man-machine dialogue device further comprises:

[0133] a preset statement extraction unit, configured to extract a preset statement from a preset corpus if the system statement of the current round cannot be generated based on the current user statement, the topic consistency determination result and the preset topic graph;

[0134] a preset statement output unit, configured to determine the preset statement as the system statement of the current round.

[0135] In the embodiments of the present application, the current user statement and the system statement of the previous round are obtained, and then the current user statement and the system statement of the previous round are input into the trained topic consistency model to obtain a topic consistency determination result. Then, the system statement of the current round is generated and output based on the current user statement, the topic consistency determination result and the preset topic graph. By judging whether the topic of the current dialogue changes, the system statement is determined and output in combination with the current user statement and the preset topic graph. This can avoid a rigid and pure response type dialogue, determine a suitable dialogue topic, effectively and controllably and naturally realize topic shift, thereby improving the interest of user dialogue interaction and enhancing user experience.

[0136] It should be noted that the information interaction, execution process and the like between the above device / unit are based on the same concept as the method embodiments of the present application. For specific functions and brought technical effects, refer to the method embodiments part, which will not be repeated here.

[0137] The embodiments of the present application further provide a computer readable storage medium, which stores a computer program. The computer program is executed by a processor to implement the steps of any one of the intelligent man-machine dialogue methods shown in Figures 1 to 6

[0138] The embodiments of the present application further provide an intelligent device, which comprises a memory, a processor and a computer program stored in the memory and executable on the processor. The processor implements the steps of any one of the intelligent man-machine dialogue methods shown in Figures 1 to 6

[0139] ​​The embodiments of the present application further provide a computer program product, which, when running on a server, causes the server to perform the steps of any of the intelligent man-machine conversation methods as Figures 1 to 6 indicated.

[0140] Figure 8 is a schematic diagram of an intelligent device provided by an embodiment of the present application. As shown in Figure 8 , the intelligent device 8 of this embodiment includes a processor 80, a memory 81, and a computer program 82 stored in the memory 81 and capable of running on the processor 80. The processor 80 implements the steps in each of the intelligent man-machine conversation method embodiments described above when executing the computer program 82, such as the steps S101-S103 shown in Figure 1 . Alternatively, the processor 80 implements the functions of each module / unit in each of the device embodiments described above when executing the computer program 82, such as the functions of the units 71-73 shown in Figure 7 .

[0141] For example, the computer program 82 can be divided into one or more modules / units, which are stored in the memory 81 and executed by the processor 80 to complete the present application. The one or more modules / units can be a series of computer readable instruction segments capable of completing a specific function, which are used to describe the execution process of the computer program 82 in the intelligent device 8.

[0142] The intelligent device 8 can include, but is not limited to, the processor 80 and the memory 81. Those skilled in the art can understand that Figure 8 the intelligent device 8 is only an example and does not constitute a limitation on the intelligent device 8, and can include more or fewer components than those shown, or combine certain components, or include different components, for example, the intelligent device 8 can also include an input / output device, a network access device, a bus, etc.

[0143] The processor 80 can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic components, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.

[0144] The memory 81 can be an internal storage unit of the smart device 8, for example, a hard disk or a memory of the smart device 8. The memory 81 can also be an external storage device of the smart device 8, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the smart device 8. Further, the memory 81 can also include both the internal storage unit and the external storage device of the smart device 8. The memory 81 is used to store the computer program and other programs and data required by the smart device. The memory 81 can also be used to temporarily store data that has been output or will be output.

[0145] It should be noted that the information interaction, execution process, etc. between the above devices / units, since based on the same concept as the method embodiments of the present application, the specific functions and the technical effects brought about, specific reference can be made to the method embodiments part, and will not be repeated here.

[0146] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above-mentioned division of each functional unit, module is exemplified, and in actual application, the above-mentioned functions can be completed by different functional units, modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit, module in the embodiment can be integrated in one processing unit, or each unit can be physically independent, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of software functional unit. In addition, the specific name of each functional unit, module is only for convenient distinction, and does not limit the protection scope of the present application. The specific working process of the unit, module in the above system can refer to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0147] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing related hardware, and the computer program can be stored in a computer readable storage medium. When the computer program is executed by a processor, the steps of the above-mentioned various method embodiments can be implemented. The computer program includes computer program code, which can be in the form of source code, object code, executable file or some intermediate form. The computer readable medium at least includes any entity or device capable of carrying the computer program code to the device / terminal equipment, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium. For example, U disk, mobile hard disk, magnetic disk or optical disk, etc. In some jurisdictions, according to legislation and patent practice, the computer readable medium can not be an electrical carrier signal and a telecommunication signal.

[0148] In the above embodiments, the description of each embodiment has its own focus, and the parts not described or recorded in detail in a certain embodiment can be referred to the relevant description of other embodiments.

[0149] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.

Claims

1. A method of intelligent human-machine dialog, characterized in that, The method comprises the following steps: obtaining a current user statement and a system statement of a previous round, the current user statement being a user statement of a current round; inputting the current user statement and the system statement of the previous round into a trained topic consistency model to obtain a topic consistency judgment result, the topic consistency model being used for detecting whether the topics of statements are consistent; generating and outputting a system statement of the current round according to the current user statement, the topic consistency judgment result and a preset topic graph, comprising the following steps: extracting an entity in the current user statement, and determining a topic of a user topic of the current round and a field to which the topic belongs based on the entity and the preset topic graph; determining a topic of a system topic of the current round according to the topic consistency judgment result, the preset topic graph, the topic of the user topic of the current round and the field to which the topic belongs, comprising the following steps: if the topic of the user topic of the current round is consistent with a topic of the system statement of the previous round, obtaining a round number of a dialogue between an intelligent device and a current user; when the round number of the dialogue reaches a first specified round number, obtaining a historical topic, the historical topic being a topic of each round of dialogue except the current user statement; if the historical topic is the same as the topic of the user topic of the current round, performing a same-field topic switching according to the preset topic graph and the field to which the topic of the user topic of the current round belongs; and determining a switched topic as the topic of the system topic of the current round; generating and outputting a system statement of the current round based on the topic of the system topic of the current round.

2. The intelligent human-to-computer dialog method of claim 1, wherein, In the preset topic graph, there are multiple topics under a same field; the step of performing the same-field topic switching according to the preset topic graph and the field to which the topic of the user topic of the current round belongs, comprising: randomly selecting a topic from multiple topics under the field to which the topic of the user topic of the current round belongs based on the preset topic graph to perform the switching.

3. The intelligent human-to-computer dialog method of claim 1, wherein, the step of determining the topic of the system topic of the current round according to the topic consistency judgment result, the preset topic graph, the topic of the user topic of the current round and the field to which the topic belongs, comprising: if the topic of the user topic of the current round is consistent with the topic of the system statement of the previous round, obtaining a round number of a dialogue between an intelligent device and a current user; when the round number of the dialogue reaches a second specified round number, obtaining a historical topic and a historical field to which the historical topic belongs, the historical topic being a topic of each round of dialogue except the current user statement, and the historical field being a field to which the historical topic belongs; obtaining a continuous topic number, the continuous topic number being a number of historical topics in the dialogue of the second specified round number, the historical topics being the same as the field to which the topic of the user topic of the current round belongs; if the continuous topic number reaches a preset topic number, performing a cross-field topic switching according to the preset topic graph and the topic of the user topic of the current round and the field to which the topic belongs; determining a switched topic as the topic of the system topic of the current round.

4. The intelligent human dialog method of claim 1, wherein, The intelligent man-machine dialogue method further comprises: if the topic of the current round of user topics is inconsistent with the topic of the system statement of the previous round, the topic of the current round of user topics is determined as the topic of the current round of system topics; based on the topic of the current round of system topics, a system statement of the current round is generated and output.

5. The intelligent man-machine dialog method according to any one of claims 1 to 4, characterized in that, The intelligent man-machine dialogue method further includes: if the system statement of the current round cannot be generated according to the current user statement, the topic consistency judgment result and the preset topic graph, a preset statement is randomly extracted from a preset corpus; the preset statement is determined as the system statement of the current round.

6. An intelligent human-to-computer dialog apparatus, characterized by, It includes: a user statement acquisition unit configured to acquire a current user statement and a system statement of a previous round, the current user statement being a user statement of a current round; a topic consistency judgment unit configured to input the current user statement and the system statement of the previous round into a trained topic consistency model to obtain a topic consistency judgment result, the topic consistency model being configured to detect whether the topics of the statements are consistent; a system statement generation and output unit configured to generate and output a system statement of a current round according to the current user statement, the topic consistency judgment result and a preset topic graph, the system statement generation and output unit including: a user topic information determination module configured to extract an entity in the current user statement and determine a topic of a current round of user topics and a field to which the topic belongs based on the entity and a preset topic graph; a system topic determination module configured to determine a topic of a current round of system topics according to the topic consistency judgment result, the preset topic graph, the topic of the current round of user topics and the field to which the topic belongs, including: if the topic of the current round of user topics is consistent with the topic of the system statement of the previous round, obtaining a dialogue round number of an intelligent device and a current user; when the dialogue round number reaches a first specified round number, obtaining a historical topic, the historical topic being a topic of each round of dialogue except the current user statement; if the historical topic is the same as the topic of the current round of user topics, performing a same-field topic switching according to the preset topic graph and the field to which the topic of the current round of user topics belongs; and determining the switched topic as the topic of the current round of system topics; a system statement generation and output module configured to generate and output a system statement of a current round based on the topic of the current round of system topics.

7. An intelligent device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the computer program to realize the intelligent man-machine dialogue method of any one of claims 1 to 5.

8. A computer-readable storage medium storing a computer program, the computer-readable storage medium comprising: The computer program is executed by the processor to realize the intelligent man-machine dialogue method of any one of claims 1 to 5.

Citation Information

Patent Citations

  • Multi-round automatic chat and conversation method and system based on deep learning

    CN107193978A

  • Conversation generation method and system, electronic equipment and readable storage medium

    CN112307188A