Method, device and medium for establishing question and answer correspondence relationship database
By establishing a question-and-answer correspondence database, using a case screening model to determine the recommendation probability value of sample sessions, selecting target sample sessions and constructing question-and-answer correspondences, the problem of insufficient correlation between response statements and consultation questions in the customer service system was solved, and more efficient consultation services were achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD
- Filing Date
- 2023-01-12
- Publication Date
- 2026-06-19
AI Technical Summary
In existing technologies, customer service systems lack an effective question-and-answer correspondence, resulting in insufficient relevance between response statements and inquiry questions, and thus failing to provide efficient consultation services.
By establishing a question-and-answer correspondence database, using a pre-trained case selection model to determine the recommendation probability value of sample sessions, selecting target sample sessions, and constructing a question-and-answer correspondence database based on target consultation questions and response statements, the response effect is optimized by combining the correspondence between consultation questions and response statements.
This enables more accurate and effective responses to customer service, improving the quality and efficiency of consultation services, ensuring that responses with better effects are recommended, and meeting the needs of consultants.
Smart Images

Figure CN116303934B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of intelligent network technology, and in particular to a method, apparatus, device and medium for establishing a question-and-answer correspondence database. Background Technology
[0002] To respond to inquiries as quickly as possible and answer questions, each customer service representative typically prepares some commonly used response phrases in the response candidate box. For example, phrases like "Hello, how can I help you?" Customer service representatives can select available phrases from the response candidate box to answer inquiries, thus saving time and facilitating the simultaneous handling of multiple inquiries.
[0003] However, in the process of realizing the present invention, it was found that the prior art has at least the following technical problems: the prior art only pre-configures conventional response statements, which cannot reflect the relationship between the response statements and the consultation questions, making it inconvenient for customer service to filter when answering questions; and when configuring conventional response statements, the response effect when using the conventional statements is not considered, which cannot provide better consultation services for consultants. Summary of the Invention
[0004] This invention provides a method, apparatus, device, and medium for establishing a question-and-answer correspondence database, in order to provide more accurate and effective response statements for customer service and better serve consultants.
[0005] In a first aspect, embodiments of the present invention provide a method for establishing a question-and-answer correspondence database, comprising:
[0006] At least one sample session is identified from a pre-established sample session library; wherein, the sample session includes a sample consultation question and a sample response statement corresponding to the sample consultation question;
[0007] For each of the sample sessions, the sample response statements in the sample session are input into the pre-trained case selection model to obtain the recommendation probability value corresponding to the sample session;
[0008] Based on the recommendation probability value corresponding to each of the sample sessions, a target sample session is selected from each of the sample sessions;
[0009] Based on the target consultation questions and target response statements in each target sample session, a question-and-answer correspondence database for responding to real-time consultation questions is established.
[0010] Secondly, embodiments of the present invention also provide an apparatus for establishing a question-and-answer correspondence database, the apparatus comprising:
[0011] The sample session determination module is used to determine at least one sample session from a pre-established sample session library; wherein, the sample session includes a sample consultation question and a sample response statement corresponding to the sample consultation question;
[0012] The recommendation probability value determination module is used to input the sample response statements in each sample session into a pre-trained case screening model to obtain the recommendation probability value corresponding to the sample session.
[0013] The target sample session selection module is used to select a target sample session from the sample sessions based on the recommendation probability value corresponding to each sample session.
[0014] The question-and-answer correspondence database establishment module is used to establish a question-and-answer correspondence database for responding to real-time consultation questions based on the target consultation questions and target response statements in each target sample session.
[0015] Thirdly, embodiments of the present invention also provide an electronic device, the electronic device comprising:
[0016] One or more processors;
[0017] Storage device for storing one or more programs.
[0018] When the one or more programs are executed by the one or more processors, the one or more processors implement the question-and-answer correspondence database establishment method provided in any embodiment of the present invention.
[0019] Fourthly, embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for establishing a question-and-answer correspondence database provided in any embodiment of the present invention.
[0020] This invention provides a method for establishing a question-and-answer correspondence database. At least one sample session is identified from a pre-established sample session library. Sample response statements from each identified sample session are input into a pre-trained case selection model to obtain a recommendation probability value corresponding to the sample session. This recommendation probability value reflects the quality of each sample session. Taking into account the quality of the sample sessions, target sample sessions are selected based on their respective recommendation probability values. A question-and-answer correspondence database for answering real-time inquiries is then established based on the target inquiry questions and target response statements in the target sample sessions. The question-and-answer correspondence database established in this embodiment combines the correspondence between inquiry questions and response statements, facilitating more accurate and effective provision of response statements to customer service. Furthermore, establishing the database based on the recommendation probability values of sample sessions considers the response effectiveness of the response statements in the database, allowing for the addition of better-performing and more recommendable response statements to the database, thus achieving a better service delivery to consultants.
[0021] Furthermore, the apparatus, device, and medium for establishing a question-and-answer correspondence database provided by this invention correspond to the above-mentioned method and have the same beneficial effects. Attached Figure Description
[0022] To more clearly illustrate the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 A flowchart illustrating a method for establishing a question-and-answer correspondence database according to an embodiment of the present invention;
[0024] Figure 2 This is a schematic diagram of the structure of the statement extraction model provided in an embodiment of the present invention;
[0025] Figure 3 A flowchart illustrating another method for establishing a question-and-answer correspondence database provided in an embodiment of the present invention;
[0026] Figure 4 This is a schematic diagram of a process for determining a recommendation probability value provided in an embodiment of the present invention;
[0027] Figure 5 A structural diagram of an apparatus for establishing a question-and-answer correspondence database provided in an embodiment of the present invention;
[0028] Figure 6 This is a structural diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0029] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present invention, and not all of the structures.
[0030] Before discussing the exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the operations (or steps) as sequential processes, many of these operations can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but it may also have additional steps not included in the figures. The process may correspond to a method, function, procedure, subroutine, subroutine, etc.
[0031] To enable those skilled in the art to better understand the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0032] Before introducing the technical solution, we can first illustrate the application scenarios. This technical solution can be applied to establish a question-and-answer correspondence database. This database can provide customer service representatives with optional response statements when a customer answers a real-time question, thus improving the efficiency of answering inquiries. The question-and-answer correspondence database can be applied to various inquiry scenarios. For example, in scenarios where a user inquires about order information for purchased items or the progress of a business transaction, the established question-and-answer correspondence database, which corresponds to each inquiry scenario, can provide customer service representatives with response statements that match the real-time inquiry, enabling them to provide answers that better meet the user's needs.
[0033] It should be noted that the acquisition, storage, use, and processing of information in this application's technical solution all comply with the relevant provisions of national laws and regulations; on this basis, a question-and-answer correspondence database is established to respond to real-time consultation questions.
[0034] Figure 1This is a flowchart illustrating a method for establishing a question-and-answer correspondence database according to an embodiment of the present invention. This embodiment is applicable to situations where a question-and-answer correspondence database is established to provide customer service with response statements when answering real-time inquiries. This method can be executed by a device for establishing the question-and-answer correspondence database, which can be implemented through software and / or hardware and can be configured in a terminal and / or server to implement the method for establishing the question-and-answer correspondence database in this embodiment of the present invention.
[0035] like Figure 1 As shown, the method in this embodiment may specifically include:
[0036] S110. Identify at least one sample session from a pre-established sample session library.
[0037] The sample sessions can be actual and / or predicted dialogues between consulting users and customer service representatives, and a sample session library is composed of at least one sample session. Each sample session includes sample consultation questions and corresponding sample response statements. A sample consultation question is a question sent by the consulting user's terminal in the sample session; a sample response statement is the answer provided by the customer service terminal for each sample consultation question in the sample session. A sample session may include consultation questions sent by a consulting user's terminal at different times and the corresponding response statements provided by the customer service terminal.
[0038] In practice, all sample sessions in the sample session library can be identified to build a question-and-answer correspondence database; alternatively, only a portion of the sample sessions can be selected. For example, a first sample session can be chosen from the sample session library, where the sample response statements only contain stop words or polite phrases. Since these only contain stop words or polite phrases, they have little effect on customer service responses. Therefore, a second sample session can be selected from the sample session library as the sample session for constructing the question-and-answer correspondence database.
[0039] To provide a more vivid and concrete explanation of the sample conversation, please refer to Table 1 for the specific content of the sample conversation.
[0040] Table 1
[0041] User / Customer Service Conversation content user I want to request to switch to human assistance. customer service Hello, yes, I'm here. How can I help you? user Hello, I would like to cancel order A. customer service Has the order been successfully placed? user Yes user Should I submit the application over there or on my end? customer service I'm submitting it here today, and it will be reviewed tomorrow. customer service Please wait a moment. customer service I'll submit it and wait for review. customer service Please wait patiently. customer service Hello, please take a look. My application has already been completed. user I don't need to worry about this, right? customer service Uh-huh user Okay, thank you very much. customer service Okay, you're welcome.
[0042] The conversation content corresponding to the user is the sample inquiry question; the conversation content corresponding to the customer service representative is the sample response statement. As shown in Table 1, sample inquiry questions may include statements such as "I want to apply to transfer to human customer service," "Hello, I want to cancel order A," and "Should I submit the application here or there?" Sample response statements may include statements such as "Hello, yes, how can I help you?" and "I'll submit it here; I'll submit it today and it will be reviewed tomorrow."
[0043] S120. For each sample session, input the sample response statements in the sample session into the pre-trained case selection model to obtain the recommendation probability value corresponding to the sample session.
[0044] The pre-trained case selection model can be a neural network model. The input to the model can be the sample response statements from each sample session, and the output can be the recommendation probability value for that sample session. The recommendation probability value reflects the degree to which a sample session is worth recommending. A higher probability indicates a better sample session and more valuable sample response statements for learning; conversely, a lower probability indicates a more ordinary sample session and more common and routine sample response statements.
[0045] Specifically, the recommendation probability value can be expressed as a percentage, a positive integer, or a decimal. The case selection model can directly output the recommendation probability value of the corresponding sample session based on the input sample response statements. For example, the recommendation probability value output by the case selection model can be either 0 or 1, representing whether the sample response statement in the sample session is worth recommending or not worth recommending, respectively. The recommendation probability value output by the case selection model can also be any decimal within the interval [0,1]. When the recommendation probability value is within [0,0.3), it indicates that the sample response statement in the sample session is not worth recommending; when the recommendation probability value is within [0.3,0.6), it indicates that the sample response statement in the sample session is reasonably worth recommending; and when the recommendation probability value is within [0.6,1], it indicates that the sample response statement in the sample session is highly worth recommending.
[0046] S130. Based on the recommendation probability value corresponding to each sample session, select the target sample session from each sample session.
[0047] The target sample session can be a session in the sample session used to establish a question-and-answer correspondence database.
[0048] In practical implementation, the selection of target sample sessions based on the recommendation probability values corresponding to each sample session can be achieved in the following two ways:
[0049] 1. Identify the first sample sessions whose recommendation probability values fall within the preset recommendation value range; select a preset number of second sample sessions from each of the first sample sessions as target sample sessions.
[0050] Specifically, when the number of output recommendation probability values of the case selection model is large—for example, if the output recommendation probability values can only be any decimal in the range [0,1]—a recommendation value range can be preset to obtain a preset number of target sample sessions. For instance, when the recommendation probability values include two or more values, and the larger the value, the more worthy the sample response statement in the sample session is of recommendation, the recommendation value range can be preset to (0.7,1], determining the first sample session whose recommendation probability value belongs to (0.7,1). When the number of first sample sessions is greater than the preset number, they can be sorted according to their recommendation probability values, and the second sample session with the largest preset number in the sorted list can be selected as the target sample session.
[0051] In this embodiment, by setting a recommended value range, target sample sessions that meet the recommended value requirements can be selected from the sample sessions. These target sample sessions are then considered more worthy of recommendation. By using sample questions and sample responses from these more worthy sample sessions, a question-and-answer correspondence database is established, ensuring the quality and effectiveness of the responses in the database.
[0052] 2. Determine the third sample session with a recommendation probability value of the preset recommendation value, and select a preset number of fourth sample sessions from each third sample session as the target sample session.
[0053] Specifically, when the number of output recommendation probability values from the case selection model is small—for example, if the output recommendation probability values only include 0 or 1—then a third sample session with a recommendation probability value of a preset recommendation value can be identified. For instance, if the output recommendation probability values only include 0 or 1, where 0 indicates that the sample response statements in the sample session are not worth recommending, and 1 indicates that the sample response statements in the sample session are worth recommending, then the sample session with a recommendation probability value of 1 can be designated as the third sample session. A preset number of fourth sample sessions can then be identified from these third sample sessions as target sample sessions. Based on the sample consultation questions and sample response statements in the sample sessions that are worth recommending, a question-and-answer correspondence database can be established. It should be noted that if the number of third sample sessions is less than the preset number, all third sample sessions can be directly identified as target sample sessions.
[0054] S140. Based on the target consultation questions and target response statements in each target sample session, establish a question-and-answer correspondence database for responding to real-time consultation questions.
[0055] In this embodiment, when establishing the question-and-answer correspondence database, target questions and target responses can be stored in pairs in the database according to the question-and-answer relationship to form the question-and-answer correspondence database. The question-and-answer correspondence database can include target questions and target responses from all target sample sessions, or, to save storage space, target questions and target responses from a preset number of target sample sessions with the highest recommendation probability values can be selected to construct the question-and-answer correspondence database.
[0056] In this embodiment, the implementation method for establishing a question-and-answer correspondence database for answering real-time consultation questions based on the target consultation questions and target response statements in each target sample session can also be as follows: classify the consultation intent of the target consultation questions in each target sample session to obtain at least one first consultation intent category; establish a question-and-answer correspondence database based on the correspondence between each first consultation intent category and each target consultation question, and the question-and-answer relationship between each target consultation question and each target response statement.
[0057] The question-and-answer correspondence database contains each first consultation intent category and at least one target response statement corresponding to each first consultation intent category.
[0058] In practical implementation, the specific method for classifying the consultation intent of target consultation questions in each target sample session can be as follows: input the target consultation questions in each target sample session into a pre-established intent classification model to classify each target consultation question; based on the output of the intent classification model, determine the first consultation intent category of the target consultation question. The intent classification model can be a text classification model, such as the textCNN model. Through the intent classification model, the target consultation question can be divided into a preset number of first consultation intent categories. For example, the preset number of categories can be 1000.
[0059] When classifying the consultation intent of the target consultation questions in each target sample session, the first consultation intent category of each target consultation question in the target consultation question can also be determined by detecting consultation category words in the target consultation question and based on the pre-established mapping relationship between intent categories and consultation category words.
[0060] Furthermore, based on the correspondence between each first consultation intent category and each target consultation question, and the question-and-answer relationship between each target consultation question and each target response statement, the correspondence between each first consultation intent category and the target response statement can be determined. According to this correspondence, each first consultation intent category and the target response statement can be stored in the database to form a question-and-answer correspondence database.
[0061] In this embodiment, since the number of first consultation intent categories is less than the number of target consultation questions, a question-and-answer correspondence database is established that includes the first consultation intent categories and target response statements. When determining the real-time response statement corresponding to the real-time consultation question, compared to the question-and-answer correspondence database that includes the target consultation question and the corresponding target response statement, it is not necessary to traverse each target consultation question in the question-and-answer correspondence database. Only the category corresponding to the consultation question needs to be determined from the relatively small number of consultation intent categories, which greatly reduces the workload of the real-time response process and helps to improve response efficiency.
[0062] When establishing a question-and-answer correspondence database, since the target response statements in the target sample sessions may contain non-core sentences such as polite phrases and meaningless colloquialisms, which have low reference value for customer service, a question-and-answer correspondence database containing consultation categories and corresponding core sentences can be established. Specifically, based on the target consultation questions and target response statements in each target sample session, a question-and-answer correspondence database for answering real-time consultation questions is established, including: for each target sample session, inputting at least one target response statement from the target sample session into a pre-established statement extraction model to obtain the target response core sentence in each target response statement; classifying the consultation intent of the target consultation questions corresponding to each target response core sentence in each target sample session to obtain at least one second consultation intent category; and establishing a question-and-answer correspondence database based on the correspondence between each second consultation intent category and each target consultation question corresponding to the target response core sentence, and the correspondence between the target response core sentence and the target consultation question.
[0063] The question-and-answer correspondence database contains each second consultation intent category and at least one target response core sentence corresponding to each second consultation intent category. The statement extraction model is used to identify the core sentence in each target response statement. The target response core sentence is the important statement in each target response statement used to solve the consultation problem.
[0064] In practice, at least one target response statement from each target sample session can be input into the statement extraction model. The statement extraction model then determines the core sentence of the target response used to resolve the consultation problem within each input target response statement. For example, the statement extraction model can output a 0 or 1 identifier, indicating whether the input target response statement is a core sentence or a non-core sentence, respectively. Based on the identifier output by the statement extraction model, the core sentence of the target response statement can be determined.
[0065] Furthermore, target consultation questions corresponding to the core sentences of the target responses can be identified from each target consultation question. These identified target consultation questions are then categorized to obtain at least one second consultation intent category. Based on the correspondence between each second consultation intent category and each target consultation question corresponding to the core sentence of the target response, and the correspondence between the core sentence of the target response and the target consultation question, the correspondence between the core sentence of the target response and the second consultation intent category is determined. According to this correspondence, a question-and-answer correspondence database including the second consultation intent category and the core sentence of the target response is established. It should be noted that it is also possible to directly establish a question-and-answer correspondence database including the target consultation questions and their corresponding core sentences of the target response without classifying the target consultation questions.
[0066] In this embodiment, a question-and-answer correspondence database is established based on the second consultation category and the target response core sentence. This reduces the number of non-core sentences such as polite phrases and meaningless colloquialisms in the question-and-answer correspondence database, thus ensuring the effectiveness of the database while reducing its data volume. Only the target response core sentence is retained, thereby recommending more effective and valuable response sentences to customer service representatives through the question-and-answer correspondence database.
[0067] In specific implementation, the process of inputting the target response statement from the target sample session into a pre-established statement extraction model to obtain the core sentence of the target response statement includes: inputting at least one target response statement from the target sample session into the pre-established statement extraction model; for each input target response statement, converting each character in the target response statement into a character vector through the statement extraction model, and performing feature fusion on each character vector corresponding to the target response statement to generate a sentence vector corresponding to the input target response statement; for each generated sentence vector, determining the sentence type of the sentence vector based on the sentence vector's own features and the global correlation features between sentence vectors.
[0068] The sentence types include core and non-core types. The target response sentence corresponding to the sentence vector of the core type is determined as the target response core sentence. Global association features are the association features between the response sentences of each sample in the target sample session. When training the sentence extraction model, a preset number of training sessions can be selected, and the core sentences in the training sessions can be labeled. The neural network to be trained is then trained based on the labeled content, and the sentence extraction model is obtained at the end of the training. For example, 2000 human customer service sessions can be selected as extraction training sessions, and the core sentences of the customer service can be labeled in each session for training the neural network to be trained.
[0069] Specifically, when converting each character in the target response statement into a character vector, the character vector corresponding to each character in the target response statement can be determined based on the pre-determined correspondence between vectors and characters; or, based on deep learning technology, the character vector of each character in the target response statement can be determined using the Word2vec (a related model used to generate word vectors, word to vector) method.
[0070] Figure 2 This is a schematic diagram of the sentence extraction model provided in an embodiment of the present invention; to explain the process of obtaining the core sentence of the target response more clearly and in detail, it can be combined with... Figure 2 The following explanation is provided. Each target response statement from the target sample session can be input into the input layer of the statement extraction model. Based on each character in the target response statement, a character vector corresponding to each character is generated to reflect the character-level features of the target response statement. By performing feature fusion on the character vectors corresponding to each character in the target response statement, a sentence vector corresponding to the input target response statement is generated to reflect the sentence-level features of each target response statement. Each sample response statement in each target sample session has a corresponding sentence vector. Based on the individual features of each sentence vector and the global correlation features between sentence vectors, the sentence type of the sentence vector is determined. For example, the sentence type can be represented by an identifier of 0 or 1, such as 1 indicating that the sentence type of the input sample response statement is a core type, and 0 indicating that the sentence type of the input sample response statement is a non-core type.
[0071] In this embodiment, when determining the sentence type, not only are the individual characteristics of the sentence vectors corresponding to each sample response statement considered, but also the global correlation characteristics between each sentence vector are combined, so as to comprehensively reflect the characteristics of the sentence vectors and make the determined sentence type of the sample response statement more accurate.
[0072] In this embodiment, after establishing the question-and-answer correspondence database, the method further includes: when a real-time consultation question is received from a user terminal, determining the real-time consultation intent category of the real-time consultation question; based on the question-and-answer correspondence database, determining at least one real-time response statement corresponding to the real-time consultation intent category, and pushing the real-time response statement to the customer service terminal.
[0073] In this context, a real-time inquiry question is a question sent by the user through their terminal during a consultation session. The real-time inquiry intent category corresponds to the inquiry question, such as inquiries about order logistics, after-sales time, and after-sales details. A real-time response statement is at least one response statement that can be used to answer a real-time inquiry question.
[0074] In practical applications, when a real-time consultation question is received, the real-time consultation intent category of the real-time consultation question can be determined. The specific methods for determining the real-time consultation intent category may include: inputting the real-time consultation question into a pre-established intent classification model to obtain the real-time consultation intent category corresponding to the real-time consultation question; or, extracting the question keywords from the real-time consultation question, and determining the consultation intent category corresponding to the question keywords as the real-time consultation intent category corresponding to the real-time consultation question based on the pre-established correspondence between keywords and consultation intent categories.
[0075] The intent classification model can be a text classification model, such as the textCNN model. Question keywords include non-stop words in real-time consultation questions, such as "logistics progress" and "apply for after-sales service."
[0076] Specifically, when determining the category of real-time consultation intent using an intent classification model, the category can be directly determined based on the classification results of the intent classification model. When determining the category of real-time consultation questions using a pre-established correspondence between keywords and consultation intent categories, the consultation intent category corresponding to the keywords that match the question keywords can be determined as the real-time consultation intent category. It should be noted that the method used to determine the consultation intent category when establishing the question-answer correspondence database can be used as the method to determine the real-time consultation intent category, thereby ensuring that the consultation intent categories in the question-answer correspondence database match the real-time consultation intent category, facilitating the rapid and accurate determination of the real-time consultation intent category.
[0077] Furthermore, the method for determining the real-time consultation intent category can also be as follows: First, extract the question keywords from the real-time consultation question, and compare the question keywords with keywords in a pre-determined correspondence. If a keyword matches the question keywords, the consultation intent category corresponding to the matching keyword can be determined as the real-time consultation intent category, and the process of determining the real-time consultation intent category ends. If no keyword matches the question keywords, the real-time consultation question can be input into a pre-established intent classification model, and the real-time consultation intent category can be determined based on the classification results. Determining the real-time consultation intent category through a two-step method can prevent situations where the real-time consultation intent category cannot be determined, improve the determination efficiency, and better provide real-time response statements for customer service.
[0078] This embodiment determines the real-time consultation intent category by using an intent classification model or a pre-established correspondence between keywords and consultation intent categories. This achieves automatic determination of the real-time consultation intent category, avoiding errors caused by manual determination and the workload brought to customer service, and enabling faster and more convenient determination of the real-time consultation intent category.
[0079] Specifically, after determining the real-time consultation intent category, at least one real-time response statement corresponding to the real-time consultation intent category can be determined based on the question-and-answer correspondence database, and the real-time response statement can be pushed to the customer service terminal. For example, all real-time response statements corresponding to the real-time consultation intent category in the question-and-answer correspondence database can be recommended to the customer service terminal for customer service selection; alternatively, a preset number of real-time response statements corresponding to the real-time consultation intent category in the question-and-answer correspondence database can be recommended to the customer service terminal, but this embodiment of the invention does not limit the scope of the recommendations.
[0080] Furthermore, if the consultation intent category in the question-and-answer correspondence database does not include the real-time consultation intent category, it's possible that the real-time consultation intent category is incorrectly determined, or that the question-and-answer correspondence database is incomplete. In such cases, a prompt message containing the real-time consultation question and the real-time consultation intent category can be generated and sent to the customer service terminal, indicating that a corresponding real-time response statement has not yet been determined and suggesting a manual response. Additionally, to further improve the question-and-answer correspondence database, when the consultation intent category in the database does not include the real-time consultation intent category, the manual response statement from the customer service representative can be obtained. This real-time consultation intent category and the manual response statement can then be stored in the question-and-answer correspondence database according to the correspondence between the real-time consultation intent category and the manual response statement, making the question-and-answer correspondence database more complete and comprehensive.
[0081] In this embodiment, the real-time response statement corresponding to the real-time consultation question is quickly determined based on the pre-established question-and-answer correspondence database, thereby providing customer service with a quick and accurate real-time response statement for customer service to choose from. This helps improve the response efficiency of customer service and greatly reduces the workload of customer service.
[0082] This invention provides a method for establishing a question-and-answer correspondence database. In this method, at least one sample session is identified from a pre-established sample session library. Sample response statements from each identified sample session are input into a pre-trained case selection model to obtain a recommendation probability value corresponding to the sample session. This recommendation probability value reflects the quality of each sample session. Taking into account the quality of the sample sessions, target sample sessions are selected based on their respective recommendation probability values. A question-and-answer correspondence database for answering real-time inquiries is then established based on the target inquiry questions and target response statements within the target sample sessions. The question-and-answer correspondence database established in this embodiment combines the correspondence between inquiry questions and response statements, facilitating more accurate and effective provision of response statements to customer service. Furthermore, by establishing the database based on the recommendation probability values of sample sessions, the effectiveness of the response statements in the database is considered. This allows for the addition of more effective and recommended response statements to the database based on the recommendation probability values, ultimately achieving a better consultation service for consultants.
[0083] Figure 3 This is a flowchart illustrating another method for establishing a question-and-answer correspondence database provided by an embodiment of the present invention. This embodiment is based on and optimized from the above-described technical solutions. Optionally, before inputting sample response statements from sample conversations into a pre-trained case selection model, the method further includes: determining the conversation sentiment features corresponding to each sample conversation in the sample conversation database. Explanations of terms that are the same as or corresponding to those in the above embodiments will not be repeated here.
[0084] like Figure 3 As shown, the method in this embodiment may specifically include:
[0085] S210. Identify at least one sample conversation in the pre-established sample conversation library, and determine the conversation emotion features corresponding to each sample conversation in the sample conversation library.
[0086] Among them, the conversation sentiment feature is the sentiment reflected in the sample response statements in the sample conversation. The conversation sentiment feature can include positive sentiment, negative sentiment and neutral sentiment.
[0087] In specific implementation, the emotional characteristics of a conversation can be determined as follows: based on the emotional characteristic words included in each sample response statement in the sample conversation, the emotional characteristics of the sample conversation are determined. For example, emotional characteristic words may include at least one of positive emotional words, negative emotional words, and neutral emotional words; positive emotional words may include words used to reflect timely feedback or problem-solving, such as immediately, right away, now, at the first moment, always, and this; negative emotional words may include words such as only, sorry, anyway, and definitely not; neutral emotional words may be words other than negative and positive emotional words.
[0088] Furthermore, when determining the emotional characteristics of a conversation, the number of positive, negative, and neutral emotional words in all sample responses within the sample conversation can be determined, and the emotional type with the most words can be identified as the conversation emotional characteristic. For example, if the number of positive emotional words in all sample responses of a sample conversation is 8, the number of negative emotional words is 0, and the number of neutral emotional words is 2, then the number of positive emotional words is the highest, and the corresponding conversation emotional characteristic of the sample conversation can be identified as positive emotional characteristic.
[0089] In specific implementation, before inputting the sample response statements and corresponding emotional features of the sample sessions into the pre-trained case selection model, the process includes: acquiring at least one pre-established training session and training labels corresponding to each training session; wherein the training labels are used to label the training recommendation probability value of the corresponding training session; determining the training emotional features corresponding to each training session; wherein the training emotional features include at least two of positive, negative, and neutral emotions; for each training session, inputting each training response statement and the corresponding training emotional features into the neural network model to be trained to obtain the predicted recommendation probability value of the training session; adjusting the network parameters in the neural network model based on the training labels and predicted recommendation probability values corresponding to the training sessions; and determining the neural network model at the end of training as the case selection model.
[0090] Specifically, the case selection model can be trained using pre-established training sessions. For example, 1000 pre-established human customer service sessions can be used as training sessions, and training labels can be added to these sessions. Training sessions include training consultation questions and corresponding training response statements. Training labels can be added to these sessions to indicate their training recommendation probability values. These probability values reflect the quality of each training session, and can be set based on customer service feedback regarding the quality of the sessions. Higher quality sessions allow for higher training recommendation probability values. The predicted recommendation probability is the output of the neural network model corresponding to the training session. By comparing the set training recommendation probability with the predicted recommendation probability, the network parameters in the neural network model can be adjusted to make the predicted recommendation probability increasingly closer to the training recommendation probability, thereby improving the accuracy of the neural network model in determining the recommendation probability. Furthermore, the neural network model at the end of training can be used as the case selection model. One approach is to use the convergence of the loss function corresponding to the neural network model as a marker for the end of training; another approach is to pre-set the number of training iterations, and determine the end of training when the current number of training iterations matches the pre-set number of training iterations.
[0091] This embodiment trains the neural network model based on training sessions and their corresponding training labels. By comparing the trained recommendation probability values with the predicted recommendation probability values, the predicted recommendation probability values output by the neural network model are made increasingly closer to the trained recommendation probability values, thereby improving the accuracy of the neural network model in determining recommendation probability values. Furthermore, it incorporates training sentiment features, enabling the resulting case selection model to consider the sentiment characteristics of the sessions when determining recommendation probability values, which helps improve the selection effect of the case selection model.
[0092] In specific implementation, the methods for determining the training emotion features corresponding to each training session can include the following two: 1. When constructing a training session, the session emotion features of the training session can be marked in the training labels, and the session emotion features of the corresponding training session can be directly determined based on the labels. 2. For each training session, the training response statements in the training session are segmented to obtain each training segment corresponding to the training response statement; each training segment is compared with the pre-set emotion feature words, and the training emotion features corresponding to the training session are determined based on the comparison results.
[0093] Specifically, based on a pre-established dictionary, each training response statement in the training session can be segmented into words to obtain training word segments corresponding to the training response statements. Each training word segment is then compared with emotion feature words to determine the training emotion feature. For example, emotion feature words may include at least one of positive emotion words, negative emotion words, and neutral emotion words. The training emotion feature can be determined based on the number of emotion feature words of each type in each training word segment. For example, if the number of positive emotion words is the largest among the training word segments, then the training emotion feature is determined to be a positive emotion feature. Determining the training emotion feature by comparing the training word segments with emotion feature words eliminates the need for manual pre-annotation, enabling rapid and efficient determination of the training emotion feature while ensuring accuracy.
[0094] S220. For each sample conversation, input the sample response statements and the corresponding conversation sentiment features into the pre-trained case selection model to obtain the recommendation probability value corresponding to the sample conversation.
[0095] The sample session includes at least one sample response statement and a sample consultation question corresponding to the sample response statement.
[0096] In practical implementation, to more accurately and comprehensively determine the recommendation probability value corresponding to the sample conversation, the conversation sentiment features corresponding to the sample conversation can be used as a reference factor for determining the recommendation probability value. The sample response statements and conversation sentiment features from the sample conversation are both input into the case selection model to obtain the recommendation probability value. For example, conversation sentiment features have a positive effect on the recommendation probability value; for instance, conversation sentiment features include positive, negative, and neutral sentiment features, and a higher recommendation probability value indicates that the sample conversation is more worthy of recommendation. Therefore, when the input conversation sentiment features are positive, it is beneficial to increase the output recommendation probability value; when the input conversation sentiment features are negative, it is easy to decrease the output recommendation probability value.
[0097] Optionally, the recommendation probability value corresponding to the sample session can be obtained as follows: input at least one sample response statement from the sample session and the corresponding session sentiment features into a pre-trained case selection model; for each input sample response statement, convert each character in the sample response statement into a character vector through the case selection model; perform feature fusion on each character vector to generate a sentence vector corresponding to the input sample response statement; generate a session vector corresponding to the sample session based on the sentence vectors corresponding to each sample response statement; perform feature fusion on the session vector and the corresponding session sentiment features, and determine the recommendation probability value based on the fused features obtained from the fusion operation.
[0098] For a detailed and clear explanation of the process of obtaining the recommendation probability value, please refer to [link / reference]. Figure 4 The case selection model can employ a hierarchical feature determination method to determine the recommendation probability value. For each input sample response statement, the case selection model generates a character vector corresponding to each word to reflect the character-level features of the sample response statement. By performing feature fusion on the character vectors corresponding to each word in the sample response statement, a sentence vector corresponding to the input sample response statement is generated to reflect the sentence-level features of each sample response statement. Feature fusion is then performed on the sentence vectors corresponding to each input sample response statement to obtain a conversation vector corresponding to the sample conversation. At this point, the obtained conversation vector can be fused with the input conversation sentiment features to determine the recommendation probability value by combining the conversation sentiment features and the features of the sample response statement itself in the sample conversation. In this embodiment, by fusing the conversation vector of the sample conversation itself with the input conversation sentiment features, the recommendation probability value is determined based on the fused features. This approach considers not only the features of the sample conversation itself but also the conversation sentiment features, which helps to more accurately determine the recommendation probability value corresponding to the sample conversation.
[0099] S230. Based on the recommendation probability value corresponding to each sample session, select the target sample session from each sample session.
[0100] S240. Based on the target consultation questions and target response statements in each target sample session, establish a question-and-answer correspondence database for responding to real-time consultation questions.
[0101] In this embodiment, by inputting sample response statements and corresponding conversational emotion features from sample conversations into a pre-trained case selection model, the recommendation probability value corresponding to the sample conversation is obtained. This not only considers the characteristics of the sample conversation itself but also the conversational emotion features, which helps to more accurately determine the recommendation probability value corresponding to the sample conversation. This improves the effectiveness of the established question-and-answer correspondence database, ensures the response effect of the response statements in the established question-and-answer correspondence database, and better serves customer service and consulting users.
[0102] Figure 5 This diagram illustrates a structural apparatus for establishing a question-and-answer correspondence database, provided in an embodiment of the present invention. This apparatus is used to execute the method for establishing a question-and-answer correspondence database provided in any of the above embodiments. This apparatus and the method for establishing a question-and-answer correspondence database in the above embodiments belong to the same inventive concept. Details not described exhaustively in the embodiments of the apparatus for establishing a question-and-answer correspondence database can be found in the embodiments of the method for establishing a question-and-answer correspondence database. Specifically, the apparatus may include:
[0103] The sample session determination module 10 is used to determine at least one sample session from a pre-established sample session library; wherein, the sample session includes a sample consultation question and a sample response statement corresponding to the sample consultation question;
[0104] The recommendation probability value determination module 11 is used to input the sample response statements in each sample session into a pre-trained case screening model to obtain the recommendation probability value corresponding to the sample session.
[0105] The target sample session selection module 12 is used to select a target sample session from the sample sessions based on the recommendation probability value corresponding to each sample session.
[0106] The question-and-answer correspondence database establishment module 13 is used to establish a question-and-answer correspondence database for answering real-time consultation questions based on the target consultation questions and target response statements in each target sample session.
[0107] In addition to any of the optional technical solutions in the embodiments of the present invention, the invention may also include:
[0108] The conversation sentiment feature determination module is used to determine the conversation sentiment features corresponding to each sample conversation in the sample conversation library before inputting sample response statements from sample conversations into the pre-trained case selection model; the recommendation probability value determination module 11 includes:
[0109] The conversation sentiment feature input unit is used to input the sample response statements and the corresponding conversation sentiment features from the sample conversation into the pre-trained case selection model to obtain the recommendation probability value corresponding to the sample conversation.
[0110] Based on any optional technical solution in the embodiments of the present invention, optionally, the sample session includes at least one sample response statement;
[0111] The conversational emotion feature input unit includes:
[0112] The conversation emotion feature input subunit is used to input at least one sample response statement from the sample conversation and the conversation emotion feature corresponding to the sample conversation into the pre-trained case selection model.
[0113] The sentence vector generation subunit is used to convert each character in the input sample response statement into a character vector through a case selection model; and to perform feature fusion on each character vector to generate a sentence vector corresponding to the input sample response statement.
[0114] The conversation vector generation subunit is used to generate a conversation vector corresponding to the sample conversation based on the sentence vector corresponding to each sample response statement.
[0115] The feature fusion subunit is used to fuse the conversation vector and the corresponding conversation sentiment features, and determine the recommendation probability value based on the fused features obtained from the fusion operation.
[0116] In addition to any of the optional technical solutions in the embodiments of the present invention, the invention may also include:
[0117] The training session acquisition unit is used to acquire at least one pre-established training session and training labels corresponding to each training session before inputting the sample response statements and the corresponding session sentiment features from the sample session into the pre-trained case selection model; wherein, the training labels are used to label the training recommendation probability value of the corresponding training session.
[0118] The training emotion feature determination unit is used to determine the training emotion features corresponding to each training session; wherein, the training emotion features include at least two of the following: positive emotion, negative emotion, and neutral emotion;
[0119] The network parameter adjustment unit is used to input the training response statements and the corresponding training sentiment features of each training session into the neural network model to be trained for each training session, so as to obtain the predicted recommendation probability value of the training session; and adjust the network parameters in the neural network model based on the training labels and predicted recommendation probability values corresponding to the training sessions.
[0120] The case selection model determination unit is used to determine the neural network model at the end of training as the case selection model.
[0121] Based on any optional technical solution in the embodiments of the present invention, optionally, the training emotion feature determination unit includes:
[0122] The training response statement segmentation processing subunit is used to segment the training response statements in each training session to obtain the training segments corresponding to the training response statements.
[0123] The training emotion feature determination subunit is used to compare each training word with pre-defined emotion feature words, and determine the training emotion features corresponding to the training session based on the comparison results.
[0124] Based on any optional technical solution in the embodiments of the present invention, optionally, the question-and-answer correspondence database establishment module 13 includes:
[0125] The first consultation intent classification unit is used to classify the consultation intent of the target consultation questions in each target sample session to obtain at least one first consultation intent category.
[0126] The first question-and-answer correspondence database establishment unit is used to establish a question-and-answer correspondence database based on the correspondence between each first consultation intent category and each target consultation question, and the question-and-answer relationship between each target consultation question and each target response statement;
[0127] The question-and-answer correspondence database contains each first consultation intent category and at least one target response statement corresponding to each first consultation intent category.
[0128] Based on any optional technical solution in the embodiments of the present invention, optionally, the question-and-answer correspondence database establishment module 13 includes:
[0129] The target response statement input unit is used to input at least one target response statement from each target sample session into a pre-established statement extraction model to obtain the target response core sentence in each target response statement.
[0130] The second consultation intent classification unit is used to classify the consultation intent of the target consultation questions corresponding to the core sentences of each target response in each target sample conversation, and obtain at least one second consultation intent category.
[0131] The second question-and-answer correspondence database establishment unit is used to establish a question-and-answer correspondence database based on the correspondence between each second consultation intent category and each target consultation question corresponding to the target response core sentence, and the correspondence between the target response core sentence and the target consultation question;
[0132] The question-and-answer correspondence database contains each second consultation intent category and at least one target response core sentence corresponding to each second consultation intent category.
[0133] Based on any optional technical solution in the embodiments of the present invention, optionally, the target response statement input unit includes:
[0134] The target response statement input subunit is used to input at least one target response statement from the target sample session into the pre-established statement extraction model.
[0135] The sentence vector generation unit is used to convert each character in the target response statement into a character vector through a sentence extraction model for each input target response statement, and to perform feature fusion on each character vector corresponding to the target response statement to generate a sentence vector corresponding to the input target response statement.
[0136] The sentence type determination unit is used to determine the sentence type of each generated sentence vector based on its own features and the global correlation features between sentence vectors; the sentence type includes core type and non-core type.
[0137] The target response core sentence determination unit is used to determine the target response core sentence as the sentence vector corresponding to the sentence type core type.
[0138] In addition to any of the optional technical solutions in the embodiments of the present invention, the invention may also include:
[0139] The real-time consultation intent category determination module is used to determine the real-time consultation intent category of a real-time consultation question when a real-time consultation question sent by a user terminal is obtained after the question-and-answer correspondence database is established.
[0140] The real-time response statement push module is used to determine at least one real-time response statement corresponding to the real-time consultation intent category based on the question-and-answer correspondence database, and push the real-time response statement to the customer service terminal.
[0141] Based on any optional technical solution in the embodiments of the present invention, the optional real-time consultation intent category determination module includes:
[0142] The real-time consultation question input unit is used to input real-time consultation questions into a pre-established intent classification model to obtain the real-time consultation intent category corresponding to the real-time consultation question.
[0143] or,
[0144] The question keyword extraction unit is used to extract question keywords from real-time consultation questions. Based on the pre-established correspondence between keywords and consultation intent categories, the consultation intent category corresponding to the question keywords is determined as the real-time consultation intent category corresponding to the real-time consultation question.
[0145] Based on any optional technical solution in the embodiments of the present invention, optionally, the target sample session selection module 12 includes:
[0146] The first sample session determination unit is used to determine the first sample session whose recommendation probability value belongs to the preset recommendation value range;
[0147] The target sample session determination unit is used to select a preset number of second sample sessions as target sample sessions from each first sample session.
[0148] The question-and-answer correspondence database establishment apparatus provided in this embodiment of the invention can execute the question-and-answer correspondence database establishment method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0149] It is worth noting that in the embodiments of the above-mentioned question-and-answer correspondence database establishment device, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the scope of protection of the present invention.
[0150] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Figure 6 A block diagram of an exemplary electronic device 20 suitable for implementing embodiments of the present invention is shown. The illustrated electronic device 20 is merely an example and should not be construed as limiting the functionality and scope of the embodiments of the present invention.
[0151] like Figure 6 As shown, the electronic device 20 is presented in the form of a general-purpose computing device. The components of the electronic device 20 may include, but are not limited to: one or more processors or processing units 201, system memory 202, and bus 203 connecting different system components (including system memory 202 and processing unit 201).
[0152] Bus 203 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. For example, these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.
[0153] Electronic device 20 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by electronic device 20, including volatile and non-volatile media, removable and non-removable media.
[0154] System memory 202 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 204 and / or cache memory 205. Electronic device 20 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 206 may be used to read and write non-removable, non-volatile magnetic media. Disk drives for reading and writing to removable non-volatile disks (e.g., "floppy disks") and optical disk drives for reading and writing to removable non-volatile optical disks (e.g., CD-ROMs, DVD-ROMs, or other optical media) may be provided. In these cases, each drive may be connected to bus 203 via one or more data media interfaces. Memory 202 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of the present invention.
[0155] A program / utility 208 having a set (at least one) of program modules 207 may be stored, for example, in memory 202. Such program modules 207 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 207 typically perform the functions and / or methods described in the embodiments of the present invention.
[0156] Electronic device 20 can also communicate with one or more external devices 209 (e.g., keyboard, pointing device, display 210, etc.), and with one or more devices that enable a user to interact with electronic device 20, and / or with any device that enables electronic device 20 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed via input / output (I / O) interface 211. Furthermore, electronic device 20 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 212. As shown, network adapter 212 communicates with other modules of electronic device 20 via bus 203. It should be understood that other hardware and / or software modules can be used in conjunction with electronic device 20, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0157] The processing unit 201 executes various functional applications and data processing by running programs stored in the system memory 202.
[0158] The present invention provides an electronic device capable of implementing the following method: determining at least one sample session in a pre-established sample session library; wherein, the sample session includes a sample consultation question and a sample response statement corresponding to the sample consultation question; for each sample session, inputting the sample response statement in the sample session into a pre-trained case selection model to obtain a recommendation probability value corresponding to the sample session; selecting target sample sessions from each sample session based on the recommendation probability value corresponding to each sample session; and establishing a question-and-answer correspondence database for answering real-time consultation questions based on the target consultation question and target response statement in each target sample session. The question-and-answer correspondence database established through this embodiment combines the correspondence between consultation questions and response statements, facilitating more accurate and effective provision of response statements to customer service personnel; furthermore, establishing the question-and-answer correspondence database based on the recommendation probability value of the sample session takes into account the response effect of the response statements in the established question-and-answer correspondence database, making it easier to add response statements with better response effects and more worthy of recommendation to the question-and-answer correspondence database through the recommendation probability value, thereby achieving a better effect of providing consultation services to consultants.
[0159] This invention provides a storage medium containing computer-executable instructions. When executed by a computer processor, the computer-executable instructions are used to perform a method for establishing a question-and-answer correspondence database. The method includes: determining at least one sample session in a pre-established sample session library; wherein, the sample session includes a sample inquiry question and a sample response statement corresponding to the sample inquiry question; for each sample session, inputting the sample response statement in the sample session into a pre-trained case selection model to obtain a recommendation probability value corresponding to the sample session; selecting target sample sessions from each sample session based on the recommendation probability values corresponding to each sample session; and establishing a question-and-answer correspondence database for answering real-time inquiry questions based on the target inquiry question and target response statement in each target sample session. The question-and-answer correspondence database established through this embodiment combines the correspondence between consultation questions and response statements, making it easier to provide customer service with more accurate and effective response statements. Furthermore, by establishing the question-and-answer correspondence database based on the recommendation probability value of sample sessions, the response effect of the response statements in the established question-and-answer correspondence database is taken into account. This makes it easier to add response statements with better response effects and more recommendable responses to the question-and-answer correspondence database through the recommendation probability value, thereby achieving a better consultation service for consultants.
[0160] Of course, the computer-executable instructions provided in the embodiments of the present invention are not limited to the method operations described above, but can also perform related operations in the question-and-answer correspondence database establishment method provided in any embodiment of the present invention.
[0161] The computer storage medium of this invention can be any combination of one or more computer-readable media. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0162] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.
[0163] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including—but not limited to—wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0164] Computer program code for performing the operations of embodiments of the present invention can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0165] Note that the above description is merely a preferred embodiment of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, the scope of which is determined by the scope of the appended claims.
Claims
1. A method for establishing a question-and-answer correspondence database, characterized in that, include: At least one sample session is identified from a pre-established sample session library; wherein, the sample session includes a sample consultation question and a sample response statement corresponding to the sample consultation question; For each of the sample sessions, the sample response statements in the sample session are input into the pre-trained case selection model to obtain the recommendation probability value corresponding to the sample session; Based on the recommendation probability value corresponding to each of the sample sessions, a target sample session is selected from each of the sample sessions; Based on the target consultation questions and target response statements in each target sample session, a question-and-answer correspondence database for responding to real-time consultation questions is established. The step of establishing a question-and-answer correspondence database for responding to real-time consultation questions based on the target consultation questions and target response statements in each target sample session includes: For each target sample session, at least one target response statement in the target sample session is input into a pre-established statement extraction model to obtain the target response core sentence in each target response statement; The consultation intent is classified for the target consultation questions corresponding to the core sentences of the target responses in each target sample session to obtain at least one second consultation intent category. Based on the correspondence between each of the second consultation intent categories and each of the target consultation questions corresponding to the target response core sentence, and the correspondence between the target response core sentence and the target consultation question, the question-answer correspondence database is established; The question-and-answer correspondence database contains each of the second consultation intent categories and at least one target response core sentence corresponding to each of the second consultation intent categories.
2. The method according to claim 1, characterized in that, Before inputting the sample response statements from the sample session into the pre-trained case selection model, the method further includes: Determine the conversation sentiment features corresponding to each of the sample conversations in the sample conversation library; The step of inputting the sample response statements from the sample session into a pre-trained case selection model to obtain the recommendation probability value corresponding to the sample session includes: The sample response statements and the corresponding conversation sentiment features in the sample conversation are input into the pre-trained case selection model to obtain the recommendation probability value corresponding to the sample conversation.
3. The method of claim 2, wherein, The sample session includes at least one of the sample response statements; The step of inputting sample response statements and corresponding conversation sentiment features from the sample conversation into a pre-trained case selection model to obtain the recommendation probability value corresponding to the sample conversation includes: At least one sample response statement from the sample conversation and the corresponding conversation sentiment features are input into the pre-trained case selection model; For each input sample response statement, the case selection model converts each character in the sample response statement into a character vector; and performs feature fusion on each character vector to generate a sentence vector corresponding to the input sample response statement. Based on the sentence vectors corresponding to each of the sample response statements, a session vector corresponding to the sample session is generated. The conversation vector and the corresponding conversation sentiment feature are fused, and the recommendation probability value is determined based on the fused feature obtained from the fusion operation.
4. The method of claim 2, wherein, Before inputting the sample response statements and corresponding conversation sentiment features from the sample conversation into the pre-trained case selection model, the method further includes: Obtain at least one pre-established training session and training labels corresponding to each training session; wherein, the training labels are used to label the training recommendation probability value of the corresponding training session; Determine the training emotional features corresponding to each training session; wherein, the training emotional features include at least two of the following: positive emotion, negative emotion, and neutral emotion; For each training session, the training response statements in the training session and the training emotion features corresponding to the training session are input into the neural network model to be trained to obtain the predicted recommendation probability value of the training session; based on the training label corresponding to the training session and the predicted recommendation probability value, the network parameters in the neural network model are adjusted. The neural network model at the end of training is selected as the case selection model.
5. The method of claim 4, wherein, Determining the training emotion features corresponding to each training session includes: For each training session, the training response statements in the training session are segmented into words to obtain each training word corresponding to the training response statement; Each training word segment is compared with a pre-defined emotion feature word, and the training emotion feature corresponding to the training session is determined based on the comparison result.
6. The method of claim 1, wherein, The step of establishing a question-and-answer correspondence database for responding to real-time consultation questions based on the target consultation questions and target response statements in each target sample session includes: The consultation intent is classified for the target consultation questions in each target sample session to obtain at least one first consultation intent category; Based on the correspondence between each of the first consultation intent categories and each of the target consultation questions, and the question-and-answer relationship between each of the target consultation questions and each of the target response statements, the question-and-answer correspondence database is established; The question-and-answer correspondence database contains each of the first consultation intent categories and at least one target response statement corresponding to each of the first consultation intent categories.
7. The method of claim 1, wherein, The step of inputting the target response statement from the target sample session into a pre-established statement extraction model to obtain the core sentence of the target response statement includes: Input at least one target response statement from the target sample session into a pre-established statement extraction model; For each of the input target response statements, the statement extraction model converts each character in the target response statement into a character vector, and performs feature fusion on each character vector corresponding to the target response statement to generate a sentence vector corresponding to the input target response statement; For each of the generated sentence vectors, the sentence type of the sentence vector is determined based on its own features and the global correlation features between the sentence vectors; wherein, the sentence type includes core type and non-core type; The target response statement corresponding to the sentence vector with the sentence type of core type is determined as the target response core sentence.
8. The method of claim 1, wherein, After establishing the question-and-answer correspondence database, the following is also included: When a real-time consultation question is received from a user terminal, the real-time consultation intent category of the real-time consultation question is determined. Based on the question-and-answer correspondence database, at least one real-time response statement corresponding to the real-time consultation intent category is determined, and the real-time response statement is pushed to the customer service terminal.
9. The method of claim 8, wherein, Determining the real-time consultation intent category of the real-time consultation question includes: The real-time consultation question is input into a pre-established intent classification model to obtain the real-time consultation intent category corresponding to the real-time consultation question; Alternatively, extract the keywords from the real-time consultation question, and based on the pre-established correspondence between keywords and consultation intent categories, determine the consultation intent category corresponding to the question keywords as the real-time consultation intent category corresponding to the real-time consultation question.
10. The method according to any one of claims 1-7, characterized in that, The step of selecting a target sample session from each of the sample sessions based on the recommendation probability value corresponding to each of the sample sessions includes: The first sample session whose recommendation probability value falls within the preset recommendation value range was identified; A preset number of second sample sessions are selected from each of the first sample sessions as the target sample sessions.
11. An apparatus for establishing a question-and-answer correspondence database, characterized in that, include: The sample session determination module is used to determine at least one sample session from a pre-established sample session library; wherein, the sample session includes a sample consultation question and a sample response statement corresponding to the sample consultation question; The recommendation probability value determination module is used to input the sample response statements in each sample session into a pre-trained case screening model to obtain the recommendation probability value corresponding to the sample session. The target sample session selection module is used to select a target sample session from the sample sessions based on the recommendation probability value corresponding to each sample session. The question-and-answer correspondence database establishment module is used to establish a question-and-answer correspondence database for answering real-time questions based on the target consultation questions and target response statements in each target sample session. The question-and-answer correspondence database establishment module includes: The target response statement input unit is used to input at least one target response statement from each target sample session into a pre-established statement extraction model to obtain the target response core statement from each target response statement. The second consultation intent classification unit is used to classify the consultation intent of the target consultation questions corresponding to the core sentences of the target responses in each target sample conversation, and obtain at least one second consultation intent category. The second question-and-answer correspondence database establishment unit is used to establish the question-and-answer correspondence database based on the correspondence between each of the second consultation intent categories and each of the target consultation questions corresponding to the target response core sentence, and the correspondence between the target response core sentence and the target consultation question; The question-and-answer correspondence database contains each of the second consultation intent categories and at least one target response core sentence corresponding to each of the second consultation intent categories.
12. An electronic device, characterized in that, include: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method for establishing a question-and-answer correspondence database as described in any one of claims 1-10.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the method for establishing a question-and-answer correspondence database as described in any one of claims 1-10.
Citation Information
Patent Citations
Verbal trick recommendation device and method and model training device
CN110032630A
Method for generating recommended speaking skill set and method and device for recommending speaking skill
CN110046230A
Intelligent interaction system and method based on legal consultation
CN111400453A