WO2020177282A1 - Machine dialogue method and apparatus, computer device, and storage medium - Google Patents

Machine dialogue method and apparatus, computer device, and storage medium Download PDF

Info

Publication number
WO2020177282A1
WO2020177282A1 PCT/CN2019/103612 CN2019103612W WO2020177282A1 WO 2020177282 A1 WO2020177282 A1 WO 2020177282A1 CN 2019103612 W CN2019103612 W CN 2019103612W WO 2020177282 A1 WO2020177282 A1 WO 2020177282A1
Authority
WO
WIPO (PCT)
Prior art keywords
response
value
intention
dialogue
model
Prior art date
Application number
PCT/CN2019/103612
Other languages
French (fr)
Chinese (zh)
Inventor
吴壮伟
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2020177282A1 publication Critical patent/WO2020177282A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks

Definitions

  • the present invention relates to the field of artificial intelligence technology, in particular to a machine dialogue method, device, computer equipment and storage medium.
  • chatbots have gradually emerged.
  • a chatbot is a program used to simulate human conversations or chats. It can be used for practical purposes, such as customer service, consultation and Q&A, and some social robots are used to chat with people.
  • chatbots will be equipped with natural language processing systems, but more often extract keywords from input sentences, and then retrieve answers based on keywords from the database.
  • the answers of these chat bots are usually pretty, non-emotional, and the chat mode is the same, causing people to be less interested in chatting with them, and the utilization rate of chat bots is also low.
  • the invention provides a machine dialogue method, device, computer equipment and storage medium to solve the same problem that a chat robot answers.
  • a machine dialogue method includes the following steps:
  • the dialogue intention is input into a preset response decision model, and the response strategy output by the response decision model in response to the dialogue intention is obtained, wherein the response decision model is used to obtain a response strategy from a plurality of preset candidate response strategies Select a response strategy corresponding to the dialogue intention in the dialog;
  • the language information is input into a response generation model having a mapping relationship with the response strategy, and the response information input by the response generation model in response to the language information is obtained.
  • a machine dialogue device including:
  • the acquisition module is used to acquire the language information input by the current user
  • a recognition module which inputs the language information into a preset intention recognition model, and obtains a dialogue intention output by the intention recognition model in response to the language information;
  • the calculation module inputs the dialog intention into a preset response decision model, and obtains the response strategy output by the response decision model in response to the dialog intention, wherein the response decision model is used to obtain a response from a plurality of preset Selecting a response strategy corresponding to the dialogue intention among candidate response strategies;
  • a generating module inputs the language information into a response generation model that has a mapping relationship with the response strategy, and obtains response information input by the response generation model in response to the language information.
  • a computer device comprising a memory and a processor, the memory stores computer readable instructions, and when the computer readable instructions are executed by the processor, the processor executes the steps of the machine dialogue method described above .
  • a computer-readable storage medium having computer-readable instructions stored thereon, and when the computer-readable instructions are executed by a processor, the processor executes the steps of the machine dialogue method described above.
  • the beneficial effects of the embodiments of the present invention are: by acquiring the language information input by the current user; inputting the language information into a preset intention recognition model, and acquiring the dialogue intention output by the intention recognition model in response to the language information;
  • the dialogue intention is input into a preset response decision model, and the response strategy output by the response decision model in response to the dialogue intention is obtained, wherein the response decision model is used to obtain a response strategy from a plurality of preset candidate response strategies Select the response strategy corresponding to the dialogue intention; input the language information into a response generation model that has a mapping relationship with the response strategy, and obtain the response information input by the response generation model in response to the language information.
  • the response generation model is determined, and the reinforcement learning network model is introduced in the process of determining the response generation model.
  • different response generation models are used to generate different types of responses, so that the dialogue is diversified and more interesting.
  • FIG. 1 is a schematic diagram of the basic flow of a machine dialogue method according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram of a process flow of determining a response strategy using a Q-value matrix in an embodiment of the present invention
  • FIG. 3 is a schematic diagram of a process flow of determining a response strategy using a Q value reinforcement learning network according to an embodiment of the present invention
  • FIG. 4 is a schematic diagram of the training process of an LSTM-CNN neural network model according to an embodiment of the present invention
  • FIG. 5 is a block diagram of the basic structure of a machine dialogue device according to an embodiment of the present invention.
  • Fig. 6 is a block diagram of the basic structure of a computer device according to an embodiment of the present invention.
  • terminal and “terminal equipment” used herein include both wireless signal receiver equipment, equipment that only has wireless signal receivers without transmitting capability, and equipment receiving and transmitting hardware.
  • a device which has a device capable of performing two-way communication receiving and transmitting hardware on a two-way communication link.
  • Such equipment may include: cellular or other communication equipment, which has a single-line display or multi-line display or cellular or other communication equipment without a multi-line display; PCS (Personal Communications Service, personal communication system), which can combine voice and data Processing, fax and/or data communication capabilities; PDA (Personal Digital Assistant), which can include radio frequency receivers, pagers, Internet/Intranet access, web browsers, notebooks, calendars and/or GPS (Global Positioning System (Global Positioning System) receiver; a conventional laptop and/or palmtop computer or other device, which has and/or includes a radio frequency receiver, a conventional laptop and/or palmtop computer or other device.
  • PCS Personal Communications Service, personal communication system
  • PDA Personal Digital Assistant
  • GPS Global Positioning System (Global Positioning System) receiver
  • a conventional laptop and/or palmtop computer or other device which has and/or includes a radio frequency receiver, a conventional laptop and/or palmtop computer or other device.
  • terminal and terminal equipment used here may be portable, transportable, installed in vehicles (aviation, sea and/or land), or suitable and/or configured to operate locally, and/or In a distributed form, it runs on the earth and/or any other location in space.
  • the "terminal” and “terminal device” used here can also be communication terminals, Internet terminals, music/video playback terminals, such as PDA, MID (Mobile Internet Device, mobile Internet device) and/or music/video playback Functional mobile phones can also be devices such as smart TVs and set-top boxes.
  • the terminal in this embodiment is the aforementioned terminal.
  • FIG. 1 is a schematic diagram of the basic flow of a machine dialogue method in this embodiment.
  • a machine dialogue method includes the following steps:
  • the language information input by the user is acquired through the interactive page on the terminal.
  • the received information can be text information or voice information.
  • the voice information is converted into text information through a voice recognition device.
  • the recognition of the dialogue intention can be based on keywords, for example, to determine whether the intent is task-based or chat-type.
  • the task-type is the dialogue intention that requires robots to answer questions. It can be determined whether the input language information contains query keywords, such as "?" "What", "How much”, “Where", “How” and other interrogative mood particles. You can also use a regular matching algorithm to determine whether the input language information is a question sentence.
  • a regular expression is a logical formula for string manipulation. It uses predefined specific characters and combinations of these specific characters to form a "rule” String", this "rule string” is used to express a kind of filtering logic for string.
  • the dialogue intention is a chat type.
  • dialogue intentions can be subdivided.
  • the chat type can be subdivided into positive types, including emotions such as affirmation, praise, and thanks, and negative types, including emotions such as complaints, complaints, and accusations.
  • the subdivided dialogue intentions can be judged by the preset keyword list.
  • a keyword list is preset. When the keywords in the extracted input language information are in the keyword list corresponding to a certain dialogue intention When the words match, it is considered that the input language information corresponds to the dialogue intention.
  • the dialogue intention recognition is performed through the pre-trained LSTM-CNN neural network model.
  • first perform Chinese word segmentation use the basic word segmentation library, and sequentially enter to remove stop words, punctuation, etc., obtain the word embedding vector through the word vector model, and pass it to the neural network model based on LSTM-CNN.
  • the word embedding vector enters the multi-layer LSTM neural unit to obtain the state vector and output of each stage; then, based on the state vector of each stage, perform convolution operation and pooling operation (CNN) to obtain the integrated vector index; then the integrated vector index Enter the softmax function to get the probability of the corresponding intention.
  • CNN convolution operation and pooling operation
  • the intention with the highest probability is the dialogue intention corresponding to the input language information.
  • Figure 4 for the training process of the LSTM-CNN neural network model.
  • the dialogue intention of the input language information is obtained, and the dialogue intention is input into the response decision model to determine the response strategy for the input language information.
  • different response strategies can be preset for different dialogue intentions, for example, for task-based intentions, the response strategy is question answering, and for negative intentions, the response strategy is emotional resolution.
  • Different response strategies correspond to different response generation models.
  • the Q value is calculated to determine the response strategy to be adopted for the dialogue intention.
  • the Q value is used to measure the value of a certain response strategy for a certain dialogue intention to the entire chat process. For example, we examine the degree of pleasure of the chat. The degree of pleasure can be accounted for by the negative intention sentences of the entire dialogue process as the user’s input in the current round of dialogue. Measured by the ratio of the number, the Q value is the value of a certain response strategy for a certain round of dialogue to chat pleasure.
  • a Q-value matrix can be preset through empirical values, the elements of which are q(s,a), s ⁇ S, a ⁇ A, where S is the dialogue intention space and A is the response strategy space.
  • the Q value is calculated by a Q value reinforcement learning network model.
  • the input of Q-value reinforcement learning network model is s, which is the dialogue intention, and the output is Q(s, a). That is, starting from state s and adopting strategy a, the expected benefits can be obtained.
  • the training of the Q-value reinforcement learning network model takes the convergence of the first loss function as the training objective, and the first loss function is
  • s is the dialogue intention
  • a is the response strategy
  • w is the network parameter of the Q value reinforcement learning network model
  • Q is the true value. Is the predicted value.
  • w is the network parameter trained by the Q-value reinforcement learning network model.
  • the response decision model is the aforementioned Q-value matrix or Q-value reinforcement learning network model.
  • S104 Input the language information to a response generation model that has a mapping relationship with the response strategy, and obtain response information input by the response generation model in response to the language information.
  • a corresponding response generation model is preset.
  • the response strategy is a question answering type
  • the corresponding response generation model includes a question and answer database, and matches the corresponding answer by searching for keywords in the input language information.
  • the corresponding response generation model adopts the trained Seq2Seq model.
  • the specific training process is to prepare the training corpus, that is, prepare the input sequence and the corresponding output sequence, input the input sequence into the Seq2Seq model, and calculate the output For the probability of the sequence, adjust the parameters of the Seq2Seq model so that the entire sample, that is, all input sequences, has the highest probability of outputting the corresponding output sequence after Seq2Seq.
  • the training corpus prepared here requires the sentiment of the input sentence to be negative and the sentiment of the output sentence to be positive.
  • step S103 further includes the following steps:
  • S112 Determine that the candidate response strategy corresponding to the largest q value in the Q value matrix is the response strategy of the dialogue intention.
  • the candidate response strategy with the largest q value is the response strategy corresponding to the dialogue intention.
  • step S103 further includes the following steps:
  • S121 Input the candidate response strategy and the dialogue intention into the Q-value reinforcement learning network model in turn, and obtain the Q value corresponding to each candidate response strategy output by the Q-value reinforcement learning network model;
  • the candidate response strategy and the dialogue intention are input into the Q value reinforcement learning network model to obtain the Q value of the dialogue intention using the response strategy.
  • S122 Determine that the candidate response strategy with the largest Q value is the response strategy of the dialogue intention.
  • the candidate response strategy with the largest Q value is the response strategy that the dialogue intention should adopt.
  • the training of the LSTM-CNN neural network model in the embodiment of the present invention includes the following steps:
  • the training samples are labeled with the category of dialogue intent.
  • the types of training sample marks are task type and chat type.
  • the task type responds to user needs for answering questions
  • the chat type responds to applications and needs for small talk.
  • N is the number of training samples.
  • the corresponding label Yi is the final intent recognition result
  • the neural network model of LSTM-CNN takes the convergence of the second loss function as the training target, that is, by adjusting the weight of each node in the neural network model, the second loss function reaches the minimum value.
  • the loss When the value of the function no longer decreases, but instead increases, the training ends.
  • the second loss function is used to measure whether the conversation intention of the training sample predicted by the LSTM-CNN neural network model is consistent with the conversation intention category marked by the training sample. If the second loss function does not converge, adjust the neural network through the gradient descent method
  • the weight of each node in the model ends when the reference type of dialogue intention predicted by the neural network is consistent with the type of dialogue intention marked by the training sample. That is to continue to adjust the weight, the value of the loss function no longer decreases, but increases instead, the training ends.
  • FIG. 5 is a block diagram of the basic structure of the machine dialogue device of this embodiment.
  • a machine dialogue device includes: an acquisition module 210, an identification module 220, a calculation module 230, and a generation module 240.
  • the obtaining module 210 is used to obtain the language information input by the current user;
  • the recognition module 220 is used to input the language information into a preset intention recognition model, and obtain the dialogue output by the intention recognition model in response to the language information.
  • calculation module 230 input the dialogue intent into a preset response decision model, and obtain the response strategy output by the response decision model in response to the dialogue intention, wherein the response decision model is used from the preset
  • the response strategy corresponding to the dialogue intention is selected among the multiple candidate response strategies
  • the generation module 240 inputs the language information into the response generation model that has a mapping relationship with the response strategy, and obtains the response information of the response generation model The response information entered while describing the language information.
  • the embodiment of the present invention obtains the language information input by the current user; inputs the language information into a preset intention recognition model, and obtains the dialogue intention output by the intention recognition model in response to the language information; Input into a preset response decision model to obtain the response strategy output by the response decision model in response to the dialogue intention, wherein the response decision model is used to select from a plurality of preset candidate response strategies and A response strategy corresponding to the dialogue intention; the language information is input to a response generation model that has a mapping relationship with the response strategy, and the response information input by the response generation model in response to the language information is obtained.
  • the response generation model is determined, and the reinforcement learning network model is introduced in the process of determining the response generation model. For different intentions, different response generation models are used to generate different types of responses, so that the dialogue is diversified and more interesting.
  • the response decision model in the machine dialogue device is based on a preset Q-value matrix, wherein the element q in the Q-value matrix is used to evaluate the value of each candidate response strategy for each dialogue intention.
  • the machine dialogue device further includes: a first query submodule and a first confirmation submodule, wherein the first query submodule is used for querying the Q-value matrix according to the dialogue intention; the first confirmation submodule is used for It is determined that the candidate response strategy corresponding to the largest q value in the Q value matrix is the response strategy of the dialogue intention.
  • the response decision model in the machine dialogue device is based on a pre-trained Q-value reinforcement learning network model, wherein the Q-value reinforcement learning network model is characterized by the following first loss function:
  • s is the dialogue intention
  • a is the response strategy
  • w is the network parameter of the Q value reinforcement learning network model
  • Q is the true value. Is the predicted value; adjusting the value of the network parameter w of the Q-value reinforcement learning network model, so that when the first loss function reaches the minimum value, the Q-value reinforcement learning network model defined by the value of the network parameter w is determined to be Pre-trained Q value reinforcement learning network model.
  • the machine dialogue device further includes: a first processing submodule and a second confirmation submodule.
  • the first processing sub-module is configured to sequentially input candidate response strategies and the dialogue intention into the Q-value reinforcement learning network model, and obtain Q corresponding to each candidate response strategy output by the Q-value reinforcement learning network model. Value; the second confirmation sub-module is used to determine that the candidate response strategy with the largest Q value is the response strategy of the dialogue intention.
  • the preset intention recognition model in the machine dialogue device uses a pre-trained LSTM-CNN neural network model
  • the machine dialogue device further includes: a first acquisition submodule, a second processing submodule, and a A comparison sub-module and a first execution sub-module, wherein the first acquisition sub-module is used to acquire training samples marked with dialogue intention categories, and the training samples are language information marked with different dialogue intention categories; second processing The sub-module is used to input the training samples into the LSTM-CNN neural network model to obtain the reference category of the dialogue intention of the training samples; the first comparison sub-module is used to compare the differences in the training samples through the second loss function Whether the sample dialogue intention reference category is consistent with the dialogue intention category, wherein the second loss function is:
  • N is the number of training samples.
  • the corresponding label Yi is the final intent recognition result
  • the preset intent recognition model in the machine dialogue device adopts a regular matching algorithm, wherein the rule character string used by the regular matching algorithm includes at least a question feature string, and the machine dialogue device also It includes a first matching sub-module, which is used to perform a regular matching operation between the language information and the rule string.
  • the result is a match, it is determined that the dialogue intention is task-based, otherwise, it is determined that the dialogue intention is chat-type .
  • the response generation model in the machine dialogue device includes at least a pre-trained Seq2Seq model
  • the machine dialogue device further includes a second acquisition submodule and a third processing submodule, wherein the second acquisition submodule , Used to obtain training corpus, the training corpus includes an input sequence and an output sequence; a third processing sub-module, used to input the input sequence into the Seq2Seq model, adjust the parameters of the Seq2Seq model, and make the Seq2Seq model respond to the input The probability of outputting the output sequence is the greatest.
  • FIG. 6 is a block diagram of the basic structure of the computer device in this embodiment.
  • the computer device includes a processor, a non-volatile storage medium, a memory, and a network interface connected through a system bus.
  • the non-volatile storage medium of the computer device stores an operating system, a database, and computer-readable instructions.
  • the database may store control information sequences.
  • the processor can make the processor realize the above The machine conversation method described in any embodiment.
  • the processor of the computer equipment is used to provide calculation and control capabilities, and supports the operation of the entire computer equipment.
  • the computer readable instructions may be stored in the memory of the computer device, and when the computer readable instructions are executed by the processor, the processor can cause the processor to execute the machine dialogue method described in any of the foregoing embodiments.
  • the network interface of the computer device is used to connect and communicate with the terminal.
  • the processor is used to execute the specific content of the acquisition module 210, the recognition module 220, the calculation module 230, and the generation module 240 in FIG. 5, and the memory stores the program codes and various data required to execute the above modules.
  • the network interface is used for data transmission between user terminals or servers.
  • the memory in this embodiment stores the program codes and data required to execute all the sub-modules in the machine dialogue method, and the server can call the program codes and data of the server to execute the functions of all the sub-modules.
  • the computer device obtains the language information input by the current user; inputs the language information into a preset intention recognition model, and obtains the dialogue intention output by the intention recognition model in response to the language information; and inputs the dialogue intention into
  • the response strategy output by the response decision model in response to the dialogue intention is obtained, wherein the response decision model is used to select the dialogue intention from a plurality of preset candidate response strategies Corresponding response strategy; input the language information to a response generation model that has a mapping relationship with the response strategy, and obtain response information input by the response generation model in response to the language information.
  • the response generation model is determined, and the reinforcement learning network model is introduced in the process of determining the response generation model.
  • different response generation models are used to generate different types of responses, so that the dialogue is diversified and more interesting.
  • the present invention also provides a storage medium storing computer-readable instructions.
  • the computer-readable instructions are executed by one or more processors, the one or more processors execute the machine conversation method described in any of the above embodiments. A step of.
  • the computer program can be stored in a computer readable storage medium. When executed, it may include the processes of the above-mentioned method embodiments.
  • the aforementioned storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disc, a read-only memory (Read-Only Memory, ROM), or a random access memory (Random Access Memory, RAM), etc.

Abstract

The embodiment of the present invention relates to the technical field of artificial intelligence. Disclosed are a machine dialogue method and apparatus, a computer device, and a storage medium. The method comprises the following steps: acquiring language information input by a current user; inputting the language information into a pre-set intention recognition model, and acquiring a dialogue intention output by the intention recognition model in response to the language information; inputting the dialogue intention into a pre-set response decision model, and acquiring a response strategy output by the response decision model in response to the dialogue intention; and inputting the language information into a response generation model having a mapping relationship with the response strategy, and acquiring response information input by the response generation model in response to the language information. Performing Intention recognition, determining a response generation model and generating responses of different types realize that the dialogue is diversified and more interesting.

Description

一种机器对话方法、装置、计算机设备及存储介质Machine dialogue method, device, computer equipment and storage medium
交叉引用cross reference
本申请以2019年3月1日提交的申请号为201910154323.9,名称为“一种机器对话方法、装置、计算机设备及存储介质”的中国发明专利申请为基础,并要求其优先权。This application is based on the Chinese invention patent application filed on March 1, 2019 with the application number 201910154323.9, titled "a machine dialogue method, device, computer equipment and storage medium", and claims its priority.
技术领域Technical field
本发明涉及人工智能技术领域,尤其涉及一种机器对话方法、装置、计算机设备及存储介质。The present invention relates to the field of artificial intelligence technology, in particular to a machine dialogue method, device, computer equipment and storage medium.
背景技术Background technique
随着人工智能技术的发展,聊天机器人也逐渐兴起。聊天机器人是一个用来模拟人类对话或聊天的程序,可以用于实用的目的,例如客户服务、咨询问答,也有一部分的社交机器人,用来与人们聊天。With the development of artificial intelligence technology, chatbots have gradually emerged. A chatbot is a program used to simulate human conversations or chats. It can be used for practical purposes, such as customer service, consultation and Q&A, and some social robots are used to chat with people.
有些聊天机器人会搭载自然语言处理系统,但更多的从输入语句中提取关键字,再从数据库中根据关键字检索答案。这些聊天机器人回答通常中规中矩,不带感情色彩,聊天模式千篇一律,导致人们与之聊天的兴趣不高,聊天机器人的利用率也较低。Some chatbots will be equipped with natural language processing systems, but more often extract keywords from input sentences, and then retrieve answers based on keywords from the database. The answers of these chat bots are usually pretty, non-emotional, and the chat mode is the same, causing people to be less interested in chatting with them, and the utilization rate of chat bots is also low.
发明内容Summary of the invention
本发明提供一种机器对话方法、装置、计算机设备及存储介质,以解决聊天机器人回答千篇一律的问题。The invention provides a machine dialogue method, device, computer equipment and storage medium to solve the same problem that a chat robot answers.
一种机器对话方法,包括如下步骤:A machine dialogue method includes the following steps:
获取当前用户输入的语言信息;Get the language information entered by the current user;
将所述语言信息输入到预设的意图识别模型中,获取所述意图识别模型响应所述语言信息而输出的对话意图;Inputting the language information into a preset intention recognition model, and obtaining a dialogue intention output by the intention recognition model in response to the language information;
将所述对话意图输入到预设的应答决策模型中,获取所述应答决策模型响应所述对话意图而输出的应答策略,其中,所述应答决策模型用于从预设的多个候选应答策略中选择与所述对话意图对应的应答策略;The dialogue intention is input into a preset response decision model, and the response strategy output by the response decision model in response to the dialogue intention is obtained, wherein the response decision model is used to obtain a response strategy from a plurality of preset candidate response strategies Select a response strategy corresponding to the dialogue intention in the dialog;
将所述语言信息输入到与所述应答策略具有映射关系的应答生成模型,获取所述应答生成模型响应所述语言信息而输入的应答信息。The language information is input into a response generation model having a mapping relationship with the response strategy, and the response information input by the response generation model in response to the language information is obtained.
一种机器对话装置,包括:A machine dialogue device, including:
获取模块,用于获取当前用户输入的语言信息;The acquisition module is used to acquire the language information input by the current user;
识别模块,将所述语言信息输入到预设的意图识别模型中,获取所述意图识别模型响应所述语言信息而输出的对话意图;A recognition module, which inputs the language information into a preset intention recognition model, and obtains a dialogue intention output by the intention recognition model in response to the language information;
计算模块,将所述对话意图输入到预设的应答决策模型中,获取所述应答决策模型响应所述对话意图而输出的应答策略,其中,所述应答决策模型用于从预设的多个候选应答策略中选择与所述对话意图对应的应答策略;The calculation module inputs the dialog intention into a preset response decision model, and obtains the response strategy output by the response decision model in response to the dialog intention, wherein the response decision model is used to obtain a response from a plurality of preset Selecting a response strategy corresponding to the dialogue intention among candidate response strategies;
生成模块,将所述语言信息输入到与所述应答策略具有映射关系的应答生成模型,获取所述应答生成模型响应所述语言信息而输入的应答信息。A generating module inputs the language information into a response generation model that has a mapping relationship with the response strategy, and obtains response information input by the response generation model in response to the language information.
一种计算机设备,包括存储器和处理器,所述存储器中存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行上述所述机器对话方法的步骤。A computer device, comprising a memory and a processor, the memory stores computer readable instructions, and when the computer readable instructions are executed by the processor, the processor executes the steps of the machine dialogue method described above .
一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机可读指令,所述计算机可读指令被处理器执行时,使得所述处理器执行上述所述机器对话方法的步骤。A computer-readable storage medium having computer-readable instructions stored thereon, and when the computer-readable instructions are executed by a processor, the processor executes the steps of the machine dialogue method described above.
本发明实施例的有益效果为:通过获取当前用户输入的语言信息;将所述语言信息输入到预设的意图识别模型中,获取所述意图识别模型响应所述语言信息而输出的对话意图;将所述对话意图输入到预设的应答决策模型中,获取所述应答决策模型响应所述对话意图而输出的应答策略,其中,所述应答决策模型用于从预设的多个候选应答策略中选择与所述对话意图对应的应答策略;将所述语言信息输入到与所述应答策略具有映射关系的应答生成模型,获取所述应答生成模型响应所述语言信息而输入的应答信息。通过对输入语句的意图识别,确定应答生成模型,且在确定应答生成模型过程中引入强化学习网络模型,意图不同,采用不同的应答生成模型,生成不同类型的应答,使对话多样化,更有趣味性。The beneficial effects of the embodiments of the present invention are: by acquiring the language information input by the current user; inputting the language information into a preset intention recognition model, and acquiring the dialogue intention output by the intention recognition model in response to the language information; The dialogue intention is input into a preset response decision model, and the response strategy output by the response decision model in response to the dialogue intention is obtained, wherein the response decision model is used to obtain a response strategy from a plurality of preset candidate response strategies Select the response strategy corresponding to the dialogue intention; input the language information into a response generation model that has a mapping relationship with the response strategy, and obtain the response information input by the response generation model in response to the language information. Through the identification of the intention of the input sentence, the response generation model is determined, and the reinforcement learning network model is introduced in the process of determining the response generation model. For different intentions, different response generation models are used to generate different types of responses, so that the dialogue is diversified and more Interesting.
附图说明Description of the drawings
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中 所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图In order to more clearly describe the technical solutions in the embodiments of the present invention, the following will briefly introduce the accompanying drawings used in the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those skilled in the art, without creative work, other drawings can be obtained based on these drawings.
图1为本发明实施例一种机器对话方法基本流程示意图;FIG. 1 is a schematic diagram of the basic flow of a machine dialogue method according to an embodiment of the present invention;
图2为本发明实施例采用Q值矩阵确定应答策略流程示意图;FIG. 2 is a schematic diagram of a process flow of determining a response strategy using a Q-value matrix in an embodiment of the present invention;
图3为本发明实施例采用Q值强化学习网络确定应答策略流程示意图;FIG. 3 is a schematic diagram of a process flow of determining a response strategy using a Q value reinforcement learning network according to an embodiment of the present invention;
图4为本发明实施例LSTM-CNN神经网络模型训练流程示意图;4 is a schematic diagram of the training process of an LSTM-CNN neural network model according to an embodiment of the present invention;
图5为本发明实施例一种机器对话装置基本结构框图;5 is a block diagram of the basic structure of a machine dialogue device according to an embodiment of the present invention;
图6为本发明实施例计算机设备基本结构框图。Fig. 6 is a block diagram of the basic structure of a computer device according to an embodiment of the present invention.
具体实施方式detailed description
为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述。In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be described clearly and completely in conjunction with the accompanying drawings in the embodiments of the present invention.
在本发明的说明书和权利要求书及上述附图中的描述的一些流程中,包含了按照特定顺序出现的多个操作,但是应该清楚了解,这些操作可以不按照其在本文中出现的顺序来执行或并行执行,操作的序号如101、102等,仅仅是用于区分开各个不同的操作,序号本身不代表任何的执行顺序。另外,这些流程可以包括更多或更少的操作,并且这些操作可以按顺序执行或并行执行。需要说明的是,本文中的“第一”、“第二”等描述,是用于区分不同的消息、设备、模块等,不代表先后顺序,也不限定“第一”和“第二”是不同的类型。In some processes described in the specification and claims of the present invention and the above-mentioned drawings, multiple operations appearing in a specific order are included, but it should be clearly understood that these operations may not be performed in the order in which they appear in this document. Execution or parallel execution, the sequence numbers of operations, such as 101, 102, etc., are only used to distinguish different operations, and the sequence numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel. It should be noted that the descriptions of "first" and "second" in this article are used to distinguish different messages, devices, modules, etc., and do not represent a sequence, nor do they limit the "first" and "second" Are different types.
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work shall fall within the protection scope of the present invention.
实施例Example
本技术领域技术人员可以理解,这里所使用的“终端”、“终端设备”既包括无线信号接收器的设备,其仅具备无发射能力的无线信号接收器的设备,又包括接收和发射硬件的设备,其具有能够在双向通信链路上,执行双向通信的接收和发射硬件的设备。这种设备可以包括:蜂窝或其他通信设备,其具有单线路显示器或多线路显示器或没有多线路显示器的蜂窝或其他通信设备; PCS(Personal Communications Service,个人通信系统),其可以组合语音、数据处理、传真和/或数据通信能力;PDA(Personal Digital Assistant,个人数字助理),其可以包括射频接收器、寻呼机、互联网/内联网访问、网络浏览器、记事本、日历和/或GPS(Global Positioning System,全球定位系统)接收器;常规膝上型和/或掌上型计算机或其他设备,其具有和/或包括射频接收器的常规膝上型和/或掌上型计算机或其他设备。这里所使用的“终端”、“终端设备”可以是便携式、可运输、安装在交通工具(航空、海运和/或陆地)中的,或者适合于和/或配置为在本地运行,和/或以分布形式,运行在地球和/或空间的任何其他位置运行。这里所使用的“终端”、“终端设备”还可以是通信终端、上网终端、音乐/视频播放终端,例如可以是PDA、MID(Mobile Internet Device,移动互联网设备)和/或具有音乐/视频播放功能的移动电话,也可以是智能电视、机顶盒等设备。Those skilled in the art can understand that the term "terminal" and "terminal equipment" used herein include both wireless signal receiver equipment, equipment that only has wireless signal receivers without transmitting capability, and equipment receiving and transmitting hardware. A device, which has a device capable of performing two-way communication receiving and transmitting hardware on a two-way communication link. Such equipment may include: cellular or other communication equipment, which has a single-line display or multi-line display or cellular or other communication equipment without a multi-line display; PCS (Personal Communications Service, personal communication system), which can combine voice and data Processing, fax and/or data communication capabilities; PDA (Personal Digital Assistant), which can include radio frequency receivers, pagers, Internet/Intranet access, web browsers, notebooks, calendars and/or GPS (Global Positioning System (Global Positioning System) receiver; a conventional laptop and/or palmtop computer or other device, which has and/or includes a radio frequency receiver, a conventional laptop and/or palmtop computer or other device. The "terminal" and "terminal equipment" used here may be portable, transportable, installed in vehicles (aviation, sea and/or land), or suitable and/or configured to operate locally, and/or In a distributed form, it runs on the earth and/or any other location in space. The "terminal" and "terminal device" used here can also be communication terminals, Internet terminals, music/video playback terminals, such as PDA, MID (Mobile Internet Device, mobile Internet device) and/or music/video playback Functional mobile phones can also be devices such as smart TVs and set-top boxes.
本实施方式中的终端即为上述的终端。The terminal in this embodiment is the aforementioned terminal.
具体地,请参阅图1,图1为本实施例一种机器对话方法的基本流程示意图。Specifically, please refer to FIG. 1, which is a schematic diagram of the basic flow of a machine dialogue method in this embodiment.
如图1所示,一种机器对话方法,包括下述步骤:As shown in Figure 1, a machine dialogue method includes the following steps:
S101、获取当前用户输入的语言信息;S101. Acquire language information input by the current user;
通过终端上可交互的页面获取用户输入的语言信息,接收到的信息可以是文本信息,也可以是语音信息,通过语音识别装置,将语音信息转化为文本信息。The language information input by the user is acquired through the interactive page on the terminal. The received information can be text information or voice information. The voice information is converted into text information through a voice recognition device.
S102、将所述语言信息输入到预设的意图识别模型中,获取所述意图识别模型响应所述语言信息而输出的对话意图;S102. Input the language information into a preset intention recognition model, and obtain a dialogue intention output by the intention recognition model in response to the language information;
将文本化的语言信息输入到预设的意图识别模型中,识别出用户的对话意图。对话意图的识别可以基于关键字,例如判断意图是任务型还是聊天型,任务型即对话意图为需要机器人解答问题,可以通过判断输入的语言信息中是否包含表示疑问的关键词,例如“?””什么”“多少”“哪里”“怎么”等表示疑问的语气词。也可以采用正则匹配的算法,判断输入的语言信息是否疑问句,正则表达式是对字符串操作的一种逻辑公式,用事先定义好的一些特定字符、及这些特定字符的组合,组成一个“规则字符串”,这个“规则字符串”用来表达对字符串的一种过滤逻辑。Input the textual language information into the preset intention recognition model to recognize the user's dialogue intention. The recognition of the dialogue intention can be based on keywords, for example, to determine whether the intent is task-based or chat-type. The task-type is the dialogue intention that requires robots to answer questions. It can be determined whether the input language information contains query keywords, such as "?" "What", "How much", "Where", "How" and other interrogative mood particles. You can also use a regular matching algorithm to determine whether the input language information is a question sentence. A regular expression is a logical formula for string manipulation. It uses predefined specific characters and combinations of these specific characters to form a "rule" String", this "rule string" is used to express a kind of filtering logic for string.
当输入的语言信息不是疑问句,则判断对话意图为聊天型。进一步地,可以细分对话意图,例如聊天型下可细分为积极型,包括肯定、称赞、感谢等情绪;消极型,包括吐槽、抱怨、指责等情绪。细分的对话意图可以通过预设的关键词列表判断,每一种对话意图,预设一个关键词列表,当提取的输入语言信息中的关键词与某种对话意图对应的关键词列表中的词一致时,认为输入语言信息对应该对话意图。When the input language information is not an interrogative sentence, it is judged that the dialogue intention is a chat type. Further, dialogue intentions can be subdivided. For example, the chat type can be subdivided into positive types, including emotions such as affirmation, praise, and thanks, and negative types, including emotions such as complaints, complaints, and accusations. The subdivided dialogue intentions can be judged by the preset keyword list. For each dialogue intention, a keyword list is preset. When the keywords in the extracted input language information are in the keyword list corresponding to a certain dialogue intention When the words match, it is considered that the input language information corresponds to the dialogue intention.
本发明实施例中通过预先训练的LSTM-CNN神经网络模型进行对话意图识别。具体地,对输入的内容,首先进行中文分词,采用基本分词库,依次进入去除停用词、标点符号等,通过词向量模型获得词嵌入向量,传入基于LSTM-CNN的神经网络模型。词嵌入向量进入多层LSTM神经单元,得到各个阶段的状态向量和输出;然后,基于各个阶段的状态向量,进行卷积操作和池化操作(CNN),得到综合向量指标;然后将综合向量指标输入softmax函数,得到对应的意图的概率。取概率最高的意图为输入语言信息对应的对话意图。具体地,LSTM-CNN神经网络模型的训练过程请参阅图4。In the embodiment of the present invention, the dialogue intention recognition is performed through the pre-trained LSTM-CNN neural network model. Specifically, for the input content, first perform Chinese word segmentation, use the basic word segmentation library, and sequentially enter to remove stop words, punctuation, etc., obtain the word embedding vector through the word vector model, and pass it to the neural network model based on LSTM-CNN. The word embedding vector enters the multi-layer LSTM neural unit to obtain the state vector and output of each stage; then, based on the state vector of each stage, perform convolution operation and pooling operation (CNN) to obtain the integrated vector index; then the integrated vector index Enter the softmax function to get the probability of the corresponding intention. The intention with the highest probability is the dialogue intention corresponding to the input language information. Specifically, please refer to Figure 4 for the training process of the LSTM-CNN neural network model.
S103、将所述对话意图输入到预设的应答决策模型中,获取所述应答决策模型响应所述对话意图而输出的应答策略,其中,所述应答决策模型用于从预设的多个候选应答策略中选择与所述对话意图对应的应答策略;S103. Input the dialog intention into a preset response decision model, and obtain a response strategy output by the response decision model in response to the dialog intention, wherein the response decision model is used to obtain a response from a plurality of preset candidates Select a response strategy corresponding to the dialogue intention in the response strategy;
经过步骤S102的处理,得到了输入语言信息的对话意图,将对话意图输入到应答决策模型中,确定针对输入语言信息的应答策略。为了使对话带有感情色彩,使对话更有趣,可以针对不同的对话意图预设不同的应答策略,例如,针对任务型意图,应答策略为问题解答型,针对消极型意图,应答策略为情绪排解型,针对积极型意图,应答策略为情绪同理型。不同的应答策略对应不同的应答生成模型。After the processing of step S102, the dialogue intention of the input language information is obtained, and the dialogue intention is input into the response decision model to determine the response strategy for the input language information. In order to make the dialogue more emotional and more interesting, different response strategies can be preset for different dialogue intentions, for example, for task-based intentions, the response strategy is question answering, and for negative intentions, the response strategy is emotional resolution. Type, for positive intentions, the response strategy is emotional empathy. Different response strategies correspond to different response generation models.
本发明实施例中,通过计算Q值来确定对话意图所应采取的应答策略。Q值用来衡量针对某种对话意图采取某种应答策略对整个聊天过程的价值,例如我们考察聊天的愉悦程度,愉悦程度可以用整个对话过程中消极意图语句占用户在本轮对话中输入语句数的比例来衡量,则Q值是针对某轮对话采取某种应答策略对聊天愉悦度的价值。In the embodiment of the present invention, the Q value is calculated to determine the response strategy to be adopted for the dialogue intention. The Q value is used to measure the value of a certain response strategy for a certain dialogue intention to the entire chat process. For example, we examine the degree of pleasure of the chat. The degree of pleasure can be accounted for by the negative intention sentences of the entire dialogue process as the user’s input in the current round of dialogue. Measured by the ratio of the number, the Q value is the value of a certain response strategy for a certain round of dialogue to chat pleasure.
可以通过经验值预设一个Q值矩阵,其中的元素为q(s,a),s∈S,a∈A其中S为对话意图空间,A为应答策略空间。A Q-value matrix can be preset through empirical values, the elements of which are q(s,a), s∈S, a∈A, where S is the dialogue intention space and A is the response strategy space.
q(1,1) … q(1,a)q(1,1)... q(1,a)
…    …    ………
q(s,1) … q(s,a)q(s,1)... q(s,a)
在一些实施方式中,Q值通过Q值强化学习网络模型计算得出。Q值强化学习网络模型输入为s,即对话意图,输出为Q(s,a)。即从状态s出发,采取a策略,能得到的预期收益。Q值强化学习网络模型的训练以第一损失函数收敛为训练目标,第一损失函数为In some embodiments, the Q value is calculated by a Q value reinforcement learning network model. The input of Q-value reinforcement learning network model is s, which is the dialogue intention, and the output is Q(s, a). That is, starting from state s and adopting strategy a, the expected benefits can be obtained. The training of the Q-value reinforcement learning network model takes the convergence of the first loss function as the training objective, and the first loss function is
Figure PCTCN2019103612-appb-000001
Figure PCTCN2019103612-appb-000001
其中,s为对话意图,a为应答策略,w为Q值强化学习网络模型的网络参数,Q为真实值,
Figure PCTCN2019103612-appb-000002
为预测值。当第一损失函数收敛时,w即为Q值强化学习网络模型训练好的网络参数。
Among them, s is the dialogue intention, a is the response strategy, w is the network parameter of the Q value reinforcement learning network model, and Q is the true value.
Figure PCTCN2019103612-appb-000002
Is the predicted value. When the first loss function converges, w is the network parameter trained by the Q-value reinforcement learning network model.
所述的应答决策模型即前述的Q值矩阵或Q值强化学习网络模型。The response decision model is the aforementioned Q-value matrix or Q-value reinforcement learning network model.
S104、将所述语言信息输入到与所述应答策略具有映射关系的应答生成模型,获取所述应答生成模型响应所述语言信息而输入的应答信息。S104. Input the language information to a response generation model that has a mapping relationship with the response strategy, and obtain response information input by the response generation model in response to the language information.
针对每种应答策略,预设对应的应答生成模型,例如,应答策略为问题解答型,对应的应答生成模型包含问答数据库,通过检索输入语言信息中的关键词,匹配相应的答案。对于应答策略为情绪排解型,对应的应答生成模型采用经过训练的Seq2Seq模型,具体的训练过程为准备训练语料,即准备输入序列和对应的输出序列,将输入序列输入到Seq2Seq模型,计算得到输出序列的概率,调整Seq2Seq模型的参数,使整个样本,即所有输入序列经过Seq2Seq输出对应输出序列的概率最高。这里准备的训练语料要求输入语句情感为消极型,输出语句情感为积极型。For each response strategy, a corresponding response generation model is preset. For example, the response strategy is a question answering type, and the corresponding response generation model includes a question and answer database, and matches the corresponding answer by searching for keywords in the input language information. For the response strategy of emotional resolution, the corresponding response generation model adopts the trained Seq2Seq model. The specific training process is to prepare the training corpus, that is, prepare the input sequence and the corresponding output sequence, input the input sequence into the Seq2Seq model, and calculate the output For the probability of the sequence, adjust the parameters of the Seq2Seq model so that the entire sample, that is, all input sequences, has the highest probability of outputting the corresponding output sequence after Seq2Seq. The training corpus prepared here requires the sentiment of the input sentence to be negative and the sentiment of the output sentence to be positive.
如图2所示,当采用预设的Q值矩阵来确定对话意图对应的应答策略时,步骤S103中还包括以下步骤:As shown in Fig. 2, when the preset Q value matrix is used to determine the response strategy corresponding to the dialogue intention, step S103 further includes the following steps:
S111、根据所述对话意图查询所述Q值矩阵;S111. Query the Q value matrix according to the dialogue intention;
查询Q值矩阵中,该对话意图对应的各候选应答策略的q值。Query the q value of each candidate response strategy corresponding to the dialogue intention in the Q value matrix.
S112、确定所述Q值矩阵中最大的q值对应的候选应答策略为所述对话意图的应答策略。S112: Determine that the candidate response strategy corresponding to the largest q value in the Q value matrix is the response strategy of the dialogue intention.
q值最大的候选应答策略即为该对话意图对应的应答策略。The candidate response strategy with the largest q value is the response strategy corresponding to the dialogue intention.
如图3所示,当采用预先训练的Q值强化学习网络模型来确定对话意图对应的应答策略时,步骤S103中还包括以下步骤:As shown in Fig. 3, when the pre-trained Q-value reinforcement learning network model is used to determine the response strategy corresponding to the dialogue intention, step S103 further includes the following steps:
S121、依次将候选应答策略和所述对话意图输入到所述Q值强化学习网络模型中,获取所述Q值强化学习网络模型输出的各候选应答策略对应的Q值;S121: Input the candidate response strategy and the dialogue intention into the Q-value reinforcement learning network model in turn, and obtain the Q value corresponding to each candidate response strategy output by the Q-value reinforcement learning network model;
计算各候选应答策略的Q值时,将该候选应答策略和对话意图输入到Q值强化学习网络模型,得到该对话意图采用该应答策略的Q值。When calculating the Q value of each candidate response strategy, the candidate response strategy and the dialogue intention are input into the Q value reinforcement learning network model to obtain the Q value of the dialogue intention using the response strategy.
S122、确定所述Q值最大的候选应答策略为所述对话意图的应答策略。S122: Determine that the candidate response strategy with the largest Q value is the response strategy of the dialogue intention.
确定Q值最大的候选应答策略为该对话意图应该采用的应答策略。It is determined that the candidate response strategy with the largest Q value is the response strategy that the dialogue intention should adopt.
如图4所示,本发明实施例中LSTM-CNN神经网络模型的训练包括以下步骤:As shown in Figure 4, the training of the LSTM-CNN neural network model in the embodiment of the present invention includes the following steps:
S131、获取标记有对话意图类别的训练样本,所述训练样本为标记有不同对话意图类别的语言信息;S131. Obtain training samples marked with dialogue intention categories, where the training samples are language information marked with different dialogue intention categories;
准备训练样本,训练样本标记有对话意图的类别。本发明实施例中的训练样本标记的类别为任务型和聊天型。任务型对应用户需求为解答问题,聊天型对应用和需求为闲聊。Prepare training samples. The training samples are labeled with the category of dialogue intent. In the embodiment of the present invention, the types of training sample marks are task type and chat type. The task type responds to user needs for answering questions, and the chat type responds to applications and needs for small talk.
S132、将所述训练样本输入LSTM-CNN神经网络模型获取所述训练样本的对话意图参照类别;S132: Input the training sample into the LSTM-CNN neural network model to obtain the dialogue intention reference category of the training sample;
将训练样本,首先进行中文分词,可以采用基本分词库,依次进入去除停用词、标点符号等、通过词向量模型获得词嵌入向量,输入到LSTM-CNN的神经网络模型,即词嵌入向量,进入多层LSTM神经单元,得到各个阶段的状态向量和输出;然后,基于各个阶段的状态向量,进行卷积操作和池化操作(CNN),得到综合向量指标;然后将综合向量指标进入softmax函数,得到对应的意图的概率。First perform Chinese word segmentation on the training samples. You can use the basic word segmentation database, and then enter to remove stop words, punctuation, etc., obtain the word embedding vector through the word vector model, and input it into the LSTM-CNN neural network model, that is, the word embedding vector , Enter the multi-layer LSTM neural unit, get the state vector and output of each stage; then, based on the state vector of each stage, perform convolution and pooling operations (CNN) to obtain the integrated vector index; then enter the integrated vector index into softmax Function to get the probability of the corresponding intention.
S133、通过第二损失函数比对所述训练样本内不同样本对话意图参照类别与所述对话意图类别是否一致,其中第二损失函数为:S133. Compare whether the dialogue intention reference category of different samples in the training sample is consistent with the dialogue intention category by a second loss function, where the second loss function is:
Figure PCTCN2019103612-appb-000003
Figure PCTCN2019103612-appb-000003
其中,N为训练样本数,针对第i个样本其对应的标记为Yi是最终的意图识别结果,h=(h1,h2,...,hc)为样本i的预测结果,其中C是所有分类的数量;Among them, N is the number of training samples. For the i-th sample, the corresponding label Yi is the final intent recognition result, h=(h1,h2,...,hc) is the prediction result of sample i, where C is all The number of categories;
本发明实施例中,LSTM-CNN的神经网络模型以第二损失函数收敛为训练目标,即通过调整神经网络模型中各节点的权重,使第二损失函数达到最 小值,当继续调整权重,损失函数的值不再减小,反而增大时,训练结束。In the embodiment of the present invention, the neural network model of LSTM-CNN takes the convergence of the second loss function as the training target, that is, by adjusting the weight of each node in the neural network model, the second loss function reaches the minimum value. When the weight is continuously adjusted, the loss When the value of the function no longer decreases, but instead increases, the training ends.
S134、当所述对话意图参照类别与所述对话意图类别不一致时,反复循环迭代的更新所述LSTM-CNN神经网络模型中的权重,至所述第二损失函数达到最小值时结束。S134: When the dialogue intention reference category is inconsistent with the dialogue intention category, iteratively update the weights in the LSTM-CNN neural network model repeatedly and iteratively until the second loss function reaches a minimum value.
通过第二损失函数是否收敛来衡量LSTM-CNN的神经网络模型预测的训练样本的对话意图与训练样本标记的对话意图类别是否一致,如果第二损失函数不收敛,通过梯度下降法,调整神经网络模型中各节点的权重,至神经网络预测的对话意图参照类别与训练样本标记的对话意图类别一致时结束。即继续调整权重,损失函数的值不再减小,反而增大时,训练结束。The second loss function is used to measure whether the conversation intention of the training sample predicted by the LSTM-CNN neural network model is consistent with the conversation intention category marked by the training sample. If the second loss function does not converge, adjust the neural network through the gradient descent method The weight of each node in the model ends when the reference type of dialogue intention predicted by the neural network is consistent with the type of dialogue intention marked by the training sample. That is to continue to adjust the weight, the value of the loss function no longer decreases, but increases instead, the training ends.
为解决上述技术问题本发明实施例还提供一种机器对话装置。具体请参阅图5,图5为本实施例机器对话装置的基本结构框图。To solve the above technical problems, the embodiment of the present invention also provides a machine dialogue device. Please refer to FIG. 5 for details. FIG. 5 is a block diagram of the basic structure of the machine dialogue device of this embodiment.
如图5所示,一种机器对话装置,包括:获取模块210、识别模块220、计算模块230和生成模块240。其中,获取模块210,用于获取当前用户输入的语言信息;识别模块220,将所述语言信息输入到预设的意图识别模型中,获取所述意图识别模型响应所述语言信息而输出的对话意图;计算模块230,将所述对话意图输入到预设的应答决策模型中,获取所述应答决策模型响应所述对话意图而输出的应答策略,其中,所述应答决策模型用于从预设的多个候选应答策略中选择与所述对话意图对应的应答策略;生成模块240,将所述语言信息输入到与所述应答策略具有映射关系的应答生成模型,获取所述应答生成模型响应所述语言信息而输入的应答信息。As shown in FIG. 5, a machine dialogue device includes: an acquisition module 210, an identification module 220, a calculation module 230, and a generation module 240. Wherein, the obtaining module 210 is used to obtain the language information input by the current user; the recognition module 220 is used to input the language information into a preset intention recognition model, and obtain the dialogue output by the intention recognition model in response to the language information. Intention; calculation module 230, input the dialogue intent into a preset response decision model, and obtain the response strategy output by the response decision model in response to the dialogue intention, wherein the response decision model is used from the preset The response strategy corresponding to the dialogue intention is selected among the multiple candidate response strategies; the generation module 240 inputs the language information into the response generation model that has a mapping relationship with the response strategy, and obtains the response information of the response generation model The response information entered while describing the language information.
本发明实施例通过获取当前用户输入的语言信息;将所述语言信息输入到预设的意图识别模型中,获取所述意图识别模型响应所述语言信息而输出的对话意图;将所述对话意图输入到预设的应答决策模型中,获取所述应答决策模型响应所述对话意图而输出的应答策略,其中,所述应答决策模型用于从预设的多个候选应答策略中选择与所述对话意图对应的应答策略;将所述语言信息输入到与所述应答策略具有映射关系的应答生成模型,获取所述应答生成模型响应所述语言信息而输入的应答信息。通过对输入语句的意图识别,确定应答生成模型,且在确定应答生成模型过程中引入强化学习网络模型,意图不同,采用不同的应答生成模型,生成不同类型的应答,使对话多样化,更有趣味性。The embodiment of the present invention obtains the language information input by the current user; inputs the language information into a preset intention recognition model, and obtains the dialogue intention output by the intention recognition model in response to the language information; Input into a preset response decision model to obtain the response strategy output by the response decision model in response to the dialogue intention, wherein the response decision model is used to select from a plurality of preset candidate response strategies and A response strategy corresponding to the dialogue intention; the language information is input to a response generation model that has a mapping relationship with the response strategy, and the response information input by the response generation model in response to the language information is obtained. Through the identification of the intention of the input sentence, the response generation model is determined, and the reinforcement learning network model is introduced in the process of determining the response generation model. For different intentions, different response generation models are used to generate different types of responses, so that the dialogue is diversified and more Interesting.
在一些实施方式中,所述机器对话装置中的应答决策模型基于预设的Q值矩阵,其中,所述Q值矩阵中的元素q用于评价各候选应答策略对于各对话意图的价值,所述机器对话装置中还包括:第一查询子模块和第一确认子模块,其中,第一查询子模块,用于根据所述对话意图查询所述Q值矩阵;第一确认子模块,用于确定所述Q值矩阵中最大的q值对应的候选应答策略为所述对话意图的应答策略。In some embodiments, the response decision model in the machine dialogue device is based on a preset Q-value matrix, wherein the element q in the Q-value matrix is used to evaluate the value of each candidate response strategy for each dialogue intention. The machine dialogue device further includes: a first query submodule and a first confirmation submodule, wherein the first query submodule is used for querying the Q-value matrix according to the dialogue intention; the first confirmation submodule is used for It is determined that the candidate response strategy corresponding to the largest q value in the Q value matrix is the response strategy of the dialogue intention.
在一些实施方式中,所述机器对话装置中的应答决策模型基于预先训练的Q值强化学习网络模型,其中,所述Q值强化学习网络模型以下述第一损失函数为特征:In some implementations, the response decision model in the machine dialogue device is based on a pre-trained Q-value reinforcement learning network model, wherein the Q-value reinforcement learning network model is characterized by the following first loss function:
Figure PCTCN2019103612-appb-000004
Figure PCTCN2019103612-appb-000004
其中,s为对话意图,a为应答策略,w为Q值强化学习网络模型的网络参数,Q为真实值,
Figure PCTCN2019103612-appb-000005
为预测值;调整所述Q值强化学习网络模型的网络参数w的值,使所述第一损失函数达到最小值时,确定由所述网络参数w的值定义的Q值强化学习网络模型为预先训练的Q值强化学习网络模型。
Among them, s is the dialogue intention, a is the response strategy, w is the network parameter of the Q value reinforcement learning network model, and Q is the true value.
Figure PCTCN2019103612-appb-000005
Is the predicted value; adjusting the value of the network parameter w of the Q-value reinforcement learning network model, so that when the first loss function reaches the minimum value, the Q-value reinforcement learning network model defined by the value of the network parameter w is determined to be Pre-trained Q value reinforcement learning network model.
在一些实施方式中,所述机器对话装置还包括:第一处理子模块、第二确认子模块。其中,第一处理子模块,用于依次将候选应答策略和所述对话意图输入到所述Q值强化学习网络模型中,获取所述Q值强化学习网络模型输出的各候选应答策略对应的Q值;第二确认子模块,用于确定所述Q值最大的候选应答策略为所述对话意图的应答策略。In some embodiments, the machine dialogue device further includes: a first processing submodule and a second confirmation submodule. Wherein, the first processing sub-module is configured to sequentially input candidate response strategies and the dialogue intention into the Q-value reinforcement learning network model, and obtain Q corresponding to each candidate response strategy output by the Q-value reinforcement learning network model. Value; the second confirmation sub-module is used to determine that the candidate response strategy with the largest Q value is the response strategy of the dialogue intention.
在一些实施方式中,所述机器对话装置中预设的意图识别模型采用预先训练的LSTM-CNN神经网络模型,所述机器对话装置还包括:第一获取子模块、第二处理子模块、第一比对子模块和第一执行子模块,其中,第一获取子模块,用于获取标记有对话意图类别的训练样本,所述训练样本为标记有不同对话意图类别的语言信息;第二处理子模块,用于将所述训练样本输入LSTM-CNN神经网络模型获取所述训练样本的对话意图参照类别;第一比对子模块,用于通过第二损失函数比对所述训练样本内不同样本对话意图参照类别与所述对话意图类别是否一致,其中第二损失函数为:In some embodiments, the preset intention recognition model in the machine dialogue device uses a pre-trained LSTM-CNN neural network model, and the machine dialogue device further includes: a first acquisition submodule, a second processing submodule, and a A comparison sub-module and a first execution sub-module, wherein the first acquisition sub-module is used to acquire training samples marked with dialogue intention categories, and the training samples are language information marked with different dialogue intention categories; second processing The sub-module is used to input the training samples into the LSTM-CNN neural network model to obtain the reference category of the dialogue intention of the training samples; the first comparison sub-module is used to compare the differences in the training samples through the second loss function Whether the sample dialogue intention reference category is consistent with the dialogue intention category, wherein the second loss function is:
Figure PCTCN2019103612-appb-000006
Figure PCTCN2019103612-appb-000006
其中,N为训练样本数,针对第i个样本其对应的标记为Yi是最终的意 图识别结果,h=(h1,h2,...,hc)为样本i的预测结果,其中C是所有分类的数量;第一执行子模块,用于当所述对话意图参照类别与所述对话意图类别不一致时,反复循环迭代的更新所述LSTM-CNN神经网络模型中的权重,至所述第二损失函数达到最小值时结束。Among them, N is the number of training samples. For the i-th sample, the corresponding label Yi is the final intent recognition result, h=(h1,h2,...,hc) is the prediction result of sample i, where C is all The number of categories; the first execution sub-module is used to repeatedly update the weights in the LSTM-CNN neural network model when the dialogue intention reference category is inconsistent with the dialogue intention category to the second It ends when the loss function reaches its minimum value.
在一些实施方式中,所述机器对话装置中所述预设的意图识别模型采用正则匹配算法,其中,所述正则匹配算法使用的规则字符串至少包含疑问特征字符串,所述机器对话装置还包括第一匹配子模块,用于将所述语言信息与所述规则字符串进行正则匹配运算,当结果为匹配时,确定所述对话意图为任务型,否则,确定所述对话意图为聊天型。In some embodiments, the preset intent recognition model in the machine dialogue device adopts a regular matching algorithm, wherein the rule character string used by the regular matching algorithm includes at least a question feature string, and the machine dialogue device also It includes a first matching sub-module, which is used to perform a regular matching operation between the language information and the rule string. When the result is a match, it is determined that the dialogue intention is task-based, otherwise, it is determined that the dialogue intention is chat-type .
在一些实施方式中,所述机器对话装置中的应答生成模型至少包含预先训练的Seq2Seq模型,所述机器对话装置还包括第二获取子模块和第三处理子模块,其中,第二获取子模块,用于获取训练语料,所述训练语料包含输入序列和输出序列;第三处理子模块,用于将所述输入序列输入到Seq2Seq模型中,调整Seq2Seq模型的参数,使Seq2Seq模型响应所述输入序列而输出所述输出序列的概率最大。In some embodiments, the response generation model in the machine dialogue device includes at least a pre-trained Seq2Seq model, and the machine dialogue device further includes a second acquisition submodule and a third processing submodule, wherein the second acquisition submodule , Used to obtain training corpus, the training corpus includes an input sequence and an output sequence; a third processing sub-module, used to input the input sequence into the Seq2Seq model, adjust the parameters of the Seq2Seq model, and make the Seq2Seq model respond to the input The probability of outputting the output sequence is the greatest.
为解决上述技术问题,本发明实施例还提供计算机设备。具体请参阅图6,图6为本实施例计算机设备基本结构框图。To solve the above technical problems, the embodiments of the present invention also provide computer equipment. Please refer to FIG. 6 for details. FIG. 6 is a block diagram of the basic structure of the computer device in this embodiment.
如图6所示,计算机设备的内部结构示意图。如图6所示,该计算机设备包括通过系统总线连接的处理器、非易失性存储介质、存储器和网络接口。其中,该计算机设备的非易失性存储介质存储有操作系统、数据库和计算机可读指令,数据库中可存储有控件信息序列,该计算机可读指令被处理器执行时,可使得处理器实现上述任意实施例中所述的机器对话方法。该计算机设备的处理器用于提供计算和控制能力,支撑整个计算机设备的运行。该计算机设备的存储器中可存储有计算机可读指令,该计算机可读指令被处理器执行时,可使得处理器执行上述任意实施例中所述的机器对话方法。该计算机设备的网络接口用于与终端连接通信。本领域技术人员可以理解,图6中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。As shown in Figure 6, a schematic diagram of the internal structure of the computer equipment. As shown in Figure 6, the computer device includes a processor, a non-volatile storage medium, a memory, and a network interface connected through a system bus. Wherein, the non-volatile storage medium of the computer device stores an operating system, a database, and computer-readable instructions. The database may store control information sequences. When the computer-readable instructions are executed by the processor, the processor can make the processor realize the above The machine conversation method described in any embodiment. The processor of the computer equipment is used to provide calculation and control capabilities, and supports the operation of the entire computer equipment. The computer readable instructions may be stored in the memory of the computer device, and when the computer readable instructions are executed by the processor, the processor can cause the processor to execute the machine dialogue method described in any of the foregoing embodiments. The network interface of the computer device is used to connect and communicate with the terminal. Those skilled in the art can understand that the structure shown in FIG. 6 is only a block diagram of part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may Including more or fewer parts than shown in the figure, or combining some parts, or having a different arrangement of parts.
本实施方式中处理器用于执行图5中获取模块210、识别模块220、计算 模块230和生成模块240的具体内容,存储器存储有执行上述模块所需的程序代码和各类数据。网络接口用于向用户终端或服务器之间的数据传输。本实施方式中的存储器存储有机器对话方法中执行所有子模块所需的程序代码及数据,服务器能够调用服务器的程序代码及数据执行所有子模块的功能。In this embodiment, the processor is used to execute the specific content of the acquisition module 210, the recognition module 220, the calculation module 230, and the generation module 240 in FIG. 5, and the memory stores the program codes and various data required to execute the above modules. The network interface is used for data transmission between user terminals or servers. The memory in this embodiment stores the program codes and data required to execute all the sub-modules in the machine dialogue method, and the server can call the program codes and data of the server to execute the functions of all the sub-modules.
计算机设备通过获取当前用户输入的语言信息;将所述语言信息输入到预设的意图识别模型中,获取所述意图识别模型响应所述语言信息而输出的对话意图;将所述对话意图输入到预设的应答决策模型中,获取所述应答决策模型响应所述对话意图而输出的应答策略,其中,所述应答决策模型用于从预设的多个候选应答策略中选择与所述对话意图对应的应答策略;将所述语言信息输入到与所述应答策略具有映射关系的应答生成模型,获取所述应答生成模型响应所述语言信息而输入的应答信息。通过对输入语句的意图识别,确定应答生成模型,且在确定应答生成模型过程中引入强化学习网络模型,意图不同,采用不同的应答生成模型,生成不同类型的应答,使对话多样化,更有趣味性。The computer device obtains the language information input by the current user; inputs the language information into a preset intention recognition model, and obtains the dialogue intention output by the intention recognition model in response to the language information; and inputs the dialogue intention into In the preset response decision model, the response strategy output by the response decision model in response to the dialogue intention is obtained, wherein the response decision model is used to select the dialogue intention from a plurality of preset candidate response strategies Corresponding response strategy; input the language information to a response generation model that has a mapping relationship with the response strategy, and obtain response information input by the response generation model in response to the language information. Through the identification of the intention of the input sentence, the response generation model is determined, and the reinforcement learning network model is introduced in the process of determining the response generation model. For different intentions, different response generation models are used to generate different types of responses, so that the dialogue is diversified and more Interesting.
本发明还提供一种存储有计算机可读指令的存储介质,所述计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行上述任一实施例所述机器对话方法的步骤。The present invention also provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the machine conversation method described in any of the above embodiments. A step of.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,该计算机程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,前述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)等非易失性存储介质,或随机存储记忆体(Random Access Memory,RAM)等。A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing relevant hardware through a computer program. The computer program can be stored in a computer readable storage medium. When executed, it may include the processes of the above-mentioned method embodiments. Among them, the aforementioned storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disc, a read-only memory (Read-Only Memory, ROM), or a random access memory (Random Access Memory, RAM), etc.
应该理解的是,虽然附图的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,其可以以其他的顺序执行。而且,附图的流程图中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,其执行顺序也不必然是依次进行,而是可以与其他步骤或者其他步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that, although the various steps in the flowchart of the drawings are shown in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless explicitly stated in this article, the execution of these steps is not strictly limited in order, and they can be executed in other orders. Moreover, at least part of the steps in the flowchart of the drawings may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the order of execution is also It is not necessarily performed sequentially, but may be performed alternately or alternately with other steps or at least a part of sub-steps or stages of other steps.
以上所述仅是本发明的部分实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The above are only part of the embodiments of the present invention. It should be pointed out that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and modifications can be made, and these improvements and modifications are also It should be regarded as the protection scope of the present invention.

Claims (20)

  1. 一种机器对话方法,其特征在于,包括下述步骤:A machine dialogue method, characterized in that it comprises the following steps:
    获取当前用户输入的语言信息;Get the language information entered by the current user;
    将所述语言信息输入到预设的意图识别模型中,获取所述意图识别模型响应所述语言信息而输出的对话意图;Inputting the language information into a preset intention recognition model, and obtaining a dialogue intention output by the intention recognition model in response to the language information;
    将所述对话意图输入到预设的应答决策模型中,获取所述应答决策模型响应所述对话意图而输出的应答策略,其中,所述应答决策模型用于从预设的多个候选应答策略中选择与所述对话意图对应的应答策略;The dialogue intention is input into a preset response decision model, and the response strategy output by the response decision model in response to the dialogue intention is obtained, wherein the response decision model is used to obtain a response strategy from a plurality of preset candidate response strategies Select a response strategy corresponding to the dialogue intention in the dialog;
    将所述语言信息输入到与所述应答策略具有映射关系的应答生成模型,获取所述应答生成模型响应所述语言信息而输入的应答信息。The language information is input into a response generation model having a mapping relationship with the response strategy, and the response information input by the response generation model in response to the language information is obtained.
  2. 根据权利要求1所述的机器对话方法,其特征在于,所述应答决策模型基于预设的Q值矩阵,其中,所述Q值矩阵中的元素q用于评价各候选应答策略对于各对话意图的价值,在将所述对话意图输入到预设的应答决策模型中,获取所述应答决策模型响应所述对话意图而输出的应答策略的步骤中,具体包括下述步骤:The machine dialogue method according to claim 1, wherein the response decision model is based on a preset Q value matrix, wherein the element q in the Q value matrix is used to evaluate each candidate response strategy for each dialogue intention The value of inputting the dialogue intention into the preset response decision model and obtaining the response strategy output by the response decision model in response to the dialogue intention specifically includes the following steps:
    根据所述对话意图查询所述Q值矩阵;Query the Q-value matrix according to the dialogue intention;
    确定所述Q值矩阵中最大的q值对应的候选应答策略为所述对话意图的应答策略。It is determined that the candidate response strategy corresponding to the largest q value in the Q value matrix is the response strategy of the dialogue intention.
  3. 根据权利要求1所述的机器对话方法,其特征在于,所述应答决策模型基于预先训练的Q值强化学习网络模型,其中,所述Q值强化学习网络模型以下述第一损失函数为特征:The machine dialogue method according to claim 1, wherein the response decision model is based on a pre-trained Q-value reinforcement learning network model, wherein the Q-value reinforcement learning network model is characterized by the following first loss function:
    Figure PCTCN2019103612-appb-100001
    Figure PCTCN2019103612-appb-100001
    其中,s为对话意图,a为应答策略,w为Q值强化学习网络模型的网络参数,Q为真实值,
    Figure PCTCN2019103612-appb-100002
    为预测值;
    Among them, s is the dialogue intention, a is the response strategy, w is the network parameter of the Q value reinforcement learning network model, and Q is the true value.
    Figure PCTCN2019103612-appb-100002
    Is the predicted value;
    调整所述Q值强化学习网络模型的网络参数w的值,使所述第一损失函数达到最小值时,确定由所述网络参数w的值定义的Q值强化学习网络模型为预先训练的Q值强化学习网络模型。Adjust the value of the network parameter w of the Q-value reinforcement learning network model so that the first loss function reaches the minimum value, and determine that the Q-value reinforcement learning network model defined by the value of the network parameter w is the pre-trained Q Value reinforcement learning network model.
  4. 根据权利要求3所述的机器对话方法,其特征在于,在将所述对话意图输入到预设的应答决策模型中,获取所述应答决策模型响应所述对话意图而输出的应答策略的步骤中,具体包括下述步骤:The machine dialogue method according to claim 3, wherein, in the step of inputting the dialogue intention into a preset response decision model, and obtaining the response strategy output by the response decision model in response to the dialogue intention , Specifically including the following steps:
    依次将候选应答策略和所述对话意图输入到所述Q值强化学习网络模型中,获取所述Q值强化学习网络模型输出的各候选应答策略对应的Q值;Sequentially inputting the candidate response strategy and the dialogue intention into the Q value reinforcement learning network model, and obtaining the Q value corresponding to each candidate response strategy output by the Q value reinforcement learning network model;
    确定所述Q值最大的候选应答策略为所述对话意图的应答策略。It is determined that the candidate response strategy with the largest Q value is the response strategy of the dialogue intention.
  5. 根据权利要求1所述的机器对话方法,其特征在于,所述预设的意图识别模型采用预先训练的LSTM-CNN神经网络模型,其中,所述LSTM-CNN神经网络模型通过下述步骤进行训练:The machine dialogue method of claim 1, wherein the preset intention recognition model adopts a pre-trained LSTM-CNN neural network model, wherein the LSTM-CNN neural network model is trained through the following steps :
    获取标记有对话意图类别的训练样本,所述训练样本为标记有不同对话意图类别的语言信息;Acquiring training samples marked with dialogue intention categories, where the training samples are language information marked with different dialogue intention categories;
    将所述训练样本输入LSTM-CNN神经网络模型获取所述训练样本的对话意图参照类别;Inputting the training sample into the LSTM-CNN neural network model to obtain the dialogue intention reference category of the training sample;
    通过第二损失函数比对所述训练样本内不同样本对话意图参照类别与所述对话意图类别是否一致,其中第二损失函数为:The second loss function is used to compare whether the dialogue intention reference category of different samples in the training sample is consistent with the dialogue intention category, wherein the second loss function is:
    Figure PCTCN2019103612-appb-100003
    Figure PCTCN2019103612-appb-100003
    其中,N为训练样本数,针对第i个样本其对应的标记为Yi是最终的意图识别结果,h=(h1,h2,...,hc)为样本i的预测结果,其中C是所有分类的数量;Among them, N is the number of training samples. For the i-th sample, the corresponding label Yi is the final intent recognition result, h=(h1,h2,...,hc) is the prediction result of sample i, where C is all The number of categories;
    当所述对话意图参照类别与所述对话意图类别不一致时,反复循环迭代的更新所述LSTM-CNN神经网络模型中的权重,至所述第二损失函数达到最小值时结束。When the dialogue intention reference category is inconsistent with the dialogue intention category, the weights in the LSTM-CNN neural network model are updated repeatedly and iteratively until the second loss function reaches the minimum value.
  6. 根据权利要求1所述的机器对话方法,其特征在于,所述预设的意图识别模型采用正则匹配算法,其中,所述正则匹配算法使用的规则字符串至少包含疑问特征字符串,所述将所述语言信息输入到预设的意图识别模型中,获取所述意图识别模型响应所述语言信息而输出的对话意图的步骤中,包括下述步骤:The machine dialogue method according to claim 1, wherein the preset intent recognition model adopts a regular matching algorithm, wherein the rule string used by the regular matching algorithm contains at least a question feature string, and the The step of inputting the language information into a preset intention recognition model, and obtaining the dialogue intention output by the intention recognition model in response to the language information includes the following steps:
    将所述语言信息与所述规则字符串进行正则匹配运算,当结果为匹配时,确定所述对话意图为任务型,否则,确定所述对话意图为聊天型。Perform a regular matching operation between the language information and the rule character string, and when the result is a match, it is determined that the dialogue intention is a task type; otherwise, it is determined that the dialogue intention is a chat type.
  7. 根据权利要求1所述的机器对话方法,其特征在于,所述应答生成模型至少包含预先训练的Seq2Seq模型,其中,所述Seq2Seq模型通过下述步骤进行训练:The machine dialogue method of claim 1, wherein the response generation model includes at least a pre-trained Seq2Seq model, wherein the Seq2Seq model is trained through the following steps:
    获取训练语料,所述训练语料包含输入序列和输出序列;Acquiring a training corpus, the training corpus including an input sequence and an output sequence;
    将所述输入序列输入到Seq2Seq模型中,调整Seq2Seq模型的参数,使Seq2Seq模型响应所述输入序列而输出所述输出序列的概率最大。The input sequence is input into the Seq2Seq model, and the parameters of the Seq2Seq model are adjusted so that the Seq2Seq model has the greatest probability of outputting the output sequence in response to the input sequence.
  8. 一种机器对话装置,其特征在于,包括:A machine dialogue device, characterized by comprising:
    获取模块,用于获取当前用户输入的语言信息;The acquisition module is used to acquire the language information input by the current user;
    识别模块,将所述语言信息输入到预设的意图识别模型中,获取所述意图识别模型响应所述语言信息而输出的对话意图;A recognition module, which inputs the language information into a preset intention recognition model, and obtains a dialogue intention output by the intention recognition model in response to the language information;
    计算模块,将所述对话意图输入到预设的应答决策模型中,获取所述应答决策模型响应所述对话意图而输出的应答策略,其中,所述应答决策模型用于从预设的多个候选应答策略中选择与所述对话意图对应的应答策略;The calculation module inputs the dialog intention into a preset response decision model, and obtains the response strategy output by the response decision model in response to the dialog intention, wherein the response decision model is used to obtain a response from a plurality of preset Selecting a response strategy corresponding to the dialogue intention among candidate response strategies;
    生成模块,将所述语言信息输入到与所述应答策略具有映射关系的应答生成模型,获取所述应答生成模型响应所述语言信息而输入的应答信息。A generating module inputs the language information into a response generation model that has a mapping relationship with the response strategy, and obtains response information input by the response generation model in response to the language information.
  9. 根据权利要求8所述的机器对话装置,其特征在于,所述机器对话装置中的应答决策模型基于预设的Q值矩阵,其中,所述Q值矩阵中的元素q用于评价各候选应答策略对于各对话意图的价值,所述机器对话装置中还包括:The machine dialogue device according to claim 8, wherein the response decision model in the machine dialogue device is based on a preset Q value matrix, wherein the element q in the Q value matrix is used to evaluate each candidate response The value of the strategy to each dialogue intention, the machine dialogue device also includes:
    第一查询子模块,用于根据所述对话意图查询所述Q值矩阵;The first query sub-module is used to query the Q-value matrix according to the dialogue intention;
    第一确认子模块,用于确定所述Q值矩阵中最大的q值对应的候选应答策略为所述对话意图的应答策略。The first confirmation sub-module is used to determine that the candidate response strategy corresponding to the largest q value in the Q value matrix is the response strategy of the dialogue intention.
  10. 根据权利要求8所述的机器对话装置,其特征在于,所述机器对话装置中的应答决策模型基于预先训练的Q值强化学习网络模型,其中,所述Q值强化学习网络模型以下述第一损失函数为特征:The machine dialogue device according to claim 8, wherein the response decision model in the machine dialogue device is based on a pre-trained Q value reinforcement learning network model, wherein the Q value reinforcement learning network model is based on the following first The loss function is characterized by:
    Figure PCTCN2019103612-appb-100004
    Figure PCTCN2019103612-appb-100004
    其中,s为对话意图,a为应答策略,w为Q值强化学习网络模型的网络参数,Q为真实值,
    Figure PCTCN2019103612-appb-100005
    为预测值;
    Among them, s is the dialogue intention, a is the response strategy, w is the network parameter of the Q value reinforcement learning network model, and Q is the true value.
    Figure PCTCN2019103612-appb-100005
    Is the predicted value;
    调整所述Q值强化学习网络模型的网络参数w的值,使所述第一损失函数达到最小值时,确定由所述网络参数w的值定义的Q值强化学习网络模型为预先训练的Q值强化学习网络模型。Adjust the value of the network parameter w of the Q-value reinforcement learning network model so that the first loss function reaches the minimum value, and determine that the Q-value reinforcement learning network model defined by the value of the network parameter w is the pre-trained Q Value reinforcement learning network model.
  11. 一种计算机设备,其特征在于,包括存储器和处理器,所述存储器中存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行如下步骤:A computer device, characterized by comprising a memory and a processor, the memory storing computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor is caused to perform the following steps:
    获取当前用户输入的语言信息;Get the language information entered by the current user;
    将所述语言信息输入到预设的意图识别模型中,获取所述意图识别模型响应所述语言信息而输出的对话意图;Inputting the language information into a preset intention recognition model, and obtaining a dialogue intention output by the intention recognition model in response to the language information;
    将所述对话意图输入到预设的应答决策模型中,获取所述应答决策模型响应所述对话意图而输出的应答策略,其中,所述应答决策模型用于从预设的多个候选应答策略中选择与所述对话意图对应的应答策略;The dialogue intention is input into a preset response decision model, and the response strategy output by the response decision model in response to the dialogue intention is obtained, wherein the response decision model is used to obtain a response strategy from a plurality of preset candidate response strategies Select a response strategy corresponding to the dialogue intention in the dialog;
    将所述语言信息输入到与所述应答策略具有映射关系的应答生成模型,获取所述应答生成模型响应所述语言信息而输入的应答信息。The language information is input into a response generation model having a mapping relationship with the response strategy, and the response information input by the response generation model in response to the language information is obtained.
  12. 根据权利要求11所述的计算机设备,其特征在于,所述应答决策模型基于预设的Q值矩阵,其中,所述Q值矩阵中的元素q用于评价各候选应答策略对于各对话意图的价值,在将所述对话意图输入到预设的应答决策模型中,获取所述应答决策模型响应所述对话意图而输出的应答策略的步骤中,具体包括下述步骤:The computer device according to claim 11, wherein the response decision model is based on a preset Q value matrix, wherein the element q in the Q value matrix is used to evaluate the response of each candidate response strategy to each dialogue intention Value, in the step of inputting the dialogue intention into the preset response decision model, and obtaining the response strategy output by the response decision model in response to the dialogue intention, specifically includes the following steps:
    根据所述对话意图查询所述Q值矩阵;Query the Q-value matrix according to the dialogue intention;
    确定所述Q值矩阵中最大的q值对应的候选应答策略为所述对话意图的应答策略。It is determined that the candidate response strategy corresponding to the largest q value in the Q value matrix is the response strategy of the dialogue intention.
  13. 根据权利要求11所述的计算机设备,其特征在于,所述应答决策模型基于预先训练的Q值强化学习网络模型,其中,所述Q值强化学习网络模型以下述第一损失函数为特征:The computer device according to claim 11, wherein the response decision model is based on a pre-trained Q-value reinforcement learning network model, wherein the Q-value reinforcement learning network model is characterized by the following first loss function:
    Figure PCTCN2019103612-appb-100006
    Figure PCTCN2019103612-appb-100006
    其中,s为对话意图,a为应答策略,w为Q值强化学习网络模型的网络参数,Q为真实值,
    Figure PCTCN2019103612-appb-100007
    为预测值;
    Among them, s is the dialogue intention, a is the response strategy, w is the network parameter of the Q value reinforcement learning network model, and Q is the true value.
    Figure PCTCN2019103612-appb-100007
    Is the predicted value;
    调整所述Q值强化学习网络模型的网络参数w的值,使所述第一损失函数达到最小值时,确定由所述网络参数w的值定义的Q值强化学习网络模型为预先训练的Q值强化学习网络模型。Adjust the value of the network parameter w of the Q-value reinforcement learning network model so that the first loss function reaches the minimum value, and determine that the Q-value reinforcement learning network model defined by the value of the network parameter w is the pre-trained Q Value reinforcement learning network model.
  14. 根据权利要求13所述的计算机设备,其特征在于,在将所述对话意图输入到预设的应答决策模型中,获取所述应答决策模型响应所述对话意图而输出的应答策略的步骤中,具体包括下述步骤:The computer device according to claim 13, wherein in the step of inputting the dialogue intention into a preset response decision model, and obtaining the response strategy output by the response decision model in response to the dialogue intention, Specifically include the following steps:
    依次将候选应答策略和所述对话意图输入到所述Q值强化学习网络模型中,获取所述Q值强化学习网络模型输出的各候选应答策略对应的Q值;Sequentially inputting the candidate response strategy and the dialogue intention into the Q value reinforcement learning network model, and obtaining the Q value corresponding to each candidate response strategy output by the Q value reinforcement learning network model;
    确定所述Q值最大的候选应答策略为所述对话意图的应答策略。It is determined that the candidate response strategy with the largest Q value is the response strategy of the dialogue intention.
  15. 根据权利要求11所述的计算机设备,其特征在于,所述预设的意图 识别模型采用预先训练的LSTM-CNN神经网络模型,其中,所述LSTM-CNN神经网络模型通过下述步骤进行训练:The computer device according to claim 11, wherein the preset intention recognition model adopts a pre-trained LSTM-CNN neural network model, wherein the LSTM-CNN neural network model is trained through the following steps:
    获取标记有对话意图类别的训练样本,所述训练样本为标记有不同对话意图类别的语言信息;Acquiring training samples marked with dialogue intention categories, where the training samples are language information marked with different dialogue intention categories;
    将所述训练样本输入LSTM-CNN神经网络模型获取所述训练样本的对话意图参照类别;Inputting the training sample into the LSTM-CNN neural network model to obtain the dialogue intention reference category of the training sample;
    通过第二损失函数比对所述训练样本内不同样本对话意图参照类别与所述对话意图类别是否一致,其中第二损失函数为:The second loss function is used to compare whether the dialogue intention reference category of different samples in the training sample is consistent with the dialogue intention category, wherein the second loss function is:
    Figure PCTCN2019103612-appb-100008
    Figure PCTCN2019103612-appb-100008
    其中,N为训练样本数,针对第i个样本其对应的标记为Yi是最终的意图识别结果,h=(h1,h2,...,hc)为样本i的预测结果,其中C是所有分类的数量;Among them, N is the number of training samples. For the i-th sample, the corresponding label Yi is the final intent recognition result, h=(h1,h2,...,hc) is the prediction result of sample i, where C is all The number of categories;
    当所述对话意图参照类别与所述对话意图类别不一致时,反复循环迭代的更新所述LSTM-CNN神经网络模型中的权重,至所述第二损失函数达到最小值时结束。When the dialogue intention reference category is inconsistent with the dialogue intention category, the weights in the LSTM-CNN neural network model are updated repeatedly and iteratively until the second loss function reaches the minimum value.
  16. 一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机可读指令,所述计算机可读指令被处理器执行时实现如下的步骤:A computer-readable storage medium having computer-readable instructions stored thereon, and when the computer-readable instructions are executed by a processor, the following steps are implemented:
    获取当前用户输入的语言信息;Get the language information entered by the current user;
    将所述语言信息输入到预设的意图识别模型中,获取所述意图识别模型响应所述语言信息而输出的对话意图;Inputting the language information into a preset intention recognition model, and obtaining a dialogue intention output by the intention recognition model in response to the language information;
    将所述对话意图输入到预设的应答决策模型中,获取所述应答决策模型响应所述对话意图而输出的应答策略,其中,所述应答决策模型用于从预设的多个候选应答策略中选择与所述对话意图对应的应答策略;The dialogue intention is input into a preset response decision model, and the response strategy output by the response decision model in response to the dialogue intention is obtained, wherein the response decision model is used to obtain a response strategy from a plurality of preset candidate response strategies Select a response strategy corresponding to the dialogue intention in the dialog;
    将所述语言信息输入到与所述应答策略具有映射关系的应答生成模型,获取所述应答生成模型响应所述语言信息而输入的应答信息。The language information is input into a response generation model having a mapping relationship with the response strategy, and the response information input by the response generation model in response to the language information is obtained.
  17. 根据权利要求16所述的计算机设备,其特征在于,所述应答决策模型基于预设的Q值矩阵,其中,所述Q值矩阵中的元素q用于评价各候选应答策略对于各对话意图的价值,在将所述对话意图输入到预设的应答决策模型中,获取所述应答决策模型响应所述对话意图而输出的应答策略的步骤中,具体包括下述步骤:The computer device according to claim 16, wherein the response decision model is based on a preset Q value matrix, wherein the element q in the Q value matrix is used to evaluate the response of each candidate response strategy to each dialogue intention Value, in the step of inputting the dialogue intention into the preset response decision model, and obtaining the response strategy output by the response decision model in response to the dialogue intention, specifically includes the following steps:
    根据所述对话意图查询所述Q值矩阵;Query the Q-value matrix according to the dialogue intention;
    确定所述Q值矩阵中最大的q值对应的候选应答策略为所述对话意图的应答策略。It is determined that the candidate response strategy corresponding to the largest q value in the Q value matrix is the response strategy of the dialogue intention.
  18. 根据权利要求16所述的计算机设备,其特征在于,所述应答决策模型基于预先训练的Q值强化学习网络模型,其中,所述Q值强化学习网络模型以下述第一损失函数为特征:The computer device according to claim 16, wherein the response decision model is based on a pre-trained Q-value reinforcement learning network model, wherein the Q-value reinforcement learning network model is characterized by the following first loss function:
    Figure PCTCN2019103612-appb-100009
    Figure PCTCN2019103612-appb-100009
    其中,s为对话意图,a为应答策略,w为Q值强化学习网络模型的网络参数,Q为真实值,
    Figure PCTCN2019103612-appb-100010
    为预测值;
    Among them, s is the dialogue intention, a is the response strategy, w is the network parameter of the Q value reinforcement learning network model, and Q is the true value.
    Figure PCTCN2019103612-appb-100010
    Is the predicted value;
    调整所述Q值强化学习网络模型的网络参数w的值,使所述第一损失函数达到最小值时,确定由所述网络参数w的值定义的Q值强化学习网络模型为预先训练的Q值强化学习网络模型。Adjust the value of the network parameter w of the Q-value reinforcement learning network model so that the first loss function reaches the minimum value, and determine that the Q-value reinforcement learning network model defined by the value of the network parameter w is the pre-trained Q Value reinforcement learning network model.
  19. 根据权利要求18所述的计算机设备,其特征在于,在将所述对话意图输入到预设的应答决策模型中,获取所述应答决策模型响应所述对话意图而输出的应答策略的步骤中,具体包括下述步骤:18. The computer device according to claim 18, wherein in the step of inputting the dialogue intention into a preset response decision model, and obtaining the response strategy output by the response decision model in response to the dialogue intention, Specifically include the following steps:
    依次将候选应答策略和所述对话意图输入到所述Q值强化学习网络模型中,获取所述Q值强化学习网络模型输出的各候选应答策略对应的Q值;Sequentially inputting the candidate response strategy and the dialogue intention into the Q value reinforcement learning network model, and obtaining the Q value corresponding to each candidate response strategy output by the Q value reinforcement learning network model;
    确定所述Q值最大的候选应答策略为所述对话意图的应答策略。It is determined that the candidate response strategy with the largest Q value is the response strategy of the dialogue intention.
  20. 根据权利要求16所述的计算机设备,其特征在于,所述预设的意图识别模型采用预先训练的LSTM-CNN神经网络模型,其中,所述LSTM-CNN神经网络模型通过下述步骤进行训练:The computer device according to claim 16, wherein the preset intention recognition model adopts a pre-trained LSTM-CNN neural network model, wherein the LSTM-CNN neural network model is trained through the following steps:
    获取标记有对话意图类别的训练样本,所述训练样本为标记有不同对话意图类别的语言信息;Acquiring training samples marked with dialogue intention categories, where the training samples are language information marked with different dialogue intention categories;
    将所述训练样本输入LSTM-CNN神经网络模型获取所述训练样本的对话意图参照类别;Inputting the training sample into the LSTM-CNN neural network model to obtain the dialogue intention reference category of the training sample;
    通过第二损失函数比对所述训练样本内不同样本对话意图参照类别与所述对话意图类别是否一致,其中第二损失函数为:The second loss function is used to compare whether the dialogue intention reference category of different samples in the training sample is consistent with the dialogue intention category, wherein the second loss function is:
    Figure PCTCN2019103612-appb-100011
    Figure PCTCN2019103612-appb-100011
    其中,N为训练样本数,针对第i个样本其对应的标记为Yi是最终的意图识别结果,h=(h1,h2,...,hc)为样本i的预测结果,其中C是所有分类的数量;Among them, N is the number of training samples. For the i-th sample, the corresponding label Yi is the final intent recognition result, h=(h1,h2,...,hc) is the prediction result of sample i, where C is all The number of categories;
    当所述对话意图参照类别与所述对话意图类别不一致时,反复循环迭代的更新所述LSTM-CNN神经网络模型中的权重,至所述第二损失函数达到最小值时结束。When the dialogue intention reference category is inconsistent with the dialogue intention category, the weights in the LSTM-CNN neural network model are updated repeatedly and iteratively until the second loss function reaches the minimum value.
PCT/CN2019/103612 2019-03-01 2019-08-30 Machine dialogue method and apparatus, computer device, and storage medium WO2020177282A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910154323.9 2019-03-01
CN201910154323.9A CN110046221B (en) 2019-03-01 2019-03-01 Machine dialogue method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2020177282A1 true WO2020177282A1 (en) 2020-09-10

Family

ID=67274468

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/103612 WO2020177282A1 (en) 2019-03-01 2019-08-30 Machine dialogue method and apparatus, computer device, and storage medium

Country Status (2)

Country Link
CN (1) CN110046221B (en)
WO (1) WO2020177282A1 (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112085594A (en) * 2020-09-14 2020-12-15 深圳前海微众银行股份有限公司 Identity verification method, equipment and readable storage medium
CN112131362A (en) * 2020-09-22 2020-12-25 腾讯科技(深圳)有限公司 Dialog statement generation method and device, storage medium and electronic equipment
CN112380875A (en) * 2020-11-18 2021-02-19 杭州大搜车汽车服务有限公司 Conversation label tracking method, device, electronic device and storage medium
CN112528679A (en) * 2020-12-17 2021-03-19 科大讯飞股份有限公司 Intention understanding model training method and device and intention understanding method and device
CN112559714A (en) * 2020-12-24 2021-03-26 北京百度网讯科技有限公司 Dialog generation method and device, electronic equipment and storage medium
CN113641806A (en) * 2021-07-28 2021-11-12 北京百度网讯科技有限公司 Dialogue method, dialogue system, electronic device and storage medium
CN114490985A (en) * 2022-01-25 2022-05-13 北京百度网讯科技有限公司 Dialog generation method and device, electronic equipment and storage medium
EP4020326A1 (en) * 2020-12-25 2022-06-29 Beijing Baidu Netcom Science and Technology Co., Ltd Method and apparatus of training model, device, storage medium, and program product
CN116501852A (en) * 2023-06-29 2023-07-28 之江实验室 Controllable dialogue model training method and device, storage medium and electronic equipment

Families Citing this family (30)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110046221B (en) * 2019-03-01 2023-12-22 平安科技(深圳)有限公司 Machine dialogue method, device, computer equipment and storage medium
CN110414005B (en) * 2019-07-31 2023-10-10 达闼机器人股份有限公司 Intention recognition method, electronic device and storage medium
CN110472035A (en) * 2019-08-26 2019-11-19 杭州城市大数据运营有限公司 A kind of intelligent response method, apparatus, computer equipment and storage medium
CN110717022A (en) * 2019-09-18 2020-01-21 平安科技(深圳)有限公司 Robot dialogue generation method and device, readable storage medium and robot
CN111739506B (en) * 2019-11-21 2023-08-04 北京汇钧科技有限公司 Response method, terminal and storage medium
CN110928997A (en) * 2019-12-04 2020-03-27 北京文思海辉金信软件有限公司 Intention recognition method and device, electronic equipment and readable storage medium
CN111209380B (en) * 2019-12-31 2023-07-28 深圳追一科技有限公司 Control method and device for conversation robot, computer equipment and storage medium
CN113132214B (en) * 2019-12-31 2023-07-18 深圳市优必选科技股份有限公司 Dialogue method, dialogue device, dialogue server and dialogue storage medium
CN111341309A (en) * 2020-02-18 2020-06-26 百度在线网络技术(北京)有限公司 Voice interaction method, device, equipment and computer storage medium
CN111400450B (en) * 2020-03-16 2023-02-03 腾讯科技(深圳)有限公司 Man-machine conversation method, device, equipment and computer readable storage medium
CN111538820A (en) * 2020-04-10 2020-08-14 出门问问信息科技有限公司 Exception reply processing device and computer readable storage medium
CN111681653A (en) * 2020-04-28 2020-09-18 平安科技(深圳)有限公司 Call control method, device, computer equipment and storage medium
CN111611365A (en) * 2020-05-19 2020-09-01 上海鸿翼软件技术股份有限公司 Flow control method, device, equipment and storage medium of dialog system
CN111611350B (en) * 2020-05-26 2024-04-09 北京妙医佳健康科技集团有限公司 Response method and device based on health knowledge and electronic equipment
CN111666396B (en) * 2020-06-05 2023-10-31 北京百度网讯科技有限公司 User intention understanding satisfaction evaluation method, device, equipment and storage medium
CN111881254A (en) * 2020-06-10 2020-11-03 百度在线网络技术(北京)有限公司 Method and device for generating dialogs, electronic equipment and storage medium
CN111797215A (en) * 2020-06-24 2020-10-20 北京小米松果电子有限公司 Dialogue method, dialogue device and storage medium
CN111651582B (en) * 2020-06-24 2023-06-23 支付宝(杭州)信息技术有限公司 Method and system for simulating user speaking
CN112347788A (en) * 2020-11-06 2021-02-09 平安消费金融有限公司 Corpus processing method, apparatus and storage medium
CN112559700A (en) * 2020-11-09 2021-03-26 联想(北京)有限公司 Response processing method, intelligent device and storage medium
CN112733649B (en) * 2020-12-30 2023-06-20 平安科技(深圳)有限公司 Method and related equipment for identifying user intention based on video image
CN112765959A (en) * 2020-12-31 2021-05-07 康佳集团股份有限公司 Intention recognition method, device, equipment and computer readable storage medium
CN112328776A (en) * 2021-01-04 2021-02-05 北京百度网讯科技有限公司 Dialog generation method and device, electronic equipment and storage medium
CN112836028A (en) * 2021-01-13 2021-05-25 国家电网有限公司客户服务中心 Multi-turn dialogue method and system based on machine learning
CN112800204A (en) * 2021-02-24 2021-05-14 浪潮云信息技术股份公司 Construction method of intelligent dialogue system
CN113220856A (en) * 2021-05-28 2021-08-06 天津大学 Multi-round dialogue system based on Chinese pre-training model
CN113360618B (en) * 2021-06-07 2022-03-11 暨南大学 Intelligent robot dialogue method and system based on offline reinforcement learning
CN113282755A (en) * 2021-06-11 2021-08-20 上海寻梦信息技术有限公司 Dialogue type text classification method, system, equipment and storage medium
CN113806503A (en) * 2021-08-25 2021-12-17 北京库睿科技有限公司 Dialog fusion method, device and equipment
CN116521850B (en) * 2023-07-04 2023-12-01 北京红棉小冰科技有限公司 Interaction method and device based on reinforcement learning

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106777081A (en) * 2016-12-13 2017-05-31 竹间智能科技(上海)有限公司 Method and device for determining conversational system acknowledgment strategy
CN106934452A (en) * 2017-01-19 2017-07-07 深圳前海勇艺达机器人有限公司 Robot dialogue method and system
CN107146610A (en) * 2017-04-10 2017-09-08 北京猎户星空科技有限公司 A kind of determination method and device of user view
CN107665708A (en) * 2016-07-29 2018-02-06 科大讯飞股份有限公司 Intelligent sound exchange method and system
CN110046221A (en) * 2019-03-01 2019-07-23 平安科技(深圳)有限公司 A kind of machine dialogue method, device, computer equipment and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150179170A1 (en) * 2013-12-20 2015-06-25 Microsoft Corporation Discriminative Policy Training for Dialog Systems
CN108363690A (en) * 2018-02-08 2018-08-03 北京十三科技有限公司 Dialog semantics Intention Anticipation method based on neural network and learning training method
CN108962238B (en) * 2018-04-25 2020-08-07 苏州思必驰信息科技有限公司 Dialogue method, system, equipment and storage medium based on structured neural network
CN109063164A (en) * 2018-08-15 2018-12-21 百卓网络科技有限公司 A kind of intelligent answer method based on deep learning

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107665708A (en) * 2016-07-29 2018-02-06 科大讯飞股份有限公司 Intelligent sound exchange method and system
CN106777081A (en) * 2016-12-13 2017-05-31 竹间智能科技(上海)有限公司 Method and device for determining conversational system acknowledgment strategy
CN106934452A (en) * 2017-01-19 2017-07-07 深圳前海勇艺达机器人有限公司 Robot dialogue method and system
CN107146610A (en) * 2017-04-10 2017-09-08 北京猎户星空科技有限公司 A kind of determination method and device of user view
CN110046221A (en) * 2019-03-01 2019-07-23 平安科技(深圳)有限公司 A kind of machine dialogue method, device, computer equipment and storage medium

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112085594A (en) * 2020-09-14 2020-12-15 深圳前海微众银行股份有限公司 Identity verification method, equipment and readable storage medium
CN112131362A (en) * 2020-09-22 2020-12-25 腾讯科技(深圳)有限公司 Dialog statement generation method and device, storage medium and electronic equipment
CN112131362B (en) * 2020-09-22 2023-12-12 腾讯科技(深圳)有限公司 Dialogue sentence generation method and device, storage medium and electronic equipment
CN112380875A (en) * 2020-11-18 2021-02-19 杭州大搜车汽车服务有限公司 Conversation label tracking method, device, electronic device and storage medium
CN112528679A (en) * 2020-12-17 2021-03-19 科大讯飞股份有限公司 Intention understanding model training method and device and intention understanding method and device
CN112528679B (en) * 2020-12-17 2024-02-13 科大讯飞股份有限公司 Method and device for training intention understanding model, and method and device for intention understanding
CN112559714A (en) * 2020-12-24 2021-03-26 北京百度网讯科技有限公司 Dialog generation method and device, electronic equipment and storage medium
CN112559714B (en) * 2020-12-24 2024-04-12 北京百度网讯科技有限公司 Dialogue generation method and device, electronic equipment and storage medium
EP4020326A1 (en) * 2020-12-25 2022-06-29 Beijing Baidu Netcom Science and Technology Co., Ltd Method and apparatus of training model, device, storage medium, and program product
CN113641806B (en) * 2021-07-28 2023-06-23 北京百度网讯科技有限公司 Dialogue method, dialogue system, electronic equipment and storage medium
CN113641806A (en) * 2021-07-28 2021-11-12 北京百度网讯科技有限公司 Dialogue method, dialogue system, electronic device and storage medium
CN114490985B (en) * 2022-01-25 2023-01-31 北京百度网讯科技有限公司 Dialogue generation method and device, electronic equipment and storage medium
CN114490985A (en) * 2022-01-25 2022-05-13 北京百度网讯科技有限公司 Dialog generation method and device, electronic equipment and storage medium
CN116501852A (en) * 2023-06-29 2023-07-28 之江实验室 Controllable dialogue model training method and device, storage medium and electronic equipment
CN116501852B (en) * 2023-06-29 2023-09-01 之江实验室 Controllable dialogue model training method and device, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN110046221A (en) 2019-07-23
CN110046221B (en) 2023-12-22

Similar Documents

Publication Publication Date Title
WO2020177282A1 (en) Machine dialogue method and apparatus, computer device, and storage medium
CN107846350B (en) Method, computer readable medium and system for context-aware network chat
US20240112008A1 (en) Active Federated Learning for Assistant Systems
WO2020147428A1 (en) Interactive content generation method and apparatus, computer device, and storage medium
US11657371B2 (en) Machine-learning-based application for improving digital content delivery
WO2020155619A1 (en) Method and apparatus for chatting with machine with sentiment, computer device and storage medium
US20210019599A1 (en) Adaptive neural architecture search
WO2018033030A1 (en) Natural language library generation method and device
WO2022022421A1 (en) Language representation model system, pre-training method and apparatus, device and medium
EP3547155A1 (en) Entity representation learning for improving digital content recommendations
CN111428010B (en) Man-machine intelligent question-answering method and device
CN111144124B (en) Training method of machine learning model, intention recognition method, and related device and equipment
WO2022252636A1 (en) Artificial intelligence-based answer generation method and apparatus, device, and storage medium
CN109766418B (en) Method and apparatus for outputting information
US11270082B2 (en) Hybrid natural language understanding
WO2019226375A1 (en) Personalized query formulation for improving searches
CN112417158A (en) Training method, classification method, device and equipment of text data classification model
CN112101042A (en) Text emotion recognition method and device, terminal device and storage medium
KR20190075277A (en) Method for searching content and electronic device thereof
WO2021063089A1 (en) Rule matching method, rule matching apparatus, storage medium and electronic device
CN110727871A (en) Multi-mode data acquisition and comprehensive analysis platform based on convolution decomposition depth model
CN112989843B (en) Intention recognition method, device, computing equipment and storage medium
CN113420136A (en) Dialogue method, system, electronic equipment, storage medium and program product
CN112307738A (en) Method and device for processing text
CN114676227B (en) Sample generation method, model training method and retrieval method

Legal Events

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

Ref document number: 19918097

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19918097

Country of ref document: EP

Kind code of ref document: A1