Question and answer system model training method and device, electronic equipment and storage medium

By iteratively training question text samples, a question parsing model is generated, which solves the difficulty of intent recognition in question-answering systems when faced with colloquial and one-sided questions, and improves the intent recognition capability and efficiency of question-answering systems.

CN116306974BActive Publication Date: 2025-12-23MASHANG CONSUMER FINANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310247092.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-14
Publication Date
2025-12-23
Estimated Expiration
2043-03-14

AI Technical Summary

Technical Problem

Question-answering systems face difficulties in recognizing intent when dealing with colloquial and one-sided questions, and insufficient information leads to unsatisfactory responses.

Method used

By acquiring question text samples, the initial question parsing model is iteratively trained to generate a question parsing model, including a first encoding layer and a transformation layer that generate a preset number of initial intent vectors, target intent vectors, and text fragments for querying the answers corresponding to the question text samples in the question answering system.

Benefits of technology

It improves the intent recognition capability of the question-and-answer system, reduces the latency of slot recognition processing, increases the efficiency of concurrent slot recognition, and enhances concurrency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116306974B_ABST
    Figure CN116306974B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure provide a model training method and device of a question and answer system, an electronic device, and a storage medium, wherein the model training method of the question and answer system comprises: obtaining a question text sample; inputting the question text sample into an initial question analysis model for iterative training to obtain a question analysis model; the initial question analysis model comprises a first encoding layer and a conversion layer; the first encoding layer is configured to perform encoding processing according to the question text sample to obtain a corresponding first sentence pattern vector; the conversion layer is configured to generate a preset number of initial intent vectors under the condition of receiving the first sentence pattern vector, perform filling processing on each initial intent vector according to the first sentence pattern vector to obtain a corresponding target intent vector, and convert the target intent vector into a corresponding text segment; and the text segment is configured to query an answer corresponding to the question text sample in the question and answer system, thereby improving the intent recognition capability of the question and answer system.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of knowledge graph, and particularly relates to a model training method and device of a question and answer system, an electronic device and a storage medium. BACKGROUND

[0002] With the development of Internet technology, the application of question and answer systems is becoming more and more popular. Through a question and answer system, the efficiency of answering questions raised by users can be improved, and human resources can be saved. However, in actual application, the questions raised by users may be in spoken language, so that the sentence structure is rich and diverse, which increases the difficulty of intent recognition of the question and answer system. SUMMARY

[0003] The present application provides a model training method and device of a question and answer system, an electronic device and a storage medium to improve the intent recognition capability of the question and answer system.

[0004] In a first aspect, the present application provides a model training method of a question and answer system, the question and answer system comprising an initial question analysis model; the method comprising:

[0005] obtaining a question text sample;

[0006] inputting the question text sample into the initial question analysis model for iterative training to obtain a question analysis model; the initial question analysis model comprising a first encoding layer and a conversion layer;

[0007] the first encoding layer is configured to encode the question text sample to obtain a corresponding first sentence pattern vector;

[0008] the conversion layer is configured to generate a preset number of initial intent vectors upon receiving the first sentence pattern vector, fill each initial intent vector according to the first sentence pattern vector to obtain a corresponding target intent vector, and convert the target intent vector into a corresponding text segment; the text segment is used to query an answer corresponding to the question text sample in the question and answer system.

[0009] In a second aspect, the present application provides a question and answer method, comprising:

[0010] obtaining a target question to be answered;

[0011] inputting the target question into a question analysis model for analysis to obtain a corresponding target segment; the question analysis model is obtained by training the model training method of the question and answer system according to the first aspect;

[0012] determining an answer to the target question according to the target segment.

[0013] In a third aspect, an embodiment of the present application provides a model training device of a question and answer system, the question and answer system comprising an initial question analysis model; the device comprising:

[0014] a first obtaining unit, configured to obtain a question text sample;

[0015] a training unit, configured to input the question text sample into the initial question analysis model for iterative training to obtain a question analysis model; the initial question analysis model comprising a first encoding layer and a conversion layer;

[0016] the first encoding layer being configured to perform encoding processing according to the question text sample to obtain a corresponding first sentence pattern vector;

[0017] the conversion layer being configured to generate a preset number of initial intent vectors upon receiving the first sentence pattern vector, perform padding processing on each of the initial intent vectors according to the first sentence pattern vector to obtain a corresponding target intent vector, and convert the target intent vector into a corresponding text segment; the text segment being configured to query an answer corresponding to the question text sample in the question and answer system.

[0018] In a fourth aspect, an embodiment of the present application provides a response device, comprising:

[0019] a second obtaining unit, configured to obtain a target question to be responded;

[0020] a parsing unit, configured to input the target question into a question analysis model for parsing processing to obtain a corresponding target segment; the question analysis model being obtained by training according to the model training method of the question and answer system of the first aspect;

[0021] a determining unit, configured to determine an answer to the target question according to the target segment.

[0022] In a fifth aspect, an embodiment of the present application provides an electronic device, comprising a processor, and a memory configured to store computer executable instructions, the computer executable instructions, when executed, causing the processor to perform the model training method of the question and answer system of the first aspect, or the response method of the second aspect.

[0023] In a sixth aspect, an embodiment of the present application provides a computer readable storage medium, configured to store computer executable instructions, the computer executable instructions, when executed by a processor, implementing the model training method of the question and answer system of the first aspect, or the response method of the second aspect.

[0024] It can be seen that in the embodiment of the present application, firstly, the question text sample is obtained; then the question text sample is input into the initial question analysis model for iterative training to obtain the question analysis model; the initial question analysis model includes a first encoding layer and a conversion layer; the first encoding layer is used for encoding processing according to the question text sample to obtain a corresponding first sentence pattern vector; the conversion layer is used for generating a preset number of initial intent vectors under the condition of receiving the first sentence pattern vector, filling processing each initial intent vector according to the first sentence pattern vector to obtain a corresponding target intent vector, and converting the target intent vector into a corresponding text segment; the text segment is used for querying the answer corresponding to the question text sample in the question and answer system. In this way, the initial question analysis model is iteratively trained by the obtained question text sample. In the training process, the question text sample can be encoded to obtain a corresponding first sentence pattern vector through the first encoding layer, a preset number of initial intent vectors can be generated through the conversion layer, and then each initial intent vector is filled and processed based on the first sentence pattern vector, so that at least one text segment corresponding to the target intent vector is obtained by analyzing the question text sample at one time. The question intent reflected by each text segment can be determined by the corresponding initial intent vector, and the question text sample can be converted to different intent spaces through the question analysis model, and entities and constraints are labeled under the intent vector corresponding to each intent space. This is conducive to improving the slot recognition efficiency, reducing the number of models required in the slot recognition processing flow, thereby reducing the time delay, and simultaneously performing slot recognition in each intent space, which can increase concurrency and improve the intent recognition capability and efficiency of the question and answer system. BRIEF DESCRIPTION OF DRAWINGS

[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments described in the specification, and other drawings can also be obtained by those skilled in the art without creative labor.

[0026] Figure 1 A processing flow chart of a model training method of a question and answer system provided by the embodiment of the present application;

[0027] Figure 2 A data flow direction diagram of a question analysis model in a model training method of a question and answer system provided by the embodiment of the present application;

[0028] Figure 3 A data flow direction diagram of an entity linking model in a model training method of a question and answer system provided by the embodiment of the present application;

[0029] Figure 4 A processing flow chart of a response method provided by the embodiment of the present application;

[0030] Figure 5 A session management flowchart of a response method provided for an embodiment of the present application;

[0031] Figure 6 A model training device schematic diagram of a question and answer system provided for an embodiment of the present application;

[0032] Figure 7 A response device schematic diagram provided for an embodiment of the present application;

[0033] Figure 8 A structural schematic diagram of an electronic device provided for an embodiment of the present application. DETAILED DESCRIPTION

[0034] In order for those skilled in the art to better understand the technical solutions in the embodiments of the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present specification, not all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative labor should be within the protection scope of the present application.

[0035] In the actual application of the question and answer system, on the one hand, the question put forward by the user may be colloquial, and may be one-sided, resulting in rich and varied sentence structure of the question, increasing the difficulty of intent recognition of the question and answer system; on the other hand, the information provided by the user when asking questions may be one-sided, and if only the question with insufficient information is responded to, it is likely that a satisfactory answer for the user cannot be found. In order to solve the above problems, the present application provides a sample generation method of a question and answer system.

[0036] Figure 1 A processing flowchart of a model training method of a question and answer system provided for an embodiment of the present application. Figure 1 The model training method of the question and answer system can be executed by an electronic device, which can be a terminal device such as a mobile phone, a notebook computer, a smart interactive device, etc.; or the electronic device can also be a server such as an independent physical server, a server cluster or a cloud server capable of cloud computing. Referring to Figure 1 The model training method of the question and answer system provided in the embodiment specifically includes steps S102 to S104.

[0037] The question and answer system can include an initial question analysis model, and can also include an initial question classification model and an initial entity linking model.

[0038] The initial question classification model can be an untrained OOD (out of the design scope) model.

[0039] In actual implementation, a question domain can be preconfigured, questions within the question domain are domain-in questions, and questions outside the question domain are domain-out questions. The question and answer system has the capability of answering domain-in questions and does not have the capability of answering domain-out questions. The OOD model can be used to classify the received question, and the classification result at least includes the domain-in question and the domain-out question.

[0040] The initial question analysis model can be an untrained relation extraction model. The relation extraction model can be used to perform slot identification processing to obtain a slot identification result, and the slot identification result includes but is not limited to an entity, an attribute, a relation, a constraint, and the like.

[0041] An entity can be a person name, a place name, an organization name, a pre-set proper noun, and the like. A concept, also known as a class, is an abstract description of a collection of objects with the same characteristics. The concept can be used to reflect a category. One concept can correspond to multiple entities.

[0042] For example, the concept "plant" can correspond to the following entities: "willow", "cactus", "cherry blossom", and the like.

[0043] An attribute can be used to reflect the characteristics of an entity. One concept can correspond to multiple attributes.

[0044] For example, the concept "plant" can correspond to the following attributes: "name", "species", "shape", "growing environment", "distribution range", and "reproduction method", and the like.

[0045] For each attribute, an attribute name, an attribute type, and an attribute description can be preconfigured.

[0046] The attribute type includes but is not limited to text, number, picture, rich text, and json.

[0047] A relation is used to describe the connection between concepts, which is divided into classification relations and non-classification relations. In actual application, corresponding relations can be defined according to specific fields and specific applications, such as a cause-and-effect relation.

[0048] A constraint can be a restriction condition. For example, "What are the services with an annual interest rate less than x%?" In the question, the slot identification result of "annual interest rate less than x%" is a constraint.

[0049] The initial entity linking model can be an untrained Bert classification model. The Bert classification model can be used for classification prediction processing to link the entity segment of the input model to an entity node in the pre-configured knowledge graph.

[0050] The knowledge graph includes a plurality of entity nodes, each entity node corresponding to an entity. The knowledge graph can be formed by ontology and corpus, knowledge extraction to form triples, and knowledge of business data, thereby being constructed.

[0051] In step S102, the question text sample is obtained.

[0052] The question text sample can be a pre-generated question analysis sample. Each question text sample can be a word, a combination of words, an incomplete sentence, or a complete sentence, etc.

[0053] The question analysis sample can be generated in the following way:

[0054] A pre-configured synonym set, a similar question set, and a comparison word set are obtained; the synonym set includes a plurality of standard words and at least one synonym corresponding to each standard word; the similar question set includes a plurality of first attributes and at least one similar question sentence corresponding to each first attribute; the comparison word set includes comparison word information; and the question analysis sample is generated according to at least one of the synonym set, the similar question set, and the comparison word set.

[0055] In specific implementation, the synonym set can be obtained from a pre-configured synonym template.

[0056] In the synonym template, the following fields can be displayed: standard word, type, synonym, update time, operation, etc. Specifically:

[0057] (a1) Standard word: automatically generated by the system, the value is derived from the defined entity and attribute in the corresponding graph;

[0058] (a2) Type: automatically generated by the system, the value is derived from the type corresponding to the defined entity and attribute in the corresponding graph.

[0059] (a3) Synonym: manually entered through "edit" or batch entered through "upload synonyms".

[0060] (a4) Update time: the latest modification time of the synonym.

[0061] The synonym set includes a plurality of standard words and at least one synonym corresponding to each standard word, for example, the synonym set includes:

[0062] The standard word x1, the synonym x2, the synonym x3, and the synonym x4 corresponding to the standard word x1.

[0063] standard word y1, the synonym y2 corresponding to the standard word y1;

[0064] standard word z1, the synonym z2 corresponding to the standard word z1, and the synonym z3, and so on.

[0065] In particular implementation, the similar question set can be obtained from a pre-configured similar question template.

[0066] In the similar question template, the entity type column corresponds to the concept, the attribute column corresponds to the attribute, the similar question is constructed for the attribute, and when the similar question template is maintained, the mask [e] can be configured, that is, the position for filling the synonym is left.

[0067] For example, “How to handle this parking loan?” should be maintained as “How to handle this [e]?” in the similar question template.

[0068] The similar question template can be used to generate a question parsing data set including a plurality of question parsing samples, and the similar question template can be used to form a complete sentence together with the synonym and the comparison word to simulate a user question in a real scenario.

[0069] In the similar question template, the following fields can be displayed: concept, attribute name, attribute type, similar question, update time, operation, and the like. Specifically:

[0070] (b1) Concept: corresponding to the concept defined in the graph, searchable, and cannot be added or edited.

[0071] (b2) Attribute type: corresponding to the attribute defined in the graph, and cannot be edited.

[0072] The attribute type includes, but is not limited to: text, number, picture, rich text, Map, and the like.

[0073] (b3) Similar question: the similar question of a specific attribute, which can be maintained in single piece or imported in batch, and the similar question can be one or multiple.

[0074] (b4) Update time: the latest modification time of the similar question.

[0075] (b5) Operation: edit, delete.

[0076] The similar question set includes a plurality of first attributes and at least one similar question corresponding to each first attribute, for example, the similar question set includes:

[0077] The first attribute A and the similar question A1 and the similar question A2 corresponding to the first attribute A;

[0078] The first attribute B and the similar question B1 corresponding to the first attribute B, and the like.

[0079] In specific implementation, the comparison word set can be obtained from a pre-configured comparison word template.

[0080] The comparison word template can be used to generate a question parsing data set, and the maintainable candidate words are mainly attribute words of the attribute type of the concept “number”, and the purpose is to ensure that relevant comparison type training data is generated in the parsing data set.

[0081] The comparison word information can include a comparison word and a unit.

[0082] The comparison word includes, but is not limited to, the lowest, the smallest, the least, the shortest, the cheapest, the low, the small, the few, the short, the cheap, the highest, the largest, the most, the longest, the most expensive, the high, the large, the many, the long, the expensive, and the like.

[0083] The unit includes, but is not limited to, yuan, thousand, ten thousand, hundred million, billion, day, day, month, year, %, percent, and the like.

[0084] The question parsing sample includes, but is not limited to, a single slot sample, a single attribute sample, a single entity single attribute sample, a single entity double attribute sample, a double entity single attribute sample, a double entity double attribute sample, a composite attribute constraint sample, and a comparison type sample. For example, the generated question parsing sample can be stored in the following format:

[0085]

[0086]

[0087] The storage format described above is only exemplary and does not constitute a special limitation on the present embodiment.

[0088] The graph attribute can be an attribute of the generated data in the graph, used to represent the storage intention of the generated data in the graph. Different types of question parsing samples have different generation methods, and some of them are described in detail below:

[0089] (c1) Single slot sample.

[0090] The single slot sample can be a text sample corresponding to only one of the preset slot types such as entity, attribute, relationship, and constraint.

[0091] Each preset slot type corresponds to one of the slot recognition results described above.

[0092] For example, the slot recognition result obtained by performing slot recognition processing on the question “A product's price is how much” by a relationship extraction model includes: the slot recognition result of “A product” is “entity”, the slot recognition result of “price” is “attribute”, and the like.

[0093] Slot recognition result "entity" corresponds to preset slot type "entity". Single slot samples belonging to preset slot type "entity" can be "A product", "B activity", "C commodity and D commodity", etc.

[0094] Slot recognition result "attribute" corresponds to preset slot type "attribute". Single slot samples belonging to preset slot type "attribute" can be "price", "activity deadline", "interest rate", "discount", etc.

[0095] According to at least one of the synonym set, the similar question set and the comparison word set, the question analysis sample is generated, including: filtering the synonym set according to the first preset filtering condition to obtain a candidate word list; the candidate word list includes a candidate standard word and a candidate synonym corresponding to the candidate standard word; the candidate word list is subjected to first sampling processing to obtain a single slot sample.

[0096] The generation of the single slot sample is to simulate the question when the user's intention is unclear, and the single slot sample can be used in the guided counter-question and continuous counter-question scenarios.

[0097] The single slot sample includes, but is not limited to, single entity data, double entity data and single constraint data.

[0098] It should be noted that although the double entity sample includes two entities, the two entities correspond to a preset slot type, i.e., the preset slot type "entity", so the double entity sample is also a single slot sample.

[0099] The first preset filtering condition can include filtering condition "entity" and filtering condition "json key". Based on the filtering condition "entity", the synonym set is filtered to obtain a candidate word list, and the candidate word list is subjected to first sampling processing, which can generate single entity data and / or double entity data. The sampling method of the first sampling processing can be random sampling or other sampling methods.

[0100] Single entity data, for example,

[0101]

[0102] Among them, "bill business" located in the "text" line can be the generated data, that is, the text corresponding to the single entity data. "NULL" can be a graph attribute, used to represent that the storage intention of the single entity data is empty. "0" can be the start position of the head entity, "4" can be the end position of the head entity, "business" can be the head entity category, and "bill business" located in the "value" line can be the standard name of the head entity.

[0103] The synonym set is filtered based on the filtering condition "json key", and a candidate word list is obtained. The candidate word list is subjected to first sampling processing, and single constraint data can be generated.

[0104] The single constraint data, for example,

[0105]

[0106] The "X branch" in the "text" line can be the generated data, i.e., the text corresponding to the single constraint data. The "handling process" can be a graph attribute, indicating that the storage intention of the single constraint data is handling process. The "0" can be the start position of the head entity, the "4" can be the end position of the head entity, the "constraint" can be the head entity category, and the "X branch" in the "value" line can be the standard name of the head entity.

[0107] (c2) Single attribute sample.

[0108] The single attribute sample can be a text sample corresponding only to the preset slot type "attribute". The single attribute sample can be a special single slot sample. Since the purpose of the single attribute sample is different from the above-mentioned "single entity sample", "double entity sample" and "single constraint sample", it is described separately.

[0109] According to at least one of the synonym set, the similar question set and the comparison word set, a question analysis sample is generated, including: performing second sampling processing on a plurality of first attributes in the similar question set to obtain a target first attribute; performing third sampling processing on at least one similar question sentence corresponding to the target first attribute to obtain an initial similar question sentence; if the initial similar question sentence carries a mask, deleting the mask in the initial similar question sentence to obtain a single attribute sample; if the initial similar question sentence does not carry a mask, determining the initial similar question sentence as a single attribute sample.

[0110] The generation of the single attribute sample is to generate a question to simulate the user's inquiry when the subject is unknown, and is used in the guided counter-question and continuous counter-question scenarios.

[0111] The single attribute sample can be single attribute data.

[0112] The second sampling processing is performed on a plurality of first attributes in the similar question set to obtain a target first attribute. The third sampling processing is performed on at least one similar question sentence corresponding to the target first attribute to obtain an initial similar question sentence. If the initial similar question sentence carries a mask, i.e., the initial similar question sentence is a similar question sentence with [e], then [e] is deleted to obtain single attribute data. If the initial similar question sentence does not carry a mask, i.e., the initial similar question sentence is a similar question sentence without [e], then the similar question sentence is determined as single attribute data.

[0113] The processing mode of the second sampling processing and the third sampling processing can be random sampling or other sampling modes.

[0114] Single attribute data, for example,

[0115]

[0116] Wherein, "What is the handling process" located in the "text" line can be the generated data, that is, the text corresponding to the single attribute data. "Handling process" can be a graph attribute, used to represent the storage intention of the single attribute data as handling process. The single attribute data does not have a head entity and does not have a tail entity.

[0117] (c3) Composite sample.

[0118] The composite sample can be a text sample corresponding to a plurality of preset slot types in the entity, attribute, relationship, constraint and the like.

[0119] According to at least one of the synonym set, the similar question set and the comparison word set, a question analysis sample is generated, including: filtering the synonym set according to a second preset filtering condition to obtain a candidate entity word table; the candidate entity word table includes a plurality of candidate entity words; the similar question set is screened to obtain an intermediate similar question set; the intermediate similar question set includes a plurality of first attributes and at least one candidate similar question sentence carrying a mask corresponding to each first attribute; according to the candidate word list and the intermediate similar question set, a target candidate entity word and a target candidate similar question sentence corresponding to the same attribute category are determined; the mask in the target candidate similar question sentence is replaced by the target candidate entity word to obtain a composite sample.

[0120] The composite sample includes but is not limited to: single entity single attribute sample, single entity double attribute sample, double entity single attribute sample and double entity double attribute sample, etc.

[0121] Wherein, the generation of single entity single attribute sample is to simulate the question of user normally inquiring the attribute of a certain thing, the generation of single entity double attribute sample is to simulate the question of user inquiring two or more attributes of a certain thing at the same time in single entity multi-attribute scene, the generation of double entity single attribute sample is to simulate the question of user inquiring the same attribute of multiple things at the same time in multi-entity single attribute scene, and the generation of double entity double attribute sample is to simulate the question of user inquiring multiple attributes of multiple things at the same time in multi-entity multi-attribute scene.

[0122] The composite sample can be composite data. The composite data includes but is not limited to: single entity single attribute data, single entity double attribute data, double entity single attribute data and double entity double attribute data.

[0123] The second preset filtering condition can include a filtering condition "entity". The synonym set is filtered based on the filtering condition "entity" to obtain a candidate entity word list; the candidate entity word list includes a plurality of candidate entity words; the similar question set is filtered to obtain an intermediate similar question set; the intermediate similar question set includes a plurality of first attributes and at least one candidate similar question sentence carrying a mask corresponding to each first attribute; the candidate entity word corresponding to each attribute category and the candidate similar question sentence are determined according to the candidate word list and the intermediate similar question set; the candidate entity word corresponding to each attribute category and the candidate similar question sentence are randomly sampled to obtain a target candidate entity word and a target candidate similar question sentence corresponding to the same attribute category; the mask [e] in the target candidate similar question sentence is replaced by the target candidate entity word to obtain composite data.

[0124] The target candidate entity word and the target candidate similar question sentence of the same attribute category are determined; the mask [e] in the target candidate similar question sentence is replaced by the target candidate entity word to obtain composite data, which can be that a target candidate entity word and a target candidate similar question sentence under the same attribute category are randomly selected, the mask [e] in the target candidate similar question sentence is replaced by the target candidate entity word to obtain single-entity single-attribute data.

[0125] The single-entity single-attribute data, for example,

[0126]

[0127]

[0128] The "where to support business A" can be the generated data, that is, the text corresponding to the single-entity single-attribute data. The "handling channel" can be a graph attribute, used to represent that the storage intention of the single-entity single-attribute data is a handling channel. The "9" can be a head entity start position, the "12" can be a head entity end position, the "business" can be a head entity category, and the "business A" can be a head entity standard name.

[0129] The target candidate entity word and the target candidate similar question sentence of the same attribute category are determined; the mask [e] in the target candidate similar question sentence is replaced by the target candidate entity word to obtain composite data, which can be that a target candidate entity word and a target candidate similar question sentence under the same attribute category are randomly selected, the mask [e] in the target candidate similar question sentence is replaced by the target candidate entity word to obtain single-entity single-attribute data.

[0130] Single-entity double-attribute data, for example,

[0131]

[0132]

[0133] Wherein, "Do you need to submit what materials for business X? What requirements do you need to apply for?" can be the generated data, that is, the text corresponding to the single-entity double-attribute data. "Handling materials" and "handling conditions" can be two different graph attributes, used to represent that the storage intention of the single-entity double-attribute data includes handling materials and handling conditions. "4" can be the start position of the head entity, "11" can be the end position of the head entity, "business" can be the category of the head entity, "export credit" can be the standard name of the first head entity, and "X" can be the standard name of the second head entity.

[0134] It should be noted that in the single-entity double-attribute data, the first head entity and the second head entity are the same entity, so the start position of the first head entity is the same as the start position of the second head entity, and the end position of the first head entity is the same as the end position of the second head entity.

[0135] Determine the target candidate entity word and the target candidate similar question of the same attribute category; replace the mask [e] in the target candidate similar question with the target candidate entity word to obtain the composite data, which can also be, randomly select two target candidate entity words and a target candidate similar question under the same attribute category, randomly select one of the multiple preset splicing manners as the target splicing manner, splice the two target candidate entity words through the target splicing manner to obtain the target spliced word, and replace the mask [e] in the target candidate similar question with the target spliced word to obtain the double-entity parameter data.

[0136] The preset splicing manner, for example, one of "and", "and", "and", "and", and "and" is used to splice two words together.

[0137] Double-entity single-attribute data, for example,

[0138]

[0139]

[0140] Where, "how much is the credit limit of A business and B business" can be the generated data, that is, the text corresponding to the double-entity single-property data. "Limit" can be a graph attribute, used to represent that the storage intention of the double-entity single-property data is limit. "0" can be the start position of the first head entity, "6" can be the end position of the first head entity, "7" can be the start position of the second head entity, "12" can be the end position of the second head entity, "business" can be a head entity category, "A business" can be a standard name of the first head entity, and "B business" can be a standard name of the second head entity.

[0141] It should be noted that in the double-entity single-property data, the first head entity and the second head entity are two different entities, but the graph attributes of the two entities are the same. The double-entity double-property sample can be double-entity double-property data.

[0142] In specific implementation, a plurality of single-entity single-property data can be randomly extracted from the generated plurality of single-entity single-property data, for example, single-entity single-property data 1 and single-entity single-property data 2. The single-entity single-property data 1 and the single-entity single-property data 2 are spliced by a randomly selected connector to form double-entity double-property data.

[0143] The double-entity double-property data, for example,

[0144]

[0145] Where, "Y product's limit usage mode is what, and what kind of card can Z business generally use" can be the generated data, that is, the text corresponding to the double-entity double-property data. "Limit usage mode" and "kind" can be two different graph attributes, used to represent that the storage intention of the double-entity double-property data includes limit usage mode and kind. "0" can be the start position of the first head entity, "3" can be the end position of the first head entity, "16" can be the start position of the second head entity, "24" can be the end position of the second head entity, "business" can be a head entity category, "Y product" can be a standard name of the first head entity, and "Z business" can be a standard name of the second head entity. In addition, the composite attribute constraint sample can be a composite attribute constraint data.

[0146] The generation of the composite attribute constraint sample is to simulate the question of the user asking for an attribute of a thing under a certain limitation. It is used in the composite attribute constraint scene and the continuous counter-question scene.

[0147] The synonym set is filtered based on the filtering condition "json key" to obtain the json attribute synonym, and the synonym set is filtered based on the filtering condition "entity" to obtain the entity synonym.

[0148] The similar question set is filtered to obtain a similar question carrying a mask, that is, a similar question with [e].

[0149] According to the json attribute synonym, the entity synonym, and the similar question with [e], the entity synonym, the json attribute synonym, and the similar question corresponding to each attribute category can be determined.

[0150] Random sampling is performed on the entity synonym, the json attribute synonym, and the similar question corresponding to each attribute category to obtain a target entity synonym, a target json attribute synonym, and a target similar question. The [e] in the target similar question is replaced by the target entity synonym to obtain an intermediate similar question. A splicing manner is randomly determined, and the target json attribute synonym and the intermediate similar question are spliced according to the determined splicing manner to obtain composite attribute constraint data.

[0151] The composite attribute constraint data, for example,

[0152]

[0153] Among them, "Can you say the business B handling process mobile banking" can be the generated data, that is, the text corresponding to the composite attribute constraint data. "Handling process" can be a graph attribute, used to represent the storage intention of the composite attribute constraint data as handling process. "3" can be the start position of the head entity, "6" can be the end position of the head entity, "11" can be the start position of the tail entity, "15" can be the end position of the tail entity, "business" can be the head entity category, "constraint" can be the tail entity category, "business B" can be the head entity standard name, and "mobile banking" can be the tail entity standard name.

[0154] (c4) Comparison type sample.

[0155] According to at least one of the synonym set, the similar question set, and the comparison word set, a question analysis sample is generated, including: filtering the synonym set according to a third preset filtering condition to obtain attribute synonyms and entity synonyms; generating a random number; and splicing the comparison word information, the attribute synonyms, the entity synonyms, the random number, and the preset descriptive word to obtain a comparison type sample.

[0156] The comparison type sample is generated to simulate a user asking a question about the maximum, minimum, greater than, less than, between, and other numerical comparisons of an attribute under a certain thing, and is used in a comparison sentence scenario.

[0157] The comparison type sample can be a comparison type data.

[0158] The synonym set is filtered according to a third preset filtering condition, to obtain attribute synonyms and entity synonyms.

[0159] A random number is generated.

[0160] The comparison type data is obtained by splicing the comparison word information in the comparison word set, the attribute synonyms, the entity synonyms, the random number, and a preset descriptive word.

[0161] The comparison type data, for example,

[0162]

[0163] The "M product can be extended for many years" can be the generated data, that is, the text corresponding to the comparison type data. The "term" can be a graph attribute, indicating that the storage intention of the comparison type data is the term. The "0" can be the start position of the head entity, the "4" can be the end position of the head entity, the "business" can be the category of the head entity, and the "asset business" can be the standard name of the head entity. The preset descriptive word, for example, what, what, what, what, what, and so on.

[0164] In specific implementation, the comparison word information can be synchronized from the comparison word template, such as attribute, comparison word, unit, etc.; the attribute synonyms of the type of number in the synonym template are taken, such as amount, limit, term, etc.; the entity of the same type under the non-leaf node is obtained from the entity synonym; when generating data of the maximum, minimum, greater than, and less than types, the attribute synonyms, comparison words, generated random numbers, and units are spliced first, and then the spliced string is spliced with the entity synonyms and the preset descriptive word in a randomly selected position.

[0165] Suppose the above content is ABC, respectively, the splicing can be: ABC, ACB, BAC, BCA, CBA, CAB, etc., to form an attribute question.

[0166] In specific implementation, the comparison word, random number, and unit can also be used to form data of a numerical single constraint, such as greater than 4.35% and less than 5 years.

[0167] In specific implementation, the entity and synonym of the same type under the leaf node in the knowledge graph can also be taken, two entity synonyms are spliced in a randomly selected splicing manner, and the attribute word and the comparison word are spliced through the conjunction word to form an attribute question. For example, who has a higher interest rate between A and B; who has a longer term between A and C?

[0168] Step S104, inputting the question text sample into an initial question analysis model for iterative training to obtain a question analysis model; the initial question analysis model comprises a first encoding layer and a conversion layer; the first encoding layer is configured to perform encoding processing according to the question text sample to obtain a corresponding first sentence vector; the conversion layer is configured to generate a preset number of initial intent vectors under the condition of receiving the first sentence vector, perform filling processing on each initial intent vector according to the first sentence vector to obtain a corresponding target intent vector, and convert the target intent vector into a corresponding text segment; the text segment is configured to query an answer corresponding to the question text sample in a question and answer system.

[0169] It should be noted that the initial question analysis model is completely consistent in structure with the question analysis model obtained after iterative training, and the model parameters participating in training are different. The question analysis model obtained after iterative training also has a first encoding layer and a conversion layer.

[0170] The first encoding layer can be a Bert encoder or other components that can be used to convert text into a sentence vector. The conversion layer can be composed of a space conversion layer and a plurality of binary classification fully connected layers.

[0171] The output of the first encoding layer can be the input of the conversion layer.

[0172] The initial intent vector can be a vector with a fixed number of elements but unknown elements, and each initial intent vector can be used to represent a corresponding intent space. After filling processing is performed on the initial intent vector, some elements are known, and the remaining unknown elements can be filled with specified numerical values, thereby obtaining a target intent vector corresponding to the initial intent vector.

[0173] The preset number of initial intent vectors are generated under the condition of receiving the first sentence vector, and the initial intent vectors include the same number of elements.

[0174] The number of elements included in each initial intent vector can be a preconfigured fixed value. Specifically, a preset number of initial intent vectors are generated under the condition of receiving the first sentence vector; the number of elements included in the initial intent vector is a preset value.

[0175] The number of elements included in each initial intent vector can also be determined based on the number of characters corresponding to the first sentence vector. Specifically, a preset number of initial intent vectors are generated according to the first sentence vector under the condition of receiving the first sentence vector; the number of elements included in the initial intent vector is determined based on the number of characters corresponding to the first sentence vector.

[0176] In a specific implementation, the first sentence vector includes a semantic feature sub-vector and a plurality of character sub-vectors; and the filling processing of each initial intent vector according to the first sentence vector is implemented in the following manner: the semantic feature sub-vector is subjected to intent classification processing to obtain a corresponding intent classification result; the filling processing of each initial intent vector according to the intent classification result is implemented to obtain a corresponding intermediate intent vector; and the filling processing of each intermediate intent vector according to each character sub-vector is implemented to obtain a corresponding target intent vector.

[0177] For example, the semantic feature sub-vector can be represented by [cls]. [cls] is not a vector used to represent a character in the text, but a semantic feature vector used to represent the entire text, which can be directly used for classification after being taken out.

[0178] The question text sample can include a plurality of characters, and after the question text sample is encoded by the first encoding layer to obtain a corresponding first sentence vector, the first sentence vector can include a character sub-vector corresponding to each character in the question text sample.

[0179] The intent classification result can be used to indicate whether the first sentence vector has the intent corresponding to each initial intent vector. For example, for the initial intent vector 1, if the intent classification result is the first classification result, it indicates that the first sentence vector does not have the intent corresponding to the initial intent vector 1; and if the intent classification result is the second classification result, it indicates that the first sentence vector has the intent corresponding to the initial intent vector 1.

[0180] The intent classification processing of the semantic feature sub-vector to obtain a corresponding intent classification result can be implemented by a binary classification full connection layer linear based on [cls] to obtain the intent classification result. That is, the input value of linear is [cls], and the output value includes a plurality of intent classification results, each of which corresponds to an initial intent vector, and each intent classification result can be one of the first classification result and the second classification result.

[0181] The filling processing of each initial intent vector according to the intent classification result to obtain a corresponding intermediate intent vector can be implemented by automatically filling a value used to represent the intent classification result of the initial intent vector in each initial intent vector to obtain the intermediate intent vector. For example, for the initial intent vector 1, if the intent classification result is the first classification result, the value “0” used to represent the first classification result is filled in the specified position of the initial intent vector 1; and if the intent classification result is the second classification result, the value “1” used to represent the second classification result is filled in the specified position of the initial intent vector 1.

[0182] Exemplarily, a value "0" used for representing the first classification result is filled in the specified position of the initial intention vector 1, which can be replacing the unknown element of the specified position with "0".

[0183] It should be noted that if the intention classification result corresponding to the initial intention vector is the first classification result, it indicates that the first sentence vector does not have a corresponding intention, so the character recognition result obtained by performing entity recognition and constraint recognition in the subsequent steps is irrelevant to the initial intention vector. Therefore, after filling "0" in the initial intention vector to obtain the intermediate intention vector, the intermediate intention vector can be determined as the corresponding target intention vector.

[0184] In a specific implementation, the specific implementation of filling each intermediate intention vector according to each character sub-vector to obtain the corresponding target intention vector includes: performing entity recognition processing and constraint recognition processing according to each character sub-vector to obtain a corresponding character recognition result; and filling each intermediate intention vector according to the character recognition result to obtain the corresponding target intention vector.

[0185] In specific implementation, the entity recognition processing and the constraint recognition processing can be performed according to each character sub-vector through a binary classification full connection layer linear to obtain a character recognition result, which can be used to represent an entity type and a constraint type corresponding to the character sub-vector. The entity type includes a non-entity and a plurality of preset entity types, and the constraint type includes a non-constraint and a plurality of preset constraint types.

[0186] By generating the character recognition result, it can be determined whether each character sub-vector belongs to an entity or a constraint, thereby realizing entity extraction or constraint extraction.

[0187] In a specific implementation, the specific implementation of filling each intermediate intention vector according to the character recognition result to obtain the corresponding target intention vector includes: if the character recognition result is used to represent that the character sub-vector belongs to an entity category or a constraint category, then the corresponding intermediate intention vector is determined and filled according to the character recognition result.

[0188] If the character recognition result is used to represent that the character sub-vector belongs to an entity category, then entity extraction processing can be performed according to the character recognition result, and intention prediction processing is performed on the extracted entity to determine the intermediate intention vector corresponding to the entity, and the entity is automatically filled into the corresponding intermediate intention vector.

[0189] The filling position of the entity in the intermediate intention vector can be determined based on the character position of the entity in the question text sample.

[0190] If the character recognition result is used to represent that the character sub-vector belongs to a constraint category, a constraint extraction process can be performed according to the character recognition result, and an intent prediction process is performed on the extracted constraint to determine the intermediate intent vector corresponding to the constraint, and the constraint is automatically filled into the corresponding intermediate intent vector.

[0191] The filling position of the constraint in the intermediate intent vector can be determined based on the corresponding character position of the constraint in the question text sample.

[0192] In a specific implementation, the question text sample includes at least one of an entity element, an attribute element, a relationship element, and a constraint element; the preset number of initial intent vectors includes a first intent vector and a plurality of second intent vectors; the first intent vector corresponds to no intent, and each second intent vector corresponds to an attribute element or a relationship element.

[0193] The question text sample includes at least one of an entity element, an attribute element, a relationship element, and a constraint element. The slot recognition result of the entity element can be "entity", the slot recognition result of the attribute element can be "attribute", the slot recognition result of the relationship element can be "relationship", and the slot recognition result of the constraint element can be "constraint", and the like.

[0194] The following examples illustrate the question text sample.

[0195] The question text sample can be converted to different intent spaces by the question analysis model, and each intent space corresponds to an initial intent vector.

[0196] If the question text sample includes an attribute element, the attribute element can be used to determine a target initial intent vector corresponding to the attribute element in the preset number of initial intent vectors.

[0197] If the question text sample includes a relationship element, the relationship element can be used to determine a target initial intent vector corresponding to the relationship element in the preset number of initial intent vectors.

[0198] The filling process of each initial intent vector according to the first sentence vector can be the annotation of entity and constraint in the initial intent vector corresponding to each intent space. The annotation of entity and constraint in the target initial intent vector corresponding to the attribute element can make the generated target intent vector be able to reflect at least one of the corresponding relationship between the attribute and the entity, and the corresponding relationship between the attribute and the constraint. The annotation of entity and constraint in the target initial intent vector corresponding to the relationship element can make the generated target intent vector be able to reflect at least one of the corresponding relationship between the relationship and the entity, and the corresponding relationship between the relationship and the constraint.

[0199] In the processing of slot recognition, the various slot elements in the problem text sample, such as entity elements, attribute elements, relationship elements, and constraint elements, may have certain corresponding relationships with each other.

[0200] For example, the problem text sample is: What is the price of product A? What is the on-shelf time of product B? Among them, "product A" and "product B" are entities, and "price" and "on-shelf time" are attributes. Among them, "product A" corresponds to "price", and "product B" corresponds to "on-shelf time". If slot recognition processing is performed for each type of element respectively, it may misinterpret the user's intention corresponding to the problem text sample, and thus feedback the prices of both product A and product B, and the on-shelf times of both product A and product B to the user.

[0201] In this embodiment, in the case where each initial intention vector corresponds to an attribute element or a relationship element, by performing entity and constraint labeling under the initial intention vector corresponding to each intention space, slot recognition can be simultaneously performed in different intention spaces, not only identifying each slot element in the problem text sample, but also identifying the corresponding relationship between attributes and entities, the corresponding relationship between attributes and constraints, the corresponding relationship between relationships and entities, and the corresponding relationship between relationships and constraints, etc. In this way, without separately training a model for each type of slot element using a corresponding model for slot recognition, the number of models required by the slot recognition processing flow is reduced, the time delay in the slot recognition processing flow is reduced, and the entity and constraint labeling in multiple intention spaces can be performed simultaneously, so that the slot recognition result of each slot element in the problem text sample can be obtained at one time, improving the slot recognition efficiency.

[0202] The problem text sample can be composed of entity elements and attribute elements, for example, the problem text sample is: How is the cost of product A calculated? Among them, the entity element is "product A", and the attribute element is "how to calculate the cost". The attribute element corresponds to the attribute "price".

[0203] The problem text sample can be composed of entity elements and constraint elements, for example, the problem text sample is: What are the restaurant activities that can be attended before this Sunday? Among them, the entity element is "restaurant activities", and the constraint element is "before this Sunday".

[0204] The problem text sample can be composed of entity elements and relationship elements, for example, the problem text sample is: What are the channels for handling C activities? Among them, the entity element is "C activities", and the relationship element is "handling channel".

[0205] The question text sample can be composed of entity elements, for example, D service. Among them, the entity element is "D service". In the case where the question text sample only includes entity elements, the question is usually incomplete and needs to be asked again to guide the user to supplement the question. In this case, the intent classification result of the first intent vector can be the second classification result, and the intent classification result of each second intent vector can be the first classification result, that is, the first sentence vector does not have any intent.

[0206] The following can refer to Figure 2 The structure of the question analysis model and the data processing method inside the question analysis model are exemplarily explained. Figure 2 A data flow diagram of a question analysis model in a model training method of a question and answer system provided by an embodiment of the present application.

[0207] As Figure 2 shown, the question text sample 202 is "How long can liposuction be good? How to calculate the cost of face slimming". [sep] is used to represent the separator between two question text samples. [cls] means classification (classification), which can be understood as a classification task downstream. For the text classification task, the BERT model inserts a [cls] symbol in front of the text, and the output vector corresponding to the symbol is used as the semantic representation of the whole text, which is used for text classification.

[0208] The first encoding layer can be a Bert encoder 204, and the conversion layer can include a spatial conversion layer 208, a binary classification full connection layer 210, and a binary classification full connection layer 212.

[0209] The Bert encoder 204 is used to convert the question text sample 202 into a corresponding sentence vector 206 and send it to the spatial conversion layer 208; the spatial conversion layer 208 is used to generate a preset number of initial intent vectors when receiving the sentence vector 206, wherein the initial intent vector 1 corresponds to the intent space Null 220, the initial intent vector 2 corresponds to the intent space "introduction" 218, the initial intent vector 3 corresponds to the intent space "price" 216, and the initial intent vector 4 corresponds to the intent space "recovery period" 214.

[0210] The binary classification full connection layer 210 can be used for intent classification processing according to the semantic feature sub-vector H[cls]2062, to obtain the intent classification result corresponding to each intent space and fill in: the intent space "recovery period" 214 corresponds to the second classification result, and "1" is filled in the first place; the intent space "price" 216 corresponds to the second classification result, and "1" is filled in the first place; the intent space "introduction" 218 corresponds to the first classification result, and "0" is filled in the first place; and the intent space Null 220 corresponds to the first classification result, and "0" is filled in the first place.

[0211] The binary classification full connection layer 212 can be used for entity recognition processing and constraint recognition processing according to each character sub-vector 2064, to obtain a corresponding character recognition result, and for entity extraction processing and constraint extraction processing based on the character recognition result, to obtain the entities "liposuction" and "face slimming" corresponding to the first sentence vector. The intent prediction processing is performed on the entity "liposuction", and it is determined that the intent space corresponding to the entity "liposuction" is the intent space "recovery period" 214 and is filled, to obtain the target intent vector corresponding to the intent space "recovery period". The intent prediction processing is performed on the entity "face slimming", and it is determined that the intent space corresponding to the entity "face slimming" is the intent space "price" 216 and is filled, to obtain the target intent vector corresponding to the intent space "price".

[0212] According to the target intent vector corresponding to the intent space "recovery period" and the target intent vector corresponding to the intent space "price", a corresponding text segment can be generated. For other intent spaces with the first classification result as the classification result, the corresponding target intent vector can be discarded.

[0213] In a specific implementation, the question and answer system further includes an initial entity linking model; the model training method of the question and answer system further includes: obtaining an entity linking sample; inputting the entity linking sample into the initial entity linking model for iterative training to obtain an entity linking model; the entity linking model includes a second encoding layer and a prediction layer; the second encoding layer is used for encoding processing on the entity linking sample to obtain a corresponding second sentence vector; and the prediction layer is used for prediction processing according to the second sentence vector to determine a corresponding target entity.

[0214] The entity linking sample can be obtained in the following manner: obtaining a standard entity library; the standard entity library includes a plurality of standard entities; and generating the entity linking sample according to the question analysis sample and the standard entity library.

[0215] The initial entity linking model and the entity linking model obtained after iterative training are completely consistent in structure, and the model parameters participating in training are different. The entity linking model obtained after iterative training also has a second encoding layer and a prediction layer.

[0216] The second encoding layer can be a Bert converter, or other components that can be used to convert text into a sentence vector. The prediction layer can be a binary classification full connection layer linear, or other components that can be used to map semantic feature sub-vectors to corresponding entities.

[0217] In specific implementation, according to the question analysis sample and the standard entity library, the entity linking sample is generated, including: according to the question analysis sample, determining a target analysis sample carrying a non-standard entity; calculating the similarity of the non-standard entity with each standard entity in the standard entity library and sorting; according to the sorting result, determining a preset number of target standard entities corresponding to the non-standard entity; according to the non-standard entity and the preset number of target standard entities, constructing positive and negative samples corresponding to the non-standard entity, and determining the positive and negative samples as the entity linking sample.

[0218] According to the sorting result, the second preset number of target standard entities corresponding to the non-standard entity can be determined as the target standard entity with the largest similarity.

[0219] For example, the non-standard entity "unit notice money", according to the similarity, the top 5 entities most similar in the standard entity library are "unit notice deposit", "unit regular money", "unit current money", "unit agreement deposit", and "unit regular one pass".

[0220] According to the non-standard entity and the second preset number of target standard entities, the positive and negative samples corresponding to the non-standard entity can be constructed according to the non-standard entity and the target standard entity with the largest similarity, and the negative sample is constructed according to the non-standard entity and the target standard entity other than the target standard entity with the largest similarity.

[0221] For example, the positive sample constructed is {"text":"《unit notice money》 transaction time is what point [sep] unit notice deposit", "label": 1}.

[0222] The constructed negative sample includes:

[0223] {"text":"《unit notice money》 transaction time is what point [sep] unit regular money", "label": 0};

[0224] {"text":"《unit notice money》 transaction time is what point [sep] unit current money", "label": 0};

[0225] {"text":"《unit notice money》 transaction time is what point [sep] unit agreement deposit", "label": 0};

[0226] {"text":"《unit notice money》 transaction time is what point [sep] unit regular one pass", "label": 0}.

[0227] The prediction layer is configured to perform prediction processing on the second sentence vector to determine the corresponding target entity. Specifically, the prediction layer can be configured to perform prediction processing on the semantic feature sub-vector in the second sentence vector to determine the corresponding target entity.

[0228] In the training phase, the generated entity linking dataset can be used to train the BERT classification model. In the prediction phase, after the entity recognition is completed by the question analysis model, an entity mention segment is obtained, and entities with high similarity are recalled in the graph. Similar to the construction data, the question with the mention segment and the recalled entity are spliced respectively. The entity linking model is used for prediction, and the unique entity in the graph is linked.

[0229] The following can be combined Figure 3 to exemplarily illustrate the structure of the entity linking model and the data processing flow in the entity linking model. Figure 3 The data flow chart of the entity linking model in the model training method of the question and answer system provided by the embodiments of the present application.

[0230] As Figure 3 shown, the entity linking sample 302 is "[sep] How much does radio frequency face slimming cost [sep] Radio frequency liposuction face slimming", the entity linking sample 302 is encoded and processed by the Bert encoder 302 to obtain a corresponding second sentence vector, and the second sentence vector includes a semantic feature sub-vector H[cls] 306. The semantic feature sub-vector H[cls] 306 is predicted and processed by the two-class full connection layer 308 to determine the corresponding entity prediction result 310.

[0231] In a specific implementation, the question and answer system further includes an initial question classification model; the model training method of the question and answer system further includes: obtaining a question classification sample; inputting the question classification sample into the initial question classification model for iterative training to obtain a question classification model.

[0232] The question classification sample can be obtained in the following way:

[0233] Obtain a question domain set; the question domain set includes domain internal question text and domain external question text; generate a question classification sample according to the question analysis sample and the question domain set.

[0234] In specific implementation, the question domain set can be obtained from a pre-configured question domain template.

[0235] The question domain template is used to generate the OOD model dataset, maintain some questions that cannot be answered by the question and answer system, and chat, etc. The background will sample part of the question analysis dataset to form binary classification positive and negative samples to ensure reasonable leakage of question and answer data. Since the generated data has certain limitations, the OOD template provides editing and importing of in-domain and out-of-domain questions to ensure classification accuracy and data maintainability.

[0236] The question domain set includes in-domain question texts and out-of-domain question texts.

[0237] The in-domain question can be a question within the question domain, and the text used to describe the in-domain question can be an in-domain question text. The out-of-domain question can be a question outside the question domain, and the text used to describe the out-of-domain question can be an out-of-domain question text.

[0238] The in-domain question text is, for example, "A activity deadline is which day?"; and the out-of-domain question text is, for example, "Should I go out today?"

[0239] The question classification sample can be an OOD dataset, which is used to construct the training data required for the OOD model. The question classification sample can include positive and negative samples. The positive sample is used to represent the out-of-domain question and is identified by label "1", and the negative sample is used to represent the in-domain question and is identified by label "0".

[0240] Exemplarily,

[0241] The positive sample can be {"text":"Hello","label":1}

[0242] The negative sample can be {"text":"Unit notice deposit transaction time is what time","label":0}, or {"text":"Car parking loan can be borrowed for how long","label":0}

[0243] In specific implementation, according to the question analysis sample and the question domain set, the question classification sample is generated, including: performing fourth sampling processing on the question analysis sample to obtain a first in-domain sample; generating a corresponding second in-domain sample according to the in-domain question text; generating a corresponding out-of-domain sample according to the out-of-domain question text; and generating the question classification sample according to the first in-domain sample, the second in-domain sample, and the out-of-domain sample.

[0244] The sampling mode of the fourth sampling processing can be random sampling or other sampling modes.

[0245] In the like Figure 1In the illustrated embodiment, firstly, a question text sample is acquired; then, the question text sample is input into an initial question analysis model for iterative training to obtain a question analysis model; the initial question analysis model comprises a first encoding layer and a conversion layer; the first encoding layer is configured to perform encoding processing according to the question text sample to obtain a corresponding first sentence pattern vector; the conversion layer is configured to generate a preset number of initial intent vectors under the condition of receiving the first sentence pattern vector, perform filling processing on each initial intent vector according to the first sentence pattern vector to obtain a corresponding target intent vector, and convert the target intent vector into a corresponding text segment; the text segment is configured to query an answer corresponding to the question text sample in a question and answer system. In this way, the initial question analysis model is iteratively trained by using the acquired question text sample. During the training process, the question text sample can be encoded by the first encoding layer to obtain a corresponding first sentence pattern vector, a preset number of initial intent vectors can be generated by the conversion layer, and each initial intent vector can be filled based on the first sentence pattern vector, so that the question text sample is analyzed to obtain at least one text segment corresponding to a target intent vector at one time. The question intent reflected by each text segment can be determined by the corresponding initial intent vector, and the question text sample can be converted to different intent spaces by the question analysis model, and entities and constraints can be labeled under the intent vectors corresponding to the intent spaces. This is beneficial to improving the slot recognition efficiency, reducing the number of models required in the slot recognition processing flow, thereby reducing the time delay, and performing slot recognition in each intent space at the same time, which can increase concurrency and improve the intent recognition capability and efficiency of the question and answer system.

[0246] Embodiments of the application also provide an embodiment of a response method based on the same technical concept as the foregoing method embodiments. Figure 4 The embodiment of the application provides a processing flowchart of a response method. Referring to Figure 4 The processing flow of the response method specifically includes steps S402 to S406.

[0247] S402, acquiring a target question to be responded.

[0248] S404, inputting the target question into a question analysis model for analysis processing to obtain a corresponding target segment; the question analysis model is obtained by training a model of a question and answer system by using a model training method.

[0249] The model training method of the question and answer system in this step can be a model training method of a question and answer system provided in any of the foregoing method embodiments.

[0250] In a specific implementation, the target problem is input into the question analysis model for analysis processing to obtain the corresponding target segment, including: inputting the target problem into the question classification model for classification processing to obtain a classification result; in the case where the classification result indicates that the target problem belongs to a first preset classification, inputting the target problem into the question analysis model for analysis processing to obtain the corresponding target segment.

[0251] In step S406, the answer to the target problem is determined according to the target segment.

[0252] In a specific implementation, the answer to the target problem is determined according to the target segment, including: inputting the target segment into an entity linking model for prediction processing to obtain a corresponding target entity; performing slot filling processing according to the target entity to obtain a slot filling result of the target problem; and querying a corresponding answer in a preconfigured knowledge graph according to the slot filling result to obtain the answer to the target problem.

[0253] According to the target entity, the slot filling processing can be performed on the target segment obtained in step S404. First, at least one slot template that the target segment can correspond to is determined, and then for each slot template, the slot filling processing is performed on the slot template through the target segment to obtain a filled slot template, and the filled slot template is determined as the slot filling result corresponding to the target problem.

[0254] Each slot template can include one or more slots to be filled.

[0255] For example, slot template 1 is:

[0256] What is the (attribute slot) of the (entity slot)?

[0257] Slot template 2 is:

[0258] What is the (relationship slot) of the (entity slot)?

[0259] Slot template 3 is:

[0260] What are the (constraint slots) of the (entity slot)?

[0261] It should be emphasized that the target entity can be used not only for filling the "entity slot", but also for filling various slots such as "attribute slot", "relationship slot", and "constraint slot".

[0262] Based on the slot identification and filling results, the corresponding answer is queried in a pre-configured knowledge graph. If the slot identification and filling results cannot be used to find a unique answer in the knowledge graph, then the missing slot information corresponding to the slot identification and filling results is determined. A rhetorical question is generated based on the missing slot information. User input responding to the rhetorical question is received. Slot filling processing is performed based on the user input. Based on the slot identification and filling results after slot filling processing, the corresponding answer is queried in the pre-configured knowledge graph to obtain the answer to the target question.

[0263] For example, the slot filling result for the target question includes the filled slot template 1: What is the (attribute slot) of (Product A)? This filled slot template 1 cannot be used to find a unique answer in the knowledge graph, indicating that the missing information for the slot corresponding to this filled slot template 1 is attribute missing. Based on the missing slot information "attribute missing," a corresponding rhetorical question is generated: "What information would you like to inquire about regarding product A?" The user input "price" is received in response to the rhetorical question. Slot filling processing is performed based on the user input, that is, the attribute slots in "What is the (attribute slot) of (Product A)?" are filled, resulting in the second-filled slot template 1: What is the (price) of (Product A)? Based on the slot filling result after the second-filling process, the answer to "What is the price of Product A?" is queried in the pre-configured knowledge graph to obtain the answer to the target question.

[0264] Below, we can combine Figure 5 This example illustrates how to determine the corresponding answer in a knowledge graph based on the slot filling results. Figure 5 This is a flowchart of a response method provided in an embodiment of this application, illustrating session management.

[0265] like Figure 5 As shown, after a user-inputted question enters the session stack, the question-answering system can perform algorithmic parsing on the question to obtain the parsing result. This parsing result includes at least one slot identification result.

[0266] The parsing result is checked. If the parsing result indicates OOD or no result, a response text is generated according to the pre-configured response script corresponding to "don't know / cannot answer / flag bit". This response text is used to notify the user that the question-and-answer system cannot answer the question.

[0267] If the parsing result is used to represent a single result, then a session stack check is performed: for the first session, the slot management process is initiated; for multi-turn dialogues, the session management process is initiated.

[0268] If the parsing result is used to represent multiple results, then the slot management process is entered, and the slot filling process is carried out through this slot management process.

[0269] In the slot management process, whether the composite constraint slot, the entity slot, the intent slot, the existence of the normal constraint slot, whether the node is a leaf node, and whether the intent slot is a normal intent or a multi-value intent can be used to determine the generated query template or the generated answer template.

[0270] In the session management process, composite constraint detection, normal constraint detection, entity detection, intent detection, node judgment, entity inheritance, constraint inheritance, and intent inheritance can be used to determine how to perform logical inheritance in a multi-round conversation.

[0271] Since the technical concepts are the same, the embodiments described in this embodiment are relatively simple, and the relevant parts can be referred to the corresponding description of the method embodiments provided above.

[0272] In the above embodiments, a model training method of a question and answer system is provided. Based on the same technical concept, the embodiments of the present application also provide a model training device of a question and answer system, which will be described below with reference to the accompanying drawings.

[0273] Figure 6 A model training device of a question and answer system provided in the embodiments of the present application is shown in the schematic diagram.

[0274] The embodiment provides a model training device 600 of a question and answer system, and the question and answer system includes an initial question analysis model. The device includes:

[0275] A first acquisition unit 602 is configured to acquire a question text sample.

[0276] A first training unit 604 is configured to input the question text sample into the initial question analysis model for iterative training to obtain a question analysis model. The initial question analysis model includes a first encoding layer and a conversion layer.

[0277] The first encoding layer is configured to perform encoding processing on the question text sample to obtain a corresponding first sentence vector.

[0278] The conversion layer is configured to generate a preset number of initial intent vectors when the first sentence vector is received, fill each initial intent vector according to the first sentence vector to obtain a corresponding target intent vector, and convert the target intent vector into a corresponding text segment. The text segment is used to query an answer corresponding to the question text sample in the question and answer system.

[0279] Optionally, the first sentence vector includes a semantic feature sub-vector and a plurality of character sub-vectors. The specific implementation of filling each initial intent vector according to the first sentence vector to obtain a corresponding target intent vector includes:

[0280] performing intent classification processing on the semantic feature sub-vectors to obtain corresponding intent classification results;

[0281] performing padding processing on each of the initial intent vectors according to the intent classification results to obtain corresponding intermediate intent vectors;

[0282] performing padding processing on each of the intermediate intent vectors according to each of the character sub-vectors to obtain corresponding target intent vectors.

[0283] Optionally, the intent classification results include first classification results and second classification results; and the specific implementation manner of performing padding processing on each of the intermediate intent vectors according to each of the character sub-vectors to obtain corresponding target intent vectors includes:

[0284] performing entity recognition processing and constraint recognition processing according to each of the character sub-vectors to obtain corresponding character recognition results;

[0285] performing padding processing on each of the intermediate intent vectors according to the character recognition results to obtain corresponding target intent vectors.

[0286] Optionally, the specific implementation manner of performing padding processing on each of the intermediate intent vectors according to the character recognition results to obtain corresponding target intent vectors includes:

[0287] If the character recognition results are used to represent that the character sub-vectors belong to an entity category or a constraint category, then corresponding intermediate intent vectors are determined and padded according to the character recognition results.

[0288] Optionally, the question text sample includes at least one of an entity element, an attribute element, a relationship element, and a constraint element; the preset number of initial intent vectors includes a first intent vector and a plurality of second intent vectors; the first intent vector corresponds to no intent, and each of the second intent vectors corresponds to one of the attribute elements or one of the relationship elements.

[0289] Optionally, the question and answer system further includes an initial entity linking model; and the model training apparatus 600 of the question and answer system further includes:

[0290] a third obtaining unit configured to obtain an entity linking sample;

[0291] a second training unit configured to input the entity linking sample into the initial entity linking model to perform iterative training, so as to obtain an entity linking model; the entity linking model includes a second encoding layer and a prediction layer;

[0292] the second encoding layer is configured to perform encoding processing on the entity linking sample to obtain a corresponding second sentence vector;

[0293] The prediction layer is configured to perform prediction processing according to the second sentence vector to determine a corresponding target entity.

[0294] Optionally, the question and answer system further comprises an initial question classification model; and the model training device 600 of the question and answer system further comprises:

[0295] A fourth obtaining unit is configured to obtain a question classification sample.

[0296] A third training unit is configured to input the question classification sample into the initial question classification model for iterative training to obtain a question classification model.

[0297] The model training device of the question and answer system provided in the embodiments of the present application comprises a first obtaining unit and a training unit, wherein: the first obtaining unit is configured to obtain a question text sample; the training unit is configured to input the question text sample into an initial question analysis model for iterative training to obtain a question analysis model; the initial question analysis model comprises a first encoding layer and a conversion layer; the first encoding layer is configured to perform encoding processing according to the question text sample to obtain a corresponding first sentence vector; the conversion layer is configured to generate a preset number of initial intent vectors under the condition of receiving the first sentence vector, perform filling processing on each initial intent vector according to the first sentence vector to obtain a corresponding target intent vector, and convert the target intent vector into a corresponding text segment; and the text segment is configured to query an answer corresponding to the question text sample in the question and answer system. In this way, the initial question analysis model is iteratively trained by the obtained question text sample. In the training process, the question text sample can be encoded by the first encoding layer to obtain a corresponding first sentence vector, a preset number of initial intent vectors can be generated by the conversion layer, and then each initial intent vector is filled according to the first sentence vector, so that at least one target intent vector corresponding to a text segment is analyzed from the question text sample at one time. The question intent reflected by each text segment can be determined by the corresponding initial intent vector, and the question text sample can be converted to different intent spaces by the question analysis model, and entities and constraints are labeled under the intent vectors corresponding to the intent spaces. This is beneficial to improving the slot recognition efficiency, reducing the number of models required in the slot recognition processing flow, thereby reducing the time delay, and simultaneously performing slot recognition in each intent space, which can increase concurrency and improve the intent recognition capability and efficiency of the question and answer system.

[0298] In the above embodiments, a response method is provided. Corresponding to the same technical concept, based on the same technical concept, the embodiments of the present application also provide a response device, which will be described below with reference to the accompanying drawings.

[0299] Figure 7 A response device provided in the embodiments of the present application is shown in the schematic diagram.

[0300] The embodiment provides a response device 700, comprising:

[0301] A second acquisition unit 702 is used for acquiring a target question to be responded;

[0302] An analysis unit 704 is used for inputting the target question into a question analysis model for analysis processing to obtain a corresponding target segment; the question analysis model is obtained by training a model of a question and answer system;

[0303] A determination unit 706 is used for determining an answer of the target question according to the target segment.

[0304] Optionally, the analysis unit 704 is specifically used for:

[0305] inputting the target question into a question classification model for classification processing to obtain a classification result;

[0306] in a case where the classification result is used for representing that the target question belongs to a first preset classification, inputting the target question into the question analysis model for analysis processing to obtain a corresponding target segment.

[0307] Optionally, the determination unit 706 is specifically used for:

[0308] inputting the target segment into an entity linking model for prediction processing to obtain a corresponding target entity;

[0309] performing slot filling processing according to the target entity to obtain a slot filling result of the target question;

[0310] querying a corresponding answer in a preconfigured knowledge graph according to the slot filling result to obtain the answer of the target question.

[0311] The response device provided in the embodiments of the present application comprises: a second acquisition unit configured to acquire a target question to be responded; an analysis unit configured to input the target question into a question analysis model for analysis processing to obtain a corresponding target segment; the question analysis model is obtained by training the model of the question and answer system through a model training method; and a determination unit configured to determine an answer to the target question according to the target segment. In this way, the question analysis model can encode the question text sample to obtain a corresponding first sentence vector through the first encoding layer in the training process, can generate a preset number of initial intent vectors through the conversion layer, and can further fill each initial intent vector based on the first sentence vector, so as to analyze the question text sample to obtain a text segment corresponding to at least one target intent vector at one time, the question intent reflected by each text segment can be determined by the corresponding initial intent vector, and the question text sample can be converted to different intent spaces through the question analysis model, and entities and constraints are labeled under the intent vector of each intent space, which is beneficial to improving the slot recognition efficiency, reducing the number of models required in the slot recognition processing flow, thereby reducing the time delay, and the slot recognition is performed in each intent space at the same time, which can increase the concurrency and improve the intent recognition capability and efficiency of the question and answer system. Furthermore, the target segment is generated through the question analysis model, and the answer to the target question is determined through the target segment, which can improve the intent recognition accuracy and efficiency of the question and answer system.

[0312] Corresponding to the above description, a model training method of a question and answer system, or a response method corresponding to the above description, based on the same technical concept, the embodiments of the present application further provide an electronic device for executing the above-provided model training method of the question and answer system, or the above-provided response method, Figure 8 A structural schematic diagram of an electronic device provided in the embodiments of the present application.

[0313] As Figure 8 shown, the electronic device can have a large difference due to different configurations or performances, and can include one or more processors 801 and memories 802, and one or more storage applications or data can be stored in the memories 802. The memory 802 can be temporary storage or persistent storage. The applications stored in the memory 802 can include one or more modules (not shown in the figure), and each module can include a series of computer executable instructions in the electronic device. Furthermore, the processor 801 can be configured to communicate with the memory 802 and execute a series of computer executable instructions in the memory 802 on the electronic device. The electronic device can also include one or more power supplies 803, one or more wired or wireless network interfaces 804, one or more input / output interfaces 805, one or more keyboards 806, and the like.

[0314] In one embodiment, an electronic device includes memory and one or more programs, wherein one or more programs are stored in the memory and the one or more programs can include one or more modules, and each module can include a series of computer-executable instructions in the electronic device and is configured to be executed by one or more processors to perform the following computer-executable instructions:

[0315] Obtaining a question text sample;

[0316] Inputting the question text sample into the initial question analysis model for iterative training to obtain a question analysis model; the initial question analysis model includes a first encoding layer and a conversion layer;

[0317] The first encoding layer is configured to perform encoding processing according to the question text sample to obtain a corresponding first sentence vector;

[0318] The conversion layer is configured to generate a preset number of initial intent vectors upon receiving the first sentence vector, fill each initial intent vector according to the first sentence vector to obtain a corresponding target intent vector, and convert the target intent vector into a corresponding text segment; the text segment is used to query an answer corresponding to the question text sample in the question and answer system.

[0319] In another embodiment, an electronic device includes memory and one or more programs, wherein one or more programs are stored in the memory and the one or more programs can include one or more modules, and each module can include a series of computer-executable instructions in the electronic device and is configured to be executed by one or more processors to perform the following computer-executable instructions:

[0320] Obtaining a target question to be answered;

[0321] Inputting the target question into a question analysis model for analysis processing to obtain a corresponding target segment; the question analysis model is obtained by training a model of a question and answer system;

[0322] According to the target segment, determining an answer to the target question.

[0323] The computer-readable storage medium provided in the specification implements, for example:

[0324] Based on the same technical concept, the model training method of the question and answer system described above, the embodiments of the present application also provide a computer-readable storage medium.

[0325] The computer readable storage medium provided by the embodiment is used for storing computer executable instructions, and the computer executable instructions realize the following process when executed by a processor.

[0326] Obtain a question text sample;

[0327] Input the question text sample into the initial question analysis model for iterative training to obtain a question analysis model; the initial question analysis model comprises a first encoding layer and a conversion layer;

[0328] The first encoding layer is configured to perform encoding processing according to the question text sample to obtain a corresponding first sentence vector;

[0329] The conversion layer is configured to generate a preset number of initial intent vectors when the first sentence vector is received, fill each initial intent vector according to the first sentence vector to obtain a corresponding target intent vector, and convert the target intent vector into a corresponding text segment; the text segment is used to query an answer corresponding to the question text sample in the question and answer system.

[0330] It should be noted that the embodiments of the computer readable storage medium in the present specification and the model training method of the question and answer system in the present specification are based on the same inventive concept, and therefore the specific implementation of this embodiment can refer to the implementation of the corresponding method described above, and the repeated parts will not be described here.

[0331] According to the above-mentioned response method, based on the same technical concept, the embodiments of the present application also provide a computer readable storage medium.

[0332] The computer readable storage medium provided by the embodiment is used for storing computer executable instructions, and the computer executable instructions realize the following process when executed by a processor.

[0333] Obtain a target question to be answered;

[0334] Input the target question into a question analysis model for analysis processing to obtain a corresponding target segment; the question analysis model is obtained by training the model training method of the question and answer system;

[0335] According to the target segment, determine the answer to the target question.

[0336] It should be noted that the embodiments of the computer readable storage medium in the present specification and the model training method of the question and answer system in the present specification are based on the same inventive concept, and therefore the specific implementation of this embodiment can refer to the implementation of the corresponding method described above, and the repeated parts will not be described here.

[0337] The above-described embodiments of the application have several aspects, no single one of which is solely responsible for the application's desirable attributes. Without limiting the scope of the application as expressed by the claims that follow, some further embodiments of the application will now be described to explain in further detail some embodiments of the application. Additional embodiments within the scope of the following claims will be recognized by those of ordinary skill in the art.

[0338] Those skilled in the art will appreciate that embodiments of the application can be devised for a method, a system, or a computer program product. Accordingly, embodiments of the application can be embodied in hardware and / or in software (including firmware, resident software, micro-code, etc.). Furthermore, embodiments of the application can take the form of a computer program product on a computer-readable storage medium having computer

[0339] The computer program instructions can also be loaded onto a computer or other programmable apparatus to cause a series of operations steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the operations described in the flowchart block or blocks. Figure 1 The flowchart and / or block diagram in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to the present application. In this regard, each block in the flowchart and / or block diagrams can represent a module, segment, or portion of code, which comprises one or more executable Figure 1 The flowchart and / or block diagram in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to the present application. In this regard, each block in the flowchart and / or block diagrams can represent a module, segment, or portion of code, which comprises one or more executable The computer program instructions can also be loaded onto a computer or other programmable apparatus to cause a series of operations steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the operations described in the flowchart block or blocks.

[0340] The flowchart and / or block diagram in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to the present application. In this regard, each block in the flowchart and / or block diagrams can represent a module, segment, or portion of code, which comprises one or more executable Figure 1 The flowchart and / or block diagram in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to the present application. In this regard, each block in the flowchart and / or block diagrams can represent a module, segment, or portion of code, which comprises one or more executable Figure 1 The flowchart and / or block diagram in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to the present application. In this regard, each block in the flowchart and / or block diagrams can represent a module, segment, or portion of code, which comprises one or more executable The computer program instructions can also be loaded onto a computer or other programmable apparatus to cause a series of operations steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the operations described in the flowchart block or blocks.

[0341] The flowchart and / or block diagram in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to the present application. In this regard, each block in the flowchart and / or block diagrams can represent a module, segment, or portion of code, which comprises one or more executable Figure 1 The flowchart and / or block diagram in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to the present application. In this regard, each block in the flowchart and / or block diagrams can represent a module, segment, or portion of code, which comprises one or more executable Figure 1 The flowchart and / or block diagram in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to the present application. In this regard, each block in the flowchart and / or block diagrams can represent a module, segment, or portion of code, which comprises one or more executable The computer program instructions can also be loaded onto a computer or other programmable apparatus to cause a series of operations steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the operations described in the flowchart block or blocks.

[0342] In one typical arrangement, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0343] The memory can include non-persistent memory and / or volatile memory, such as random access memory (RAM) having a common memory storage port. The memory is an example of computer readable media.

[0344] Computer readable media includes permanent and non-permanent, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital versatile discs (DVDs) or other optical storage, magnetic cassettes, magnetic disks storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer readable media does not include transitory media, such as modulated data signals and carrier waves.

[0345] It is also important to note that the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.

[0346] Embodiments of the present application can be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, and the like, that perform particular tasks or implement particular abstract data types. One or more embodiments of the present description can also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules can be located in both local and remote computer storage media including memory storage devices.

[0347] The various embodiments described in this specification are described using a numbering of embodiments approach: these are each individually integrated contributions pertaining to different aspects of the description. For each embodiment, the description focuses on the differences from the other embodiments. Each embodiment is to be read in isolation, with the understanding that the same or similar features from other embodiments can be combined with the features of the respective embodiment. In particular, the description of the system embodiments is kept relatively short, as the system embodiments are largely analogous to the method embodiments.

[0348] The above description is embodied in the form of examples only and is not used to limit the present document. The present document can be changed and modified in various ways by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present document shall be included in the scope of the claims of the present document.

Claims

1. A model training method for a question-answering system, characterized in that, The question-answering system includes an initial question parsing model; the method includes: Obtain a sample of the question text; The question text sample is input into the initial question parsing model for iterative training to obtain the question parsing model; the initial question parsing model includes a first encoding layer and a transformation layer; The first encoding layer is used to encode the problem text sample to obtain the corresponding first sentence vector; The conversion layer is used to generate a preset number of initial intent vectors upon receiving the first sentence vector, fill each initial intent vector according to the first sentence vector to obtain a corresponding target intent vector, and convert the target intent vector into a corresponding text fragment; the text fragment is used to query the answer corresponding to the question text sample in the question-answering system. The first sentence structure vector includes a semantic feature sub-vector and multiple character sub-vectors. The specific implementation of filling each initial intent vector with the first sentence structure vector to obtain the corresponding target intent vector includes: performing intent classification processing on the semantic feature sub-vectors to obtain corresponding intent classification results; filling each initial intent vector with the intent classification results to obtain corresponding intermediate intent vectors; and filling each intermediate intent vector with each character sub-vector to obtain the corresponding target intent vector.

2. The method according to claim 1, characterized in that, The specific implementation methods for filling each intermediate intent vector based on each character sub-vector to obtain the corresponding target intent vector are as follows: Based on each character sub-vector, entity recognition processing and constraint recognition processing are performed to obtain the corresponding character recognition result; Based on the character recognition results, each intermediate intent vector is filled to obtain the corresponding target intent vector.

3. The method according to claim 2, characterized in that, The specific implementation methods for filling each intermediate intent vector according to the character recognition result to obtain the corresponding target intent vector are as follows: If the character recognition result is used to characterize that the character subvector belongs to an entity category or a constraint category, then the corresponding intermediate intent vector is determined and filled according to the character recognition result.

4. The method according to any one of claims 1-3, characterized in that, The question text sample includes at least one of entity elements, attribute elements, relation elements, and constraint elements; the preset number of initial intent vectors includes a first intent vector and multiple second intent vectors; the first intent vector corresponds to no intent, and each second intent vector corresponds to one attribute element or one relation element.

5. The method according to claim 1, characterized in that, The question-answering system also includes an initial entity linking model; the method also includes: Obtain entity link samples; The entity link samples are input into the initial entity link model for iterative training to obtain the entity link model; the entity link model includes a second encoding layer and a prediction layer. The second encoding layer is used to encode the entity link sample to obtain the corresponding second sentence vector; The prediction layer is used to perform prediction processing based on the second sentence vector to determine the corresponding target entity.

6. The method according to claim 1, characterized in that, The question-answering system also includes an initial question classification model; the method also includes: Obtain problem classification samples; The problem classification samples are input into the initial problem classification model for iterative training to obtain the problem classification model.

7. A response method, characterized in that, include: Obtain the target question to be answered; The target problem is input into the problem analysis model for analysis and processing to obtain the corresponding target fragment; The question parsing model is obtained by training the model training method of the question-answering system as described in any one of claims 1-6; Based on the target fragment, determine the answer to the target question.

8. The method according to claim 7, characterized in that, The step of inputting the target problem into a problem analysis model for analysis and processing to obtain the corresponding target fragment includes: The target problem is input into a problem classification model for classification processing to obtain the classification result; When the classification result is used to characterize that the target problem belongs to the first preset category, the target problem is input into the problem parsing model for parsing processing to obtain the corresponding target fragment.

9. The method according to claim 7, characterized in that, Determining the answer to the target question based on the target fragment includes: The target fragment is input into the entity linking model for prediction processing to obtain the corresponding target entity; Based on the target entity, perform slot filling processing to obtain the slot filling result for the target problem; Based on the slot filling results, the corresponding answer is queried in the pre-configured knowledge graph to obtain the answer to the target question.

10. A response device, characterized in that, include: The second acquisition unit is used to acquire the target question to be answered; The parsing unit is used to input the target problem into the problem parsing model for parsing processing to obtain the corresponding target fragment; The question parsing model is obtained by training the model training method of the question-answering system as described in any one of claims 1-6; A determining unit is used to determine the answer to the target question based on the target fragment.

11. An electronic device, characterized in that, The device includes: A processor; and a memory configured to store computer-executable instructions, which, when executed, cause the processor to perform a model training method for a question-answering system as claimed in any one of claims 1-6, or a response method as claimed in any one of claims 7-9.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store computer-executable instructions, which, when executed by a processor, implement the model training method of the question-answering system as described in any one of claims 1-6, or the response method as described in any one of claims 7-9.

Citation Information

Patent Citations

  • Problem analysis method and device, electronic equipment and storage medium

    CN112380343A

  • Knowledge question and answer model training method and device, knowledge question and answer method and device and computer equipment

    CN115062134A