CN116842143A - Dialog simulation method and device based on artificial intelligence, electronic equipment and medium - Google Patents

Dialog simulation method and device based on artificial intelligence, electronic equipment and medium Download PDF

Info

Publication number
CN116842143A
CN116842143A CN202310146134.3A CN202310146134A CN116842143A CN 116842143 A CN116842143 A CN 116842143A CN 202310146134 A CN202310146134 A CN 202310146134A CN 116842143 A CN116842143 A CN 116842143A
Authority
CN
China
Prior art keywords
answer
dialogue
target
simulation
question
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310146134.3A
Other languages
Chinese (zh)
Inventor
李松岭
王科强
倪渊
陈思玥
郭招
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202310146134.3A priority Critical patent/CN116842143A/en
Publication of CN116842143A publication Critical patent/CN116842143A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/151Transformation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • G06F40/35Discourse or dialogue representation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Mathematical Physics (AREA)
  • Human Computer Interaction (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to the technical field of artificial intelligence, and provides a dialogue simulation method, a dialogue simulation device, an electronic device and a dialogue simulation medium based on artificial intelligence, wherein the method comprises the following steps: determining a target question-answer tree and a first query node based on the dialogue scene type; transmitting a first question of a first query node to a speech management model; receiving a first target answer of a first question output by a speech management model; transmitting a second question of a second query node to a semantic recognition model corresponding to the simulated user; receiving semantic answers output by the semantic recognition model in response to the second questions, and performing semantic conversion on the semantic answers to obtain second target answers; when the second target answer does not meet the constraint requirements of the simulation user, acquiring final dialogue content; and analyzing the final dialogue content to obtain an analysis result. According to the invention, the simulation dialogue is realized by determining the target question-answering tree based on the dialogue scene type, and the accuracy of the simulation dialogue content is improved.

Description

Dialog simulation method and device based on artificial intelligence, electronic equipment and medium
Technical Field
The invention relates to the technical field of artificial intelligence, in particular to a dialogue simulation method, a dialogue simulation device, an electronic device and a dialogue simulation medium based on artificial intelligence.
Background
With the development of artificial intelligence technology, when a task type dialogue system is developed, the rapid iteration of a model cannot be supported because the collection of interaction data of a real user is time-consuming and labor-consuming, and the prior art simulates dialogue contents by constructing a user simulator.
However, the existing user simulator is mainly realized through rules and statistical schemes, has poor generalization, and causes poor dialogue simulation effect, so that the simulated real user dialogue accuracy is low.
Disclosure of Invention
In view of the above, it is necessary to provide a dialogue simulation method, device, electronic device and medium based on artificial intelligence, which can realize simulation of dialogue by determining a target question-answer tree based on dialogue scene type, thereby improving accuracy of simulation dialogue content.
A first aspect of the present invention provides an artificial intelligence based dialog simulation method, the method comprising:
responding to the received dialogue simulation request, and acquiring a simulation user and dialogue scene types;
determining a target question-answering tree and a corresponding first query node based on the dialogue scene type;
performing at least one round of iterative simulation dialogue on the target question-answer tree until final dialogue content is obtained, wherein any one round of template dialogue in the at least one round of iterative simulation dialogue comprises:
Transmitting a first question of the first query node to a speech management model;
receiving a first target answer of a first question output by the speech management model;
determining a second query node based on the first target answer;
sending a second question of the second query node to a semantic recognition model corresponding to the simulation user;
receiving the semantic response output by the semantic recognition model, and performing semantic conversion on the semantic response to obtain a second target answer;
judging whether the second target answer meets the constraint requirement of the simulation user or not;
when the second target answer meets the constraint condition of the simulation user, determining a third query node based on the second target answer, and starting the next iteration simulation dialogue from the third query node; or alternatively
And when the second target answer does not meet the constraint requirements of the simulation user, acquiring the final dialogue content.
Optionally, the determining the target question-answer tree and the corresponding first query node based on the dialogue scene type includes:
when the dialogue scene type is a preset scene, matching a question-answer tree of each sub-scene associated with the preset scene from a preset database; according to a preset speaking sequence, a plurality of question-answer trees of all sub-scenes associated with the preset scene are associated, the associated question-answer tree is determined to be a target question-answer tree, and a first node of a first question-answer tree in the target question-answer tree is determined to be a first query node of the target question-answer tree; or alternatively
When the dialogue scene type is a sub-scene of a preset scene, matching a question-answer tree of the sub-scene from the preset database, determining the question-answer tree as a target question-answer tree, and determining a first node of the target question-answer tree as a first query node of the target question-answer tree.
Optionally, the determining whether the second target answer meets the constraint requirement of the simulated user includes:
identifying whether the second target answer matches a user image of the simulated user;
when the second target answer is completely matched with the user image of the simulation user, determining that the second target answer meets constraint requirements of the simulation user; or alternatively
And when the second target answer is not completely matched with the user image of the simulation user, determining that the second target answer does not meet the constraint requirement of the simulation user.
Optionally, performing semantic conversion on the semantic answer to obtain a second target answer includes:
judging the category of the semantic answer;
when the semantic answer is a key value pair type, the key value pair is used as a second target answer; or alternatively
When the semantic answer is of a semantic category, performing text conversion on the semantic answer to obtain a second target answer; or alternatively
When the semantic replies comprise a first semantic reply of a key value pair category and a second semantic reply of a semantic category, taking the first semantic reply as a first text, and performing text conversion on the second semantic reply to obtain a second text; and splicing the first text and the second text to obtain a second target answer.
Optionally, performing text conversion on the semantic answer to obtain a second target answer includes:
determining the intention and the entity of the semantic response according to the target question-answering tree;
traversing sentence templates matched with the intentions and the entities from a preset database according to the intentions and the entities;
and mapping the intention and the entity into corresponding sentence templates respectively to obtain a second target answer.
Optionally, after the acquiring the final dialog content, the method further comprises:
acquiring an initial template and a preset template of the dialogue scene type;
mapping the final dialogue content into the initial template to obtain a target template;
matching the target template with the preset template;
inquiring failure information from the matching result;
counting the number of dialogue rounds of the final dialogue content;
Calculating the coverage rate of the final dialogue content in the target dialogue content corresponding to the dialogue scene type;
and determining the failure information, the number of conversation rounds and the coverage rate as analysis results of the final conversation content.
Optionally, the method further comprises:
determining whether the final dialogue content meets sample requirements according to the analysis result;
when the final dialogue content meets the sample requirement, taking the final dialogue content as a training sample;
and retraining the speech surgery management model based on the training sample to obtain a target speech surgery management model.
A second aspect of the present invention provides an artificial intelligence based dialog simulation device, the device comprising:
the acquisition module is used for responding to the received dialogue simulation request and acquiring a simulation user and dialogue scene types;
the determining module is used for determining a target question-answer tree and a corresponding first query node based on the dialogue scene type;
the simulation dialogue module is used for carrying out at least one round of iterative simulation dialogue on the target question-answering tree until final dialogue content is obtained, wherein any round of template dialogue in the at least one round of iterative simulation dialogue comprises the following steps:
The sending module is used for sending the first problem of the first query node to a conversation management model;
the output module is used for receiving a first target answer of the first question output by the speech management model;
the determining module is further configured to determine a second query node based on the first target answer;
the sending module is further configured to send a second question of the second query node to a semantic recognition model corresponding to the simulated user;
the semantic conversion module is also used for receiving the semantic response output by the semantic recognition model and carrying out semantic conversion on the semantic response to obtain a second target answer;
the judging module is used for judging whether the second target answer meets the constraint requirement of the simulation user or not;
the determining module is further configured to determine a third query node based on the second target answer when the second target answer meets the constraint condition of the simulation user, and start performing a next iteration simulation session from the third query node; or alternatively
And the acquisition module is further used for acquiring final dialogue content when the second target answer does not meet the constraint requirement of the simulation user.
A third aspect of the invention provides an electronic device comprising a processor and a memory, the processor being arranged to implement the artificial intelligence based dialog simulation method when executing a computer program stored in the memory.
A fourth aspect of the present invention provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the artificial intelligence based dialog simulation method.
In summary, the dialog simulation method, device, electronic equipment and medium based on artificial intelligence can promote the construction of smart cities, are applied to the fields of smart architecture, smart security, smart communities, smart life, internet of things and the like, and have the advantages that the target question-answering tree and the corresponding first query node are determined based on the dialog scene type, and the determined target question-answering tree is more specific and reasonable based on the dialog scene type, so that the follow-up simulation dialog accuracy and efficiency are improved. And the second target answer is obtained by carrying out semantic conversion on the semantic answer, so that the simulation dialogue content is more visual and has strong readability. Judging whether the second target answer meets the constraint requirement of the simulation user, and increasing constraint conditions when constructing the user portrait so as to maintain the context consistency of the simulation user in the local dialogue, so that the simulated dialogue content is more real, and the accuracy of the simulated dialogue content is improved.
Drawings
Fig. 1 is a schematic diagram of an application environment of an artificial intelligence-based dialog simulation method according to an embodiment of the present invention.
Fig. 2 is a flowchart of a dialog simulation method based on artificial intelligence according to a second embodiment of the present invention.
Fig. 3 is a flowchart of a template dialogue of any round provided in the second embodiment of the present invention.
Fig. 4 is a block diagram of an artificial intelligence based dialog simulation device according to a third embodiment of the invention.
Fig. 5 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.
Detailed Description
In order that the above-recited objects, features and advantages of the present invention will be more clearly understood, a more particular description of the invention will be rendered by reference to specific embodiments thereof which are illustrated in the appended drawings. It should be noted that, without conflict, the embodiments of the present invention and features in the embodiments may be combined with each other.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.
Example 1
Referring to fig. 1, an application environment architecture diagram of an artificial intelligence-based dialog simulation method according to an embodiment of the invention is shown.
The artificial intelligence based dialog simulation method may be applied in an environment of one or more electronic devices, for example, an environment of a dialog manager 110 and a user simulator 120, where the dialog manager 110 is communicatively coupled to the user simulator 120.
Specifically, the dialog manager 110 performs dialog interaction with the user simulator 120 to implement dialog simulation.
Example two
Fig. 2 is a flowchart of a dialog simulation method based on artificial intelligence according to a second embodiment of the present invention.
In this embodiment, the dialog simulation method based on artificial intelligence may be applied to an electronic device, and for an electronic device that needs to perform dialog simulation, the dialog simulation function provided by the method of the present invention may be directly integrated on the electronic device, or may be run in the electronic device in the form of a software development kit (Software Development Kit, SDK).
The embodiment of the invention can acquire and process the related data based on the artificial intelligence technology. Among these, artificial intelligence (Artificial Intelligence, AI) is the theory, method, technique and application system that uses a digital computer or a digital computer-controlled machine to simulate, extend and extend human intelligence, sense the environment, acquire knowledge and use knowledge to obtain optimal results.
Artificial intelligence infrastructure technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a robot technology, a biological recognition technology, a voice processing technology, a natural language processing technology, machine learning, deep learning and other directions.
As shown in FIG. 2, the dialog simulation method based on artificial intelligence specifically includes the following steps, the order of the steps in the flowchart may be changed according to different requirements, and some may be omitted.
And 101, responding to the received dialogue simulation request, and acquiring a simulation user and a dialogue scene type.
In this embodiment, the existing intelligent dialogue management model has many applications in various industries, for example, is applied to medical digits, a collection scene, a customer requirement investigation scene, and the like, and a task type dialogue manager needs to be developed.
In this embodiment, the session simulation request refers to that a user requests the user simulator to perform a simulation session with the session manager, and when the electronic device receives the session simulation request, the session simulation request is parsed to obtain a session simulation message, and a simulation user and a session scene type are obtained from the session simulation message.
102, determining a target question-answering tree and a corresponding first query node based on the dialogue scene type.
In this embodiment, each node of the simulated dialogue is included in the target question-answering tree, and the next node can be determined according to one of the nodes of the target question-answering tree.
In an optional embodiment, the determining the target question-answering tree and the corresponding first query node based on the dialogue scene type includes:
when the dialogue scene type is a preset scene, matching a question-answer tree of each sub-scene associated with the preset scene from a preset database; according to a preset speaking sequence, a plurality of question-answer trees of all sub-scenes associated with the preset scene are associated, the associated question-answer tree is determined to be a target question-answer tree, and a first node of a first question-answer tree in the target question-answer tree is determined to be a first query node of the target question-answer tree; or alternatively
When the dialogue scene type is a sub-scene of a preset scene, matching a question-answer tree of the sub-scene from the preset database, determining the question-answer tree as a target question-answer tree, and determining a first node of the target question-answer tree as a first query node of the target question-answer tree.
In this embodiment, the dialog scene type includes a preset scene and sub-scenes of the preset scene, specifically, the preset scene includes at least one sub-scene, for example, the preset scene is a medical number, and the sub-scenes corresponding to the preset scene include a doctor-seeing scene, a review scene, a medicine purchasing scene, and the like.
In this embodiment, the target question-answering tree of the preset scene is formed by splicing question-answering trees of a plurality of sub-scenes, so that one target question-answering tree contains at least one question-answering tree.
In the embodiment, the target question-answering tree is determined based on the dialogue scene type, so that the determined target question-answering tree has more pertinence and rationality, and the accuracy and efficiency of the subsequent simulation dialogue are improved.
103, performing at least one round of iterative simulation dialogue on the target question-answer tree until the final dialogue content is obtained.
In this embodiment, the final dialog content refers to the complete simulation dialog content performed for the dialog simulation request.
Specifically, any one of the at least one set of iterative simulation dialogs specifically includes the following steps, as shown in fig. 3.
1031, sending the first question of the first query node to a session management model.
In this embodiment, in the process of performing a simulation session between the session manager and the user simulator, the interfaces of the user simulator and the session manager are logically: input external request-process the request internally-output response to external.
In this embodiment, the controller maintains simulated users of all roles created in the user simulator, tracks and processes session flow nodes through FST (Finite State Transducer ), which is specifically a dictionary index data structure for quickly locating the location of each query node.
In this embodiment, the dialog manager receives the first question sent by the controller in the user simulator and sends the first question to the dialog management model.
Specifically, the training process of the speech management model includes:
acquiring a historical dialogue corpus corresponding to the simulated user and the dialogue scene type, wherein the historical dialogue corpus comprises a question set and answers of each question;
Taking the historical dialog corpus as a sample data set;
and inputting the sample data set into a preset neural network for training to obtain a speech surgery management model.
In this embodiment, by inputting the first question into the speech management model, the speech management model may output a corresponding target answer.
In this embodiment, by adding a controller to the user simulator to perform message conversion and forwarding, the session flow is automatically performed, so that the complete session content is simulated, and the integrity of the acquired simulated session content is improved.
1032, receiving a first target answer to the first question output by the speech management model.
In this embodiment, when the speech management model outputs a first target answer to the first question, the controller receives the first target answer.
1033, determining a second query node based on the first target answer.
In this embodiment, when the controller receives the first target answer, the second query node is determined based on the first target answer traversing the target question-answer tree.
1034, sending the second question of the second query node to the semantic recognition model corresponding to the simulation user.
In this embodiment, when the controller determines a second query node, a second question of the second query node is sent to a semantic recognition model corresponding to the simulated user.
Specifically, the training process of the semantic recognition model includes:
acquiring a historical dialogue corpus corresponding to the simulated user and the dialogue scene type, wherein the historical dialogue corpus comprises a question set and semantic answers of each question;
extracting a first semantic feature set of each question and extracting a second semantic feature set of a semantic answer of each question;
taking the first semantic feature set and the second semantic feature set as sample data sets;
and inputting the sample data set into a preset neural network for training to obtain a semantic recognition model.
In this embodiment, the semantic recognition model outputs a semantic reply.
1035, receiving the semantic response output by the semantic recognition model in response to the second question, and performing semantic conversion on the semantic response to obtain a second target answer.
In this embodiment, the semantic recognition model is trained based on historical dialogue corpora of a plurality of simulated users for each character, and the training process is specifically described herein.
In this embodiment, the semantic recognition models corresponding to the simulated users with different roles are determined when the controller receives the second question, the second question is input into the semantic recognition model corresponding to the simulated user, and the semantic response is output.
In an alternative embodiment, prior to receiving a semantic reply output by the semantic recognition model in response to the second question, the method further comprises:
analyzing the dialogue simulation requirement to obtain configuration information of a simulation user;
and constructing a user portrait for the simulation user based on the configuration information.
In this embodiment, the configuration information includes a plurality of probabilities, and each probability is used to characterize the preference degree of the simulated user for generating the question answer in the dialogue flow.
In this embodiment, a reasonable probability value is set in the configuration information, and a user portrait is built for the simulated user based on the configuration information, and then a large number of conversations are simulated, so that the user portrait can cover the whole conversation process more completely.
In this embodiment, in the process of constructing the user portrait, some constraint conditions are added to the configuration information to maintain the consistency of the context of the simulation user in the local dialogue, so that the simulated dialogue content is more real, and the accuracy of the simulated dialogue content is improved.
Specifically, the constraint may be that the simulated user has replied to the current question, for example: the current problem is: what is you going to zone a using? Before answering the current question, the user already shows that he/she makes a high-speed rail to the area A, and determines that the simulation user has already answered the current question; alternatively, the constraints may simulate that the user does not answer correctly for the current question, e.g., the current question is: what is you going to zone a using? The answer to the simulated user is: today it is very good to determine that the simulated user does not answer correctly for the current question.
In the embodiment, the constraint condition is set in the user portrait, so that the conversation of the simulation user is more real, and the accuracy of the conversation simulating content is improved.
In an optional embodiment, the performing semantic conversion on the semantic answer to obtain a second target answer includes:
judging the category of the semantic answer;
when the semantic answer is a key value pair type, the key value pair is used as a second target answer; or alternatively
When the semantic answer is of a semantic category, performing text conversion on the semantic answer to obtain a second target answer; or alternatively
When the semantic replies comprise a first semantic reply of a key value pair category and a second semantic reply of a semantic category, taking the first semantic reply as a first text, and performing text conversion on the second semantic reply to obtain a second text; and splicing the first text and the second text to obtain a second target answer.
In this embodiment, the category of semantic replies includes one or more of the following combinations: key value pair category; the semantic category, specifically, for the category of key value pairs, directly taking the key value pairs as generated text; and performing text conversion aiming at the semantic category to obtain a second target answer.
Further, performing text conversion on the semantic answer to obtain a second target answer includes:
determining the intention and the entity of the semantic response according to the target question-answering tree;
traversing sentence templates matched with the intentions and the entities from a preset database according to the intentions and the entities;
and mapping the intention and the entity into corresponding sentence templates respectively to obtain a second target answer.
In this embodiment, when the second target answer considers the semantics, determining a node of the second question from the target question-answering tree, acquiring a preset intention and entity from the node of the second question of the target question-answering tree, taking the intention and entity as the intention and entity of the semantic answer, and matching sentence templates corresponding to the intention and entity from a preset database, for example, the intention is: removing the bank A; the entity is: m buses, the sentence template that corresponds is: taking XXX to the XXX bank; mapping the intent and the entity to the sentence template to obtain a second target answer as follows: taking M buses to go to A banks.
In this embodiment, since the semantic representation is inconvenient for the user to watch, the semantic answer is converted into the text, that is, the second target answer, so that the content of the simulated dialogue is more intuitive and has strong readability, and meanwhile, the second target answer is adopted for the simulated dialogue analysis in the follow-up process, so that the accuracy of the simulated dialogue analysis is improved.
1036, judging whether the second target answer meets the constraint requirements of the simulation user.
In this embodiment, constraint conditions may be set in advance for the simulation user, specifically, the constraint conditions are set in the user image of the simulation user.
In an alternative embodiment, the determining whether the second target answer meets the constraint requirements of the simulated user includes:
identifying whether the second target answer matches a user image of the simulated user;
when the second target answer is completely matched with the user image of the simulation user, determining that the second target answer meets constraint requirements of the simulation user; or alternatively
And when the second target answer is not completely matched with the user image of the simulation user, determining that the second target answer does not meet the constraint requirement of the simulation user.
In this embodiment, whether the simulation session process can be performed may be determined by determining whether the second target answer matches the user image of the simulation user.
1037, when the second target answer meets the constraint condition of the simulation user, determining a third query node based on the second target answer, and starting to conduct the next iteration simulation dialogue from the third query node.
In this embodiment, when the second target answer meets the constraint condition of the simulation user, it is determined to continue the simulation session flow.
And 1038, when the second target answer does not meet the constraint requirements of the simulation user, acquiring final dialogue content.
In this embodiment, the final dialogue content is the complete dialogue content performed by the pointer to the dialogue simulation request, and the final dialogue content includes the target questions of each round of simulation dialogue and the target answers corresponding to the target questions, for example, the first question and the first target answer of the first question, the second question and the second target answer of the second question.
Specifically, when the second target answer does not meet the constraint condition of the simulation user, determining that the simulation dialogue flow cannot continue, directly ending the simulation dialogue flow, and obtaining the completed simulation dialogue content as final dialogue content.
In an alternative embodiment, after the obtaining the final dialog content, the method further comprises:
and analyzing the final dialogue content to obtain an analysis result.
In this embodiment, when the final dialog content is obtained, the final dialog content needs to be analyzed, for example, the final dialog content may be converted into a log or report in a specific format, so that the final dialog content may be further analyzed at a later stage.
Further, the analyzing the final dialogue content to obtain an analysis result includes:
acquiring an initial template and a preset template of the dialogue scene type;
mapping the final dialogue content into the initial template to obtain a target template;
matching the target template with the preset template;
inquiring failure information from the matching result;
counting the number of dialogue rounds of the final dialogue content;
calculating the coverage rate of the final dialogue content in the target dialogue content corresponding to the dialogue scene type;
and determining the failure information, the number of conversation rounds and the coverage rate as analysis results of the final conversation content.
In this embodiment, the initial template is used to represent a blank template of a dialog scene type, and the preset template is used to represent a template generated based on a preset dialog content of the dialog scene type, where the target dialog content is a preset dialog content corresponding to the dialog scene type.
In this embodiment, when the final dialog content is analyzed, the quality of the template dialog of the time may be evaluated by the calculated number of dialog rounds, the coverage rate of the final dialog content in the target dialog content, and the located failure information, where the failure information includes a dialog content identifier and failed dialog content.
Further, the method further comprises:
determining whether the final dialogue content meets sample requirements according to the analysis result;
when the final dialogue content meets the sample requirement, taking the final dialogue content as a training sample;
and retraining the speech surgery management model based on the training sample to obtain a target speech surgery management model.
In this embodiment, the sample requirement may be that the coverage rate in the analysis result is greater than or equal to a preset coverage rate threshold, or that the number of dialogues in the analysis result is greater than or equal to a preset dialog number threshold. Sample requirements may be set according to the actual scenario, without limitation.
In this embodiment, when the final dialogue content meets the sample requirement, the final dialogue content may be used as a training sample to train the dialogue management model, and the simulated dialogue content is used as the training sample to train the dialogue management model continuously through the simulated dialogue content, so as to improve the robustness of the dialogue management model, and meanwhile, without online collection of the real dialogue information of the user, improve the update iteration rate of the dialogue management model, and further improve the accuracy of the simulated dialogue content.
In summary, according to the dialog simulation method based on artificial intelligence of the present embodiment, the target question-answering tree and the corresponding first query node are determined based on the dialog scene type, and the target question-answering tree is determined based on the dialog scene type, so that the determined target question-answering tree has better pertinence and rationality, and further the accuracy and efficiency of the subsequent simulation dialog are improved. And the second target answer is obtained by carrying out semantic conversion on the semantic answer, so that the simulation dialogue content is more visual and has strong readability. Judging whether the second target answer meets the constraint requirement of the simulation user, and increasing constraint conditions when constructing the user portrait so as to maintain the context consistency of the simulation user in the local dialogue, so that the simulated dialogue content is more real, and the accuracy of the simulated dialogue content is improved.
In addition, the obtained final dialogue content is analyzed, the dialogue management model is retrained based on the analysis result, the target dialogue management model is obtained, the simulation dialogue content is utilized to train the dialogue management model, the robustness of the dialogue management model is improved, meanwhile, the real dialogue information of a user is not required to be collected online, the updating iteration rate of the dialogue management model is improved, and the accuracy of the simulation dialogue content is further improved.
Example III
Fig. 4 is a block diagram of an artificial intelligence based dialog simulation device according to a third embodiment of the invention.
In some embodiments, the artificial intelligence based dialog simulation device 20 may include a plurality of functional modules composed of program code segments. Program code for each program segment in the artificial intelligence based dialog simulation apparatus 20 may be stored in a memory of the electronic device and executed by the at least one processor to perform the functions of dialog simulation (described in detail with reference to fig. 1-3).
In this embodiment, the dialog simulation device 20 based on artificial intelligence may be divided into a plurality of functional modules according to the functions performed by the dialog simulation device. The functional module may include: the device comprises an acquisition module 201, a determination module 202, a simulation dialogue module 203, a sending module 204, an output module 205, a semantic conversion module 206, a judgment module 207 and an analysis module 208. The module referred to herein is a series of computer readable instructions capable of being executed by at least one processor and of performing a fixed function, stored in a memory. In the present embodiment, the functions of the respective modules will be described in detail in the following embodiments.
An obtaining module 201, configured to obtain a simulated user and a dialog scene type in response to the received dialog simulation request.
In this embodiment, the existing intelligent dialogue management model has many applications in various industries, for example, is applied to medical digits, a collection scene, a customer requirement investigation scene, and the like, and a task type dialogue manager needs to be developed.
In this embodiment, the session simulation request refers to that a user requests the user simulator to perform a simulation session with the session manager, and when the electronic device receives the session simulation request, the session simulation request is parsed to obtain a session simulation message, and a simulation user and a session scene type are obtained from the session simulation message.
A determining module 202 is configured to determine a target question-answer tree and a corresponding first query node based on the dialogue scene type.
In this embodiment, each node of the simulated dialogue is included in the target question-answering tree, and the next node can be determined according to one of the nodes of the target question-answering tree.
In an alternative embodiment, the determining module 202 determines the target question-answer tree and the corresponding first query node based on the dialogue scene type includes:
when the dialogue scene type is a preset scene, matching a question-answer tree of each sub-scene associated with the preset scene from a preset database; according to a preset speaking sequence, a plurality of question-answer trees of all sub-scenes associated with the preset scene are associated, the associated question-answer tree is determined to be a target question-answer tree, and a first node of a first question-answer tree in the target question-answer tree is determined to be a first query node of the target question-answer tree; or alternatively
When the dialogue scene type is a sub-scene of a preset scene, matching a question-answer tree of the sub-scene from the preset database, determining the question-answer tree as a target question-answer tree, and determining a first node of the target question-answer tree as a first query node of the target question-answer tree.
In this embodiment, the dialog scene type includes a preset scene and sub-scenes of the preset scene, specifically, the preset scene includes at least one sub-scene, for example, the preset scene is a medical number, and the sub-scenes corresponding to the preset scene include a doctor-seeing scene, a review scene, a medicine purchasing scene, and the like.
In this embodiment, the target question-answering tree of the preset scene is formed by splicing question-answering trees of a plurality of sub-scenes, so that one target question-answering tree contains at least one question-answering tree.
In the embodiment, the target question-answering tree is determined based on the dialogue scene type, so that the determined target question-answering tree has more pertinence and rationality, and the accuracy and efficiency of the subsequent simulation dialogue are improved.
And the simulation dialogue module 203 is configured to perform at least one iteration simulation dialogue on the target question-answer tree until final dialogue content is obtained.
In this embodiment, the final dialog content refers to the complete simulation dialog content performed for the dialog simulation request.
Specifically, any one of the at least one set of iterative simulation dialogs specifically includes the following steps, as shown in fig. 3.
And the sending module 204 is configured to send the first question of the first query node to a session management model.
In this embodiment, in the process of performing a simulation session between the session manager and the user simulator, in this embodiment, the interfaces of the user simulator and the session manager are both logically: input external request-process the request internally-output response to external.
In this embodiment, the controller maintains simulated users of all roles created in the user simulator, tracks and processes session flow nodes through FST (Finite State Transducer ), which is specifically a dictionary index data structure for quickly locating the location of each query node.
In this embodiment, the dialog manager receives the first question sent by the controller in the user simulator and sends the first question to the dialog management model.
Specifically, the training process of the speech management model includes:
acquiring a historical dialogue corpus corresponding to the simulated user and the dialogue scene type, wherein the historical dialogue corpus comprises a question set and answers of each question;
taking the historical dialog corpus as a sample data set;
and inputting the sample data set into a preset neural network for training to obtain a speech surgery management model.
In this embodiment, by inputting the first question into the speech management model, the speech management model may output a corresponding target answer.
In this embodiment, by adding a controller to the user simulator to perform message conversion and forwarding, the session flow is automatically performed, so that the complete session content is simulated, and the integrity of the acquired simulated session content is improved.
And the output module 205 is configured to receive a first target answer of the first question output by the speech management model.
In this embodiment, when the speech management model outputs a first target answer to the first question, the controller receives the first target answer.
The determining module 205 is further configured to determine a second query node based on the first target answer.
In this embodiment, when the controller receives the first target answer, the second query node is determined based on the first target answer traversing the target question-answer tree.
The sending module 204 is further configured to send a second question of the second query node to a semantic recognition model corresponding to the simulated user.
In this embodiment, when the controller determines a second query node, a second question of the second query node is sent to a semantic recognition model corresponding to the simulated user.
Specifically, the training process of the semantic recognition model includes:
acquiring a historical dialogue corpus corresponding to the simulated user and the dialogue scene type, wherein the historical dialogue corpus comprises a question set and semantic answers of each question;
extracting a first semantic feature set of each question and extracting a second semantic feature set of a semantic answer of each question;
Taking the first semantic feature set and the second semantic feature set as sample data sets;
and inputting the sample data set into a preset neural network for training to obtain a semantic recognition model.
In this embodiment, the semantic recognition model outputs a semantic reply.
The semantic conversion module 206 is configured to receive a semantic response output by the semantic recognition model in response to the second question, and perform semantic conversion on the semantic response to obtain a second target answer.
In this embodiment, the semantic recognition model is trained based on historical dialogue corpora of a plurality of simulated users for each character, and the training process is specifically described herein.
In this embodiment, the semantic recognition models corresponding to the simulated users with different roles are determined when the controller receives the second question, the second question is input into the semantic recognition model corresponding to the simulated user, and the semantic response is output.
In an alternative embodiment, before the semantic conversion module 206 receives the semantic response output by the semantic recognition model in response to the second question, the method further comprises:
Analyzing the dialogue simulation requirement to obtain configuration information of a simulation user;
and constructing a user portrait for the simulation user based on the configuration information.
In this embodiment, the configuration information includes a plurality of probabilities, and each probability is used to characterize the preference degree of the simulated user for generating the question answer in the dialogue flow.
In this embodiment, a reasonable probability value is set in the configuration information, and a user portrait is built for the simulated user based on the configuration information, and then a large number of conversations are simulated, so that the user portrait can cover the whole conversation process more completely.
In this embodiment, in the process of constructing the user portrait, some constraint conditions are added to the configuration information to maintain the consistency of the context of the simulation user in the local dialogue, so that the simulated dialogue content is more real, and the accuracy of the simulated dialogue content is improved.
Specifically, the constraint may be that the simulated user has replied to the current question, for example: the current problem is: what is you going to zone a using? Before answering the current question, the user already shows that he/she makes a high-speed rail to the area A, and determines that the simulation user has already answered the current question; alternatively, the constraints may simulate that the user does not answer correctly for the current question, e.g., the current question is: what is you going to zone a using? The answer to the simulated user is: today it is very good to determine that the simulated user does not answer correctly for the current question.
In the embodiment, the constraint condition is set in the user portrait, so that the conversation of the simulation user is more real, and the accuracy of the conversation simulating content is improved.
In an alternative embodiment, the semantic conversion module 206 performs semantic conversion on the semantic answer, and obtaining the second target answer includes:
judging the category of the semantic answer;
when the semantic answer is a key value pair type, the key value pair is used as a second target answer; or alternatively
When the semantic answer is of a semantic category, performing text conversion on the semantic answer to obtain a second target answer; or alternatively
When the semantic replies comprise a first semantic reply of a key value pair category and a second semantic reply of a semantic category, taking the first semantic reply as a first text, and performing text conversion on the second semantic reply to obtain a second text; and splicing the first text and the second text to obtain a second target answer.
In this embodiment, the category of semantic replies includes one or more of the following combinations: key value pair category; the semantic category, specifically, for the category of key value pairs, directly taking the key value pairs as generated text; and performing text conversion aiming at the semantic category to obtain a second target answer.
Further, performing text conversion on the semantic answer to obtain a second target answer includes:
determining the intention and the entity of the semantic response according to the target question-answering tree;
traversing sentence templates matched with the intentions and the entities from a preset database according to the intentions and the entities;
and mapping the intention and the entity into corresponding sentence templates respectively to obtain a second target answer.
In this embodiment, when the second target answer considers the semantics, determining a node of the second question from the target question-answering tree, acquiring a preset intention and entity from the node of the second question of the target question-answering tree, taking the intention and entity as the intention and entity of the semantic answer, and matching sentence templates corresponding to the intention and entity from a preset database, for example, the intention is: removing the bank A; the entity is: m buses, the sentence template that corresponds is: taking XXX to the XXX bank; mapping the intent and the entity to the sentence template to obtain a second target answer as follows: taking M buses to go to A banks.
In this embodiment, since the semantic representation is inconvenient for the user to watch, the semantic answer is converted into the text, that is, the second target answer, so that the content of the simulated dialogue is more intuitive and has strong readability, and meanwhile, the second target answer is adopted for the simulated dialogue analysis in the follow-up process, so that the accuracy of the simulated dialogue analysis is improved.
A judging module 207, configured to judge whether the second target answer meets the constraint requirement of the simulation user.
In this embodiment, constraint conditions may be set in advance for the simulation user, specifically, the constraint conditions are set in the user image of the simulation user.
In an alternative embodiment, the determining module 207 determining whether the second target answer meets the constraint requirements of the simulated user includes:
identifying whether the second target answer matches the user portrait of the simulated user and identifying whether the second target answer matches the user portrait of the simulated user;
when the second target answer is completely matched with the user image of the simulation user, determining that the second target answer meets constraint requirements of the simulation user; or alternatively
And when the second target answer is not completely matched with the user image of the simulation user, determining that the second target answer does not meet the constraint requirement of the simulation user.
In this embodiment, whether the simulation session process can be performed may be determined by determining whether the second target answer matches the user image of the simulation user.
The determining module 202 is further configured to determine a third query node based on the second target answer when the second target answer meets the constraint condition of the simulation user, and start performing a next iteration simulation session from the third query node.
In this embodiment, when the second target answer meets the constraint condition of the simulation user, it is determined to continue the simulation session flow.
The obtaining module 201 is further configured to obtain final dialogue content when the second target answer does not meet the constraint requirement of the simulated user.
In this embodiment, the final dialogue content is the complete dialogue content performed by the pointer to the dialogue simulation request, and the final dialogue content includes the target questions of each round of simulation dialogue and the target answers corresponding to the target questions, for example, the first question and the first target answer of the first question, the second question and the second target answer of the second question.
Specifically, when the second target answer does not meet the constraint condition of the simulation user, determining that the simulation dialogue flow cannot continue, directly ending the simulation dialogue flow, and obtaining the completed simulation dialogue content as final dialogue content.
Further, after the final dialogue content is obtained, an analysis module 208 is configured to analyze the final dialogue content to obtain an analysis result.
In this embodiment, when the final dialog content is obtained, the final dialog content needs to be analyzed, for example, the final dialog content may be converted into a log or report in a specific format, so that the final dialog content may be further analyzed at a later stage.
Specifically, the analysis module 208 analyzes the final dialog content, and the analysis result includes:
acquiring an initial template and a preset template of the dialogue scene type;
mapping the final dialogue content into the initial template to obtain a target template;
matching the target template with the preset template;
inquiring failure information from the matching result;
counting the number of dialogue rounds of the final dialogue content;
calculating the coverage rate of the final dialogue content in the target dialogue content corresponding to the dialogue scene type;
and determining the failure information, the number of conversation rounds and the coverage rate as analysis results of the final conversation content.
In this embodiment, the initial template is used to represent a blank template of a dialog scene type, and the preset template is used to represent a template generated based on a preset dialog content of the dialog scene type, where the target dialog content is a preset dialog content corresponding to the dialog scene type.
In this embodiment, when the final dialog content is analyzed, the quality of the template dialog of the time may be evaluated by the calculated number of dialog rounds, the coverage rate of the final dialog content in the target dialog content, and the located failure information, where the failure information includes a dialog content identifier and failed dialog content.
Further, according to the analysis result, determining whether the final dialogue content meets sample requirements; when the final dialogue content meets the sample requirement, taking the final dialogue content as a training sample; and retraining the speech surgery management model based on the training sample to obtain a target speech surgery management model.
In this embodiment, the sample requirement may be that the coverage rate in the analysis result is greater than or equal to a preset coverage rate threshold, or that the number of dialogues in the analysis result is greater than or equal to a preset dialog number threshold. Sample requirements may be set according to the actual scenario, without limitation.
In this embodiment, when the final dialogue content meets the sample requirement, the final dialogue content may be used as a training sample to train the dialogue management model, and the simulated dialogue content is used as the training sample to train the dialogue management model continuously through the simulated dialogue content, so as to improve the robustness of the dialogue management model, and meanwhile, without online collection of the real dialogue information of the user, improve the update iteration rate of the dialogue management model, and further improve the accuracy of the simulated dialogue content.
In summary, according to the dialog simulation device based on artificial intelligence of the present embodiment, the target question-answering tree and the corresponding first query node are determined based on the dialog scene type, and the target question-answering tree is determined based on the dialog scene type, so that the determined target question-answering tree has better pertinence and rationality, and further the accuracy and efficiency of the subsequent simulation dialog are improved. And the second target answer is obtained by carrying out semantic conversion on the semantic answer, so that the simulation dialogue content is more visual and has strong readability. Judging whether the second target answer meets the constraint requirement of the simulation user, and increasing constraint conditions when constructing the user portrait so as to maintain the context consistency of the simulation user in the local dialogue, so that the simulated dialogue content is more real, and the accuracy of the simulated dialogue content is improved.
In addition, the obtained final dialogue content is analyzed, the dialogue management model is retrained based on the analysis result, the target dialogue management model is obtained, the simulation dialogue content is utilized to train the dialogue management model, the robustness of the dialogue management model is improved, meanwhile, the real dialogue information of a user is not required to be collected online, the updating iteration rate of the dialogue management model is improved, and the accuracy of the simulation dialogue content is further improved.
Example IV
Fig. 5 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention. In the preferred embodiment of the invention, the electronic device 3 comprises a memory 31, at least one processor 32, at least one communication bus 33 and a transceiver 34.
It will be appreciated by those skilled in the art that the configuration of the electronic device shown in fig. 5 is not limiting of the embodiments of the present invention, and that either a bus-type configuration or a star-type configuration is possible, and that the electronic device 3 may also include more or less other hardware or software than that shown, or a different arrangement of components.
In some embodiments, the electronic device 3 is an electronic device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and its hardware includes, but is not limited to, a microprocessor, an application specific integrated circuit, a programmable gate array, a digital processor, an embedded device, and the like. The electronic device 3 may further include a client device, where the client device includes, but is not limited to, any electronic product that can interact with a client by way of a keyboard, a mouse, a remote control, a touch pad, or a voice control device, such as a personal computer, a tablet computer, a smart phone, a digital camera, etc.
It should be noted that the electronic device 3 is only used as an example, and other electronic products that may be present in the present invention or may be present in the future are also included in the scope of the present invention by way of reference.
In some embodiments, the memory 31 is used to store program code and various data, such as the artificial intelligence based dialog simulation device 20 installed in the electronic device 3, and to enable high speed, automatic access to programs or data during operation of the electronic device 3. The Memory 31 includes Read-Only Memory (ROM), programmable Read-Only Memory (PROM), erasable programmable Read-Only Memory (EPROM), one-time programmable Read-Only Memory (One-time Programmable Read-Only Memory, OTPROM), electrically erasable rewritable Read-Only Memory (EEPROM), compact disc Read-Only Memory (Compact Disc Read-Only Memory, CD-ROM) or other optical disc Memory, magnetic tape Memory, or any other medium that can be used for computer-readable carrying or storing data.
In some embodiments, the at least one processor 32 may be comprised of an integrated circuit, for example, a single packaged integrated circuit, or may be comprised of multiple integrated circuits packaged with the same or different functions, including one or more central processing units (Central Processing unit, CPU), microprocessors, digital processing chips, graphics processors, combinations of various control chips, and the like. The at least one processor 32 is a Control Unit (Control Unit) of the electronic device 3, connects the respective components of the entire electronic device 3 using various interfaces and lines, and executes various functions of the electronic device 3 and processes data by running or executing programs or modules stored in the memory 31 and calling data stored in the memory 31.
In some embodiments, the at least one communication bus 33 is arranged to enable connected communication between the memory 31 and the at least one processor 32 or the like.
Although not shown, the electronic device 3 may further include a power source (such as a battery) for powering the various components, and optionally, the power source may be logically connected to the at least one processor 32 via a power management device, thereby implementing functions such as managing charging, discharging, and power consumption by the power management device. The power supply may also include one or more of any of a direct current or alternating current power supply, recharging device, power failure detection circuit, power converter or inverter, power status indicator, etc. The electronic device 3 may further include various sensors, bluetooth modules, wi-Fi modules, etc., which will not be described herein.
It should be understood that the embodiments described are for illustrative purposes only and are not limited to this configuration in the scope of the patent application.
The integrated units implemented in the form of software functional modules described above may be stored in a computer readable storage medium. The software functional modules described above are stored in a storage medium and include instructions for causing a computer device (which may be a personal computer, an electronic device, or a network device, etc.) or a processor (processor) to perform portions of the methods described in the various embodiments of the invention.
In a further embodiment, in connection with fig. 4, the at least one processor 32 may execute the operating means of the electronic device 3 as well as various types of applications installed (e.g., the artificial intelligence based dialog simulation device 20), program code, etc., such as the various modules described above.
The memory 31 has program code stored therein, and the at least one processor 32 can invoke the program code stored in the memory 31 to perform related functions. For example, each of the modules depicted in fig. 4 is a program code stored in the memory 31 and executed by the at least one processor 32 to perform the functions of the respective modules for dialog simulation purposes.
Illustratively, the program code may be partitioned into one or more modules/units that are stored in the memory 31 and executed by the processor 32 to perform the present application. The one or more modules/units may be a series of computer readable instruction segments capable of performing the specified functions, which instruction segments describe the execution of the program code in the electronic device 3. For example, the program code may be divided into an acquisition module 201, a determination module 202, an analog dialog module 203, a transmission module 204, an output module 205, a semantic conversion module 206, a judgment module 207, and an analysis module 208.
In one embodiment of the application, the memory 31 stores a plurality of computer readable instructions that are executed by the at least one processor 32 to implement the functionality of dialog simulation.
Specifically, the specific implementation method of the above instruction by the at least one processor 32 may refer to descriptions of related steps in the corresponding embodiments of fig. 1 to 3, which are not repeated herein.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be other manners of division when actually implemented.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units can be realized in a form of hardware or a form of hardware and a form of software functional modules.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof. The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned. Furthermore, it will be obvious that the term "comprising" does not exclude other elements or that the singular does not exclude a plurality. The units or means stated in the invention may also be implemented by one unit or means, either by software or hardware. The terms first, second, etc. are used to denote a name, but not any particular order.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the technical solution of the present invention without departing from the spirit and scope of the technical solution of the present invention.

Claims (10)

1. A dialog simulation method based on artificial intelligence, the method comprising:
responding to the received dialogue simulation request, and acquiring a simulation user and dialogue scene types;
determining a target question-answering tree and a corresponding first query node based on the dialogue scene type;
performing at least one round of iterative simulation dialogue on the target question-answer tree until final dialogue content is obtained, wherein any one round of template dialogue in the at least one round of iterative simulation dialogue comprises:
transmitting a first question of the first query node to a speech management model;
receiving a first target answer of a first question output by the speech management model;
determining a second query node based on the first target answer;
sending a second question of the second query node to a semantic recognition model corresponding to the simulation user;
Receiving the semantic response output by the semantic recognition model, and performing semantic conversion on the semantic response to obtain a second target answer;
judging whether the second target answer meets the constraint requirement of the simulation user or not;
when the second target answer meets the constraint condition of the simulation user, determining a third query node based on the second target answer, and starting the next iteration simulation dialogue from the third query node; or alternatively
And when the second target answer does not meet the constraint requirements of the simulation user, acquiring the final dialogue content.
2. The artificial intelligence based dialog simulation method of claim 1, wherein the determining a target question-answering tree and a corresponding first query node based on the dialog scene type includes:
when the dialogue scene type is a preset scene, matching a question-answer tree of each sub-scene associated with the preset scene from a preset database; according to a preset speaking sequence, a plurality of question-answer trees of all sub-scenes associated with the preset scene are associated, the associated question-answer tree is determined to be a target question-answer tree, and a first node of a first question-answer tree in the target question-answer tree is determined to be a first query node of the target question-answer tree; or alternatively
When the dialogue scene type is a sub-scene of a preset scene, matching a question-answer tree of the sub-scene from the preset database, determining the question-answer tree as a target question-answer tree, and determining a first node of the target question-answer tree as a first query node of the target question-answer tree.
3. The artificial intelligence based dialog simulation method of claim 1, wherein the determining whether the second target answer meets the constraint requirements of the simulation user includes:
identifying whether the second target answer matches a user image of the simulated user;
when the second target answer is completely matched with the user image of the simulation user, determining that the second target answer meets constraint requirements of the simulation user; or alternatively
And when the second target answer is not completely matched with the user image of the simulation user, determining that the second target answer does not meet the constraint requirement of the simulation user.
4. The artificial intelligence based dialog simulation method of claim 1, wherein semantically converting the semantic response to obtain a second target answer includes:
judging the category of the semantic answer;
When the semantic answer is a key value pair type, the key value pair is used as a second target answer; or alternatively
When the semantic answer is of a semantic category, performing text conversion on the semantic answer to obtain a second target answer; or alternatively
When the semantic replies comprise a first semantic reply of a key value pair category and a second semantic reply of a semantic category, taking the first semantic reply as a first text, and performing text conversion on the second semantic reply to obtain a second text; and splicing the first text and the second text to obtain a second target answer.
5. The artificial intelligence based dialog simulation method of claim 4, wherein text converting the semantic response to obtain a second target answer includes:
determining the intention and the entity of the semantic response according to the target question-answering tree;
traversing sentence templates matched with the intentions and the entities from a preset database according to the intentions and the entities;
and mapping the intention and the entity into corresponding sentence templates respectively to obtain a second target answer.
6. The artificial intelligence based dialog simulation method of claim 1, wherein after the obtaining of the final dialog content, the method further comprises:
Acquiring an initial template and a preset template of the dialogue scene type;
mapping the final dialogue content into the initial template to obtain a target template;
matching the target template with the preset template;
inquiring failure information from the matching result;
counting the number of dialogue rounds of the final dialogue content;
calculating the coverage rate of the final dialogue content in the target dialogue content corresponding to the dialogue scene type;
and determining the failure information, the number of conversation rounds and the coverage rate as analysis results of the final conversation content.
7. The artificial intelligence based dialog simulation method of claim 6, wherein the method further comprises:
determining whether the final dialogue content meets sample requirements according to the analysis result;
when the final dialogue content meets the sample requirement, taking the final dialogue content as a training sample;
and retraining the speech surgery management model based on the training sample to obtain a target speech surgery management model.
8. An artificial intelligence based dialog simulation device, the device comprising:
the acquisition module is used for responding to the received dialogue simulation request and acquiring a simulation user and dialogue scene types;
The determining module is used for determining a target question-answer tree and a corresponding first query node based on the dialogue scene type;
the simulation dialogue module is used for carrying out at least one round of iterative simulation dialogue on the target question-answering tree until final dialogue content is obtained, wherein any round of template dialogue in the at least one round of iterative simulation dialogue comprises the following steps:
the sending module is used for sending the first problem of the first query node to a conversation management model;
the output module is used for receiving a first target answer of the first question output by the speech management model;
the determining module is further configured to determine a second query node based on the first target answer;
the sending module is further configured to send a second question of the second query node to a semantic recognition model corresponding to the simulated user;
the semantic conversion module is also used for receiving the semantic response output by the semantic recognition model and carrying out semantic conversion on the semantic response to obtain a second target answer;
the judging module is used for judging whether the second target answer meets the constraint requirement of the simulation user or not;
the determining module is further configured to determine a third query node based on the second target answer when the second target answer meets the constraint condition of the simulation user, and start performing a next iteration simulation session from the third query node; or alternatively
And the acquisition module is further used for acquiring final dialogue content when the second target answer does not meet the constraint requirement of the simulation user.
9. An electronic device comprising a processor and a memory, wherein the processor is configured to implement the artificial intelligence based dialog simulation method of any of claims 1 to 7 when executing a computer program stored in the memory.
10. A computer readable storage medium having stored thereon a computer program, which when executed by a processor implements the artificial intelligence based dialog simulation method of any of claims 1 to 7.
CN202310146134.3A 2023-02-15 2023-02-15 Dialog simulation method and device based on artificial intelligence, electronic equipment and medium Pending CN116842143A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310146134.3A CN116842143A (en) 2023-02-15 2023-02-15 Dialog simulation method and device based on artificial intelligence, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310146134.3A CN116842143A (en) 2023-02-15 2023-02-15 Dialog simulation method and device based on artificial intelligence, electronic equipment and medium

Publications (1)

Publication Number Publication Date
CN116842143A true CN116842143A (en) 2023-10-03

Family

ID=88164087

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310146134.3A Pending CN116842143A (en) 2023-02-15 2023-02-15 Dialog simulation method and device based on artificial intelligence, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN116842143A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117312530A (en) * 2023-11-10 2023-12-29 北京百度网讯科技有限公司 Questionnaire and model training method, device, equipment, medium and product

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117312530A (en) * 2023-11-10 2023-12-29 北京百度网讯科技有限公司 Questionnaire and model training method, device, equipment, medium and product

Similar Documents

Publication Publication Date Title
CN111125309A (en) Natural language processing method and device, computing equipment and storage medium
CN109033068A (en) It is used to read the method, apparatus understood and electronic equipment based on attention mechanism
CN110807566A (en) Artificial intelligence model evaluation method, device, equipment and storage medium
CN109101624A (en) Dialog process method, apparatus, electronic equipment and storage medium
US20220358292A1 (en) Method and apparatus for recognizing entity, electronic device and storage medium
WO2020073533A1 (en) Automatic question answering method and device
CN113435582B (en) Text processing method and related equipment based on sentence vector pre-training model
CN112685550B (en) Intelligent question-answering method, intelligent question-answering device, intelligent question-answering server and computer readable storage medium
WO2023279692A1 (en) Question-and-answer platform-based data processing method and apparatus, and related device
CN113705191A (en) Method, device and equipment for generating sample statement and storage medium
CN112949758A (en) Response model training method, response method, device, equipment and storage medium
US20230013796A1 (en) Method and apparatus for acquiring pre-trained model, electronic device and storage medium
CN115803734A (en) Natural language enrichment using action interpretation
CN116842143A (en) Dialog simulation method and device based on artificial intelligence, electronic equipment and medium
CN117473057A (en) Question-answering processing method, system, equipment and storage medium
CN113486659A (en) Text matching method and device, computer equipment and storage medium
CN110263346B (en) Semantic analysis method based on small sample learning, electronic equipment and storage medium
CN117332054A (en) Form question-answering processing method, device and equipment
CN116956934A (en) Task processing method, device, equipment and storage medium
CN116303945A (en) Sample generation method of visual question-answering model and related equipment
CN115098665A (en) Method, device and equipment for expanding session data
CN115114453A (en) Intelligent customer service implementation method and device based on knowledge graph
CN116432666A (en) Text evaluation method and device, electronic equipment and storage medium
CN112052320A (en) Information processing method and device and computer readable storage medium
CN113822034B (en) Method, device, computer equipment and storage medium for replying text

Legal Events

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