Question and answer method and device for generative model, electronic equipment and storage medium

By identifying the intention label of user question information and extracting key information to generate standard question information, the problem of irregular user input causes unstable output of generative model is solved, and more stable output effects and reduced training costs are achieved.

CN119669392APending Publication Date: 2025-03-21QINDAO HAIER REFRIGERATOR CO LTD +2
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202311206488.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-18
Publication Date
2025-03-21

AI Technical Summary

Technical Problem

The irregular question information entered by the user leads to unstable output effect of the generative model.

Method used

By identifying the intent tag of the user's question information, the standard question template corresponding to the intent tag is determined, key information is extracted from the user's question information, and standard question information of the user's question information is obtained based on the key information and the standard question template, and input it into the generative model.

Benefits of technology

It improves the stability of the output effect of the generative model, ensures that the answer information is in line with common sense, comprehensiveness, and appropriate length, and reduces the cost of early large model fine-tuning training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119669392A_ABST
    Figure CN119669392A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of intelligent questioning and answering, and discloses a questioning and answering method for a generative model, and the method comprises the steps: recognizing an intention label of user questioning information, and determining a standard questioning template corresponding to the intention label; key information is extracted from the user questioning information based on the intention label, and standard questioning information of the user questioning information is obtained based on the key information and a standard questioning template; and inputting the standard question information into the generative model, and obtaining answer information of the question information of the user based on the generative model. According to the method, the normative standard question information of the question information of the user can be obtained based on the extracted key information and the standard question template, and the normative standard question information is input into the generative model, so that the stability of the output effect of the generative model can be improved. The invention further provides a question answering device for the generative model, electronic equipment and a storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of intelligent question answering, for example, to a question answering method and device, electronic device, and storage medium for a generative model. Background Art

[0002] The question-answering system is an advanced form of information retrieval system, which can answer questions raised by users in natural language accurately and concisely. In related technologies, the question-answering system can introduce a generative model and use the generative model to obtain answers to user questions.

[0003] However, the question information that users input into the generative model is usually random and irregular. In some vertical scenarios (such as cars and home appliances), replacing the original dialogue system technology with a generative model may lead to unstable output effects of the generative model due to the irregular question information input by users.

[0004] The related art discloses a question-answering method for a generative model based on a hybrid of intent recognition and template matching, comprising the following steps: S1, initial intent recognition based on feature word matching: matching entities and trigger words from the question sentence input by the user, comprehensively judging the number of intents based on the entity type and the trigger word type, and initially recognizing the intent; S2, re-recognizing intent based on BERT-textCNN: directly recognizing the user's true intent using the intent recognition method; S3, joint decision-making: fusing the recognition results obtained by S1 and S2 to determine the user intent; wherein, in a single-intent scenario, the recognition result obtained by S2 is the determined user intent; in a multi-intent scenario, the intersection of the recognition results obtained by S1 and S2 is the determined user intent; S4, parsing the question sentence: generating a corresponding Cypher query statement based on the entity, entity type, and determined user intent in the question sentence input by the user; S5, generating an answer: calling Cypher to query on the graph, saving the returned results, and then applying a pre-defined reply template to organize and process the returned results, generating a corresponding answer and returning it to the user. However, the related technology is used to improve the accuracy of the answer information of the question-answering system in the form of a knowledge graph, and is not applicable to the question-answering scenario based on the generative model. The related technology cannot solve the problem that the output effect of the generative model is unstable due to the irregular question information input by the user.

[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present application, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0006] In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key / critical components or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.

[0007] The embodiments of the present disclosure provide a question-answering method and device, an electronic device, and a storage medium for a generative model, which can improve the stability of the output effect of the generative model.

[0008] According to a first aspect of the present disclosure, a question-answering method for a generative model is provided, and the question-answering method for a generative model comprises:

[0009] Identify the intent tags of user question information and determine the standard question templates corresponding to the intent tags;

[0010] Extract key information from user question information based on the intent tag, and obtain standard question information of the user question information based on the key information and the standard question template;

[0011] The standard question information is input into the generative model, and the answer information of the user's question information is obtained based on the generative model.

[0012] In some embodiments, the key information is a keyword, and the standard question template includes empty slots, each of which is configured with a word type;

[0013] Extract key information from the user's question information based on the intent tag, and obtain standard question information of the user's question information based on the key information and the standard question template, including:

[0014] Based on the word type indicated by the intent tag, extract keywords corresponding to the word type from the user's question information;

[0015] Each keyword is filled into an empty slot of the corresponding word type in the standard question template to obtain standard question information of the user's question information.

[0016] In some embodiments, when the intent tag indicates only one word type and multiple keywords corresponding to the word type are extracted from the user question information, each keyword is filled into an empty slot corresponding to the word type in the standard question template to obtain standard question information of the user question information, including: sequentially filling each keyword into an empty slot corresponding to the word type in the standard question template to obtain multiple standard question information of the user question information;

[0017] Inputting standard question information into a generative model, and obtaining answer information of the user's question information based on the generative model, includes: inputting multiple standard question information into the generative model, and obtaining answer information of the user's question information based on the generative model.

[0018] In some embodiments, when the intent tag indicates multiple word types, and multiple keywords corresponding to the same word type are extracted from the user question information, each keyword is filled into an empty slot of the corresponding word type in the standard question template to obtain standard question information of the user question information, including: grouping the keywords corresponding to the multiple word types to obtain multiple keyword combinations, wherein each keyword combination contains a keyword corresponding to each word type; filling each keyword in each keyword combination into an empty slot of the corresponding word type in the standard question template in turn to obtain multiple standard question information of the user question information;

[0019] Inputting standard question information into a generative model, and obtaining answer information of the user's question information based on the generative model, includes: inputting multiple standard question information into the generative model, and obtaining answer information of the user's question information based on the generative model.

[0020] In some embodiments, multiple standard question information is input into a generative model, and answer information of the user's question information is obtained based on the generative model, including:

[0021] Inputting multiple standard question information into the generative model in sequence, and obtaining answer information of each standard question information in sequence based on the generative model;

[0022] The answer information of multiple standard question information is spliced ​​into the answer information of the user question information.

[0023] In some embodiments, multiple standard question information is input into a generative model, and answer information of the user's question information is obtained based on the generative model, including:

[0024] Splice multiple standard question information into standard fusion question information;

[0025] The standard fusion question information is input into the generative model, and the answer information of the user's question information is obtained based on the generative model.

[0026] In some embodiments, the question answering method for a generative model further includes:

[0027] When the intention label of the user's question information is not identified, the user's question information is input into the generative model, and answer information of the user's question information is obtained based on the generative model.

[0028] According to a second aspect of the present disclosure, a question-answering device for a generative model is provided. The question-answering device for a generative model includes a processor and a memory storing program instructions. The processor is configured to execute the question-answering method for a generative model provided in the first aspect when running the program instructions.

[0029] According to a third aspect of the present disclosure, an electronic device is provided, the electronic device comprising a device body, and a question-answering device for a generative model is provided in the second aspect, and the question-answering device for a generative model is installed in the device body.

[0030] According to a fourth aspect of the present disclosure, a storage medium is provided, storing program instructions, which, when run, execute the question-answering method for a generative model provided in the first aspect.

[0031] The question-answering method and device, electronic device, and storage medium for a generative model provided by the embodiments of the present disclosure can achieve the following technical effects:

[0032] The disclosed embodiment can determine a standard question template that matches the intention label of the user's question information, and accurately extract key information from the random and irregular user question information based on the intention label. Based on the key information and the standard question template, the standardized standard question information of the user's question information can be obtained, and the standardized standard question information can be input into the generative model to improve the stability of the output effect of the generative model.

[0033] The foregoing general description and the following description are exemplary and explanatory only and are not intended to limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] One or more embodiments are exemplarily described by corresponding drawings, which do not limit the embodiments. Elements with the same reference numerals in the drawings are shown as similar elements, and the drawings do not constitute a scale limitation, and wherein:

[0035] Figure 1 is a schematic diagram of an electronic device provided by an embodiment of the present disclosure;

[0036] Figure 2 is a schematic diagram of a question-answering method for a generative model provided by an embodiment of the present disclosure;

[0037] Figure 3 is a schematic diagram of another question-answering method for a generative model provided by an embodiment of the present disclosure;

[0038] Figure 4 is a schematic diagram of another question-answering method for a generative model provided by an embodiment of the present disclosure;

[0039] Figure 5 is a schematic diagram of another question-answering method for a generative model provided by an embodiment of the present disclosure;

[0040] Figure 6 is a schematic diagram of another question-answering method for a generative model provided by an embodiment of the present disclosure;

[0041] Figure 7 is a schematic diagram of a question-answering device for a generative model provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0042] In order to be able to understand the features and technical contents of the embodiments of the present disclosure in more detail, the implementation of the embodiments of the present disclosure is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present disclosure. In the following technical description, for the convenience of explanation, a full understanding of the disclosed embodiments is provided through multiple details. However, one or more embodiments can still be implemented without these details. In other cases, to simplify the drawings, well-known structures and devices can be simplified for display.

[0043] The terms "first", "second", etc. in the specification and claims of the embodiments of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged where appropriate, so that the embodiments of the embodiments of the present disclosure described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions.

[0044] Unless otherwise stated, the term "plurality" means two or more.

[0045] In the embodiment of the present disclosure, the character " / " indicates that the preceding and following objects are in an "or" relationship. For example, A / B indicates: A or B.

[0046] The term "and / or" is a description of the association relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or, A and B.

[0047] The term "correspondence" may refer to an association relationship or a binding relationship. The correspondence between A and B means that there is an association relationship or a binding relationship between A and B.

[0048] First, the concepts involved in the embodiments of the present disclosure are introduced.

[0049] A generative model is an artificial intelligence model, also known as a generative AI (Artificial Intelligence) model. Through large-scale data training and powerful computing power, a generative model can automatically generate a variety of tasks, such as from text to text, from image to text, and from text to image.

[0050] Prompt, or prompt word, is a method of using natural language to guide or inspire artificial intelligence models to complete specific tasks. It is a new paradigm that has emerged in the field of natural language processing (NLP) in recent years, also known as "pretrain-prompt-predict".

[0051] The embodiment of the present disclosure provides an electronic device 100, which may be a computer, a mobile phone, an electrical appliance, etc. The electrical appliance includes a refrigerator, a freezer, an air conditioner, etc. The electronic device 100 includes a device body 101 and a question-answering device 700 for a generative model, and the question-answering device 700 for a generative model is installed on the device body 101.

[0052] In some embodiments, the question-answering apparatus 700 for the generative model includes a processor. The processor can identify the intent tag of the user's question information, extract key information from the user's question information based on the intent tag, obtain standard question information based on the key information and the standard question template corresponding to the intent tag, and obtain answer information of the user's question information by inputting the standard question information into the generative model.

[0053] In conjunction with the electronic device provided by the embodiment of the present disclosure, the embodiment of the present disclosure provides a question-answering method for a generative model, such as Figure 2 As shown in Figure 1, the question answering method for generative models includes the following steps:

[0054] S201, the processor identifies the intention tag of the user's question information, and determines a standard question template corresponding to the intention tag.

[0055] The disclosed embodiment can pre-configure a variety of intent tags, and different intent tags represent different intents. Optionally, the disclosed embodiment can pre-configure intent tags related to a specific application field according to the application field, so that the intent tags are more refined and more in line with the characteristics of the application field.

[0056] In S201, the intention of the user's question information can be identified, so as to determine the intention label of the user's question information. Here, the intention of the user's question information can be identified based on a deep learning method. Specifically, the user's question information can be input into a pre-trained deep learning model, and the intention of the user's question information can be identified based on the deep learning model. The deep learning model can be a recurrent neural network (RNN) model, a gated recurrent network (GRU) model, and a long short-term memory network (LSTM) model, etc. It can be understood that a variety of user question information and its corresponding real intentions can be used as training data, and the deep learning model can be trained using the training data so that the deep learning model acquires the ability to identify the intention of the user's question information.

[0057] It is understandable that the user question information represents the questions raised by the user. In some embodiments, the user question information in S201 is information in text form. Optionally, the user can directly input the user question information in text form into the electronic device. Optionally, the user can input the user question information in voice form into the electronic device. The processor can complete the collection of voice data through a voice receiver (pickup, microphone, mobile phone, etc.), and then perform noise reduction, echo removal, reverberation removal, format conversion and other operations on the collected voice data to obtain valid voice data. Use a speech-to-text model to transcribe the valid voice data into text data, thereby obtaining the user question information in text form.

[0058] S202: The processor extracts key information from the user's question information based on the intention tag, and obtains standard question information of the user's question information based on the key information and the standard question template.

[0059] The pre-configured intent tag of the embodiment of the present disclosure may indicate an information type. In S202, key information may be extracted from the user's question information based on the information type indicated by the intent tag. For example, if the information type of the intent tag is food, then food-related information may be extracted from the user's question information as key information.

[0060] The disclosed embodiment pre-configures a corresponding standard question template for each intent tag. Table 1 exemplarily shows the correspondence between some intent tags and standard question templates in the refrigerator field. Here, the standard question template is used to standardize user question information. For random and irregular user question information, standardized standard question information can be obtained based on key information and standard question templates. It can be understood that the complete question information can be regarded as Prompt content, and the actual meaning of the standard question information is the same as that of the user question information, but the form of the standard question information is more standardized and contains more prompt content, which is easy for the generative model to understand its meaning.

[0061] Table 1

[0062]

[0063] The disclosed embodiment can limit each intent label to correspond to only one standard question template, which can meet the professional requirements in specific scenarios on the one hand, and avoid the problem of poor model output experience caused by fuzzy intent classification on the other hand. In addition, once the intent label is determined, the corresponding standard question template can be located, and there is no need to further select the standard question template from multiple templates, which can improve the efficiency and accuracy of obtaining subsequent standard question information and improve the response speed of the model.

[0064] For example, if the user questions are "What is the nutritional value of watermelon" and "What are the benefits of eating watermelon for children", the answer information of these two user questions will contain the nutritional value of "watermelon", but the disclosed embodiment configures different intent labels and standard question templates for these two user questions. Among them, the intent label corresponding to the user question information "What is the nutritional value of watermelon" is "asking about food nutrition", and the intent label corresponding to the user question information "What are the benefits of eating watermelon for children" is "asking about the nutritional value of food for a specific group of people". By configuring different intent labels for user question information with similar meanings, it helps to improve the refinement and accuracy of the intent labels, thereby making the answer information output by the generative model more stable and in line with user expectations.

[0065] S203: The processor inputs the standard question information into the generative model, and obtains answer information of the user's question information based on the generative model.

[0066] The disclosed embodiment can determine a standard question template that matches the intention label of the user's question information, and accurately extract key information from the random and irregular user question information based on the intention label. Based on the key information and the standard question template, the standardized standard question information of the user's question information can be obtained, and the standardized standard question information can be input into the generative model to improve the stability of the output effect of the generative model.

[0067] It should be noted here that the stability of the output effect of the generative model has the following four levels of standards:

[0068] Standard 1: The answer information output by the generative model is consistent with common sense;

[0069] Standard 2: The answer information output by the generative model should be as comprehensive as possible;

[0070] Criterion 3: The length of the answer information output by the generative model is appropriate;

[0071] Standard 4: When a single user's question information is input and output, the answer information output by the generative model meets standards 1, 2 and 3. In addition, the disclosed example can also reduce the cost of fine-tuning and training of large models in the early stage. In terms of the data prepared in the fine-tuning stage, because in the task-based dialogue scenario, the dialogue system faces the user directly, and the user's questions are usually short and highly colloquial, and the user does not spend too much time constructing prompt words when interacting with the generative model. To solve such problems, engineers must fully consider these issues during the model fine-tuning stage. Specifically, in the related technology, when constructing a fine-tuning data set, it is necessary to fully consider the possible question forms to ensure that Figure 1 In the case of consistency, different corpora can be used as input to obtain consistent output. In this way, when constructing a fine-tuning training set, engineers need to spend a lot of time generalizing the question information. Compared with the related art, the embodiment of the present disclosure attempts to alleviate such problems from the questioning stage, by constructing a standard question template and filling key information in the standard question template to stabilize the model output. This method has low engineering difficulty, and the construction process is controllable, easy to adjust and convenient to iterate.

[0072] In some embodiments, the question-answering method for a generative model further includes: inputting the user's question information into the generative model without identifying the intent label of the user's question information, and obtaining answer information for the user's question information based on the generative model.

[0073] In combination with the electronic device provided by the embodiment of the present disclosure, the embodiment of the present disclosure provides another question-answering method for a generative model, such as Figure 3 As shown in Figure 1, the question answering method for generative models includes the following steps:

[0074] S301, the processor identifies the intention tag of the user's question information.

[0075] If the intention tag of the user's question information is identified, continue to execute step S302; if the intention tag of the user's question information is not identified, continue to execute step S305.

[0076] S302: When an intention tag of the user's question information is identified, the processor determines a standard question template corresponding to the intention tag.

[0077] S303: The processor extracts key information from the user's question information based on the intention tag, and obtains standard question information of the user's question information based on the key information and the standard question template.

[0078] S304, the processor inputs the standard question information into the generative model, and obtains answer information of the user's question information based on the generative model.

[0079] S305: When the intention label of the user's question information is not identified, the processor inputs the user's question information into a generative model, and obtains answer information of the user's question information based on the generative model.

[0080] In some embodiments, the key information is a keyword, and the standard question template includes empty slots, each of which is configured with a word type. Extracting key information from the user's question information based on the intent tag, and obtaining standard question information of the user's question information based on the key information and the standard question template include: extracting keywords corresponding to the word type from the user's question information based on the word type indicated by the intent tag; and filling each keyword into the empty slot corresponding to the word type in the standard question template to obtain standard question information of the user's question information.

[0081] In the disclosed embodiment, keywords are used as key information, and the word type indicated by each intent tag is pre-configured. By identifying the word type indicated by the intent tag, effective keywords can be quickly and accurately extracted from the user's question information. At the same time, in the standard question template, after obtaining the keywords, by filling the keywords into the empty slots of the corresponding word type in the standard question template, standardized standard question information can be obtained, which helps to improve the efficiency of obtaining standard question information.

[0082] In combination with the electronic device provided by the embodiment of the present disclosure, the embodiment of the present disclosure provides another question-answering method for a generative model, such as Figure 4 As shown in Figure 1, the question answering method for generative models includes the following steps:

[0083] S401, the processor identifies the intention tag of the user's question information.

[0084] If the intention tag of the user's question information is identified, the process continues with step S402 ; if the intention tag of the user's question information is not identified, the process continues with step S406 .

[0085] S402: When an intention tag of the user's question information is identified, the processor determines a standard question template corresponding to the intention tag.

[0086] S403: The processor extracts keywords corresponding to the word type from the user's question information based on the word type indicated by the intention tag.

[0087] S404: The processor fills each keyword into an empty slot of a corresponding word type in the standard question template to obtain standard question information of the user's question information.

[0088] Here, the standard question template includes empty slots, each of which is configured with a word type. Here, for the corresponding intent tag and the standard question template, the word type indicated by the intent tag is the same as the word type configured in the empty slot in the standard question template.

[0089] At the same time, the standard question template also includes basic speech information. The basic speech information is used to guide the generative model to more accurately understand the meaning of the user's question information, and to standardize the format and style of the answer information output by the generative model. Optionally, the basic speech information can be generated based on the Prompt method, or it can be configured by people in related fields.

[0090] For example, the user's question information is "What is the nutritional value of watermelon?" The intent label of the user's question information is "Ask about food nutrition" in Table 1. The standard question template corresponding to the intent label is "Now please play the role of a nutritionist, please discuss the nutritional questions I raised in points, and tell me how to eat or cook the ingredients to maximize their nutritional value. What is the nutritional value of {"slot" = "food"}?" In the above standard question template, "Now please play the role of a nutritionist, please discuss the nutritional questions I raised in points, and tell me how to eat or cook the ingredients to maximize their nutritional value" is the basic speech information, and {"slot" = "food"} is an empty slot. Among them, slot is the name of the empty slot, and food is the word type corresponding to the empty slot.

[0091] The word type indicated by the intent tag "Ask about food nutrition" is food, and the word type corresponding to the empty slot {"slot"="food"} is also food. Therefore, when the user's question information is "What is the nutritional value of watermelon", "watermelon" can be extracted as a keyword, and "watermelon" can be filled into the empty slot {"slot"="food"} of the standard question template, so as to obtain the standard question information "Now please play the role of a nutritionist, please discuss the nutritional questions I raised point by point, and tell me how to eat or cook the ingredients to maximize their nutritional value. May I ask: What is the nutritional value of watermelon?"

[0092] S405: The processor inputs the standard question information into the generative model, and obtains answer information of the user's question information based on the generative model.

[0093] S406: When the intention label of the user's question information is not identified, the processor inputs the user's question information into the generative model, and obtains answer information of the user's question information based on the generative model.

[0094] In some embodiments, the intent tag indicates only one word type, and the user question information only includes one keyword corresponding to the word type. When the intent tag indicates only one word type, and one keyword corresponding to the word type is extracted from the user question information, each keyword is filled into an empty slot of the corresponding word type in the standard question template to obtain standard question information of the user question information, including: filling a keyword into an empty slot of the corresponding word type in the standard question template to obtain standard question information of the user question information.

[0095] In some embodiments, the intent tag indicates multiple word types, and the user question information includes a keyword corresponding to each word type. When the intent tag indicates multiple word types, and a keyword corresponding to each word type is extracted from the user question information, each keyword is filled into an empty slot of the corresponding word type in the standard question template to obtain standard question information of the user question information, including: filling each keyword into an empty slot of the corresponding word type in the standard question template to obtain standard question information of the user question information.

[0096] For example, the user's question information is "What are the benefits of eating watermelon for children?" The intent label of the user's question information is "asking about the nutritional value of food for a specific group of people", and the word types indicated by the intent label include "person" and "food". The keywords in the user's question information include "children" corresponding to "person" and "watermelon" corresponding to "food".

[0097] The standard question template corresponding to the intent tag is "Now please play the role of a nutritionist and discuss the nutrition question I raised point by point. What are the benefits of {"slot"="people"} eating {"slot"="food"}?". Among them, the word type corresponding to the empty slot {"slot"="people"} is "character", and the word type corresponding to {"slot"="food"}} is "food".

[0098] Fill "children" into the empty slot {"slot" = "people"}, and fill "watermelon" into the empty slot {"slot" = "food"}, and you will get the standard question information "Now please play the role of a nutritionist and discuss the nutrition question I raised point by point. What are the benefits of eating watermelon for children?"

[0099] In some embodiments, the intent tag indicates only one word type, and the user question information includes multiple keywords corresponding to the word type. When the intent tag indicates only one word type, and multiple keywords corresponding to the word type are extracted from the user question information, each keyword is filled into an empty slot corresponding to the word type in the standard question template to obtain standard question information of the user question information, including: filling each keyword into the empty slot corresponding to the word type in the standard question template in turn to obtain multiple standard question information of the user question information. Inputting the standard question information into the generative model, and obtaining answer information of the user question information based on the generative model, including: inputting multiple standard question information into the generative model, and obtaining answer information of the user question information based on the generative model.

[0100] For example, if a user asks "What are the nutritional values ​​of watermelons and bananas?", the intent tag of the user's question is "Ask about food nutrition", and the standard question template corresponding to the intent tag is "Now please play the role of a nutritionist, discuss the nutritional questions I raised point by point, and tell me how to eat or cook the ingredients to maximize their nutritional value. What is the nutritional value of {"slot"="food"}?".

[0101] The word type indicated by the intent tag "ask about food nutrition" is food, and the word type corresponding to the empty slot {"slot"="food"} is also food. Therefore, when the user's question information is "what is the nutritional value of watermelon", "watermelon" and "banana" can be extracted as keywords.

[0102] First, fill "watermelon" into the empty slot of the standard question template {"slot" = "food"}, and get a standard question information "Now please play the role of a nutritionist, please discuss the nutrition question I raised in points, and tell me how to eat or cook the food to maximize the nutritional value of the food. What is the nutritional value of watermelon?" Only fill "banana" into the empty slot of the standard question template {"slot" = "food"}, and get a standard question information "Now please play the role of a nutritionist, please discuss the nutrition question I raised in points, and tell me how to eat or cook the food to maximize the nutritional value of the food. What is the nutritional value of banana?" The above two standard question information are input into the generative model, and the answer information of the user's question information is obtained based on the generative model.

[0103] In some embodiments, the intent tag indicates multiple word types, and the user question information includes multiple keywords corresponding to the same word type. In the case where the intent tag indicates multiple word types, and multiple keywords corresponding to the same word type are extracted from the user question information, each keyword is filled into an empty slot of the corresponding word type in the standard question template to obtain standard question information of the user question information, including: grouping the keywords corresponding to the multiple word types to obtain multiple keyword combinations, wherein each keyword combination includes a keyword corresponding to each word type; filling each keyword in each keyword combination into an empty slot of the corresponding word type in the standard question template in turn to obtain multiple standard question information of the user question information. Inputting the standard question information into the generative model, and obtaining the answer information of the user question information based on the generative model, includes: inputting multiple standard question information into the generative model, and obtaining the answer information of the user question information based on the generative model.

[0104] For example, the user's question information is "What are the benefits of eating watermelon and banana for children?" The intent label of the user's question information is "asking about the nutritional value of food for a specific group of people", and the word types indicated by the intent label include "person" and "food". The keywords in the user's question information include "children" corresponding to "person", and "watermelon" and "banana" corresponding to "food".

[0105] The standard question template corresponding to the intent tag is "Now please play the role of a nutritionist and discuss the nutrition question I raised point by point. What are the benefits of {"slot"="people"} eating {"slot"="food"}?". Among them, the word type corresponding to the empty slot {"slot"="people"} is "character", and the word type corresponding to {"slot"="food"}} is "food".

[0106] After grouping the keywords corresponding to the various word types, multiple keyword combinations are obtained. Specifically, "children" and "watermelon" are grouped together to obtain the first keyword combination; "children" and "banana" are grouped together to obtain the second keyword combination.

[0107] For the first keyword combination, fill "children" into the empty slot {"slot" = "people"}, fill "watermelon" into the empty slot {"slot" = "food"}, and get a standard question information "Now please play the role of a nutritionist, please discuss the nutrition question I raised point by point, may I ask: what are the benefits of children eating watermelon?" For the second keyword combination, fill "children" into the empty slot {"slot" = "people"}, fill "banana" into the empty slot {"slot" = "food"}, and get another standard question information "Now please play the role of a nutritionist, please discuss the nutrition question I raised point by point, may I ask: what are the benefits of children eating bananas?".

[0108] In combination with the electronic device provided by the embodiment of the present disclosure, the embodiment of the present disclosure provides another question-answering method for a generative model, such as Figure 5 As shown in Figure 1, the question answering method for generative models includes the following steps:

[0109] S501: The processor identifies the intention tag of the user's question information.

[0110] If the intention tag of the user's question information is identified, the process continues with step S502 ; if the intention tag of the user's question information is not identified, the process continues with step S506 .

[0111] S502: When an intention tag of the user's question information is identified, the processor determines a standard question template corresponding to the intention tag.

[0112] S503: The processor extracts a plurality of keywords corresponding to the word type from the user question information based on the word type indicated by the intention tag.

[0113] S504: The processor sequentially fills each keyword into an empty slot of a corresponding word type in the standard question template to obtain multiple standard question information of the user's question information.

[0114] S505: The processor inputs a plurality of standard question information into a generative model, and obtains answer information of the user's question information based on the generative model.

[0115] In some embodiments, multiple standard question information is input into a generative model, and answer information of the user's question information is obtained based on the generative model, including: inputting multiple standard question information into the generative model in sequence, and obtaining answer information of each standard question information in sequence based on the generative model; and splicing the answer information of multiple standard question information into answer information of the user's question information.

[0116] Here, the input order of the plurality of standard question information may be determined according to the generation time of the standard question information. For example, the standard question information generated first is input into the generative model first.

[0117] Optionally, each time a standard question is obtained, the latest standard question can be input into the generative model, and the answer information of the latest standard question can be obtained based on the generative model. In this way, the process of generating standard question information and the process of obtaining the answer information of the standard question can be executed in parallel, which can shorten the time of obtaining the answer information of the user's question information.

[0118] Optionally, concatenating the answer information of the plurality of standard question information into the answer information of the user question information includes: concatenating the answer information of the plurality of standard question information head to tail to obtain the answer information of the user question information.

[0119] Here, the answer information of the plurality of standard question information may be concatenated head to tail according to the input sequence of the standard question information, wherein the answer information of the standard question information input first is in front and the answer information of the standard question information input later is in the back.

[0120] In some embodiments, multiple standard question information is input into a generative model, and answer information of the user's question information is obtained based on the generative model, including: splicing multiple standard question information into standard fused question information; inputting the standard fused question information into the generative model, and obtaining answer information of the user's question information based on the generative model.

[0121] Optionally, the multiple standard question information is spliced ​​into the standard fusion question information, including: splicing the multiple standard question information head to tail to obtain the standard fusion question information. Here, the multiple standard question information can be spliced ​​head to tail according to the generation time of the standard question information. The first generated standard question information is in front, and the later generated standard question information is in the back.

[0122] S506: When the intention label of the user's question information is not identified, the processor inputs the user's question information into the generative model, and obtains answer information of the user's question information based on the generative model.

[0123] In combination with the electronic device provided by the embodiment of the present disclosure, the embodiment of the present disclosure provides another question-answering method for a generative model, such as Figure 6 As shown in Figure 1, the question answering method for generative models includes the following steps:

[0124] S601: The processor identifies the intention tag of the user's question information.

[0125] If the intention tag of the user's question information is identified, the process continues with step S602 ; if the intention tag of the user's question information is not identified, the process continues with step S607 .

[0126] S602: When an intention tag of the user's question information is identified, the processor determines a standard question template corresponding to the intention tag.

[0127] S603: The processor extracts keywords corresponding to each word type from the user's question information based on the multiple word types indicated by the intention tag.

[0128] In S603, the processor extracts multiple keywords corresponding to the same word type from the user's question information.

[0129] S604: The processor groups the keywords corresponding to the multiple word types to obtain multiple keyword combinations.

[0130] Each keyword combination contains one keyword for each word type.

[0131] S605: The processor sequentially fills each keyword in each keyword combination into an empty slot of a corresponding word type in a standard question template to obtain a plurality of standard question information of the user's question information.

[0132] S606: The processor inputs a plurality of standard question information into a generative model, and obtains answer information of the user's question information based on the generative model.

[0133] In some embodiments, multiple standard question information is input into a generative model, and answer information of the user's question information is obtained based on the generative model, including: inputting multiple standard question information into the generative model in sequence, and obtaining answer information of each standard question information in sequence based on the generative model; and splicing the answer information of multiple standard question information into answer information of the user's question information.

[0134] In some embodiments, multiple standard question information is input into a generative model, and answer information of the user's question information is obtained based on the generative model, including: splicing multiple standard question information into standard fused question information; inputting the standard fused question information into the generative model, and obtaining answer information of the user's question information based on the generative model.

[0135] S607: When the intention label of the user's question information is not identified, the processor inputs the user's question information into the generative model, and obtains answer information of the user's question information based on the generative model.

[0136] Combination Figure 7As shown, an embodiment of the present disclosure provides a question-answering device 700 for a generative model, and the question-answering device 700 for a generative model includes a processor (processor) 701 and a memory (memory) 702. Optionally, the device may also include a communication interface (Communication Interface) 703 and a bus 704. Among them, the processor 701, the communication interface 703, and the memory 702 can communicate with each other through the bus 704. The communication interface 703 can be used for information transmission. The processor 701 can call the logic instructions in the memory 702 to execute the question-answering method for the generative model of the above-mentioned corresponding embodiment.

[0137] In addition, the logic instructions in the memory 702 described above may be implemented in the form of software functional units and when sold or used as independent products, may be stored in a computer-readable storage medium.

[0138] The memory 702 is a computer-readable storage medium that can be used to store software programs and computer executable programs, such as program instructions / modules corresponding to the methods in the embodiments of the present disclosure. The processor 701 executes the functional application and data processing by running the program instructions / modules stored in the memory 702, that is, the question-answering method for the generative model of the above-mentioned corresponding embodiment is implemented.

[0139] The memory 702 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 702 may include a high-speed random access memory and may also include a non-volatile memory.

[0140] Combination Figure 1 As shown, an embodiment of the present disclosure provides an electronic device 100, which may be a computer, a mobile phone, an electrical device, etc. The electrical device includes a refrigerator, a freezer, an air conditioner, etc. The electronic device 100 includes a device body 101 and a question-answering device 700 for a generative model, and the question-answering device 700 for a generative model is installed on the device body 101. The installation relationship described here is not limited to placement inside the electronic device 100, but also includes installation connections with other components of the electronic device 100, including but not limited to physical connections, electrical connections, or signal transmission connections. It can be understood by those skilled in the art that the question-answering device 700 for a generative model can be adapted to a feasible device body 101, thereby realizing other feasible embodiments.

[0141] The present disclosure provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are configured to execute the above-mentioned question-answering method for a generative model. The above-mentioned computer-readable storage medium may be a transient computer-readable storage medium or a non-transient computer-readable storage medium.

[0142] The technical solution of the embodiment of the present disclosure can be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in the embodiment of the present disclosure. The aforementioned storage medium may be a non-transient storage medium, including: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes, or a transient storage medium.

[0143] The above description and the accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent possible changes only. Unless explicitly required, separate components and functions are optional, and the order of operation may vary. The parts and features of some embodiments may be included in or replace the parts and features of other embodiments. Moreover, the words used in the present disclosure are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and the claims, unless the context clearly indicates, the singular forms of "a", "an" and "the" are intended to include plural forms as well. Similarly, the term "and / or" as used in the present disclosure refers to any and all possible combinations of one or more associated listings. In addition, when used in the present disclosure, the term "comprise" and its variants "comprises" and / or comprising refer to the presence of stated features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method or device including the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the various embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.

[0144] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. The technicians may use different methods for each specific application to implement the described functions, but such implementations should not be considered to exceed the scope of the embodiments of the present disclosure. The technicians may clearly understand that, for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above may refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.

[0145] In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units can be only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to implement this embodiment. In addition, each functional unit in the embodiment of the present disclosure may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit.

[0146] The flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to the embodiment of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. In the description corresponding to the flowchart and the block diagram in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order from the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.

Claims

1. A question answering method for a generative model, characterized in that: include: Identify the intention tag of the user's question information, and determine a standard question template corresponding to the intention tag; Extracting key information from the user question information based on the intention tag, and obtaining standard question information of the user question information based on the key information and the standard question template; The standard question information is input into a generative model, and answer information of the user question information is obtained based on the generative model.

2. The method according to claim 1, characterized in that The key information is a keyword, the standard question template includes empty slots, and each empty slot is configured with a word type; The extracting key information from the user question information based on the intention tag, and obtaining standard question information of the user question information based on the key information and the standard question template, includes: Based on the word type indicated by the intention tag, extracting keywords corresponding to the word type from the user question information; Each keyword is filled into an empty slot of a corresponding word type in the standard question template to obtain standard question information of the user's question information.

3. The method according to claim 2, characterized in that In the case where the intention tag indicates only one word type, and multiple keywords corresponding to the word type are extracted from the user question information, the step of filling each keyword into an empty slot corresponding to the word type in the standard question template to obtain standard question information of the user question information includes: sequentially filling each keyword into an empty slot corresponding to the word type in the standard question template to obtain multiple standard question information of the user question information; The step of inputting the standard question information into a generative model and obtaining answer information of the user question information based on the generative model comprises: inputting a plurality of the standard question information into a generative model and obtaining answer information of the user question information based on the generative model.

4. The method according to claim 2, characterized in that: In the case where the intention tag indicates multiple word types, and multiple keywords corresponding to the same word type are extracted from the user question information, the step of filling each keyword into an empty slot of the corresponding word type in the standard question template to obtain standard question information of the user question information includes: grouping the keywords corresponding to the multiple word types to obtain multiple keyword combinations, wherein each keyword combination includes a keyword corresponding to each word type; and sequentially filling each keyword in each keyword combination into an empty slot of the corresponding word type in the standard question template to obtain multiple standard question information of the user question information; The step of inputting the standard question information into a generative model and obtaining answer information of the user question information based on the generative model comprises: inputting a plurality of the standard question information into a generative model and obtaining answer information of the user question information based on the generative model.

5. The method according to claim 3 or 4, characterized in that: The step of inputting the plurality of standard question information into a generative model and obtaining answer information of the user question information based on the generative model comprises: Inputting a plurality of the standard question information into a generative model in sequence, and obtaining answer information of each of the standard question information in sequence based on the generative model; The answer information of the plurality of standard question information is concatenated into the answer information of the user question information.

6. The method according to claim 3 or 4, characterized in that: The step of inputting the plurality of standard question information into a generative model and obtaining answer information of the user question information based on the generative model comprises: splicing a plurality of the standard question information into a standard fusion question information; The standard fusion question information is input into a generative model, and answer information of the user question information is obtained based on the generative model.

7. The method according to claim 1, characterized in that Also includes: In a case where the intention label of the user question information is not identified, the user question information is input into a generative model, and answer information of the user question information is obtained based on the generative model.

8. A question-answering device for a generative model, comprising a processor and a memory storing program instructions, characterized in that: The processor is configured to execute the question-answering method for a generative model as described in any one of claims 1 to 7 when running the program instructions.

9. An electronic device, characterized in that: include: Equipment body; The question-answering device for generative models as described in claim 8 is installed in the device body.

10. A storage medium storing program instructions, characterized in that: When the program instructions are executed, the question-answering method for a generative model according to any one of claims 1 to 7 is executed.

Citation Information

Cited By

  • Intention recognition method, system and related device

    CN120973908A