CN112949758A - Response model training method, response method, device, equipment and storage medium - Google Patents

Response model training method, response method, device, equipment and storage medium Download PDF

Info

Publication number
CN112949758A
CN112949758A CN202110341702.6A CN202110341702A CN112949758A CN 112949758 A CN112949758 A CN 112949758A CN 202110341702 A CN202110341702 A CN 202110341702A CN 112949758 A CN112949758 A CN 112949758A
Authority
CN
China
Prior art keywords
entity
response model
intention
training
sample
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.)
Pending
Application number
CN202110341702.6A
Other languages
Chinese (zh)
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.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
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 China Construction Bank Corp filed Critical China Construction Bank Corp
Priority to CN202110341702.6A priority Critical patent/CN112949758A/en
Publication of CN112949758A publication Critical patent/CN112949758A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • 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/36Creation of semantic tools, e.g. ontology or thesauri
    • G06F16/367Ontology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • G06F40/35Discourse or dialogue representation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computing Systems (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Molecular Biology (AREA)
  • Evolutionary Biology (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Animal Behavior & Ethology (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention relates to the technical field of artificial intelligence, and discloses a training method, a response method, a device, equipment and a storage medium of a response model, wherein the training method of the response model comprises the following steps: constructing an intention training sample based on entity information extracted from the knowledge graph; constructing a question-answer training sample based on a pre-training model; constructing a response model training sample according to the intention training sample and the question-answer training sample; and training a pre-constructed response model by using the response model training sample to obtain a trained response model. According to the method provided by the embodiment of the invention, the training corpus is automatically generated according to the knowledge map extraction result, the session design and the session construction of the end-to-end response model are completed, the rule and the deep learning are combined and applied, the similarity between the generated response model training sample and the real question-answer data is improved, the generalization capability of the generated text is improved to a certain extent, and the universality of the response model is further improved.

Description

Response model training method, response method, device, equipment and storage medium
Technical Field
The embodiment of the invention relates to the field of artificial intelligence, in particular to a training method, a response method, a device, equipment and a storage medium of a response model.
Background
Intelligent operation and maintenance (AIOps) combines the capability of Artificial Intelligence with operation and maintenance, and improves the operation and maintenance efficiency by a machine learning method. AIops claims that rules are continuously learned, continuously refined and summarized by machine learning algorithms automatically from massive operations and maintenance data, including the events themselves and the manual processing logs of the operations and maintenance personnel. On the basis of automatic operation and maintenance, the AIOps is additionally provided with a brain based on machine learning, instructs a monitoring system to acquire data required by brain decision making, makes analysis and decision and instructs an automatic script to execute the brain decision making, so that the overall goal of the operation and maintenance system is achieved. In summary, the automation operation and maintenance level is an important basic stone of AIOps, and the AIOps well combine the AI and the operation and maintenance based on the automation operation and maintenance, but the current AIOps still have the defect of operation and maintenance knowledge migration in different scenes, and for a new scene, new data often needs to be reconstructed from zero, and extra repeated labor force is needed, which is time-consuming and labor-consuming.
Disclosure of Invention
The embodiment of the invention provides a training method, a response method, a device, equipment and a storage medium of a response model, and aims to improve the universality of intelligent operation and maintenance.
In a first aspect, an embodiment of the present invention provides a method for training a response model, where the method includes:
constructing an intention training sample based on entity information extracted from the knowledge graph;
constructing a question-answer training sample based on a pre-training model;
constructing a response model training sample according to the intention training sample and the question-answer training sample;
and training the pre-constructed response model by using the response model training sample to obtain the trained response model.
In a second aspect, an embodiment of the present invention further provides a response method, including:
acquiring information to be responded;
inputting information to be responded into a response model trained in advance to obtain an output result of the response model, wherein the response model is obtained by training through a training method of the response model provided by any embodiment of the invention;
and determining and outputting response information according to the output result.
In a third aspect, an embodiment of the present invention further provides a device for training a response model, including:
the intention sample construction module is used for constructing an intention training sample based on the entity information extracted by the knowledge graph;
the question-answer sample construction module is used for constructing question-answer training samples based on a pre-training model;
the training sample construction module is used for constructing a response model training sample according to the intention training sample and the question-answer training sample;
and the response model training module is used for training a pre-constructed response model by using the response model training sample to obtain a trained response model.
In a fourth aspect, an embodiment of the present invention provides a response apparatus, including:
the information to be responded acquiring module is used for acquiring information to be responded;
the response model prediction module is used for inputting the information to be responded into a response model which is trained in advance to obtain an output result of the response model, wherein the response model is obtained by training through the training method of the response model provided by any embodiment of the invention;
and the response information output module is used for determining and outputting the response information according to the output result.
In a fifth aspect, an embodiment of the present invention provides a computer device, where the computer device includes:
one or more processors;
storage means for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method for training a response model as provided by the first aspect of the embodiment of the present invention, and/or to implement the method for responding as provided by the second aspect of the embodiment of the present invention.
In a sixth aspect, embodiments of the present invention further provide a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements a method for training a response model according to the first aspect of any of the embodiments of the present invention, and/or implements a response method according to the second aspect of the embodiments of the present invention.
The method for training the response model provided by the embodiment of the invention constructs an intention training sample through entity information extracted based on the knowledge graph; constructing a question-answer training sample based on a pre-training model; constructing a response model training sample according to the intention training sample and the question-answer training sample; the method comprises the steps of training a pre-constructed response model by using a response model training sample to obtain a trained response model, automatically generating a training corpus according to a knowledge map extraction result, completing session design and session construction of an end-to-end response model, improving the similarity between the generated response model training sample and real question and answer data by combining rules and deep learning, improving the generalization capability of a generated text to a certain extent and further improving the universality of the response model.
Drawings
Fig. 1 is a schematic flow chart of a method for training a response model according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a method for training a response model according to a second embodiment of the present invention;
fig. 3 is a schematic flowchart of a method for training a response model according to a third embodiment of the present invention;
fig. 4 is a schematic flow chart of a response method according to a fourth embodiment of the present invention;
fig. 5 is a schematic diagram illustrating training and application of an operation and maintenance robot according to a fifth embodiment of the present invention;
fig. 6 is a schematic structural diagram of a training apparatus for a response model according to a sixth embodiment of the present invention;
fig. 7 is a schematic structural diagram of a transponder according to a seventh embodiment of the present invention;
fig. 8 is a schematic structural diagram of a computer device according to an eighth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a schematic flowchart of a method for training a response model according to an embodiment of the present invention. The embodiment can be applied to the situation when the response model is trained, and is particularly suitable for the situation when the response module in the operation and maintenance robot is trained. The method may be performed by a training device of the response model, which may be implemented in software and/or hardware, for example, which may be configured in a computer device. As shown in fig. 1, the method includes:
and S110, constructing an intention training sample based on the entity information extracted by the knowledge graph.
In the embodiment, the problem of migration of operation and maintenance knowledge is considered, the technical problem that a new scene, new data and intelligent operation and maintenance need to be built from zero again is avoided, training corpora are automatically generated according to the knowledge graph extraction result, and end-to-end session design and session building are completed. For natural language understanding training corpora, rules and deep learning are combined and applied together in an end-to-end design idea, so that the similarity of generated training data and real robot question and answer data is improved, and the generalization capability of generated texts is improved to a certain extent.
The knowledge graph can be determined according to the application scene of intelligent operation and maintenance. For example, assuming that the intelligent operation and maintenance is used for business transaction, the knowledge graph may be a knowledge graph composed of enterprises, individuals, accounts, and the like; assuming intelligent operation and maintenance is used for system maintenance, the knowledge graph can be a knowledge graph formed by hardware, components and the like in the system. It can be understood that the knowledge graph may be constructed according to the acquired source data, or the constructed knowledge graph may be directly acquired, which is not limited herein. The construction method of the knowledge graph can refer to the construction method of the knowledge graph in the prior art, and is not described herein in detail.
In one embodiment of the present invention, constructing an intention training sample based on entities and entity attributes extracted from a knowledge graph includes: extracting entity information in the knowledge graph, wherein the entity information comprises entities, entity attributes and relationships among the entities; and constructing an intention training sample according to a preset intention question template and entity information. Optionally, the entity attributes of the entities and the relationships between the entities in the knowledge graph may be extracted first, the entity attributes of the entities and the relationships between the entities are used as known parameters, and an intention training sample is constructed by combining a preset intention problem template. Illustratively, the entity table entity can be constructed by extracting the entity according to the knowledge graph1For each kind of entity, extracting its attribute and constructing attribute table attribute1Extracting all relations according to the knowledge graph and constructing a relation table relation1
Optionally, the constructing an intention training sample according to a preset intention problem template and entity information includes: according to the queryi=∏entityi(∑attributei+∑relationi) Constructing an intention training sample, wherein queryiEntity to train samples for intentiAs an entity, attributeiFor entity attributes, relationshipsiIs a relationship between entities. Illustratively, the intention question template is set to be quested ∑ queryiOf quetion, among othersiFor the ith intention question template, finally generating intention training samplesIs the union of all the intention training samples, and the query is specific to each intention training sampleiCyclically sampling entity entries in an entity tableiSelectively sampling attribute in attribute tableiAnd relation in the relational tableiGenerating a complete question, specifically: quetion oni∏entityi(∑attributei+∑relationi). The intention training sample constructed based on the method covers various intentions, so that the response model trained based on the intention training sample has universality.
And S120, constructing a question-answer training sample based on the pre-training model.
In this embodiment, a question-and-answer training sample may be constructed by using a plurality of pre-training models.
Illustratively, a problem question is generated by combining a pre-training model UniLM, and compared with a generation model based on a language model, BERT cannot meet the requirements of the language model due to bidirectional decoding, but the decoding direction is manually controlled through Mask attribute, and the bidirectional decoding is changed into unidirectional:
p(x1,x2,x3,…,xn)=p(x1)p(x2|x1)p(x3|x1,x2)…p(xn|x1,x2,…,xn-1)
=p(x3)p(x1|x3)p(x2|x3,x1)…p(xn|x3,x1,…,xn-1)…p(xn-1)
=…
=p(x1|xn-1)p(xn|xn-1,x1)…p(x2|xn-1,x1,…,x3)
any "presentation sequence" of x1, x2, …, xn is possible. In principle, each order corresponds to a model, so that in principle there are n! A language model. Implementing a sequential language model amounts to scrambling the original Mask in its lower triangular form in some way. As the Attention mechanism Attention provides an n multiplied by n Attention matrix, enough freedom degrees can be provided to remove the Mask matrix in different modes, thereby realizing the diversified effect and constructing diversified question-answer training samples.
And S130, constructing a response model training sample according to the intention training sample and the question-answer training sample.
In this embodiment, the intention training sample constructed based on the knowledge graph and the question-answer training sample constructed based on the pre-training model are used as the response model training sample together, and the response model training sample is obtained based on the intention training sample with universality and diversified question-answer training samples, so that the response model trained based on the response model training sample has strong universality.
And S140, training the pre-constructed response model by using the response model training sample to obtain the trained response model.
And after the response model training sample is obtained, training a pre-constructed response model by using the response model training sample to obtain the trained response model. The structure and construction of the response model are not limited herein.
In this embodiment, the answer model may be trained in a model training manner in the prior art, and may also be adjusted based on the existing model training manner based on the structure of the answer model to train the answer model.
Illustratively, a response model training sample is input into the response model to obtain a prediction result of the response model, and when a loss value between the prediction result and the label reaches a set threshold value or the number of iterations reaches a set threshold number of iterations, the model is judged to be converged to obtain the trained response model.
The method for training the response model provided by the embodiment of the invention constructs an intention training sample through entity information extracted based on the knowledge graph; constructing a question-answer training sample based on a pre-training model; constructing a response model training sample according to the intention training sample and the question-answer training sample; the method comprises the steps of training a pre-constructed response model by using a response model training sample to obtain a trained response model, automatically generating a training corpus according to a knowledge map extraction result, completing session design and session construction of an end-to-end response model, improving the similarity between the generated response model training sample and real question and answer data by combining rules and deep learning, improving the generalization capability of a generated text to a certain extent and further improving the universality of the response model.
On the basis of the scheme, the method further comprises the following steps: and setting the associated slot position of the intention corresponding to the intention of the intention training sample according to the number of the entity labels in the intention training sample. Taking a task type chat robot system as an example, a conversation with a user generally involves multiple rounds of conversation actions and can be finished with a complete conversation process, and considering that part of the conversation processes are not well controlled for the purpose of filling a slot, and different graph relationships can share the same slot filling action with different purposes, the embodiment of the invention adopts the technical idea of presetting slot positions. The accuracy of the whole session system is improved. In particular, the setting of the associated slot for a certain intent type may be set based on the number of entity tags of that intent type in the intent training sample. Assuming that the intention is to purchase movie tickets, their associated slots may be "time", "theater name", "movie name", "seat position", and "number", and only the entity that specifies the associated slot can specify what movie tickets need to be purchased.
Example two
Fig. 2 is a schematic flow chart of a method for training a response model according to a second embodiment of the present invention. On the basis of the above embodiments, the present embodiment optimizes training of a pre-constructed response model by using response model training samples. As shown in fig. 2, the method includes:
and S210, constructing an intention training sample based on the entity information extracted by the knowledge graph.
S220, constructing a question-answer training sample based on the pre-training model.
And S230, constructing a response model training sample according to the intention training sample and the question-answer training sample.
And S240, inputting the response model training sample into the feature extraction module to obtain the initial features of the sample output by the feature extraction module.
In this embodiment, the response model includes a feature extraction module, an intent recognition module, and an entity extraction module. Generally, a strong association relationship exists between entity extraction and intent recognition, and considering that the entity extraction and the intent recognition have a strong correlation, for example, for an intent of data feedback of a low-peak scene, a slot of the intent is a fixed finite set, so for entity extraction in natural language understanding, a part of prior constraints can be applied, for example, intent recognition is performed first, and then entity extraction is performed. That is, embodiments of the present invention build a natural language understanding module by training entity extraction in conjunction with intent recognition.
Before intention identification and entity extraction are carried out on the response model training samples, data features of the response model training samples, namely initial features of the samples, need to be extracted. Specifically, a feature extraction module may be used to extract sample initial features of the response model training samples. The specific implementation of the feature extraction module may refer to the implementation of the feature extraction module in the prior art, and illustratively, a Bidirectional Long short term Memory network (BLSTM) may be used as the feature extraction module to extract the sample initial features of the response model training sample. It is understood that the sample initial features may be presented in a matrix form.
And S250, inputting the initial sample features into an intention identification module to obtain the intention sample features output by the intention identification module.
And S260, inputting the response model training sample and the sample intention characteristics into the entity extraction module to obtain sample entity characteristics output by the entity extraction module.
After the initial characteristics of the sample are obtained, inputting the initial characteristics of the sample into an intention identification module, and enabling the intention identification module to carry out intention identification on the initial characteristics of the sample to obtain the intention characteristics of the sample; and then, taking the sample intention characteristics as one of parameters of entity extraction, and taking the response model training sample as the input of an entity extraction module, so that the entity extraction module performs entity extraction to obtain sample entity characteristics.
S270, determining an intention loss value according to the sample intention characteristics and the intention labels, determining an entity loss value according to the sample entity characteristics and the entity labels, and determining a target loss value according to the intention loss value and the entity loss value.
It is understood that, in the present embodiment, a linkage training mode of intent recognition and entity extraction is adopted, and therefore the target loss value includes an intent loss value and an entity loss value. Specifically, an intent loss value is determined according to the sample intent feature and the intent tag, an entity loss value is determined according to the sample entity feature and the entity tag, and a target loss value is determined according to the intent loss value and the entity loss value. Wherein determining the target loss value according to the intent loss value and the entity loss value may be: the characteristic values of the intent loss value and the entity loss value are taken as target loss values. The characteristic values of the intention loss value and the entity loss value may be a mean value, a variance, a sum, and other characteristic values of the intention loss value and the entity loss value, and are not limited herein.
In one embodiment, determining a target loss value from the intent loss value and the entity loss value comprises: and weighting and summing the intention loss value and the entity loss value to obtain a target loss value. Alternatively, a weighted sum of the intention loss value and the entity loss value may be directly used as the target loss value, wherein the weights of the intention loss value and the entity loss value may be set in advance according to the actual demand. If the intention identification is emphasized, a larger weight can be set for the intention loss value, and a smaller weight can be set for the entity loss value; if the entity extraction is emphasized, a smaller weight can be set for the intention loss value, and a larger weight can be set for the entity loss value; without emphasis, the same weight may be set for the intended loss value and the physical loss value, such as both being set to 0.5 or both being set to 1.
And S280, training the response model by taking the goal of reaching the convergence condition by the goal loss value as a goal, and obtaining the trained response model.
Optionally, the question-answer model is trained with the goal that the target loss value reaches the convergence condition, so as to obtain the trained question-answer model. The target loss value meeting the convergence condition may be that a difference between two adjacent target loss values is smaller than a set threshold, or the number of iterations reaches a set target number of iterations.
On the basis of the embodiment, the embodiment of the invention optimizes the training of the pre-constructed response model by using the response model training sample, trains the pre-constructed response model by using the response model training sample through embodying the response model into a feature extraction module, an intention recognition module and an entity extraction module, and obtains the trained response model by embodying the following steps: inputting the response model training sample into the feature extraction module to obtain a sample initial feature output by the feature extraction module; inputting the sample initial features into the intention identification module to obtain sample intention features output by the intention identification module; inputting the response model training sample and the sample intention characteristics into the entity extraction module to obtain sample entity characteristics output by the entity extraction module; determining an intent loss value from the sample intent feature and the intent tag, determining an entity loss value from the sample entity feature and the entity tag, and determining a target loss value from the intent loss value and the entity loss value; the response model is trained with the goal that the target loss value reaches the convergence condition, the linkage training of intention identification and entity extraction is realized, the strong dependence relationship between the entity extraction and the intention identification is fully considered, the model obtained by final training can be ensured to simultaneously consider the intention identification and the entity extraction, and the entity extraction is more accurate.
EXAMPLE III
Fig. 3 is a schematic flowchart of a method for training a response model according to a third embodiment of the present invention. On the basis of the above embodiments, the present embodiment optimizes training of a pre-constructed response model by using response model training samples. As shown in fig. 3, the method includes:
and S310, constructing an intention training sample based on the entity information extracted by the knowledge graph.
And S320, constructing a question-answer training sample based on the pre-training model.
And S330, constructing a response model training sample according to the intention training sample and the question-answer training sample.
And S340, inputting the response model training sample into the feature extraction module to obtain the initial features of the sample output by the feature extraction module.
And S350, inputting the initial sample features into the intention identification module to obtain the intention sample features output by the intention identification module.
And S360, inputting the sample intention characteristics into the attention model to obtain the attention result output by the attention model.
In this embodiment, on the basis of the above embodiment, an attention module is added to the response model, and specifically, the response model further includes an attention module, and the intention identifying module, the attention module, and the entity extracting module are sequentially connected. Correspondingly, the sample intention characteristics are processed by the attention model and then input into the entity extraction module for entity extraction.
By introducing an attention mechanism between the intention identification module and the intention extraction module, namely adding the attention module between the intention identification module and the intention extraction module, the relation constraint between the entity extraction and the intention identification is further enhanced, so that the entity extraction is more accurate.
And S370, inputting the response model training sample and the attention result into the entity extraction module to obtain the sample entity characteristics output by the entity extraction module.
And S380, determining an intention loss value according to the sample intention characteristics and the intention label, determining an entity loss value according to the sample entity characteristics and the entity label, and determining a target loss value according to the intention loss value and the entity loss value.
And S390, training the response model by taking the goal loss value reaching the convergence condition as a goal, and obtaining the trained response model.
On the basis of the embodiment, the embodiment of the invention uses the response model training sample to train the pre-constructed response model, and adds the attention module between the intention identification module and the entity extraction module, thereby further enhancing the relation constraint between the entity extraction and the intention identification and enabling the entity extraction to be more accurate.
Example four
Fig. 4 is a flowchart illustrating a response method according to a fourth embodiment of the present invention. The embodiment can be applied to the situation during intelligent response, and is particularly suitable for the situation during intelligent response in an operation and maintenance scene. The method may be performed by a answering device, which may be implemented in software and/or hardware, for example, which may be configured in a computer device. As shown in fig. 4, the method includes:
and S410, acquiring the information to be responded.
In this embodiment, the information to be responded may be information input by the user through voice or text. If the user inputs 'i want to buy movie tickets' through voice, the 'i want to buy movie tickets' is taken as the information to be responded.
And S420, inputting the information to be responded into a response model trained in advance, and obtaining an output result of the response model.
In this embodiment, the response model obtained by training using the training method of the response model provided in the above embodiment is used for response. Specifically, the information to be responded is input into a response model trained in advance, and an output result of the response model is obtained. The output result may be a processing result of the information to be responded. Taking the information to be responded as 'i want to buy the movie ticket' as an example, the output result can be the specific information of the movie ticket; taking the information to be responded as the "current memory occupation ratio" as an example, the output result may be a specific numerical value of the current memory occupation ratio.
In one embodiment of the present invention, the response model includes an intention identifying module, an entity extracting module and a session managing module, and inputs information to be responded into a pre-trained response model to obtain an output result of the response model, including: inputting the information to be responded into an intention identification module to obtain the predicted intention characteristics output by the intention identification module; inputting the information to be responded and the prediction intention characteristics into an entity extraction module to obtain the prediction entity characteristics output by the entity extraction module; and the session management module determines a target query type based on the prediction intention characteristics and obtains an output result according to a query mode corresponding to the target query type and the prediction entity characteristics. Optionally, the intention identification is performed on the information to be responded to first to obtain the prediction intention characteristic, and the prediction intention characteristic and the information to be responded are both used as the input characteristics of the entity extraction module to extract the entity in the information to be responded, so that the strong dependence on the intention identification is considered in the entity extraction, and the accuracy of the entity extraction is improved. In addition, considering that the query modes corresponding to different intents are different, when the query is carried out, the target query type is determined based on the predicted intention characteristics, and the query is carried out by using the corresponding query mode to obtain an output result.
In one embodiment, obtaining an output result according to a query mode corresponding to a target query category and a predicted entity feature includes: determining a target slot position corresponding to the target query type; and filling the slot position based on the predicted entity characteristics, and determining an output result according to the slot position filling result. It can be understood by combining the above embodiments that the required slots under different intentions are different, when the response model is trained, the associated slots of each intention are already set according to the knowledge graph, when the response model is used for responding, the target slots corresponding to the target query type (i.e., intention type) are determined, the predicted entity features are filled into the target slots, and if the predicted entity features are filled in the target slots, the query result can be directly used as an output result; if there is an unfilled slot, it is necessary to generate advisory information of the slot as an output result.
Optionally, determining an output result according to the slot filling result includes: and determining the unfilled slot position, generating natural voice information corresponding to the unfilled slot position, and generating an output result based on the natural language information. For example, assuming that the information to be responded is "i need to buy a movie ticket of a ten-thousand-square cinema", after identifying the intention of the information to be responded, the prediction intention characteristic is "buy a movie ticket", the prediction entity characteristic is "ten-thousand-square cinema" or "one", the target slot position corresponding to the intention "buy a movie ticket" is "time", "cinema name", "movie name", "seat position" and "number", and after filling the prediction entity characteristic into the target slot position, the target slot position is "cinema name-ten-thousand-square cinema", "number-one", but all of "time", "movie name" and "seat position" are unfilled slot positions. Then the natural voice information corresponding to "time", "movie name" and "seat position" is generated as an output result. It can be understood that when there are a plurality of unfilled slots, the natural voice information of each unfilled slot may be sequentially generated as an output result to interact with the user, or the natural voice information of all unfilled slots may be generated at a time as an output result to interact with the user. Such as directly generating "what movie you want to see at what position you need to sit" as an output result.
And S430, determining and outputting response information according to the output result.
When the output result is natural voice information, the output result can be directly output as response information; when the output result is information in other forms, the information needs to be converted into natural voice information to be output as response information.
The embodiment of the invention obtains the information to be responded; inputting information to be responded into a response model trained in advance to obtain an output result of the response model, wherein the response model is obtained by training through a training method of the response model provided by any embodiment of the invention; response information is determined and output according to the output result, and the training sample and the training of the response model are constructed by the training method of the response model provided by any embodiment of the invention, so that the accuracy and the efficiency of response are improved.
EXAMPLE five
The present embodiment provides a preferred embodiment based on the above-described embodiments. The present embodiment describes the training of the answer model by taking an operation and maintenance robot as an example.
Fig. 5 is a schematic diagram of training and application of an operation and maintenance robot according to a fifth embodiment of the present invention, as shown in fig. 5, the fifth embodiment of the present invention constructs a knowledge graph for a large-scale physical and virtual server, utilizes a natural language generation technology to automatically extract graph information to complete construction of a dialogue chatting training corpus, combines a natural language understanding technology to perform intention recognition design and slot position design on a problem, and utilizes an idea of form design to design a dialogue story, and the form design adopts a positioning slot position of an idea dynamic of a conventional greedy algorithm, thereby solving the problem of slot position redundancy, in terms of the story design and the natural language understanding design, extracting intention classification according to the knowledge graph, effectively limiting the number of session states in a dialogue state system, and improving extensibility and portability of a back-end session Action (Action) design, for a new service operation and maintenance graph, there is no need to reconstruct the session Action (Action). And finally, combining natural language processing technologies, such as nested named body recognition and multi-label text classification, the UniLM constructs a set of complete end-to-end automatic operation and maintenance schemes.
Specifically, the training of the operation and maintenance robot provided by the embodiment of the present invention includes:
(1) extracting entities according to the knowledge graph, and constructing entity table entity1For each kind of entity, extracting its attribute and constructing attribute table attribute1Extracting all relations according to the knowledge graph and constructing a relation table relation1
(2) Designing question template sigma query according to intentioniOf quetion, among othersiFor the ith question template, the final generated question set is the union of all the templates, and the query is specific to each question templateiCyclically sampling entity entries in an entity tableiSelectively sampling attribute in attribute tableiAnd relation in the relational tableiGenerating a complete problem with the mathematical relationship:
questioni=∏entityi(∑attributei+∑relationi)
(3) compared with a generation model based on a language model, the problem question is generated by combining a pre-training model UniLM, BERT is hesitant, bidirectional decoding cannot meet the requirement of the language model, but the decoding direction is manually controlled through Mask entry, and the bidirectional decoding is changed into the unidirectional decoding.
For the natural language understanding part, considering that the extraction of the entity has strong correlation with the judgment of the intention, for example, for the intention of data feedback of a low peak scene, the slot position of the intention is a fixed finite set, so that for the entity extraction in the natural language understanding, the entity extraction has partial prior constraint (firstly, intention detection is carried out, and then entity extraction is carried out), and therefore, the natural language understanding module is constructed by utilizing a mode of entity and intention combined training.
In the training process, the intention and the entity are considered, the intention loss function and the entity loss function are designed and are put into an optimizer as the final loss function to perform gradient descent, so that multi-task training is realized, and the natural language understanding model obtained by final training can be ensured to simultaneously consider intention recognition and entity extraction. Besides, an attention mechanism between the entity and the intention is introduced to enhance the relation constraint between the entity and the intention, wherein the slot position door controls the entity extraction result of each final word, and the mechanism is as follows:
g=∑v*tanh(hi+W*attentioni)
yi s=softmax(Wh s y(hi+hi*g))
the effectiveness of the natural language understanding module is effectively guided by introducing attention results between the entity and the intent recognition in calculating the tagging results of the entity.
And for the dynamic retrieval of the session action and the slot position, a redundant session action design scheme is abandoned. Aiming at a robot constructed based on a bank operation and maintenance knowledge graph, the query process can be abstracted and divided into 2 classes, the first class is query based on entity node attributes, the second class is query based on graph relations, the second relation query is that if the knowledge graph contains N relations, a general design idea is to construct N conversation actions to be matched with the N conversation actions, but considering transportability, the N relations in the graph are abstracted into K (K) according to the formula<<N), therefore, for any relation i in K, the corresponding entity must be more than or equal to 1, and after the user inputs a question, the intention of the natural language understanding module for recognizing the input is not set as intenti(i<K) By map retrieval, abstract relationship can be rapidly retrievediIn the actual mapAnd the relation set S is adopted, so that the conversation action can further complete relation positioning according to the interaction between the S set and the user, and the slot position of the conversation is determined step by step until the conversation process is completed.
The invention relates to a conversation form design, which relates to a general task type chat robot system, wherein a complete conversation process (stock) can only be finished through multiple conversation actions, and the idea of designing a slot position by using a form is adopted in the invention, once a conversation is started, the slot position required by the whole conversation process is set into a necessary slot position, and the conversation action is not started until all the slot positions are filled, so that the method provided by the embodiment of the invention effectively controls the condition that the intention is not well grasped during slot filling, and improves the accuracy of the whole conversation system.
The embodiment of the invention automatically generates the robot training corpus according to the knowledge graph extraction result, and completes the end-to-end session design and session construction. For natural language understanding training corpora, the similarity between generated training data and real robot question and answer data is improved by combining and applying rules and deep learning. And through once extracting the map, all intentions and slot positions required by the intentions of the operation and maintenance robot can be automatically extracted, a complicated business logic construction process is omitted, and in a certain sense, the operation and maintenance robot is automatically constructed according to the knowledge map. Finally, through form design and combination with slot position setting, once the intention is correctly identified, the session state can be well controlled in the session action according to the form rule.
EXAMPLE six
Fig. 6 is a schematic structural diagram of a training apparatus for a response model according to a sixth embodiment of the present invention. The means for training the response model may be implemented in software and/or hardware, for example, the means for training the response model may be configured in a computer device. As shown in fig. 6, the apparatus includes an intention sample construction module 610, a question-answer sample construction module 620, a training sample construction module 630, and an answer model training module 640, wherein:
an intention sample construction module 610, configured to construct an intention training sample based on entity information extracted from the knowledge graph;
a question-answer sample construction module 620, configured to construct a question-answer training sample based on the pre-training model;
a training sample construction module 630, configured to construct a response model training sample according to the intention training sample and the question-and-answer training sample;
and the response model training module 640 is configured to train a pre-constructed response model by using a response model training sample to obtain a trained response model.
The training device of the response model provided by the embodiment of the invention constructs the intention training sample through the intention sample construction module 610 based on the entity information extracted by the knowledge graph; the question-answer sample construction module 620 constructs question-answer training samples based on the pre-training model; the training sample construction module 630 constructs a response model training sample according to the intention training sample and the question-and-answer training sample; the response model training module 640 trains a pre-constructed response model by using a response model training sample to obtain a trained response model, automatically generates training corpora according to a knowledge graph extraction result, completes session design and session construction of an end-to-end response model, improves the similarity between the generated response model training sample and real question and answer data by combining rules and deep learning, improves the generalization capability of a generated text to a certain extent, and further improves the universality of the response model.
Optionally, on the basis of the above scheme, the sample construction module 610 is specifically configured to:
extracting entity information in the knowledge graph, wherein the entity information comprises entities, entity attributes and relationships among the entities;
and constructing an intention training sample according to a preset intention question template and entity information.
Optionally, on the basis of the above scheme,
according to the queryi=∏entityi(∑attributei+∑relationi) Build intent trainingSamples of, among others, queryiEntity to train samples for intentiAs an entity, attributeiFor entity attributes, relationshipsiIs a relationship between entities.
Optionally, on the basis of the above scheme, the response model includes a feature extraction module, an intention recognition module, and an entity extraction module, and the response model training module 640 includes:
the initial characteristic extraction submodule is used for inputting the response model training sample into the characteristic extraction module to obtain the initial characteristic of the sample output by the characteristic extraction module;
the intention characteristic extraction submodule is used for inputting the initial characteristics of the sample into the intention identification module to obtain the intention characteristics of the sample output by the intention identification module;
the entity feature extraction sub-module is used for inputting the response model training sample and the sample intention features into the entity extraction module to obtain sample entity features output by the entity extraction module;
the loss value operator module is used for determining an intention loss value according to the sample intention characteristics and the intention label, determining an entity loss value according to the sample entity characteristics and the entity label, and determining a target loss value according to the intention loss value and the entity loss value;
and the response model training submodule is used for training the response model by taking the goal loss value reaching the convergence condition as a goal.
Optionally, on the basis of the above scheme, the loss value operator module is specifically configured to:
and weighting and summing the intention loss value and the entity loss value to obtain a target loss value.
Optionally, on the basis of the above scheme, the response model further includes an attention module, the intention identifying module, the attention module and the entity extracting module are sequentially connected, and the apparatus further includes an attention value calculating module, configured to:
inputting the sample intention characteristics into an attention model to obtain an attention result output by the attention model before inputting the response model training sample and the sample intention characteristics into the entity extraction module to obtain the sample entity characteristics output by the entity extraction module;
correspondingly, the entity feature extraction submodule is specifically configured to:
and inputting the response model training sample and the attention result into the entity extraction module to obtain the sample entity characteristics output by the entity extraction module.
Optionally, on the basis of the above scheme, the apparatus further includes a slot position setting module, configured to:
and setting the associated slot position of the intention corresponding to the intention of the intention training sample according to the number of the entity labels in the intention training sample.
The training device for the response model provided by the embodiment of the invention can execute the training method for the response model provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
EXAMPLE seven
Fig. 7 is a schematic structural diagram of a transponder according to a seventh embodiment of the present invention. The answering device can be implemented in software and/or hardware, for example, the answering device can be configured in a computer device. As shown in fig. 7, the apparatus includes a to-be-responded information obtaining module 710, a response model predicting module 720 and a response information outputting module 730, wherein:
a to-be-responded information obtaining module 710, configured to obtain to-be-responded information;
the response model prediction module 720 is configured to input information to be responded to a response model trained in advance to obtain an output result of the response model, where the response model is obtained by training through a training method of the response model provided in any embodiment of the present invention;
and the response information output module 730 is configured to determine response information according to the output result and output the response information.
In the embodiment of the invention, the information to be responded is acquired by the information to be responded acquisition module 710; the response model prediction module 720 inputs the information to be responded into a response model trained in advance to obtain an output result of the response model, wherein the response model is obtained by training through a training method of the response model provided by any embodiment of the invention; the response information output module 730 determines and outputs the response information according to the output result, and the training sample and the training of the response model are constructed by the method for training the response model provided by any embodiment of the invention, so that the accuracy and the efficiency of response are improved.
Optionally, on the basis of the foregoing scheme, the response model includes an intention identifying module, an entity extracting module and a session managing module, and the response model predicting module 720 includes:
the prediction intention determining submodule is used for inputting the information to be responded into the intention identifying module and obtaining the prediction intention characteristics output by the intention identifying module;
the prediction entity determining submodule is used for inputting the information to be responded and the prediction intention characteristics into the entity extracting module to obtain the prediction entity characteristics output by the entity extracting module;
and the output result determining submodule is used for determining the target query type by the session management module based on the prediction intention characteristics and obtaining an output result according to the query mode corresponding to the target query type and the prediction entity characteristics.
Optionally, on the basis of the above scheme, the output result determining sub-module includes:
the target slot position determining unit is used for determining a target slot position corresponding to the target query type;
and the output result determining unit is used for carrying out slot filling based on the predicted entity characteristics and determining an output result according to the slot filling result.
Optionally, on the basis of the above scheme, the output result determining unit is specifically configured to:
and determining the unfilled slot position, generating natural voice information corresponding to the unfilled slot position, and generating an output result based on the natural language information.
The response device provided by the embodiment of the invention can execute the response method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
Example eight
Fig. 8 is a schematic structural diagram of a computer device according to an eighth embodiment of the present invention. Fig. 8 is a schematic structural diagram of a computer device according to an eighth embodiment of the present invention. FIG. 8 illustrates a block diagram of an exemplary computer device 812 suitable for use in implementing embodiments of the invention. Computer device 812 shown in FIG. 8 is only an example and should not place any limitation on the scope of use or functionality of embodiments of the present invention.
As shown in fig. 8, computer device 812 is in the form of a general purpose computing device. Components of computer device 812 may include, but are not limited to: one or more processors 816, a system memory 828, and a bus 818 that couples various system components including the system memory 828 and the processors 816.
Bus 818 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and processor 816, or a local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Computer device 812 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by computer device 812 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 828 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)830 and/or cache memory 832. Computer device 812 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage 834 may be used to read from or write to non-removable, nonvolatile magnetic media (not shown in FIG. 8, but commonly referred to as a "hard disk drive"). Although not shown in FIG. 8, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 818 by one or more data media interfaces. Memory 828 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 840 having a set (at least one) of program modules 842, including but not limited to an operating system, one or more application programs, other program modules, and program data, may be stored in, for example, memory 828, each of which examples or some combination thereof may include an implementation of a network environment. Program modules 842 generally perform the functions and/or methodologies of the described embodiments of the invention.
Computer device 812 may also communicate with one or more external devices 814 (e.g., keyboard, pointing device, display 824, etc.), with one or more devices that enable a user to interact with computer device 812, and/or with any devices (e.g., network card, modem, etc.) that enable computer device 812 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 822. Also, computer device 812 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network such as the Internet) through network adapter 820. As shown, the network adapter 820 communicates with the other modules of the computer device 812 over the bus 818. It should be appreciated that although not shown, other hardware and/or software modules may be used in conjunction with computer device 812, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processor 816 executes various functional applications and data processing by executing programs stored in the system memory 828, for example, implementing a method for training a response model provided by an embodiment of the present invention, the method including:
constructing an intention training sample based on entity information extracted from the knowledge graph;
constructing a question-answer training sample based on a pre-training model;
constructing a response model training sample according to the intention training sample and the question-answer training sample;
training a pre-constructed response model by using a response model training sample to obtain a trained response model;
and/or, implementing the response method provided by the embodiment of the invention, the method includes:
acquiring information to be responded;
inputting information to be responded into a response model trained in advance to obtain an output result of the response model, wherein the response model is obtained by training through a training method of the response model provided by any embodiment of the invention;
and determining and outputting response information according to the output result.
Of course, those skilled in the art will understand that the processor may also implement the method for training the response model provided in any embodiment of the present invention and/or the solution of the response method provided in any embodiment of the present invention.
Example nine
The ninth embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a method for training a response model provided in the ninth embodiment of the present invention, where the method includes:
constructing an intention training sample based on entity information extracted from the knowledge graph;
constructing a question-answer training sample based on a pre-training model;
constructing a response model training sample according to the intention training sample and the question-answer training sample;
training a pre-constructed response model by using a response model training sample to obtain a trained response model;
and/or, implementing the response method provided by the embodiment of the invention, the method includes:
acquiring information to be responded;
inputting information to be responded into a response model trained in advance to obtain an output result of the response model, wherein the response model is obtained by training through a training method of the response model provided by any embodiment of the invention;
and determining and outputting response information according to the output result.
Of course, the computer program stored on the computer-readable storage medium provided by the embodiments of the present invention is not limited to the above method operations, and may also perform the training method of the response model provided by any embodiment of the present invention and/or the related operations of the response method provided by any embodiment of the present invention.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, or the like, as well as conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments illustrated herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (15)

1. A method for training a response model, comprising:
constructing an intention training sample based on entity information extracted from the knowledge graph;
constructing a question-answer training sample based on a pre-training model;
constructing a response model training sample according to the intention training sample and the question-answer training sample;
and training a pre-constructed response model by using the response model training sample to obtain a trained response model.
2. The method according to claim 1, wherein the constructing the intention training sample based on the entities and the entity attributes extracted by the knowledge-graph comprises:
extracting entity information in the knowledge graph, wherein the entity information comprises entities, entity attributes and relationships among the entities;
and constructing the intention training sample according to a preset intention question template and the entity information.
3. The method according to claim 2, wherein the constructing the intention training sample according to the preset intention question template and the entity information comprises:
according to the queryi=∏entityi(∑attributei+∑relationi) Constructing the intention training sample, wherein queryiEntity to train samples for intentiAs an entity, attributeiFor entity attributes, relationshipsiIs a relationship between entities.
4. The method of claim 1, wherein the response model comprises a feature extraction module, an intention recognition module and an entity extraction module, and the training of the pre-constructed response model using the response model training samples to obtain the trained response model comprises:
inputting the response model training sample into the feature extraction module to obtain a sample initial feature output by the feature extraction module;
inputting the sample initial features into the intention identification module to obtain sample intention features output by the intention identification module;
inputting the response model training sample and the sample intention characteristics into the entity extraction module to obtain sample entity characteristics output by the entity extraction module;
determining an intent loss value from the sample intent feature and the intent tag, determining an entity loss value from the sample entity feature and the entity tag, and determining a target loss value from the intent loss value and the entity loss value;
and training the response model by taking the goal that the target loss value reaches a convergence condition as a goal.
5. The method of claim 4, wherein determining a target loss value based on the intent loss value and the entity loss value comprises:
and weighting and summing the intention loss value and the entity loss value to obtain the target loss value.
6. The method of claim 4, wherein the response model further comprises an attention module, the intention recognition module, the attention module and the entity extraction module are connected in sequence, and before inputting the intention training sample and the sample intention features into the entity extraction module and obtaining sample entity features output by the entity extraction module, the method further comprises:
inputting the sample intention characteristics into the attention model to obtain an attention result output by the attention model;
correspondingly, before inputting the response model training sample and the sample intention characteristics into the entity extraction module and obtaining the predicted entity output by the entity extraction module, the method includes:
and inputting the response model training sample and the attention result into the entity extraction module to obtain sample entity characteristics output by the entity extraction module.
7. The method of claim 1, further comprising:
and setting the associated slot position of the intention corresponding to the intention of the intention training sample according to the number of the entity labels in the intention training sample.
8. A method of responding, comprising:
acquiring information to be responded;
inputting the information to be responded into a response model trained in advance to obtain an output result of the response model, wherein the response model is obtained by training through the training method of the response model according to any one of claims 1 to 6;
and determining response information according to the output result and outputting the response information.
9. The method of claim 8, wherein the response model comprises an intention recognition module, an entity extraction module and a session management module, and the inputting the information to be responded into a pre-trained response model and obtaining the output result of the response model comprises:
inputting the information to be responded into the intention identification module to obtain the predicted intention characteristics output by the intention identification module;
inputting the information to be responded and the prediction intention characteristic into the entity extraction module to obtain a prediction entity characteristic output by the entity extraction module;
and the session management module determines a target query type based on the prediction intention characteristics, and obtains the output result according to a query mode corresponding to the target query type and the prediction entity characteristics.
10. The method of claim 9, wherein obtaining the output result according to the query mode corresponding to the target query category and the predicted entity feature comprises:
determining a target slot position corresponding to the target query type;
and filling slot positions based on the predicted entity characteristics, and determining the output result according to the slot position filling result.
11. The method of claim 9, wherein determining the output result from the slot fill result comprises:
determining an unfilled slot position, generating natural voice information corresponding to the unfilled slot position, and generating the output result based on the natural language information.
12. An apparatus for training a response model, comprising:
the intention sample construction module is used for constructing an intention training sample based on the entity information extracted by the knowledge graph;
the question-answer sample construction module is used for constructing question-answer training samples based on a pre-training model;
the training sample construction module is used for constructing a response model training sample according to the intention training sample and the question-answer training sample;
and the response model training module is used for training a pre-constructed response model by using the response model training sample to obtain a trained response model.
13. A transponder apparatus, comprising:
the information to be responded acquiring module is used for acquiring information to be responded;
the response model prediction module is used for inputting the information to be responded into a response model which is trained in advance to obtain an output result of the response model, wherein the response model is obtained by training through the training method of the response model according to any one of claims 1 to 6;
and the response information output module is used for determining and outputting response information according to the output result.
14. A computer device, the device comprising:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement a method of training a response model according to any one of claims 1 to 6 and/or to implement a response method according to any one of claims 7 to 11.
15. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out a method for training a response model according to any one of claims 1 to 6 and/or carries out a method for responding according to any one of claims 7 to 11.
CN202110341702.6A 2021-03-30 2021-03-30 Response model training method, response method, device, equipment and storage medium Pending CN112949758A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110341702.6A CN112949758A (en) 2021-03-30 2021-03-30 Response model training method, response method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110341702.6A CN112949758A (en) 2021-03-30 2021-03-30 Response model training method, response method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112949758A true CN112949758A (en) 2021-06-11

Family

ID=76230540

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110341702.6A Pending CN112949758A (en) 2021-03-30 2021-03-30 Response model training method, response method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112949758A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114818683A (en) * 2022-06-30 2022-07-29 北京宝兰德软件股份有限公司 Operation and maintenance method and device based on mobile terminal
CN116244417A (en) * 2023-03-23 2023-06-09 山东倩倩网络科技有限责任公司 Question-answer interaction data processing method and server applied to AI chat robot
CN117151121A (en) * 2023-10-26 2023-12-01 安徽农业大学 Multi-intention spoken language understanding method based on fluctuation threshold and segmentation
CN117633540A (en) * 2024-01-25 2024-03-01 杭州阿里云飞天信息技术有限公司 Sample data construction method and device

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114818683A (en) * 2022-06-30 2022-07-29 北京宝兰德软件股份有限公司 Operation and maintenance method and device based on mobile terminal
CN116244417A (en) * 2023-03-23 2023-06-09 山东倩倩网络科技有限责任公司 Question-answer interaction data processing method and server applied to AI chat robot
CN116244417B (en) * 2023-03-23 2024-05-24 上海笑聘网络科技有限公司 Question-answer interaction data processing method and server applied to AI chat robot
CN117151121A (en) * 2023-10-26 2023-12-01 安徽农业大学 Multi-intention spoken language understanding method based on fluctuation threshold and segmentation
CN117151121B (en) * 2023-10-26 2024-01-12 安徽农业大学 Multi-intention spoken language understanding method based on fluctuation threshold and segmentation
CN117633540A (en) * 2024-01-25 2024-03-01 杭州阿里云飞天信息技术有限公司 Sample data construction method and device
CN117633540B (en) * 2024-01-25 2024-04-30 杭州阿里云飞天信息技术有限公司 Sample data construction method and device

Similar Documents

Publication Publication Date Title
CN109101537B (en) Multi-turn dialogue data classification method and device based on deep learning and electronic equipment
US11120801B2 (en) Generating dialogue responses utilizing an independent context-dependent additive recurrent neural network
CN111198937B (en) Dialog generation device, dialog generation program, dialog generation apparatus, computer-readable storage medium, and electronic apparatus
CN108959482B (en) Single-round dialogue data classification method and device based on deep learning and electronic equipment
CN112949758A (en) Response model training method, response method, device, equipment and storage medium
CN111897941A (en) Dialog generation method, network training method, device, storage medium and equipment
CN110234018B (en) Multimedia content description generation method, training method, device, equipment and medium
CN112069302A (en) Training method of conversation intention recognition model, conversation intention recognition method and device
WO2020073533A1 (en) Automatic question answering method and device
US20220358292A1 (en) Method and apparatus for recognizing entity, electronic device and storage medium
CN113268609A (en) Dialog content recommendation method, device, equipment and medium based on knowledge graph
CN111651573B (en) Intelligent customer service dialogue reply generation method and device and electronic equipment
CN114676234A (en) Model training method and related equipment
CN111291882A (en) Model conversion method, device, equipment and computer storage medium
CN112860862A (en) Method and device for generating intelligent body dialogue sentences in man-machine dialogue
CN109635197A (en) Searching method, device, electronic equipment and storage medium
CN111597815A (en) Multi-embedded named entity identification method, device, equipment and storage medium
CN111597816A (en) Self-attention named entity recognition method, device, equipment and storage medium
CN116958738A (en) Training method and device of picture recognition model, storage medium and electronic equipment
CN116975347A (en) Image generation model training method and related device
JP2023017983A (en) Information generation model training method, information generation method, apparatus, electronic device, storage medium, and computer program
CN114936564A (en) Multi-language semantic matching method and system based on alignment variational self-coding
CN112861474B (en) Information labeling method, device, equipment and computer readable storage medium
Afrae et al. A Question answering System with a sequence to sequence grammatical correction
CN114761944A (en) Session broker on domain structure knowledge

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