CN115309877B - Dialogue generation method, dialogue model training method and device - Google Patents

Dialogue generation method, dialogue model training method and device Download PDF

Info

Publication number
CN115309877B
CN115309877B CN202210929482.3A CN202210929482A CN115309877B CN 115309877 B CN115309877 B CN 115309877B CN 202210929482 A CN202210929482 A CN 202210929482A CN 115309877 B CN115309877 B CN 115309877B
Authority
CN
China
Prior art keywords
target
dialogue
vector representation
word
role
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210929482.3A
Other languages
Chinese (zh)
Other versions
CN115309877A (en
Inventor
徐新超
吴文权
牛正雨
吴华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202210929482.3A priority Critical patent/CN115309877B/en
Publication of CN115309877A publication Critical patent/CN115309877A/en
Application granted granted Critical
Publication of CN115309877B publication Critical patent/CN115309877B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/3347Query execution using vector based model
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning

Abstract

The application discloses a dialogue generation method, a dialogue model training method and a dialogue model training device, relates to the technical field of computers, and particularly relates to the field of artificial intelligence such as natural language processing, deep learning and the like. The specific implementation scheme is as follows: acquiring a history dialogue and a target dialogue between a user and a target robot, wherein the target dialogue is generated based on role information of the target robot; inputting the target dialogue and the history dialogue into a dialogue model to acquire reply sentences of the history dialogue output by the dialogue model; the reply sentence is a sentence matched with the role information of the target robot. Aiming at different robot role information, the method can obtain reply sentences which are output by the dialogue model and matched with the role information of the target robot by taking the target dialogue generated based on the role information of the robot as the input of the dialogue model, thereby obtaining robots with different set role information and reducing the cost.

Description

Dialogue generation method, dialogue model training method and device
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to the field of artificial intelligence such as natural language processing and deep learning, and in particular, to a method for generating a dialogue, and a method and apparatus for training a dialogue model.
Background
The dialogue robot, or dialogue system, uses Machine Learning (ML) and artificial intelligence (Artificial Intelligence, AI) to make the robot understand the language of the robot, so as to simulate the communication between people. In practical application, chat requirements of users in different application scenes may be different, and conversation robots with different roles need to be applied to different scenes.
Therefore, how to reduce the cost of acquiring conversational robots of different roles is a challenge.
Disclosure of Invention
The application provides a dialogue generation method, a dialogue model training method and a dialogue model training device. The specific scheme is as follows:
according to an aspect of the present application, there is provided a dialog generation method, including:
acquiring a history dialogue and a target dialogue between a user and a target robot, wherein the target dialogue is generated based on role information of the target robot;
inputting the target dialogue and the history dialogue into a dialogue model to acquire reply sentences of the history dialogue output by the dialogue model; the reply sentence is a sentence matched with the role information of the target robot.
According to another aspect of the present application, there is provided a dialog model training method, including:
Acquiring a training sample, wherein the training sample comprises role information of a robot, role information of a user, a historical dialogue between the user and the robot and a first reply sentence;
inputting the training sample into the initial dialogue model to obtain a second reply sentence of the history dialogue output by the initial dialogue model;
and adjusting parameters of the initial dialogue model according to the difference between the second reply sentence and the first reply sentence so as to obtain the dialogue model.
According to another aspect of the present application, there is provided a dialog generating apparatus including:
the first acquisition module is used for acquiring a history dialogue and a target dialogue between a user and the target robot, wherein the target dialogue is generated based on role information of the target robot;
the second acquisition module is used for inputting the target dialogue and the history dialogue into the dialogue model so as to acquire reply sentences of the history dialogue output by the dialogue model; the reply sentence is a sentence matched with the role information of the target robot.
According to another aspect of the present application, there is provided a dialog model training device, including:
the first acquisition module is used for acquiring a training sample, wherein the training sample comprises role information of the robot, role information of a user, a history dialogue between the user and the robot and a first reply sentence;
The second acquisition module is used for inputting the training sample into the initial dialogue model so as to acquire a second reply sentence of the history dialogue output by the initial dialogue model;
and the adjusting module is used for adjusting parameters of the initial dialogue model according to the difference between the second reply sentence and the first reply sentence so as to obtain the dialogue model.
According to another aspect of the present application, there is provided an electronic device including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of the above embodiments.
According to another aspect of the present application, there is provided a non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method according to the above-described embodiments.
According to another aspect of the present application, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the steps of the method described in the above embodiments.
It should be understood that the description of this section is not intended to identify key or critical features of the embodiments of the application or to delineate the scope of the application. Other features of the present application will become apparent from the description that follows.
Drawings
The drawings are for better understanding of the present solution and do not constitute a limitation of the present application. Wherein:
FIG. 1 is a flow chart of a dialog generating method according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a dialog generation process according to an embodiment of the present application;
FIG. 3 is a flow chart of a dialog generating method according to another embodiment of the present application;
FIG. 4 is a flow chart of a dialog generating method according to another embodiment of the present application;
FIG. 5 is a flow chart of a method for training a dialogue model according to an embodiment of the present application;
FIG. 6 is a flowchart of a method for training a dialogue model according to another embodiment of the present disclosure;
FIG. 7 is a schematic diagram of training phase dialog model input provided in an embodiment of the present application;
fig. 8 is a schematic structural diagram of a dialogue generating device according to an embodiment of the present application;
FIG. 9 is a schematic structural diagram of a dialogue model training device according to an embodiment of the present disclosure;
Fig. 10 is a block diagram of an electronic device for implementing a dialog generation method of an embodiment of the present application.
Detailed Description
Exemplary embodiments of the present application are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present application to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Artificial intelligence is the discipline of studying certain mental processes and intelligent behaviors (e.g., learning, reasoning, thinking, planning, etc.) of a person using a computer, both in the technical field of hardware and in the technical field of software. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing, and the like; the artificial intelligence software technology comprises a computer vision technology, a voice recognition technology, a natural language processing technology, a deep learning technology, a big data processing technology, a knowledge graph technology and the like.
NLP (Natural Language Processing ) is an important direction in the fields of computer science and artificial intelligence, and the content of NLP research includes, but is not limited to, the following branch fields: text classification, information extraction, automatic abstracting, intelligent question and answer, topic recommendation, machine translation, topic word recognition, knowledge base construction, deep text representation, named entity recognition, text generation, text analysis (lexical, syntactic, grammatical, etc.), speech recognition and synthesis, and the like.
Deep learning is a new research direction in the field of machine learning. Deep learning is the inherent regularity and presentation hierarchy of learning sample data, and the information obtained during such learning is helpful in interpreting data such as text, images and sounds. Its final goal is to have the machine have analytical learning capabilities like a person, and to recognize text, image, and sound data.
The following describes a dialogue generating method, a dialogue model training method and a device according to the embodiments of the present application with reference to the accompanying drawings.
Fig. 1 is a flow chart of a dialog generating method according to an embodiment of the present application.
The dialogue generating method of the embodiment of the application can be executed by the dialogue generating device of the embodiment of the application, and the device can be configured in the electronic equipment to obtain robots with different roles according to different role information.
The electronic device may be any device with computing capability, for example, may be a personal computer, a mobile terminal, a server, etc., and the mobile terminal may be, for example, a vehicle-mounted device, a mobile phone, a tablet computer, a personal digital assistant, a wearable device, etc., which have various operating systems, touch screens, and/or display screens.
The robot described in the present application may refer to a conversation robot, or a device having a conversation function, or the like.
As shown in fig. 1, the dialog generation method includes:
step 101, acquiring a history dialogue and a target dialogue between a user and a target robot, wherein the target dialogue is generated based on role information of the target robot.
The history dialogue can be a history dialogue between a user and a target robot in a certain round of dialogue; the character information of the target robot may include, but is not limited to, information of a name, sex, age, constellation, education level, interest tag, etc. of the target robot.
In the present application, the target session may be a session related to the role information of the target machine, and the target session may be preconfigured or may be pre-generated based on the role information of the target robot.
For example, a role information of a target robot is named a, the age is 10 years, and the target dialogue may be "U: what name you call; s, I call A; u is provided; you are very young; s: i year 10 la ", where U represents the user and S represents the robot.
Step 102, inputting the target dialogue and the history dialogue into the dialogue model to obtain the reply sentence of the history dialogue output by the dialogue model.
In the present application, the session model may be trained in advance based on training samples including character information of the robot, character information of the user, a history session between the user and the robot, and the like. The training of the dialogue model can be performed by adopting the role information of various robots, the role information of various users and the like, so that the role information of the dialogue participants is added during the training of the dialogue model, and the learning of the dialogue model on the role information is enhanced.
In the application, the target robot may be configured with the dialogue model, or the target robot uses the dialogue model to generate a reply sentence.
In practical application, the role information of the people is different, so that the reply content during chat can be different, and the effect is also expected to be achieved for the robot, thereby improving the intelligentization of chat. Thus, in the present application, after the history dialogue and the target dialogue between the user and the target robot are acquired, the target dialogue and the history dialogue may be input together into the dialogue model, so that the dialogue model is used to encode and decode the target dialogue and the history dialogue, so as to acquire a reply sentence of the history dialogue output by the dialogue model.
For ease of understanding, fig. 2 is a schematic diagram of a session generation process according to an embodiment of the present application.
As shown in fig. 2, the set robot character information is "name: AA; gender: girl; age: 11", the robot is configured with the above dialogue model, and the target dialogue obtained based on the role information is as shown in fig. 2, where U represents the user, S represents the robot, and the target dialogue and the history dialogue can be input into the dialogue model, so as to obtain a reply sentence" you can call me AA ".
In the method, each time when a reply sentence is generated, the target dialogue and the current history dialogue are input into the dialogue model to acquire the reply sentence output by the dialogue model, so that the reply sentence is matched with the role information of the target robot, and the accuracy of the reply sentence is improved.
In practical application, different conversational robots with different roles are required to be applied in different scenes, in the related technology, a large number of conversational samples are collected mainly based on preset robot role information, a conversational model corresponding to the role information of the robot is obtained through training based on the collected conversational samples, and obviously, for the role information of different robots, corresponding conversational models are required to be obtained through training so as to obtain robots with different roles, and the cost is high.
In the application, the history dialogue and the target dialogue generated based on the role information of the robot can be input into the dialogue model together for the role information of different robots, and the reply sentences matched with the role information of the robots are acquired, so that the robots with set role information can be obtained, and the cost is low.
In the embodiment of the application, the target dialogue generated based on the role information of the target robot and the history dialogue between the user and the target robot are input into the dialogue model together, so that the reply sentence matched with the role information of the target robot is acquired. Therefore, aiming at different robot role information, the target dialogue generated based on the robot role information can be used as the input of the dialogue model to obtain the reply sentence which is output by the dialogue model and matched with the target robot role information, so that robots with different set role information can be obtained, and the cost is reduced.
Fig. 3 is a flow chart of a dialog generating method according to another embodiment of the present application.
As shown in fig. 3, the target session may be generated by the following steps before the target session is acquired:
step 301, acquiring role information of a target robot.
The role information of the target robot may be input by a user on a display interface of the target robot, or may be preconfigured.
Step 302, determining a target role attribute corresponding to the target robot and an attribute value of the target role attribute according to the role information of the target robot.
Character attributes may include name, gender, age, constellation, interest tags, etc., among others.
In the application, the character information of the target robot can be subjected to natural language processing, and the character attribute and the attribute value of the character attribute of the target robot are extracted from each word obtained by the natural language processing, namely, the target character attribute and the attribute value of the target character attribute are determined. The target character attribute may be one or more, and this application is not limited thereto.
For example, the role information of a certain robot is "female, the age is 20 years old", and it can be determined that the target role attribute of the robot includes gender and age, the attribute value corresponding to the gender is female, the attribute value corresponding to the age is 20 years old, that is, the target role attribute of the robot and the attribute value thereof are "gender: a female; age: age 20).
Step 303, generating a target dialogue according to the target character attribute and the attribute value.
When generating the target dialog, as a possible implementation manner, a correspondence relationship between the character attribute and the question-answer sentence may be preset, where each pair of question-answer sentences in the correspondence relationship is a set of dialogs for describing the corresponding character attribute. For example, a pair of question-answer sentences corresponding to the gender attribute may be "question: what your gender is; answering: i are personal [ 'gender' ] woolen. As another example, a pair of question-answer sentences corresponding to an age attribute may be "question: what your age is; answering: i have [ 'age' ] in this year.
When the target dialogue is generated, the corresponding relation between the preset character attribute and the question and answer can be obtained, the corresponding relation is queried according to the target character attribute, when the target character attribute is matched with any character attribute in the corresponding relation, the question and answer sentence corresponding to the character attribute can be used as the target question and answer sentence corresponding to the target character attribute, then the corresponding slot of the answer sentence in the target question and answer sentence can be filled by utilizing the attribute value of the target character attribute, and the target dialogue can be generated.
For example, if the name of the robot is set to AA, the question-answer sentence corresponding to the name is "question: what your name is called; answering: i call [ 'name' ] ", AA can be filled in the name slot of the answer sentence in the question-answer sentence corresponding to the name, so that a dialogue" question "about the name of the robot can be obtained: what your name is called; answering: i call AA).
Therefore, the target question-answer sentence corresponding to the target character attribute is obtained based on the corresponding relation between the preset character attribute and the question-answer sentence, and the target dialogue is generated based on the target question-answer sentence and the attribute value, so that the method is simple and convenient.
If the target character attributes are multiple, that is, the target question-answer sentences are multiple pairs, the attribute value of each target character attribute can be filled in the corresponding slot positions in the answer sentences in the corresponding question-answer sentences to obtain a group of dialogs corresponding to each character attribute, and then the group of dialogs corresponding to each character attribute are spliced to obtain the target dialogs. Or, the target question-answer sentence is spliced to obtain a spliced question-answer sentence, and then the attribute value corresponding to each pair of question-answer sentences is filled into the corresponding slot of the answer sentence in the spliced question-answer sentence, so that the target dialogue is obtained.
Therefore, when the target question-answer sentences are multiple pairs, the target dialogue can be obtained through splicing, so that the target dialogue contains attribute values of a plurality of role attributes of the target robot, and the diversified requirements of users can be met.
As another possible implementation manner of generating the target dialogue, in the present application, the target role attribute may be matched with a sentence in a preset sentence library, so as to determine a query sentence and a statement sentence matched with the target role attribute from the sentence library, and then, the attribute value of the target role attribute is substituted for the attribute value in the statement sentence, and the query sentence is combined to generate the target dialogue.
For example, the target character attribute and its attribute value are "gender: female ", query what the query statement matches the gender is" you are, and statement "i am a boy", then "boy" in the statement may be replaced with "girl" to get the target dialogue "U: what you gender is; s: i are girls.
It can be appreciated that when the target character attribute is plural, a group of dialogs corresponding to each target character attribute can be obtained in this way, and then the dialogs corresponding to all the target character attributes are spliced to obtain the target dialogs.
Therefore, the target dialogue can be generated according to the query statement, the statement and the attribute value by matching the target role attribute with the statements in the statement library to determine the query statement and the statement matched with the target role attribute, and the method is simple and convenient.
According to the method and the device, the target role attribute and the attribute value corresponding to the target robot can be determined according to the role information of the target robot by acquiring the role information of the target robot, and the target dialogue is generated according to the target role attribute and the attribute value, so that automatic generation of the target dialogue is realized, and efficiency is improved.
Fig. 4 is a flow chart of a dialog generating method according to another embodiment of the present application.
As shown in fig. 4, the dialog generation method includes:
step 401, acquiring a history dialogue and a target dialogue between a user and a target robot.
In this application, step 401 is similar to the description in the above embodiment, so that the description is omitted here.
Step 402, splicing the target dialogue before the history dialogue, and obtaining the target dialogue and the dialogue after the history dialogue is spliced.
In the application, the target dialogue can be regarded as a prompt of the history dialogue, and the target dialogue can be spliced before the history dialogue, so that the target dialogue and the dialogue after the history dialogue are spliced are obtained.
The target session and the history session as shown in fig. 2 may be described as "S" of the target session in fig. 2: i are girl 'after splice' U: hello ", the dialog after splicing can be obtained as" U: what your name is called; s: i call AA; u: how old you are; s: i last 11 years; u: what you gender is; s: i are girls; u: you are like; s: very happy to know you; u: i call B, you woolen.
Step 403, inputting the spliced dialogue into the dialogue model to obtain the reply sentence of the history dialogue.
In the application, the spliced conversation can be input into the conversation model, so that the conversation model is utilized to encode and decode the target conversation and the history conversation, and the reply sentence of the history conversation output by the conversation model is obtained.
According to the method and the device, the target dialogue is spliced before the history dialogue, the target dialogue and the dialogue after the history dialogue are spliced are obtained, the spliced dialogue is input into the dialogue model, so that a reply sentence is obtained, and therefore the target dialogue is input into the dialogue model as a part of the history dialogue of a user and the target robot, accuracy of the reply sentence can be improved, and the robot with the corresponding role can be customized based on different robot role information.
Fig. 5 is a flow chart of a dialogue model training method according to an embodiment of the present application.
As shown in fig. 5, the dialog model training includes:
step 501, a training sample is obtained.
In the present application, dialogue information may be collected from social media in a public domain or the like, or a dialogue or the like performed by two persons playing different role information may be collected, and a plurality of training samples may be acquired based on the collected dialogue. Wherein each training sample may include character information of the robot, character information of the user, a historical dialog between the user and the robot, and a first reply sentence.
Wherein, the character information can include, but is not limited to, information such as name, gender, age, constellation, education level, interest tags, etc.; the first reply sentence may be regarded as a sample reply sentence of the robot.
In the application, the role information of robots contained in different training samples may be the same or different, and the role information of users contained in different training samples may be the same or different.
In order to improve the accuracy of the model, in the application, the initial dialogue model can be trained by adopting various robot role information and opposite user role information.
Step 502, inputting the training sample into the initial dialogue model to obtain a second reply sentence of the history dialogue output by the initial dialogue model.
In the application, the training sample may be input to an initial dialogue model, and the initial dialogue model predicts the reply sentence based on the role information of the robot, the role information of the user, and the historical dialogue between the user and the robot, so as to output a second reply sentence of the historical dialogue.
For example, a history dialogue included in a training sample may be represented as c= { U 1 ,S 1 ,U 2 ,S 2 …,U t-1 ,S t-1 ,U t U and S represent user and robot, respectively, U 1 Statement of user S 1 A dialogue model can use the robot character information Ps, the user character information Pu, and the history dialogue c= { U in the training sample 1 ,S 1 ,U 2 ,S 2 …,U t-1 ,S t-1 ,U t Predicted dialogue reply sentence S t
Here, inputting the training samples into the initial dialogue model may refer to inputting vector representations corresponding to the training samples into the initial dialogue model.
In step 503, parameters of the initial dialogue model are adjusted according to the difference between the second reply sentence and the first reply sentence, so as to obtain the dialogue model.
In the application, the loss value can be determined according to the difference between the second reply sentence and the first reply sentence, if the loss value is greater than or equal to the preset threshold, parameters of the initial dialogue model can be adjusted according to the loss value, and then training is continued by using other training samples until the loss value is smaller than the preset threshold, so that the dialogue model is obtained.
Alternatively, a conditional probability corresponding to the second reply sentence may be determined, where the conditional probability is a product of the conditional probabilities corresponding to the respective characters in the second reply sentence, and parameters of the initial dialogue model are adjusted by minimizing a negative log likelihood loss of the conditional probability, to obtain the dialogue model.
For example, the conversation history C and the robot character P s And user role P u Connected into a long text, which can be expressed as { x } 1 ,x 2 ,…,x t Ending with a text end mark, where x 1 、x 2 Etc. may represent a character and the second reply sentence of the initial dialog model may be represented as r= { x t+1 ,x t+2 ,…,x N The conditional probability of the second reply sentence R may be expressed as
Figure BDA0003781022110000081
The following negative log likelihood loss can be minimized:
Figure BDA0003781022110000082
where N represents the length of text entered by the dialog model, R <i Representing a previously generated character, x i Representing the characters in the reply sentence R.
In the application, when training the initial dialogue model, training can be performed by a deep learning mode, and compared with other machine learning methods, the deep learning has better performance on a large data set.
When robots with different roles are customized, a target dialogue generated based on the preset role information of the robot and a history dialogue of a user and the robot can be input into a dialogue model, so that dialogue reply sentences matched with the role information of the robot can be obtained, and the robots with different role information can be customized, and the cost is low.
According to the method and the device, the initial dialogue model is trained based on the training samples comprising the role information of the robot, the role information of the user and the historical dialogue between the user and the robot, so that learning of the dialogue model on the role information can be enhanced, reply sentences can be predicted by using the dialogue model according to the role information of different robots, reply sentences matched with the role information of the robots can be obtained, accuracy of the reply sentences can be improved, and robots customizing different role information can be realized.
Fig. 6 is a flowchart of a dialog model training method according to another embodiment of the present application.
As shown in fig. 6, the dialog model training includes:
step 601, a training sample is obtained.
In this application, step 601 is similar to that described in the above embodiments, and thus will not be described here again.
Step 602, performing vector conversion on each word in the training sample to obtain a first vector representation corresponding to each word.
In the application, word coding can be performed on each word in the training sample to obtain word vector representation, at least one of character coding, input type coding and position coding can be performed on each word to obtain at least one of character vector representation, input type vector representation and position vector representation, and then at least one of character vector representation, input type vector representation and position vector representation corresponding to each word can be added with the word vector representation to obtain first vector representation corresponding to each word.
For example, the above four codes are respectively performed on each word in the training sample, and the dimensions of the vector representations obtained by each code are the same, so that the elements in the same positions in the four vector representations corresponding to each word can be added, thereby obtaining the first vector representation corresponding to each word.
In the method, the accuracy of the subsequent model prediction can be improved by carrying out various codes on each word and obtaining the vector representation of each word based on various vector representations corresponding to each word. In addition, the vector representations corresponding to each word are added to obtain the vector representation of each word, so that the dimension of the vector representation can be reduced, and the calculated amount can be reduced.
In the application, the role types include a user and a robot, when each word is coded, a target role type to which each word belongs can be determined from the two role types of the user and the robot, and vector conversion is performed on each word according to the target role type, namely, the role type to which each word belongs is coded, so that a role vector representation corresponding to each word is obtained.
For example, the role codes may be respectively encoded according to a role type, wherein a machine role is 0 and a user role is 1.
In the application, the input types of the dialogue model can be divided into three types, namely character information, historical dialogue and reply sentences, so that when the input type coding is carried out on each word in the training sample, the target input type to which each word belongs can be determined, and according to the target input type, vector conversion is carried out on each word, namely the target input type to which each word belongs is coded, and the input type vector corresponding to each word is obtained.
For example, historical dialog, reply, and role information may be set to 0,1,2, respectively.
When each word is subjected to position coding, the position of each word in the training sample can be determined, and vector conversion is carried out on each word according to the position of each word in the training sample, namely the position of each word is coded, so that a position vector representation corresponding to each word is obtained.
In the position encoding, a relative encoding mode may be adopted, for example, the first reply sentence may be encoded from 0 to 127, and the other part may be encoded in reverse order from 128. This coding scheme facilitates expansion.
For ease of understanding, fig. 7 is a schematic diagram of training phase dialogue model input according to an embodiment of the present application.
As shown in FIG. 7, to distinguish between different input slots, special separators [ BOS ] and [ EOS ] may be used, each beginning with [ BOS ] and ending with [ EOS ], with vector conversion of the separators [ BOS ] and [ EOS ] also occurring when vector converting training samples.
In fig. 7, the model input includes character information of four parts of users, character information of robots, history dialogues, and first reply sentences, and character encoding, input type encoding, position encoding, and word encoding are performed on each input word, respectively, to obtain character vector representations, input type vector representations, position vector representations, word vector representations, and the like.
In the role encoding, the user role is 1, the robot role is 0, as shown in fig. 7, the role vector corresponding to each word in the user role information is 1, the role vector corresponding to each word in the robot role information is 0, the role vector corresponding to each word in the history dialogue is determined according to the role type to which each word belongs in the history dialogue, and the role vector corresponding to each word in the first reply sentence is 0.
In the case of performing input type encoding, the dialogue history, the first reply sentence, and the character information are set to 0,1, and 2, respectively, and the encoding corresponding to each part is as shown in fig. 7.
In the position encoding, the first reply sentence portion performs position encoding from 0 to 127 based on the position of each word, and the remaining portion starts to encode the dialogue history to the user character information portion in reverse order from 128.
The above-described encoding schemes are merely examples, and should not be construed as limiting the present application.
Thus, by performing character encoding, input type encoding, position encoding, and the like for each word, accuracy of model prediction can be improved.
And 603, obtaining a second vector representation corresponding to the training sample according to the second vector representation corresponding to each word.
In the application, the second vector representations corresponding to the words in the training samples can be spliced in sequence according to the positions of the words in the training samples, so that the second vector representations corresponding to the training samples are obtained, and the vector conversion of the training samples is realized.
Step 604, the second encoded vector representation is input into the dialog initial model to obtain a second reply sentence.
In the application, a second vector representation corresponding to the training sample can be input into the dialogue model, and the dialogue model can perform encoding and decoding processing on the second vector representation, so that a second reply sentence output by the dialogue model is obtained.
In step 605, parameters of the initial dialogue model are adjusted according to the difference between the second reply sentence and the first reply sentence to generate the dialogue model.
In this application, step 605 is similar to that described in the above embodiments, and thus will not be described here again.
In the embodiment of the application, vector conversion is carried out on each word in the training sample to obtain a first vector representation corresponding to each word; obtaining second vector representations corresponding to training samples according to the second vector representations corresponding to each word; the second encoded vector representation is input into the dialog initial model to obtain a second reply sentence. Therefore, the vector representation corresponding to the training sample is obtained by carrying out vector conversion on each word in the training sample, and the vector representation corresponding to the training sample is input into the dialogue model, so that the processing is convenient, and the processing efficiency is improved.
In order to achieve the above embodiments, the embodiments of the present application further provide a dialog generating apparatus. Fig. 8 is a schematic structural diagram of a dialogue generating device according to an embodiment of the present application.
As shown in fig. 8, the dialogue generating device 800 includes:
a first obtaining module 810 for obtaining a history dialogue and a target dialogue between a user and a target robot, wherein the target dialogue is generated based on character information of the target robot;
a second obtaining module 820, configured to input the target dialogue and the history dialogue into the dialogue model, so as to obtain reply sentences of the history dialogue output by the dialogue model; the reply sentence is a sentence matched with the role information of the target robot.
In an implementation manner of the embodiment of the application, the apparatus may further include:
the third acquisition module is used for acquiring role information of the target robot;
the determining module is used for determining the target role attribute corresponding to the target robot and the attribute value of the target role attribute according to the role information of the target robot;
and the generating module is used for generating a target dialogue according to the target role attribute and the attribute value.
In one implementation manner of the embodiment of the application, the generating module is configured to:
Acquiring a corresponding relation between a preset character attribute and question-answer sentences, wherein each pair of question-answer sentences in the corresponding relation is a group of dialogues for describing the corresponding character attribute;
inquiring the corresponding relation according to the target character attribute to determine a target question-answer sentence corresponding to the target character attribute;
and generating a target dialogue according to the target question-answer sentence and the attribute value.
In one implementation manner of the embodiment of the present application, the target question-answer sentence is multiple pairs, and the generating module is configured to:
splicing a plurality of pairs of target question-answer sentences to obtain spliced question-answer sentences;
and generating a target dialogue according to the spliced question-answer sentences and the attribute values corresponding to each pair of question-answer sentences.
In one implementation manner of the embodiment of the application, the generating module is configured to:
matching the target character attribute with sentences in a preset sentence library to determine query sentences and statement sentences matched with the target character attribute from the sentence library;
and generating a target dialogue according to the query statement, the statement and the attribute value.
In an implementation manner of an embodiment of the present application, the second obtaining module is configured to:
splicing the target dialogue before the history dialogue to obtain the target dialogue and the dialogue after the history dialogue is spliced;
And inputting the spliced dialogs into a dialog model to acquire reply sentences of the historical dialogs.
Note that, the explanation of the foregoing embodiment of the dialog generating method is also applicable to the dialog generating apparatus of this embodiment, and therefore will not be described in detail here.
In the embodiment of the application, the target dialogue generated based on the role information of the target robot and the history dialogue between the user and the target robot are input into the dialogue model together, so that the reply sentence matched with the role information of the target robot is acquired. Therefore, aiming at different robot role information, the target dialogue generated based on the robot role information can be used as the input of the dialogue model to obtain the reply sentence which is output by the dialogue model and matched with the target robot role information, so that robots with different set role information can be obtained, and the cost is reduced.
In order to achieve the above embodiments, the embodiments of the present application further provide a session model training device. Fig. 9 is a schematic structural diagram of a dialogue model training device according to an embodiment of the present application.
As shown in fig. 9, the dialogue model training apparatus 900 includes:
a first obtaining module 910, configured to obtain a training sample, where the training sample includes role information of a robot, role information of a user, a history dialogue between the user and the robot, and a first reply sentence;
A second obtaining module 920, configured to input a training sample to the initial dialogue model to obtain a second reply sentence of the history dialogue output by the initial dialogue model;
the adjusting module 930 is configured to adjust parameters of the initial dialogue model according to the difference between the second reply sentence and the first reply sentence, so as to obtain the dialogue model.
In one implementation manner of the embodiment of the present application, the second obtaining module 920 includes:
the vector conversion unit is used for carrying out vector conversion on each word in the training sample to obtain a first vector representation corresponding to each word;
the determining unit is used for determining second vector representations corresponding to the training samples according to the second vector representations corresponding to the words;
and the acquisition unit is used for inputting the second coding vector representation into the dialogue initial model to acquire a second reply sentence.
In one implementation manner of the embodiment of the present application, the vector conversion unit is configured to:
performing at least one of character coding, input type coding and position coding and word coding on each word in the training sample to obtain at least one of character vector representation, input type vector representation and position vector representation corresponding to each word and word vector representation;
And obtaining a first vector representation corresponding to each word according to at least one of the character vector representation, the input type vector representation and the position vector representation and the word vector representation.
In one implementation manner of the embodiment of the present application, the vector conversion unit is configured to:
and adding at least one of the character vector representation, the input type vector representation and the position vector representation with the word vector representation to obtain a first vector representation.
In one implementation manner of the embodiment of the present application, the vector conversion unit is configured to:
determining the type of the target role to which each word belongs;
and carrying out vectorization processing on each word according to the target role type to obtain a role vector representation corresponding to each word.
In one implementation manner of the embodiment of the present application, the vector conversion unit is configured to:
determining a target input type to which each word belongs;
and carrying out vectorization processing on each word according to the target input type to obtain an input type vector representation corresponding to each word.
It should be noted that, the explanation of the foregoing embodiment of the session model training method is also applicable to the session model training apparatus of this embodiment, so that the explanation is not repeated here.
According to the method and the device, the initial dialogue model is trained based on the training samples comprising the role information of the robot, the role information of the user and the historical dialogue between the user and the robot, so that learning of the dialogue model on the role information can be enhanced, reply sentences can be predicted by using the dialogue model according to the role information of different robots, reply sentences matched with the role information of the robots can be obtained, accuracy of the reply sentences can be improved, and robots customizing different role information can be realized.
According to embodiments of the present application, there is also provided an electronic device, a readable storage medium and a computer program product.
Fig. 10 shows a schematic block diagram of an example electronic device 1000 that may be used to implement embodiments of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the application described and/or claimed herein.
As shown in fig. 10, the apparatus 1000 includes a computing unit 1001 that can perform various appropriate actions and processes according to a computer program stored in a ROM (Read-Only Memory) 1002 or a computer program loaded from a storage unit 1008 into a RAM (Random Access Memory ) 1003. In the RAM 1003, various programs and data required for the operation of the device 1000 can also be stored. The computing unit 1001, the ROM 1002, and the RAM 1003 are connected to each other by a bus 1004. An I/O (Input/Output) interface 1005 is also connected to bus 1004.
Various components in device 1000 are connected to I/O interface 1005, including: an input unit 1006 such as a keyboard, a mouse, and the like; an output unit 1007 such as various types of displays, speakers, and the like; a storage unit 1008 such as a magnetic disk, an optical disk, or the like; and communication unit 1009 such as a network card, modem, wireless communication transceiver, etc. Communication unit 1009 allows device 1000 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunications networks.
The computing unit 1001 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 1001 include, but are not limited to, a CPU (Central Processing Unit ), GPU (Graphic Processing Units, graphics processing unit), various dedicated AI (Artificial Intelligence ) computing chips, various computing units running machine learning model algorithms, DSP (Digital Signal Processor ), and any suitable processor, controller, microcontroller, etc. The computing unit 1001 performs the respective methods and processes described above, for example, a dialog generating method. For example, in some embodiments, the dialog generation method may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as the storage unit 1008. In some embodiments, part or all of the computer program may be loaded and/or installed onto device 1000 via ROM 1002 and/or communication unit 1009. When a computer program is loaded into RAM 1003 and executed by computing unit 1001, one or more steps of the dialog generation method described above may be performed. Alternatively, in other embodiments, the computing unit 1001 may be configured to perform the dialog generation method in any other suitable way (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit System, FPGA (Field Programmable Gate Array ), ASIC (Application-Specific Integrated Circuit, application-specific integrated circuit), ASSP (Application Specific Standard Product, special-purpose standard product), SOC (System On Chip ), CPLD (Complex Programmable Logic Device, complex programmable logic device), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present application may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this application, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, RAM, ROM, EPROM (Electrically Programmable Read-Only-Memory, erasable programmable read-Only Memory) or flash Memory, an optical fiber, a CD-ROM (Compact Disc Read-Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., CRT (Cathode-Ray Tube) or LCD (Liquid Crystal Display ) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: LAN (Local Area Network ), WAN (Wide Area Network, wide area network), internet and blockchain networks.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service (Virtual Private Server, virtual special servers) are overcome. The server may also be a server of a distributed system or a server that incorporates a blockchain.
It should be noted that, the block diagram of the electronic device for implementing the dialogue model training method according to the embodiment of the present application is similar to the block diagram of the electronic device shown in fig. 10, so that a detailed description thereof is omitted herein.
According to an embodiment of the present application, there is further provided a computer program product, which when executed by an instruction processor in the computer program product, performs the dialog generation method or the dialog model training method set forth in the above embodiment of the present application.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present application may be performed in parallel, sequentially, or in a different order, provided that the desired results of the technical solutions disclosed in the present application can be achieved, and are not limited herein.
The above embodiments do not limit the scope of the application. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application are intended to be included within the scope of the present application.

Claims (22)

1. A dialog model training method, comprising:
acquiring a training sample, wherein the training sample comprises role information of a robot, role information of a user, a historical dialogue between the user and the robot and a first reply sentence, and the first reply sentence is a sample reply sentence of the robot;
performing at least one of character coding, input type coding and position coding and word coding on each word in the training sample to obtain at least one of character vector representation, input type vector representation and position vector representation corresponding to each word and word vector representation; the role coding is to code according to the role type, wherein the role type comprises a user and a robot; the input type codes are coded according to the input type, and the input type comprises character information, historical conversations and reply sentences;
obtaining a first vector representation corresponding to each word according to at least one of the character vector representation, the input type vector representation and the position vector representation and the word vector representation;
determining a second vector representation corresponding to the training sample according to the first vector representation corresponding to each word;
Inputting the second vector representation into a dialogue initial model to obtain a second reply sentence;
and adjusting parameters of the initial dialogue model according to the difference between the second reply sentence and the first reply sentence so as to obtain the dialogue model.
2. The method of claim 1, wherein the obtaining the first vector representation for each word from the word vector representation and at least one of the character vector representation, the input type vector representation, and the position vector representation comprises:
and adding at least one of the character vector representation, the input type vector representation and the position vector representation to the word vector representation to obtain the first vector representation.
3. The method of claim 1, wherein said character encoding each word in the training sample comprises:
determining a target role type to which each word belongs from the role types;
and carrying out vectorization processing on each word according to the target role type to obtain the role vector representation corresponding to each word.
4. The method of claim 1, wherein said encoding the input type for each word in the training sample comprises:
Determining a target input type to which each word belongs from the input types;
and carrying out vectorization processing on each word according to the target input type to obtain an input type vector representation corresponding to each word.
5. A dialog generation method, comprising:
acquiring a history dialogue and a target dialogue between a user and a target robot, wherein the target dialogue is generated based on role information of the target robot;
inputting the target dialogue and the history dialogue into a dialogue model to acquire reply sentences of the history dialogue output by the dialogue model; the reply sentence is a sentence matched with the role information of the target robot; the dialog model is obtained using the training method as claimed in any of claims 1 to 4.
6. The method of claim 5, wherein prior to the acquiring the target session, further comprising:
acquiring role information of the target robot;
determining a target role attribute corresponding to the target robot and an attribute value of the target role attribute according to the role information of the target robot;
and generating the target dialogue according to the target role attribute and the attribute value.
7. The method of claim 6, wherein the generating the target dialog from the target character attribute and the attribute value comprises:
acquiring a corresponding relation between a preset character attribute and question-answer sentences, wherein each pair of question-answer sentences in the corresponding relation is a group of dialogues for describing the corresponding character attribute;
inquiring the corresponding relation according to the target role attribute to determine a target question-answer sentence corresponding to the target role attribute;
and generating the target dialogue according to the target question-answer sentence and the attribute value.
8. The method of claim 7, wherein the target question-answer sentence is a plurality of pairs, the generating the target dialogue from the target question-answer sentence and the attribute value comprising:
splicing a plurality of pairs of target question-answer sentences to obtain spliced question-answer sentences;
and generating the target dialogue according to the spliced question-answer sentences and the attribute values corresponding to each pair of question-answer sentences.
9. The method of claim 6, wherein the generating the target dialog from the target character attribute and the attribute value comprises:
matching the target role attribute with sentences in a preset sentence library to determine query sentences and statement sentences matched with the target role attribute from the sentence library;
And generating the target dialogue according to the query statement, the statement and the attribute value.
10. The method of claim 5, wherein said inputting the target conversation and the history conversation into a conversation model to obtain reply sentences of the history conversation output by the conversation model comprises:
splicing the target dialogue before the history dialogue to obtain the target dialogue and the dialogue after the history dialogue is spliced;
and inputting the spliced conversation into a conversation model to acquire reply sentences of the historical conversations.
11. A dialog generation device comprising:
a first acquisition module for acquiring a history dialogue and a target dialogue between a user and a target robot, wherein the target dialogue is generated based on role information of the target robot;
the second acquisition module is used for inputting the target dialogue and the history dialogue into a dialogue model so as to acquire reply sentences of the history dialogue output by the dialogue model; the reply sentence is a sentence matched with the role information of the target robot; the dialog model is obtained using the training method as claimed in any of claims 1 to 4.
12. The apparatus of claim 11, further comprising:
the third acquisition module is used for acquiring the role information of the target robot;
the determining module is used for determining a target role attribute corresponding to the target robot and an attribute value of the target role attribute according to the role information of the target robot;
and the generation module is used for generating the target dialogue according to the target role attribute and the attribute value.
13. The apparatus of claim 12, wherein the means for generating is configured to:
acquiring a corresponding relation between a preset character attribute and question-answer sentences, wherein each pair of question-answer sentences in the corresponding relation is a group of dialogues for describing the corresponding character attribute;
inquiring the corresponding relation according to the target role attribute to determine a target question-answer sentence corresponding to the target role attribute;
and generating the target dialogue according to the target question-answer sentence and the attribute value.
14. The apparatus of claim 13, wherein the target question-answer sentence is a plurality of pairs, the generating module being configured to:
splicing a plurality of pairs of target question-answer sentences to obtain spliced question-answer sentences;
And generating the target dialogue according to the spliced question-answer sentences and the attribute values corresponding to each pair of question-answer sentences.
15. The apparatus of claim 12, wherein the means for generating is configured to:
matching the target role attribute with sentences in a preset sentence library to determine query sentences and statement sentences matched with the target role attribute from the sentence library;
and generating the target dialogue according to the query statement, the statement and the attribute value.
16. The apparatus of claim 11, wherein the second acquisition module is configured to:
splicing the target dialogue before the history dialogue to obtain the target dialogue and the dialogue after the history dialogue is spliced;
and inputting the spliced conversation into a conversation model to acquire reply sentences of the historical conversations.
17. A dialog model training device comprising:
the system comprises a first acquisition module, a second acquisition module and a first processing module, wherein the first acquisition module is used for acquiring a training sample, the training sample comprises role information of a robot, role information of a user, a historical dialogue between the user and the robot and a first reply sentence, and the first reply sentence is a sample reply sentence of the robot;
The second acquisition module is used for inputting the training sample into an initial dialogue model so as to acquire a second reply sentence of the history dialogue output by the initial dialogue model;
the adjusting module is used for adjusting parameters of the initial dialogue model according to the difference between the second reply sentence and the first reply sentence so as to obtain a dialogue model;
wherein, the second acquisition module includes:
the vector conversion unit is used for carrying out at least one code of character coding, input type coding and position coding and word coding on each word in the training sample to obtain at least one of character vector representation, input type vector representation and position vector representation corresponding to each word and word vector representation; obtaining a first vector representation corresponding to each word according to at least one of the character vector representation, the input type vector representation and the position vector representation and the word vector representation; the role coding is to code according to the role type, wherein the role type comprises a user and a robot; the input type codes are coded according to the input type, and the input type comprises character information, historical conversations and reply sentences;
The determining unit is used for determining a second vector representation corresponding to the training sample according to the first vector representation corresponding to each word;
and the acquisition unit is used for inputting the second vector representation into the dialogue initial model so as to acquire the second reply sentence.
18. The apparatus of claim 17, wherein the vector conversion unit is configured to:
and adding at least one of the character vector representation, the input type vector representation and the position vector representation to the word vector representation to obtain the first vector representation.
19. The apparatus of claim 17, wherein the vector conversion unit is configured to:
determining the target role type of each word according to the role type;
and carrying out vectorization processing on each word according to the target role type to obtain the role vector representation corresponding to each word.
20. The apparatus of claim 17, wherein the vector conversion unit is configured to:
determining a target input type to which each word belongs according to the input type;
and carrying out vectorization processing on each word according to the target input type to obtain an input type vector representation corresponding to each word.
21. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-4 or to perform the method of any one of claims 5-10.
22. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-4 or to perform the method of any one of claims 5-10.
CN202210929482.3A 2022-08-03 2022-08-03 Dialogue generation method, dialogue model training method and device Active CN115309877B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210929482.3A CN115309877B (en) 2022-08-03 2022-08-03 Dialogue generation method, dialogue model training method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210929482.3A CN115309877B (en) 2022-08-03 2022-08-03 Dialogue generation method, dialogue model training method and device

Publications (2)

Publication Number Publication Date
CN115309877A CN115309877A (en) 2022-11-08
CN115309877B true CN115309877B (en) 2023-05-30

Family

ID=83859426

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210929482.3A Active CN115309877B (en) 2022-08-03 2022-08-03 Dialogue generation method, dialogue model training method and device

Country Status (1)

Country Link
CN (1) CN115309877B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115545002B (en) * 2022-11-29 2023-03-31 支付宝(杭州)信息技术有限公司 Model training and business processing method, device, storage medium and equipment
CN115952274B (en) * 2023-03-10 2023-06-27 北京百度网讯科技有限公司 Data generation method, training method and device based on deep learning model
CN116932714A (en) * 2023-06-30 2023-10-24 北京百度网讯科技有限公司 Method and device for training generated dialogue model and realizing generated dialogue
CN117251552B (en) * 2023-11-13 2024-02-27 腾讯科技(深圳)有限公司 Dialogue processing method and device based on large language model and electronic equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104462024A (en) * 2014-10-29 2015-03-25 百度在线网络技术(北京)有限公司 Method and device for generating dialogue action strategy model
CN114626384A (en) * 2022-03-01 2022-06-14 京东科技信息技术有限公司 Dialogue processing method, question rewriting model training method and device

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103078867A (en) * 2013-01-15 2013-05-01 深圳市紫光杰思谷科技有限公司 Automatic chatting method and chatting system among robots
CN106297789B (en) * 2016-08-19 2020-01-14 北京光年无限科技有限公司 Personalized interaction method and system for intelligent robot
CN106649752A (en) * 2016-12-26 2017-05-10 北京云知声信息技术有限公司 Answer acquisition method and device
CN106649746A (en) * 2016-12-26 2017-05-10 北京云知声信息技术有限公司 Answer acquisition method and device
CN106897263A (en) * 2016-12-29 2017-06-27 北京光年无限科技有限公司 Robot dialogue exchange method and device based on deep learning
CN111831798A (en) * 2019-04-19 2020-10-27 北京三星通信技术研究有限公司 Information processing method, information processing device, electronic equipment and computer readable storage medium
EP3819809A1 (en) * 2019-11-08 2021-05-12 PolyAI Limited A dialogue system, a method of obtaining a response from a dialogue system, and a method of training a dialogue system
CN112100353A (en) * 2020-09-15 2020-12-18 京东方科技集团股份有限公司 Man-machine conversation method and system, computer device and medium
CN113505198B (en) * 2021-07-09 2023-12-29 和美(深圳)信息技术股份有限公司 Keyword-driven generation type dialogue reply method and device and electronic equipment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104462024A (en) * 2014-10-29 2015-03-25 百度在线网络技术(北京)有限公司 Method and device for generating dialogue action strategy model
CN114626384A (en) * 2022-03-01 2022-06-14 京东科技信息技术有限公司 Dialogue processing method, question rewriting model training method and device

Also Published As

Publication number Publication date
CN115309877A (en) 2022-11-08

Similar Documents

Publication Publication Date Title
CN115309877B (en) Dialogue generation method, dialogue model training method and device
CN109887484B (en) Dual learning-based voice recognition and voice synthesis method and device
CN113205817B (en) Speech semantic recognition method, system, device and medium
CN112487173B (en) Man-machine conversation method, device and storage medium
CN111223498A (en) Intelligent emotion recognition method and device and computer readable storage medium
CN112528637B (en) Text processing model training method, device, computer equipment and storage medium
JP2023535709A (en) Language expression model system, pre-training method, device, device and medium
JP7335300B2 (en) Knowledge pre-trained model training method, apparatus and electronic equipment
EP4113357A1 (en) Method and apparatus for recognizing entity, electronic device and storage medium
CN114360557B (en) Voice tone conversion method, model training method, device, equipment and medium
CN117033582A (en) Training method and device for dialogue model, electronic equipment and storage medium
CN115687565A (en) Text generation method and device
CN112910761B (en) Instant messaging method, device, equipment, storage medium and program product
CN112860995A (en) Interaction method, device, client, server and storage medium
CN115357710B (en) Training method and device for table description text generation model and electronic equipment
CN112349294A (en) Voice processing method and device, computer readable medium and electronic equipment
CN114970666B (en) Spoken language processing method and device, electronic equipment and storage medium
CN113468857B (en) Training method and device for style conversion model, electronic equipment and storage medium
CN113553413A (en) Dialog state generation method and device, electronic equipment and storage medium
CN112560466A (en) Link entity association method and device, electronic equipment and storage medium
CN111159339A (en) Text matching processing method and device
CN114282552B (en) Training method and device of non-autoregressive translation model
CN115169367B (en) Dialogue generating method and device, and storage medium
CN114360558B (en) Voice conversion method, voice conversion model generation method and device
CN116244432B (en) Pre-training method and device for language model and electronic equipment

Legal Events

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