Intelligent question answering system testing method, device, electronic device and storage medium

By collecting and classifying question texts and statement texts, eliminating texts that do not fit the application scenario, and using semantic relevance detection and multi-category label matching, we solve the problem of insufficient testing of intelligent question and answer systems and achieve more comprehensive and accurate testing. Effect.

CN114546882BActive Publication Date: 2024-08-27CHINA PING AN LIFE INSURANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210288200.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-23
Publication Date
2024-08-27
Estimated Expiration
2042-03-23

AI Technical Summary

Technical Problem

Existing testing methods for intelligent question answering systems cannot fully evaluate the testing effect of the system under different types of text, resulting in insufficient comprehensive and systematic testing.

Method used

By receiving test instructions, it collects question texts and statement texts, eliminates texts that do not meet the application scenario, performs semantic relevance detection, generates multi-category tags, matches the consultation text input by the user, and uses multi-category tags to conduct system testing.

Benefits of technology

It improves the testing comprehensiveness and accuracy of the intelligent question and answer system, saves testing resources, and ensures that the system's testing effect under different types of text is more comprehensive and systematic.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114546882B
    Figure CN114546882B
Patent Text Reader

Abstract

The present invention relates to artificial intelligence technology, and discloses a method, device, electronic device and storage medium for testing an intelligent question-answering system, wherein the method comprises: receiving a first question text set and a statement text set, removing question texts that do not conform to an application scenario from the first question text set to obtain a second question text set, extracting a specified number of question texts from the second question text set to obtain a third question text set, respectively generating multiple categories of labels corresponding to the third question text set and multiple categories of labels corresponding to the statement text set, receiving an advisory text, selecting a matching text corresponding to the advisory text from the third question text set or the statement text set according to the multiple categories of labels, testing the intelligent question-answering system using the matching text, obtaining an answer text corresponding to the matching text, and completing the test. The present invention can solve the problem of being unable to evaluate the test effect of the question-answering system under different types of texts.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to artificial intelligence technology, and in particular to a method, device, electronic device and computer-readable storage medium for testing an intelligent question-answering system. Background Art

[0002] With the development of artificial intelligence technology, the development of intelligent question-answering systems has been promoted. Currently, intelligent question-answering systems generally first receive text input by users, and use deep learning and machine learning models to match the answers corresponding to the text.

[0003] On the one hand, the intelligent question-answering system has greatly facilitated people's daily lives, but on the other hand, it is extremely important to test the intelligent question-answering system before it is available to users. Currently, the commonly used testing methods for intelligent question-answering systems mainly imitate the question test texts input by users to see whether the intelligent question-answering system can give corresponding outputs. It can be seen that during the test process, the test texts are all defaulted to question test texts, but in practice the intelligent question-answering system may receive declarative sentences input by users. Therefore, the test of the intelligent question-answering system is not comprehensive enough, which makes it impossible to evaluate the test effect of the question-answering system under different types of texts, and therefore it is impossible to achieve a more comprehensive and systematic test. Summary of the Invention

[0004] The present invention provides a method, device, electronic device and computer-readable storage medium for testing an intelligent question-answering system. Its main purpose is to solve the problem that it is impossible to evaluate the test effect of the question-answering system under different types of texts, resulting in the inability to achieve more comprehensive and systematic testing.

[0005] To achieve the above-mentioned object, the present invention provides a method for testing an intelligent question-answering system, comprising:

[0006] Receiving a test instruction of the intelligent question-answering system, collecting question texts and statement texts according to the test instruction, and obtaining a first question text set and a statement text set;

[0007] Eliminating question texts that do not conform to the application scenario of the intelligent question-answering system from the first question text set to obtain a second question text set;

[0008] Extracting a specified number of question texts from the second question text set to obtain multiple question text subsets, performing semantic relevance detection on each of the question text subsets, and selecting any question text with a semantic relevance higher than a specified threshold and aggregating them to obtain a third question text set;

[0009] Generating multiple categories of labels corresponding to the third question text set and multiple categories of labels corresponding to the statement text set;

[0010] Receiving a consultation text input by a user into the intelligent question-answering system, performing label prediction on the consultation text, and obtaining multiple sets of predicted labels;

[0011] Extracting a tag set whose similarity with the multiple groups of predicted tags is higher than a preset threshold from the multiple groups of multi-class tags, and selecting a matching text corresponding to the consultation text from the third question text set or the statement text set based on the tag set;

[0012] The intelligent question-answering system is tested using the matching text to obtain an answer text corresponding to the matching text, thereby completing the test.

[0013] Optionally, removing question texts that do not conform to the application scenario of the intelligent question-answering system from the first question text set to obtain a second question text set includes:

[0014] Receiving a scenario keyword set input by a user according to an application scenario of the intelligent question-answering system;

[0015] Calculating the number of keywords in the scene keyword set, and constructing cluster center sets with the same number as the number of keywords;

[0016] Performing a vectorization operation on the first question text set to obtain a first question vector set;

[0017] performing clustering on the first question vector set according to a clustering algorithm and the cluster center set to obtain multiple sets of cluster vector sets, and sending the multiple sets of cluster vector sets to a user;

[0018] A cluster vector set retained by a user from a plurality of cluster vector sets is received, and the retained cluster vector set is converted into text to obtain the second question text set.

[0019] Optionally, clustering the first question vector set according to the clustering algorithm and the cluster center set to obtain multiple groups of cluster vector sets, and sending the multiple groups of cluster vector sets to the user includes:

[0020] Projecting each first problem vector in the first problem vector set into a pre-constructed coordinate system to obtain a first problem coordinate set;

[0021] randomly generating, in the coordinate system, the same number of cluster center coordinates as the set of cluster centers;

[0022] Calculating the distance between each cluster center coordinate and each problem coordinate in the first problem coordinate set to obtain a distance value set;

[0023] According to the K-means clustering algorithm and the distance value set, the first problem coordinate set is divided into a plurality of cluster vector sets.

[0024] Optionally, extracting a specified number of question texts from the second question text set to obtain multiple question text subsets, performing semantic relevance detection on each of the question text subsets, and selecting any question text with a semantic relevance higher than a specified threshold and aggregating them to obtain a third question text set, including:

[0025] Performing a vectorization operation on the second question text set to obtain a text vector matrix;

[0026] Obtaining a preset dimensionality reduction matrix, and performing a product operation on the dimensionality reduction matrix and the text vector matrix to obtain the text low-dimensional matrix;

[0027] Performing convolution and pooling operations on the text low-dimensional matrix to obtain a text convolution matrix;

[0028] Extracting the specified number of convolution vectors from the text convolution matrix without duplication;

[0029] Calculating the similarity between a specified number of the convolution vectors and other row convolution vectors in the text convolution matrix;

[0030] Retain one of the convolution vectors whose similarity is higher than the preset threshold to obtain the eliminated matrix;

[0031] The eliminated matrix is ​​converted into the third question text set.

[0032] Optionally, generating multiple categories of labels corresponding to the third question text set and multiple categories of labels corresponding to the statement text set includes:

[0033] Receive the tag set and corresponding tag explanation text input by the user;

[0034] Extracting semantic features from the label interpretation text;

[0035] Calculating the distance between the third question text set and each tag in the tag set according to the semantic features;

[0036] The labels corresponding to the distance values ​​less than the preset threshold are used as the multi-class labels of each third question text.

[0037] Optionally, extracting semantic features from the tag interpretation text includes:

[0038] Convert each word in the label explanation text into a word vector to obtain a label vector set;

[0039] Generate a first matrix, a second matrix, and a third matrix respectively according to the three sets of pre-trained weight matrices and the label vector set;

[0040] Performing a dot product on the first matrix and the second matrix to obtain a fourth matrix; performing a cross product on the fourth matrix and the third matrix to obtain the semantic feature.

[0041] Optionally, collecting question texts and statement texts according to the test instruction to obtain a first question text set and a first statement text set includes:

[0042] Triggering a pre-built crawler program according to the test instructions;

[0043] Using the crawler program to crawl a pre-built text database or web page to obtain a text set to be classified;

[0044] The to-be-classified text set is split into the question text and the statement text according to punctuation marks and modal particles.

[0045] In order to solve the above problems, the present invention further provides a device for testing an intelligent question-answering system, the device comprising:

[0046] a text receiving module, configured to receive a test instruction of the intelligent question-answering system, collect question texts and statement texts according to the test instruction, and obtain a first question text set and a statement text set;

[0047] a text processing module configured to eliminate question texts that do not conform to the application scenario of the intelligent question-answering system from the first question text set to obtain a second question text set, extract a specified number of question texts from the second question text set to obtain multiple question text subsets, perform semantic relevance detection on each of the question text subsets, select any question text with a semantic relevance higher than a specified threshold and aggregate them to obtain a third question text set, and generate multiple class labels corresponding to the third question text set and multiple class labels corresponding to the statement text set;

[0048] A label prediction module is used to receive a consultation text input by a user into the intelligent question-answering system, and perform label prediction on the consultation text using multiple types of labels to obtain multiple sets of predicted labels;

[0049] a text matching module, configured to extract, from the multiple groups of multi-category labels, a set of labels whose similarity with the multiple groups of predicted labels is higher than a preset threshold, and select, based on the set of labels, a matching text corresponding to the consultation text from the third question text set or the statement text set;

[0050] The system testing module is used to test the intelligent question-answering system using the matching text, obtain the answer text corresponding to the matching text, and complete the test.

[0051] In order to solve the above problem, the present invention further provides an electronic device, comprising:

[0052] at least one processor; and,

[0053] a memory communicatively connected to the at least one processor; wherein,

[0054] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor to implement the above-mentioned intelligent question-answering system testing method.

[0055] In order to solve the above problems, the present invention also provides a computer-readable storage medium, in which at least one computer program is stored. The at least one computer program is executed by a processor in an electronic device to implement the above-mentioned intelligent question-answering system testing method.

[0056] In an embodiment of the present invention, text classification is first performed - the text is divided into question text and statement text, so as to facilitate subsequent testing of the test effect of the intelligent question-answering system under different types of texts; secondly, the question text that does not conform to the application scenario of the intelligent question-answering system is eliminated; then, semantic relevance detection is performed, and one of the question texts with a semantic relevance higher than a specified threshold is retained to save testing resources; finally, the consultation text input by the user is matched according to multiple categories of labels, and finally, through the similarity of multiple categories of labels, the intelligent question-answering system is used to calculate the answer text to complete the test. Compared with the testing method of the background technology: the test texts are all defaulted to question test texts, and there is a lack of a testing process in which the intelligent answering system may receive declarative statements. The embodiment of the present invention first classifies the test text, divides the text into question text and statement text, and then tests the intelligent answering system separately. The intelligent answering system is tested by different text types, thereby improving the comprehensiveness of the test of the intelligent question and answer system. In addition, multiple categories of labels are used to match the consultation text input by the user from the question text and statement text to obtain matching text, and the matching text with higher classification accuracy is used to test the intelligent question and answer model, and its test effect is further improved. At the same time, the same test text is eliminated, saving testing resources. Therefore, the intelligent question and answer system testing method, device, electronic device and computer-readable storage medium proposed in the present invention can solve the problem that it is impossible to evaluate the test effect of the question and answer system under different types of texts, resulting in an inability to achieve more comprehensive and systematic testing. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Figure 1 A flowchart of a method for testing an intelligent question-answering system according to an embodiment of the present invention;

[0058] Figure 2 This is a flow chart of step S2 in the intelligent question-answering system testing method provided by one embodiment of the present invention;

[0059] Figure 3 This is a flow chart of step S3 in the intelligent question-answering system testing method provided by one embodiment of the present invention;

[0060] Figure 4 This is a flow chart of step S4 in the intelligent question-answering system testing method provided by one embodiment of the present invention;

[0061] Figure 5 A schematic diagram of a module of an intelligent question-answering system testing device provided by one embodiment of the present invention;

[0062] Figure 6 A schematic diagram of the internal structure of an electronic device for implementing a method for testing an intelligent question-answering system according to an embodiment of the present invention;

[0063] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION

[0064] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0065] The embodiment of the present application provides a method for testing an intelligent question-answering system. The execution subject of the intelligent question-answering system testing method includes but is not limited to at least one of the electronic devices such as a server, a terminal, etc. that can be configured to execute the method provided by the embodiment of the present application. In other words, the intelligent question-answering system testing method can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc. The server can be an independent server or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and basic cloud computing services such as big data and artificial intelligence platforms.

[0066] Reference Figure 1 FIG. 1 is a flow chart of a method for testing an intelligent question-answering system according to an embodiment of the present invention. In an embodiment of the present invention, the method for testing an intelligent question-answering system includes:

[0067] S1. Receive a test instruction of the intelligent question-answering system, collect question texts and statement texts according to the test instruction, and obtain a first question text set and a statement text set.

[0068] Since most intelligent question - answering systems build intelligent answering strategies around the interrogative sentences input by users, and for the flat - narrative texts input by users, the system's response effect is often poor. Therefore, in the embodiments of the present invention, the texts are divided into question texts and statement texts for separate testing to generate a more accurate test evaluation for the intelligent question - answering system.

[0069] Further, the question text is also called an interrogative sentence text, and the statement text is also called a non - interrogative sentence text. For example, in an intelligent question - answering system applied in the insurance field, its question texts may include: "What is a disease insurance?", "Why don't I meet the requirements of this insurance?", etc., and its statement texts may include: "I'm quite healthy recently and don't want to buy any insurance", "My family members think the newly launched insurance activity is not very suitable for me", etc.

[0070] As an embodiment of the present invention, collecting the question texts and statement texts according to the test instruction to obtain a first question text set and a statement text set includes:

[0071] Triggering a pre - built crawler program according to the test instruction; <00,00155>Using the crawler program to crawl a text set to be classified from a pre - built text database or web page;

[0073] According to punctuation marks and modal particles, splitting the text set to be classified into the question text and the statement text.

[0074] Among them, the crawler program can be built by, but not limited to, using the Python language.

[0075] It should be understood that interrogative sentences generally end with "?", while declarative sentences generally end with punctuation marks such as ". " or "! ". Therefore, through the punctuation marks corresponding to each sentence, the classification of question texts and statement texts can be achieved.

[0076] In addition, when some modal particles exist in a sentence, generally this sentence must be a statement text or a question text. For example, when "ma, ma" etc. are used as the ending words of a sentence, this sentence can be classified as a question text; when "certainly, definitely" exist in a sentence, this sentence can be classified as a statement text.

[0077] S2. Removing the question texts that do not meet the application scenario of the intelligent question - answering system from the first question text set to obtain a second question text set.

[0078] It should be understood that the application scenarios of different intelligent question - answering systems are different. For example, for the intelligent question - answering system applied in the insurance field as mentioned above, the scope of application of its intelligent answers is generally limited to the insurance field only. Therefore, as shown in Figure 2 shown, S2 includes:

[0079] S21. Receive a scenario keyword set input by a user based on an application scenario of the intelligent question-answering system;

[0080] For example, a user may enter scenario keywords such as "insurance," "car insurance," "safety," and "danger" in sequence according to an intelligent question-answering system used in the insurance field.

[0081] S22, calculating the number of keywords in the scene keyword set, and constructing cluster center sets with the same number as the number of keywords;

[0082] For example, if a user enters 15 scenario keywords related to the insurance field, 15 cluster centers will be constructed. Cluster centers, also known as cluster centers in clustering algorithms, represent the clustering of multiple data sets. For example, 15 cluster centers means that the first question text set is clustered into 15 clusters, each representing a data category.

[0083] S23, performing a vectorization operation on the first question text set to obtain a first question vector set;

[0084] As an embodiment of the present invention, the vectorization operation may be performed using the Word2Vec algorithm.

[0085] In another embodiment of the present invention, the vectorization operation can also be performed using an artificial intelligence model, which can be a BERT model.

[0086] S24. Clustering the first question vector set according to the clustering algorithm and the cluster center set to obtain multiple sets of cluster vector sets, and sending the multiple sets of cluster vector sets to the user;

[0087] In one embodiment of the present invention, S24 includes: projecting each first problem vector in the first problem vector set into a pre-constructed coordinate system to obtain a first problem coordinate set; randomly generating the same number of cluster center coordinates as the cluster center set in the coordinate system; calculating the distance between each cluster center coordinate and each problem coordinate in the first problem coordinate set to obtain a distance value set; and dividing the first problem coordinate set into multiple groups of cluster vector sets according to the K-means clustering algorithm and the distance value set.

[0088] For example, the present invention may use, but is not limited to, a Euclidean distance calculation method or a Chebyshev distance calculation method to calculate the distance value set. Furthermore, a K-means clustering algorithm may continuously adjust the coordinates of each cluster center based on the distance value set, thereby completing clustering and obtaining multiple cluster vector sets.

[0089] Furthermore, multiple groups of cluster vector sets are sent to the user, allowing the user to further select which groups of cluster vectors to retain, thereby eliminating question texts that do not conform to the application scenario of the intelligent question answering system.

[0090] S25. Receive a cluster vector set retained by the user from the multiple cluster vector sets, convert the retained cluster vector set into text, and obtain the second question text set.

[0091] For example, if 15 cluster vector sets are obtained through the K-means clustering algorithm, and the user retains 13 cluster vector sets, the 13 cluster vector sets are converted into the original corresponding question texts, thereby obtaining the second question text set.

[0092] S3. Extract a specified number of question texts from the second question text set to obtain multiple question text subsets, perform semantic relevance detection on each of the question text subsets, and select any question text with a semantic relevance higher than a specified threshold and summarize them to obtain a third question text set.

[0093] It should be understood that there may be multiple semantically similar question texts in the second question text set. In order to save resources, semantically similar question texts should be eliminated. For example, in one embodiment of the present invention, the specified number can be set to 2, that is, two question texts are extracted from the second question text set in sequence without repetition, and the semantic relevance between the two question texts is calculated. When the semantic relevance is higher than the specified threshold, one of the question texts is randomly eliminated, and all the retained question texts are summarized to obtain the third question text set.

[0094] In detail, in one embodiment of the present invention, refer to Figure 3 As shown, the S3 includes:

[0095] S31, performing a vectorization operation on the second question text set to obtain a text vector matrix;

[0096] In one embodiment of the present invention, the vectorization operation can be performed using the Word2Vec algorithm or the Bert algorithm.

[0097] For example, the following text vector matrix A is obtained by using the Bert algorithm:

[0098]

[0099] Among them, the matrix dimension of the text vector matrix A is m*n, where m represents the row dimension and n represents the column dimension.

[0100] S32: Obtain a preset dimensionality reduction matrix, and perform a product operation on the dimensionality reduction matrix and the text vector matrix to obtain the text low-dimensional matrix;

[0101] Since the text vector matrix may have too high a dimension, which may cause an explosion in subsequent calculations, a dimensionality reduction matrix needs to be used to perform a dimensionality reduction operation on the text vector matrix.

[0102] Taking the above-mentioned text vector matrix A as an example, its matrix dimension is m*n. Therefore, the embodiment of the present invention constructs a dimensionality reduction matrix of n*s, where s is much smaller than n. According to the matrix product operation, m*n and n*s are multiplied to obtain m*s, that is, the matrix dimension of the text low-dimensional matrix is ​​m*s. It should be understood that since s is much smaller than n, the dimension of the text low-dimensional matrix is ​​much smaller than the text vector matrix.

[0103] S33, performing convolution and pooling operations on the text low-dimensional matrix to obtain a text convolution matrix;

[0104] In an embodiment of the present invention, a pre-built convolutional neural network is used to perform convolution and pooling operations on the text low-dimensional matrix.

[0105] S34, extracting the specified number of convolution vectors from the text convolution matrix without duplication;

[0106] S35. Calculate the similarity between a specified number of convolution vectors and other row convolution vectors in the text convolution matrix. For example, the m*s text convolution matrix B obtained by the S33 operation is as follows:

[0107]

[0108] Calculate the similarity between (1 2 9 0) and other convolution vectors respectively. If the similarity between the convolution vector (1 2 9 0) and the convolution vector (1 2 8 0) is too high, then (1 2 8 0) will be eliminated accordingly.

[0109] S36, retaining one of the convolution vectors whose similarity is higher than a preset threshold to obtain a eliminated matrix;

[0110] In one embodiment of the present invention, if the similarity between convolution vectors A, B and C is higher than the preset threshold, the convolution vector A is retained and the convolution vectors B and C are eliminated, that is, the convolution vector A is the eliminated matrix.

[0111] S37: Convert the eliminated matrix into the third question text set.

[0112] In another embodiment of the present invention, S3 can also be replaced by: performing semantic relevance detection on the question texts in the second question text set, clustering the question texts in the second question text set according to the semantic relevance to obtain question text subsets, and randomly selecting a question text from each of the question text subsets, and the selected question texts forming a third question text set.

[0113] It should be explained that the semantic relevance detection can use a pre-trained Bert model. When the Bert model is used to perform semantic relevance detection, the semantic relevance of each question text with other question texts is obtained, and then each question text is clustered in a similar interval according to the semantic relevance, thereby obtaining different groups of question text subsets, and further, a question text is randomly selected from each question text subset, and summarized to obtain the third question text set.

[0114] S4. Generate multiple categories of labels corresponding to the third question text set and multiple categories of labels corresponding to the statement text set.

[0115] For details, see Figure 4 As shown, the generating of multiple categories of labels corresponding to the third question text set and multiple categories of labels corresponding to the statement text set includes:

[0116] S41, receiving a tag set and corresponding tag explanation text input by a user;

[0117] For example, the tags input by the user include: "car insurance", "personal insurance", "accident insurance", "car", "education", etc., and a detailed tag explanation text is given for each tag.

[0118] S42, extracting semantic features from the label interpretation text;

[0119] In one embodiment of the present invention, S42 includes: converting each character in the label explanation text into a word vector to obtain a label vector set; generating a first matrix, a second matrix and a third matrix respectively according to the three sets of pre-trained weight matrices and the label vector set; performing a dot product on the first matrix and the second matrix to obtain a fourth matrix; performing a cross product on the fourth matrix and the third matrix to obtain the semantic feature.

[0120] In the embodiment of the present invention, the label explanation text is converted into the label vector set using the Word2Vec algorithm.

[0121] It is also important to note that the three groups of weight matrices are extracted from the pre-trained Bert model. During the training process of the Bert model, the internal values ​​of the three groups of weight matrices are mainly trained. In an embodiment of the present invention, the three groups of weight matrices are directly extracted from the pre-trained Bert model, saving the time for extracting semantic features.

[0122] S43, calculating the distance value between the third question text set and each tag in the tag set according to the semantic feature;

[0123] In the embodiment of the present invention, the distance value between each tag is calculated using, but not limited to, a Euclidean distance calculation method and a Chebyshev distance calculation method.

[0124] S44. Use the labels corresponding to the distance values ​​less than the preset threshold as the multi-category labels for each third question text.

[0125] For example, the distances calculated between the third question text C included in the third question text set and the explanatory texts such as "auto insurance", "personal insurance", "accident insurance", "automobile", and "education" are 1.23, 4.32, 4.12, 5.78, and 0.67 respectively, and the preset threshold is 2.00, then the multi-category labels of the third question text C include "auto insurance" and "education".

[0126] S5. Receive consultation text input by the user into the intelligent question-answering system, and perform label prediction on the consultation text using multiple categories of labels to obtain multiple groups of predicted labels.

[0127] It should be emphasized that, in general, the consultation text input by the user may be a question text or a statement text. Therefore, the multi-class label performs label prediction on the consultation text to obtain multiple groups of predicted labels, including: judging whether the consultation text belongs to the question text type or the statement text type; if the consultation text belongs to the question text type, the multi-class label corresponding to the third question text set is used as the true label set; if the consultation text belongs to the statement text type, the multi-class label corresponding to the statement text set is used as the true label set; extracting labels that match the consultation text from the true label set to obtain multiple groups of predicted labels.

[0128] For example, if the user inputs "Are there any car-related insurance activities recently?", it is judged that it is a question text, so all labels corresponding to the third question text set are extracted to obtain the real label set, and then the label prediction model, such as the neural network prediction model and the support vector machine model, is used to predict the corresponding prediction label.

[0129] S6. Extract a tag set whose similarity with the multiple groups of predicted tags is higher than a preset threshold from the multiple groups of multi-category tags, and select a matching text corresponding to the consultation text from the third question text set or the statement text set based on the tag set.

[0130] In an embodiment of the present invention, since there are a large number of labels for different texts, similar texts can be found through label matching. For example, each statement text in the statement text set may include more than ten labels. When the consultation text input by the user is a statement-type text, the statement text with the same predicted label as the consultation text is searched from the statement text set, which is the matching text.

[0131] S7. Use the matching text to test the intelligent question-answering system, obtain an answer text corresponding to the matching text, and complete the test.

[0132] For example, after the intelligent question-answering system obtains the matching text, the intelligent question-answering system can output the answer text corresponding to the matching text, wherein semantic analysis can be performed using models such as Bert model, convolutional neural network model, LSTM, etc., and the answer text corresponding to the matching text is output, thereby completing the test of the intelligent question-answering system.

[0133] In an embodiment of the present invention, text classification is first performed - the text is divided into question text and statement text, so as to facilitate subsequent testing of the test effect of the intelligent question-answering system under different types of texts; secondly, the question text that does not conform to the application scenario of the intelligent question-answering system is eliminated; then, semantic relevance detection is performed, and one of the question texts with a semantic relevance higher than a specified threshold is retained to save testing resources; finally, the consultation text input by the user is matched according to multiple categories of labels, and finally, through the similarity of multiple categories of labels, the intelligent question-answering system is used to calculate the answer text to complete the test. Compared with the testing method of the background technology: the test texts are all defaulted to question test texts, and there is a lack of a testing process in which the intelligent answering system may receive declarative statements. The embodiment of the present invention first classifies the test text, divides the text into question text and statement text, and then tests the intelligent answering system separately. The intelligent answering system is tested by different text types, thereby improving the comprehensiveness of the test of the intelligent question and answer system. In addition, multiple categories of labels are used to match the consultation text input by the user from the question text and statement text to obtain matching text, and the matching text with higher classification accuracy is used to test the intelligent question and answer model, and its test effect is further improved. At the same time, the same test text is eliminated, saving testing resources. Therefore, the intelligent question and answer system testing method, device, electronic device and computer-readable storage medium proposed in the present invention can solve the problem that it is impossible to evaluate the test effect of the question and answer system under different types of texts, resulting in an inability to achieve more comprehensive and systematic testing.

[0134] like Figure 5 , which is a functional module diagram of the intelligent question-answering system testing device of the present invention.

[0135] The intelligent question-answering system testing device 100 described in the present invention can be installed in an electronic device. Depending on the functionality implemented, the intelligent question-answering system testing device may include a text receiving module 101, a text processing module 102, a tag prediction module 103, a text matching module 104, and a system testing module 105. A module, also referred to as a unit, is a series of computer program segments that can be executed by a processor of an electronic device and perform a fixed function, and is stored in the memory of the electronic device.

[0136] In this embodiment, the functions of each module / unit are as follows:

[0137] The text receiving module 101 is configured to receive a test instruction of the intelligent question-answering system, collect question texts and statement texts according to the test instruction, and obtain a first question text set and a statement text set;

[0138] The text processing module 102 is configured to eliminate question texts that do not conform to the application scenario of the intelligent question-answering system from the first question text set to obtain a second question text set, extract a specified number of question texts from the second question text set to obtain multiple question text subsets, perform semantic relevance detection on each of the question text subsets, select any question text with a semantic relevance higher than a specified threshold and aggregate them to obtain a third question text set, and generate multiple class labels corresponding to the third question text set and multiple class labels corresponding to the statement text set;

[0139] The label prediction module 103 is used to receive the consultation text input by the user into the intelligent question-answering system, and perform label prediction on the consultation text using multiple types of labels to obtain multiple groups of predicted labels;

[0140] The text matching module 104 is configured to extract a tag set having a similarity with the multiple sets of predicted tags higher than a preset threshold from the multiple sets of multi-class tags, and select a matching text corresponding to the consultation text from the third question text set or the statement text set based on the tag set;

[0141] The system testing module 105 is used to test the intelligent question-answering system using the matching text, obtain the answer text corresponding to the matching text, and complete the test.

[0142] In detail, the modules in the intelligent question answering system testing device 100 according to the embodiment of the present invention are used in the same manner as above. Figure 1The same technical means are used as the intelligent question answering system testing method described in , and can produce the same technical effects, so I will not go into details here.

[0143] like Figure 6 , which is a structural diagram of an electronic device 1 for implementing the intelligent question-answering system testing method according to the present invention.

[0144] The electronic device 1 may include a processor 10, a memory 11, a communication bus 12, and a communication interface 13. It may also include a computer program stored in the memory 11 and executable on the processor 10, such as an intelligent question-answering system test program.

[0145] In some embodiments, the processor 10 may be composed of an integrated circuit, such as a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and a combination of various control chips. The processor 10 is the control core (Control Unit) of the electronic device 1, and utilizes various interfaces and lines to connect the various components of the entire electronic device 1. It executes or runs programs or modules stored in the memory 11 (such as executing an intelligent question-answering system test program) and calls data stored in the memory 11 to execute various functions of the electronic device 1 and process data.

[0146] The memory 11 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (for example, an SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. In some embodiments, the memory 11 can be an internal storage unit of the electronic device 1, such as a mobile hard disk of the electronic device 1. In other embodiments, the memory 11 can also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 1. Furthermore, the memory 11 can also include both an internal storage unit of the electronic device 1 and an external storage device. The memory 11 can not only be used to store application software and various types of data installed on the electronic device 1, such as the code of the intelligent question-answering system test program, etc., but can also be used to temporarily store data that has been output or is to be output.

[0147] The communication bus 12 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to enable communication between the memory 11 and at least one processor 10, etc.

[0148] The communication interface 13 is used for communication between the above-mentioned electronic device 1 and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device 1 and other electronic devices 1. The user interface may be a display (Display), an input unit (such as a keyboard (Keyboard)), optionally, the user interface may also be a standard wired interface, a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc. Among them, the display may also be appropriately referred to as a display screen or a display unit, for displaying information processed in the electronic device 1 and for displaying a visual user interface.

[0149] Figure 6 Only the electronic device 1 having components is shown, and it can be understood by those skilled in the art that Figure 6 The structure shown does not constitute a limitation on the electronic device 1 , and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0150] For example, although not shown, the electronic device 1 may further include a power source (such as a battery) for powering the various components. Preferably, the power source may be logically connected to the at least one processor 10 via a power management device, thereby implementing functions such as charging management, discharging management, and power consumption management through the power management device. The power source may further include any components such as one or more DC or AC power sources, a recharging device, a power failure detection circuit, a power converter or inverter, a power status indicator, etc. The electronic device 1 may further include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be described in detail here.

[0151] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.

[0152] The intelligent question-answering system test program stored in the memory 11 of the electronic device 1 is a combination of multiple computer programs. When running in the processor 10, it can achieve the following:

[0153] Receiving a test instruction of the intelligent question-answering system, collecting question texts and statement texts according to the test instruction, and obtaining a first question text set and a statement text set;

[0154] Eliminating question texts that do not conform to the application scenario of the intelligent question answering system from the first question text set to obtain a second question text set;

[0155] Extracting a specified number of question texts from the second question text set to obtain multiple question text subsets, performing semantic relevance detection on each of the question text subsets, and selecting any question text with a semantic relevance higher than a specified threshold and aggregating them to obtain a third question text set;

[0156] Generate multiple class labels corresponding to the third question text set and multiple class labels corresponding to the statement text set;

[0157] Receiving a consultation text input by a user into the intelligent question-answering system, performing label prediction on the consultation text using multiple types of labels to obtain multiple groups of predicted labels;

[0158] Extracting a tag set whose similarity with the multiple groups of predicted tags is higher than a preset threshold from the multiple groups of multi-class tags, and selecting a matching text corresponding to the consultation text from the third question text set or the statement text set based on the tag set;

[0159] The intelligent question-answering system is tested using the matching text to obtain an answer text corresponding to the matching text, thereby completing the test.

[0160] Specifically, the specific implementation method of the processor 10 for the above computer program can refer to Figure 1 The description of the relevant steps in the corresponding embodiments will not be repeated here.

[0161] Furthermore, if the modules / units integrated into the electronic device 1 are implemented as software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard drive, a magnetic disk, an optical disk, a computer memory, or a read-only memory (ROM).

[0162] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program. When the computer program is executed by the processor of the electronic device 1, the computer program can achieve:

[0163] Receiving a test instruction of the intelligent question-answering system, collecting question texts and statement texts according to the test instruction, and obtaining a first question text set and a statement text set;

[0164] Eliminating question texts that do not conform to the application scenario of the intelligent question-answering system from the first question text set to obtain a second question text set;

[0165] Extracting a specified number of question texts from the second question text set to obtain multiple question text subsets, performing semantic relevance detection on each of the question text subsets, and selecting any question text with a semantic relevance higher than a specified threshold and aggregating them to obtain a third question text set;

[0166] Generating multiple categories of labels corresponding to the third question text set and multiple categories of labels corresponding to the statement text set;

[0167] Receiving a consultation text input by a user into the intelligent question-answering system, performing label prediction on the consultation text using multiple types of labels to obtain multiple groups of predicted labels;

[0168] Extracting a tag set whose similarity with the multiple groups of predicted tags is higher than a preset threshold from the multiple groups of multi-class tags, and selecting a matching text corresponding to the consultation text from the third question text set or the statement text set based on the tag set;

[0169] The intelligent question-answering system is tested using the matching text to obtain an answer text corresponding to the matching text, thereby completing the test.

[0170] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the module division is merely a logical function division, and other division methods may be used in actual implementation.

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

[0172] In addition, the functional modules in various embodiments of the present invention may be integrated into a single processing unit, 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 hardware plus software functional modules.

[0173] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0174] Therefore, the embodiments should be considered in all respects as illustrative and non-restrictive, and the scope of the invention is defined by the appended claims rather than the foregoing description, and all changes that come within the meaning and range of equivalents of the claims are intended to be embraced therein. Any reference to a figure in a claim should not be construed as limiting the claim to which it relates.

[0175] Blockchain, as used in this article, refers to a novel application model for computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Blockchain is essentially a decentralized database, a series of data blocks generated using cryptographic methods. Each block contains information about a batch of online transactions, used to verify the validity of this information (to prevent counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, the platform product service layer, and the application service layer.

[0176] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is 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 achieve optimal results.

[0177] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in a system claim may also be implemented by a single unit or device through software or hardware. Second-order terms are used to indicate names and do not imply any particular order.

[0178] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not limiting. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. A method for testing an intelligent question-answering system, characterized in that: The method comprises: Receiving a test instruction of the intelligent question-answering system, collecting question texts and statement texts according to the test instruction, and obtaining a first question text set and a statement text set; Eliminate question texts that do not conform to the application scenario of the intelligent question answering system from the first question text set to obtain a second question text set; Extracting a specified number of question texts from the second question text set to obtain a plurality of question text subsets, performing semantic relevance detection on each of the question text subsets, and selecting any question text with a semantic relevance higher than a specified threshold and summarizing them to obtain a third question text set; Generate multiple categories of labels corresponding to the third question text set and multiple categories of labels corresponding to the statement text set; Receiving a consultation text input by a user into the intelligent question-answering system, performing label prediction on the consultation text, and obtaining multiple groups of predicted labels; Extracting a tag set whose similarity with the multiple groups of predicted tags is higher than a preset threshold from the multiple groups of the multiple categories of tags, and selecting a matching text corresponding to the consultation text from the third question text set or the statement text set according to the tag set; Using the matching text to test the intelligent question-answering system, obtaining an answer text corresponding to the matching text, and completing the test; Among them, the step of removing question texts that do not conform to the application scenario of the intelligent question-answering system from the first question text set to obtain the second question text set includes: receiving a scenario keyword set input by a user according to the application scenario of the intelligent question-answering system; calculating the number of keywords in the scenario keyword set, and constructing a cluster center set with the same number as the number of keywords; performing a vectorization operation on the first question text set to obtain a first question vector set; performing clustering on the first question vector set according to a clustering algorithm and the cluster center set to obtain multiple groups of cluster vector sets, and sending the multiple groups of cluster vector sets to the user; receiving a cluster vector set retained by the user from the multiple groups of cluster vector sets, converting the retained cluster vector set into text, and obtaining the second question text set; The method of generating multiple categories of labels corresponding to the third question text set includes: receiving a label set input by a user and a corresponding label explanation text; extracting semantic features from the label explanation text; calculating the distance value between the third question text set and each label in the label set according to the semantic features; and using the label corresponding to the distance value less than a preset threshold as the multiple category label of each third question text.

2. The intelligent question-answering system testing method according to claim 1, characterized in that: The step of clustering the first problem vector set according to the clustering algorithm and the cluster center set to obtain multiple sets of cluster vector sets, and sending the multiple sets of cluster vector sets to the user includes: Projecting each first problem vector in the first problem vector set into a pre-constructed coordinate system to obtain a first problem coordinate set; Randomly generate the same number of cluster center coordinates as the cluster center set in the coordinate system; Calculate the distance between each cluster center coordinate and each problem coordinate of the first problem coordinate set to obtain a distance value set; According to the K-means clustering algorithm and the distance value set, the first problem coordinate set is divided into a plurality of groups of cluster vector sets.

3. The intelligent question answering system testing method according to claim 1, characterized in that: The step of extracting a specified number of question texts from the second question text set to obtain a plurality of question text subsets, performing semantic relevance detection on each of the question text subsets, and selecting any question text with a semantic relevance higher than a specified threshold and aggregating them to obtain a third question text set includes: Performing a vectorization operation on the second question text set to obtain a text vector matrix; Obtain a preset dimensionality reduction matrix, and perform a product operation on the dimensionality reduction matrix and the text vector matrix to obtain a text low-dimensional matrix; Performing convolution and pooling operations on the text low-dimensional matrix to obtain a text convolution matrix; Extracting the specified number of convolution vectors from the text convolution matrix without duplication; Calculate the similarity between a specified number of the convolution vectors and other row convolution vectors in the text convolution matrix; Keep one of the convolution vectors whose similarity is higher than the preset threshold to obtain the eliminated matrix; The eliminated matrix is ​​converted into the third question text set.

4. The intelligent question answering system testing method as claimed in claim 1, characterized in that: The step of extracting semantic features from the label interpretation text includes: Convert each word in the label explanation text into a word vector to obtain a label vector set; Generate a first matrix, a second matrix and a third matrix respectively according to the three sets of pre-trained weight matrices and the label vector set; Performing a dot product on the first matrix and the second matrix to obtain a fourth matrix; performing a cross product on the fourth matrix and the third matrix to obtain the semantic feature.

5. The intelligent question answering system testing method according to claim 1, characterized in that: The step of collecting question texts and statement texts according to the test instruction to obtain a first question text set and a statement text set includes: Triggering a pre-built crawler program according to the test instruction; Using the crawler program to crawl from a pre-built text database or web page to obtain a text set to be classified; According to punctuation marks and modal particles, the text set to be classified is split into the question text and the statement text.

6. An intelligent question answering system testing device, used to implement the intelligent question answering system testing method according to any one of claims 1 to 5, characterized in that: The device comprises: A text receiving module, used to receive a test instruction of the intelligent question-answering system, collect question texts and statement texts according to the test instruction, and obtain a first question text set and a statement text set; A text processing module is used to remove question texts that do not conform to the application scenario of the intelligent question answering system from the first question text set to obtain a second question text set, extract a specified number of question texts from the second question text set to obtain multiple question text subsets, perform semantic relevance detection on each of the question text subsets, select any question text with a semantic relevance higher than a specified threshold and summarize them to obtain a third question text set, and generate multiple categories of labels corresponding to the third question text set and multiple categories of labels corresponding to the statement text set; A label prediction module, used to receive a consultation text input by a user into the intelligent question-answering system, and perform label prediction on the consultation text using multiple types of labels to obtain multiple groups of predicted labels; A text matching module, used to extract a tag set whose similarity with the multiple groups of predicted tags is higher than a preset threshold from the multiple groups of the multiple categories of tags, and select a matching text corresponding to the consultation text from the third question text set or the statement text set according to the tag set; The system testing module is used to test the intelligent question-answering system using the matching text, obtain the answer text corresponding to the matching text, and complete the test.

7. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the intelligent question and answer system testing method as described in any one of claims 1 to 5.

8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the intelligent question-answering system testing method as described in any one of claims 1 to 5 is implemented.