Dialogue flow generation method, electronic device and storage medium
By performing knowledge extraction and intent classification on the input sentences, combining multiple knowledge and intent combinations in the preset dialogue process, and predicting the most likely next sequence combination, the problems of homogeneity and lack of correlation in the dialogue process in the existing technology are solved. questions, realizing the generation of complex and relevant dialogue processes.
Patent Information
- Application Number
- CN202210999202.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-19
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2042-08-19
AI Technical Summary
The existing technology ignores the knowledge entities inside sentences in the generation of dialogue processes, resulting in a high degree of homogeneity in the generated dialogue processes. It is unable to generate new processes based on different user inputs, and is relevant to dialogue processes for knowledge-intensive and process-complex tasks. Insufficient sex.
By performing knowledge extraction and intent classification on input sentences, and combining multiple knowledge and intent combinations in the preset dialogue process, it predicts the most likely next sequence combination and generates a specific dialogue process.
It improves the correlation between the input sentences and the dialogue process, and can generate complex and long dialogue processes based on different inputs, adapt to specific scenarios or topics, and enhance the diversity and content relevance of the dialogue process.
Smart Images

Figure CN115376503B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of voice data processing, and in particular relates to a dialogue flow generation method, an electronic device and a storage medium. Background Art
[0002] With the continuous development of information technology and artificial intelligence technology, intelligent robots and intelligent customer service are becoming increasingly popular, allowing machines to replace humans and improve the overall work efficiency of society.
[0003] The prior art discloses basically a method for generating a dialogue process based on intent analysis and dialogue clustering, and the method steps are generally as follows: obtaining dialogue corpus, extracting features and clustering sentences in the dialogue corpus, classifying the intent of sentences according to the clustering results, matching the intent of sentences or performing reinforcement learning on sentences, learning the strategy of sentence intent and inputting intent according to the context of the existing dialogue, generating a matching sentence intent for the next sentence or generating a strategy.
[0004] The defects of the existing technology are: most of the existing technologies only focus on the intention and semantic features of the input sentences, thereby ignoring the knowledge entities within the sentences, which will lead to highly homogeneous generated dialogue processes; if clustering and matching methods are used, classification can only be performed in the existing clustering results, and new processes based on different user inputs cannot be generated; the dialogue responses of the existing technology are mostly fixed intentions and configured sentences, which tend to be general sentences and cannot generate sentences for specific dialogue processes; and the generated dialogue processes are also relatively simple. For knowledge-intensive and process-complex tasks, it is impossible to generate dialogue processes that are highly relevant to the content, nor can it generate processes for specific scenarios or specific topics. Summary of the invention
[0005] The embodiments of the present invention provide a dialog flow generation method, an electronic device and a storage medium, which are used to solve at least one of the above-mentioned technical problems.
[0006] In a first aspect, an embodiment of the present invention provides a method for generating a dialogue process, comprising: performing knowledge extraction on an input sentence to obtain knowledge corresponding to the input sentence, and performing intent classification on the input sentence to obtain intent corresponding to the input sentence; extracting a combination of knowledge and intent in a preset dialogue process based at least on the knowledge, wherein the preset dialogue process includes a combination of multiple knowledge and multiple intents; and predicting the combination that is most likely to become the next sequence of the current dialogue process.
[0007] In a second aspect, an embodiment of the present invention provides another method for generating a dialogue process, comprising: performing knowledge extraction and intent classification on an input sentence to obtain initial knowledge and initial intent corresponding to the input sentence; obtaining similar knowledge corresponding to the input sentence and the intent corresponding to the input sentence; matching the similar knowledge and intent with the initial knowledge and initial intent to obtain similar knowledge and intent that best matches the initial knowledge and initial intent.
[0008] In a third aspect, an embodiment of the present invention provides a dialogue process generation device, comprising: a knowledge extraction program module, configured to perform knowledge extraction on an input sentence to obtain knowledge corresponding to the input sentence, and perform intent classification on the input sentence to obtain intent corresponding to the input sentence; an extraction program module, configured to extract a combination of knowledge and intent in a preset dialogue process based at least on the knowledge, wherein the preset dialogue process includes a combination of multiple knowledge and multiple intents; a prediction program module, configured to predict the combination that is most likely to become the next sequence of the current dialogue process.
[0009] In a fourth aspect, an embodiment of the present invention provides a dialogue process generation device, comprising: an acquisition program module, configured to extract knowledge and classify intent of an input sentence, and obtain initial knowledge and initial intent corresponding to the input sentence; an acquisition program module, configured to obtain similar knowledge corresponding to the input sentence and the intent corresponding to the input sentence; a matching program module, configured to match the similar knowledge and intent with the initial knowledge and initial intent, and obtain similar knowledge and intent that best matches the initial knowledge and initial intent.
[0010] In a fifth aspect, an electronic device is provided, comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the steps of the dialog flow generation method of any embodiment of the present invention.
[0011] In a sixth aspect, an embodiment of the present invention further provides a computer program product, comprising a computer program stored on a non-volatile computer-readable storage medium, wherein the computer program comprises program instructions, and when the program instructions are executed by a computer, the computer executes the steps of the dialog flow generation method of any embodiment of the present invention.
[0012] The method and device of the present application combine knowledge extraction and intent classification, so that specific dialogue flows can be generated according to different knowledge and intents. The sequence prediction-based method can generate complex and long dialogue flows according to different inputs, thereby greatly improving the relevance between the knowledge of the input sentence and the dialogue flow. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0014] Figure 1 A flowchart of a method for generating a dialog flow provided by an embodiment of the present invention;
[0015] Figure 2 A flowchart of another method for generating a dialog flow provided by an embodiment of the present invention;
[0016] Figure 3 A flowchart of another method for generating a dialog flow provided by an embodiment of the present invention;
[0017] Figure 4 A flowchart of a method for generating a dialog flow provided by an embodiment of the present invention;
[0018] Figure 5 A flowchart of a specific example of a method for generating a dialog flow provided by an embodiment of the present invention;
[0019] Figure 6 A knowledge generation effect diagram of a specific example of a method for generating a dialog flow provided by an embodiment of the present invention;
[0020] Figure 7 A block diagram of a dialog flow generating device provided by an embodiment of the present invention;
[0021] Figure 8 A block diagram of another dialog flow generating device provided by an embodiment of the present invention;
[0022] Fig. 9 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0023] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0024] Please refer to Figure 1 , which shows a flowchart of an embodiment of a conversation process generation method of the present application. The conversation process generation method of this embodiment can be applied to terminals with communication or real-time voice conversation functions, such as smart phones, tablets, computers, etc.
[0025] like Figure 1 As shown, in step 101, knowledge extraction is performed on the input sentence to obtain knowledge corresponding to the input sentence, and intent classification is performed on the input sentence to obtain intent corresponding to the input sentence;
[0026] In step 102, a combination of knowledge and intention is extracted in a preset dialogue process based at least on the knowledge, wherein the preset dialogue process includes a combination of multiple knowledge and multiple intentions;
[0027] In step 103, the combination among the combinations that is most likely to become the next sequence of the current dialog flow is predicted.
[0028] In this embodiment, for step 101, the dialogue process generation device performs knowledge extraction on the input sentence to obtain the knowledge corresponding to the input sentence, and performs intent classification on the input sentence to obtain the intent corresponding to the input sentence, wherein knowledge extraction is to extract various knowledge points in the text through identification, understanding, screening, and formatting; for example, a new input sentence is subjected to knowledge extraction and intent classification, and 0 to k knowledge entities (0, e1, e2...ek) are extracted and recorded as a set E and an intent I, then there are k and combinations (0, I), (e1, I)...(ek, I), in a specific embodiment, taking "a little low fever, cough, and feeling like I have a cold" as an example, the results of intent classification and knowledge extraction are (low fever, consultation symptoms), (cough, consultation symptoms), and (cold, consultation disease); taking "I want to consult about the 2021 XX car" as an example, after knowledge extraction and intent classification, it is (2021 XX car, consultation car).
[0029] Then, for step 102, the dialogue process generation device extracts a combination of knowledge and intentions in the preset dialogue process based on at least knowledge. For example, the preset dialogue process includes a combination of multiple knowledge and multiple intentions. Taking "a little low fever, cough, and feeling like I have a cold" as an example, the relevant knowledge includes low fever (fever, fever, high body temperature, cold...), cough (cough, sputum, sore throat, hoarseness, pharyngitis...), cold (wind-heat cold, cold, viral cold, bacterial cold...), which are combined into (fever, asking about the time of illness), (coughing, asking if there is any) and the like.
[0030] Finally, for step 103, the dialogue process generation device predicts the combination of multiple knowledge and multiple intentions that is most likely to become the next sequence of the current dialogue process. For example, multiple knowledge and multiple intentions are merged into a candidate set to be predicted, and then the candidate set to be predicted is input into the prediction model to predict the most likely next sequence.
[0031] The method of this embodiment combines knowledge extraction and intent classification, so that a specific dialogue flow can be generated according to different knowledge and intents. The sequence prediction-based method can generate complex and long dialogue flows according to different inputs, thereby greatly improving the relevance between the knowledge of the input sentence and the dialogue flow.
[0032] Further references Figure 2 , which shows a flowchart of another method for generating a dialogue process provided by an embodiment of the present application. Figure 1 A flowchart of the steps further defined in the process of "extracting a combination of knowledge and intention in a preset dialogue process based at least on the first knowledge".
[0033] like Figure 2 As shown, in step 201, a first similar knowledge set of any one of the knowledge is calculated;
[0034] In step 202, a first combination related to any one of the knowledge is extracted in a preset dialogue process based on the first similar knowledge set.
[0035] In this embodiment, for step 201, the dialogue process generation device calculates the first similar knowledge set of any knowledge contained in the knowledge of the input sentence. Taking knowledge E as an example, for any knowledge ei in the extracted knowledge E, the similar knowledge of ei is calculated to obtain the similar knowledge set<ei1,ei2...ein> , where ei is an alias in the knowledge graph, ei to ein is the word vector distance, the introduction sentence of ei in the knowledge graph is matched with the introduction sentence of ein for similarity, all knowledge in the graph is embedded, and the entity distance between ei and ein is calculated. Similar knowledge can be obtained through multiple methods, and this application is not limited here.
[0036] Then, in step 202, the dialogue process generating device extracts a first combination related to any knowledge in the preset dialogue process based on the first similar knowledge set. Taking knowledge E as an example, similar knowledge E is extracted.<ei1,ei2...ein> The combination of all knowledge and intentions contained in the dialogue process in the corpus is used as a candidate for the process to be predicted.
[0037] The method of this embodiment calculates the first similar knowledge set of any knowledge contained in the knowledge of the input sentence, and then extracts the first combination related to any knowledge in the preset dialogue process based on the first similar knowledge set, so that the generated dialogue process can contain knowledge entities and have a certain knowledge logic.
[0038] In some optional embodiments, the step of extracting a combination of knowledge and intention in a preset dialogue process based at least on the first knowledge further includes:
[0039] Based on all the extracted first combinations related to all the knowledge, a candidate set of the process to be predicted is formed. For example, because the input sentence contains multiple pieces of knowledge, one piece of knowledge is first calculated to obtain a collection of similar knowledge, and then all the combinations of knowledge and intentions contained in the dialogue process of this collection of similar knowledge in the corpus are extracted as candidates for the process to be pre-selected. Then, the next piece of knowledge is calculated to obtain the candidates for the process to be predicted of the next piece of knowledge, and these are merged with the candidates for the process to be predicted of the previous piece of knowledge into a candidate set for the process to be predicted.
[0040] The method of this embodiment forms a candidate set of the process to be predicted based on all the first combinations extracted related to all the knowledge, so that by combining knowledge extraction and intent classification, a specific dialogue process can be generated according to different knowledge and intents. Furthermore, the method based on sequence prediction can generate complex and long dialogue processes according to different inputs.
[0041] Further references Figure 3 , which shows a flowchart of another method for generating a dialogue flow provided by an embodiment of the present application. This flowchart is mainly a flowchart of the steps of further defining the process after "the combination most likely to become the next sequence of the current dialogue flow" in the above embodiment.
[0042] like Figure 3 As shown, in step 301, a second similar knowledge set of the knowledge in the next sequence is extracted, and a second combination related to the knowledge in the next sequence is extracted in a preset dialogue process based on the second similar knowledge set;
[0043] In step 302, the second combination is updated to the candidate set to be predicted;
[0044] In step 303, predicting the next new sequence in the candidate set to be predicted;
[0045] In step 304, the above steps are iterated repeatedly until a termination condition is met.
[0046] In this embodiment, for step 301, the dialog flow generation device extracts the second similar knowledge set in the next sequence, and extracts the second combination related to the knowledge in the next sequence in the preset dialog flow based on the second similar knowledge set; then, for step 302, the dialog flow generation device updates the second combination to the candidate set to be predicted; then, for step 303, the dialog flow generation device predicts the new next sequence in the candidate set to be predicted; finally, for step 304, the dialog flow generation device iterates the above steps until the termination condition is met. For example, extract the similar knowledge set of any knowledge in the next sequence, extract all the knowledge and intention combinations of the similar knowledge set in the preset dialog flow to update the candidate set to be predicted, and obtain a new candidate set to be predicted. Then, the new candidate set to be predicted is used as a new sequence input to predict the most likely next sequence in the new candidate set, and then iterates continuously until the termination condition is met, for example, the customer feedback ends or the dialog ends.
[0047] The method of this embodiment extracts a second similar knowledge set in the next sequence, extracts a second combination related to the knowledge in the next sequence in a preset dialogue process based on the second similar knowledge set, and then updates the second combination to the candidate set to be predicted, and then iterates continuously until a termination condition is encountered, so that a dialogue process of new knowledge can be generated based on existing knowledge, and further solves the problem of insufficient corpus.
[0048] In some optional embodiments, before extracting knowledge from the input sentence to obtain knowledge corresponding to the input sentence, the method further includes:
[0049] The dialogue process generation device takes a knowledge collection as a sequence input, takes a knowledge collection similar to the knowledge collection as a prediction result, and trains a sequence prediction model. For example, (E1, I1), (E2, I2)...(En, In) are taken as a sequence input, (En+1, In+1) is taken as a prediction result, and the sequence prediction model is trained, that is, whether (En+1, In+1) is the next sequence of (E1, I1), (E2, I2)...(En, In).
[0050] Further references Figure 4 , which shows a flowchart of another method for generating a dialogue process provided by an embodiment of the present application.
[0051] like Figure 4As shown, in step 401, knowledge extraction and intent classification are performed on the input sentence to obtain initial knowledge and initial intent corresponding to the input sentence;
[0052] In step 402, similar knowledge corresponding to the input sentence and the intention corresponding to the input sentence are obtained;
[0053] In step 403, the similar knowledge and intention are matched with the initial knowledge and initial intention to obtain similar knowledge and intention that best matches the initial knowledge and initial intention.
[0054] In this embodiment, for step 401, the dialogue process generation device extracts knowledge and classifies intents from the input sentence, and obtains the initial knowledge and initial intent corresponding to the input sentence; then, for step 402, the dialogue process generation device obtains the similar knowledge and intent corresponding to the input sentence and the intent corresponding to the input sentence; finally, for step 403, the dialogue process generation device matches the similar knowledge and intent with the initial knowledge and initial intent, and obtains the similar knowledge and intent that best matches the initial knowledge and initial intent. For example, the knowledge extraction and intent classification of the input sentence are performed, and the initial knowledge and initial intent of the input sentence are recorded as (Ei, Ii) by taking knowledge E and intent I as an example; the process and of similar knowledge are directly recorded as a whole as (E1, I1)...(En, In); then (E1, I1)...(En, In) are matched with the initial knowledge and initial intent (Ei, Ii) respectively, and if the best matching feature is (Ek, Ik), all processes of (Ek, Ik) are regarded as the process of input (Ei, Ii).
[0055] The method of this embodiment matches similar knowledge and intentions with initial knowledge and initial intentions to obtain similar knowledge and intentions that best match the initial knowledge and initial intentions, thereby improving the speed of generating a dialogue process.
[0056] Please refer to Figure 5 , which shows a flowchart of a specific example of a method for generating a dialog flow provided by an embodiment of the present invention.
[0057] like Figure 5 As shown, step 1: train the corpus, take (E1, I1), (E2, I2)...(En, In) as a sequence input, (En+1, In+1) as the prediction result, and train the sequence prediction model. That is, predict whether (En+1, In+1) is the next sequence of (E1, I1), (E2, I2)...(En, In).
[0058] Step 2: Perform knowledge extraction and intent classification on a new input sentence S, extract 0 to k knowledge entities (0, e1, e2...ek) recorded as a set E and an intent I. Then there are k and combinations (0, I), (e1, I)... (ek, I).
[0059] Step 3: For any piece of knowledge ei in the extracted knowledge E, calculate the similar knowledge of ei and obtain the similar knowledge set<ei1,ei2...ein> Similar knowledge can be obtained through multiple methods: ei's alias in the knowledge graph; the word vector distance between ei and ein; similarity matching between the introduction sentence of ei in the knowledge graph and the introduction sentence of ein; knowledge embedding of all knowledge in the graph and calculation of the entity distance between ei and ein. Here we use the method of calculating the Glove word vector to obtain similar knowledge.
[0060] Step 4: Extract similar knowledge<ei1,ei2...ein> The combination of all knowledge and intentions contained in the dialogue process in the corpus is used as a candidate for the process to be predicted.
[0061] Step 5: Since the input sentence contains the number of knowledge (0, e1, e2...ek), perform steps 3 and 4 for each knowledge. The final candidate set to be predicted is (Ei, Ij). Ei represents the candidate knowledge, and Ij represents the intention of all candidates. The number of candidate combinations (Ei, Ij) is ixj.
[0062] Step 6: Predict the candidate process, take the input combination (0, I), (e1, I)...(ek, I) as (E1, I1) as input, suppose there is any combination (Ex, Ix) in the candidate set (Ei, Ij), predict whether (Ex, Ix) is the next sequence of the input sequence, and finally get the most likely next sequence (E2, I2).
[0063] Step 7: Perform a method similar to step 4 on the generated knowledge E2 to obtain some new process combinations, update the candidate set (Ei, Ij) to obtain a new candidate set.
[0064] Step 8: Take (E1, I1), (E2, I2) as new sequence input and predict the most likely next sequence (E3, I3) in the new candidate set (Ei, Ij).
[0065] Step 9: Continue iterating until the termination condition is met, such as the end of customer feedback or I = "dialogue termination".
[0066] Step 10: Finally, the generated dialogue flow (E1, I1), (E2, I2)...(Ek, Ik) is obtained.
[0067] Please refer to Figure 6 , which shows a knowledge generation effect diagram of a specific example of a dialog flow generation method provided by an embodiment of the present invention.
[0068] like Figure 6 As shown in the figure, in a specific example, for the patient input, we get the knowledge "low fever", "cough", "cold". "Low fever" and "cough" are not in the corpus. We can use "fever" and "fever" to simulate the consultation process of low fever; we can use "sputum" and "sore throat" to simulate the process of "cough".
[0069] Please refer to Figure 7 , which shows a structural schematic diagram of a dialogue process generating device provided by an embodiment of the present invention.
[0070] like Figure 7 As shown, the dialog flow generating device 700 includes: a knowledge extraction program module 710 , an extraction program module 720 and a prediction program module 730 .
[0071] Among them, the knowledge extraction program module 710 is configured to perform knowledge extraction on the input sentence to obtain the knowledge corresponding to the input sentence, and perform intent classification on the input sentence to obtain the intent corresponding to the input sentence; the extraction program module 720 is configured to extract a combination of knowledge and intent in a preset dialogue process based at least on the knowledge, wherein the preset dialogue process includes a combination of multiple knowledge and multiple intents; the prediction program module 730 is configured to predict the combination that is most likely to become the next sequence of the current dialogue process.
[0072] Please refer to Figure 8 , which shows a structural schematic diagram of a dialogue process generating device provided by an embodiment of the present invention.
[0073] like Figure 8 As shown, the dialog flow generating device 800 includes: an initial acquisition program module 810 , an intention acquisition program module 820 and a matching program module 830 .
[0074] Among them, the initial acquisition program module 810 is configured to extract knowledge and classify intent of the input sentence, and obtain the initial knowledge and initial intent corresponding to the input sentence; the intent acquisition program module 820 is configured to obtain similar knowledge corresponding to the input sentence and the intent corresponding to the input sentence; the matching program module 830 is configured to match the similar knowledge and intent with the initial knowledge and initial intent, and obtain the similar knowledge and intent that best matches the initial knowledge and initial intent.
[0075] It should be understood that Figure 7 and Figure 8 Modules and references documented in Figure 1 , Figure 2 , Figure 3 and Figure 4 Therefore, the operations and features described above for the method and the corresponding technical effects are also applicable to Figure 8 The modules in it will not be described in detail here.
[0076] It is worth noting that the modules in the embodiments of the present disclosure are not used to limit the solutions of the present disclosure. For example, the knowledge extraction program module can be described as a module that extracts knowledge from an input sentence to obtain knowledge corresponding to the input sentence, and performs intent classification on the input sentence to obtain intent corresponding to the input sentence. In addition, related functional modules can also be implemented by a hardware processor, for example, the knowledge extraction program module can also be implemented by a processor, which will not be repeated here.
[0077] In some other embodiments, the present invention also provides a non-volatile computer storage medium, the computer storage medium stores computer executable instructions, and the computer executable instructions can execute the dialog flow generation method in any of the above method embodiments;
[0078] As an implementation mode, the non-volatile computer storage medium of the present invention stores computer executable instructions, and the computer executable instructions are configured as follows:
[0079] Performing knowledge extraction on the input sentence to obtain knowledge corresponding to the input sentence, and performing intent classification on the input sentence to obtain intent corresponding to the input sentence;
[0080] Extracting a combination of knowledge and intention in a preset dialogue process based at least on the knowledge, wherein the preset dialogue process includes a combination of multiple knowledge and multiple intentions;
[0081] Predict the combination among the combinations that is most likely to become the next sequence of the current dialog flow.
[0082] As another embodiment, the non-volatile computer storage medium of the present invention stores computer executable instructions, and the computer executable instructions are configured as follows:
[0083] Extracting knowledge and classifying intent of an input sentence to obtain initial knowledge and initial intent corresponding to the input sentence;
[0084] Acquire similar knowledge corresponding to the input sentence and the intention corresponding to the input sentence;
[0085] The similar knowledge and intention are matched with the initial knowledge and initial intention to obtain the similar knowledge and intention that best matches the initial knowledge and initial intention.
[0086] The non-volatile computer-readable storage medium may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required by at least one function; the data storage area may store data created according to the use of the dialog flow generation device, etc. In addition, the non-volatile computer-readable storage medium may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the non-volatile computer-readable storage medium may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the dialog flow generation device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0087] An embodiment of the present invention further provides a computer program product, which includes a computer program stored on a non-volatile computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes any of the above-mentioned dialog flow generation methods.
[0088] Fig. 9 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention, such as Fig. 9 As shown, the device includes: one or more processors 910 and a memory 920, Fig. 9 A processor 910 is used as an example. The device of the dialog flow generation method may also include: an input device 930 and an output device 940. The processor 910, the memory 920, the input device 930 and the output device 940 may be connected via a bus or other means. Fig. 9 The example of connecting via a bus is taken. The memory 920 is the above-mentioned non-volatile computer-readable storage medium. The processor 910 executes various functional applications and data processing of the server by running the non-volatile software programs, instructions and modules stored in the memory 920, that is, the dialogue flow generation method of the above-mentioned method embodiment is realized. The input device 930 can receive input digital or character information, and generate key signal input related to the user setting and function control of the communication compensation device. The output device 940 may include a display device such as a display screen.
[0089] The above product can execute the method provided by the embodiment of the present invention, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not described in detail in this embodiment, please refer to the method provided by the embodiment of the present invention.
[0090] As an implementation mode, the electronic device is applied to a dialog flow generating device, used for a client, and includes: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can:
[0091] Performing knowledge extraction on the input sentence to obtain knowledge corresponding to the input sentence, and performing intent classification on the input sentence to obtain intent corresponding to the input sentence;
[0092] Extracting a combination of knowledge and intention in a preset dialogue process based at least on the knowledge, wherein the preset dialogue process includes a combination of multiple knowledge and multiple intentions;
[0093] Predict the combination among the combinations that is most likely to become the next sequence of the current dialog flow.
[0094] As another implementation, the electronic device is applied to a dialog flow generating device, used for a client, and includes: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can:
[0095] Extracting knowledge and classifying intent of an input sentence to obtain initial knowledge and initial intent corresponding to the input sentence;
[0096] Acquire similar knowledge corresponding to the input sentence and the intention corresponding to the input sentence;
[0097] The similar knowledge and intention are matched with the initial knowledge and initial intention to obtain the similar knowledge and intention that best matches the initial knowledge and initial intention.
[0098] The electronic device of the embodiment of the present application exists in various forms, including but not limited to:
[0099] (1) Mobile communication devices: These devices are characterized by their mobile communication functions and their main purpose is to provide voice and data communications. These terminals include: smart phones (such as iPhone), multimedia phones, functional phones, and low-end phones.
[0100] (2) Ultra-mobile personal computer devices: These devices fall into the category of personal computers, have computing and processing capabilities, and generally also have mobile Internet access features. These terminals include: PDA, MID and UMPC devices, such as iPad.
[0101] (3) Portable entertainment devices: These devices can display and play multimedia content. They include audio and video players (such as iPods), handheld game consoles, e-books, as well as smart toys and portable car navigation devices.
[0102] (4) Server: A device that provides computing services. The server consists of a processor, hard disk, memory, system bus, etc. The server is similar to a general computer architecture, but because it needs to provide highly reliable services, it has higher requirements in terms of processing power, stability, reliability, security, scalability, and manageability.
[0103] (5) Other electronic devices with data interaction functions.
[0104] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.
[0105] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.
[0106] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for generating a dialogue process, include: Performing knowledge extraction on the input sentence to obtain knowledge corresponding to the input sentence, and performing intent classification on the input sentence to obtain intent corresponding to the input sentence; Extracting a combination of knowledge and intention in a preset dialogue process based at least on the knowledge, wherein the preset dialogue process includes a combination of multiple knowledge and multiple intentions; Predicting the combination that is most likely to become the next sequence of the current dialogue flow among the combinations; Before extracting knowledge from the input sentence to obtain knowledge corresponding to the input sentence, the method further includes: A knowledge collection is taken as a sequence input, and a knowledge collection similar to the knowledge collection is taken as the prediction result to train the sequence prediction model.
2. The method according to claim 1, in, The combination of extracting knowledge and intention in a preset dialogue process based at least on the knowledge includes: Calculate a first similar knowledge set of any one of the knowledge; A first combination related to any one of the knowledge is extracted in a preset dialogue process based on the first similar knowledge set.
3. The method according to claim 2, in, The combination of extracting knowledge and intention in a preset dialogue process based at least on the knowledge also includes: A candidate set of the process to be predicted is formed based on all the extracted first combinations related to all the knowledge.
4. The method according to claim 3, in, After predicting the combination that is most likely to become the next sequence of the current dialogue flow, the method further includes: Extracting a second similar knowledge set of the knowledge in the next sequence, and extracting a second combination related to the knowledge in the next sequence in a preset dialogue process based on the second similar knowledge set; Updating the second combination into the candidate set to be predicted; Predicting a new next sequence in the candidate set to be predicted; Repeat the above steps until the termination condition is met.
5. A dialogue flow generating device, include: A knowledge extraction program module is configured to perform knowledge extraction on an input sentence to obtain knowledge corresponding to the input sentence, and perform intent classification on the input sentence to obtain intent corresponding to the input sentence; An extraction program module, configured to extract a combination of knowledge and intention in a preset dialogue process based at least on the knowledge, wherein the preset dialogue process includes a combination of multiple knowledge and multiple intentions; A prediction program module, configured to predict the combination of the combinations that is most likely to become the next sequence of the current dialogue flow; Before extracting knowledge from the input sentence to obtain knowledge corresponding to the input sentence, the method further includes: A knowledge collection is taken as a sequence input, and a knowledge collection similar to the knowledge collection is taken as the prediction result to train the sequence prediction model.
6. An electronic device, wherein include: At least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the steps of the method described in any one of claims 1 to 4.
7. A storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Method and computer apparatus for automatically building or updating hierarchical conversation flow management model for interactive AI agent system, and computer-readable recording medium
CN111837116A
Dialogue generation method and device, network training method and device, storage medium and equipment
CN111897941A
Process knowledge extraction method and system for interactive dialogue
CN114328967A
Robotic agent conversation escalation
US20190325868A1
Response method in man-machine dialogue, dialogue system, and storage medium
WO2021232957A1
