Dialogue processing and model training method and device, electronic equipment and storage medium

Through the dialogue processing method, the combination of the first model and the second model is used to process the label information of user question statements, which solves the problem of inaccuracy in the dialogue scenario, improves the accuracy and relevance of dialogue responses, and improves the improvement of the accuracy and relevance of dialogue responses. User experience.

CN119226462APending Publication Date: 2024-12-31MASHANG CONSUMER FINANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411259185.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-06
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

Existing artificial intelligence is difficult to provide accurate responses in dialogue scenarios, which leads to inaccuracy of response results, especially in highly demanding business logic scenarios, such as financial dialogue scenarios, which affect user experience.

Method used

By performing labeling information processing on user's question statements, a more accurate response statement is generated using the combination of the first model and the second model. The specific steps include: inputting the user's question statement into the first model to obtain the label information. If the label information changes, input the label information and dialogue data into the second model to generate a response statement to provide more relevant and accurate replies.

Benefits of technology

It improves the accuracy and relevance of dialogue responses, reduces the randomness of reply, ensures that more accurate information resource basis is provided in scenarios with strong business logic, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119226462A_ABST
    Figure CN119226462A_ABST
Patent Text Reader

Abstract

The invention provides a dialogue processing and model training method and device, electronic equipment and a storage medium, and the dialogue processing method comprises the steps: inputting a first question statement of a user into a first model, and obtaining first annotation information of the first question statement; second annotation information of a second question statement of the user is determined, the second question statement is adjacent to the first question statement, and the time of the second question statement is earlier than that of the first question statement; if the first annotation information is different from the second annotation information, inputting the first annotation information, the second annotation information and first dialogue data of the user into a second model, and generating a first response statement of the first question statement, the first dialogue data comprises a question statement of the user, a response statement of the question statement and annotation information corresponding to the question statement. Therefore, the response accuracy can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to dialogue processing and model training methods, devices, electronic devices, and storage media. Background Art

[0002] With the development of artificial intelligence, artificial intelligence can be applied in more and more scenarios. Artificial intelligence can be used to respond to users' questions. However, the information involved in different scenarios is diverse, and the business logic requirements are relatively strong. This may result in artificial intelligence being unable to respond accurately, reducing the accuracy of the response results. Summary of the invention

[0003] The present application provides a dialogue processing and model training method, device, electronic device, and storage medium to improve the accuracy of dialogue responses.

[0004] In a first aspect, the present application provides a conversation processing method, the conversation processing method comprising:

[0005] Inputting a first question statement of a user into a first model to obtain first annotation information of the first question statement, wherein the first annotation information is used to indicate the returned resource information corresponding to the first question statement;

[0006] Determine second annotation information of a second question statement of the user, where the second question statement is adjacent to the first question statement and the time of the second question statement is earlier than the time of the first question statement, and the second annotation information is used to indicate the return information resource corresponding to the second question statement;

[0007] If the first annotation information and the second annotation information are different, the first annotation information, the second annotation information, and the user's first conversation data are input into a second model to generate a first response statement to the first question statement, wherein the first conversation data includes the user's question statement, the response statement to the question statement, and the annotation information corresponding to the question statement.

[0008] In a second aspect, the present application provides a model training method, comprising:

[0009] Acquire second training data of the user, where the second training data includes multiple rounds of dialogue sentences, each round of the dialogue sentences including a question sentence of the user and a response sentence to the question sentence;

[0010] Inputting the question sentences of the user in each round into the first model to obtain the annotation information of the question sentences in each round;

[0011] If the fourth annotation information of the question sentence of the first round is different from the fifth annotation information of the question sentence of the second round, adding the third question sentence and the return resource corresponding to the fifth annotation information to the second training data;

[0012] The second model is trained based on the added second training data.

[0013] In a third aspect, the present application provides a dialogue processing device, the dialogue processing device comprising:

[0014] A first annotation module, used for inputting a first question statement of a user into a first model to obtain first annotation information of the first question statement, wherein the first annotation information is used for indicating the returned resource information corresponding to the first question statement;

[0015] A second annotation module is used to determine second annotation information of a second question statement of the user, where the second question statement is adjacent to the first question statement and the time of the second question statement is earlier than the time of the first question statement, and the second annotation information is used to indicate the return information resource corresponding to the second question statement;

[0016] A generation module is used to input the first annotation information, the second annotation information, and the user's first dialogue data into a second model if the first annotation information is different from the second annotation information, so as to generate a first response statement to the first question statement, wherein the first dialogue data includes the user's question statement, the response statement to the question statement, and the annotation information corresponding to the question statement.

[0017] In a fourth aspect, the present application provides an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores one or more computer programs executable by the at least one processor, and one or more of the computer programs are executed by the at least one processor so that the at least one processor can execute the above-mentioned dialogue processing method.

[0018] In a fifth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the above-mentioned dialogue processing method when executed by a processor.

[0019] In a sixth aspect, the present application provides a computer program product, comprising a computer-readable code, or a non-volatile computer-readable storage medium carrying a computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above-mentioned dialogue processing method.

[0020] In the embodiment provided by the present application, first annotation information of a first question statement and second annotation information of a second question statement are obtained. If the first annotation information and the second annotation information are different, the first annotation information, the second annotation information, and the first dialogue data of the user are input into a second model to generate a first response statement to the first question statement. In this way, during the dialogue, a response can be made based on the annotation information. The annotation information can characterize the returned information resources, and can provide a more accurate and effective basis for the response, thereby reducing the randomness of the response. In addition, the returned information resources asked by the user may change during the dialogue. By judging whether the first annotation information of the first question statement and the second annotation information of the second question statement are the same during the dialogue, if they are different, the first annotation information, the second annotation information, and the first dialogue data are all input into the second model for response, so that the response is more accurate, further improving the accuracy of the response.

[0021] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The accompanying drawings are used to provide a further understanding of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the present application and do not constitute a limitation of the present application. The above and other features and advantages will become more apparent to those skilled in the art by describing detailed example embodiments with reference to the accompanying drawings. In the accompanying drawings:

[0023] Figure 1 An application scenario diagram provided for an embodiment of the present application;

[0024] Figure 2 A flowchart of a conversation processing method provided in an embodiment of the present application;

[0025] Figure 3 A flowchart of a model training method provided in an embodiment of the present application;

[0026] Figure 4 A schematic diagram of the training and application process of the first model and the second model provided in an embodiment of the present application;

[0027] Figure 5 A block diagram of a conversation processing device provided in an embodiment of the present application;

[0028] Figure 6 A block diagram of a model training device provided in an embodiment of the present application;

[0029] Figure 7 A block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0030] In order to enable those skilled in the art to better understand the technical solution of the present application, the exemplary embodiments of the present application are described below in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0031] In the absence of conflict, the embodiments of the present application and the features therein may be combined with each other.

[0032] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.

[0033] The terms used herein are only used to describe specific embodiments and are not intended to limit the present application. As used herein, the singular forms "a" and "the" are also intended to include plural forms, unless the context clearly indicates otherwise. It will also be understood that when the terms "including" and / or "made of" are used in this specification, the presence of the features, wholes, steps, operations, elements and / or components is specified, but the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof is not excluded. "Connected" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect.

[0034] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and this application, and will not be interpreted as having an idealized or overly formal meaning unless explicitly defined herein.

[0035] In the technical solution of this application, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals. The use of user data in this technical solution complies with relevant national laws and regulations (for example, the "Information Security Technology Personal Information Security Specification", etc.). For example: corresponding prescribed measures are taken for personal information access control; prescribed restrictions are imposed on the display of personal information; the purpose of using personal information does not exceed the scope of direct or reasonable association; when using personal information, clear identity reference is eliminated to avoid precise positioning of specific individuals.

[0036] At present, in dialogue scenarios, such as financial dialogue scenarios, the accuracy requirements for consultations on some information such as repayment information are relatively high. If the response results based on artificial intelligence are inaccurate, it will have a greater adverse impact on users and reduce user experience. Therefore, in an embodiment of the present application, a dialogue processing method is provided to determine the first annotation information of the first question statement and the second annotation information of the second question statement. If the first annotation information and the second annotation information are different, the first annotation information, the second annotation information, and the user's first dialogue data are input into the second model to generate the first response statement of the first question statement. In this way, dialogue response through annotation information can provide a more effective and more relevant basis, and by judging whether the annotation information of the question statement changes during the dialogue process, a more accurate basis for returning resource information can be provided for the response to the first question statement, further improving the accuracy of dialogue response.

[0037] Figure 1 The application scenario diagram of the dialogue processing method and device provided in the embodiment of the present application is schematically shown.

[0038] like Figure 1 As shown, the application scenario of the embodiment of the present application may include a terminal device 101, a network 103 and a server 102. The network 103 is used to provide a medium for a communication link between the terminal device 101 and the server 102. The network 103 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0039] The user can use the terminal device 101 to interact with the server 102 through the network 103 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).

[0040] The terminal device 101 may be any electronic device having a display screen and supporting web browsing, including but not limited to a smart phone, a tablet computer, a laptop computer, a desktop computer, and the like.

[0041] The server 102 may be a server that provides various services, such as a background management server that provides support for websites browsed by users using the terminal device 101 (for example only). The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device. For example, in an embodiment of the present application, a user inputs a financial question through a financial application in the terminal device 101, and then the terminal device 101 sends a financial question consultation request to the server 102 through the network 103. The server 102 obtains a reply result of the financial question based on the second model, and returns the reply result to the terminal device 101.

[0042] It should be noted that the dialogue processing method and device provided in the embodiment of the present application can be executed by the server 102. Accordingly, the dialogue processing method and device provided in the embodiment of the present application can be set in the server 102. The dialogue processing method and device provided in the embodiment of the present application can also be executed by a server or server cluster that is different from the server 102 and can communicate with the terminal device 101 and / or the server 102. Correspondingly, the dialogue processing method and device provided in the embodiment of the present application can also be set in a server or server cluster that is different from the server 102 and can communicate with the terminal device 101 and / or the server 102. Of course, the dialogue processing method and device in the embodiment of the present application can also be executed by the terminal device 101, and this is not limited.

[0043] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.

[0044] Figure 2 A flowchart of a conversation processing method provided in an embodiment of the present application, the method comprising:

[0045] S201: Input a first question statement of a user into a first model to obtain first annotation information of the first question statement, where the first annotation information is used to indicate the returned resource information corresponding to the first question statement.

[0046] In an embodiment of the present application, in a human-computer interaction scenario, a user can have multiple rounds of conversations with artificial intelligence customer service or manual customer service. During the multiple rounds of conversations, conversation data will be generated. The first question statement can be any round of conversation during the multiple rounds of conversations. Among them, the method for the user to input the first conversation data is not limited in the embodiment of the present application, for example, it can be input through voice or text.

[0047] In an embodiment of the present application, the first annotation information can represent the resource return information of the business handled by the user. In the process of initiating a conversation between the user and the customer service, the user may need to consult about the business handled or handle a new business. Therefore, when the user asks a question, it can be determined based on the first question statement which business and resource return information the user currently wants to know, and the first annotation information of the user's first question statement can be determined.

[0048] S202: Determine second annotation information of a second question statement of the user, where the second question statement is adjacent to the first question statement and the time of the second question statement is earlier than the time of the first question statement, and the second annotation information is used to indicate the return information resource corresponding to the second question statement.

[0049] S203: If the first annotation information and the second annotation information are different, the first annotation information, the second annotation information, and the user's first dialogue data are input into the second model to generate a first response statement to the first question statement, wherein the first dialogue data includes the user's question statement, the response statement to the question statement, and the annotation information corresponding to the question statement.

[0050] In an embodiment of the present application, for example, during multiple rounds of conversations between a user and an artificial intelligence, the content of the consultation or questions asked is variable, and the inquiries are not necessarily directed to the same subject. Therefore, in an embodiment of the present application, annotation information can be determined for each round of conversation, so as to determine whether the annotation information of each round of conversation has changed, and determine the information provided to the second model, so as to improve the accuracy of the second model, reduce the amount of data, and improve processing efficiency.

[0051] During multiple rounds of dialogue, the first model and the second model can be used together to implement a dialogue processing method, where annotation information is determined based on the first model, and the annotation information is provided to the second model, and a response statement is obtained based on the second model.

[0052] In this embodiment, when the first annotation information of the first question statement is different from the second annotation information of the previous second question statement, it means that the user wants to ask other questions related to the return of resource information. At this time, the first dialogue data, the first annotation information and the second annotation information need to be input into the second model. The first dialogue data may include the first question statement, and the historical question statements and corresponding annotation information before the first question statement. Then, the historical dialogue data can be used as context information, and the first annotation information can be used as the main basis to perform semantic analysis on the first question statement, answer the first question statement, and obtain the first response statement.

[0053] For example, a user has three resource return information, namely the first, second and third. The first question statement is: How much of my n resources is left to be returned? It is determined that the user is inquiring about the second resource return information. The first resource return information inquired in the second question statement of the previous round, that is, the first annotation information and the second annotation information have changed. At this time, the second resource return information needs to be provided to the second model, and the historical conversation data can also be provided to the second model. The historical conversation data is used as the context information of the first question statement, which can further improve the accuracy. Then the second model can calculate through reasoning how much of the second resource return information is left to be returned, that is, obtain the first response statement of the first question statement.

[0054] Furthermore, in an embodiment of the present application, it also includes: if the first annotation information and the second annotation information are the same, the user's first dialogue data is input into the second model to generate a first response statement to the first question statement.

[0055] In an embodiment of the present application, when the first annotation information and the second annotation information are the same, it can be understood that the user is asking questions about the same returned resource information. In this case, only the historical first conversation data and the first question statement can be input into the second model, and then the second model can use the historical first conversation data as context information to perform semantic analysis on the first question statement to obtain the first response statement. In this way, when they are the same, it means that the returned information resource has not changed. The first annotation information can be omitted in this round of response, and the reply can be based on the historical first conversation data. Not only can accuracy be guaranteed, but the amount of information processed can also be reduced to a certain extent, thereby improving efficiency.

[0056] For example, a user has three resource return information, namely the first, second and third. The current first question statement is: Which period has my m resource been returned? It is determined that the user is inquiring about the first resource return information. The second question statement in the previous round also inquired about the first resource return information. At this time, when replying to the first question statement in the current round, there is no need to repeatedly input the first resource return information into the second model. The second model is based on the historical first conversation data, that is, it can obtain the first resource return information, and based on the first resource return information, analyze the first question statement to generate a first response statement.

[0057] In an embodiment of the present application, the first annotation information of the first question statement is determined, and the second annotation information of the second question statement is determined. If the first annotation information and the second annotation information are different, the first annotation information, the second annotation information, and the user's first dialogue data are input into the second model to generate a first response statement to the first question statement. In this way, by judging whether the annotation information corresponding to adjacent question statements is the same, if they are different, the first annotation information needs to be input into the second model, which can provide the second model with more accurate and relevant response basis and prompt information, thereby improving the accuracy of the response.

[0058] Furthermore, in the embodiments of the present application, the business scenarios in which the dialogue processing method is applied are not limited. For different business scenarios, the annotation information may be different, and the annotation information may also be understood as business information associated with the user in the business scenario. For example, business scenarios may include financial scenarios, educational scenarios, transportation scenarios, social communication scenarios, etc.

[0059] In a possible embodiment, in the case of multiple business scenarios, for the user's first question statement, it can be determined first which business scenario it belongs to, and then the first annotation information of the first question statement can be determined from the determined business scenario.

[0060] Specifically, the present application also provides possible implementation methods, including: 1) extracting dialogue keywords from the first question statement, where the frequency of occurrence of the dialogue keywords is higher than a preset threshold and / or the part of speech of the dialogue keywords is a preset part of speech.

[0061] In an embodiment of the present application, the method of extracting conversation keywords from the first question statement may specifically include: performing word segmentation processing on the first question statement to obtain each participle included in the first question statement; determining the occurrence frequency and / or part of speech of each participle, and determining the conversation keywords from each participle based on the occurrence frequency and / or part of speech.

[0062] For example, words with a frequency higher than a preset threshold are determined as conversation keywords. In the first question sentence, if the frequency of the word "repayment" is high and higher than the preset threshold, the word "repayment" is determined as a conversation keyword.

[0063] For another example, words with preset parts of speech are determined as conversation keywords. Nouns or attributives in the conversation may be more able to express business scenarios, such as "I want to see my IOU." "IOU" can better reflect the business scenario of the conversation. Therefore, the preset part of speech can be set to noun. Of course, the setting of the preset part of speech is not limited in the embodiments of the present application, and can be set according to actual needs and experience.

[0064] For another example, first determine the keywords in the first question sentence whose frequency of appearance is higher than a preset threshold and use them as candidate keywords. Then, based on the part of speech of each candidate keyword, determine the candidate keywords whose part of speech is the preset part of speech as dialogue keywords.

[0065] 2) Based on the conversation keywords, determine the first business scenario of the first question statement.

[0066] For example, the first business scenario corresponding to the conversation keyword can be determined according to the mapping relationship between the preset words and the business scenario, that is, the first business scenario determined as the first question statement. For example, if the keyword is loan, the business scenario can be determined to be a financial scenario.

[0067] 3) Determine first annotation information of the first question statement from the business data corresponding to the first business scenario.

[0068] In an embodiment of the present application, business data corresponding to the user may be stored in different business scenarios. Therefore, based on the first business scenario and for the first question statement, after obtaining the user's authorization and consent, the user's first annotation information may be obtained, wherein the first annotation information may be one or more and is not limited.

[0069] In this way, additional information that is more relevant to the user and the first question statement can be obtained, so that the first question statement can be analyzed in combination with the first annotation information, providing richer and more authentic basis for the answer and improving accuracy.

[0070] In a possible example, with respect to the above step S201 in which the user's first question statement is input into the first model to obtain first annotation information of the first question statement, a possible implementation method is also provided: multiple annotation information and the first question statement are input into the first model to obtain matching probabilities of the first question statement and the multiple annotation information; the matching probability with the highest probability value among the matching probabilities corresponding to the multiple annotation information is determined, and the annotation information corresponding to the matching probability with the highest probability value is determined as the first annotation information.

[0071] For example, in a financial scenario, if a user has three resource return information, the user's first question statement is: Which of my n resources is due for payment? Based on the first model, the first question statement can be matched with the user's three resource return information to ultimately determine which resource return information the user is inquiring about.

[0072] Furthermore, if the first question statement fails to match all the user's annotation information, the first model may output no-return resource information. In this case, the first annotation information associated with the first question statement may be no-return resource information.

[0073] In addition, in the embodiment of the present application, the implementation method for determining the second annotation information of the second question statement in the above step S202 is similar to the above method for determining the first annotation information of the first question statement, and will not be described in detail here. Of course, it can be understood that in the multi-round dialogue process, in the process of answering the current first question statement, the second question statement that is earlier than the first question statement at this time, that is, the historical dialogue data before the first question statement at this time, can be considered that the second annotation information of the second question statement has been determined when the second question statement was previously replied, so in the process of currently replying to the first question statement, the second question statement can be input into the first model to obtain the second annotation information of the second question statement.

[0074] The training process of the first model and the second model in the embodiment of the present application is described below.

[0075] In a possible embodiment, the first model is trained by the following method, including:

[0076] 1) Multiple third returned resource information of the user and each training question sentence of the user are concatenated to obtain multiple first training data.

[0077] 2) Label each first training data to obtain third labeling information of each first training data, where the third labeling information is used to indicate fourth return resource information corresponding to the training question statement in each first training data, and the fourth return resource information is the return resource information corresponding to the training question statement in multiple third return resource information.

[0078] 3) Training the first model according to each first training data and the third annotation information of each first training data.

[0079] This step specifically includes: inputting each first training data into the first model to obtain the predicted labeling information corresponding to each first training data; and training the first model according to the predicted labeling information, the third labeling information and the classification loss function.

[0080] In an embodiment of the present application, the problem of identifying the annotation information can be converted into a classification problem. The first model is trained based on the training data and the third annotation information until the training end condition is met, and the trained first model is obtained, wherein the input of the first model is all the returned resource information corresponding to the user and the user's question statement, and the output is the matching probability of each returned resource information category label, and the largest matching probability is selected as the annotation information finally determined by the first model.

[0081] Among them, in the embodiment of the present application, there is no restriction on the network structure of the first model. For example, a bidirectional encoder representation (Bidirectional Encoder Representations from Transformers) model based on the Transformer architecture is adopted. The Bert model is a pre-trained language model that can be fine-tuned through an additional output layer and can be applied to a variety of tasks.

[0082] In a possible embodiment, the second model is trained by the following method, including:

[0083] 1) Obtaining second training data of the user, the second training data includes multiple rounds of dialogue sentences, each round of dialogue sentences includes the user's question sentence and the answer sentence of the question sentence.

[0084] 2) Input the question sentences of each round of users into the first model to obtain the annotation information of each round of question sentences.

[0085] 3) If the fourth annotation information of the first round of question sentences is different from the fifth annotation information of the second round of question sentences, the returned resource information corresponding to the third question sentence and the fifth annotation information is added to the second training data.

[0086] For this step, the present application specifically provides a possible implementation scheme, including: adding the third question statement as a question statement adjacent to the second round of question statements to the second training data, and the time of the third question statement is later than the second round of question statements; adding the return resource information corresponding to the fifth annotation information as a response statement to the third question statement to the second training data.

[0087] 4) Training the second model based on the added second training data.

[0088] Among them, in an embodiment of the present application, for example, the second model can be a generative model, which is a large model. The generative model is fine-tuned based on the added second training data so as to be able to more accurately answer questions in the business scenario to which the resource return information belongs. For example, the trained second model can be obtained by training a new model based on the added second training data, and this is not limited in the embodiment of the present application.

[0089] Figure 3 A flowchart of a model training method provided in an embodiment of the present application, the method comprising:

[0090] S301: Acquire second training data of the user, where the second training data includes multiple rounds of dialogue sentences, and each round of dialogue sentences includes a question sentence of the user and a response sentence to the question sentence.

[0091] S302: Input the question statements of each round of users into the first model to obtain the annotation information of each round of question statements.

[0092] S303: If the fourth annotation information of the first round of question sentences is different from the fifth annotation information of the second round of question sentences, then the third question sentence and the returned resource information corresponding to the fifth annotation information are added to the second training data.

[0093] S304: Training a second model based on the added second training data.

[0094] In an embodiment of the present application, the annotation information of each round of question statements can be obtained through the first model, and it can be determined whether the annotation information of each adjacent round of question statements in multiple rounds of dialogue statements is the same. If it is different, a third round of question statements and the corresponding fifth annotation information are added, so that the second model can be trained to obtain it. In this way, more relevant annotation information can be provided to the second model during training, which improves the training accuracy, makes the response of the second model more accurate, and reduces the randomness of the response.

[0095] The following uses a specific application scenario for illustration. Taking business scenarios including financial scenarios as examples, the training process and online application of the first model and the second model in the embodiment of the present application are described. Figure 4 As shown, it is a schematic diagram of the training and application process of the first model and the second model provided in the embodiment of the present application, such as Figure 4 As shown, including:

[0096] Part I: Training process.

[0097] For the first model in the embodiment of the present application, Figure 4 As shown, the training process of the first model is:

[0098] 1) Obtain a training sample set.

[0099] Specifically, the present application provides a possible implementation method, which obtains complete conversation data, wherein the complete conversation data includes a user's question statement and a corresponding response statement, and then splits the complete conversation data to obtain the user's response statement, and splices each user's response statement with the user's multiple third returned resource information to obtain an unlabeled training sample set, wherein the training sample set includes multiple first training data, wherein the splicing format is, for example, multiple third returned resource information of the user + question statement.

[0100] The unlabeled training sample set is labeled to obtain third labeling information of each first training data.

[0101] For example, if there are at most five pieces of returned resource information, the target information label of each piece of returned resource information may include the first, second, third, fourth, fifth and no returned resource information. If a user's returned resource information includes returned resource information a and returned resource information b, and the user's question is "Please help me check which period my item that contains x resources has been returned", then the first training data after splicing is: "The first piece of returned resource information a; the second piece of returned resource information b + the second piece of returned resource information b + the piece of returned resource that contains x resources, please help me check which period my item that contains x resources has been returned". After labeling, the third labeling information of the first training data is: "The second piece", that is, the item containing x resources in the question refers to the returned resource information b.

[0102] 2) Train the first model.

[0103] That is, the first model can be trained according to each first training data and the third annotation information of each first training data.

[0104] For the second model in the embodiment of the present application, Figure 4 As shown, the training process for the second model is:

[0105] 1) Using the trained first model, for each round of question statements in the second training data, obtain labeling information for each round of question statements.

[0106] 2) Construct target training data based on the question statements and annotation information of each round.

[0107] Specifically, for the multiple rounds of conversations included in the second training data, determine whether the annotation information of each round of conversation in the multiple rounds is the same as the corresponding previous round of conversation. If they are the same, the same two rounds of conversations are not changed. If they are not the same, a new round of virtual conversation is inserted to obtain the target training data. The target training data can be understood as including the second training data and the inserted virtual conversation.

[0108] For example, in a multi-round dialogue process, the first question statement of the user in the first round of dialogue is: "I want to settle my pending resources in advance". Through the first model, it is determined that the first annotation information corresponding to the first question statement is: no returned resource information, which means that the first model has not located which return resource information the user wants to inquire about at this time. The second model performs semantic analysis on the first question statement and obtains the corresponding first response statement: "Which return resource information do you want to see?" Then, the user initiates a second round of dialogue. The second question statement of the user in the second round of dialogue is: "I want to see the one containing k resources". Through the first model, it is determined that the second annotation information corresponding to the second question statement is assumed to be: the second one. By judging that the second annotation information is different from the first annotation information, a virtual dialogue is inserted after the second question statement, for example, the virtual dialogue is: "What is the status of this second one", and the corresponding reply is: the second return resource information corresponding to the second one. Then, based on the second return resource information and historical dialogue data, the second model can obtain the second response statement of the second question statement: "I have found that the return resource information for this period is less than three periods, and it cannot be settled in advance if it is less than three periods."

[0109] 3) Training or fine-tuning the second model based on the target training data.

[0110] Part 2: Online application process.

[0111] In an embodiment of the present application, in actual applications, it is necessary for the first model and the second model to be used in coordination with each other. For example, in a certain application, a user opens an artificial intelligence interaction interface and enters the question he wants to ask in the input box. During multiple rounds of dialogue, for the user's first question statement in each round of dialogue, based on the first model, the first annotation information matching the first question statement is determined, and then based on the second model, according to the first annotation information, a semantic analysis is performed on the first question statement to obtain a first response statement.

[0112] In this way, in the embodiment of the present application, the first model and the second model are trained. When used online, the user and the artificial intelligence have a conversation. During multiple rounds of conversations, the matching annotation information is determined based on the first model, and the annotation information can be provided to the second model. In this way, external information prompts and basis can be input into the second model, making the answer to the question statement more accurate. Then, the second model can obtain the response statement based on the historical conversation data and annotation information, reducing the randomness of the response. For business scenarios with strong business logic, more accurate response statements can also be obtained.

[0113] It can be understood that the above-mentioned various method embodiments mentioned in this application can be combined with each other to form a combined embodiment without violating the principle logic. Due to space limitations, this application will not go into details. Those skilled in the art can understand that in the above-mentioned method of the specific implementation method, the specific execution order of each step should be determined by its function and possible internal logic.

[0114] In addition, the present application also provides a dialogue processing device, an electronic device, and a computer-readable storage medium, all of which can be used to implement any dialogue processing method provided by the present application. The corresponding technical solutions and descriptions are referred to in the corresponding records of the method part and will not be repeated here.

[0115] Figure 5 A block diagram of a conversation processing device provided in an embodiment of the present application.

[0116] Reference Figure 5 , an embodiment of the present application provides a dialogue processing device, the dialogue processing device comprising:

[0117] A first determining module 51 is used to input a first question statement of a user into a first model to obtain first annotation information of the first question statement, where the first annotation information is used to indicate the returned resource information corresponding to the first question statement;

[0118] A second determining module 52 is used to determine second annotation information of a second question statement of the user, where the second question statement is adjacent to the first question statement and the time of the second question statement is earlier than the time of the first question statement, and the second annotation information is used to indicate the return information resource corresponding to the second question statement;

[0119] A generation module 53 is used to input the first annotation information, the second annotation information, and the user's first dialogue data into a second model if the first annotation information is different from the second annotation information, so as to generate a first response statement to the first question statement, wherein the first dialogue data includes the user's question statement, the response statement to the question statement, and the annotation information corresponding to the question statement.

[0120] In a possible embodiment, a first training module 54 is further included, and the first model is trained based on the first training module 54 by the following method:

[0121] splicing the plurality of third returned resource information of the user and each training question sentence of the user to obtain a plurality of first training data;

[0122] Annotate each of the first training data to obtain third annotation information of each of the first training data, wherein the third annotation information is used to indicate fourth return resource information corresponding to the training question sentence in each of the first training data, and the fourth return resource information is the return resource information corresponding to the training question sentence among the plurality of third return resource information;

[0123] The first model is trained according to each first training data and the third labeling information of each first training data.

[0124] In a possible embodiment, when training the first model according to each of the first training data and the third annotation information of each of the first training data, the first training module 54 is used to:

[0125] Inputting each of the first training data into the first model to obtain prediction labeling information corresponding to each of the first training data;

[0126] The first model is trained according to the predicted labeling information, the third labeling information and a classification loss function.

[0127] In a possible embodiment, a second training module 55 is further included, and the second model is trained based on the second training module 55 by the following method:

[0128] Acquire second training data of the user, where the second training data includes multiple rounds of dialogue sentences, each round of the dialogue sentences includes a question sentence of the user and a response sentence to the question sentence;

[0129] Inputting the question sentences of the user in each round into the first model to obtain the labeling information of the question sentences in each round;

[0130] If the fourth annotation information of the question sentence of the first round is different from the fifth annotation information of the question sentence of the second round, adding the third question sentence and the returned resource information corresponding to the fifth annotation information to the second training data;

[0131] The second model is trained based on the added second training data.

[0132] In a possible embodiment, when the third question statement and the returned resource information corresponding to the fifth annotation information are added to the second training data, the second training module 55 is used to:

[0133] adding the third question statement as a question statement adjacent to the question statement of the second round to the second training data, wherein the time of the third question statement is later than the question statement of the second round;

[0134] The resource return information corresponding to the fifth annotation information is added to the second training data as a response sentence to the third question sentence.

[0135] Figure 6 A block diagram of a model training device provided in an embodiment of the present application.

[0136] Reference Figure 6 , the embodiment of the present application provides a model training device, the model training device comprising:

[0137] An acquisition module 61 is used to acquire second training data of a user, where the second training data includes multiple rounds of dialogue sentences, each round of the dialogue sentences includes a question sentence of the user and a response sentence to the question sentence;

[0138] A first processing module 62, configured to input the question statements of the user in each round into a first model to obtain labeling information of the question statements in each round;

[0139] A second processing module 63, configured to add the third question statement and the returned resource corresponding to the fifth annotation information to the second training data if the fourth annotation information of the question statement of the first round is different from the fifth annotation information of the question statement of the second round;

[0140] The third processing module 64 is used to train the second model based on the added second training data.

[0141] Figure 7 A block diagram of an electronic device provided in an embodiment of the present application.

[0142] Reference Figure 7 An embodiment of the present application provides an electronic device, which includes: at least one processor 701; at least one memory 702, and one or more I / O interfaces 703, connected between the processor 701 and the memory 702; wherein the memory 702 stores one or more computer programs that can be executed by at least one processor 701, and the one or more computer programs are executed by at least one processor 701 so that the at least one processor 701 can execute the above-mentioned dialogue processing method or model training method.

[0143] The embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored, wherein the computer program implements the above-mentioned dialogue processing method or model training method when executed by a processor. The computer-readable storage medium can be a volatile or non-volatile computer-readable storage medium.

[0144] An embodiment of the present application also provides a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above-mentioned dialogue processing method or model training method.

[0145] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable storage medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium).

[0146] As is known to those of ordinary skill in the art, the term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable program instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), static random access memory (SRAM), flash memory or other memory technology, portable compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. In addition, it is known to those of ordinary skill in the art that communication media typically contain computer-readable program instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and may include any information delivery medium.

[0147] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0148] The computer program instructions for performing the operation of the present application can be assembler instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions can be executed completely on a user's computer, partially on a user's computer, executed as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet). In some embodiments, by using the state information of a computer-readable program instruction to personalize an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA) or a programmable logic array (PLA), the electronic circuit can execute a computer-readable program instruction, thereby realizing various aspects of the present application.

[0149] The computer program product described herein may be implemented in hardware, software, or a combination thereof. In one optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (SDK), etc.

[0150] Various aspects of the present application are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present application. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.

[0151] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0152] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0153] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the logical function of the specification. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can also be executed in the opposite order sometimes, depending on the function involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be realized by a dedicated hardware-based system that performs the function or action of the specification, or can be realized by a combination of special-purpose hardware and computer instructions.

[0154] Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted only in a general illustrative sense and not for limiting purposes. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly noted, features, characteristics, and / or elements described in conjunction with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in conjunction with other embodiments. Therefore, those skilled in the art will appreciate that various changes in form and detail may be made without departing from the scope of the present application as set forth in the appended claims.

Claims

1. A method for processing a conversation, characterized in that: include: Inputting a first question statement of a user into a first model to obtain first annotation information of the first question statement, wherein the first annotation information is used to indicate the returned resource information corresponding to the first question statement; Determine second annotation information of a second question statement of the user, where the second question statement is adjacent to the first question statement and the time of the second question statement is earlier than the time of the first question statement, and the second annotation information is used to indicate the return information resource corresponding to the second question statement; If the first annotation information and the second annotation information are different, the first annotation information, the second annotation information, and the user's first conversation data are input into a second model to generate a first response statement to the first question statement, wherein the first conversation data includes the user's question statement, the response statement to the question statement, and the annotation information corresponding to the question statement.

2. The method for processing a conversation according to claim 1, characterized in that: The first model is trained by the following method, which includes: splicing the plurality of third returned resource information of the user and each training question sentence of the user to obtain a plurality of first training data; Annotate each of the first training data to obtain third annotation information of each of the first training data, wherein the third annotation information is used to indicate fourth return resource information corresponding to the training question sentence in each of the first training data, and the fourth return resource information is the return resource information corresponding to the training question sentence among the plurality of third return resource information; The first model is trained according to each first training data and the third labeling information of each first training data.

3. The method for processing a conversation according to claim 2, characterized in that: The step of training the first model according to each of the first training data and the third labeling information of each of the first training data includes: Inputting each of the first training data into the first model to obtain prediction labeling information corresponding to each of the first training data; The first model is trained according to the predicted labeling information, the third labeling information and a classification loss function.

4. The method for processing a conversation according to claim 1, characterized in that: The second model is trained by the following method, which includes: Acquire second training data of the user, where the second training data includes multiple rounds of dialogue sentences, each round of the dialogue sentences includes a question sentence of the user and a response sentence to the question sentence; Inputting the question sentences of the user in each round into the first model to obtain the labeling information of the question sentences in each round; If the fourth annotation information of the question sentence of the first round is different from the fifth annotation information of the question sentence of the second round, adding the third question sentence and the returned resource information corresponding to the fifth annotation information to the second training data; The second model is trained based on the added second training data.

5. The method for processing a dialogue according to claim 4, characterized in that: The adding the third question statement and the returned resource information corresponding to the fifth annotation information to the second training data includes: adding the third question statement as a question statement adjacent to the question statement of the second round to the second training data, wherein the time of the third question statement is later than the question statement of the second round; The resource return information corresponding to the fifth annotation information is added to the second training data as a response sentence to the third question sentence.

6. A model training method, characterized in that: include: Acquire second training data of the user, where the second training data includes multiple rounds of dialogue sentences, each round of the dialogue sentences including a question sentence of the user and a response sentence to the question sentence; Inputting the question sentences of the user in each round into the first model to obtain the annotation information of the question sentences in each round; If the fourth annotation information of the question sentence of the first round is different from the fifth annotation information of the question sentence of the second round, adding the third question sentence and the returned resource information corresponding to the fifth annotation information to the second training data; The second model is trained based on the added second training data.

7. A dialogue processing device, characterized in that: include: A first annotation module, used for inputting a first question statement of a user into a first model to obtain first annotation information of the first question statement, wherein the first annotation information is used for indicating the returned resource information corresponding to the first question statement; A second annotation module is used to determine second annotation information of a second question statement of the user, where the second question statement is adjacent to the first question statement and the time of the second question statement is earlier than the time of the first question statement, and the second annotation information is used to indicate the return information resource corresponding to the second question statement; A generation module is used to input the first annotation information, the second annotation information, and the user's first dialogue data into a second model if the first annotation information is different from the second annotation information, so as to generate a first response statement to the first question statement, wherein the first dialogue data includes the user's question statement, the response statement to the question statement, and the annotation information corresponding to the question statement.

8. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores one or more computer programs executable by the at least one processor, and the one or more computer programs are executed by the at least one processor to enable the at least one processor to perform the dialog processing method according to any one of claims 1 to 5.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the computer program implements the dialog processing method according to any one of claims 1 to 5.

10. A computer program product, characterized in that The device comprises a computer-readable code or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the dialog processing method as described in any one of claims 1 to 5.