CN115309877A - Dialog generation method, dialog model training method and device - Google Patents

Dialog generation method, dialog model training method and device Download PDF

Info

Publication number
CN115309877A
CN115309877A CN202210929482.3A CN202210929482A CN115309877A CN 115309877 A CN115309877 A CN 115309877A CN 202210929482 A CN202210929482 A CN 202210929482A CN 115309877 A CN115309877 A CN 115309877A
Authority
CN
China
Prior art keywords
target
role
word
vector representation
dialogue
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.)
Granted
Application number
CN202210929482.3A
Other languages
Chinese (zh)
Other versions
CN115309877B (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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Data Mining & Analysis (AREA)
  • Artificial Intelligence (AREA)
  • Databases & Information Systems (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Computation (AREA)
  • Medical Informatics (AREA)
  • Computing Systems (AREA)
  • Machine Translation (AREA)

Abstract

The application discloses a dialogue generation method, a dialogue model training method and a device, relates to the technical field of computers, and particularly relates to the artificial intelligence fields of natural language processing, deep learning and the like. The specific implementation scheme is as follows: acquiring historical conversations and target conversations between a user and a target robot, wherein the target conversations are generated based on role information of the target robot; inputting the target dialogue and the historical dialogue into a dialogue model to obtain a reply sentence of the historical dialogue output by the dialogue model; wherein, 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 a reply sentence which is 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 the robots with different set role information and reducing the cost.

Description

Dialog generation method, dialog model training method and device
Technical Field
The application relates to the technical field of computers, in particular to the field of artificial intelligence such as natural language processing and deep learning, and specifically relates to a conversation generation method and a conversation model training method and device.
Background
A dialogue robot, or dialogue system, utilizes Machine Learning (ML) and Artificial Intelligence (AI) techniques to let a robot understand the language of a person, thereby simulating communication between people. In practical applications, chat requirements of users may be different in different application scenarios, and the conversation robots with different roles need to be applied to different scenarios.
Therefore, how to reduce the cost of acquiring the conversation robots with different roles is an urgent problem to be solved.
Disclosure of Invention
The application provides a dialogue generation method, a dialogue model training method and a device. The specific scheme is as follows:
according to an aspect of the present application, there is provided a dialog generation method including:
acquiring historical conversations and target conversations between a user and a target robot, wherein the target conversations are generated based on role information of the target robot;
inputting the target dialogue and the historical dialogue into a dialogue model to obtain a reply sentence of the historical dialogue output by the dialogue model; wherein, 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 dialogue model training method, including:
acquiring a training sample, wherein the training sample comprises role information of a robot, role information of a user, historical conversation 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 historical dialogue output by the initial dialogue model;
and adjusting parameters of the initial dialogue model according to the difference between the second reply statement and the first reply statement to obtain the dialogue model.
According to another aspect of the present application, there is provided a dialog generating apparatus including:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring historical conversations and target conversations between a user and a target robot, and the target conversations are generated based on role information of the target robot;
the second acquisition module is used for inputting the target dialogue and the historical dialogue into the dialogue model so as to acquire a reply sentence of the historical dialogue output by the dialogue model; wherein, 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 dialogue model training apparatus including:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring training samples, and the training samples comprise role information of the robot, role information of a user, historical conversation 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 to acquire a second reply sentence of the historical dialogue output by the initial dialogue model;
and the adjusting module is used for adjusting the parameters of the initial dialogue model according to the difference between the second reply statement and the first reply statement 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 content of the first and second substances,
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 having stored thereon computer instructions for causing the computer to perform the method according to the above-described embodiments.
According to another aspect of the present application, a computer program product is provided, comprising a computer program which, when being executed by a processor, carries out the steps of the method of the above-mentioned embodiment.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present application, nor do they limit the scope of the present application. Other features of the present application will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not intended to limit the present application. Wherein:
fig. 1 is a schematic flowchart of a dialog generation method according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a dialog generation process provided in an embodiment of the present application;
fig. 3 is a schematic flowchart of a dialog generation method according to another embodiment of the present application;
fig. 4 is a schematic flowchart of a dialog generation method according to another embodiment of the present application;
FIG. 5 is a flowchart illustrating a dialogue model training method according to an embodiment of the application;
FIG. 6 is a schematic flow chart illustrating a training method of a dialogue model according to another embodiment of the present application;
FIG. 7 is a schematic diagram of a training phase dialog model input provided in accordance with an embodiment of the present application;
fig. 8 is a schematic structural diagram of a dialog generating device according to an embodiment of the present application;
FIG. 9 is a schematic structural diagram of a dialogue model training apparatus according to an embodiment of the present application;
fig. 10 is a block diagram of an electronic device for implementing a dialog generation method according to an embodiment of the present application.
Detailed Description
The following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application for the understanding of the same, which are to be considered exemplary only. Accordingly, those 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 subject of research on the use of computers to simulate certain mental processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.) of humans, both in the hardware and software domain. 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, deep learning, a big data processing technology, a knowledge map 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 summarization, intelligent question answering, topic recommendation, machine translation, subject 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 intrinsic law and expression level of the learning sample data, and the information obtained in the learning process is very helpful for the interpretation of data such as characters, images and sounds. The final aim of the method is to enable the machine to have the analysis and learning capability like a human, and to recognize data such as characters, images and sounds.
A dialog generation method, a dialog model training method, and an apparatus according to an embodiment of the present application are described below with reference to the drawings.
Fig. 1 is a schematic flow chart of a dialog generation method according to an embodiment of the present application.
The dialog generating method according to the embodiment of the present application may be executed by the dialog generating apparatus according to the embodiment of the present application, and the apparatus may be configured in an electronic device to implement robots with different roles according to different role information.
The electronic device may be any device with computing capability, for example, a personal computer, a mobile terminal, a server, and the like, and the mobile terminal may be a hardware device with various operating systems, touch screens, and/or display screens, such as an in-vehicle device, a mobile phone, a tablet computer, a personal digital assistant, a wearable device, and the like.
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, obtaining historical dialogue and target dialogue between a user and a target robot, wherein the target dialogue is generated based on role information of the target robot.
Wherein, the historical dialogue can be historical dialogue between the user and the target robot in a certain wheel dialogue; the character information of the target robot may include, but is not limited to, information of a name, a sex, an age, a constellation, an education level, an interest tag, and the like of the target robot.
In the present application, the target session may be a session related to the character information of the target robot, and the target session may be configured in advance or may be generated in advance based on the character information of the target robot.
For example, the role information of a target robot is named as a, the age is 10 years, and the target dialog may be "U: what name you call; s, I call A; u; you are a few years old; s: i 10 years old this year "where U represents the user and S represents the robot.
And 102, inputting the target dialogue and the historical dialogue into the dialogue model to obtain a reply sentence of the historical dialogue output by the dialogue model.
In the present application, the dialogue model may be obtained by training in advance based on training samples including robot role information, user role information, and historical dialogue between the user and the robot. The training of the dialogue model can be performed using character information of a plurality of robots, character information of a plurality of users, and the like, thereby adding character information of dialogue participants during the dialogue model training and enhancing the learning of the dialogue model for the use of the character information.
In the present application, the target robot may be configured with the dialogue model, or the target robot may generate a reply sentence using the dialogue model.
In practical application, if the role information of people is different, the content of the reply in the chat may also be different, and the effect is also expected to be achieved for the robot, so that the intelligence of the chat is improved. Therefore, in the present application, after the historical dialogue and the target dialogue between the user and the target robot are acquired, the target dialogue may be input into the dialogue model together with the historical dialogue, so as to perform encoding and decoding processing on the target dialogue and the historical dialogue by using the dialogue model, so as to acquire a reply sentence of the historical dialogue output by the dialogue model.
For convenience of understanding, the following description is made with reference to fig. 2, and fig. 2 is a schematic diagram of a dialog generation process provided in an embodiment of the present application.
As shown in fig. 2, the set robot role information is "name: AA; sex: a 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 a user, and S represents a robot, and the target dialogue and the historical dialogue can be input into the dialogue model to obtain a reply sentence" you can call me AA ".
In the application, when the reply sentences are generated every time, the target conversations and the current historical conversations are input into the conversation model to obtain the reply sentences output by the conversation model, so that the reply sentences are matched with the role information of the target robot, and the accuracy of the reply sentences is improved.
In practical application, different scenes need to use the dialogue robots with different roles, in the related technology, a large number of dialogue samples are collected based on preset robot role information, a dialogue model corresponding to the role information of the robot is obtained based on the collected dialogue samples through training, obviously, for the role information of different robots, corresponding dialogue models need to be obtained through training to obtain robots with different roles, and the cost is high.
In the application, for the role information of different robots, the historical dialogue and the target dialogue generated based on the role information of the robots can be input into the dialogue model together, and the reply sentence matched with the role information of the robots is obtained, so that the robots with the 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 historical dialogue between the user and the target robot are input into the dialogue model together, and the reply sentence matched with the role information of the target robot is acquired. Therefore, for different robot role information, the reply sentence which is output by the dialogue model and is matched with the role information of the target robot can be obtained by taking the target dialogue generated based on the role information of the robot as the input of the dialogue model, so that the robots with different set role information can be obtained, and the cost is reduced.
Fig. 3 is a flowchart illustrating a dialog generation method according to another embodiment of the present application.
As shown in fig. 3, before the target dialog is obtained, the target dialog may be generated by:
step 301, role information of the target robot is acquired.
The role information of the target robot can be obtained based on input of a user on a display interface of the target robot, and can also be configured in advance.
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.
Wherein the character attributes may include name, gender, age, constellation, interest tags, and the like.
In the application, the role information of the target robot can be subjected to natural language processing, and the role attribute and the attribute value of the role attribute of the target robot are extracted from each participle obtained by natural language processing, namely the target role attribute and the attribute value of the target role attribute are determined. The target role attribute may be one or more, and the present application does not limit this.
For example, if the role information of a certain robot is "girl, age is 20 years old", it may be determined that the target role attribute of the robot includes gender and age, the attribute value corresponding to gender is girl, and the attribute value corresponding to age is 20 years old, that is, the target role attribute and the attribute value of the robot are "gender: a woman; age: 20 years old.
Step 303, generating a target dialog according to the target role attribute and the attribute value.
When generating the target dialog, as a possible implementation manner, a corresponding relationship between the role attribute and the question-answer sentence may be preset, where each pair of question-answer sentences in the corresponding relationship is a group of dialogs for describing the corresponding role attribute. For example, a pair of question-answer sentences corresponding to gender attribute may be "question: what your gender is; answering: i am [ ' sex ' ] woolen '. For another example, a pair of question-answer sentences corresponding to the age attribute may be "question: what is your age; answering: i this year [ 'age' ].
When a target dialogue is generated, the corresponding relation between preset role attributes and questions and answers can be obtained, the corresponding relation is inquired according to the target role attributes, when the target role attributes are matched with any role attributes in the corresponding relation, the question and answer sentences corresponding to the role attributes can be used as the target question and answer sentences corresponding to the target role attributes, then corresponding slots of answer sentences in the target question and answer sentences can be filled by utilizing the attribute values of the target role attributes, and the target dialogue can be generated.
For example, if the name of the robot is set as AA, the question-answer sentence corresponding to the name is "question: what your name calls; answering: i call [ 'name' ], AA can be filled in the name slot of the reply sentence in the question-answer sentence corresponding to the name, so that a dialog "question: what your name calls; answering: i call AA ".
Therefore, the target question-answer sentences corresponding to the target role attributes are obtained based on the corresponding relation between the preset role attributes and the question-answer sentences, and the target conversation is generated based on the target question-answer sentences and the attribute values, so that the method is simple and convenient.
If the target role attributes are multiple, that is, the target question-answer sentences are multiple pairs, the attribute value of each target role attribute can be filled in the corresponding slot position in the answer sentence in the corresponding question-answer sentence to obtain a group of conversations corresponding to each role attribute, and then the group of conversations corresponding to each role attribute are spliced to obtain the target conversation. Or, the target question-answer sentences may be spliced to obtain spliced question-answer sentences, and then the attribute values corresponding to each pair of question-answer sentences are filled into corresponding slots of the answer sentences in the spliced question-answer sentences, so as to obtain the target dialog.
Therefore, when the target question-answering sentences are in multi-pair, a target dialogue can be obtained through splicing, so that the target dialogue comprises 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 dialog, in the present application, the target role attribute may also be matched with a statement in a preset statement library, so as to determine a question statement and a statement that are matched with the target role attribute from the statement library, and then replace an attribute value in the statement with an attribute value of the target role attribute, and generate the target dialog by combining the question statement.
For example, the target character attribute and its attribute value are "gender: female ", inquiring that the question sentence matching gender is" what is your gender "and the statement sentence" i am a boy ", the" boy "in the statement sentence can be replaced by" girl ", resulting in the target dialog" U: what is your gender; s: i am a girl.
It can be understood that, when there are a plurality of target role attributes, a set of dialogs corresponding to each target role attribute can be obtained in this way, and then the dialogs corresponding to all the target role attributes are spliced to obtain a target dialog.
Therefore, the target role attributes can be matched with the sentences in the sentence library to determine the question sentences and statement sentences matched with the target role attributes, so that the target dialogue is generated according to the question sentences, the statement sentences and the attribute values, and the method is simple and convenient.
In the embodiment of the application, 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 conversation is generated according to the target role attribute and the attribute value, so that the automatic generation of the target conversation is realized, and the efficiency is improved.
Fig. 4 is a flowchart illustrating a dialog generation method according to another embodiment of the present application.
As shown in fig. 4, the dialog generation method includes:
step 401, obtaining historical dialogue and target dialogue between a user and a target robot.
In the present application, step 401 is similar to the content described in the above embodiments, and therefore is not described herein again.
And step 402, splicing the target dialog before the historical dialog to obtain the target dialog and the dialog spliced by the historical dialog.
In the application, the target dialog can be regarded as a prompt of the historical dialog, and the target dialog can be spliced before the historical dialog to obtain the dialog after splicing the target dialog and the historical dialog.
As shown in fig. 2 for the target dialog and the history dialog, the "S: i is a girl woolen 'splicing later' U: hello ", we can get the dialog after splicing as" U: what your name calls; s: i call AA; u: how much you are old; s: i am 11 years old this year; u: what is your gender; s: i is girl; u: you like; s: it is very happy to know you; u: i call B, you woolen ".
And 403, inputting the spliced conversation into a conversation model to obtain a reply statement of the historical conversation.
In the application, the spliced conversation can be input into the conversation model, so that the target conversation and the historical conversation are encoded and decoded by using the conversation model, and the reply sentence of the historical conversation output by the conversation model is obtained.
In the embodiment of the application, the target dialogue is spliced before the historical dialogue to obtain the dialogue after splicing the target dialogue and the historical dialogue, and the spliced dialogue is input into the dialogue model to obtain the reply sentence.
Fig. 5 is a flowchart illustrating a dialogue model training method according to an embodiment of the present application.
As shown in fig. 5, the dialogue model training includes:
step 501, obtaining a training sample.
In the present application, the dialogue information may be collected from social media in the public domain or the like, or dialogues performed by two persons playing different role information may also be collected, and a plurality of training samples may be obtained based on the collected dialogues. Wherein each training sample may include role information of the robot, role information of the user, historical dialog between the user and the robot, and a first reply sentence.
Wherein, the role information may include, but is not limited to, name, gender, age, constellation, education level, interest tag, etc.; the first reply sentence may be considered a sample reply sentence of the robot.
In the present application, the role information of the robot included in different training samples may be the same or different, and the role information of the user included 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 using various robot role information and various user role information.
Step 502, inputting the training sample into the initial dialogue model to obtain a second reply sentence of the historical 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 role information of the robot, role information of the user, and a historical dialogue between the user and the robot to output a second reply sentence of the historical dialogue.
For example, a historical dialog included in a training sample may be represented as C = { U = { (U) } 1 ,S 1 ,U 2 ,S 2 …,U t-1 ,S t-1 ,U t Where U and S represent user and robot, respectively, U 1 Sentence representing user, S 1 Representing the reply sentence of the robot, the dialogue model may use the robot character information Ps, the user character information Pu, and the historical dialogue C = { U } in the training sample 1 ,S 1 ,U 2 ,S 2 …,U t-1 ,S t-1 ,U t Predicting a dialog reply statement S t
Here, the input of the training samples to the initial dialogue model may mean that the vector representations corresponding to the training samples are input to the initial dialogue model.
Step 503, adjusting parameters of the initial dialogue model according to the difference between the second reply statement and the first reply statement to obtain the dialogue model.
In the application, a 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 a preset threshold value, the 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 less than the preset threshold value, so that the dialogue model is obtained.
Or, a conditional probability corresponding to the second reply sentence may be determined, where the conditional probability is a product of conditional probabilities corresponding to 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, conversation history C and robot character P s And user role P u Connected into a long text, theLong text may be represented as { x } 1 ,x 2 ,…,x t End with an end of text marker, where x 1 、x 2 Etc. may represent one character, 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 statement R can be expressed as
Figure BDA0003781022110000081
The following negative log likelihood loss can be minimized:
Figure BDA0003781022110000082
where N represents the length of the input text of the dialogue model, R <i Representing previously generated characters, x i Representing characters in the reply sentence R.
In the application, when the initial dialogue model is trained, the initial dialogue model can be trained in a deep learning mode, and compared with other machine learning methods, the deep learning method has better performance on a large data set.
When the robots with different roles are customized, a target conversation generated based on preset role information of the robot and historical conversations between a user and the robot can be input into a conversation model, so that a conversation reply sentence matched with the role information of the robot can be obtained, the robots with different role information can be customized, and the cost is low.
In the embodiment of the application, the initial dialogue model is trained based on the training samples including the role information of the robot, the role information of the user and the historical dialogue between the user and the robot, so that the learning of the role information by the dialogue model can be enhanced, the reply sentences can be predicted by utilizing the dialogue model aiming at the role information of different robots, the reply sentences matched with the role information of the robot can be obtained, the accuracy of the reply sentences can be improved, the robots with different role information can be customized, and the cost is low.
Fig. 6 is a flowchart illustrating a dialogue model training method according to another embodiment of the present application.
As shown in fig. 6, the dialogue model training includes:
step 601, obtaining a training sample.
In the present application, the content of step 601 is similar to that described in the above embodiments, and therefore, the description thereof is omitted.
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 encoding may be performed on each word in a training sample to obtain word vector representation, at least one of role encoding, input type encoding and position encoding may be performed on each word to obtain at least one of role vector representation, input type vector representation and position vector representation, and then at least one of role vector representation, input type vector representation and position vector representation corresponding to each word may be added to word vector representation to obtain first vector representation corresponding to each word.
For example, the above four kinds of encoding are performed on each word in the training sample, and the dimensions of the vector representations obtained by each kind of encoding are the same, then the elements at the same positions in the four kinds of vector representations corresponding to each word may be added, so as to obtain the first vector representation corresponding to each word.
In the application, the accuracy of the subsequent model prediction can be improved by carrying out multiple kinds of coding on each word and obtaining the vector representation of each word based on the multiple kinds of vector representations corresponding to each word. In addition, the vector representation of each word is obtained by adding the plurality of kinds of vector representations corresponding to each word, and the number of dimensions of the vector representation can be reduced, thereby reducing the amount of calculation.
In the application, the role types comprise a user and a robot, when role coding is performed on each word, a target role type to which each word belongs can be determined from two role types of the user and the robot, vector transformation is performed on each word according to the target role type, namely, the role type to which each word belongs is coded, and role vector representation corresponding to each word is obtained.
For example, the role coding may be coded according to role types, where the machine role is 0 and the user role is 1.
In the application, the input types of the dialogue model can be divided into three types, namely role information, historical dialogue and reply sentences, so that when the input type coding is performed on each word in the training sample, the target input type to which each word belongs can be determined, and the vector transformation is performed on each word according to the target input type, namely the target input type to which each word belongs is coded, so that the input type vector corresponding to each word is obtained.
For example, historical dialog, reply, and character 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 performed on each word according to the position of each word in the training sample, that is, the position of each word is coded, so that position vector representation corresponding to each word is obtained.
In the position coding, a relative coding mode can be adopted, for example, the first recovery sentence can be coded from 0-127, and the other part is coded in a reverse order from 128. This way of encoding facilitates the expansion.
For ease of understanding, reference is now made to fig. 7, which is a schematic diagram illustrating an input of a dialog model in a training phase according to an embodiment of the present application.
As shown in FIG. 7, to distinguish different input slots, special separators BOS and EOS may be used, each starting at BOS and ending at EOS, which are also vector transformed when the training samples are vector transformed.
In fig. 7, the model input includes four parts of user role information, robot role information, historical dialogue and a first reply sentence, and the input words are respectively subjected to role encoding, input type encoding, position encoding and word encoding to obtain role vector representation, input type vector representation, position vector representation, word vector representation and the like.
During role coding, 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 represented as 1, the role vector corresponding to each word in the role information of the robot is represented as 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 represented as 0.
When the input type coding is performed, the dialog history, the first reply sentence and the character information are respectively set to 0,1,2, and the corresponding codes of the parts are as shown in fig. 7.
When the position coding is carried out, the first reply sentence part carries out the position coding from 0 to 127 according to the position of each word, and the rest part carries out the reverse coding on the conversation history to the user role information part from 128.
The above-described encoding methods 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, the accuracy of model prediction can be improved.
Step 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 sample can be spliced in sequence according to the positions of the words in the training sample to obtain the second vector representations corresponding to the training sample, so that the vector conversion of the training sample is realized.
Step 604, a second encoding vector representation is input into the dialogue initial model to obtain a second reply sentence.
In this application, the second vector representation corresponding to the training sample may be input into the dialogue model, and the dialogue model may perform encoding and decoding processing on the second vector representation, so as to obtain a second reply sentence output by the dialogue model.
Step 605, adjusting parameters of the initial dialogue model according to the difference between the second reply statement and the first reply statement to generate the dialogue model.
In the present application, step 605 is similar to the content described in the above embodiments, and therefore is not described herein again.
In the embodiment of the application, vector transformation is carried out on each word in a training sample to obtain a first vector representation corresponding to each word; obtaining a second vector representation corresponding to the training sample according to the second vector representation corresponding to each word; the second encoding vector representation is input into the dialogue initiation model to obtain a second reply sentence. Therefore, vector representation corresponding to the training sample is obtained by vector conversion of each word in the training sample, and the vector representation corresponding to the training sample is input into the dialogue model, so that processing is facilitated, and processing efficiency is improved.
In order to implement the foregoing embodiments, an apparatus for generating a dialog is also provided in the embodiments of the present application. Fig. 8 is a schematic structural diagram of a dialog generating device according to an embodiment of the present application.
As shown in fig. 8, the dialog generating device 800 includes:
a first obtaining module 810, configured to obtain a historical dialogue and a target dialogue between a user and a target robot, where the target dialogue is generated based on role information of the target robot;
a second obtaining module 820, configured to input the target dialog and the historical dialog into the dialog model to obtain a reply statement of the historical dialog output by the dialog model; wherein, the reply sentence is a sentence matched with the role information of the target robot.
In an implementation manner of the embodiment of the present 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 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 generating module is used for generating the target dialogue according to the target role attribute and the attribute value.
In an implementation manner of the embodiment of the present application, the generating module is configured to:
acquiring a corresponding relation between preset role attributes and question-answer sentences, wherein each pair of question-answer sentences in the corresponding relation is a group of conversations for describing the corresponding role attributes;
inquiring the corresponding relation according to the target role attribute so as to determine a target question-answer sentence corresponding to the target role attribute;
and generating a target dialogue according to the target question-answer sentence and the attribute value.
In an implementation manner of the embodiment of the present application, the target question-answering sentences are in 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 an implementation manner of the embodiment of the present application, the generating module is configured to:
matching the target role attribute with sentences in a preset sentence library to determine question sentences and statement sentences matched with the target role attribute from the sentence library;
and generating the target dialogue according to the question statement, the statement and the attribute value.
In an implementation manner of the embodiment of the present application, the second obtaining module is configured to:
splicing the target dialog before the historical dialog to obtain the target dialog and the dialog spliced by the historical dialog;
and inputting the spliced conversation into a conversation model to obtain reply sentences of the historical conversations.
It should be noted that the explanation of the foregoing embodiment of the dialog generating method is also applicable to the dialog generating device of this embodiment, and therefore, the explanation is not repeated here.
In the embodiment of the application, the target dialogue generated based on the role information of the target robot and the historical 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 obtained. Therefore, for different robot role information, the reply sentence which is output by the dialogue model and is matched with the role information of the target robot can be obtained by taking the target dialogue generated based on the role information of the robot as the input of the dialogue model, so that the robots with different set role information can be obtained, and the cost is reduced.
In order to implement the above embodiments, an apparatus for training a dialog model is also provided in the embodiments of the present application. Fig. 9 is a schematic structural diagram of a dialogue model training apparatus 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 historical dialog between the user and the robot, and a first reply statement;
a second obtaining module 920, configured to input the training sample to the initial dialog model to obtain a second reply statement of the historical dialog output by the initial dialog model;
an adjusting module 930, configured to adjust parameters of the initial dialogue model according to a difference between the second reply statement and the first reply statement, so as to obtain the dialogue model.
In an implementation manner of this 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 a second vector representation corresponding to the training sample according to the second vector representation corresponding to each word;
and the acquisition unit is used for inputting the second coding vector representation into the conversation initial model so as to acquire a second reply statement.
In an implementation manner of the embodiment of the present application, the vector conversion unit is configured to:
performing at least one of role coding, input type coding and position coding and word coding on each word in the training sample to obtain at least one of role vector representation, input type vector representation and position vector representation and word vector representation corresponding to each word;
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 an 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 to the word vector representation to obtain a first vector representation.
In an implementation manner of the embodiment of the present application, the vector conversion unit is configured to:
determining the target role type of each word;
and according to the target role type, vectorizing each word to obtain the role vector representation corresponding to each word.
In an 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 according to the target input type, vectorizing each word to obtain the input type vector representation corresponding to each word.
It should be noted that the explanation of the embodiment of the dialog model training method is also applicable to the dialog model training apparatus of this embodiment, and therefore, the explanation is not repeated herein.
In the embodiment of the application, 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 the learning of the role information by the dialogue model can be enhanced, the reply sentences can be predicted by utilizing the dialogue model according to the role information of different robots, the reply sentences matched with the role information of the robot can be obtained, the accuracy of the reply sentences can be improved, the robots with different role information can be customized, and the cost is low.
According to embodiments of the present application, an electronic device, a readable storage medium, and a computer program product are also provided.
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 phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application that are described and/or claimed herein.
As shown in fig. 10, the device 1000 includes a computing unit 1001 that can perform various appropriate actions and processes in accordance with 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 necessary for the operation of the device 1000 can also be stored. The calculation 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 the bus 1004.
A number of 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 a communication unit 1009 such as a network card, a modem, a wireless communication transceiver, or the like. The communication unit 1009 allows the device 1000 to exchange information/data with other devices through a computer network such as the internet and/or various telecommunication networks.
Computing unit 1001 may be a variety of general and/or special purpose processing components with processing and computing capabilities. Some examples of the computing Unit 1001 include, but are not limited to, a CPU (Central Processing Unit), a GPU (graphics Processing Unit), various dedicated AI (Artificial Intelligence) computing chips, various computing Units running machine learning model algorithms, a DSP (Digital Signal Processor), and any suitable Processor, controller, microcontroller, and the like. The calculation unit 1001 executes the respective methods and processes described above, such as the dialogue generation method. For example, in some embodiments, the dialog generation method may be implemented as a computer software program tangibly embodied in 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 communications unit 1009. When the computer program is loaded into the RAM 1003 and executed by the 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 realized in digital electronic circuitry, integrated circuitry, FPGAs (Field Programmable Gate arrays), ASICs (Application-Specific Integrated circuits), ASSPs (Application Specific Standard products), SOCs (System On Chip, system On a Chip), CPLDs (Complex Programmable Logic devices), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present application may be written in any combination of one or more programming languages. These program codes 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 codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. 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. A 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, a RAM, a ROM, an EPROM (Electrically 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., a CRT (Cathode Ray Tube) or LCD (Liquid Crystal Display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a 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 can 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, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end 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 back-end, 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), internet, and blockchain Network.
The computer system may include clients and servers. A client and server are generally 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 may be a cloud Server, which is also called a cloud computing Server or a cloud host, and is a host product in a cloud computing service system, so as to solve the defects of high management difficulty and weak service expansibility in a conventional physical host and a VPS (Virtual Private Server). The server may also be a server of a distributed system, or a server incorporating a blockchain.
It should be noted that the block diagram of the electronic device for implementing the dialog 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, and therefore is not described herein again.
According to an embodiment of the present application, there is also provided a computer program product, which when executed by an instruction processor in the computer program product, performs a dialog generation method or a dialog model training method proposed in the above-mentioned embodiment of the present application.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present application can be achieved, and the present invention is not limited herein.
The above-described embodiments should not be construed as limiting the scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (27)

1. A dialog generation method comprising:
acquiring historical conversations and target conversations between a user and a target robot, wherein the target conversations are generated based on role information of the target robot;
inputting the target dialogue and the historical dialogue into a dialogue model to obtain a reply sentence of the historical dialogue output by the dialogue model; wherein the reply sentence is a sentence matched with the role information of the target robot.
2. The method of claim 1, wherein prior to said obtaining a target conversation, 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.
3. The method of claim 2, wherein said generating the target dialog based on the target character attributes and the attribute values comprises:
acquiring a corresponding relation between preset role attributes and question-answer sentences, wherein each pair of question-answer sentences in the corresponding relation is a group of conversations for describing the corresponding role attributes;
inquiring the corresponding relation according to the target role attribute so as to determine a target question-answer sentence corresponding to the target role attribute;
and generating the target dialogue according to the target question-answering sentence and the attribute value.
4. The method of claim 3, wherein the target question-answer sentences are in a plurality of pairs, and the generating the target dialog according to the target question-answer sentences and the attribute values comprises:
splicing a plurality of pairs of target question-answering sentences to obtain spliced question-answering 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.
5. The method of claim 2, wherein said generating the target dialog based on the target character attributes and the attribute values comprises:
matching the target role attributes with statements in a preset statement library to determine question statements and statement statements matched with the target role attributes from the statement library;
and generating the target dialog according to the question statement, the statement and the attribute value.
6. The method of claim 1, wherein the inputting the target dialog and the historical dialog into a dialog model to obtain a reply statement for the historical dialog output by the dialog model comprises:
splicing the target dialog before the historical dialog to obtain the target dialog and the dialog spliced by the historical dialog;
and inputting the spliced conversation into a conversation model to obtain a reply sentence of the historical conversation.
7. A dialogue model training method, comprising:
acquiring a training sample, wherein the training sample comprises role information of a robot, role information of a user, historical conversation between the user and the robot and a first recovery statement;
inputting the training sample into an initial dialogue model to obtain a second reply sentence of the historical dialogue output by the initial dialogue model;
and adjusting parameters of the initial dialogue model according to the difference between the second reply statement and the first reply statement to obtain the dialogue model.
8. The method of claim 7, wherein the inputting the training sample to an initial dialogue model to obtain a second reply sentence of the historical dialogue output by the initial dialogue model comprises:
carrying out vector transformation on each word in the training sample to obtain a first vector representation corresponding to each word;
determining a second vector representation corresponding to the training sample according to the second vector representation corresponding to each word;
inputting the second encoding vector representation into the dialog initiation model to obtain the second reply statement.
9. The method of claim 8, wherein the vector converting each word in the training sample to obtain a first vector representation corresponding to each word comprises:
performing at least one of role coding, input type coding and position coding and word coding on each word in the training sample to obtain at least one of role vector representation, input type vector representation and position vector representation and word vector representation corresponding to each word;
and obtaining a first vector representation corresponding to each word according to at least one of the role vector representation, the input type vector representation and the position vector representation and the word vector representation.
10. The method of claim 9, wherein the deriving a first vector representation corresponding to each word from the word vector representation and at least one of the character vector representation, the input type vector representation, and the location vector representation comprises:
adding at least one of the character vector representation, the input type vector representation, and the location vector representation to the word vector representation to obtain the first vector representation.
11. The method of claim 9, wherein said role coding each word in the training sample comprises:
determining the target role type of each word;
and according to the target role type, vectorizing each word to obtain a role vector representation corresponding to each word.
12. The method of claim 9, wherein said input type encoding each word in the training sample comprises:
determining a target input type to which each word belongs;
and according to the target input type, vectorizing each word to obtain an input type vector representation corresponding to each word.
13. A dialog generation device comprising:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring historical conversations and target conversations between a user and a target robot, and the target conversations are generated based on role information of the target robot;
the second acquisition module is used for inputting the target conversation and the historical conversation into a conversation model so as to acquire a reply sentence of the historical conversation output by the conversation model; wherein the reply sentence is a sentence matched with the role information of the target robot.
14. The apparatus of claim 13, further comprising:
the third acquisition module is used for acquiring 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 generating module is used for generating the target dialogue according to the target role attribute and the attribute value.
15. The apparatus of claim 14, wherein the means for generating is configured to:
acquiring a corresponding relation between preset role attributes and question-answer sentences, wherein each pair of question-answer sentences in the corresponding relation is a group of conversations for describing the corresponding role attributes;
inquiring the corresponding relation according to the target role attribute so as to determine a target question-answer sentence corresponding to the target role attribute;
and generating the target dialogue according to the target question-answering sentence and the attribute value.
16. The apparatus of claim 15, wherein the target question-answering sentence is a plurality of pairs, and the generating module is configured to:
splicing a plurality of pairs of target question-answering sentences to obtain spliced question-answering 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.
17. The apparatus of claim 14, wherein the means for generating is configured to:
matching the target role attribute with sentences in a preset sentence library to determine question sentences and statement sentences matched with the target role attribute from the sentence library;
and generating the target dialog according to the question statement, the statement and the attribute value.
18. The apparatus of claim 13, wherein the second obtaining means is configured to:
splicing the target dialog before the historical dialog to obtain the target dialog and the dialog spliced by the historical dialog;
and inputting the spliced conversation into a conversation model to obtain a reply sentence of the historical conversation.
19. A dialogue model training apparatus comprising:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring training samples, and the training samples comprise role information of a robot, role information of a user, historical conversation between the user and the robot and a first reply sentence;
the second acquisition module is used for inputting the training sample into an initial dialogue model to acquire a second reply statement of the historical dialogue output by the initial dialogue model;
and the adjusting module is used for adjusting the parameters of the initial dialogue model according to the difference between the second reply statement and the first reply statement to obtain the dialogue model.
20. The apparatus of claim 19, wherein the second obtaining means comprises:
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;
a determining unit, configured to determine, according to the second vector representation corresponding to each word, a second vector representation corresponding to the training sample;
an obtaining unit, configured to input the second encoding vector representation into the dialog initial model to obtain the second reply statement.
21. The apparatus of claim 20, wherein the vector translation unit is to:
performing at least one of role coding, input type coding and position coding and word coding on each word in the training sample to obtain at least one of role vector representation, input type vector representation and position vector representation and word vector representation corresponding to each word;
and obtaining a first vector representation corresponding to each word according to at least one of the role vector representation, the input type vector representation and the position vector representation and the word vector representation.
22. The apparatus of claim 21, wherein the vector translation unit is to:
adding at least one of the character vector representation, the input type vector representation, and the location vector representation to the word vector representation to obtain the first vector representation.
23. The apparatus of claim 21, wherein the vector translation unit is to:
determining the target role type of each word;
and according to the target role type, vectorizing each word to obtain a role vector representation corresponding to each word.
24. The apparatus of claim 21, wherein the vector translation unit is to:
determining a target input type to which each word belongs;
and according to the target input type, vectorizing each word to obtain an input type vector representation corresponding to each word.
25. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
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-6 or to perform the method of any one of claims 7-12.
26. A non-transitory computer readable storage medium having stored thereon computer instructions for causing a computer to perform the method of any one of claims 1-6 or the method of any one of claims 7-12.
27. A computer program product comprising a computer program which, when executed by a processor, carries out the steps of the method of any one of claims 1 to 6 or carries out the steps of the method of any one of claims 7 to 12.
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 true CN115309877A (en) 2022-11-08
CN115309877B 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)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115545002A (en) * 2022-11-29 2022-12-30 支付宝(杭州)信息技术有限公司 Method, device, storage medium and equipment for model training and business processing
CN115952274A (en) * 2023-03-10 2023-04-11 北京百度网讯科技有限公司 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
CN117251552A (en) * 2023-11-13 2023-12-19 腾讯科技(深圳)有限公司 Dialogue processing method and device based on large language model and electronic equipment

Citations (11)

* 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
CN104462024A (en) * 2014-10-29 2015-03-25 百度在线网络技术(北京)有限公司 Method and device for generating dialogue action strategy model
CN106297789A (en) * 2016-08-19 2017-01-04 北京光年无限科技有限公司 The personalized interaction method of intelligent robot and interactive system
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
US20210141799A1 (en) * 2019-11-08 2021-05-13 PolyAI Limited Dialogue system, a method of obtaining a response from a dialogue system, and a method of training a dialogue system
CN113505198A (en) * 2021-07-09 2021-10-15 和美(深圳)信息技术股份有限公司 Keyword-driven generating type dialogue reply method and device and electronic equipment
US20220083742A1 (en) * 2020-09-15 2022-03-17 Boe Technology Group Co., Ltd. Man-machine dialogue method and system, computer device and medium
CN114626384A (en) * 2022-03-01 2022-06-14 京东科技信息技术有限公司 Dialogue processing method, question rewriting model training method and device

Patent Citations (11)

* 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
CN104462024A (en) * 2014-10-29 2015-03-25 百度在线网络技术(北京)有限公司 Method and device for generating dialogue action strategy model
CN106297789A (en) * 2016-08-19 2017-01-04 北京光年无限科技有限公司 The personalized interaction method of intelligent robot and interactive system
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
US20210141799A1 (en) * 2019-11-08 2021-05-13 PolyAI Limited Dialogue system, a method of obtaining a response from a dialogue system, and a method of training a dialogue system
US20220083742A1 (en) * 2020-09-15 2022-03-17 Boe Technology Group Co., Ltd. Man-machine dialogue method and system, computer device and medium
CN113505198A (en) * 2021-07-09 2021-10-15 和美(深圳)信息技术股份有限公司 Keyword-driven generating type dialogue reply method and device and electronic equipment
CN114626384A (en) * 2022-03-01 2022-06-14 京东科技信息技术有限公司 Dialogue processing method, question rewriting model training method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
YANXIANG LING 等: "DORA: Towards policy optimization for task-oriented dialogue system with efficient context", pages 1 - 20 *
郭宇 等: "PCC:一个对单用户建模的个性化对话系统", pages 112 - 121 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115545002A (en) * 2022-11-29 2022-12-30 支付宝(杭州)信息技术有限公司 Method, device, storage medium and equipment for model training and business processing
CN115545002B (en) * 2022-11-29 2023-03-31 支付宝(杭州)信息技术有限公司 Model training and business processing method, device, storage medium and equipment
CN115952274A (en) * 2023-03-10 2023-04-11 北京百度网讯科技有限公司 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
CN117251552A (en) * 2023-11-13 2023-12-19 腾讯科技(深圳)有限公司 Dialogue processing method and device based on large language model and electronic equipment
CN117251552B (en) * 2023-11-13 2024-02-27 腾讯科技(深圳)有限公司 Dialogue processing method and device based on large language model and electronic equipment

Also Published As

Publication number Publication date
CN115309877B (en) 2023-05-30

Similar Documents

Publication Publication Date Title
CN112487173B (en) Man-machine conversation method, device and storage medium
CN115309877B (en) Dialogue generation method, dialogue model training method and device
CN112507706B (en) Training method and device for knowledge pre-training model and electronic equipment
EP4113357A1 (en) Method and apparatus for recognizing entity, electronic device and storage medium
CN113450759A (en) Voice generation method, device, electronic equipment and storage medium
CN114416943B (en) Training method and device for dialogue model, electronic equipment and storage medium
CN112580339B (en) Model training method and device, electronic equipment and storage medium
CN114548110A (en) Semantic understanding method and device, electronic equipment and storage medium
CN112100353A (en) Man-machine conversation method and system, computer device and medium
CN117033582A (en) Training method and device for dialogue model, electronic equipment and storage medium
CN113553412A (en) Question and answer processing method and device, electronic equipment and storage medium
CN113360001A (en) Input text processing method and device, electronic equipment and storage medium
CN115062718A (en) Language model training method and device, electronic equipment and storage medium
CN112910761B (en) Instant messaging method, device, equipment, storage medium and program product
CN113468857A (en) Method and device for training style conversion model, electronic equipment and storage medium
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
CN114970666B (en) Spoken language processing method and device, electronic equipment and storage medium
CN114758649B (en) Voice recognition method, device, equipment and medium
CN115565186A (en) Method and device for training character recognition model, electronic equipment and storage medium
CN115292467A (en) Information processing and model training method, apparatus, device, medium, and program product
CN114416941A (en) Generation method and device of dialogue knowledge point determination model fusing knowledge graph
CN114490967A (en) Training method of dialogue model, dialogue method and device of dialogue robot and electronic equipment
CN113553413A (en) Dialog state generation method and device, electronic equipment and storage medium
CN114118937A (en) Information recommendation method and device based on task, electronic equipment and storage medium

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