A method, device and system for dialogue response based on context reference
Through the two-way long and short memory network and TextCNN model based on deep learning, the problem of intelligent voice robots having difficulty understanding omitted content in users' spoken language is solved, achieving more accurate user intent recognition and experience improvement.
Patent Information
- Application Number
- CN202110157073.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-04
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2041-02-04
AI Technical Summary
It is difficult for intelligent voice robots to understand the omitted content in the user's spoken language, resulting in poor user experience.
The two-way long and short memory network model and TextCNN model based on deep learning are used to fill in the missing slots with alternative words in the historical dialogue through slot judgment and attribute judgment to improve the accuracy of dialogue understanding.
It improves the accuracy of understanding user intentions, improves user experience, and enhances the intelligent robot's ability to recognize user intentions.
Smart Images

Figure CN112948549B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer information processing, and in particular to a method, device and system for dialogue answering based on context reference. Background Art
[0002] The customer service center is the main bridge for communication between enterprises and users, and the main channel for improving user satisfaction. In the past, the customer service center was mainly based on manual customer service, with professional customer service personnel providing services to users.
[0003] With the development of computer information processing technology, more and more customer service centers have begun to use intelligent voice robots to serve users, alleviating the problem of long waiting time for manual customer service.
[0004] But people usually omit the content of the conversation when they speak, for example:
[0005] User: Hello, what colors are available for this phone?
[0006] Customer Service: Hello, this phone is available in white, blue and red.
[0007] User: How much memory is there?
[0008] Customer Service: This phone has 6G of memory.
[0009] User: What about this laptop?
[0010] It is easy for human customer service to understand that the user is asking about a notebook, but it is more difficult for intelligent voice robots, which often misunderstand or even fail to understand, resulting in a poor user experience. Summary of the invention
[0011] The present invention aims to solve the problem that the existing intelligent voice robot cannot well understand the omitted content in spoken language, which gives a bad experience to users.
[0012] In order to solve the above technical problems, the first aspect of the present invention proposes a conversation answering method based on context reference, the method comprising:
[0013] A conversation answering method based on context reference, characterized in that the method comprises:
[0014] Receive user input, input the user input into a slot judgment model, and determine the word corresponding to the slot;
[0015] Input the word corresponding to the slot into the slot attribute judgment model, if it is judged as a main slot, set the corresponding word as the first substitute word, if it is judged as an attribute slot, set the corresponding word as the second substitute word;
[0016] If the input content lacks a main body slot, the first alternative word in the most recent historical conversation is used to fill the main body slot. If the input content lacks an attribute slot, the second alternative word in the most recent historical conversation is used to fill the attribute slot, and the filled content is used for the conversation.
[0017] According to a preferred embodiment of the present invention, the slot judgment model is a bidirectional long short-term memory network model based on deep learning.
[0018] According to a preferred embodiment of the present invention, the slot judgment model includes an input layer, an encoding layer and an output layer, wherein the input layer converts the user's input content into a word vector, the encoding layer performs feature extraction on the converted word vector encoding, and the output layer outputs the slot information.
[0019] According to a preferred embodiment of the present invention, the encoding layer adopts a bidirectional long short-term memory network LSTM encoder, and the output layer adopts a serialization labeling algorithm CRF.
[0020] According to a preferred embodiment of the present invention, the slot attribute judgment model is a TextCNN model based on deep learning.
[0021] According to a preferred embodiment of the present invention, a backtracking round number threshold is preset, and when the backtracking dialogue round number exceeds the backtracking round number threshold, the first alternative word or the second alternative word is no longer used to fill the subject slot or the attribute slot.
[0022] According to a preferred implementation manner of the present invention, the backtracking round number threshold is set to 3.
[0023] A second aspect of the present invention provides a conversation answering device based on context reference, comprising:
[0024] The slot judgment module is used to receive the user's input content, input the user's input content into the slot judgment model, and determine the word corresponding to the slot;
[0025] A slot attribute judgment module, used for inputting the word corresponding to the slot into a slot attribute judgment model, and setting the corresponding word as a first substitute word if it is judged to be a main slot, and setting the corresponding word as a second substitute word if it is judged to be an attribute slot;
[0026] A slot filling module, if the input content lacks a main slot, backtracks and uses the first alternative word in the most recent historical conversation to fill the main slot; if the input content lacks an attribute slot, backtracks and uses the second alternative word in the most recent historical conversation to fill the attribute slot, and uses the filled content to conduct the conversation.
[0027] According to a preferred embodiment of the present invention, the slot judgment model is a bidirectional long short-term memory network model based on deep learning.
[0028] According to a preferred embodiment of the present invention, the slot judgment model includes an input layer, an encoding layer and an output layer, wherein the input layer converts the user's input content into a word vector, the encoding layer performs feature extraction on the converted word vector encoding, and the output layer outputs the slot information.
[0029] According to a preferred embodiment of the present invention, the encoding layer adopts a bidirectional long short-term memory network LSTM encoder, and the output layer adopts a serialization labeling algorithm CRF.
[0030] According to a preferred embodiment of the present invention, the slot attribute judgment model is a TextCNN model based on deep learning.
[0031] According to a preferred embodiment of the present invention, a backtracking round number threshold is preset, and when the backtracking dialogue round number exceeds the backtracking round number threshold, the first alternative word or the second alternative word is no longer used to fill the subject slot or the attribute slot.
[0032] According to a preferred implementation manner of the present invention, the backtracking round number threshold is set to 3.
[0033] A third aspect of the present invention provides a context-based dialogue response system, comprising:
[0034] A storage unit for storing a computer executable program;
[0035] The processing unit is used to read the computer executable program in the storage unit to execute the conversation answering method based on context reference.
[0036] A fourth aspect of the present invention provides a computer-readable medium for storing a computer-readable program, wherein the computer-readable program is used to execute the context-based reference-based dialogue response method.
[0037] By adopting this technical solution, the dialogue sentences omitted by the user are completed through context reference filling, so that the intelligent robot can better understand the user's meaning, improve the accuracy of understanding the user's intention, and enhance the user's experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to make the technical problems solved by the present invention, the technical means adopted and the technical effects achieved more clearly, the specific embodiments of the present invention will be described in detail with reference to the accompanying drawings. However, it should be noted that the drawings described below are only drawings of exemplary embodiments of the present invention, and those skilled in the art can obtain drawings of other embodiments based on these drawings without creative work.
[0039] Figure 1 is a flow chart of a conversation answering method based on context reference in an embodiment of the present invention;
[0040] Figure 2 is a schematic diagram of the structure of a slot determination model in an embodiment of the present invention;
[0041] Figure 3 is a schematic diagram of the structure of a conversation answering device based on context reference in an embodiment of the present invention;
[0042] Figure 4 Schematic diagram of the structural framework of the conversation response system based on context reference in an embodiment of the present invention;
[0043] Figure 5 It is a schematic diagram of the structure of a computer-readable storage medium in an embodiment of the present invention. DETAILED DESCRIPTION
[0044] The exemplary embodiments of the present invention will now be described more fully with reference to the accompanying drawings. Although each exemplary embodiment can be implemented in a variety of specific ways, it should not be understood that the present invention is limited to the embodiments set forth herein. On the contrary, these exemplary embodiments are provided to make the content of the present invention more complete and to facilitate the comprehensive communication of the inventive concept to those skilled in the art.
[0045] Under the premise of conforming to the technical concept of the present invention, the structure, performance, effect or other characteristics described in a specific embodiment may be combined with one or more other embodiments in any appropriate manner.
[0046] In the process of introducing specific embodiments, the detailed description of the structure, performance, effect or other characteristics is to enable those skilled in the art to fully understand the embodiments. However, it does not exclude that those skilled in the art can implement the present invention with a technical solution that does not contain the above-mentioned structure, performance, effect or other characteristics under certain circumstances.
[0047] The flowchart in the accompanying drawings is only an exemplary process demonstration, and does not mean that the solution of the present invention must include all the contents, operations and steps in the flowchart, nor does it mean that it must be executed in the order shown in the figure. For example, some operations / steps in the flowchart can be decomposed, some operations / steps can be combined or partially combined, etc. The execution order shown in the flowchart can be changed according to the actual situation without departing from the main purpose of the present invention.
[0048] Frames in the attached figure Figure 1 Generally, it refers to functional entities, which do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processing unit devices and / or microcontroller devices.
[0049] The same reference numerals in the drawings represent the same or similar elements, components or parts, and thus the repeated description of the same or similar elements, components or parts may be omitted below. It should also be understood that although the first, second, third and other attributives representing the numbers may be used herein to describe various devices, elements, components or parts, these devices, elements, components or parts should not be limited by these attributives. In other words, these attributives are only used to distinguish one from another. For example, the first device may also be called the second device, but it does not deviate from the essential technical solution of the present invention. In addition, the terms "and / or" and "and / or" refer to all combinations including any one or more of the listed items.
[0050] Figure 1 is a timing diagram of a conversation answering method based on context reference of the present invention, such as Figure 1 As shown. To distinguish it from computer language, the language used by humans is called natural language. However, natural language is different from computer language. Computers cannot directly understand the natural language used by humans. Slots are designed to help computers understand natural language. Slots are key information that the system needs to collect from users. For example, "What colors are available for this phone?" Slots include "phone," "color," and "which ones." Through the design of slots, computers can understand the meaning of natural language very well.
[0051] However, when people communicate normally, they often omit words. For example, when asking "What colors does this phone have?", people often say "What about the memory?" when asking about the memory. This makes it difficult for the computer to understand. The present invention is to solve this problem. The present invention provides a conversation answering method based on context reference, including:
[0052] S101, receiving user input content, inputting the user input content into a slot judgment model, and determining the word corresponding to the slot.
[0053] Furthermore, the slot judgment model is a bidirectional long short-term memory network model based on deep learning.
[0054] In this embodiment, since the judgment of the word content needs to be combined with the context, a bidirectional long short-term memory network model is used. The structure of the slot judgment model is as follows: Figure 2 As shown. The traditional network model based on deep learning is a recurrent neural network RNN model, and the RNN model shares a set of parameters and cannot determine which position's information is more important and which position's information is not important in combination with the context, so it is more difficult to do deep learning. The bidirectional long short-term memory network LSTM model solves this problem well and reduces the problem of gradient disappearance to a certain extent. Therefore, the network model in the present invention is a bidirectional long short-term memory network LSTM model based on deep learning.
[0055] On the basis of the above technical solution, further, the slot judgment model includes an input layer, an encoding layer and an output layer, wherein the input layer converts the user's input content into a word vector, the encoding layer performs feature extraction on the converted word vector encoding, and the output layer outputs the slot information.
[0056] The vectorization of text is to use digital features to represent text, because computers cannot directly understand natural language. In order for computers to understand natural language, we need to map text information into a numerical semantic space, which we can call word vector space. There are many algorithms for converting text into vectors, such as TF-IDF, BOW, One-Hot, word2vec, etc. In this embodiment, the word2vec algorithm is used for text vectorization. The word2vec model is an unsupervised learning model. The mapping of text information to semantic space can be achieved by training with an unindexed corpus.
[0057] In this embodiment, the input layer performs word segmentation processing on the user's input content and vectorizes the segmented phrases. For example, after the word segmentation processing of "What colors does this mobile phone have", it is divided into "this model", "mobile phone", "color", "what are there", "?" and converted into vectors according to the word2vec model. In other embodiments, a semantic vector library can be pre-set, all Chinese characters can be converted into vectors in advance for storage, and the vectors corresponding to the Chinese characters can be directly selected from the semantic vector library when used.
[0058] In the encoding layer, feature extraction is performed on the vectorized text to obtain slot representation features. The output layer constrains the slot representation features to improve accuracy and outputs slot labels.
[0059] On the basis of the above technical solution, further, the encoding layer adopts a bidirectional long short-term memory network LSTM encoder, and the output layer adopts a serialization labeling algorithm CRF.
[0060] In this embodiment, the bidirectional long-short term memory network model is a type of recurrent neural network, which can better consider the words before and after the sentence, such as "I don't think the weather is good today", where "no" is a limitation on the following "the weather is good", indicating the negation of the good weather. The use of the bidirectional long-short term memory network model can better capture the dependency relationship over a longer distance, and the bidirectional long-short term memory network model can also take into account the limitation of the following words on the previous words, such as "the weather is too cold today", where "not good" is a modification and limitation of "cold". Figure 2 As shown in the figure, the LSTM layer includes two LSTM models. The input sequence of one model is from left to right, and the input sequence of the other model is from right to left. Finally, the outputs of the hidden layer units of the two LSTM layers are concatenated as the output of the entire LSTM layer.
[0061] In this embodiment, the CRF layer can add some constraints to ensure that the final prediction result is valid. These constraints can be automatically learned by the CRF layer when training data. With these useful constraints, the wrong prediction sequence will be greatly reduced, and the accuracy of the output layer will be improved.
[0062] S102. Input the word corresponding to the slot into a slot attribute judgment model. If it is judged as a main slot, the corresponding word is set as a first substitute word. If it is judged as an attribute slot, the corresponding word is set as a second substitute word.
[0063] In this embodiment, the user service center has accumulated a large amount of historical corpus, and uses the historical corpus to train the slot attribute judgment model. The slots in the historical corpus are indexed by slot attributes using manual indexing, and the indexed historical corpus is divided into training samples and test samples. The model is trained using the training samples until the model converges, and then the model is tested using the test samples. If the model training passes the test, the model training is completed.
[0064] After the word corresponding to the slot is input into the slot attribute judgment model, the attribute of the slot is output. If it is judged as a main slot, the corresponding word is set as the first alternative word. If it is judged as an attribute slot, the corresponding word is set as the second alternative word.
[0065] For example, a user asks "Hello, what colors are available for this phone?" After judging that "phone" is the subject slot and "color" is the attribute slot, the first alternative word is "phone" and the second alternative word is "color".
[0066] On the basis of the above technical solution, further, the slot attribute judgment model is a TextCNN model based on deep learning. In this embodiment, the input language is classified by the TextCNN model to determine whether it is a subject slot or an attribute slot.
[0067] In other implementations, the application field is more specific, such as electronic product sales, and the number of products involved is not large, so the main slot library and the attribute slot library can be set by manual input. The slot attribute judgment model is a semantic matching DSSM model based on deep learning. The words corresponding to the slot are input into the DSMM model for matching with the words in the main slot library and / or the attribute slot library, and the specific attributes of the slot are judged by semantic matching.
[0068] S103. If the input content lacks a main body slot, backtrack and use the first substitute word in the most recent historical conversation to fill the main body slot; if the input content lacks an attribute slot, backtrack and use the second substitute word in the most recent historical conversation to fill the attribute slot, and use the filled content to conduct the conversation.
[0069] The process is described below by means of Example 1.
[0070] Embodiment 1
[0071] The transformation process of the first alternative word and the second alternative word during the dialogue is shown in Table 1.
[0072] Table 1 Contents of conversations between users and customer service Table 1
[0073] identity Conversation content First alternative Second alternative user Hello, what colors are available for this phone? cell phone color customer service Hello, the colors of this phone are white, blue and red. user How big is the memory? cell phone Memory customer service The memory of this phone is 6G. user What about this laptop? notebook Memory
[0074] From Table 1, we can see that the user did not omit anything when asking for the first time, and both the subject slot and the attribute slot were complete. When asking for the second time, the subject slot was habitually omitted. At this time, the first alternative word in the previous round of dialogue was used to fill it in. The user's question after filling it in was "How big is the (mobile phone) memory?" At this time, the system can accurately identify the user's intention and answer it. When asking for the third time, the user omitted the attribute slot. At this time, the second alternative word in the previous round of dialogue was used to fill it in. The user's question after filling it in was "What about this laptop's (memory)?" At this time, the system can also accurately identify the user's intention. Have a conversation based on the recognized user intention, such as answering "The memory of this laptop is 16G."
[0075] On the basis of the above technical solution, further, a backtracking round number threshold is preset, and when the backtracking dialogue round number exceeds the backtracking round number threshold, the first alternative word or the second alternative word is no longer used to fill the subject slot or the attribute slot.
[0076] On the basis of the above technical solution, further, the backtracking round number threshold is set to 3.
[0077] In this embodiment, omissions are usually made in relatively close conversations during a user conversation. If there are many conversations between rounds, filling in or replacing them may lead to misunderstandings. Therefore, the number of conversation rounds to be backtracked is set to 3, and no filling is performed after more than 3 rounds.
[0078] In other embodiments, since people often go off topic during a conversation, that is, the topic suddenly changes during the conversation and the topic of the previous conversation is no longer continued, using the first alternative word or the second alternative word to fill the subject slot or attribute slot may lead to misunderstanding of the topic. Therefore, before filling the missing subject slot or attribute slot, the user's conversation content is first input into the intention judgment model to judge the user's conversation content intention. When the subject slot or attribute slot is missing and it is necessary to backtrack and use the first alternative word or the second alternative word in the most recent historical conversation to fill it, it is judged whether the conversation content intention of the current conversation round is consistent with the conversation content intention of the conversation round where the first alternative word or the second alternative word is located. If it is consistent, the first alternative word or the second alternative word is used to fill it, otherwise it continues to backtrack until the first alternative word or the second alternative word with the same conversation content intention is used to fill it. The intention judgment model is a TextCNN model based on deep learning, which is trained with historical conversation data, and the training process is the same as the slot attribute judgment model training process.
[0079] The process is described below through Example 2.
[0080] Embodiment 2
[0081] The transformation process of the first alternative word and the second alternative word during the dialogue is shown in Table 2.
[0082] Table 2 Contents of conversations between users and customer service Table 2
[0083]
[0084] As can be seen from Table 2, in the first round of dialogue, the user's dialogue content intention is "consulting about products", the first alternative word is "mobile phone", and the second alternative word is "color". In the second round of dialogue, the user's dialogue content intention changes from "consulting about products" to "consulting about weather". At this time, the first alternative word in the second round of dialogue is "today" and the second alternative word is "weather". In the third round of dialogue, the dialogue content intention changes back to "consulting about products". At this time, there is a lack of subject slots. Going back to the second round of dialogue, due to the different dialogue content intentions, the first alternative word in the second round of dialogue is not used. Continuing to go back, the dialogue content intention is the same in the first round of dialogue, so the first alternative word in the first round of dialogue is used to fill it.
[0085] Similarly, in this embodiment, a backtracking round number threshold is also set. When the backtracking round number exceeds the set backtracking round number threshold, no more filling is performed.
[0086] In this embodiment, if the set backtracking round threshold is exceeded and the missing subject slot or attribute slot cannot be filled, resulting in the system being unable to understand the user's intention, or the user's input content lacks both the subject slot and the attribute slot, the system uses a pre-set fallback phrase to answer, such as "I'm sorry, I'm not very clear about your question, could you please say it again?"
[0087] Figure 3 is a schematic diagram of the structure of a conversation answering device based on context reference in an embodiment of the present invention. Figure 3 As shown, the present invention provides a conversation answering device 400 based on context reference, comprising:
[0088] The slot determination module 301 is used to receive user input content, input the user input content into the slot determination model, and determine the word corresponding to the slot.
[0089] On the basis of the above technical solution, further, the slot judgment model is a bidirectional long short-term memory network model based on deep learning.
[0090] In this embodiment, since the judgment of the word content needs to be combined with the context, a bidirectional long short-term memory network model is used. The structure of the slot judgment model is as follows: Figure 2 As shown. The traditional network model based on deep learning is a recurrent neural network RNN model, and the RNN model shares a set of parameters and cannot combine the context to determine which position's information is more important and which position's information is not important, so deep learning is more difficult. The bidirectional long short-term memory network LSTM model solves this problem well and reduces the problem of gradient disappearance to a certain extent. Therefore, the network model in the present invention is a bidirectional long short-term memory network LSTM model based on deep learning.
[0091] On the basis of the above technical solution, further, the slot judgment model includes an input layer, an encoding layer and an output layer, wherein the input layer converts the user's input content into a word vector, the encoding layer performs feature extraction on the converted word vector encoding, and the output layer outputs the slot information.
[0092] The vectorization of text is to use digital features to represent text, because computers cannot directly understand natural language. In order for computers to understand natural language, we need to map text information into a numerical semantic space, which we can call word vector space. There are many algorithms for converting text into vectors, such as TF-IDF, BOW, One-Hot, word2vec, etc. In this embodiment, the word2vec algorithm is used for text vectorization. The word2vec model is an unsupervised learning model. The mapping of text information to semantic space can be achieved by training with an unindexed corpus.
[0093] In this embodiment, the input layer performs word segmentation processing on the user's input content and vectorizes the segmented phrases. For example, after the word segmentation processing of "What colors does this mobile phone have", it is divided into "this model", "mobile phone", "color", "what are there", "?" and converted into vectors according to the word2vec model. In other embodiments, a semantic vector library can be pre-set, all Chinese characters can be converted into vectors in advance for storage, and the vectors corresponding to the Chinese characters can be directly selected from the semantic vector library when used.
[0094] In the encoding layer, feature extraction is performed on the vectorized text to obtain slot representation features. The output layer constrains the slot representation features to improve accuracy and outputs slot labels.
[0095] On the basis of the above technical solution, further, the encoding layer adopts a bidirectional long short-term memory network LSTM encoder, and the output layer adopts a serialization labeling algorithm CRF.
[0096] In this embodiment, the bidirectional long-short term memory network model is a type of recurrent neural network, which can better consider the words before and after the sentence, such as "I don't think the weather is good today", where "no" is a limitation on the following "the weather is good", indicating the negation of the good weather. The use of the bidirectional long-short term memory network model can better capture the dependency relationship over a longer distance, and the bidirectional long-short term memory network model can also take into account the limitation of the following words on the previous words, such as "the weather is too cold today", where "not good" is a modification and limitation of "cold". Figure 2As shown in the figure, the LSTM layer includes two LSTM models. The input sequence of one model is from left to right, and the input sequence of the other model is from right to left. Finally, the outputs of the hidden layer units of the two LSTM layers are concatenated as the output of the entire LSTM layer.
[0097] In this embodiment, the CRF layer can add some constraints to ensure that the final prediction result is valid. These constraints can be automatically learned by the CRF layer when training data. With these useful constraints, the wrong prediction sequence will be greatly reduced, and the accuracy of the output layer will be improved.
[0098] The slot attribute judgment module 302 is used to input the word corresponding to the slot into the slot attribute judgment model. If it is judged as a main slot, the corresponding word is set as the first alternative word. If it is judged as an attribute slot, the corresponding word is set as the second alternative word.
[0099] In this embodiment, the user service center has accumulated a large amount of historical corpus, and uses the historical corpus to train the slot attribute judgment model. The slots in the historical corpus are indexed by slot attributes using manual indexing, and the indexed historical corpus is divided into training samples and test samples. The model is trained using the training samples until the model converges, and then the model is tested using the test samples. If the model training passes the test, the model training is completed.
[0100] After the word corresponding to the slot is input into the slot attribute judgment model, the attribute of the slot is output. If it is judged as a main slot, the corresponding word is set as the first alternative word. If it is judged as an attribute slot, the corresponding word is set as the second alternative word.
[0101] For example, a user asks "Hello, what colors are available for this phone?" After judging that "phone" is the subject slot and "color" is the attribute slot, the first alternative word is "phone" and the second alternative word is "color".
[0102] On the basis of the above technical solution, further, the slot attribute judgment model is a TextCNN model based on deep learning. In this embodiment, the input language is classified by the TextCNN model to determine whether it is a subject slot or an attribute slot.
[0103] In other implementations, the application field is more specific, such as electronic product sales, and the number of products involved is not large, so the main slot library and the attribute slot library can be set by manual input. The slot attribute judgment model is a semantic matching DSSM model based on deep learning. The words corresponding to the slot are input into the DSMM model for matching with the words in the main slot library and / or the attribute slot library, and the specific attributes of the slot are judged by semantic matching.
[0104] The slot filling module 303 backtracks and uses the first substitute word in the most recent historical conversation to fill the main slot if the input content lacks a main slot; and backtracks and uses the second substitute word in the most recent historical conversation to fill the attribute slot if the input content lacks an attribute slot, and uses the filled content to conduct the conversation.
[0105] On the basis of the above technical solution, further, a backtracking round number threshold is preset, and when the backtracking dialogue round number exceeds the backtracking round number threshold, the first alternative word or the second alternative word is no longer used to fill the subject slot or the attribute slot.
[0106] On the basis of the above technical solution, further, the backtracking round number threshold is set to 3.
[0107] In this embodiment, omissions are usually made in relatively close conversations during a user conversation. If there are many conversations between rounds, filling in or replacing them may lead to misunderstandings. Therefore, the number of conversation rounds to be backtracked is set to 3, and no filling is performed after more than 3 rounds.
[0108] In other embodiments, since people often go off topic during a conversation, that is, the topic suddenly changes during the conversation and the topic of the previous conversation is no longer continued, using the first alternative word or the second alternative word to fill the subject slot or attribute slot may lead to misunderstanding of the topic. Therefore, before filling the missing subject slot or attribute slot, the user's conversation content is first input into the intention judgment model to judge the user's conversation content intention. When the subject slot or attribute slot is missing and it is necessary to backtrack and use the first alternative word or the second alternative word in the most recent historical conversation to fill it, it is judged whether the conversation content intention of the current conversation round is consistent with the conversation content intention of the conversation round where the first alternative word or the second alternative word is located. If it is consistent, the first alternative word or the second alternative word is used to fill it, otherwise it continues to backtrack until the first alternative word or the second alternative word with the same conversation content intention is used to fill it. The intention judgment model is a TextCNN model based on deep learning, which is trained with historical conversation data, and the training process is the same as the slot attribute judgment model training process.
[0109] Similarly, in this embodiment, a backtracking round number threshold is also set. When the backtracking round number exceeds the set backtracking round number threshold, no more filling is performed.
[0110] like Figure 4 As shown, in one embodiment of the present invention, a conversation response system based on context reference is also disclosed. Figure 4 The displayed context-based dialogue response system is merely an example and should not limit the functionality and scope of use of the embodiments of the present invention.
[0111] The context-reference-based dialogue response system 400 includes a storage unit 420 for storing a computer executable program; and a processing unit 410 for reading the computer executable program in the storage unit to execute the steps of various embodiments of the present invention.
[0112] In this embodiment, the context-based dialogue response system 400 further includes a bus 430 connecting different system components (including a storage unit 420 and a processing unit 410), a display unit 440, and the like.
[0113] The storage unit 420 stores a computer-readable program, which may be a source program or a code of a read-only program. The program may be executed by the processing unit 410, so that the processing unit 410 performs the steps of various embodiments of the present invention. For example, the processing unit 410 may perform the following steps: Figure 1 Steps shown.
[0114] The storage unit 420 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 4201 and / or a cache storage unit 4202, and may further include a read-only storage unit (ROM) 4203. The storage unit 420 may also include a program / utility 4204 having a set (at least one) of program modules 4205, such program modules 4205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination thereof may include the implementation of a network environment.
[0115] Bus 430 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0116] The context-based dialog response system 400 may also communicate with one or more external devices 470 (e.g., keyboard, display, network device, Bluetooth device, etc.), so that the user can interact with the processing unit 410 via these external devices 470 through the input / output (I / O) interface 450, and may also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN) and / or public network, such as the Internet) through the network adapter 460. The network adapter 460 may communicate with other modules of the context-based dialog response system 400 through the bus 430. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in the context-based dialog response system 400, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0117] Figure 5 Schematic diagram of a computer readable medium embodiment of the present invention. Figure 5 As shown, the computer program can be stored on one or more computer-readable media. The computer-readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory unit (RAM), a read-only memory unit (ROM), an erasable programmable read-only memory unit (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory unit (CD-ROM), an optical storage unit, a magnetic storage unit, or any suitable combination of the above. When the computer program is executed by one or more data processing devices, the computer-readable medium is enabled to implement the above method of the present invention, namely:
[0118] S101, receiving user input content, inputting the user input content into a slot judgment model, and determining a word corresponding to the slot;
[0119] S102, inputting the word corresponding to the slot into the slot attribute judgment model, if it is judged to be a main slot, setting the corresponding word as a first substitute word, if it is judged to be an attribute slot, setting the corresponding word as a second substitute word;
[0120] S103. If the input content lacks a main body slot, backtrack and use the first substitute word in the most recent historical conversation to fill the main body slot; if the input content lacks an attribute slot, backtrack and use the second substitute word in the most recent historical conversation to fill the attribute slot, and use the filled content to conduct the conversation.
[0121] Through the description of the above implementation modes, it is easy for those skilled in the art to understand that the exemplary embodiments described in the present invention can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation mode of the present invention can be embodied in the form of a software product, which can be stored in a computer-readable storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a data processing device (which can be a personal computer, a server, or a network device, etc.) to perform the above method according to the present invention.
[0122] The computer readable storage medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by an instruction execution system, an apparatus, or a device or used in combination with it. The program code contained on the readable storage medium may be transmitted with any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.
[0123] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0124] In summary, the present invention can be implemented by a method, apparatus, electronic device or computer readable medium that executes a computer program. In practice, a general data processing device such as a microprocessor unit or a digital signal processing unit (DSP) can be used to implement some or all functions of the present invention.
[0125] The specific embodiments described above further describe the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the present invention is not inherently related to any specific computer, virtual device or electronic device, and various general devices can also implement the present invention. The above description is only a specific embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A conversation response method based on context reference, It is characterized in that Methods include: Receive user input, input the user input into a slot judgment model, and determine the word corresponding to the slot; Input the word corresponding to the slot into the slot attribute judgment model, if it is judged as a main slot, set the corresponding word as the first substitute word, if it is judged as an attribute slot, set the corresponding word as the second substitute word; Determine the intention of the user input content. If the input content lacks a main body slot, determine whether the conversation content intention of the current conversation round is consistent with the conversation content intention of the conversation round in the most recent historical conversation where the first alternative word is located. If they are consistent, use the first alternative word to fill the main body slot. Otherwise, continue to backtrack forward until the first alternative word with the same conversation content intention is used to fill it. If the input content lacks an attribute slot, determine whether the conversation content intention of the current conversation round is consistent with the conversation content intention of the conversation round in the most recent historical conversation where the second alternative word is located. If they are consistent, use the second alternative word to fill the attribute slot. Otherwise, continue to backtrack forward until the second alternative word with the same conversation content intention is used to fill it. Use the filled content to have a conversation.
2. The conversation response method according to claim 1, It is characterized in that The slot judgment model is a bidirectional long short-term memory network model based on deep learning.
3. The conversation response method according to claim 2, It is characterized in that The slot judgment model includes an input layer, an encoding layer and an output layer, wherein the input layer converts the user's input content into a word vector, the encoding layer performs feature extraction on the converted word vector encoding, and the output layer outputs slot information.
4. The conversation response method according to claim 3, It is characterized in that The encoding layer adopts a bidirectional long short-term memory network LSTM encoder, and the output layer adopts a serialization labeling algorithm CRF.
5. The conversation response method according to claim 1, It is characterized in that The slot attribute judgment model is a TextCNN model based on deep learning.
6. The conversation response method according to claim 1, It is characterized in that A backtracking round number threshold is preset, and when the backtracking dialogue round number exceeds the backtracking round number threshold, the first alternative word or the second alternative word is no longer used to fill the subject slot or the attribute slot.
7. The conversation response method according to claim 6, It is characterized in that The backtracking round number threshold is set to 3.
8. A conversation response device based on contextual reference, It is characterized in that The device includes: The slot judgment module is used to receive the user's input content, input the user's input content into the slot judgment model, and determine the word corresponding to the slot; A slot attribute judgment module, used for inputting the word corresponding to the slot into a slot attribute judgment model, and setting the corresponding word as a first substitute word if it is judged to be a main slot, and setting the corresponding word as a second substitute word if it is judged to be an attribute slot; A slot filling module determines the intention of the user input content. If the input content lacks a main body slot, it determines whether the conversation content intention of the current dialogue round is consistent with the conversation content intention of the first alternative word in the most recent historical dialogue. If they are consistent, the first alternative word is used to fill the main slot, otherwise it continues to backtrack until the first alternative word with the same conversation content intention is used to fill it; if the input content lacks an attribute slot, it determines whether the conversation content intention of the current dialogue round is consistent with the conversation content intention of the second alternative word in the most recent historical dialogue. If they are consistent, the second alternative word is used to fill the attribute slot, otherwise it continues to backtrack until the second alternative word with the same conversation content intention is used to fill it; Use the filled content to have a conversation.
9. A conversation response system based on context reference, It is characterized in that include: A storage unit for storing a computer executable program; A processing unit, configured to read the computer executable program in the storage unit to execute the context-reference-based dialogue answering method according to any one of claims 1 to 7.
10. A computer-readable medium for storing a computer-readable program, It is characterized in that The computer-readable program is used to execute the context-reference-based dialogue response method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Realization method and apparatus for intelligent question and answer system
CN108446322A
Automatic question and answer method, device and equipment based on knowledge graph, and storage medium
CN111949787A
