WO2021179445A1 - 基于对话状态预测的多轮对话方法、装置和计算机设备 - Google Patents

基于对话状态预测的多轮对话方法、装置和计算机设备 Download PDF

Info

Publication number
WO2021179445A1
WO2021179445A1 PCT/CN2020/093426 CN2020093426W WO2021179445A1 WO 2021179445 A1 WO2021179445 A1 WO 2021179445A1 CN 2020093426 W CN2020093426 W CN 2020093426W WO 2021179445 A1 WO2021179445 A1 WO 2021179445A1
Authority
WO
WIPO (PCT)
Prior art keywords
round
dialogue
state
text
preset
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.)
Ceased
Application number
PCT/CN2020/093426
Other languages
English (en)
French (fr)
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
Publication of WO2021179445A1 publication Critical patent/WO2021179445A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3343Query execution using phonetics
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L15/00Speech recognition
    • G10L15/08Speech classification or search
    • G10L15/16Speech classification or search using artificial neural networks
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L15/00Speech recognition
    • G10L15/26Speech to text systems
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • This application relates to the field of artificial intelligence, in particular to a multi-round dialogue method, device, computer equipment and storage medium based on dialogue state prediction.
  • Multi-round dialogue technology is used to realize rapid information interaction between humans and computers.
  • the multi-round dialogue system includes modules such as speech recognition, language understanding, dialogue state maintenance, action candidate sorting, language generation, and speech synthesis.
  • the answer logic mainly reflects In the dialog state maintenance module, that is, after receiving the output of the language understanding module, it is judged what state the system should jump to.
  • the inventor realizes that the dialogue state maintenance module can generally be set by manual rules, but the dialogue state maintenance module based on manual rules does not have generalization ability, that is, when the user inputs special information, the manual rules are not set for the special information. It will cause the interruption of the entire multi-round dialogue. Therefore, the generalization ability of the traditional multi-round dialogue scheme is poor, and the running smoothness cannot be guaranteed.
  • the main purpose of this application is to provide a multi-round dialogue method, device, computer equipment and storage medium based on dialogue state prediction, aiming to improve the generalization ability of the multi-round dialogue scheme and ensure fluency.
  • this application proposes a multi-round dialogue method based on dialogue state prediction, which includes the following steps:
  • a preset voice recognition method perform voice recognition processing on the i+1th round of speech, so as to obtain the i+1th round of text;
  • the preset p dialog state prediction tools are used, based on the i+1th round of text text and the i+1th round of text.
  • the previous information corresponding to the round text is predicted to perform dialogue state prediction, so as to obtain p predicted dialogue states corresponding to the p dialogue state prediction tools; where p is an integer greater than 1, and the previous information includes at least the first Round text,..., i-th round text;
  • a preset voice output device is used to output the (i+1)th round of reply voice.
  • This application provides a multi-round dialogue device based on dialogue state prediction, including:
  • the (i+1)th round of speech acquisition unit is configured to acquire the (i+1)th round of speech input by the user after the i-round dialogue with the user, where i is an integer greater than 1;
  • the (i+1)th round of text and text acquisition unit is configured to perform voice recognition processing on the (i+1)th round of speech according to a preset voice recognition method, so as to obtain the (i+1)th round of text and text;
  • a dialogue state generation condition judging unit configured to judge whether the i+1th round of text and text triggers a preset dialogue state generation condition
  • the predictive dialogue state acquisition unit is configured to use preset p dialogue state prediction tools if the i+1th round of text text does not trigger a preset dialogue state generation condition, based on the i+1th round of text text Perform dialogue state prediction with the preceding information corresponding to the i+1th round of text, so as to obtain p predicted dialogue states corresponding to the p dialogue state prediction tools; where p is an integer greater than 1,
  • the preceding information includes at least the first round of text,..., the i-th round of text;
  • a predictive dialogue state judging unit configured to determine whether the p predicted dialogue states are the same
  • the i+1th round reply voice acquisition unit is configured to update the current state of the multiple rounds of dialogue to the predicted dialogue state if the p predicted dialogue states are the same, and according to the correspondence between the preset dialogue state and the reply voice Relationship, get the i+1 round reply voice;
  • the i+1th round reply voice output unit is configured to use a preset voice output device to output the i+1th round reply voice.
  • the present application provides a computer device, including a memory and a processor, the memory stores a computer program, and the processor executes the computer program when the computer program is executed.
  • a multi-round dialogue method based on dialogue state prediction includes the following steps:
  • a preset voice recognition method perform voice recognition processing on the i+1th round of speech, so as to obtain the i+1th round of text;
  • the preset p dialog state prediction tools are used, based on the i+1th round of text text and the i+1th round of text.
  • the previous information corresponding to the round text is predicted to perform dialogue state prediction, so as to obtain p predicted dialogue states corresponding to the p dialogue state prediction tools; where p is an integer greater than 1, and the previous information includes at least the first Round text,..., i-th round text;
  • a preset voice output device is used to output the (i+1)th round of reply voice.
  • This application provides a computer-readable storage medium on which a computer program is stored, and the computer program is executed when the computer program is executed by a processor.
  • a multi-round dialogue method based on dialogue state prediction includes the following steps:
  • a preset voice recognition method perform voice recognition processing on the i+1th round of speech, so as to obtain the i+1th round of text;
  • the preset p dialog state prediction tools are used, based on the i+1th round of text text and the i+1th round of text.
  • the previous information corresponding to the round text is predicted to perform dialogue state prediction, so as to obtain p predicted dialogue states corresponding to the p dialogue state prediction tools; where p is an integer greater than 1, and the previous information includes at least the first Round text,..., i-th round text;
  • a preset voice output device is used to output the (i+1)th round of reply voice.
  • the multi-round dialogue method, device, computer equipment and storage medium based on dialogue state prediction of the present application acquire the i+1th round of voice input by the user after i-round dialogue with the user; Perform voice recognition processing to obtain the i+1 round of text; determine whether the i+1 round of text triggers a preset dialog state generation condition; if the i+1 round of text does not trigger a preset
  • the dialog state generation condition is to use preset p dialog state prediction tools to predict the dialog state, thereby obtaining p predicted dialog states; determine whether the p predicted dialog states are the same; if the p predicted dialog states are the same, Then update the current state of the multiple rounds of dialogue to the predicted dialogue state, and obtain the i+1th round of reply voice according to the corresponding relationship between the preset dialogue state and the reply voice; use the preset voice output device to output the Reply voice in the i+1 round.
  • the generalization ability of the multi-round dialogue scheme is improved and fluency is ensured. Therefore, the method of integrating p dialog state prediction tools (to improve the accuracy of prediction) and the method of using the previous information to predict the dialog state (making the analysis of multiple rounds of dialogs are based on the whole, the data is more sufficient, and the analysis The result is more accurate), which makes the data analysis more adequate, more adaptable (that is, the generalization ability is improved), and the dialogue is more fluent.
  • FIG. 1 is a schematic flowchart of a multi-round dialogue method based on dialogue state prediction according to an embodiment of this application;
  • FIG. 2 is a schematic block diagram of the structure of a multi-round dialogue device based on dialogue state prediction according to an embodiment of the application;
  • FIG. 3 is a schematic block diagram of the structure of a computer device according to an embodiment of the application.
  • an embodiment of the present application provides a multi-round dialogue method based on dialogue state prediction, including the following steps:
  • S2 perform voice recognition processing on the i+1th round of speech, so as to obtain the i+1th round of text text;
  • the i+1th round of text does not trigger the preset dialog state generation condition, then use p preset dialog state prediction tools, based on the i+1th round of text and the i-th +1 rounds of the preceding information corresponding to the text, perform dialog state prediction, so as to obtain p predicted dialog states corresponding to the p dialog state prediction tools; where p is an integer greater than 1, and the preceding information includes at least The first round of text,..., the i-th round of text;
  • step S1 after i rounds of dialogue with the user, the i+1 round of voice input by the user is obtained, where i is an integer greater than 1.
  • This application is applied in the process of multiple rounds of dialogue, so it is implemented after the first round of dialogue, that is, the i+1 round of voice input by the user is obtained, where i is an integer greater than 1.
  • the voice recognition processing is performed on the i+1th round of speech, so as to obtain the i+1th round of text.
  • the speech recognition method can adopt any feasible method, for example, an open source speech recognition tool is used to process speech into text.
  • the open source speech recognition tool is, for example, Google's open source Live Transcribe speech recognition to text tool.
  • step S3 it is determined whether the (i+1)th round of texts triggers a preset dialog state generation condition.
  • the dialog state generation conditions can be pre-recorded in a preset configuration file, such as a json configuration file, where the trigger condition corresponds to the "trigger" part of the json.
  • a preset configuration file such as a json configuration file
  • the trigger condition corresponds to the "trigger" part of the json.
  • step S4 if the i+1th round of text does not trigger the preset dialog state generation condition, then preset p dialog state prediction tools are used, based on the i+1th round of text and The preceding information corresponding to the i+1th round of text is used to predict the dialog state, so as to obtain p predicted dialog states corresponding to the p dialog state prediction tools; where p is an integer greater than 1, so The foregoing information includes at least the first round of text,..., the i-th round of text.
  • the dialogue state prediction tool may be any feasible tool, for example, a dialogue state prediction tool based on neural network model training, or a dialogue state prediction tool based on an external knowledge base.
  • the p dialog state prediction tools are used to continue the breakpoint, that is, predict Out of the dialogue state to maintain multiple rounds of dialogue.
  • the i+1th round of text does not trigger the preset dialogue state generation condition
  • the multiple rounds of dialogue are forced to end or the multiple rounds of dialogue are forced to restart, which is not conducive to the smooth operation of the multiple rounds of dialogue state.
  • the so-called dialogue state is a data structure containing the dialogue history from time 0 to time t (for example, the current time).
  • the predicted dialogue state is, for example, M1-M2-M3, where M1-M2 is the dialogue history (that is, two rounds of dialogue have occurred, including data such as the user's input and the user's reply), and M3 is the newly predicted dialogue The new part of the state.
  • the dialogue state may also be accompanied by labels of fluency and quality, such as smooth, unsmooth, or good, excellent, or poor dialogue quality, so that the data is more accurate and it is more conducive to realizing accurate dialogue state prediction.
  • step S5 it is determined whether the p predicted dialog states are the same. If the p predicted dialogue states are the same, it means that all dialogue state prediction tools predict the same dialogue state, and the predicted dialogue state is the final dialogue state, that is, the current state of multiple rounds of dialogue should be updated to the predicted dialogue state.
  • step S6 if the p predicted dialogue states are the same, the current state of the multiple rounds of dialogue is updated to the predicted dialogue state, and the i-th dialogue state is obtained according to the preset correspondence relationship between the dialogue state and the reply voice. +1 round of reply voice.
  • the current state of the round dialogue is updated to the predicted dialogue state, it indicates that the computer has understood the i+1 round voice input by the user, and therefore should output the corresponding reply voice.
  • This application presets the corresponding relationship between the dialogue state and the reply voice, so the i+1th round of reply voice can be accurately obtained.
  • the preset voice output device is used to output the i+1th round of reply voice.
  • the voice output device is, for example, a speaker or a sound box.
  • the output of the i+1th round of reply voice is used to maintain multiple rounds of dialogue and give the user the opportunity to conduct the i+2th round of dialogue.
  • the step S3 of judging whether the (i+1)th round of texts triggers a preset dialog state generation condition includes:
  • S302 Determine whether the keyword or the combination of the keywords is recorded in a preset configuration file, where the configuration file records trigger conditions, reply voice, and jump state;
  • the method includes:
  • the configuration file is, for example, a json configuration file, where the trigger condition, reply content, and jump state correspond to the "trigger" part, the "output” part, and the "state” part of the json, respectively.
  • the p dialog state prediction tools include a designated dialog state prediction tool, and the designated dialog state prediction tool is pre-connected to a preset external knowledge base, and the external knowledge base stores multiple historical rounds of conversations,
  • the step S4 of performing dialogue state prediction based on the i+1th round of text and the preceding information corresponding to the i+1th round of text includes:
  • S402. Obtain a designated historical multi-round dialogue from the external knowledge base, wherein the second state chain of the designated historical multi-round dialogue includes the first state chain; wherein, the second state chain includes the first state chain;
  • the state chain means that all state nodes in the first state chain are state nodes of the second state chain, and the node relationship between all state nodes in the first state chain is also the same as that of the second state chain.
  • the node relationship of the corresponding state nodes in the state chain is the same;
  • the external knowledge base stores multiple historical rounds of dialogue, which can be used as a basis for predicting the state of the dialogue. Multiple rounds of dialogue are composed of multiple rounds of dialogue.
  • the execution terminal of this application will determine what the current dialogue state is, and then decide what kind of reply voice should be returned. This is a manual rule Standard process.
  • the first state chain is, for example, T1-T2, that is, the current multi-round dialogue is stuck in the third round of dialogue. Therefore, the historical multi-round dialogue with the T1-T2 chain is obtained from the external knowledge base.
  • the historical multi-round dialogue is regarded as the designated
  • the state node directly connected to the T1-T2 chain is T5
  • T5 is a designated state node
  • the predicted dialogue state node corresponding to the designated dialogue state prediction tool should be recorded as T5.
  • the second state chain of the designated historical multi-round dialogue includes the first state chain
  • the designated historical multi-round dialogue is similar to the current multi-round dialogue.
  • the multi-round dialogue is stuck, refer to the designated historical multi-round
  • the dialogue can give a relatively accurate prediction of the dialogue state, so as to maintain the progress of multiple rounds of dialogue.
  • the priority search principle or the voting decision principle can be adopted to select the most accurate predicted dialogue state.
  • the principle of preferential search refers to the first designated state node of the designated historical multi-round dialogue searched as the predicted dialogue state.
  • the voting decision principle refers to the maximum number of designated state nodes as the predicted dialogue state. For example, there are three historical multi-round dialogues, and their state chains are T1-T2-T5-T8, T1-T2-T4-T7, T1-T2. -T5-T9, then T5 is the designated state node with the largest number, so T5 is used as the predicted dialogue state node.
  • T1 is, for example, the status of determining the user authority, and the output reply voice is, for example: "Authority verification is correct, please select the business to be handled" (for example, the user enters the user name and password in the first round of dialogue);
  • T2 is the business confirmation Status, the output response voice is, for example, "Do you need to adjust the temporary quota or the fixed quota?" (For example, the user enters a voice similar to "I want to adjust the credit limit");
  • T3 is the status of the quota category confirmation, and the output voice is, for example, "You need How to adjust the temporary quota” (for example, the user has entered the voice of "temporary quota”).
  • the above example of T1-T3 is only for explaining one application scenario of this application, but not as a limitation to this application.
  • the method includes:
  • this application uses a preset similarity calculation method to calculate the similarity between the designated historical multi-round dialogue and the current multi-round dialogue, so as to obtain multiple corresponding to all designated historical multi-round dialogues. Similarity value; to obtain the designated state node of the designated historical multi-round dialogue corresponding to the maximum similarity value, and record it as the method of predicting the dialogue state corresponding to the designated dialogue state prediction tool to ensure that the most current multi-round dialogue is obtained Multiple rounds of similar designated history dialogues. Therefore, the next dialogue state of the most similar designated historical multi-round dialogue is most likely to be the dialogue state of the current multi-round dialogue. Thereby improving the accuracy of predicting the state of the dialogue.
  • the step S4031 of calculating the similarity between the specified historical multiple rounds of dialogue and the current multiple rounds of dialogue according to a preset similarity calculation method includes:
  • the similarity calculation method of the preset similarity calculation method is implemented to calculate the similarity between the specified historical multiple rounds of dialogue and the current multiple rounds of dialogue.
  • This application not only uses the current round of voice input by the user as the basis for similar calculations, but also uses the user’s previous voice input as the basis for similar calculations, so as to improve the accuracy of similar calculations.
  • the word vector database is used to map words to vectors, and is a common database in the field of natural language analysis.
  • the word vector library is used to obtain i+1 first word vector sequences corresponding to the first round of speech input by the user,..., and the i+1th round of speech respectively, and the i+1th round of speech
  • a word vector sequence is connected in order to obtain the first comprehensive vector X; and by querying the universal word vector library, the first round of voice input by the user in the designated historical multiple rounds of dialogue,..., the i+1 round
  • the i+1 second word vector sequences corresponding to the speech respectively, and the i+1 second word vector sequences are sequentially connected to obtain the second integrated vector Y.
  • the similarity judgment between the current multiple rounds of dialogue and the historical multiple rounds of dialogue is transformed into a similarity calculation between vectors. According to the formula:
  • the method includes:
  • the current state of multiple rounds of dialogue is updated to the predicted dialogue state corresponding to the first group, and the dialogue state prediction tool corresponding to the second group is deleted from the p dialogue state prediction tools .
  • p predicted dialogue states are all the same, but in fact, the prediction accuracy of p dialogue state prediction tools are different, so it is very likely that p predicted dialogue states are not exactly the same.
  • this application divides the p predicted dialog states into multiple groups, where the first group with the most members in the group indicates that most of the dialog state prediction tools recognize the predicted dialog state Therefore, the current state of the multiple rounds of dialogue is updated to the predicted dialogue state corresponding to the first group.
  • the dialog state prediction tools corresponding to the second group are also deleted from the p dialog state prediction tools, so as to improve the accuracy of the next prediction.
  • the relative weight of the dialogue state prediction tool thereby improving the accuracy of the subsequent possible dialogue state prediction.
  • an embodiment of the present application provides a multi-round dialogue device based on dialogue state prediction, including:
  • the (i+1)th round of speech acquisition unit 10 is configured to acquire the (i+1)th round of speech input by the user after the i-round dialogue with the user, where i is an integer greater than 1;
  • the i+1th round of text and text acquisition unit 20 is configured to perform voice recognition processing on the i+1th round of speech according to a preset voice recognition method, so as to obtain the (i+1)th round of text and text;
  • the dialog state generation condition determination unit 30 is configured to determine whether the i+1th round of text and text triggers a preset dialog state generation condition
  • the predictive dialogue state acquisition unit 40 is configured to use preset p dialogue state prediction tools if the i+1th round of text does not trigger a preset dialogue state generation condition, based on the i+1th round of text
  • the text and the preceding information corresponding to the i+1-th round of textual text are used to predict the dialogue state, thereby obtaining p predicted dialogue states corresponding to the p dialogue state prediction tools; where p is an integer greater than 1 ,
  • the preceding information includes at least the first round of text,..., the i-th round of text;
  • the predicted dialogue state judging unit 50 is used to judge whether the p predicted dialogue states are the same;
  • the i+1th round reply voice acquiring unit 60 is configured to update the current state of the multiple rounds of dialogue to the predicted dialogue state if the p predicted dialogue states are the same, and based on the preset dialogue state and the reply voice Correspondence, get the i+1th round reply voice;
  • the i+1th round reply voice output unit 70 is configured to use a preset voice output device to output the i+1th round reply voice.
  • the dialog state generation condition judgment unit 30 includes:
  • the word segmentation processing subunit is used to perform word segmentation processing on the i+1th round of text text to obtain multiple keywords;
  • the configuration file judging subunit is used to judge whether the keyword or the combination of the keywords is recorded in a preset configuration file, wherein the configuration file records the trigger condition, the reply voice, and the jump state;
  • the dialog state generation condition judging subunit is used to determine that if the keyword or the combination of the keywords is recorded in the trigger condition part, it is determined that the i+1th round of text text triggers a preset dialog state generation condition;
  • the device includes:
  • the dialogue state update unit is configured to update the current state of multiple rounds of dialogue to the jump state if the i+1th round of text triggers a preset dialogue state generation condition, and use a preset voice output device Output the reply voice.
  • the p dialog state prediction tools include a designated dialog state prediction tool, and the designated dialog state prediction tool is pre-connected to a preset external knowledge base, and the external knowledge base stores multiple historical rounds of conversations,
  • the predictive dialogue state obtaining unit 40 includes:
  • the first state chain generation subunit is used to use the specified dialog state prediction tool to generate the current multiple rounds according to the i+1th round of text and the preceding information corresponding to the i+1th round of text
  • the first state chain of the dialogue
  • the node relationship of is also the same as the node relationship of the corresponding state node in the second state chain;
  • the designated historical multi-round dialogue quantity judging subunit is used for judging whether the designated historical multi-round dialogue quantity is equal to 1;
  • the designated state node obtaining subunit is configured to obtain the designated state node in the second state chain if the number of the designated history multi-round dialogue is equal to 1, and record the designated state node as the designated dialogue state The prediction dialog state corresponding to the prediction tool, wherein the designated state node is directly connected to the first state chain.
  • the device includes:
  • the similarity calculation unit is used to calculate the similarity between the designated historical multi-round dialogue and the current multi-round dialogue according to the preset similarity calculation method if the number of the designated historical multi-round dialogue is not equal to 1, thereby obtaining the similarity between the designated historical multi-round dialogue and the current multi-round dialogue.
  • the predicted dialogue state marking unit is used to obtain the designated state node of the designated historical multi-round dialogue corresponding to the largest numerical similarity value, and record it as the predicted dialogue state corresponding to the designated dialogue state prediction tool, wherein the designated state node and the The first state chain is directly connected.
  • the similarity calculation unit includes:
  • the first comprehensive vector X obtaining subunit is used to obtain the i+1 first words corresponding to the first round of speech input by the user,..., and the i+1th round of speech respectively by querying the universally set word vector library Vector sequence, and sequentially connect the i+1 first word vector sequences to obtain the first comprehensive vector X;
  • the second comprehensive vector Y obtaining subunit is used to obtain the i corresponding to the first round of speech,..., and the i+1th round of speech input by the user in the specified historical multiple rounds of dialogue by querying the universally set word vector library +1 second word vector sequence, and sequentially connect the i+1 second word vector sequences to obtain a second comprehensive vector Y;
  • the similarity M calculation subunit is used according to the formula:
  • the device includes:
  • a grouping division unit configured to divide the p predicted dialog states into multiple groups if the p predicted dialog states are not completely the same, wherein each group includes only one predicted dialog state;
  • the first group obtaining unit is configured to obtain the first group with the most members in the group from the plurality of groups, and update the current state of the multiple rounds of conversations to the predicted conversation state corresponding to the first group;
  • the second group obtaining unit is configured to obtain the second group with the least members in the group from the plurality of groups, and delete the dialog state prediction tool corresponding to the second group from the p dialog state prediction tools.
  • an embodiment of the present application also provides a computer device.
  • the computer device may be a server, and its internal structure may be as shown in the figure.
  • the computer equipment includes a processor, a memory, a network interface, and a database connected through a system bus. Among them, the processor designed by the computer is used to provide calculation and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium stores an operating system, a computer program, and a database.
  • the memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium.
  • the database of the computer equipment is used to store data used in the multi-round dialogue method based on dialogue state prediction.
  • the network interface of the computer device is used to communicate with an external terminal through a network connection.
  • the computer program is executed by the processor to realize a multi-round dialogue method based on dialogue state prediction.
  • the above-mentioned processor executes the above-mentioned multi-round dialogue method based on dialogue state prediction, wherein the steps included in the method respectively correspond to the steps of executing the multi-round dialogue method based on dialogue state prediction in the aforementioned embodiment one-to-one, and will not be repeated here.
  • the multi-round dialogue method based on dialogue state prediction includes: obtaining the i+1 round of voice input by the user after i-round dialogue with the user, where i is an integer greater than 1; according to a preset voice recognition method, Perform voice recognition processing on the i+1th round of speech to obtain the i+1th round of text; determine whether the i+1th round of text and text triggers a preset dialog state generation condition; if the i+th round of text If the 1 round of text does not trigger the preset dialog state generation condition, the preset p dialog state prediction tools are used, based on the i+1th round of text and the preceding text corresponding to the i+1th round of text Information, the dialog state prediction is performed to obtain p predicted dialog states corresponding to the p dialog state prediction tools; wherein p is an integer greater than 1, and the preceding information includes at least the first round of text,...
  • the i-th round of text determines whether the p predicted dialogue states are the same; if the p predicted dialogue states are the same, update the current state of the multiple rounds of dialogue to the predicted dialogue state, and according to the preset The corresponding relationship between the dialogue state and the reply voice is obtained, and the i+1 round reply voice is obtained; the preset voice output device is used to output the i+1 round reply voice.
  • An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored.
  • the storage medium is a volatile storage medium or a non-volatile storage medium.
  • the multi-round dialogue method based on dialogue state prediction includes: obtaining the i+1 round of voice input by the user after i-round dialogue with the user, where i is an integer greater than 1; according to a preset voice recognition method, Perform voice recognition processing on the i+1th round of speech to obtain the i+1th round of text; determine whether the i+1th round of text and text triggers a preset dialog state generation condition; if the i+th round of text If the 1 round of text does not trigger the preset dialog state generation condition, the preset p dialog state prediction tools are used, based on the i+1th round of text and the preceding text corresponding to the i+1th round of text Information, the dialog state prediction is performed to obtain p predicted dialog states corresponding to the p dialog state prediction tools; wherein p is an integer greater than 1, and the preceding information includes at least the first round of text,...
  • the i-th round of text determines whether the p predicted dialogue states are the same; if the p predicted dialogue states are the same, update the current state of the multiple rounds of dialogue to the predicted dialogue state, and according to the preset The corresponding relationship between the dialogue state and the reply voice is obtained, and the i+1 round reply voice is obtained; the preset voice output device is used to output the i+1 round reply voice.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Health & Medical Sciences (AREA)
  • Acoustics & Sound (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Human Computer Interaction (AREA)
  • Artificial Intelligence (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Mathematical Physics (AREA)
  • Multimedia (AREA)
  • General Health & Medical Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Machine Translation (AREA)

Abstract

一种基于对话状态预测的多轮对话方法、装置、计算机设备和存储介质,该方法包括:在与用户进行i轮对话之后,获取用户输入的第i+1轮语音(S1);根据预设的语音识别方法,对该第i+1轮语音进行语音识别处理,得到第i+1轮文字文本(S2);判断该第i+1轮文字文本是否触发预设的对话状态生成条件(S3);若未触发预设的对话状态生成条件,则采用预设的p个对话状态预测工具进行对话状态预测,得到p个预测对话状态(S4);判断P个预测对话状态是否相同(S5);若该p个预测对话状态相同,则将多轮对话的当前状态更新为预测对话状态,并根据预设的对话状态与回复语音的对应关系,获取第i+1轮回复语音(S6);采用预设的语音输出装置,输出第i+1轮回复语音(S7)。从而提高了多轮对话方案的泛化能力,保证了流畅性。

Description

基于对话状态预测的多轮对话方法、装置和计算机设备
本申请要求于2020年3月13日提交中国专利局、申请号为202010177686.7,发明名称为“基于对话状态预测的多轮对话方法、装置和计算机设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及到人工智能领域,特别是涉及到一种基于对话状态预测的多轮对话方法、装置、计算机设备和存储介质。
背景技术
多轮对话技术用以实现人与计算机之类的快速信息交互,其中多轮对话系统包括语音识别、语言理解、对话状态维护、动作候选排序、语言生成、语音合成等模块,其中回答逻辑主要体现在对话状态维护模块中,也即,当接收到语言理解模块的输出之后,判断系统应该跳转到什么状态。发明人意识到,对话状态维护模块一般可采用人工规则来设置,但是基于人工规则的对话状态维护模块不具有泛化能力,即当用户输入特别信息后,人工规则未针对该特别信息进行设置,则会造成整个多轮对话的中断。因此,传统的多轮对话方案的泛化能力差,运行流畅性得不到保证。
技术问题
本申请的主要目的为提供一种基于对话状态预测的多轮对话方法、装置、计算机设备和存储介质,旨在提高多轮对话方案的泛化能力,保证流畅性。
技术解决方案
为了实现上述目的,本申请提出一种基于对话状态预测的多轮对话方法,包括以下步骤:
在与用户进行i轮对话之后,获取用户输入的第i+1轮语音,其中i为大于1的整数;
根据预设的语音识别方法,对所述第i+1轮语音进行语音识别处理,从而得到第i+1轮文字文本;
判断所述第i+1轮文字文本是否触发预设的对话状态生成条件;
若所述第i+1轮文字文本未触发预设的对话状态生成条件,则采用预设的p个对话状态预测工具,依据所述第i+1轮文字文本和与所述第i+1轮文字文本对应的前文信息,进行对话状态预测,从而得到与所述p个对话状态预测工具分别对应的p个预测对话状态;其中,p为大于1的整数,所述前文信息至少包括第一轮文字文本、...、第i轮文字文本;
判断所述p个预测对话状态是否相同;
若所述p个预测对话状态相同,则将多轮对话的当前状态更新为所述预测对话状态,并根据预设的对话状态与回复语音的对应关系,获取第i+1轮回复语音;
采用预设的语音输出装置,输出所述第i+1轮回复语音。
本申请提供一种基于对话状态预测的多轮对话装置,包括:
第i+1轮语音获取单元,用于在与用户进行i轮对话之后,获取用户输入的第i+1轮语音,其中i为大于1的整数;
第i+1轮文字文本获取单元,用于根据预设的语音识别方法,对所述第i+1轮语音进行语音识别处理,从而得到第i+1轮文字文本;
对话状态生成条件判断单元,用于判断所述第i+1轮文字文本是否触发预设的对话状态生成条件;
预测对话状态获取单元,用于若所述第i+1轮文字文本未触发预设的对话状态生成条件,则采用预设的p个对话状态预测工具,依据所述第i+1轮文字文本和与所述第i+1轮文字文本对应的前文信息,进行对话状态预测,从而得到与所述p个对话状态预测工具分别对应的p个预测对话状态;其中,p为大于1的整数,所述前文信息至少包括第一轮文字文本、...、第i轮文字文本;
预测对话状态判断单元,用于判断所述p个预测对话状态是否相同;
第i+1轮回复语音获取单元,用于若所述p个预测对话状态相同,则将多轮对话的当前状态更新为所述预测对话状态,并根据预设的对话状态与回复语音的对应关系,获取第i+1轮回复语音;
第i+1轮回复语音输出单元,用于采用预设的语音输出装置,输出所述第i+1轮回复语音。
本申请提供一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现
一种基于对话状态预测的多轮对话方法,包括以下步骤:
在与用户进行i轮对话之后,获取用户输入的第i+1轮语音,其中i为大于1的整数;
根据预设的语音识别方法,对所述第i+1轮语音进行语音识别处理,从而得到第i+1轮文字文本;
判断所述第i+1轮文字文本是否触发预设的对话状态生成条件;
若所述第i+1轮文字文本未触发预设的对话状态生成条件,则采用预设的p个对话状态预测工具,依据所述第i+1轮文字文本和与所述第i+1轮文字文本对应的前文信息,进行对话状态预测,从而得到与所述p个对话状态预测工具分别对应的p个预测对话状态;其中,p为大于1的整数,所述前文信息至少包括第一轮文字文本、...、第i轮文字文本;
判断所述p个预测对话状态是否相同;
若所述p个预测对话状态相同,则将多轮对话的当前状态更新为所述预测对话状态,并根据预设的对话状态与回复语音的对应关系,获取第i+1轮回复语音;
采用预设的语音输出装置,输出所述第i+1轮回复语音。
本申请提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现
一种基于对话状态预测的多轮对话方法,包括以下步骤:
在与用户进行i轮对话之后,获取用户输入的第i+1轮语音,其中i为大于1的整数;
根据预设的语音识别方法,对所述第i+1轮语音进行语音识别处理,从而得到第i+1轮文字文本;
判断所述第i+1轮文字文本是否触发预设的对话状态生成条件;
若所述第i+1轮文字文本未触发预设的对话状态生成条件,则采用预设的p个对话状态预测工具,依据所述第i+1轮文字文本和与所述第i+1轮文字文本对应的前文信息,进行对话状态预测,从而得到与所述p个对话状态预测工具分别对应的p个预测对话状态;其中,p为大于1的整数,所述前文信息至少包括第一轮文字文本、...、第i轮文字文本;
判断所述p个预测对话状态是否相同;
若所述p个预测对话状态相同,则将多轮对话的当前状态更新为所述预测对话状态,并根据预设的对话状态与回复语音的对应关系,获取第i+1轮回复语音;
采用预设的语音输出装置,输出所述第i+1轮回复语音。
有益效果
本申请的基于对话状态预测的多轮对话方法、装置、计算机设备和存储介质,在与用户进行i轮对话之后,获取用户输入的第i+1轮语音;对所述第i+1轮语音进行语音识别处理,从而得到第i+1轮文字文本;判断所述第i+1轮文字文本是否触发预设的对话状态生成条件;若所述第i+1轮文字文本未触发预设的对话状态生成条件,则采用预设的p个对话状态预测工具进行对话状态预测,从而得到p个预测对话状态;判断所述p个预测对话状态是否相同;若所述p个预测对话状态相同,则将多轮对话的当前状态更新为所述预测对话状态,并根据预设的对话状态与回复语音的对应关系,获取第i+1轮回复语音;采用预设的语音输出装置,输出所述第i+1轮回复语音。从而提高了多轮对话方案的泛化能力,保证了流畅性。从而利用综合p个对话状态预测工具的方式(使预测准确性得到提高),以及利用前文信息进行对话状态预测的方式(使得多轮对话的分析是基于整体而进行的,数据更加充分,使分析结果更准确),使得数据分析更加充分,适应性更强(即泛化能力得到提高),使对话流畅性更高。
附图说明
图1为本申请一实施例的基于对话状态预测的多轮对话方法的流程示意图;
图2为本申请一实施例的基于对话状态预测的多轮对话装置的结构示意框图;
图3为本申请一实施例的计算机设备的结构示意框图。
本申请的最佳实施方式
参照图1,本申请实施例提供一种基于对话状态预测的多轮对话方法,包括以下步骤:
S1、在与用户进行i轮对话之后,获取用户输入的第i+1轮语音,其中i为大于1的整数;
S2、根据预设的语音识别方法,对所述第i+1轮语音进行语音识别处理,从而得到第i+1轮文字文本;
S3、判断所述第i+1轮文字文本是否触发预设的对话状态生成条件;
S4、若所述第i+1轮文字文本未触发预设的对话状态生成条件,则采用预设的p个对话状态预测工具,依据所述第i+1轮文字文本和与所述第i+1轮文字文本对应的前文信息,进行对话状态预测,从而得到与所述p个对话状态预测工具分别对应的p个预测对话状态;其中,p为大于1的整数,所述前文信息至少包括第一轮文字文本、...、第i轮文字文本;
S5、判断所述p个预测对话状态是否相同;
S6、若所述p个预测对话状态相同,则将多轮对话的当前状态更新为所述预测对话状态,并根据预设的对话状态与回复语音的对应关系,获取第i+1轮回复语音;
S7、采用预设的语音输出装置,输出所述第i+1轮回复语音。
本申请在多轮对话发生卡壳时(即所述第i+1轮文字文本未触发预设的对话状态生成条件),采用特殊的设置以保证多轮对话的持续进行,即采用预设的p个对话状态预测工具预测对话状态。从而提高了多轮对话方案的泛化能力,保证了运行流畅性。
如上述步骤S1所述,在与用户进行i轮对话之后,获取用户输入的第i+1轮语音,其中i为大于1的整数。本申请是应用在多轮对话的过程中,因此是在第一轮对话之后才实施,即获取用户输入的第i+1轮语音,其中i为大于1的整数。
如上述步骤S2所述,根据预设的语音识别方法,对所述第i+1轮语音进行语音识别处理,从而得到第i+1轮文字文本。其中,所述语音识别方法可采用任意可行的方法,例如采用开源的语音识别工具,以将语音处理为文字文本。所述开源的语音识别工具例如为谷歌开源Live Transcribe语音识别转文字工具等。
如上述步骤S3所述,判断所述第i+1轮文字文本是否触发预设的对话状态生成条件。对话状态生成条件可预先记载在预设的配置文件中,例如为一个json配置文件,其中触发条件对应json中的"trigger"部分。当第i+1轮文字文本表述的意图(例如体现为关键词或关键词组合)记载于trigger部分中,则判定所述第i+1轮文字文本触发预设的对话状态生成条件。
如上述步骤S4所述,若所述第i+1轮文字文本未触发预设的对话状态生成条件,则采用预设的p个对话状态预测工具,依据所述第i+1轮文字文本和与所述第i+1轮文字文本对应的前文信息,进行对话状态预测,从而得到与所述p个对话状态预测工具分别对应的p个预测对话状态;其中,p为大于1的整数,所述前文信息至少包括第一轮文字文本、...、第i轮文字文本。其中所述对话状态预测工具可以为任意可行的工具,例如为基于神经网络模型训练而 成的对话状态预测工具,或者为基于外部知识库的对话状态预测工具。由于所述第i+1轮文字文本未触发预设的对话状态生成条件,因此按原先的规则是无法维持多轮对话的,因此采用所述p个对话状态预测工具接续上断点,即预测出对话状态,以维持多轮对话。传统方案在第i+1轮文字文本未触发预设的对话状态生成条件之时,或者强硬结束所述多轮对话,或者强行将多轮对话重启,而不利于多轮对话状态的顺畅运行。其中,所谓对话状态,是一种包含0时刻到t时刻(例如为当前时刻)的对话历史的数据结构。预测出的对话状态例如为M1-M2-M3,其中M1-M2是对话历史(即已发生了两轮对话,其中包括用户的输入与用户得到的回复等数据),M3是新预测出的对话状态的新的组成部分。进一步地,对话状态还可以附带有流畅性与质量的标注,例如顺畅、不顺畅还是对话质量良好、优秀、差等标注,从而使数据更加精确,更利于实现精准的对话状态预测。
如上述步骤S5所述,判断所述p个预测对话状态是否相同。若所述p个预测对话状态相同,表明所有的对话状态预测工具均预测相同的对话状态,该预测对话状态就是最终的对话状态,即多轮对话的当前状态应当更新为该预测对话状态。
如上述步骤S6所述,若所述p个预测对话状态相同,则将多轮对话的当前状态更新为所述预测对话状态,并根据预设的对话状态与回复语音的对应关系,获取第i+1轮回复语音。对轮对话的当前状态更新为所述预测对话状态后,表明计算机已经理解用户输入的第i+1轮语音,因此应该输出对应的回复语音。本申请预先设置有对话状态与回复语音的对应关系,因此能够准确获得第i+1轮回复语音。
如上述步骤S7所述,采用预设的语音输出装置,输出所述第i+1轮回复语音。其中所述语音输出装置例如为喇叭或音箱等。输出的第i+1轮回复语音用以维持多轮对话,并给予用户进行第i+2轮对话的时机。
在一个实施方式中,所述判断所述第i+1轮文字文本是否触发预设的对话状态生成条件的步骤S3,包括:
S301、将所述第i+1轮文字文本进行分词处理,从而得到多个关键词;
S302、判断所述关键词或者所述关键词之间的组合是否记载在预设的配置文件中,其中所述配置文件记载有触发条件、回复语音和跳转状态;
S303、若所述关键词或者所述关键词之间的组合记载在所述触发条件部分,则判定所述第i+1轮文字文本触发预设的对话状态生成条件;
所述判断所述第i+1轮文字文本是否触发预设的对话状态生成条件的步骤S3之后,包括:
S31、若所述第i+1轮文字文本触发预设的对话状态生成条件,则将多轮对话的当前状态更新为所述跳转状态,并采用预设的语音输出装置输出所述回复语音。
如上所述,实现了判断所述第i+1轮文字文本是否触发预设的对话状态生成条件。本申请采用配置文件的方式来判断是否触发预设的对话状态生成条件。 其中,所述配置文件例如为json配置文件,其中触发条件、答复内容、跳转状态则分别对应json中的"trigger"部分、"output"部分、”state”部分。以银行领域调整信用卡额度为例进行说明,首先在用户咨询“信用卡额度调整”便会触发额度调整意图(例如配置文件中的"trigger"部分记录了“信用卡”和“额度调整”的组合),因此回答“您需要调整临时额度还是固定额度?”(例如配置文件中的"output"部分记录了“您需要调整临时额度还是固定额度?”),并且state部分记录了007,则将当前状态更新为007状态。从而完成第i+1轮对话。此时,由于已触发对话状态生成条件,因此无需对话状态预测工具也可顺利完成多轮对话。
在一个实施方式中,所述p个对话状态预测工具包括指定对话状态预测工具,所述指定对话状态预测工具预先连接至预设的外部知识库,所述外部知识库存储有历史多轮对话,所述依据所述第i+1轮文字文本和与所述第i+1轮文字文本对应的前文信息,进行对话状态预测的步骤S4,包括:
S401、采用所述指定对话状态预测工具,依据所述第i+1轮文字文本和与所述第i+1轮文字文本对应的前文信息,生成当前的多轮对话的第一状态链;
S402、从所述外部知识库中获取指定历史多轮对话,其中所述指定历史多轮对话的第二状态链包含所述第一状态链;其中,所述第二状态链包含所述第一状态链指,所述第一状态链中的所有状态节点均是所述第二状态链的状态节点,并且所述第一状态链中的所有状态节点之间的节点关系也与所述第二状态链中对应的状态节点的节点关系相同;
S403、判断所述指定历史多轮对话的数量是否等于1;
S404、若所述指定历史多轮对话的数量等于1,则获取所述第二状态链中的指定状态节点,并将所述指定状态节点记为所述指定对话状态预测工具对应的预测对话状态,其中所述指定状态节点与所述第一状态链直接连接。
如上所述,实现了依据所述第i+1轮文字文本和与所述第i+1轮文字文本对应的前文信息,进行对话状态预测。其中,所述外部知识库存储有历史多轮对话,可作为对话状态的预测的依据。多轮对话是由多个轮次的对话构成的,每轮对话本申请的执行终端均会确定当前的对话状态是什么样的,进而决定应该返回什么样的回复语音,这是人工规则的一个制式流程。所述第一状态链例如为T1-T2,即当前的多轮对话在第3轮对话时出现了卡壳现象。因此从外部知识库中获取具有T1-T2链的历史多轮对话,例如存在T1-T2-T5-T8链(即第二状态链)的历史多轮对话,则该历史多轮对话则作为指定历史多轮对话,与T1-T2链直接连接的状态节点为T5,因此T5为指定状态节点,应该将所述指定对话状态预测工具对应的预测对话状态节点记为T5。由于所述指定历史多轮对话的第二状态链包含所述第一状态链,因此所述指定历史多轮对话与当前多轮对话是相近的,在多轮对话卡壳时,参照指定历史多轮对话即能给出相对准确的预测对话状态,从而维持多轮对话的进行。进一步地,当所述指定历史多轮对话的数量不等于1时,可采用优先搜索原则或投票决策原则,以选出最准确的预测对话状态。其中所述优先搜索原则指,以搜索到的第一个指定历史 多轮对话的指定状态节点,作为预测对话状态。投票决策原则指,以数量最多的指定状态节点作为预测对话状态,例如存在三个历史多轮对话,其状态链分别为T1-T2-T5-T8、T1-T2-T4-T7、T1-T2-T5-T9,则T5为数量最多的指定状态节点,因此T5作为预测对话状态节点。其中,T1例如为确定用户权限的状态,输出的回复语音例如为:“权限验证无误,请选择要办理的业务”(例如用户在第一轮对话中输入了用户名和密码);T2为业务确认状态,输出的回复语音例如为“您需要调整临时额度还是固定额度?”(例如用户输入了“我要调整信用额度”类似语音);T3为额度类别确认状态,输出的语音例如为“您需要如何调整临时额度”(例发用户输入了“临时额度”的语音)。其中,上述T1-T3的举例仅为解释本申请的一种应用场景,但不作为对本申请的限定。
在一个实施方式中,所述判断所述指定历史多轮对话的数量是否等于1的步骤S403之后,包括:
S4031、若所述指定历史多轮对话的数量不等于1,则根据预设的相似计算方法,计算指定历史多轮对话与当前多轮对话的相似度,从而得到与所有的指定历史多轮对话分别对应的多个相似度值;
S4032、获取数值最大的相似度值对应的指定历史多轮对话的指定状态节点,并记为所述指定对话状态预测工具对应的预测对话状态,其中指定状态节点与所述第一状态链直接连接。
如上所述,实现了获取数值最大的相似度值对应的指定历史多轮对话的指定状态节点,并记为所述指定对话状态预测工具对应的预测对话状态。为了提高对话状态预测的准确性,本申请采用根据预设的相似计算方法,计算指定历史多轮对话与当前多轮对话的相似度,从而得到与所有的指定历史多轮对话分别对应的多个相似度值;获取数值最大的相似度值对应的指定历史多轮对话的指定状态节点,并记为所述指定对话状态预测工具对应的预测对话状态的方式,以保证获取与当前多轮对话最相似的指定历史多轮对话。从而最相似的指定历史多轮对话接下来的对话状态,也最有可能是当前多轮对话的对话状态。从而提高预测对话状态的准确性。
在一个实施方式中,所述根据预设的相似计算方法,计算指定历史多轮对话与当前多轮对话的相似度的步骤S4031,包括:
S40311、通过查询通设的词向量库,获取与用户输入的第一轮语音、...、第i+1轮语音分别对应的i+1个第一词向量序列,并将所述i+1个第一词向量序列顺序连接,从而得到第一综合向量X;
S40312、通过查询通设的词向量库,获取指定历史多轮对话中的用户输入的第一轮语音、...、第i+1轮语音分别对应的i+1个第二词向量序列,并将所述i+1个第二词向量序列顺序连接,从而得到第二综合向量Y;
S40313、根据公式:
Figure PCTCN2020093426-appb-000001
计算出指定历史多轮对话与当前多轮对话的相似度M,其中X为所述第一综合向量,Y为所述第二综合向量,Xj为所述第一综合向量的第j个分向量,Yj为所述第二综合向量的第j个分向量,所述第一综合向量和所述第二综合向量均具有m个分向量。
如上所述,实现了根据预设的相似计算方法,计算指定历史多轮对话与当前多轮对话的相似度。本申请不仅以用户输入的当前轮语音作为相似计算的依据,还以用户之前输入的语音作为相似计算的依据,以提高相似计算的准确性。所述词向量库用于将单词映射为向量,是自然语言分析领域中的一种常用数据库。从而利用所述词向量库,获取与用户输入的第一轮语音、...、第i+1轮语音分别对应的i+1个第一词向量序列,并将所述i+1个第一词向量序列顺序连接,从而得到第一综合向量X;并通过查询通设的词向量库,获取指定历史多轮对话中的用户输入的第一轮语音、...、第i+1轮语音分别对应的i+1个第二词向量序列,并将所述i+1个第二词向量序列顺序连接,从而得到第二综合向量Y。从而将当前多轮对话与历史多轮对话的相似判断,转化为向量间的相似计算。再根据公式:
Figure PCTCN2020093426-appb-000002
计算出指定历史多轮对话与当前多轮对话的相似度M。其中上述公式不仅考虑到了向量间的数值差异,还考虑到了向量间的角度差异,从而进一步保证了相似计算的准确性。
在一个实施方式中,所述判断所述p个预测对话状态是否相同的步骤S5之后,包括:
S51、若所述p个预测对话状态不完全相同,则将所述p个预测对话状态划分为多个分组,其中每个分组仅包括一种预测对话状态;
S52、从所述多个分组中获取组内成员最多的第一分组,并将多轮对话的当前状态更新为所述第一分组对应的预测对话状态;
S53、从所述多个分组中获取组内成员最少的第二分组,并将所述第二分组对应的对话状态预测工具从所述p个对话状态预测工具中删除。
如上所述,实现了将多轮对话的当前状态更新为所述第一分组对应的预测对话状态,并将所述第二分组对应的对话状态预测工具从所述p个对话状态预测工具中删除。理想状态下是p个预测对话状态都相同,但实际上,p个对话状态预测工具的预测准确性是有差异的,因此很可能出现p个预测对话状态不完全相同的状况。当p个预测对话状态不完全相同时,本申请将所述p个预测对话状态划分为多个分组,其中组内成员最多的第一分组表明大多数的对话状态预测工具均认可该预测对话状态,因此将多轮对话的当前状态更新为所述第 一分组对应的预测对话状态。并且,为了维持p个对话状态预测工具的预测准确性,还将所述第二分组对应的对话状态预测工具从所述p个对话状态预测工具中删除,以在下次进行预测时,提高较为准确的对话状态预测工具的相对权重,从而提高后续可能的对话状态预测的准确性。
参照图2,本申请实施例提供一种基于对话状态预测的多轮对话装置,包括:
第i+1轮语音获取单元10,用于在与用户进行i轮对话之后,获取用户输入的第i+1轮语音,其中i为大于1的整数;
第i+1轮文字文本获取单元20,用于根据预设的语音识别方法,对所述第i+1轮语音进行语音识别处理,从而得到第i+1轮文字文本;
对话状态生成条件判断单元30,用于判断所述第i+1轮文字文本是否触发预设的对话状态生成条件;
预测对话状态获取单元40,用于若所述第i+1轮文字文本未触发预设的对话状态生成条件,则采用预设的p个对话状态预测工具,依据所述第i+1轮文字文本和与所述第i+1轮文字文本对应的前文信息,进行对话状态预测,从而得到与所述p个对话状态预测工具分别对应的p个预测对话状态;其中,p为大于1的整数,所述前文信息至少包括第一轮文字文本、...、第i轮文字文本;
预测对话状态判断单元50,用于判断所述p个预测对话状态是否相同;
第i+1轮回复语音获取单元60,用于若所述p个预测对话状态相同,则将多轮对话的当前状态更新为所述预测对话状态,并根据预设的对话状态与回复语音的对应关系,获取第i+1轮回复语音;
第i+1轮回复语音输出单元70,用于采用预设的语音输出装置,输出所述第i+1轮回复语音。
其中上述单元、子单元、模块或子模块分别用于执行的操作与前述实施方式的基于对话状态预测的多轮对话方法的步骤一一对应,在此不再赘述。
在一个实施方式中,所述对话状态生成条件判断单元30,包括:
分词处理子单元,用于将所述第i+1轮文字文本进行分词处理,从而得到多个关键词;
配置文件判断子单元,用于判断所述关键词或者所述关键词之间的组合是否记载在预设的配置文件中,其中所述配置文件记载有触发条件、回复语音和跳转状态;
对话状态生成条件判断子单元,用于若所述关键词或者所述关键词之间的组合记载在所述触发条件部分,则判定所述第i+1轮文字文本触发预设的对话状态生成条件;
所述装置,包括:
对话状态更新单元,用于若所述第i+1轮文字文本触发预设的对话状态生成条件,则将多轮对话的当前状态更新为所述跳转状态,并采用预设的语音输出装置输出所述回复语音。
其中上述单元、子单元、模块或子模块分别用于执行的操作与前述实施方 式的基于对话状态预测的多轮对话方法的步骤一一对应,在此不再赘述。
在一个实施方式中,所述p个对话状态预测工具包括指定对话状态预测工具,所述指定对话状态预测工具预先连接至预设的外部知识库,所述外部知识库存储有历史多轮对话,所述预测对话状态获取单元40,包括:
第一状态链生成子单元,用于采用所述指定对话状态预测工具,依据所述第i+1轮文字文本和与所述第i+1轮文字文本对应的前文信息,生成当前的多轮对话的第一状态链;
指定历史多轮对话获取子单元,用于从所述外部知识库中获取指定历史多轮对话,其中所述指定历史多轮对话的第二状态链包含所述第一状态链;其中,所述第二状态链包含所述第一状态链指,所述第一状态链中的所有状态节点均是所述第二状态链的状态节点,并且所述第一状态链中的所有状态节点之间的节点关系也与所述第二状态链中对应的状态节点的节点关系相同;
指定历史多轮对话数量判断子单元,用于判断所述指定历史多轮对话的数量是否等于1;
指定状态节点获取子单元,用于若所述指定历史多轮对话的数量等于1,则获取所述第二状态链中的指定状态节点,并将所述指定状态节点记为所述指定对话状态预测工具对应的预测对话状态,其中所述指定状态节点与所述第一状态链直接连接。
其中上述单元、子单元、模块或子模块分别用于执行的操作与前述实施方式的基于对话状态预测的多轮对话方法的步骤一一对应,在此不再赘述。
在一个实施方式中,所述装置,包括:
相似计算单元,用于若所述指定历史多轮对话的数量不等于1,则根据预设的相似计算方法,计算指定历史多轮对话与当前多轮对话的相似度,从而得到与所有的指定历史多轮对话分别对应的多个相似度值;
预测对话状态标记单元,用于获取数值最大的相似度值对应的指定历史多轮对话的指定状态节点,并记为所述指定对话状态预测工具对应的预测对话状态,其中指定状态节点与所述第一状态链直接连接。
其中上述单元、子单元、模块或子模块分别用于执行的操作与前述实施方式的基于对话状态预测的多轮对话方法的步骤一一对应,在此不再赘述。
在一个实施方式中,所述相似计算单元,包括:
第一综合向量X获取子单元,用于通过查询通设的词向量库,获取与用户输入的第一轮语音、...、第i+1轮语音分别对应的i+1个第一词向量序列,并将所述i+1个第一词向量序列顺序连接,从而得到第一综合向量X;
第二综合向量Y获取子单元,用于通过查询通设的词向量库,获取指定历史多轮对话中的用户输入的第一轮语音、...、第i+1轮语音分别对应的i+1个第二词向量序列,并将所述i+1个第二词向量序列顺序连接,从而得到第二综合向量Y;
相似度M计算子单元,用于根据公式:
Figure PCTCN2020093426-appb-000003
计算出指定历史多轮对话与当前多轮对话的相似度M,其中X为所述第一综合向量,Y为所述第二综合向量,Xj为所述第一综合向量的第j个分向量,Yj为所述第二综合向量的第j个分向量,所述第一综合向量和所述第二综合向量均具有m个分向量。
其中上述单元、子单元、模块或子模块分别用于执行的操作与前述实施方式的基于对话状态预测的多轮对话方法的步骤一一对应,在此不再赘述。
在一个实施方式中,所述装置,包括:
分组划分单元,用于若所述p个预测对话状态不完全相同,则将所述p个预测对话状态划分为多个分组,其中每个分组仅包括一种预测对话状态;
第一分组获取单元,用于从所述多个分组中获取组内成员最多的第一分组,并将多轮对话的当前状态更新为所述第一分组对应的预测对话状态;
第二分组获取单元,用于从所述多个分组中获取组内成员最少的第二分组,并将所述第二分组对应的对话状态预测工具从所述p个对话状态预测工具中删除。
其中上述单元、子单元、模块或子模块分别用于执行的操作与前述实施方式的基于对话状态预测的多轮对话方法的步骤一一对应,在此不再赘述。
参照图3,本申请实施例中还提供一种计算机设备,该计算机设备可以是服务器,其内部结构可以如图所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设计的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机程序和数据库。该内存器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的数据库用于存储基于对话状态预测的多轮对话方法所用数据。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种基于对话状态预测的多轮对话方法。
上述处理器执行上述基于对话状态预测的多轮对话方法,其中所述方法包括的步骤分别与执行前述实施方式的基于对话状态预测的多轮对话方法的步骤一一对应,在此不再赘述。所述基于对话状态预测的多轮对话方法,包括:在与用户进行i轮对话之后,获取用户输入的第i+1轮语音,其中i为大于1的整数;根据预设的语音识别方法,对所述第i+1轮语音进行语音识别处理,从而得到第i+1轮文字文本;判断所述第i+1轮文字文本是否触发预设的对话状态生成条件;若所述第i+1轮文字文本未触发预设的对话状态生成条件,则采用预设的p个对话状态预测工具,依据所述第i+1轮文字文本和与所述第i+1轮文字文本对应的前文信息,进行对话状态预测,从而得到与所述p个对话状态预测工具分别对应的p个预测对话状态;其中,p为大于1的整数,所述前文信息至少包括第一轮文字文本、...、第i轮文字文本;判断所述p个预测对 话状态是否相同;若所述p个预测对话状态相同,则将多轮对话的当前状态更新为所述预测对话状态,并根据预设的对话状态与回复语音的对应关系,获取第i+1轮回复语音;采用预设的语音输出装置,输出所述第i+1轮回复语音。
本申请一实施例还提供一种计算机可读存储介质,其上存储有计算机程序,所述存储介质为易失性存储介质或非易失性存储介质,计算机程序被处理器执行时实现基于对话状态预测的多轮对话方法,其中所述方法包括的步骤分别与执行前述实施方式的基于对话状态预测的多轮对话方法的步骤一一对应,在此不再赘述。所述基于对话状态预测的多轮对话方法,包括:在与用户进行i轮对话之后,获取用户输入的第i+1轮语音,其中i为大于1的整数;根据预设的语音识别方法,对所述第i+1轮语音进行语音识别处理,从而得到第i+1轮文字文本;判断所述第i+1轮文字文本是否触发预设的对话状态生成条件;若所述第i+1轮文字文本未触发预设的对话状态生成条件,则采用预设的p个对话状态预测工具,依据所述第i+1轮文字文本和与所述第i+1轮文字文本对应的前文信息,进行对话状态预测,从而得到与所述p个对话状态预测工具分别对应的p个预测对话状态;其中,p为大于1的整数,所述前文信息至少包括第一轮文字文本、...、第i轮文字文本;判断所述p个预测对话状态是否相同;若所述p个预测对话状态相同,则将多轮对话的当前状态更新为所述预测对话状态,并根据预设的对话状态与回复语音的对应关系,获取第i+1轮回复语音;采用预设的语音输出装置,输出所述第i+1轮回复语音。

Claims (20)

  1. 一种基于对话状态预测的多轮对话方法,其中,包括:
    在与用户进行i轮对话之后,获取用户输入的第i+1轮语音,其中i为大于1的整数;
    根据预设的语音识别方法,对所述第i+1轮语音进行语音识别处理,从而得到第i+1轮文字文本;
    判断所述第i+1轮文字文本是否触发预设的对话状态生成条件;
    若所述第i+1轮文字文本未触发预设的对话状态生成条件,则采用预设的p个对话状态预测工具,依据所述第i+1轮文字文本和与所述第i+1轮文字文本对应的前文信息,进行对话状态预测,从而得到与所述p个对话状态预测工具分别对应的p个预测对话状态;其中,p为大于1的整数,所述前文信息至少包括第一轮文字文本、...、第i轮文字文本;
    判断所述p个预测对话状态是否相同;
    若所述p个预测对话状态相同,则将多轮对话的当前状态更新为所述预测对话状态,并根据预设的对话状态与回复语音的对应关系,获取第i+1轮回复语音;
    采用预设的语音输出装置,输出所述第i+1轮回复语音。
  2. 根据权利要求1所述的基于对话状态预测的多轮对话方法,其中,所述判断所述第i+1轮文字文本是否触发预设的对话状态生成条件的步骤,包括:
    将所述第i+1轮文字文本进行分词处理,从而得到多个关键词;
    判断所述关键词或者所述关键词之间的组合是否记载在预设的配置文件中,其中所述配置文件记载有触发条件、回复语音和跳转状态;
    若所述关键词或者所述关键词之间的组合记载在所述触发条件部分,则判定所述第i+1轮文字文本触发预设的对话状态生成条件;
    所述判断所述第i+1轮文字文本是否触发预设的对话状态生成条件的步骤之后,包括:
    若所述第i+1轮文字文本触发预设的对话状态生成条件,则将多轮对话的当前状态更新为所述跳转状态,并采用预设的语音输出装置输出所述回复语音。
  3. 根据权利要求1所述的基于对话状态预测的多轮对话方法,其中,所述p个对话状态预测工具包括指定对话状态预测工具,所述指定对话状态预测工具预先连接至预设的外部知识库,所述外部知识库存储有历史多轮对话,所述依据所述第i+1轮文字文本和与所述第i+1轮文字文本对应的前文信息,进行对话状态预测的步骤,包括:
    采用所述指定对话状态预测工具,依据所述第i+1轮文字文本和与所述第i+1轮文字文本对应的前文信息,生成当前的多轮对话的第一状态链;
    从所述外部知识库中获取指定历史多轮对话,其中所述指定历史多轮对话的第二状态链包含所述第一状态链;其中,所述第二状态链包含所述第一状态链指,所述第一状态链中的所有状态节点均是所述第二状态链的状态节点,并且所述第一状态链中的所有状态节点之间的节点关系也与所述第二状态链中 对应的状态节点的节点关系相同;
    判断所述指定历史多轮对话的数量是否等于1;
    若所述指定历史多轮对话的数量等于1,则获取所述第二状态链中的指定状态节点,并将所述指定状态节点记为所述指定对话状态预测工具对应的预测对话状态,其中所述指定状态节点与所述第一状态链直接连接。
  4. 根据权利要求3所述的基于对话状态预测的多轮对话方法,其中,所述判断所述指定历史多轮对话的数量是否等于1的步骤之后,包括:
    若所述指定历史多轮对话的数量不等于1,则根据预设的相似计算方法,计算指定历史多轮对话与当前多轮对话的相似度,从而得到与所有的指定历史多轮对话分别对应的多个相似度值;
    获取数值最大的相似度值对应的指定历史多轮对话的指定状态节点,并记为所述指定对话状态预测工具对应的预测对话状态,其中指定状态节点与所述第一状态链直接连接。
  5. 根据权利要求4所述的基于对话状态预测的多轮对话方法,其中,所述根据预设的相似计算方法,计算指定历史多轮对话与当前多轮对话的相似度的步骤,包括:
    通过查询通设的词向量库,获取与用户输入的第一轮语音、...、第i+1轮语音分别对应的i+1个第一词向量序列,并将所述i+1个第一词向量序列顺序连接,从而得到第一综合向量X;
    通过查询通设的词向量库,获取指定历史多轮对话中的用户输入的第一轮语音、...、第i+1轮语音分别对应的i+1个第二词向量序列,并将所述i+1个第二词向量序列顺序连接,从而得到第二综合向量Y;
    根据公式:
    Figure PCTCN2020093426-appb-100001
    计算出指定历史多轮对话与当前多轮对话的相似度M,其中X为所述第一综合向量,Y为所述第二综合向量,Xj为所述第一综合向量的第j个分向量,Yj为所述第二综合向量的第j个分向量,所述第一综合向量和所述第二综合向量均具有m个分向量。
  6. 根据权利要求1所述的基于对话状态预测的多轮对话方法,其中,所述判断所述p个预测对话状态是否相同的步骤之后,包括:
    若所述p个预测对话状态不完全相同,则将所述p个预测对话状态划分为多个分组,其中每个分组仅包括一种预测对话状态;
    从所述多个分组中获取组内成员最多的第一分组,并将多轮对话的当前状态更新为所述第一分组对应的预测对话状态;
    从所述多个分组中获取组内成员最少的第二分组,并将所述第二分组对应的对话状态预测工具从所述p个对话状态预测工具中删除。
  7. 一种基于对话状态预测的多轮对话装置,其中,包括:
    第i+1轮语音获取单元,用于在与用户进行i轮对话之后,获取用户输入的第i+1轮语音,其中i为大于1的整数;
    第i+1轮文字文本获取单元,用于根据预设的语音识别方法,对所述第i+1轮语音进行语音识别处理,从而得到第i+1轮文字文本;
    对话状态生成条件判断单元,用于判断所述第i+1轮文字文本是否触发预设的对话状态生成条件;
    预测对话状态获取单元,用于若所述第i+1轮文字文本未触发预设的对话状态生成条件,则采用预设的p个对话状态预测工具,依据所述第i+1轮文字文本和与所述第i+1轮文字文本对应的前文信息,进行对话状态预测,从而得到与所述p个对话状态预测工具分别对应的p个预测对话状态;其中,p为大于1的整数,所述前文信息至少包括第一轮文字文本、...、第i轮文字文本;
    预测对话状态判断单元,用于判断所述p个预测对话状态是否相同;
    第i+1轮回复语音获取单元,用于若所述p个预测对话状态相同,则将多轮对话的当前状态更新为所述预测对话状态,并根据预设的对话状态与回复语音的对应关系,获取第i+1轮回复语音;
    第i+1轮回复语音输出单元,用于采用预设的语音输出装置,输出所述第i+1轮回复语音。
  8. 根据权利要求7所述的基于对话状态预测的多轮对话装置,其中,所述对话状态生成条件判断单元,包括:
    分词处理子单元,用于将所述第i+1轮文字文本进行分词处理,从而得到多个关键词;
    配置文件判断子单元,用于判断所述关键词或者所述关键词之间的组合是否记载在预设的配置文件中,其中所述配置文件记载有触发条件、回复语音和跳转状态;
    对话状态生成条件判断子单元,用于若所述关键词或者所述关键词之间的组合记载在所述触发条件部分,则判定所述第i+1轮文字文本触发预设的对话状态生成条件;
    所述装置,包括:
    对话状态更新单元,用于若所述第i+1轮文字文本触发预设的对话状态生成条件,则将多轮对话的当前状态更新为所述跳转状态,并采用预设的语音输出装置输出所述回复语音。
  9. 一种计算机设备,其中,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现一种基于对话状态预测的多轮对话方法,所述方法包括:
    在与用户进行i轮对话之后,获取用户输入的第i+1轮语音,其中i为大于1的整数;
    根据预设的语音识别方法,对所述第i+1轮语音进行语音识别处理,从而得到第i+1轮文字文本;
    判断所述第i+1轮文字文本是否触发预设的对话状态生成条件;
    若所述第i+1轮文字文本未触发预设的对话状态生成条件,则采用预设的p个对话状态预测工具,依据所述第i+1轮文字文本和与所述第i+1轮文字文本对应的前文信息,进行对话状态预测,从而得到与所述p个对话状态预测工具分别对应的p个预测对话状态;其中,p为大于1的整数,所述前文信息至少包括第一轮文字文本、...、第i轮文字文本;
    判断所述p个预测对话状态是否相同;
    若所述p个预测对话状态相同,则将多轮对话的当前状态更新为所述预测对话状态,并根据预设的对话状态与回复语音的对应关系,获取第i+1轮回复语音;
    采用预设的语音输出装置,输出所述第i+1轮回复语音。
  10. 根据权利要求9所述的计算机设备,其中,所述判断所述第i+1轮文字文本是否触发预设的对话状态生成条件的步骤,包括:
    将所述第i+1轮文字文本进行分词处理,从而得到多个关键词;
    判断所述关键词或者所述关键词之间的组合是否记载在预设的配置文件中,其中所述配置文件记载有触发条件、回复语音和跳转状态;
    若所述关键词或者所述关键词之间的组合记载在所述触发条件部分,则判定所述第i+1轮文字文本触发预设的对话状态生成条件;
    所述判断所述第i+1轮文字文本是否触发预设的对话状态生成条件的步骤之后,包括:
    若所述第i+1轮文字文本触发预设的对话状态生成条件,则将多轮对话的当前状态更新为所述跳转状态,并采用预设的语音输出装置输出所述回复语音。
  11. 根据权利要求9所述的计算机设备,其中,所述p个对话状态预测工具包括指定对话状态预测工具,所述指定对话状态预测工具预先连接至预设的外部知识库,所述外部知识库存储有历史多轮对话,所述依据所述第i+1轮文字文本和与所述第i+1轮文字文本对应的前文信息,进行对话状态预测的步骤,包括:
    采用所述指定对话状态预测工具,依据所述第i+1轮文字文本和与所述第i+1轮文字文本对应的前文信息,生成当前的多轮对话的第一状态链;
    从所述外部知识库中获取指定历史多轮对话,其中所述指定历史多轮对话的第二状态链包含所述第一状态链;其中,所述第二状态链包含所述第一状态链指,所述第一状态链中的所有状态节点均是所述第二状态链的状态节点,并且所述第一状态链中的所有状态节点之间的节点关系也与所述第二状态链中对应的状态节点的节点关系相同;
    判断所述指定历史多轮对话的数量是否等于1;
    若所述指定历史多轮对话的数量等于1,则获取所述第二状态链中的指定状态节点,并将所述指定状态节点记为所述指定对话状态预测工具对应的预测对话状态,其中所述指定状态节点与所述第一状态链直接连接。
  12. 根据权利要求11所述的计算机设备,其中,所述判断所述指定历史多轮对话的数量是否等于1的步骤之后,包括:
    若所述指定历史多轮对话的数量不等于1,则根据预设的相似计算方法,计算指定历史多轮对话与当前多轮对话的相似度,从而得到与所有的指定历史多轮对话分别对应的多个相似度值;
    获取数值最大的相似度值对应的指定历史多轮对话的指定状态节点,并记为所述指定对话状态预测工具对应的预测对话状态,其中指定状态节点与所述第一状态链直接连接。
  13. 根据权利要求12所述的计算机设备,其中,所述根据预设的相似计算方法,计算指定历史多轮对话与当前多轮对话的相似度的步骤,包括:
    通过查询通设的词向量库,获取与用户输入的第一轮语音、...、第i+1轮语音分别对应的i+1个第一词向量序列,并将所述i+1个第一词向量序列顺序连接,从而得到第一综合向量X;
    通过查询通设的词向量库,获取指定历史多轮对话中的用户输入的第一轮语音、...、第i+1轮语音分别对应的i+1个第二词向量序列,并将所述i+1个第二词向量序列顺序连接,从而得到第二综合向量Y;
    根据公式:
    Figure PCTCN2020093426-appb-100002
    计算出指定历史多轮对话与当前多轮对话的相似度M,其中X为所述第一综合向量,Y为所述第二综合向量,Xj为所述第一综合向量的第j个分向量,Yj为所述第二综合向量的第j个分向量,所述第一综合向量和所述第二综合向量均具有m个分向量。
  14. 根据权利要求9所述的计算机设备,其中,所述判断所述p个预测对话状态是否相同的步骤之后,包括:
    若所述p个预测对话状态不完全相同,则将所述p个预测对话状态划分为多个分组,其中每个分组仅包括一种预测对话状态;
    从所述多个分组中获取组内成员最多的第一分组,并将多轮对话的当前状态更新为所述第一分组对应的预测对话状态;
    从所述多个分组中获取组内成员最少的第二分组,并将所述第二分组对应的对话状态预测工具从所述p个对话状态预测工具中删除。
  15. 一种计算机可读存储介质,其中,其上存储有计算机程序,所述计算机程序被处理器执行时实现一种基于对话状态预测的多轮对话方法,所述方法包括:
    在与用户进行i轮对话之后,获取用户输入的第i+1轮语音,其中i为大于1的整数;
    根据预设的语音识别方法,对所述第i+1轮语音进行语音识别处理,从而得到第i+1轮文字文本;
    判断所述第i+1轮文字文本是否触发预设的对话状态生成条件;
    若所述第i+1轮文字文本未触发预设的对话状态生成条件,则采用预设的 p个对话状态预测工具,依据所述第i+1轮文字文本和与所述第i+1轮文字文本对应的前文信息,进行对话状态预测,从而得到与所述p个对话状态预测工具分别对应的p个预测对话状态;其中,p为大于1的整数,所述前文信息至少包括第一轮文字文本、...、第i轮文字文本;
    判断所述p个预测对话状态是否相同;
    若所述p个预测对话状态相同,则将多轮对话的当前状态更新为所述预测对话状态,并根据预设的对话状态与回复语音的对应关系,获取第i+1轮回复语音;
    采用预设的语音输出装置,输出所述第i+1轮回复语音。
  16. 根据权利要求15所述的计算机可读存储介质,其中,所述判断所述第i+1轮文字文本是否触发预设的对话状态生成条件的步骤,包括:
    将所述第i+1轮文字文本进行分词处理,从而得到多个关键词;
    判断所述关键词或者所述关键词之间的组合是否记载在预设的配置文件中,其中所述配置文件记载有触发条件、回复语音和跳转状态;
    若所述关键词或者所述关键词之间的组合记载在所述触发条件部分,则判定所述第i+1轮文字文本触发预设的对话状态生成条件;
    所述判断所述第i+1轮文字文本是否触发预设的对话状态生成条件的步骤之后,包括:
    若所述第i+1轮文字文本触发预设的对话状态生成条件,则将多轮对话的当前状态更新为所述跳转状态,并采用预设的语音输出装置输出所述回复语音。
  17. 根据权利要求15所述的计算机可读存储介质,其中,所述p个对话状态预测工具包括指定对话状态预测工具,所述指定对话状态预测工具预先连接至预设的外部知识库,所述外部知识库存储有历史多轮对话,所述依据所述第i+1轮文字文本和与所述第i+1轮文字文本对应的前文信息,进行对话状态预测的步骤,包括:
    采用所述指定对话状态预测工具,依据所述第i+1轮文字文本和与所述第i+1轮文字文本对应的前文信息,生成当前的多轮对话的第一状态链;
    从所述外部知识库中获取指定历史多轮对话,其中所述指定历史多轮对话的第二状态链包含所述第一状态链;其中,所述第二状态链包含所述第一状态链指,所述第一状态链中的所有状态节点均是所述第二状态链的状态节点,并且所述第一状态链中的所有状态节点之间的节点关系也与所述第二状态链中对应的状态节点的节点关系相同;
    判断所述指定历史多轮对话的数量是否等于1;
    若所述指定历史多轮对话的数量等于1,则获取所述第二状态链中的指定状态节点,并将所述指定状态节点记为所述指定对话状态预测工具对应的预测对话状态,其中所述指定状态节点与所述第一状态链直接连接。
  18. 根据权利要求17所述的计算机可读存储介质,其中,所述判断所述指定历史多轮对话的数量是否等于1的步骤之后,包括:
    若所述指定历史多轮对话的数量不等于1,则根据预设的相似计算方法, 计算指定历史多轮对话与当前多轮对话的相似度,从而得到与所有的指定历史多轮对话分别对应的多个相似度值;
    获取数值最大的相似度值对应的指定历史多轮对话的指定状态节点,并记为所述指定对话状态预测工具对应的预测对话状态,其中指定状态节点与所述第一状态链直接连接。
  19. 根据权利要求18所述的计算机可读存储介质,其中,所述根据预设的相似计算方法,计算指定历史多轮对话与当前多轮对话的相似度的步骤,包括:
    通过查询通设的词向量库,获取与用户输入的第一轮语音、...、第i+1轮语音分别对应的i+1个第一词向量序列,并将所述i+1个第一词向量序列顺序连接,从而得到第一综合向量X;
    通过查询通设的词向量库,获取指定历史多轮对话中的用户输入的第一轮语音、...、第i+1轮语音分别对应的i+1个第二词向量序列,并将所述i+1个第二词向量序列顺序连接,从而得到第二综合向量Y;
    根据公式:
    Figure PCTCN2020093426-appb-100003
    计算出指定历史多轮对话与当前多轮对话的相似度M,其中X为所述第一综合向量,Y为所述第二综合向量,Xj为所述第一综合向量的第j个分向量,Yj为所述第二综合向量的第j个分向量,所述第一综合向量和所述第二综合向量均具有m个分向量。
  20. 根据权利要求15所述的计算机可读存储介质,其中,所述判断所述p个预测对话状态是否相同的步骤之后,包括:
    若所述p个预测对话状态不完全相同,则将所述p个预测对话状态划分为多个分组,其中每个分组仅包括一种预测对话状态;
    从所述多个分组中获取组内成员最多的第一分组,并将多轮对话的当前状态更新为所述第一分组对应的预测对话状态;
    从所述多个分组中获取组内成员最少的第二分组,并将所述第二分组对应的对话状态预测工具从所述p个对话状态预测工具中删除。
PCT/CN2020/093426 2020-03-13 2020-05-29 基于对话状态预测的多轮对话方法、装置和计算机设备 Ceased WO2021179445A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010177686.7 2020-03-13
CN202010177686.7A CN111475616B (zh) 2020-03-13 2020-03-13 基于对话状态预测的多轮对话方法、装置和计算机设备

Publications (1)

Publication Number Publication Date
WO2021179445A1 true WO2021179445A1 (zh) 2021-09-16

Family

ID=71748316

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/093426 Ceased WO2021179445A1 (zh) 2020-03-13 2020-05-29 基于对话状态预测的多轮对话方法、装置和计算机设备

Country Status (2)

Country Link
CN (1) CN111475616B (zh)
WO (1) WO2021179445A1 (zh)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115269790A (zh) * 2022-06-24 2022-11-01 北京捷通华声科技股份有限公司 对话状态的管理方法、系统、电子设备和存储介质
CN115374266A (zh) * 2022-10-27 2022-11-22 深圳市人马互动科技有限公司 基于剧情交互节点的交互方法、装置、设备和存储介质
CN115495562A (zh) * 2022-09-01 2022-12-20 北京达佳互联信息技术有限公司 对话处理方法、装置、电子设备及存储介质
CN115878775A (zh) * 2022-12-23 2023-03-31 北京百度网讯科技有限公司 生成跨类型对话数据的方法和装置
CN116383355A (zh) * 2023-04-03 2023-07-04 哈尔滨工业大学人工智能研究院有限公司 一种基于sl-lstm的多轮对话自学习算法及电子设备
CN117290465A (zh) * 2023-02-28 2023-12-26 杭州一隅千象科技有限公司 一种虚幻引擎数字人语音交互方法、装置及应用
CN118820443A (zh) * 2024-09-12 2024-10-22 山东浪潮科学研究院有限公司 基于上下文信息聚合的智能问答方法、系统、设备及介质
CN116383355B (zh) * 2023-04-03 2026-05-05 哈尔滨工业大学人工智能研究院有限公司 一种基于sl-lstm的多轮对话自学习算法及电子设备

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112017663B (zh) * 2020-08-14 2024-04-30 博泰车联网(南京)有限公司 一种语音泛化方法、装置及计算机存储介质
CN112185391A (zh) * 2020-09-30 2021-01-05 深圳供电局有限公司 一种用于客服笔录自动修改处理方法
CN112463939B (zh) * 2020-11-12 2024-05-24 深圳市欢太科技有限公司 人机对话方法、系统、服务设备及计算机存储介质
CN112364147A (zh) * 2020-12-01 2021-02-12 四川长虹电器股份有限公司 一种基于知识图谱的跨领域多轮对话方法及实现系统
CN113220858B (zh) * 2021-05-31 2023-10-27 平安科技(深圳)有限公司 对话系统更新方法、装置、计算机设备及存储介质

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4408665B2 (ja) * 2003-08-11 2010-02-03 富士通株式会社 音声認識用発話データ収集装置、音声認識用発話データ収集方法、及びコンピュータプログラム
CN106599196A (zh) * 2016-12-14 2017-04-26 竹间智能科技(上海)有限公司 一种人工智能对话方法及系统
CN106796787A (zh) * 2014-05-20 2017-05-31 亚马逊技术有限公司 在自然语言处理中使用先前对话行为进行的语境解释
CN107665704A (zh) * 2016-07-29 2018-02-06 科大讯飞股份有限公司 语音指令检测模型构建方法、检测方法及系统、人机交互方法及设备
CN109635085A (zh) * 2018-06-05 2019-04-16 安徽省泰岳祥升软件有限公司 智能交互流程的管理方法、多轮对话方法及装置
CN110032633A (zh) * 2019-04-17 2019-07-19 腾讯科技(深圳)有限公司 多轮对话处理方法、装置和设备
CN110050015A (zh) * 2016-11-04 2019-07-23 Prc-迪索托国际公司 含硫的多(烯基)醚、引入含硫的多(烯基)醚的预聚物及其用途
CN110096567A (zh) * 2019-03-14 2019-08-06 中国科学院自动化研究所 基于qa知识库推理的多轮对话回复选择方法、系统
CN110309170A (zh) * 2019-07-02 2019-10-08 北京大学 一种任务型多轮对话中的复杂意图识别方法
CN110442676A (zh) * 2019-07-02 2019-11-12 北京邮电大学 基于多轮对话的专利检索方法及装置
CN110704588A (zh) * 2019-09-04 2020-01-17 平安科技(深圳)有限公司 基于长短期记忆网络的多轮对话语义分析方法和系统

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9318109B2 (en) * 2013-10-02 2016-04-19 Microsoft Technology Licensing, Llc Techniques for updating a partial dialog state
CN107369443B (zh) * 2017-06-29 2020-09-25 北京百度网讯科技有限公司 基于人工智能的对话管理方法及装置
CN109086329B (zh) * 2018-06-29 2021-01-05 出门问问信息科技有限公司 基于话题关键词引导的进行多轮对话方法及装置
CN109460450B (zh) * 2018-09-27 2021-07-09 清华大学 对话状态跟踪方法、装置、计算机设备和存储介质
CN110287297A (zh) * 2019-05-22 2019-09-27 深圳壹账通智能科技有限公司 对话答复方法、装置、计算机设备及计算机可读存储介质
CN110209791B (zh) * 2019-06-12 2021-03-26 百融云创科技股份有限公司 一种多轮对话智能语音交互系统及装置

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4408665B2 (ja) * 2003-08-11 2010-02-03 富士通株式会社 音声認識用発話データ収集装置、音声認識用発話データ収集方法、及びコンピュータプログラム
CN106796787A (zh) * 2014-05-20 2017-05-31 亚马逊技术有限公司 在自然语言处理中使用先前对话行为进行的语境解释
CN107665704A (zh) * 2016-07-29 2018-02-06 科大讯飞股份有限公司 语音指令检测模型构建方法、检测方法及系统、人机交互方法及设备
CN110050015A (zh) * 2016-11-04 2019-07-23 Prc-迪索托国际公司 含硫的多(烯基)醚、引入含硫的多(烯基)醚的预聚物及其用途
CN106599196A (zh) * 2016-12-14 2017-04-26 竹间智能科技(上海)有限公司 一种人工智能对话方法及系统
CN109635085A (zh) * 2018-06-05 2019-04-16 安徽省泰岳祥升软件有限公司 智能交互流程的管理方法、多轮对话方法及装置
CN110096567A (zh) * 2019-03-14 2019-08-06 中国科学院自动化研究所 基于qa知识库推理的多轮对话回复选择方法、系统
CN110032633A (zh) * 2019-04-17 2019-07-19 腾讯科技(深圳)有限公司 多轮对话处理方法、装置和设备
CN110309170A (zh) * 2019-07-02 2019-10-08 北京大学 一种任务型多轮对话中的复杂意图识别方法
CN110442676A (zh) * 2019-07-02 2019-11-12 北京邮电大学 基于多轮对话的专利检索方法及装置
CN110704588A (zh) * 2019-09-04 2020-01-17 平安科技(深圳)有限公司 基于长短期记忆网络的多轮对话语义分析方法和系统

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115269790A (zh) * 2022-06-24 2022-11-01 北京捷通华声科技股份有限公司 对话状态的管理方法、系统、电子设备和存储介质
CN115495562A (zh) * 2022-09-01 2022-12-20 北京达佳互联信息技术有限公司 对话处理方法、装置、电子设备及存储介质
CN115374266A (zh) * 2022-10-27 2022-11-22 深圳市人马互动科技有限公司 基于剧情交互节点的交互方法、装置、设备和存储介质
CN115878775A (zh) * 2022-12-23 2023-03-31 北京百度网讯科技有限公司 生成跨类型对话数据的方法和装置
CN115878775B (zh) * 2022-12-23 2024-04-12 北京百度网讯科技有限公司 生成跨类型对话数据的方法和装置
CN117290465A (zh) * 2023-02-28 2023-12-26 杭州一隅千象科技有限公司 一种虚幻引擎数字人语音交互方法、装置及应用
CN116383355A (zh) * 2023-04-03 2023-07-04 哈尔滨工业大学人工智能研究院有限公司 一种基于sl-lstm的多轮对话自学习算法及电子设备
CN116383355B (zh) * 2023-04-03 2026-05-05 哈尔滨工业大学人工智能研究院有限公司 一种基于sl-lstm的多轮对话自学习算法及电子设备
CN118820443A (zh) * 2024-09-12 2024-10-22 山东浪潮科学研究院有限公司 基于上下文信息聚合的智能问答方法、系统、设备及介质

Also Published As

Publication number Publication date
CN111475616A (zh) 2020-07-31
CN111475616B (zh) 2023-08-22

Similar Documents

Publication Publication Date Title
WO2021179445A1 (zh) 基于对话状态预测的多轮对话方法、装置和计算机设备
CN110428822B (zh) 一种语音识别纠错方法及人机对话系统
US10424319B2 (en) Assessing the structural quality of conversations
CN110377632B (zh) 诉讼结果预测方法、装置、计算机设备和存储介质
WO2022095380A1 (zh) 基于ai的虚拟交互模型生成方法、装置、计算机设备及存储介质
CN106297800B (zh) 一种自适应的语音识别的方法和设备
WO2019218818A1 (zh) 语音识别方法、装置、计算机可读存储介质和计算机设备
CN110164416B (zh) 一种语音识别方法及其装置、设备和存储介质
US10755729B2 (en) Systems and methods for interrelating text transcript information with video and/or audio information
CN110310663A (zh) 违规话术检测方法、装置、设备及计算机可读存储介质
US11380315B2 (en) Characterizing accuracy of ensemble models for automatic speech recognition by determining a predetermined number of multiple ASR engines based on their historical performance
US11094326B2 (en) Ensemble modeling of automatic speech recognition output
CN111813954B (zh) 文本语句中两实体的关系确定方法、装置和电子设备
US20260004775A1 (en) System and method for neural network multilingual speech recognition
EP3939034B1 (en) Characterizing accuracy of ensemble models for automatic speech recognition
CN115687609A (zh) 一种基于Prompt多模板融合的零样本关系抽取方法
CN106503066A (zh) 基于人工智能的处理搜索结果方法和装置
CN114661883B (zh) 一种智能问答方法、装置及电子设备
CN115269830B (zh) 异常文本检测模型训练方法、异常文本检测方法及装置
JP2020135689A (ja) モデル学習システム、意図解釈システム、モデル学習方法およびモデル学習用プログラム
CN117975937B (zh) 多音字语音处理方法及装置、可读存储介质
CN114822527B (zh) 一种语音转文本的纠错方法、装置及电子设备和存储介质
CN118153586A (zh) 一种基于大数据的对话练习方法
JP7161974B2 (ja) 品質管理方法
CN115563978B (zh) 命名实体识别方法、装置、设备、介质和程序产品

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20924343

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20924343

Country of ref document: EP

Kind code of ref document: A1