Question generation method, device, equipment and storage medium for dialogue training

By combining a deep semantic matching model with user portraits and conversation information, the feature vector similarity is calculated and the target questions are screened out, thus solving the problem of inaccurate question generation in existing technologies and achieving more accurate conversation training.

CN114398909BActive Publication Date: 2025-09-05CHINA PING AN LIFE INSURANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210054985.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-18
Publication Date
2025-09-05
Estimated Expiration
2042-01-18

AI Technical Summary

Technical Problem

In existing dialogue training systems, question generation relies solely on keyword information input by users and fails to consider the impact of other information, resulting in inaccurate generated questions.

Method used

By obtaining user portrait information and conversation information, using a deep semantic matching model to perform feature extraction and vectorization processing, the similarity between feature vectors is calculated to screen out the target questions that best match the user portrait.

Benefits of technology

The generated questions more accurately match the current user's interests and needs, improving the effectiveness of dialogue training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114398909B_ABST
    Figure CN114398909B_ABST
Patent Text Reader

Abstract

The present application provides a question generation method, apparatus, device, and storage medium for dialogue training, which belongs to the field of artificial intelligence technology. The method includes: obtaining original user data; wherein the original user data includes user portrait information and dialogue information; performing a first screening process on a preset question library according to the user portrait information to obtain preliminary question data; performing a matching process on the preliminary question data to obtain a first feature vector; performing feature extraction process on the user portrait information and the dialogue information to obtain a second feature vector; calculating the similarity between the first feature vector and the second feature vector to obtain similarity value data; performing a second screening process on the preliminary question data according to the similarity value data to obtain a target question. By comparing the similarity of the feature vectors, the target question finally generated can be made more consistent with the current user portrait, thereby making the generated target question more accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a method, apparatus, device, and storage medium for generating questions for dialogue training. Background Art

[0002] With the development of society and advancements in technology, numerous intelligent dialogue systems have emerged, such as intelligent dialogue robots and intelligent customer service. Through these systems, users can perform tasks such as information search, social interaction, and dialogue training. During dialogue training, intelligent dialogue systems continuously ask questions to improve users' conversational skills.

[0003] In the intelligent dialogue system used for dialogue training in the related art, corresponding questions are generated only based on the keyword information input by the user. However, this question generation method does not consider the influence of other information, resulting in the generated questions being inaccurate. Summary of the Invention

[0004] The main purpose of the embodiments of the present application is to propose a question generation method, apparatus, device and storage medium for dialogue training to improve the accuracy of generated questions.

[0005] To achieve the above objectives, a first aspect of an embodiment of the present application provides a question generation method for dialogue training, the method comprising:

[0006] Obtaining original user data; wherein the original user data includes user portrait information and conversation information;

[0007] Performing a first screening process on a preset question library according to the user portrait information to obtain preliminary question data;

[0008] Performing matching processing on the preliminary question data through a preset question vector library to obtain a first feature vector that matches the preliminary question data;

[0009] performing feature extraction processing on the user portrait information and performing feature extraction processing on the conversation information to obtain a second feature vector;

[0010] Calculating the similarity between the first eigenvector and the second eigenvector to obtain similarity value data;

[0011] A second screening process is performed on the preliminary question data according to the similarity value data to obtain a target question.

[0012] In some embodiments, the user portrait information includes interest tag information, the question library includes a plurality of question information, and the first screening process is performed on the preset question library according to the user portrait information to obtain preliminary question data, including:

[0013] Obtain keyword information according to the interest tag information;

[0014] Searching the question database using the keyword information to obtain the question information that matches the keyword information;

[0015] The question information matched with the keyword information is used as the preliminary question data.

[0016] In some embodiments, before performing matching processing on the preliminary question data using a preset question vector library to obtain a first feature vector matching the preliminary question data, the method includes:

[0017] Performing a first unique-hot encoding on the plurality of question information to obtain a plurality of first word vector data;

[0018] Inputting the plurality of first word vector data into the trained deep semantic matching model in sequence for feature extraction processing to obtain question feature vector data;

[0019] The problem feature vector data is stored to obtain the problem vector library.

[0020] In some embodiments, the performing feature extraction processing on the user portrait information and the performing feature extraction processing on the conversation information to obtain a second feature vector includes:

[0021] Perform a second unique-hot encoding on the user portrait information to obtain portrait word vector data;

[0022] Performing a third unique-hot encoding on the conversation information to obtain conversation word vector data;

[0023] splicing the portrait word vector data and the dialogue word vector data to obtain second word vector data;

[0024] The second word vector data is input into the trained deep semantic matching model for feature extraction processing to obtain the second feature vector.

[0025] In some embodiments, calculating the similarity between the first feature vector and the second feature vector to obtain similarity value data includes:

[0026] Calculating the cosine similarity between the first eigenvector and the second eigenvector to obtain cosine value data;

[0027] The cosine value data is used as the similarity value data.

[0028] In some embodiments, performing a second screening process on the preliminary question data according to the similarity value data to obtain a target question includes:

[0029] Filtering out the maximum similarity value from the similarity value data;

[0030] The target question is obtained according to the maximum similarity value.

[0031] In some embodiments, after performing a second screening process on the preliminary question data based on the similarity value data to obtain a target question, the method further includes:

[0032] Vectorize the target problem to obtain a third eigenvector;

[0033] Inputting the third eigenvector into a trained speech synthesis model for speech synthesis processing to obtain a question speech;

[0034] Output the question voice to ask the question.

[0035] To achieve the above-mentioned purpose, the second aspect of the present application proposes a question generation device for dialogue training, the device comprising:

[0036] An acquisition module, the acquisition module is used to acquire original user data; wherein the original user data includes user portrait information and conversation information;

[0037] A first screening module, the first screening module is used to perform a first screening process on a preset question library according to the user portrait information to obtain preliminary question data;

[0038] a first vector acquisition module, configured to perform matching processing on the preliminary question data using a preset question vector library to obtain a first feature vector that matches the preliminary question data;

[0039] a second vector acquisition module, configured to perform feature extraction processing on the user portrait information and the conversation information to obtain a second feature vector;

[0040] a calculation module, configured to calculate a similarity between the first eigenvector and the second eigenvector to obtain similarity value data;

[0041] The second screening module is used to perform a second screening process on the preliminary question data according to the similarity value data to obtain a target question.

[0042] In some embodiments, the user portrait information includes interest tag information, the question library includes multiple question information, and the first screening module is used to perform a first screening process on the preset question library according to the user portrait information to obtain preliminary question data, specifically including:

[0043] Obtain keyword information according to the interest tag information;

[0044] Searching the question database using the keyword information to obtain the question information that matches the keyword information;

[0045] The question information matched with the keyword information is used as the preliminary question data.

[0046] In some embodiments, the first vector acquisition module is configured to perform matching processing on the preliminary question data using a preset question vector library to obtain a first feature vector matching the preliminary question data, and further includes:

[0047] Performing a first unique-hot encoding on the plurality of question information to obtain a plurality of first word vector data;

[0048] Inputting the plurality of first word vector data into the trained deep semantic matching model in sequence for feature extraction processing to obtain question feature vector data;

[0049] The problem feature vector data is stored to obtain the problem vector library.

[0050] In some embodiments, the second vector acquisition module is used to perform feature extraction processing on the user portrait information and the conversation information to obtain a second feature vector, specifically including:

[0051] Perform a second unique-hot encoding on the user portrait information to obtain portrait word vector data;

[0052] Performing a third unique-hot encoding on the conversation information to obtain conversation word vector data;

[0053] splicing the portrait word vector data and the dialogue word vector data to obtain second word vector data;

[0054] The second word vector data is input into the trained deep semantic matching model for feature extraction processing to obtain the second feature vector.

[0055] In some embodiments, the calculation module is configured to calculate the similarity between the first feature vector and the second feature vector to obtain similarity value data, specifically including:

[0056] Calculating the cosine similarity between the first eigenvector and the second eigenvector to obtain cosine value data;

[0057] The cosine value data is used as the similarity value data.

[0058] In some embodiments, the second screening module is configured to perform a second screening process on the preliminary question data according to the similarity value data to obtain a target question, specifically including:

[0059] Filtering out the maximum similarity value from the similarity value data;

[0060] The target question is obtained according to the maximum similarity value.

[0061] In some embodiments, the second screening module is configured to perform a second screening process on the preliminary question data according to the similarity value data to obtain a target question, further comprising:

[0062] A third vector acquisition module, configured to vectorize the target problem to obtain a third eigenvector;

[0063] a speech synthesis module, wherein the speech synthesis module is used to input the third feature vector into a trained speech synthesis model to perform speech synthesis processing to obtain a question speech;

[0064] The questioning module is used to output the question voice to ask questions.

[0065] To achieve the above-mentioned objectives, the third aspect of the present application provides an electronic device, comprising:

[0066] at least one memory;

[0067] at least one processor;

[0068] at least one computer program;

[0069] The computer program is stored in a memory, and the processor executes at least one computer program to implement the method of the first aspect described in the present application.

[0070] To achieve the above-mentioned object, the fourth aspect of the present application provides a storage medium, which is a computer-readable storage medium. The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute:

[0071] As described in the first aspect above.

[0072] The embodiment of the present application proposes a method, apparatus, device, and storage medium for question generation for dialogue training. The method obtains original user data and filters a preset question library based on the user profile information in the original user data to obtain preliminary question data. After matching the preliminary question data, a corresponding first feature vector is obtained. At the same time, after feature extraction processing is performed on the user profile information and dialogue information in the original user data, a second feature vector is obtained. Finally, the similarity between the first feature vector and the second feature vector is calculated, and the target question is obtained based on the size of the similarity value. The first feature vector obtained through the above-mentioned feature extraction processing is used to represent different question data, and the second feature vector is used to represent the user profile and dialogue data of the user. By comparing the similarity of the feature vectors, the target question finally generated can be made more consistent with the current user profile, thereby making the generated target question more accurate. BRIEF DESCRIPTION OF THE DRAWINGS

[0073] Figure 1 is a flowchart of the question generation method provided in an embodiment of the present application;

[0074] Figure 2 yes Figure 1 Flowchart of step S200;

[0075] Figure 3 is a flowchart of a question generation method provided by another embodiment of the present application;

[0076] Figure 4 yes Figure 1 Flowchart of step S400;

[0077] Figure 5 yes Figure 1 Flowchart of step S500;

[0078] Figure 6 yes Figure 1 Flowchart of step S600;

[0079] Figure 7 is a flowchart of a question generation method provided by another embodiment of the present application;

[0080] Figure 8 It is a module diagram of the question generating device provided in an embodiment of the present application;

[0081] Figure 9 This is a schematic diagram of the hardware structure of the electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0082] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0083] It should be noted that although the device schematics illustrate functional module divisions and the flowcharts illustrate logical sequences, in certain circumstances, the steps shown or described may be performed in a sequence that differs from the module divisions in the device or the sequence in the flowcharts. The terms "first," "second," and so on, in the specification, claims, and drawings, are used to distinguish similar items and are not necessarily used to describe a specific sequence or precedence.

[0084] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.

[0085] In addition, the described features, structures or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure can be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, well-known methods, devices, implementations or operations are not shown or described in detail to avoid blurring various aspects of the present disclosure.

[0086] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0087] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, while others may be combined or partially combined. Therefore, the actual execution order may vary depending on the actual situation.

[0088] First, let’s analyze some of the terms used in this application:

[0089] Deep Structured Semantic Models (DSSM): A dual-tower model used in recommendation applications, the DSSM constructs two independent sub-networks, using complex deep learning networks to construct feature vectors for query and document features during training. During online prediction, the semantic similarity between the two feature vectors is calculated by calculating the similarity between them.

[0090] DBSCAN (Density-Based Spatial Clustering of Applications with Noise): This is a density-based, unsupervised ML clustering algorithm that does not require pre-labeled targets to cluster data points. Unlike partitioning and hierarchical clustering methods, DBSCAN defines a cluster as the largest set of density-connected points. It can cluster areas with sufficiently high density and can discover clusters of arbitrary shapes in noisy spatial databases. It can be used as an alternative to popular clustering algorithms such as K-Means and hierarchical clustering.

[0091] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI): is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence; artificial intelligence is a branch of computer science. Artificial intelligence attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Research in this field includes robotics, speech recognition, image recognition, natural language processing and expert systems. Artificial intelligence can simulate the information process of human consciousness and thinking. Artificial intelligence is also the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0092] Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.

[0093] The conversational functions of conversational robots in related technologies are more focused on chatting and answering questions. The questions they generate are merely information completion and small talk questions. The method of generating questions is relatively simple and cannot generate targeted questions based on the user's profile. For example, when conversational robots are used to assist sales staff in sales training, different customer groups will ask different questions. For example, in the insurance sales field, when the customer is an elderly retired man, he is more likely to ask questions such as "What is the upper age limit for insurance?" than "What is the coverage of the insurance?"; when the customer is a middle-aged woman with children, she is more likely to ask questions such as "Can my underage children be insured?" than "How many policies can I buy?"

[0094] Based on this, the embodiments of the present application provide a question generation method, apparatus, device and storage medium for dialogue training, which can generate target questions by combining user portrait information, thereby making the generated target questions more accurate.

[0095] The embodiments of the present application provide a method, apparatus, device, and storage medium for generating questions for dialogue training, which are specifically illustrated by the following embodiments. First, the method for generating questions for dialogue training in the embodiments of the present application is described.

[0096] The question generation method provided in the embodiment of the present application relates to the field of machine learning technology. The question generation method provided in the embodiment of the present application can be applied to a terminal, can be applied to a server side, or can be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer or a smart watch, etc.; the server side can be configured as an independent physical server, or as a server cluster or distributed system composed of multiple physical servers, or as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the question generation method, etc., but is not limited to the above forms.

[0097] Figure 1 This is an optional flowchart of the question generation method for dialogue training provided in an embodiment of the present application. Figure 1 The method may include but is not limited to steps S100 to S600.

[0098] S100, obtaining original user data; wherein the original user data includes user portrait information and conversation information;

[0099] S200, performing a first screening process on a preset question library based on user portrait information to obtain preliminary question data;

[0100] S300, performing matching processing on the preliminary question data using a preset question vector library to obtain a first feature vector that matches the preliminary question data;

[0101] S400, performing feature extraction processing on the user portrait information and the conversation information to obtain a second feature vector;

[0102] S500, calculating the similarity between the first eigenvector and the second eigenvector to obtain similarity value data;

[0103] S600: Perform a second screening process on the preliminary question data according to the similarity value data to obtain a target question.

[0104] In steps S100 to S600 of the embodiment of the present application, the original user data is obtained, and the preset question library is screened according to the user portrait information in the original user data, thereby obtaining preliminary question data. After matching the preliminary question data, the corresponding first feature vector is obtained. At the same time, the second feature vector is obtained after feature extraction processing is performed on the user portrait information and conversation information in the original user data. Finally, the similarity between the first feature vector and the second feature vector is calculated, and the target question is obtained according to the size of the similarity value. The first feature vector obtained by the above-mentioned feature extraction processing is used to represent different question data, and the second feature vector is used to represent the user portrait and conversation data of the user. By comparing the similarity of the feature vectors, the target question finally generated can be made more consistent with the current user portrait, thereby making the generated target question more accurate.

[0105] The question generation method for conversation training of this application can be applied to a conversation robot to assist sales personnel in conducting sales speech training through the conversation robot, thereby improving the sales personnel's sales ability. The following describes the question generation method provided by the embodiment of this application in detail, taking the question generation method applied to a conversation robot as an example.

[0106] In some embodiments, when the question generation method is applied to a conversational robot, the conversational robot can simulate different types of users to assist sales staff in training. In step S100, the conversational robot can obtain original user data in a variety of ways.

[0107] When obtaining user portrait information, the following methods can be used. For example, a dialogue robot stores multiple pre-set simulated user images (such as young men, middle-aged women, elderly men, etc.), and the simulated user images include corresponding user portrait information. The user selects a specific simulated user image through the user operation interface, and the dialogue robot can obtain the corresponding user portrait information; or, the dialogue robot can display selectable user information on the display interface (such as user age, user gender, user income, user education, whether to buy insurance, marital status, children's status, insurance type of interest, etc.), and the user needs to select the specific parameters of the corresponding optional user information (such as user age is selected as 30 years old, user gender is selected as male, etc.). After all selections are completed, the dialogue robot can obtain the corresponding user portrait information; or, the user can input the corresponding user portrait information to the dialogue robot in the form of a customized user portrait through text, voice, etc.

[0108] Conversation information is the user's response to the current question. Several methods are available for obtaining conversation information. For example, a conversational robot can use a microphone to capture the user's voice information and obtain the corresponding conversation information through voice recognition. Alternatively, the user can input text information of the answer into the conversational robot through the user interface, and the conversational robot will use the text information as the corresponding conversation information.

[0109] In some embodiments, the user portrait information includes interest tag information, and the question library includes multiple question information. Figure 2 In step S200, a first screening process is performed on the preset question library according to the user portrait information to obtain preliminary question data, including:

[0110] S210, obtaining keyword information based on the interest tag information;

[0111] S220, searching the question database using the keyword information to obtain question information matching the keyword information;

[0112] S230: Taking the question information matched with the keyword information as preliminary question data.

[0113] The user portrait information in the embodiment of the present application includes the user's interest tag information, and the interest tag information is used to characterize the focus of the corresponding user. For example, older users may be more likely to pay attention to life insurance information, and users with children may be more likely to pay attention to insurance information about teenagers. The preset question library includes a variety of different types of question information, and the question information is collected and sorted during the actual problem consultation process. By using the user portrait information to first filter the preset question library, questions that are less consistent with the current user identity can be filtered out, reducing the amount of calculation during subsequent processing.

[0114] During the screening process, first, step S210 is used to obtain keyword information based on the interest tag information. It is understandable that the interest tag information may include multiple keyword information. For example, when the user portrait is an elderly user, the corresponding interest tag information may include keyword information such as cancer, serious illness insurance, and health insurance. Then, step S220 is used to search in the question library through the keyword information to obtain question information that matches the keyword information. It is understandable that when searching through keyword information, the keyword information can be directly matched with the keywords in the question information in the question library. When there are corresponding keywords in the question information, the corresponding question information can be filtered out; or when constructing a preset question library, the question information in the question library is classified and stored. When matching through keyword information, it is only necessary to select the corresponding category through the keyword information to obtain question information that matches the keyword information.

[0115] Finally, in step S230, the question information matching the keyword information is used as preliminary question data. The preliminary question data can be obtained by filtering the corresponding question information from the preset question library.

[0116] In some other embodiments, the preset question library can also be screened by combining other information in the user portrait (such as the user's disease information, etc.) to obtain corresponding preliminary question data.

[0117] In some embodiments, reference Figure 3 In step S300, before matching the preliminary question data with a preset question vector library to obtain a first feature vector matching the preliminary question data, the question generation method includes:

[0118] S310, performing first one-hot encoding on the plurality of question information to obtain a plurality of first word vector data;

[0119] S320, sequentially inputting the plurality of first word vector data into the trained deep semantic matching model for feature extraction processing to obtain question feature vector data;

[0120] S330, storing the problem feature vector data to obtain a problem vector library;

[0121] The first feature vector of the embodiment of the present application is obtained through matching processing in a preset question vector library based on preliminary question data. It can be understood that the preliminary question data includes multiple question information, and the first feature vector obtained through matching also includes multiple feature vectors. The question information and the feature vector are in a one-to-one correspondence.

[0122] The feature vectors in the preset question vector library in the embodiments of the present application are obtained by sequentially extracting features from multiple question information in the preset question library using a trained deep semantic matching model, and then storing the extracted features. The training set for training the deep semantic matching model includes collected user profile information, conversation information, and question information.

[0123] The collected user profile information may include information such as user age, gender, income range, education level, whether or not they have purchased insurance, marital status, children's status, insurance products they are interested in, and hobbies. Since multiple collected user profiles may contain overlapping profiles, the first step is to merge the profiles with the same attribute combinations. For example, all user profiles with the following attributes: "user age range 25 to 30, user gender female, user income range 12,000 to 22,000 yuan, user education level undergraduate, user insurance purchase history, married with no children" are clustered together to obtain the corresponding user profile group Si. Si includes interest tag information for multiple users. One or more interest tags with high frequency of occurrence are selected as the representative attribute set Fi of Si. This step allows for a preliminary merging of a large amount of user profile information, reducing the number of profiles to be processed. For example, after processing, we obtain S = {S1, S2, ..., S250} and F = {F1, F2, ..., F250}. The two sets of overall comparisons are used as the user profile of the user.

[0124] The merged user profiles are then clustered to determine whether the corresponding interest tags in vector space Si appear frequently. As can be understood, this vector space is unordered and sparse. Therefore, using the density-based DBSCAN algorithm, set S is clustered into a preset number of clusters, for example, 25 clusters. This compresses the merged user profiles into 25 user profiles, which are the most representative. The corresponding set F is also clustered into 25 clusters. For example, "User age range is 25 to 30, user gender is female, user income range is 12,000 to 22,000 yuan, user education level is undergraduate, user has insurance, and is married with no children" and "User age range is 30 to 35, user gender is female, user income range is 12,000 to 22,000 yuan, user education level is junior college, user has insurance, and is married with no children" are very close in vector space and are therefore considered the same cluster.

[0125] The conversation information and question information in the training set are collected from daily sales conversations. This data is then fed into the deep semantic matching model to train the neural network. It can be understood that user profile information and conversation information are input as queries, and question information is input as documents. Feature extraction is performed through the deep learning network in the representation layer. Through backpropagation and training, a trained deep semantic matching model is ultimately obtained. The specific training methods for the deep semantic matching model are well known to those skilled in the art and will not be detailed here.

[0126] Through step S310, multiple question information is subjected to first unique-hot encoding to obtain multiple first word vector data. First, multiple question information in the preset question library is obtained, and then the question information is unique-hot encoded in turn, so as to obtain multiple first word vectors corresponding to the multiple question information. Then through step S320, the multiple first word vector data are sequentially input into the trained deep semantic matching model for feature extraction processing to obtain question feature vector data. It can be understood that the first word vector data is input into the deep semantic matching model as doc, and the obtained question feature vector data includes multiple feature vectors corresponding one-to-one to multiple question information. After the feature extraction processing, the question feature vector data is stored through step S330 to obtain a question vector library. The question vector library stores feature vectors corresponding one-to-one to the input question information. When performing matching processing, by identifying the question information included in the preliminary question data and then searching in the question vector library, the feature vector corresponding one-to-one to the question information in the preliminary question data can be obtained, and the feature vector obtained by searching is used as the first feature vector. By performing a matching search in the question vector library, the eigenvector corresponding to the preliminary question data can be obtained, thereby obtaining the corresponding first eigenvector. The pre-calculation and storage method in this embodiment facilitates obtaining the corresponding first eigenvector online through a simple matching search, facilitating subsequent matching degree calculations. This method is highly efficient online and consumes less computing resources.

[0127] In some other embodiments, when used online, the question information in the screened preliminary question data can be sequentially input into the deep semantic matching model, and feature extraction processing can be performed in real time to obtain the corresponding first feature vector.

[0128] In some embodiments, reference Figure 4 In step S400, feature extraction processing is performed on the user portrait information and the conversation information to obtain a second feature vector, including:

[0129] S410, performing a second one-hot encoding on the user portrait information to obtain portrait word vector data;

[0130] S420, performing third one-hot encoding on the conversation information to obtain conversation word vector data;

[0131] S430, concatenating the portrait word vector data and the dialogue word vector data to obtain second word vector data;

[0132] S440: Input the second word vector data into the trained deep semantic matching model for feature extraction to obtain a second feature vector.

[0133] Since the user portrait information and the conversation information are input by the user during use, it is necessary to perform feature extraction on the user portrait information and the conversation information in real time to obtain the second feature vector.

[0134] First, through step S410 and step S420, the user portrait information and conversation information are uniquely encoded respectively to obtain corresponding portrait word vector data and conversation word vector data. Then, through step S430, the portrait word vector data and the conversation word vector data are spliced, and the spliced ​​vector is used as the second word vector data. Finally, through step S440, the second word vector data is input into the trained deep semantic matching model for feature extraction processing to obtain a second feature vector. It can be understood that the second word vector data is input into the deep semantic matching model as a query. The second feature vector after feature extraction only includes a feature vector for characterizing the current user portrait and conversation information.

[0135] In some embodiments, reference Figure 5 In step S500, the similarity between the first eigenvector and the second eigenvector is calculated to obtain similarity value data, including:

[0136] S510, calculating the cosine similarity between the first eigenvector and the second eigenvector to obtain cosine value data;

[0137] S520: Use the cosine value data as similarity value data.

[0138] In this embodiment of the present application, the calculated first feature vector includes multiple feature vectors representing different question information, and the second feature vector includes a feature vector representing the current user profile and conversation information. After feature extraction using the deep semantic matching model, the resulting feature vector is a 128-dimensional vector. At this point, in step S510, the cosine similarity between the first feature vector and the second feature vector is calculated to obtain cosine value data. It will be appreciated that the obtained cosine value data includes multiple cosine similarities. Then, in step S520, the cosine value data is used as similarity value data. The cosine similarity ranges from [-1, 1]. The closer the cosine similarity is to 1, the more similar the two vectors are. To facilitate subsequent calculations, the corresponding cosine distance can be calculated based on the cosine value data and used as the similarity value data. It will be appreciated that the cosine distance ranges from [0, 2], so the obtained similarity value data also ranges from [0, 2]. A larger value indicates a closer distance between the two feature vectors.

[0139] In some other embodiments, the corresponding similarity value data may also be obtained by similarity calculation methods such as Pearson correlation coefficient and Euclidean similarity.

[0140] In some embodiments, reference Figure 6 In step S600, the preliminary question data is subjected to a second screening process based on the similarity value data to obtain the target question, including:

[0141] S610, filtering out the maximum similarity value from the similarity value data;

[0142] S620: Obtain a target question based on the maximum similarity value.

[0143] In this embodiment, it is necessary to filter the preliminary question data based on the obtained similarity data to obtain the most matching and most similar target question. When the similarity value data is obtained by calculating the cosine similarity, the larger the similarity value, the more similar the two feature vectors are. Therefore, through step S610, the similarity value data is subjected to maximum value filtering processing, and the maximum similarity value is filtered out from the similarity value data. Then, through step S620, the target question is obtained based on the maximum similarity value. After obtaining the maximum similarity value, the target feature vector corresponding to the first feature vector when the maximum value is obtained can be obtained, and then the preliminary question data is matched according to the target feature vector to obtain the corresponding target question. The target question obtained is the question information that the user is most likely to ask under the currently selected user portrait information and dialogue information. The dialogue robot can train the sales staff to ask questions by outputting the corresponding target question.

[0144] In some embodiments, reference Figure 7 In step S600, after performing a second screening process on the preliminary question data according to the similarity value data to obtain the target question, the question generation method further includes:

[0145] S700, vectorizing the target problem to obtain a third eigenvector;

[0146] S800: Input the third feature vector into the trained speech synthesis model to perform speech synthesis processing to obtain the question speech;

[0147] S900: Output question voice to ask questions.

[0148] In this embodiment, the target question obtained is text information. In order to improve the training efficiency, the target question needs to be converted into the corresponding question voice and then asked to the user. First, through step S700, the target question is vectorized to obtain the third eigenvector. Then, through step S800, the third eigenvector is input into the trained speech synthesis model for speech synthesis processing to obtain the question voice. The speech synthesis model can adopt commonly used models such as WaveNet, Tacotron&Tacotron-2, Tacotron+WaveNet, etc. The training set is the target question and the question voice corresponding to the target question. The specific training process of the speech synthesis model is known to those skilled in the art and will not be repeated here. After obtaining the question voice, step S900 is used to output the question voice to ask questions. When applied to a dialogue robot, the dialogue robot plays the corresponding question voice through a speaker to ask questions to the salesperson to be trained.

[0149] In some other embodiments, the corresponding target question can be recorded by manual reading to obtain a corresponding voice library. The corresponding question voice can be obtained by searching and matching in the voice library according to the obtained target question. The question voice obtained in this way can also be used to ask questions.

[0150] In a specific embodiment, when the question generation method of the present application is applied to a conversational robot and used to train sales personnel in sales techniques, the salesperson first enters user profile information on the conversational robot through the user interface. At this time, the conversational robot will simulate the corresponding user to ask questions. It is understandable that when the salesperson interacts with the conversational robot for the first time, the salesperson does not need to enter the conversation information first. The conversational robot can also obtain the corresponding target question based on the user profile information. After the conversational robot plays the question voice to the salesperson using the target question, the salesperson will answer according to the corresponding question voice. At this time, the conversational robot then collects the salesperson's answer voice and obtains the conversation information after processing. The conversational robot then obtains new target questions based on the user profile information and the corresponding conversation information, and asks the salesperson questions. It is understandable that the conversational robot can record the target questions obtained each time. During a complete training process, it can be pre-set to prevent the conversational robot from asking the same questions to improve the training effect.

[0151] In some embodiments, reference Figure 8 , the present application also proposes a question generation device for dialogue training, the device comprising:

[0152] The acquisition module is used to obtain original user data; wherein the original user data includes user portrait information and conversation information;

[0153] A first screening module is used to perform a first screening process on a preset question library according to user portrait information to obtain preliminary question data;

[0154] A first vector acquisition module, the first vector acquisition module is used to perform matching processing on the preliminary question data through a preset question vector library to obtain a first feature vector that matches the preliminary question data;

[0155] A second vector acquisition module, which is used to perform feature extraction processing on the user portrait information and the conversation information to obtain a second feature vector;

[0156] A calculation module is used to calculate the similarity between the first eigenvector and the second eigenvector to obtain similarity value data;

[0157] The second screening module is used to perform a second screening process on the preliminary question data according to the similarity value data to obtain the target question.

[0158] In some embodiments, the user portrait information includes interest tag information, the question library includes multiple question information, and the first screening module is used to perform a first screening process on the preset question library based on the user portrait information to obtain preliminary question data, specifically including:

[0159] Obtain keyword information based on interest tag information;

[0160] Search the question database using keyword information to obtain question information that matches the keyword information;

[0161] The question information matched with the keyword information is used as preliminary question data.

[0162] In some embodiments, the first vector acquisition module is configured to perform matching processing on the preliminary question data using a preset question vector library to obtain a first feature vector that matches the preliminary question data, and specifically further includes:

[0163] Perform first unique-hot encoding on the multiple question information to obtain multiple first word vector data;

[0164] Inputting the multiple first word vector data into the trained deep semantic matching model in sequence for feature extraction processing to obtain question feature vector data;

[0165] The problem feature vector data is stored to obtain a problem vector library.

[0166] In some embodiments, the second vector acquisition module is used to perform feature extraction processing on the user portrait information and the conversation information to obtain a second feature vector, specifically including:

[0167] Perform second unique-hot encoding on the user portrait information to obtain the portrait word vector data;

[0168] Perform third-hot encoding on the conversation information to obtain conversation word vector data;

[0169] Concatenate the portrait word vector data and the dialogue word vector data to obtain second word vector data;

[0170] The second word vector data is input into the trained deep semantic matching model for feature extraction to obtain a second feature vector.

[0171] In some embodiments, the calculation module is used to calculate the similarity between the first feature vector and the second feature vector to obtain similarity value data, specifically including:

[0172] Calculate the cosine similarity between the first eigenvector and the second eigenvector to obtain cosine value data;

[0173] The cosine value data is used as the similarity value data.

[0174] In some embodiments, the second screening module is configured to perform a second screening process on the preliminary question data based on the similarity value data to obtain a target question, specifically including:

[0175] Filter out the maximum similarity value from the similarity value data;

[0176] The target problem is obtained based on the maximum similarity.

[0177] In some embodiments, the second screening module is configured to perform a second screening process on the preliminary question data based on the similarity value data to obtain the target question, further comprising:

[0178] A third vector acquisition module, which is used to vectorize the target problem to obtain a third eigenvector;

[0179] A speech synthesis module is used to input the third feature vector into the trained speech synthesis model for speech synthesis processing to obtain the question speech;

[0180] The question module is used to output question voice to ask questions.

[0181] The question generation device for dialogue training proposed in the embodiment of the present application obtains original user data and filters a preset question library based on the user profile information in the original user data to obtain preliminary question data. After matching the preliminary question data, a corresponding first feature vector is obtained. At the same time, after feature extraction processing is performed on the user profile information and dialogue information in the original user data, a second feature vector is obtained. Finally, the similarity between the first feature vector and the second feature vector is calculated, and the target question is obtained based on the size of the similarity value. The first feature vector obtained through the above-mentioned feature extraction processing is used to represent different question data, and the second feature vector is used to represent the user profile and dialogue data of the user. By comparing the similarity of the feature vectors, the target question finally generated can be made more consistent with the current user profile, thereby making the generated target question more accurate.

[0182] An embodiment of the present application further provides an electronic device, including:

[0183] at least one memory;

[0184] at least one processor;

[0185] at least one computer program;

[0186] The computer program is stored in the memory, and the processor executes the at least one computer program to implement the above-mentioned question generation method implemented in this application. The electronic device can be any smart terminal including a mobile phone, a tablet computer, a personal digital assistant (PDA), an in-vehicle computer, etc.

[0187] See also Figure 9 , Figure 9 The hardware structure of an electronic device according to another embodiment is shown. The electronic device includes:

[0188] The processor may be implemented as a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;

[0189] The memory can be implemented in the form of ROM (Read Only Memory), static storage device, dynamic storage device or RAM (Random Access Memory). The memory can store the operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program code is stored in the memory and is called by the processor to execute the question generation method of the embodiments of this application;

[0190] Input / output interface, used to realize information input and output;

[0191] Input / communication interface, used to enable communication between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WiFi, Bluetooth, etc.);

[0192] A bus that transfers information between the various components of a device (e.g., processor, memory, input / output interfaces, and input / communication interfaces);

[0193] The processor, memory, input / output interface and input / communication interface are connected to each other through a bus within the device.

[0194] An embodiment of the present application further provides a storage medium, which is a computer-readable storage medium. The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the above-mentioned question generating method.

[0195] The electronic device and storage medium proposed in the embodiment of the present application obtains original user data and filters a preset question library based on the user portrait information in the original user data to obtain preliminary question data. After matching the preliminary question data, a corresponding first feature vector is obtained. At the same time, after feature extraction processing is performed on the user portrait information and conversation information in the original user data, a second feature vector is obtained. Finally, the similarity between the first feature vector and the second feature vector is calculated, and the target question is obtained based on the size of the similarity value. The first feature vector obtained through the above-mentioned feature extraction processing is used to represent different question data, and the second feature vector is used to represent the user portrait and conversation data of the user. By comparing the similarity of the feature vectors, the target question finally generated can be made more consistent with the current user portrait, thereby making the generated target question more accurate.

[0196] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0197] The embodiments described in the embodiments of this application are intended to more clearly illustrate the technical solutions of the embodiments of this application and do not constitute a limitation on the technical solutions provided by the embodiments of this application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.

[0198] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0199] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, i.e., they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.

[0200] Those skilled in the art will appreciate that all or some of the steps in the methods, systems, and functional modules / units in the devices disclosed above may be implemented as software, firmware, hardware, or appropriate combinations thereof.

[0201] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0202] It should be understood that in this application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0203] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0204] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0205] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0206] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store programs, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0207] The embodiments of the present application have been described in detail above with reference to the accompanying drawings. However, the present application is not limited to the above embodiments. Various modifications can be made within the scope of knowledge possessed by ordinary technicians in the relevant technical field without departing from the purpose of the present application. In addition, the embodiments of the present application and the features of the embodiments can be combined with each other unless there is a conflict.

Claims

1. A question generation method for dialogue training, characterized in that: The method comprises: Obtaining original user data; wherein the original user data includes user portrait information and conversation information, and the user portrait information includes interest tag information; Performing a first screening process on a preset question library according to the interest tag information to obtain preliminary question data; Performing matching processing on the preliminary question data through a preset question vector library to obtain a first feature vector that matches the preliminary question data; performing feature extraction processing on the user portrait information and performing feature extraction processing on the conversation information to obtain a second feature vector; Calculating the similarity between the first eigenvector and the second eigenvector to obtain similarity value data; The preliminary question data is subjected to a second screening process according to the similarity value data to obtain a target question, and a question speech is output according to the target question.

2. The method according to claim 1, characterized in that The question library includes a plurality of question information, and the first screening process is performed on the preset question library according to the interest tag information to obtain preliminary question data, including: Obtain keyword information according to the interest tag information; Searching the question database using the keyword information to obtain the question information that matches the keyword information; The question information matched with the keyword information is used as the preliminary question data.

3. The method according to claim 2, characterized in that Before performing matching processing on the preliminary question data using a preset question vector library to obtain a first feature vector matching the preliminary question data, the method includes: Performing a first unique-hot encoding on the plurality of question information to obtain a plurality of first word vector data; Inputting the plurality of first word vector data into the trained deep semantic matching model in sequence for feature extraction processing to obtain question feature vector data; The problem feature vector data is stored to obtain the problem vector library.

4. The method according to claim 1, wherein The performing feature extraction processing on the user portrait information and the performing feature extraction processing on the conversation information to obtain a second feature vector includes: Perform a second unique-hot encoding on the user portrait information to obtain portrait word vector data; Performing a third one-hot encoding on the conversation information to obtain conversation word vector data; splicing the portrait word vector data and the dialogue word vector data to obtain second word vector data; The second word vector data is input into the trained deep semantic matching model for feature extraction processing to obtain the second feature vector.

5. The method according to claim 1, wherein The calculating the similarity between the first feature vector and the second feature vector to obtain similarity value data includes: Calculating the cosine similarity between the first eigenvector and the second eigenvector to obtain cosine value data; The cosine value data is used as the similarity value data.

6. The method according to claim 5, characterized in that The performing a second screening process on the preliminary question data according to the similarity value data to obtain a target question includes: Filtering out the maximum similarity value from the similarity value data; The target question is obtained according to the maximum similarity value.

7. The method according to any one of claims 1 to 6, characterized in that Outputting the question speech according to the target question includes: Vectorize the target problem to obtain a third eigenvector; Inputting the third eigenvector into a trained speech synthesis model for speech synthesis processing to obtain the problem speech; Output the question voice to ask the question.

8. A question generation device for dialogue training, characterized in that: The device comprises: An acquisition module, the acquisition module is used to acquire original user data; wherein the original user data includes user portrait information and conversation information, and the user portrait information includes interest tag information; A first screening module, configured to perform a first screening process on a preset question library according to the interest tag information to obtain preliminary question data; a first vector acquisition module, configured to perform matching processing on the preliminary question data using a preset question vector library to obtain a first feature vector that matches the preliminary question data; a second vector acquisition module, configured to perform feature extraction processing on the user portrait information and the conversation information to obtain a second feature vector; a calculation module, configured to calculate a similarity between the first eigenvector and the second eigenvector to obtain similarity value data; The second screening module is used to perform a second screening process on the preliminary question data according to the similarity value data to obtain a target question, and output a question speech according to the target question.

9. An electronic device, characterized in that: include: at least one memory; at least one processor; at least one computer program; The computer program is stored in the memory, and the processor executes at least one computer program to implement: The method according to any one of claims 1 to 7.

10. A storage medium, wherein the storage medium is a computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to cause a computer to execute: The method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Chat response method, electronic device and storage medium

    CN108491433A

  • Customer service dialogue method based on artificial intelligence

    CN111797202A