Response method and device, electronic equipment and storage medium
By extracting sentence intent information when the large language model generates the response text and filling in the target attribute information in the pre-stored voucher record, the problem of the large language model fabricating false data in the consultation scenario is solved, and the accuracy and reliability of the response are improved. .
Patent Information
- Application Number
- CN202410461055.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-16
- Publication Date
- 2024-09-17
AI Technical Summary
There is randomness in the large language model when generating response text in consultation scenarios, and it may fabricate false data, resulting in reduced response accuracy. Especially when the business logic is complex, it is difficult to accurately identify the intention of the questioner and provide accurate information.
The initial response text is generated by inputting the question text into the text generation model, extracting the statement intention information, obtaining the target response template, and filling in the target attribute information in the pre-stored voucher record to generate the target response text to avoid the randomization process of the text generation model. fabricating false data.
It improves the accuracy and reliability of responses, ensures the accuracy of response text and the correctness of numerical values, reduces the risk of misleading the questioner, and optimizes the quality of responses.
Smart Images

Figure CN118656453A
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and in particular to a response method, device, electronic device and storage medium. Background Art
[0002] With the development of electronic technology, the application of big language models is becoming more and more extensive. Big language models are deep learning models trained based on massive text data. They can not only generate natural language text, but also deeply understand the meaning of text and handle various natural language tasks such as text summarization, question answering, translation, etc.
[0003] In the consulting scenario, the robot agent can use the response text generated by the large language model to answer the questions raised by the user. However, the text generated by the large language model is random. In the case of complex business logic, the large language model may fabricate false data, reducing the accuracy of the response. Summary of the invention
[0004] The embodiments of the present application provide a response method, device, electronic device and storage medium to improve the accuracy of response.
[0005] In a first aspect, an embodiment of the present application provides a response method, including:
[0006] Inputting the first question text into the text generation model for text generation processing to obtain an initial answer text; the first question text describes the question raised by the questioner regarding the target voucher;
[0007] If the initial answer text includes sentence intention information, extracting the prompt information provided by the question object from the initial answer text, and acquiring a target answer template for the first question text according to the sentence intention information;
[0008] In the pre-stored voucher record, determining the target attribute information of the target voucher according to the prompt information;
[0009] The target response template is filled in according to the target attribute information to obtain a target response text.
[0010] In a second aspect, an embodiment of the present application provides a response device, including:
[0011] A generating unit is used to input a first question text into a text generating model for text generating processing to obtain an initial answer text; the first question text describes a question raised by the questioner regarding the target voucher;
[0012] an acquisition unit, configured to extract the prompt information provided by the question object from the initial response text if the initial response text includes sentence intention information, and to acquire a target response template for the first question text according to the sentence intention information;
[0013] a determination unit, configured to determine target attribute information of the target credential in a pre-stored credential record according to the prompt information;
[0014] A filling unit is used to fill the target response template according to the target attribute information to obtain a target response text.
[0015] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor; and a memory configured to store computer-executable instructions, wherein the computer-executable instructions, when executed, cause the processor to execute the response method as described in the first aspect.
[0016] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium for storing computer-executable instructions, which, when executed by a processor, implement the response method as described in the first aspect.
[0017] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the response method as described in the first aspect.
[0018] It can be seen that in the embodiments of the present application, on the one hand, the text generation model has the advantage of high flexibility in situations where question answering is required. It can give appropriate answers to various expressions of the same type of questions and can more accurately identify the intention of the questioning object. Therefore, the sentence intention information and prompt information included in the initial answer text generated by the text generation model are highly accurate, which is conducive to accurately querying the corresponding target answer template and target credential. On the other hand, by filling in the target answer template to obtain the target answer text, the words used to answer the questioning object can be standardized, and the target attribute information filled in the target answer template is determined in the pre-stored credential record using the prompt information, rather than automatically completed by the text generation model. This can avoid the text generation model from fabricating false data in the process of randomized text generation, thereby improving the accuracy of the answer. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative labor.
[0020] Figure 1 A schematic diagram of an implementation environment of a response method provided in an embodiment of the present application;
[0021] Figure 2 A processing flow chart of a response method provided in an embodiment of the present application;
[0022] Figure 3 A processing flow chart of another response method provided in an embodiment of the present application;
[0023] Figure 4 A schematic diagram of a response device provided in an embodiment of the present application;
[0024] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to enable 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 clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments of the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0026] This specification provides an embodiment of a response method:
[0027] In the consultation scenario, the user asks the agent a question, and the agent answers the user's question based on the user's pre-stored user information stored in the system and the pre-trained business process. However, manual answers require a lot of human resources, and with the increase in the number of consultations and the diversification of consultation questions, manual work is gradually unable to meet the consultation needs, and more and more robot agents are being put into use.
[0028] The large language model can generate the corresponding answer text after receiving the question text, so the use of large language models is becoming more and more common in consulting scenarios. Robot agents supported by large language models are very effective in handling questions with diverse expressions, but large language models are random when performing text generation processing, and the text generation effect is affected by the question text. In the case of complex business logic and multiple rounds of dialogue between the robot agent and the user, the large language model sometimes fabricates false data to fool the user. This has a huge negative impact in consulting scenarios. False data may mislead the questioner, causing the robot agent's answer to not only fail to meet the questioner's consulting needs, but also give wrong guidance.
[0029] Taking the financial scenario as an example, in multiple rounds of conversations, the large language model will give a targeted response to each question it receives. Considering that customers may switch topics at any time in different documents, the large language model is random when generating text, complex business logic, and flexible switching of topics. The above factors may cause the large language model to fabricate false data when generating text, resulting in inaccurate responses provided to customers.
[0030] Therefore, in order to solve the above problem, an embodiment of the present application provides a response method.
[0031] The response method provided in one or more embodiments of this specification may be applicable to the implementation environment of the response method, such as Figure 1 As shown, the implementation environment at least includes a server 101 for generating a target response text.
[0032] The server 101 may be a single server, or a server cluster consisting of a plurality of servers, or one or more cloud servers in a cloud computing platform, for generating a target response text.
[0033] In this implementation environment, during the process of generating a target response text, the server 101 first inputs the first question text into the text generation model for text generation processing to obtain an initial response text; the first question text describes the question asked by the questioner regarding the target credential; then, if the initial response text includes sentence intention information, the prompt information provided by the questioner is extracted from the initial response text, and the target response template of the first question text is obtained based on the sentence intention information; then, in the pre-stored credential record, the target attribute information of the target credential is determined based on the prompt information; finally, the target response template is filled in based on the target attribute information to obtain the target response text. Therefore, on the one hand, the text generation model has the advantage of high flexibility in situations where answering questions is required. It can give appropriate answers to various expressions of the same type of questions and can more accurately identify the intention of the questioner. Therefore, the sentence intention information and prompt information included in the initial answer text generated by the text generation model are very accurate, which is conducive to accurately querying the corresponding target answer template and target voucher. On the other hand, by filling in the target answer template to obtain the target answer text, the words used to answer the questioner can be standardized, and the target attribute information filled in the target answer template is determined in the pre-stored voucher record using the prompt information, rather than automatically completed by the text generation model. This can avoid the text generation model from fabricating false data in the process of randomized text generation, thereby improving the accuracy of the answer.
[0034] Figure 2 A processing flow chart of a response method provided in an embodiment of the present application. Figure 2 The answering method provided in this embodiment specifically includes steps S202 to S208:
[0035] Step S202, inputting the first question text into the text generation model for text generation processing to obtain an initial response text; the first question text describes the question raised by the questioner regarding the target voucher.
[0036] The first question text is used to describe the question asked by the questioner regarding the target credential.
[0037] It should be emphasized that the question object in this application refers to the party who actively asks the question, rather than the party who accepts the question. The question object can be the user who asks the question.
[0038] For example, user 1 asks the robot agent when his / her voucher 1 expires. User 1 is the question subject, and the text used to describe the question "when does voucher 1 expire" is the first question text.
[0039] The number of target credentials can be one or more.
[0040] Credentials can be documents, receipts, detailed explanations, evidence, etc. used as proof.
[0041] Exemplarily, the voucher may be a promissory note, an order, a ticket, and so on.
[0042] Before step S202 is executed, text input by a user may be received and used as the first question text.
[0043] For example, the first question text 1 is: How many installments do I have left to pay back from the loan I took out last year?
[0044] In addition, considering that in actual applications, when a user makes a request / instruction, the request / instruction may be rejected by the business party for some reasons, in order to ensure user experience, the business party often needs to give an explanation after rejecting the user, or make some feasible suggestions. In the conversation, although the request / instruction raised by the user is not a question, the business party needs to explain why the request / instruction is rejected, or make some recommendations, etc. The business party's reply to the request / instruction raised by the user is equivalent to a response to it.
[0045] The first question text in this embodiment may also be replaced by a first request / first instruction. The first request may carry a first request text describing the request made by the questioner for the target credential. The same is true for the first instruction.
[0046] For example, the first request text 1 is: I want to issue a settlement certificate for the loan from last year.
[0047] A user can be associated with one or more credentials.
[0048] For example, the voucher is a promissory note. User 1 has conducted three resource lending transactions with a resource lending institution. The three resource lending transactions have corresponding promissory notes. The resource lending institution stores the pre-stored user information of the user, and the pre-stored user information includes three promissory notes and attribute information of each promissory note.
[0049] The text generation model can be an LLM (Large Language Model), for example, ChatGPT (Chat Generative Pre-trained Transformer), bloom (BigScienceLarge Open-science Open-access Multilingual Language Model), Baichuan model, etc.
[0050] In specific implementation, the first question text is input into the text generation model for text generation processing to obtain the initial response text. The first question text can be used as a prompt word (Prompt), and the prompt word is input into the text generation model for text generation processing to obtain the initial response text.
[0051] The text generation process may be a text completion process.
[0052] It should be noted that during the text generation process, the text generation model does not perform calculation / query operations. The text generation model can obtain some knowledge reserves through training in advance. Based on the knowledge reserves, the text generation model can automatically complete the text when receiving the prompt word.
[0053] The first question text is input into a text generation model for text generation processing to obtain an initial response text. Alternatively, matching processing can be performed based on the first question text and a preset question set to obtain a target question text that matches the first question text. The target question text is used as a prompt word and the prompt word is input into a text generation model for text generation processing to obtain an initial response text.
[0054] In a specific implementation, matching processing is performed based on the first question text and the preset question set to obtain a target question text that matches the first question text. The text similarities between the first question text and each preset question text in the preset question set can be calculated and sorted respectively, and based on the sorting result, the preset text text with the greatest similarity to the first text question text is determined, and the preset text text with the greatest text similarity is used as the target question text.
[0055] The text generation model in this embodiment is obtained by inputting manually annotated data into the initial text generation model for model training.
[0056] The following is an explanation of the training process of the text generation model:
[0057] First, get the conversation data.
[0058] Taking the consulting scenario as an example, the conversation data may be the conversation data between the customer and the human agent, and the conversation data is related to the voucher. Specifically, in the conversation data, the customer asks the human agent questions related to the voucher, and the human agent responds to the question.
[0059] A portion of the conversation data may include time-type data and may also include numerical-type data that is not related to time.
[0060] In the case where the conversation data is related to the voucher, each time-type data / number-type data may reflect attribute information of the voucher in one dimension, or may be unrelated to the voucher.
[0061] For example, the conversation data includes: "Can my three IOUs be settled in advance?" Among them, "3" is a digital type data, which reflects the attribute information of the voucher "IOU" in one dimension.
[0062] For another example, the conversation data includes: "I asked about your order in March, but you haven't replied to me yet." "March" is a time type data, but this time type data cannot reflect the attribute information of the voucher "order" in one dimension, so this time type data can be considered to be irrelevant to the voucher "order".
[0063] The attribute information of the credential describes the characteristics of the credential in the corresponding dimension.
[0064] For different types of credentials, attribute information of the credential in multiple dimensions can be pre-configured.
[0065] Taking the voucher as an IOU as an example, the attribute information of the voucher includes but is not limited to: the number of IOUs, the number of repayment periods, the amount owed, the loan date, the repayment date, the IOU processing conditions, coupons, overdue information, etc.
[0066] Taking the ticket as an example, the attribute information of the ticket includes but is not limited to: ticket identification, departure place, destination, departure time, arrival time, ticket type, ticket price, etc.
[0067] By sorting out time type data and number type data, multiple statement intention information related to the voucher can be obtained.
[0068] Before using the conversation data as training samples for model training, the conversation data needs to be annotated. During the annotation process, the attribute information of the voucher can be used as a digital type, and the digital type of the time type data / digital type data in the conversation data can be annotated, and the sentence intent information of each sentence in the conversation data can be annotated. In addition, the voucher identifier can also be annotated for the time type data / digital type data in the conversation data.
[0069] In the case where there are multiple vouchers, each voucher may have a unique corresponding voucher identification. Each time type data / digital type data may be related to one or more vouchers.
[0070] It should be noted that if the time type data / number type data in a statement is not related to the voucher, there is no need to mark the numeric type of the time type data / number type data. In addition, if there is no time type data / number type data related to the voucher in a statement, it can be regarded that the statement has no voucher-related intention, and there is no need to mark the statement intention information of the statement.
[0071] The sentence intent information of each sentence can reflect the question / answer about which one or several dimensions of attribute information of the credential the sentence is expressing.
[0072] In specific implementation, the digital type of the time type data / digital type data can be marked by the first marking symbol, and the sentence intention information can be marked by the second marking symbol. When marking the sentence intention information of a sentence, the sentence intention information can be placed after the sentence.
[0073] The digital type of digital type data in the sentence is marked by the first marking symbol, which can be to use the digital type data as the first subtext, the digital type of the digital type data as the second subtext, and the first marking symbol, the first subtext and the second subtext together to obtain a first synthetic text. In the sentence, the digital type data is replaced by the first synthetic text. The first marking symbol can be used in pairs. Specifically, in the first synthetic text, the first subtext is located between the paired first marking symbols, and the second subtext is located between the paired first marking symbols.
[0074] The technical concept of marking the digital type of time type data in a sentence by the first marking symbol is the same and will not be repeated here.
[0075] The sentence intention information of the sentence can be marked by the second marking symbol, and the sentence intention information can be used as the third subtext, and the second marking symbol and the third subtext are spliced together to obtain a second synthetic text, and the second synthetic text is spliced after the sentence. The second marking symbol can be used in pairs. Specifically, in the second synthetic text, the third subtext is located between the paired first marking symbols.
[0076] It should be noted that the ordinal numbers such as "first" and "second" appearing in this specification are only for the convenience of distinguishing different features and have no actual meaning.
[0077] For example, conversation data 1 includes:
[0078] Customer 1: How many installments do I have left to repay my loan?
[0079] Agent 1: I’ve checked here for you and you have 3 periods left.
[0080] The first marking symbol is <>, and the second marking symbol is 《. The digital type data "3 installments" is marked by the first marking symbol, and its digital type is "repayment period number". In addition, the statement of the human agent 1 "I checked here for you, you have 3 installments left" is marked by the second marking symbol, and its statement intention information is "repayment period number".
[0081] Specifically, the digital type data "3 periods" can be used as the first subtext, the digital type "repayment period number" of the digital type data "3 periods" can be used as the second subtext, and the first marking symbol "<>", the first subtext and the second subtext can be spliced together to obtain the first synthetic text "<3 periods: repayment period number>". In the dialogue data 1, the digital type data "3 periods" is replaced by the first synthetic text. After the replacement process, the dialogue data 1 includes: I have checked here for you, you have <3 periods: repayment period number> left.
[0082] In addition, the sentence intention information "repayment period" can be used as the third subtext, and the second marking symbol "《》" can be spliced with the third subtext to obtain the second synthetic text "《Repayment period》", and the second synthetic text can be spliced after the sentence. After splicing, the dialogue data 1 includes: I have checked here for you, and you have <3 periods: repayment period> left. 《Repayment period》
[0083] For another example, conversation data 2 includes:
[0084] Customer 2: I would like to settle the account early.
[0085] Agent 2: I see that you have three IOUs, and none of them have been fully repaid for three installments. You need to pay them off before we can settle the account.
[0086] The first marking symbol is <>, and the second marking symbol is 《. The digital type data "three" is marked by the first marking symbol, and its digital type is "number of IOUs". The digital type data "full three installments" is marked by the first marking symbol, and its digital type is "processing conditions". In addition, the statement of the manual seat 2 "I see that you have three IOUs, and none of them have been fully repaid for three installments. You need to pay them off before you can settle the account" is marked by the second marking symbol, and its statement intention information is "IOU information".
[0087] Specifically, the digital type data "three transactions" can be used as the first subtext 1, the digital type "number of IOUs" of the digital type data "three transactions" can be used as the second subtext 1, and the first marking symbol "<>", the first subtext 1 and the second subtext 1 can be spliced together to obtain the first synthetic text 1 "<three transactions: number of IOUs>". The digital type data "full three installments" can be used as the first subtext 2, the digital type "number of IOUs" of the digital type data "three transactions" can be used as the second subtext 2, and the first marking symbol "<>", the first subtext 2 and the second subtext 2 can be spliced together to obtain the first synthetic text 2 "<full three installments: processing conditions>". In the dialogue data 2, the digital type data "three transactions" is replaced by the first synthetic text 1, and after the digital type data "full three installments" is replaced by the first synthetic text 2, the dialogue data 2 includes: I see that you have <three transactions: number of IOUs>, and you have not repaid <full three installments: processing conditions>, and you need to repay them before you can settle them.
[0088] In addition, the sentence intention information "loan information" can be used as the third sub-text, and the second marking symbol "《》" can be spliced with the third sub-text to obtain the second synthetic text "《loan information》", and the second synthetic text can be spliced after the sentence. After splicing, the dialogue data 2 includes: I see that you have <three: number of loan notes> loan notes, and you have not paid <full three installments: processing conditions>. You need to pay them off before you can settle. 《loan information》
[0089] The annotated conversation data is used as training samples, and the training samples are input into the initial text generation model for iterative training to obtain a text generation model.
[0090] The initial text generation model may be an LLM whose parameters are to be trained.
[0091] The following is a specific example to illustrate the effect of using the text generation model trained through the above training process.
[0092] For the sake of distinction, the model obtained by training the initial text generation model using conversation data that has not been specially annotated can be called large model 1, and the text generation model obtained by training the initial text generation model through the above-mentioned training process can be called large model 2.
[0093] The large model 1 receives the first question text 1: How late is my one thousand dollar bill?
[0094] The large model 1 uses the first question text 1 as a prompt to perform text generation processing, and obtains the answer text 1: This is the fifth period, for your reference.
[0095] After receiving the first question text 1, the large model 2 uses the first question text 1 as a prompt to generate text and obtains the answer text 2: This is the fifth installment: A. Number of repayment periods>, for your reference.
[0096] Among them, "A" is the IOU identifier, the first "repayment period" is the digital type of the digital data "five periods". The value "five periods" may be accurate or it may be a number made up by the big model. The second "repayment period" is the sentence intent information.
[0097] Step S204: If the initial response text includes sentence intention information, the prompt information provided by the question object is extracted from the initial response text, and the target response template of the first question text is obtained according to the sentence intention information.
[0098] The initial response text may or may not include sentence intent information.
[0099] In specific implementation, after the initial response text is generated, it can be detected whether the initial response text includes sentence intention information: if the initial response text includes sentence intention information, the prompt information provided by the questioning object is extracted from the initial response text, and the target response template of the first question text is obtained according to the sentence intention information; if the initial response text does not include sentence intention information, the first question text is answered according to the initial response text.
[0100] In addition, if the initial response text does not include sentence intention information, it can be determined that the initial response text does not include the prompt information provided by the questioner.
[0101] It should be emphasized that the sentence intent information in the embodiments of the present application does not refer to intent information outside the initial response text obtained by performing intent recognition processing on the initial response text. Rather, since the text generation model used in the embodiments of the present application has been trained with special annotated data, when any initial response text includes time type data / numeric type data and the time type data / numeric type data is related to the voucher, the text generation model will automatically generate sentence intent information in the process of generating the initial response text, and the sentence intent information is part of the content of the initial response text.
[0102] The sentence intention information may be a subtext marked by a second marking symbol in the initial response text. The second marking symbol may be pre-defined and configured.
[0103] For example, the initial response text is "Hello, you still have three installments left on the IOU in March. "Repayment period"", where "" and "》" are paired second marking symbols, and "Repayment period" is the sentence intent information of the initial response text.
[0104] The prompt information provided by the questioner may be a subtext marked by a first marking symbol in the initial answer text. The first marking symbol may be pre-defined and configured.
[0105] For example, the first marking symbol may include “<” and ">”. When the initial response text includes sentence intention information, it can be determined that the initial response text includes at least one pair of “<” and ">”. Furthermore, the sub-text located between the pair of “<” and ">” can be determined as the prompt information provided by the question object and extracted.
[0106] For example, the initial response text 1 is: You still have <4 installments: number of repayment periods> to repay.
[0107] Among them, the character string between a pair of “<” and ">” is “4 installments: number of repayment periods”. The prompt information provided by the questioner is extracted from the initial response text 1 to obtain “4 installments: number of repayment periods”.
[0108] Exemplarily, the prompt information may include one or more of the following: digital information, the digital type of the digital information, and a credential identifier corresponding to the digital information, and the like.
[0109] Before obtaining the target answer template of the first question text according to the sentence intention information, a plurality of sentence intention information and the answer template corresponding to each sentence intention information may be pre-configured.
[0110] Each response template may include a pre-designed response script and may also include attribute information to be filled in.
[0111] For ease of understanding, an exemplary response template is shown below in conjunction with Table 1:
[0112]
[0113] Table 1
[0114] As shown in Table 1, the “Template Name” of the response template is “Promissory Note Information”. Each response template may have a unique corresponding template name or template identifier.
[0115] "Whether the IOU number can be located" is a feature of the response template. The response template "IOU information" cannot locate the IOU number.
[0116] The template content of the response template "loan information" can be understood as follows: if it is determined that the questioner meets the settlement conditions, then "I see that the amount of {field 2} borrowed from {field 1} can be settled" is filled in and returned to the questioner; if it is determined that the questioner does not meet the settlement conditions, then "I see that the amount of {field 2} borrowed from {field 1} cannot be settled due to {field 3} {field 4} {field 5}" is filled in and returned to the questioner.
[0117] The "template field" is used to represent the attribute information to be filled in the template content of the response template "loan information".
[0118] The target answer template may include no attribute information to be filled in, or may include one or more attribute information to be filled in.
[0119] The target answer template of the first question text is obtained according to the sentence intention information. The target answer template of the first question text can be obtained by performing query processing in a pre-configured correspondence table between intentions and answer templates according to the sentence intention information. The correspondence table between intentions and answer templates includes multiple sentence intention information and answer templates corresponding to each sentence intention information.
[0120] By querying the pre-configured correspondence table between intent and response templates according to the sentence intent information, the response template corresponding to the sentence intent information can be obtained, and the response template corresponding to the sentence intent information is used as the target response template.
[0121] In a specific implementation, the response method also includes: if the initial response text includes a second marking symbol, determining the division position in the initial response text according to the second marking symbol; dividing the initial response text according to the division position to obtain a target sub-text, and using the target sub-text as the sentence intention information of the initial response text.
[0122] The division position in the initial response text is determined according to the second marking symbol. The division position may be the position of the second marking symbol in the initial response text or the sum / difference of the position of the second marking symbol in the initial response text and a preset value.
[0123] For example, the position of the second marking symbol in the initial response text can be represented by the serial number "10", that is, the 10th character in the initial response text is the second marking symbol. The division position in the initial response text is determined according to the second marking symbol, and the division position in the initial response text can be represented by the serial number "10" or by the sum of the serial number "10" and the preset value "1" "11".
[0124] The initial response text is divided according to the division position to obtain the target sub-text. The initial response text may be divided according to the division position to obtain multiple sub-texts, and the target sub-text is determined in the multiple sub-texts based on the positional relationship between the pre-configured target sub-text and the second marking symbol.
[0125] For example, the preconfigured positional relationship between the target subtext and the second marking symbol may be that the target subtext is located after the second marking symbol. The preconfigured positional relationship between the target subtext and the second marking symbol may also be that the target subtext is located between two second marking symbols used in pairs.
[0126] The second marking symbol may be a symbol used independently or in pairs.
[0127] For example, the second marking symbol is "*", which can be used independently. If the initial response text includes "*", the position of "*" in the initial response text can be determined as the division position in the initial response text. The initial response text is divided according to the division position to obtain subtext 1 before "*" and subtext 2 after "*" in the initial response sentence. Subtext 2 is the target subtext, and the target subtext is used as the sentence intention information of the initial response text.
[0128] For another example, the second marking symbols include "《" and "》", and the second marking symbols can be used in pairs. If the initial response text includes both "《" and "》", the position of "《" in the initial response text can be determined as a division position in the initial response text, and the position of "》" in the initial response text can be determined as another division position in the initial response text. By dividing the initial response text according to the division positions, two or three sub-texts can be obtained, among which the sub-text between "《" and "》" is the target sub-text, and the target sub-text is used as the sentence intention information of the initial response text.
[0129] Based on a technical concept similar to that of the present implementation, the prompt information provided by the questioning object is extracted from the initial response text, including: determining a second division position in the initial response text according to a first marking symbol; dividing the initial response text according to the second division position to obtain a second target sub-text, and using the second target sub-text as the prompt information provided by the questioning object.
[0130] It should be noted that, in the case where the initial response text includes sentence intention information, it can be determined that the initial response text includes prompt information, and there is no need to determine whether the initial response text includes the prompt information provided by the questioner.
[0131] In a specific implementation, the answering method further includes: if the initial answering text includes preset type characters, and it is determined that the preset type characters do not belong to prompt information, then using the preset general template as the target answering text.
[0132] In specific implementation, it is possible to first detect whether the initial response text includes sentence intention information: if so, extract the prompt information provided by the questioning object from the initial response text, and obtain the target response template of the first question text according to the sentence intention information; if not, it can be determined that the initial response text does not include the prompt information. In the case where the initial response text does not include the prompt information, it is possible to detect whether the initial response text includes preset type characters: if so, it can be determined that the initial response text includes preset type characters, and it is determined that the preset type characters do not belong to the prompt information, and then, the preset general template can be used as the target response text to perform response processing on the first question text according to the target response text; if not, the first question text can be processed according to the initial response text.
[0133] The preset type character may be numeric type data / time type data.
[0134] The preset general template may be a general speech template that does not include attribute information to be filled in.
[0135] For example, please check the contract and the contract information shall prevail.
[0136] In addition, it is also possible to first detect whether the initial response text includes preset type characters, and then detect whether the initial response sentence includes sentence intent information.
[0137] Alternatively, it is also possible to first detect whether the initial response text includes a preset type of character, and then determine whether the preset type of character is marked by a first marking symbol.
[0138] Step S206, determining the target attribute information of the target credential in the pre-stored credential record according to the prompt information.
[0139] The credential record may include attribute information of each credential in the credential set of the questioning object.
[0140] In the case where the credential set of the question object includes multiple credentials, the prompt information can be used as a reference for locating the target credential among the multiple credentials.
[0141] The credential set of the questioning subject may include one or more credentials possessed by the questioning subject.
[0142] The number of target credentials may be one or more.
[0143] The voucher record may also include attribute information of each voucher in the voucher record of the question object.
[0144] Each credential may have attribute information of one or more dimensions.
[0145] In the pre-stored voucher record, the target attribute information of the target voucher is determined according to the prompt information. The target voucher can be determined in the voucher record according to the prompt information, and the attribute information of one or more dimensions of the target voucher is obtained, and the attribute information is used as the target attribute information.
[0146] In a specific implementation, the prompt information includes a credential identifier; in the pre-stored credential record, the target attribute information of the target credential is determined according to the prompt information, including: filtering the credential set of the question object according to the credential identifier to obtain the target credential; querying the attribute information of the target credential to obtain the target attribute information.
[0147] Each credential has a unique corresponding credential identifier.
[0148] The number of credential identifiers included in the prompt information may be one or more.
[0149] The credential set includes one or more credentials possessed by the questioning subject.
[0150] When the number of credential identifiers included in the prompt information is one, the credential set of the question object is screened according to the credential identifier to obtain the target credential. The credential identifier can be used to query the credential set to obtain a credential corresponding to the credential identifier and use it as the target credential.
[0151] In the case where the number of credential identifiers included in the prompt information is multiple, the credential set of the question object is screened according to the credential identifier to obtain the target credential, which can be that for each credential identifier included in the credential prompt information, a credential corresponding to the credential identifier is queried in the credential set according to the credential identifier, and the credential is added as the target credential to the target credential set. The target credential set includes the target credential corresponding to each credential identifier in the prompt information.
[0152] By querying the attribute information of the target credential, you can get the target attribute information.
[0153] In a specific implementation, the prompt information includes the digital type of the digital information; in the pre-stored credential record, the target attribute information of the target credential is determined according to the prompt information, including: if the digital type meets the preset prompt information judgment condition, each credential in the credential set is determined as the target credential; the attribute information of the target credential is queried to obtain the target attribute information.
[0154] The prompt information judgment condition may be a judgment condition pre-configured for a digital type, and the judgment condition is used to determine whether the initial answer text involves each voucher in the voucher set of the question object.
[0155] For example, the preset digital types include digital type 1, digital type 2, digital type 3, etc. If the credential prompt information includes digital type 1 and digital type 2, it is determined that the digital type meets the preset prompt information judgment condition, and each credential in the credential set of the question object can be added as a target credential to the target credential set, and then the attribute information of each target credential in the target credential set is queried to obtain the target attribute information.
[0156] In addition, the sentence intention information can also be used to determine whether the initial response text involves each credential in the credential set of the question object.
[0157] In specific implementation, if the statement intent information belongs to a preset intent set, each credential in the credential set is determined as a target credential; the attribute information of the target credential is queried to obtain the target attribute information.
[0158] Step S208, filling in the target response template according to the target attribute information to obtain the target response text.
[0159] The target response template may include one or more attribute information to be filled in. In the case where the target response template includes multiple attribute information to be filled in, each attribute information to be filled in may have the same attribute type or may have different attribute types.
[0160] The target response template is filled in according to the target attribute information to obtain the target response text. This may be the case where the attribute information to be filled in the target response template is filled in according to the target attribute information to obtain the target response text.
[0161] For example, the attribute type of the attribute information to be filled in the target response template is the number of repayment periods, and the target attribute information includes the number of repayment periods "5 periods". According to the target attribute information "5 periods", the attribute information "[number of repayment periods]" to be filled in the target response template "You still have [number of repayment periods] to repay" is filled in to obtain the target response text "You still have 5 periods to repay".
[0162] After the target answer template is filled according to the target attribute information to obtain the target answer text, the first question text can be answered according to the target answer text. Specifically, the target answer text can be displayed to the questioning object.
[0163] Responding using the target response text obtained after filling in the target response template has the advantage of planned response words.
[0164] It should be noted that the answering method provided in the embodiment of the present application utilizes the text generation model's powerful intent recognition capability for user questions during natural language conversations. However, considering that the essence of the initial response text generated by the text generation model is text completion and no query operation is performed, fabricated data may occur in the actual production environment, misleading the questioner. Therefore, the target response template and the text generation model are combined to jointly generate the target response text.
[0165] If you use a template to answer directly, there may be the following problems: Since the first question text entered by the questioner may be more colloquial, it is easy to make mistakes when determining the appropriate answer template and locating the target credential, which may lead to irrelevant answers when answering. If you use a text generation model to answer directly, there may be the following problems: Although the text generation model can understand the user's intention well, the text generation model essentially uses the knowledge learned by the model to complete the text, rather than performing query operations, and may falsify values, fabricate wrong data, and mislead the questioner. The answering method provided in the embodiment of the present application combines the advantages of the text generation model and the template, which can accurately locate the intention of the questioner and the target credential that the questioner is interested in, and can give the questioner a numerically accurate reply.
[0166] In a specific implementation, a target response template is filled in according to target attribute information to obtain a target response text, including: determining the attribute type to be filled in the target response template; filtering the target attribute information according to the attribute type to be filled; and filling the target response template according to the filtered target attribute information to obtain a target response text.
[0167] Each answer template has one or more template fields, each of which represents an attribute type of attribute information to be filled.
[0168] When the target answer template includes more than or equal to two branch templates, the attribute type to be filled in the target answer template can be determined by first determining the target branch template suitable for the question object based on the attribute information of the target credential, and then reading the template field in the target branch template, and determining the attribute type to be filled based on the template field.
[0169] For example, two branch templates are configured in the template content: if it is determined according to the target attribute information of the target voucher that the questioning object meets the settlement conditions, then the target branch template suitable for the questioning object is determined to be branch template 1: "I see that the amount of {field 2} borrowed from {field 1} can be settled"; if it is determined according to the target attribute information of the target voucher that the questioning object does not meet the settlement conditions, then the target branch template suitable for the questioning object is determined to be branch template 2: "I see that the amount of {field 2} borrowed from {field 1} cannot be settled due to {field 3} {field 4} {field 5}".
[0170] When the target branch template is branch template 2, the template fields in the target branch template are read to obtain: field 1, field 2, field 3, field 4, and field 5. The attribute type to be filled can be determined according to the template fields.
[0171] The target attribute information of the target credential obtained by executing step S206 may be attribute information of the target credential in multiple dimensions, where each dimension represents an attribute type.
[0172] By filtering the target attribute information according to the attribute type to be filled, the filtered target attribute information can be obtained, and then the target response template can be filled according to the filtered target attribute information to obtain the target response text.
[0173] The reason why the first question text is input into the text generation model for text generation processing to obtain the initial answer text is that the text generation model has the advantage of high flexibility in situations where question answers are required. It can give appropriate answers to various expressions of the same type of questions, and it greatly saves human resources. However, considering that the text generated by the text generation model is random and is greatly affected by the prompts, and the business logic may be complex in actual applications, the questioner as a real human may not be very logical and coherent when asking questions, and may switch topics at any time. All of the above factors may cause the text generation model to talk nonsense when answering, return inaccurate information to the questioner, and mislead the questioner. By combining the text generation model and the target answer template, in the consultation scenario, the accuracy of the answer can be improved, the risk of misleading the questioner can be reduced, and the answer quality can be optimized.
[0174] In a specific implementation, the prompt information includes digital information; after the target answer template is filled in according to the target attribute information to obtain the target answer text, the answer method also includes: comparing the filled-in information and the digital information in the target answer text; if the filled-in information is the same as the digital information, answering the first question text according to the initial answer text; if the filled-in information is different from the digital information, answering the first question text according to the target answer text.
[0175] The prompt information includes digital information, and the digital information may be time type data / digital type data.
[0176] Considering the randomness of the text generated by the text generation model, the digital information may be accurate information or it may be erroneous information fabricated by the text generation model.
[0177] The fill information in the target response text refers to the data filled into the target response template. The fill information can be target attribute information or target attribute information after screening.
[0178] The filled-in information is compared with the digital information: if the comparison results are the same, that is, the filled-in information is the same as the digital information, it means that the digital information in the initial response text is accurate information, and the first question text can be answered based on the initial response text; if the comparison results are different, that is, the filled-in information is different from the digital information, it means that the digital information in the initial response text is erroneous information fabricated by the text generation model, then the target response text with accurate numerical values is used to answer the first question text.
[0179] By comparing the filled-in information with the digital information, it is possible to promptly discover whether the digital information in the initial response text is accurate, which is helpful for calibrating the digital information.
[0180] In such Figure 2In the illustrated embodiment, first, a first question text is input into a text generation model for text generation processing to obtain an initial response text; the first question text describes the question asked by the questioner regarding the target credential; then, if the initial response text includes sentence intention information, the prompt information provided by the questioner is extracted from the initial response text, and a target response template for the first question text is obtained based on the sentence intention information; then, in the pre-stored credential record, the target attribute information of the target credential is determined based on the prompt information; finally, the target response template is filled in based on the target attribute information to obtain the target response text. Therefore, on the one hand, the text generation model has the advantage of high flexibility in situations where answering questions is required. It can give appropriate answers to various expressions of the same type of questions and can more accurately identify the intention of the questioner. Therefore, the sentence intention information and prompt information included in the initial answer text generated by the text generation model are very accurate, which is conducive to accurately querying the corresponding target answer template and target voucher. On the other hand, by filling in the target answer template to obtain the target answer text, the words used to answer the questioner can be standardized, and the target attribute information filled in the target answer template is determined in the pre-stored voucher record using the prompt information, rather than automatically completed by the text generation model. This can avoid the text generation model from fabricating false data in the process of randomized text generation, thereby improving the accuracy of the answer.
[0181] Based on the same technical concept, taking the example of a promissory note in a financial scenario, the embodiment of the present application also provides another response method. Figure 3 A processing flow chart of another response method provided in an embodiment of the present application.
[0182] like Figure 3 As shown, step S302, data pre-processing.
[0183] Data preprocessing refers to the labeling of training samples.
[0184] Step S302 specifically includes the following sub-steps:
[0185] 1. Take inventory of manual conversation data and sort out the type templates of IOU numbers and time.
[0186] Taking the financial scenario as an example, the voucher can be a promissory note, and the manual conversation data can be the question-and-answer conversation data between the customer and the manual agent.
[0187] By combing through the manual conversation data, we can obtain one or more intentions related to the loan note.
[0188] For example, intention includes but is not limited to: all IOUs, number of IOUs, number of repayment periods, amount owed, loan date, repayment date, IOU processing conditions, coupons, overdue, etc.
[0189] The intention of each sentence, that is, the sentence intention information of the sentence, can reflect the question / answer about which one or several dimensions of attribute information of the IOU the sentence is expressing.
[0190] If a statement includes time type data / number type data related to the IOU, the statement has corresponding statement intention information.
[0191] For each intent, a corresponding response template can be pre-configured.
[0192] 2. Mark the user information field corresponding to the digital information in the conversation data.
[0193] In the manual dialogue data, the time type data / digital type data related to the loan note can be used as the user loan note information field. For each user loan note information field, its digital type can be marked, and its corresponding loan note identifier can also be marked.
[0194] In the manual dialogue data, for a sentence including at least one user loan information field, the sentence intention information of the sentence can be annotated.
[0195] 3. The digital template sorted out in the first step of the labeled user information mapping.
[0196] In a sentence, the user loan information field may be replaced by a synthetic text obtained by splicing the user loan information field and the annotation information of the user loan information field, and the sentence intention information may be spliced after the sentence.
[0197] For example, in a statement, the number "123" can be replaced by "<123: IOU field>", and the statement can be followed by "<IOU field>". Figure 1 》”.
[0198] Step S304: fine-tune the entire model.
[0199] Perform model training on large models.
[0200] The large model is a large language model, which can be referred to Figure 2 The text generation model in the embodiment.
[0201] Step S306: model post-processing.
[0202] Step S306 specifically includes the following sub-steps:
[0203] 1. The large model outputs the script with template information.
[0204] The large model output speech with template information means that the initial response text output by the large model includes a first marking symbol and a second marking symbol.
[0205] 2. Check whether the data in the big model’s words is completely equal to the corresponding IOU field data in the template.
[0206] Reference may be made to the corresponding description section of the aforementioned method embodiment for comparing the fill-in information and the digital information in the target response text.
[0207] 3. If they are not equal, directly output the template information; if they are equal, directly output the words of the large model.
[0208] Since the technical concept is the same, the description in this embodiment is relatively simple, and the relevant parts may refer to the corresponding description of the method embodiment provided above.
[0209] An embodiment of a response device provided in this specification is as follows:
[0210] In the above-mentioned embodiment, a response method is provided. Based on the same technical concept, the embodiment of the present application also provides a response device, which is described below in conjunction with the accompanying drawings.
[0211] Figure 4 A schematic diagram of a response device provided in an embodiment of the present application. This embodiment provides a response device 400, including:
[0212] A generating unit 402 is used to input a first question text into a text generation model for text generation processing to obtain an initial answer text; the first question text describes the question raised by the questioner regarding the target voucher;
[0213] The acquisition unit 404 is used to extract the prompt information provided by the question object from the initial response text if the initial response text includes sentence intention information, and to acquire a target response template of the first question text according to the sentence intention information;
[0214] A determination unit 406, configured to determine target attribute information of the target credential according to the prompt information in a pre-stored credential record;
[0215] The filling unit 408 is used to fill the target response template according to the target attribute information to obtain a target response text.
[0216] Optionally, the response device 400 further includes: a division unit;
[0217] The determining unit 406 is further configured to determine a division position in the initial response text according to the second marking symbol if the initial response text includes the second marking symbol;
[0218] The segmentation unit is used to segment the initial response text according to the segmentation positions to obtain a target subtext, and use the target subtext as the sentence intention information of the initial response text.
[0219] Optionally, the prompt information includes a credential identifier; when the determining unit 406 determines the target attribute information of the target credential according to the prompt information in the pre-stored credential record, the determining unit 406 performs the following steps:
[0220] Screening the credential set of the question object according to the credential identifier to obtain the target credential;
[0221] Query the attribute information of the target credential to obtain the target attribute information.
[0222] Optionally, the prompt information includes a digital type of digital information; when the determining unit 406 determines the target attribute information of the target credential according to the prompt information in the pre-stored credential record, the determining unit 406 performs the following steps:
[0223] If the digital type meets the preset prompt information judgment condition, each voucher in the voucher set is determined as the target voucher;
[0224] Query the attribute information of the target credential to obtain the target attribute information.
[0225] Optionally, the prompt information includes digital information; the response device 400 further includes: a comparison unit and a response unit;
[0226] The comparison unit is used to compare the filling information in the target response text with the digital information;
[0227] The response unit is used to, if the filling information is the same as the digital information, perform response processing on the first question text according to the initial response text; if the filling information is different from the digital information, perform response processing on the first question text according to the target response text.
[0228] Optionally, when the filling unit 408 fills the target response template according to the target attribute information to obtain the target response text, it performs the following steps:
[0229] Determining the attribute type to be filled in the target response template;
[0230] Screening the target attribute information according to the attribute type to be filled;
[0231] The target response template is filled in according to the target attribute information after the screening process to obtain the target response text.
[0232] Optionally, the determining unit 406 is further configured to:
[0233] If the initial response text includes characters of a preset type, and it is determined that the characters of the preset type do not belong to the prompt information, a preset general template is used as the target response text.
[0234] In an embodiment of the present application, the response device includes: a generation unit, which is used to input a first question text into a text generation model for text generation processing to obtain an initial response text; the first question text describes the question asked by the questioning object regarding the target credential; an acquisition unit, which is used to extract the prompt information provided by the questioning object from the initial response text if the initial response text includes sentence intention information, and to obtain a target response template for the first question text according to the sentence intention information; a determination unit, which is used to determine the target attribute information of the target credential according to the prompt information in a pre-stored credential record; and a filling unit, which is used to fill the target response template according to the target attribute information to obtain the target response text. Therefore, on the one hand, the text generation model has the advantage of high flexibility in situations where answering questions is required. It can give appropriate answers to various expressions of the same type of questions and can more accurately identify the intention of the questioner. Therefore, the sentence intention information and prompt information included in the initial answer text generated by the text generation model are very accurate, which is conducive to accurately querying the corresponding target answer template and target voucher. On the other hand, by filling in the target answer template to obtain the target answer text, the words used to answer the questioner can be standardized, and the target attribute information filled in the target answer template is determined in the pre-stored voucher record using the prompt information, rather than automatically completed by the text generation model. This can avoid the text generation model from fabricating false data in the process of randomized text generation, thereby improving the accuracy of the answer.
[0235] Corresponding to the above-described response method, based on the same technical concept, an embodiment of the present application further provides an electronic device, which is used to execute the above-provided response method. Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0236] like Figure 5As shown, the electronic device may have relatively large differences due to different configurations or performances, and may include one or more processors 501 and memory 502, and the memory 502 may store one or more storage applications or data. Among them, the memory 502 can be a temporary storage or a permanent storage. The application stored in the memory 502 may include one or more modules (not shown in the figure), and each module may include a series of computer executable instructions in the electronic device. Furthermore, the processor 501 can be configured to communicate with the memory 502 to execute a series of computer executable instructions in the memory 502 on the electronic device. The electronic device may also include one or more power supplies 503, one or more wired or wireless network interfaces 504, one or more input / output interfaces 505, one or more keyboards 506, etc.
[0237] In a specific embodiment, the electronic device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer executable instructions for the electronic device, and the one or more programs configured to be executed by one or more processors include the following computer executable instructions:
[0238] Inputting the first question text into the text generation model for text generation processing to obtain an initial answer text; the first question text describes the question raised by the questioner regarding the target voucher;
[0239] If the initial answer text includes sentence intention information, extracting the prompt information provided by the question object from the initial answer text, and acquiring a target answer template for the first question text according to the sentence intention information;
[0240] In the pre-stored voucher record, determining the target attribute information of the target voucher according to the prompt information;
[0241] The target response template is filled in according to the target attribute information to obtain a target response text.
[0242] The computer-readable storage medium provided in this embodiment is used to store computer-executable instructions. When the computer-executable instructions are executed by a processor, the following process is implemented:
[0243] Inputting the first question text into the text generation model for text generation processing to obtain an initial answer text; the first question text describes the question raised by the questioner regarding the target voucher;
[0244] If the initial answer text includes sentence intention information, extracting the prompt information provided by the question object from the initial answer text, and acquiring a target answer template for the first question text according to the sentence intention information;
[0245] In the pre-stored voucher record, determining the target attribute information of the target voucher according to the prompt information;
[0246] The target response template is filled in according to the target attribute information to obtain a target response text.
[0247] It should be noted that the embodiment of the computer-readable storage medium in this specification and the embodiment of the response method in this specification are based on the same inventive concept, so the specific implementation of this embodiment can refer to the implementation of the corresponding method mentioned above, and the repeated parts will not be repeated.
[0248] Another embodiment of the present application further provides a computer program product, the computer program product comprising a computer program, and when the computer program is executed by a processor, the following process is implemented:
[0249] Inputting the first question text into the text generation model for text generation processing to obtain an initial answer text; the first question text describes the question raised by the questioner regarding the target voucher;
[0250] If the initial answer text includes sentence intention information, extracting the prompt information provided by the question object from the initial answer text, and acquiring a target answer template for the first question text according to the sentence intention information;
[0251] In the pre-stored voucher record, determining the target attribute information of the target voucher according to the prompt information;
[0252] The target response template is filled in according to the target attribute information to obtain a target response text.
[0253] The computer program product in the embodiment of the present application can implement the various processes of the above-mentioned response method embodiment and achieve the same effects and functions, which will not be repeated here.
[0254] In an embodiment of the present application, first, the first question text is input into a text generation model for text generation processing to obtain an initial response text; the first question text describes the question asked by the questioning object regarding the target credential; then, if the initial response text includes sentence intention information, the prompt information provided by the questioning object is extracted from the initial response text, and the target response template of the first question text is obtained according to the sentence intention information; then, in the pre-stored credential record, the target attribute information of the target credential is determined according to the prompt information; finally, the target response template is filled in according to the target attribute information to obtain the target response text. Therefore, on the one hand, the text generation model has the advantage of high flexibility in situations where answering questions is required. It can give appropriate answers to various expressions of the same type of questions and can more accurately identify the intention of the questioner. Therefore, the sentence intention information and prompt information included in the initial answer text generated by the text generation model are very accurate, which is conducive to accurately querying the corresponding target answer template and target voucher. On the other hand, by filling in the target answer template to obtain the target answer text, the words used to answer the questioner can be standardized, and the target attribute information filled in the target answer template is determined in the pre-stored voucher record using the prompt information, rather than automatically completed by the text generation model. This can avoid the text generation model from fabricating false data in the process of randomized text generation, thereby improving the accuracy of the answer.
[0255] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0256] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the embodiments of the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this specification may adopt the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0257] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable electronic device to produce a machine, so that the instructions executed by the processor of the computer or other programmable electronic device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0258] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable electronic device to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0259] These computer program instructions may also be loaded onto a computer or other programmable electronic device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0260] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0261] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0262] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be 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 disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0263] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0264] Embodiments of the present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of the present specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communications network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0265] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0266] The above description is only an embodiment of this document and is not intended to limit this document. For those skilled in the art, this document may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this document should be included in the scope of the claims of this document.
Claims
1. A response method, characterized in that: include: Inputting the first question text into the text generation model for text generation processing to obtain an initial answer text; The first question text describes the question asked by the questioner regarding the target credential; If the initial answer text includes sentence intention information, extracting the prompt information provided by the question object from the initial answer text, and acquiring a target answer template for the first question text according to the sentence intention information; In the pre-stored voucher record, determining the target attribute information of the target voucher according to the prompt information; The target response template is filled in according to the target attribute information to obtain a target response text.
2. The method according to claim 1, characterized in that The method further comprises: If the initial response text includes a second marking symbol, determining a division position in the initial response text according to the second marking symbol; The initial response text is divided according to the division positions to obtain a target sub-text, and the target sub-text is used as the sentence intention information of the initial response text.
3. The method according to claim 1, characterized in that The prompt information includes a credential identifier; the target attribute information of the target credential is determined according to the prompt information in the pre-stored credential record, including: Screening the credential set of the question object according to the credential identifier to obtain the target credential; Query the attribute information of the target credential to obtain the target attribute information.
4. The method according to claim 1, characterized in that: The prompt information includes a digital type of digital information; the target attribute information of the target voucher is determined according to the prompt information in the pre-stored voucher record, including: If the digital type meets the preset prompt information judgment condition, each voucher in the voucher set is determined as the target voucher; Query the attribute information of the target credential to obtain the target attribute information.
5. The method according to claim 1, characterized in that The prompt information includes digital information; after the target response template is filled in according to the target attribute information to obtain the target response text, the following further includes: Compare the filling information in the target response text with the digital information; If the filling information is the same as the digital information, answer processing is performed on the first question text according to the initial answer text; If the filling information is different from the digital information, the first question text is answered according to the target answer text.
6. The method according to claim 1, characterized in that The filling process of the target response template according to the target attribute information to obtain the target response text includes: Determining the attribute type to be filled in the target response template; Screening the target attribute information according to the attribute type to be filled; The target response template is filled in according to the target attribute information after the screening process to obtain the target response text.
7. The method according to claim 1, characterized in that Also includes: If the initial response text includes characters of a preset type, and it is determined that the characters of the preset type do not belong to the prompt information, a preset general template is used as the target response text.
8. A response device, characterized in that: include: A generating unit, configured to input the first question text into a text generating model for text generating processing to obtain an initial answer text; The first question text describes the question asked by the questioner regarding the target credential; an acquisition unit, configured to extract the prompt information provided by the question object from the initial response text if the initial response text includes sentence intention information, and to acquire a target response template for the first question text according to the sentence intention information; a determination unit, configured to determine target attribute information of the target credential in a pre-stored credential record according to the prompt information; A filling unit is used to fill the target response template according to the target attribute information to obtain a target response text.
9. An electronic device, characterized in that: include: processor; And, a memory configured to store computer executable instructions, which, when executed, cause the processor to perform the response method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store computer-executable instructions, and the computer-executable instructions, when executed by a processor, implement the response method according to any one of claims 1 to 7.
11. A computer program product, characterized in that The invention comprises a computer program, which implements the response method according to any one of claims 1 to 7 when being executed by a processor.
