Knowledge testing method, device and equipment based on question and answer robot and medium
By constructing a target topic knowledge graph and a dual-channel adversarial generative network, test cases for the intelligent question-answering robot are automatically generated, solving the problems of low efficiency and insufficient coverage of traditional manual test case generation, and achieving efficient and accurate knowledge testing.
Patent Information
- Application Number
- CN202510795670.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-13
- Publication Date
- 2025-09-26
AI Technical Summary
The test case generation of existing intelligent question-answering robots relies on manual writing, which makes it difficult to fully cover the complex and diverse knowledge scenarios in different fields, resulting in insufficient depth of testing, low efficiency and prone to errors.
By acquiring target knowledge data, we build a target topic knowledge graph, use a dual-channel generative adversarial network to generate test cases, and conduct target knowledge tests through a question-answering robot, combined with a pre-built evaluation model for evaluation and feedback.
It realizes the automatic generation of test cases, improves coverage and efficiency, reduces manual dependence, and ensures the accuracy and comprehensiveness of test results.
Smart Images

Figure CN120705042A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology and can be applied to the fields of financial technology and medical health, and in particular to a knowledge testing method, device, equipment and medium based on a question-answering robot. Background Art
[0002] Currently, test case generation for intelligent question-answering robots often relies on manual coding, making it difficult to fully cover the complex and diverse knowledge and problem scenarios across different fields. In the field of financial technology, intelligent question-answering robots can be used to answer questions about financial technology, providing financial-related answers. They can also be used to apply medical and elderly care knowledge to the healthcare field, for example, by answering questions about medical and elderly care, enabling patients to gain relevant knowledge about the field.
[0003] Traditional methods lack the technology to intelligently analyze and generate test cases, and are unable to generate test cases tailored to the characteristics of the knowledge being tested and the robot's capabilities. For example, for questions involving historical, religious, and philosophical debates, it's impossible to automatically generate multi-faceted, in-depth test cases. This results in insufficient depth and difficulty uncovering potential issues with the robot's complex knowledge processing. The testing process is largely manual, inefficient, and prone to errors. Large-scale testing of intelligent question-answering robots is time-consuming and laborious, and due to human factors, can lead to inconsistent operations and inaccurate data recording, compromising the reliability of test results. Summary of the Invention
[0004] The purpose of the embodiments of the present application is to propose a knowledge testing method, device, equipment and medium based on a question-answering robot to improve the coverage and testing efficiency of target knowledge test cases and reduce the reliance on manually written test cases.
[0005] In order to solve the above technical problems, the present application provides a knowledge testing method based on a question-answering robot, comprising:
[0006] Acquire target knowledge data, and construct a target subject knowledge graph based on the target knowledge data;
[0007] Constructing test cases based on the target subject knowledge graph through a dual-channel generative adversarial network;
[0008] Conducting a target knowledge test based on the test case by a question-answering robot to obtain a test result;
[0009] Calculating evaluation indicators based on the test results using a pre-built evaluation model to generate target evaluation results;
[0010] The test results are error-classified based on the target evaluation results, and problem location and problem feedback are performed based on the error classification results.
[0011] In order to solve the above technical problems, the present invention provides a knowledge testing device based on a question-answering robot, comprising:
[0012] An initial data acquisition module is used to acquire initial text-audio pairs and pre-process the initial text-audio pairs to generate a training data set and a verification data set;
[0013] A model training module, configured to optimize the autoregressive generative model based on the training data set using a maximum likelihood estimation method, so as to perform model training on the autoregressive generative model and generate a target speech synthesis model;
[0014] A tag sequence generation module is used to obtain a text to be synthesized and generate a tag sequence based on the text to be synthesized in an autoregressive manner using the target speech synthesis model;
[0015] The speech information generation module is configured to generate target speech information by decoding the tag sequence.
[0016] In order to solve the above technical problems, a technical solution adopted by the present invention is: to provide a computer device, including one or more processors; a memory for storing one or more programs, so that the one or more processors can implement any one of the above-mentioned knowledge testing methods based on the question-answering robot.
[0017] In order to solve the above technical problems, a technical solution adopted by the present invention is: a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements any one of the above-mentioned knowledge testing methods based on the question-answering robot.
[0018] The embodiment of the present invention provides a knowledge testing method, device, equipment and medium based on a question-answering robot. The method includes: obtaining target knowledge data, and constructing a target subject knowledge graph based on the target knowledge data; constructing a test case based on the target subject knowledge graph through a dual-channel adversarial generative network; performing a target knowledge test based on the test case through a question-answering robot to obtain a test result; calculating an evaluation index based on the test result through a pre-built evaluation model to generate a target evaluation result; performing error classification on the test result based on the target evaluation result, and locating and giving feedback on the problem based on the error classification result. The embodiment of the present invention automatically generates test cases by constructing a target subject knowledge graph, and realizes the automation of the test process by combining an adversarial generative network and an intelligent evaluation model, thereby solving the problems of low efficiency and insufficient coverage of traditional manual test case generation. It has the advantages of improving the coverage and test efficiency of test cases, reducing manual dependence, and realizing automated testing of target knowledge. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the solutions in this application, a brief introduction will be given below to the drawings required for use in the description of the embodiments of this application. Obviously, the drawings described below are some embodiments of this application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0020] Figure 1 This is a schematic diagram of an application environment of a knowledge testing method based on a question-answering robot in one embodiment of the present invention;
[0021] Figure 2 This is a flowchart of the implementation process of the knowledge testing method based on the question-answering robot provided in an embodiment of the present application;
[0022] Figure 3 yes Figure 2 A schematic flow chart of a specific implementation of step S1;
[0023] Figure 4 yes Figure 2 A schematic flow chart of a specific implementation of step S2;
[0024] Figure 5 yes Figure 2 A schematic flow chart of a specific implementation of step S3;
[0025] Figure 6 yes Figure 2 A schematic flow chart of a specific implementation of step S4;
[0026] Figure 7 yes Figure 2 A schematic flow chart of a specific implementation of step S5;
[0027] Figure 8 This is a schematic diagram of a knowledge testing device based on a question-answering robot provided in an embodiment of the present application;
[0028] Figure 9 It is a schematic diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] Unless otherwise defined, all technical and scientific terms used herein have the same meanings as commonly understood by those skilled in the art to which this application belongs. The terms used in the specification of the application are for the purpose of describing specific embodiments only and are not intended to limit this application. The terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of this application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.
[0030] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0031] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.
[0032] The present invention will be described in detail below with reference to the accompanying drawings and embodiments.
[0033] It should be noted that the knowledge testing method based on the question-answering robot provided in the embodiment of the present application is generally executed by a server. Accordingly, the knowledge testing device based on the question-answering robot is generally configured in the server.
[0034] The knowledge testing method based on the question-answering robot provided by the embodiment of the present invention can be applied in Figure 1In an application environment, the client communicates with the server through a network. The server can receive the question and answer request or question and answer content from the client; construct a target subject knowledge graph to generate test cases, and generate test results based on the test cases. The server in the present invention can send the test results or the question and answer content of the question and answer robot to the client. Among them, the client can be but is not limited to various personal computers, laptops, smart phones, tablets and portable wearable devices. The server can be implemented with an independent server or a server cluster composed of multiple servers. The present invention is described in detail below through specific embodiments.
[0035] See also Figure 2 , Figure 2 A specific implementation of a knowledge testing method based on a question-answering robot is shown.
[0036] It should be noted that the method of the present invention is not limited to the method of Figure 2 The process sequence shown is limited to the following steps:
[0037] S1: Acquire target knowledge data, and construct a target subject knowledge graph based on the target knowledge data.
[0038] Specifically, target knowledge data is collected and, using natural language processing techniques and knowledge graph construction algorithms, a comprehensive target topic knowledge graph is constructed. The target knowledge data can be knowledge data from fields such as fintech, healthcare and elderly care, humanities and social sciences, history and religion, and the target topic is the subject information of the application scenario corresponding to the target knowledge. For example, in a transaction scenario in the fintech field, the target topic is transaction, and the target knowledge data can be multi-source data from the transaction scenario, including product names, pricing and circulation information, payment methods, payment locations, transaction personnel and companies, and transaction times. Therefore, a transaction topic knowledge graph can be constructed based on the transaction knowledge data. Alternatively, in a pension insurance scenario in the healthcare and elderly care field, the target topic is pension insurance, and the target knowledge data can include information on insured individuals, insurance types, insurance regulations, related family members, historical insurance information, and historical health records. A pension insurance knowledge graph can be constructed based on pension insurance data. Furthermore, this application can be applied to the historical and religious fields, for example, to construct a Buddhist knowledge graph. The target knowledge data required to obtain religious data includes religious classics, academic research, and other religious data.
[0039] See also Figure 3 , Figure 3 A specific implementation of step S1 is shown, which is described in detail as follows:
[0040] S11: Acquire the target knowledge data, and preprocess the target knowledge data to obtain preprocessed target knowledge data.
[0041] S12: Using a preset model to perform entity recognition on the preprocessed target knowledge data to obtain an entity recognition result.
[0042] S13: extracting the subject-predicate-object structure in the entity recognition result by using dependency syntactic analysis, and constructing an entity relationship based on the subject-predicate-object structure and the entity recognition result.
[0043] S14: Construct the target topic knowledge graph based on the entity relationship and the entity recognition result.
[0044] Among them, the pre-processed target knowledge data refers to structured data that has been processed through text cleaning and standardization. Specifically, regular expressions can be used to remove punctuation and special characters, stop word lists can be used to filter irrelevant words, and word segmentation tools can be used to perform vocabulary segmentation. Preprocessing is used to eliminate noise interference in the original data and improve the accuracy of subsequent entity recognition. Among them, the preset model refers to a natural language processing model trained for the target knowledge domain. Specifically, the BERT model can be used to perform fine-tuning training on the target knowledge corpus to enable it to have the ability to recognize the target knowledge proper nouns and terms. This model solves the problem of insufficient accuracy of general models in target knowledge entity recognition through domain adaptation training. Among them, dependency syntactic analysis refers to the technology of parsing sentence components based on grammatical structure. Specifically, the Stanford CoreNLP tool can be used to extract the subject-verb-object dependency relationship in the sentence, and by establishing the action-object association between verbs and nouns, the implicit causal logical relationship in the target knowledge can be accurately captured. Among them, entity relationship construction refers to the process of establishing knowledge associations based on the results of syntactic analysis. Specifically, it can be achieved by taking the predicate in the subject-predicate-object structure as the relationship type, and the subject and object as the entities at both ends of the relationship, to form a triple relationship with semantic orientation, thereby solving the problem that traditional keyword co-occurrence methods ignore semantic structure.
[0045] Specifically, the target knowledge data is cleansed and standardized to form canonical text. Domain-specific models are then used to identify proprietary concepts within the target knowledge entities. Dependency analysis is performed on sentences containing these entities. For example, from the sentence "Wu Ming Yuan Xing," a structured relationship is extracted, with "Wu Ming" as the subject, "Yuan" as the predicate, and "Xing" as the object. These relationships are combined with the entities to form a triplet relationship network of "Wu Ming - Yuan - Xing." By systematically integrating all entities and their relationships, a knowledge graph is constructed that encompasses the core concepts of the target knowledge and their doctrinal connections, providing an accurate semantic foundation for subsequent test case generation.
[0046] Traditional methods use general natural language processing models for entity recognition, which makes it difficult to accurately identify professional names in various fields, resulting in a high error rate in entity recognition. Existing relationship construction relies heavily on keyword co-occurrence frequency statistics and cannot distinguish the semantic differences expressed by professional terms. This application improves entity recognition accuracy through a domain adaptation model and uses dependency syntactic analysis to capture the core semantic structure of sentences, effectively solving the problem of extracting implicit logical relationships in the target knowledge.
[0047] The embodiments of this application can transform complex semantic relationships into structured knowledge networks, improve entity recognition accuracy to a practical level, accurately capture the causal logic chain in the target knowledge data, and construct a knowledge graph with clear layers and close semantic connections. This graph provides precise knowledge support for test case generation, ensuring that subsequent tests can cover the deep semantic connections of the target knowledge.
[0048] S15: If new target knowledge data is detected, the new target knowledge data is acquired through the incremental update engine.
[0049] S16: Perform incremental training on the target subject knowledge graph based on the new target knowledge data by using a comparative learning method to update the nodes and relationships of the target subject knowledge graph and generate a new target subject knowledge graph.
[0050] S17: Use Neo4j graph database to store the new target subject knowledge graph.
[0051] Specifically, this application further proposes that when new target knowledge data is detected, the new target knowledge data is obtained through an incremental update engine, and the target subject knowledge graph is incrementally trained based on the new target knowledge data using a comparative learning method to update nodes and relationships, generate a new target subject knowledge graph, and use a Neo4j graph database to store the new target subject knowledge graph.
[0052] The incremental update engine is an automated module used to capture newly added target knowledge data in real time. This can be achieved by using a distributed message queue combined with a data listener, automatically identifying text data related to the target knowledge by setting a keyword trigger mechanism. Contrastive learning refers to a machine learning method that distinguishes between new and old knowledge by constructing positive and negative sample pairs. This can be achieved by using a twin network structure combined with cosine similarity calculations to incorporate new entity relationships while retaining the original knowledge structure. The Neo4j graph database refers to a database system that supports the storage of attribute graph models. This can be achieved by using the Cypher query language combined with index optimization technology to efficiently store graph nodes and their relationships.
[0053] Specifically, when the incremental update engine detects new annotations to target knowledge classics, the publication of academic papers, or other updates to target knowledge, it automatically captures relevant text and performs data cleaning. The contrastive learning module maps the new data to existing nodes in the knowledge graph in feature space, calculating semantic similarity to determine whether new entities have been formed or whether existing relationships need to be expanded. For example, when a new description of a practice method is discovered under the "Zen Buddhist Koan" category, contrastive learning matches this content with existing Koan nodes. If the difference exceeds a preset threshold, a new node is generated. The updated knowledge graph is stored in Neo4j, leveraging its native graph storage structure to enable fast path queries and provide real-time data support for subsequent test case generation.
[0054] Traditional knowledge updates rely on manual organization and full retraining, which has the problems of long update cycles and high resource consumption. This application realizes automatic data capture through an incremental update engine to avoid delays caused by manual intervention; it adopts a comparative learning method instead of full training, and only adjusts the model for the difference part, reducing computing resource consumption by about 40%; combined with Neo4j's graph traversal capabilities, the relationship query response time is shortened from seconds to milliseconds. The embodiment of this application realizes the dynamic real-time update of the target subject knowledge graph, effectively solving the problem of insufficient test case coverage caused by knowledge lag. New knowledge data can be quickly integrated into the existing knowledge system to ensure that the test cases cover the latest research results and avoid test result deviations caused by outdated knowledge base. The efficient storage mechanism of the graph database supports the rapid generation of test questions based on the latest knowledge structure, significantly improving the timeliness and accuracy of test results.
[0055] S2: Construct test cases based on the target topic knowledge graph through a dual-channel generative adversarial network.
[0056] Specifically, the generator in the dual-channel adversarial generative network traverses the target topic knowledge graph to generate the question stem of the target topic causal chain, the discriminator performs discriminative optimization on the question stem to generate optimized test questions, and a heuristic search strategy is used to generate test cases based on the optimized test questions.
[0057] See also Figure 4 , Figure 4 A specific implementation of step S2 is shown, which is described in detail as follows:
[0058] S21: Traverse the target topic knowledge graph through the generator in the dual-channel adversarial generative network to generate the question stem of the target topic causal chain.
[0059] S22: Perform discriminant optimization on the question stem through the discriminator of the dual-channel adversarial generative network to generate an optimized test question.
[0060] S23: Generate the test case based on the optimized test problem using a heuristic search strategy.
[0061] Specifically, a dual-channel adversarial generative network (GAN) refers to an adversarial network architecture consisting of a generator and a discriminator. The generator can be implemented using an encoder-decoder model based on a graph neural network, generating initial questions based on the nodes and relationships in the knowledge graph. The discriminator can be implemented using a classification model combining a convolutional neural network with an attention mechanism, determining whether the generated questions conform to the causal logic of the target knowledge. Through an adversarial training mechanism, the generator and discriminator mutually optimize each other, improving the quality of question generation.
[0062] The heuristic search strategy dynamically adjusts the search path based on the degree centrality and relationship weights of knowledge graph nodes. This can be achieved by combining breadth-first search with a dynamic priority queue. By prioritizing access to frequently associated nodes and key causal chains, the generated test cases ensure that they cover core knowledge points.
[0063] Specifically, as the generator traverses the target subject knowledge graph, it extracts causal chains between entities as the main question stem. For example, for the twelve links of dependent origination, "ignorance leads to action, and action leads to consciousness," the generated question stem is "How does ignorance lead to the emergence of consciousness?" The discriminator performs semantic verification on the generated questions, filtering out questions that contain logical contradictions or are inconsistent with doctrine. The heuristic search strategy prioritizes core target knowledge nodes based on the importance of nodes in the knowledge graph and generates multi-level test questions. For example, for the "Four Noble Truths" node, a test sequence containing the four sub-questions of suffering, origin, cessation, and the path is generated. By dynamically adjusting the search depth and breadth, the generated test cases are ensured to cover both basic knowledge points and deeper philosophical issues.
[0064] Compared with existing technologies, traditional test case generation methods rely on manual analysis of classic texts to extract problems, which suffer from limited coverage and difficulty capturing complex causal relationships. For example, manually written test cases typically only cover a single knowledge point and are unable to automatically generate complex problems involving multi-level causal chains. By combining a generative adversarial network with a knowledge graph, not only can implicit relationships between entities be automatically mined to generate test questions, but the discriminator's semantic verification can also ensure the logical rigor of the questions. Compared to random sampling methods, heuristic search strategies can increase test case generation efficiency by more than three times, while ensuring that important knowledge points are covered first.
[0065] The embodiment of the present application realizes the automated generation of target knowledge test cases, and can automatically construct deep-seated questions that conform to the causal logic chain based on the structural characteristics of the knowledge graph. The generated test cases cover the core nodes and low-frequency associations in the classic data, solving the problems of insufficient coverage and lack of logical depth in manual writing. The adversarial optimization mechanism effectively avoids semantic deviations in the questions, and the generated test cases can be used to comprehensively evaluate the question-answering robot's ability to understand and reason about complex knowledge.
[0066] S3: The question-answering robot performs a target knowledge test based on the test case to obtain a test result.
[0067] Specifically, a method for generating test results by conducting target knowledge testing based on test cases through a question-and-answer robot includes receiving test cases through an interface corresponding to the question-and-answer robot, generating a context-related question sequence based on a test plan of the test case using an LSTM timing model, and answering questions based on the question sequence through the question-and-answer robot to generate test results.
[0068] See also Figure 5 , Figure 5 A specific implementation of step S3 is shown, which is described in detail as follows:
[0069] S31: Receive the test case through the interface corresponding to the question-answering robot.
[0070] S32: Generate a context-related question sequence based on the test plan of the test case using an LSTM timing model.
[0071] S33: The question-answering robot answers questions based on the question sequence to perform a target knowledge test and generate the test result.
[0072] Specifically, the LSTM time series model refers to a neural network structure containing long-short-term memory units. This can be implemented using a model architecture with 256 or 512 hidden layer nodes. It tests the causal logic relationships in the laser through sequential state transfer processing. A contextual question sequence refers to a combination of multiple questions with logical coherence. This can be achieved by optimizing the paths of candidate questions output by the LSTM using a dynamic programming algorithm, forming a causal chain question structure.
[0073] Specifically, after receiving standardized test cases, the Q&A robot interface extracts the semantic feature vectors of the test lasers using a word embedding model, which serves as input to the LSTM time series model. Based on the current input vector and the hidden state at the previous moment, the LSTM model generates question predictions containing contextual information. For example, for the "Twelve Links of Dependent Origination" test case, the LSTM model first generates the question "Why is ignorance the starting point of reincarnation?" and then, based on the hidden state, generates the related question "How does karma give rise to consciousness?" The generated candidate questions are then filtered through path scoring to form a coherent question sequence. The Q&A robot answers the questions in this sequence one by one, simulating knowledge verification in a real-world conversation during the test.
[0074] Traditional methods rely on manually written isolated questions to test question-answering robots, such as asking a single question like "What are the Four Dharma Seals?", which makes it impossible to verify the robot's logical reasoning ability in multiple rounds of dialogue. However, this application automatically generates a sequence of questions with causal associations through an LSTM model and a dynamic programming algorithm. For example, in religious topics, when testing the "Three Dharma Seals," it generates continuous questions such as "What are the manifestations of impermanence?" and "What is the relationship between the non-self of all dharmas and nirvana and tranquility?", thus achieving a coverage test of the systematic relationship of religious knowledge. The embodiments of this application can automatically generate a sequence of context-related questions that conforms to the step-by-step knowledge causal logic, effectively simulating the multi-round interaction process in a real dialogue scenario. For example, when testing the robot's understanding of the Heart Sutra, the question sequence can cover the definition of "the five aggregates are empty," the dialectical relationship of "form is not different from emptiness," and the path to achieving "ultimate nirvana," thereby systematically verifying the accuracy and logical coherence of the question-answering robot's answers in a complex knowledge system.
[0075] S4: Calculate evaluation indicators based on the test results using a pre-built evaluation model to generate target evaluation results.
[0076] Specifically, the evaluation model uses a subgraph matching algorithm to calculate the similarity between the answer content in the test results and the standard answer in the target subject knowledge graph to obtain the target similarity; the knowledge points of the answer content in the test results are extracted according to the dependency syntax analysis method, and the coverage rate of the knowledge points covering the standard answer is calculated; the hierarchical analysis method is used to calculate the evaluation indicators based on the target similarity and coverage rate to generate the target evaluation results.
[0077] See also Figure 6 , Figure 6 A specific implementation of step S4 is shown, which is described in detail as follows:
[0078] S41: Calculate the similarity between the answer content in the test result and the standard answer in the target subject knowledge graph using the subgraph matching algorithm through the evaluation model to obtain the target similarity.
[0079] S42: Extracting knowledge points of the answer content in the test result according to dependency syntactic analysis, and calculating the coverage rate of the knowledge points covering the standard answer.
[0080] S43: Calculate the evaluation index based on the target similarity and the coverage using the hierarchical analysis method to generate the target evaluation result.
[0081] The subgraph matching algorithm maps the answer content to a subgraph structure in the target topic knowledge graph, and calculates the topological match with the standard answer subgraph through a graph isomorphism detection algorithm. This can be implemented using the VF2 algorithm to capture the logical association characteristics in the target topic causal chain. Dependency parsing analyzes the grammatical dependencies between words in a sentence to extract the core knowledge points in the subject-verb-object structure. This can be implemented using the Stanford Parser tool. The hierarchical analysis method constructs a judgment matrix of similarity and coverage, and calculates indicator weights using eigenvectors. This can be implemented using the Saaty scaling method to address the problem of one-sided evaluation of single indicators.
[0082] Specifically, the evaluation model first parses the user's answer into a node-relationship subgraph within the knowledge graph. Using a subgraph matching algorithm, it compares the structural overlap with the standard answer subgraph, quantifying the accuracy of the answer in terms of the target knowledge's causal logic. Furthermore, through dependency parsing, it extracts knowledge point triples from the answer, counts their occurrence ratio within the standard answer knowledge point set, and calculates the degree of semantic coverage. Finally, the similarity and coverage scores are input into the AHP model, and a comprehensive evaluation value is calculated based on a pre-set judgment matrix, generating a target evaluation result comprised of multiple quantitative indicators.
[0083] Existing text similarity calculation methods only focus on literal matching and ignore the causal chain logical relationship unique to the target knowledge. The present application realizes comparison at the knowledge structure level through subgraph matching, and extracts core elements in combination with dependency analysis, which can more accurately evaluate the semantic consistency between the answer and the standard answer. The embodiment of the present application solves the problem of evaluation bias caused by the complexity of the semantic structure in the target knowledge test, and realizes the quantitative evaluation of the logical relevance and knowledge point completeness of the answer content and the standard answer. Through the dual verification of knowledge graph subgraph matching and grammatical dependency analysis, the metaphor understanding deviation in the interpretation of target knowledge is effectively identified, and the hierarchical analysis method is used to integrate multi-dimensional indicators to avoid misjudgment caused by a single evaluation dimension, thereby improving the objectivity and accuracy of the test result evaluation.
[0084] S5: Error classification of the test results based on the target evaluation results, and problem location and problem feedback based on the error classification results.
[0085] Specifically, an SVM classifier is used to divide the test results into errors based on the target evaluation results and generate error division results, an error distribution heat map is generated based on the error division results, problem location is performed based on the error division results, and problem feedback is provided based on the error distribution heat map and problem location.
[0086] See also Figure 7 , Figure 7 A specific implementation of step S5 is shown, which is described in detail as follows:
[0087] S51: Using an SVM classifier to perform error classification on the test result based on the target evaluation result to generate the error classification result.
[0088] S52: Generate an error distribution heat map based on the error division result.
[0089] S53: Locate the problem based on the error division result.
[0090] S54: Providing problem feedback based on the error distribution heat map and the problem location.
[0091] Among them, SVM classifier refers to the support vector machine classification model, which realizes the classification of high-dimensional data by constructing a hyperplane. Specifically, kernel functions can be used to process nonlinear separable data to realize automatic identification of error types. Error distribution heat map refers to a visual chart that maps error types and test case attributes to a two-dimensional space. Specifically, color gradients can be used to reflect the error frequency density distribution to quickly locate high-frequency error areas. Problem location refers to associating entity relationship nodes in the knowledge graph according to error types. Specifically, a graph traversal algorithm can be used to trace the path of erroneous knowledge points in the knowledge graph to realize the traceability of defect links. Problem feedback refers to the integration of error distribution and location information to generate multi-dimensional guidance suggestions. Specifically, data-driven templates can be used to automatically generate optimization strategy documents to realize closed-loop management of test evaluation.
[0092] Specifically, in the target knowledge test scenario, the similarity, coverage, and other multi-dimensional indicators in the target evaluation results are first used as input vectors. The classification model obtained through SVM classifier training divides the test results into error types such as concept confusion, causal chain breakage, and entity missing. The error distribution heat map maps different error types to the subject dimension of the target knowledge system. For example, causal chain breakage errors are concentrated in the problem area of causal law. The problem location module traverses the entity nodes related to the error type in the knowledge graph to identify target knowledge points with logical gaps or relationship deviations. For example, it locates that the causal relationship between the truth of suffering and the truth of origin in the Four Noble Truths is not correctly constructed. The problem feedback module combines the high-frequency error areas shown in the heat map with the specific knowledge point defects in the location results to generate a feedback report that includes error distribution trend analysis and targeted optimization suggestions, such as suggesting to supplement the detailed parsing path of the Twelve Links of Dependent Origination in the knowledge graph.
[0093] The existing technology relies on manual experience to classify test results, which has problems such as inconsistent classification standards, low efficiency and inability to process multi-dimensional evaluation data. Traditional error location methods only perform surface analysis based on statistical results, lack of association with the knowledge system, resulting in difficulty in tracing the root cause of the problem. The existing feedback mechanism usually only provides simple error statistics and cannot form effective guidance by combining visual distribution with knowledge structure defects. The present application realizes the systematization and precision of the entire error processing process through automated classification and graph association positioning. The embodiment of the present application solves the problem of low efficiency in test result classification, and realizes rapid processing of multi-dimensional data and automatic classification of error types through the SVM classifier. The error distribution heat map converts abstract classification results into spatial distribution features, which facilitates the rapid identification of high-frequency error areas. The problem location module traces the root cause of the error through the knowledge graph node and accurately identifies the defective links in the target knowledge system. The feedback mechanism that integrates the heat map and positioning results can provide both macro error trends and specific improvement directions, effectively improving the accuracy of target knowledge test evaluation and the optimization efficiency of the question-answering robot.
[0094] In a specific embodiment, the present application can be combined with application scenarios in the financial field. For example, when constructing the target subject knowledge graph, additional keywords in the financial field are obtained, and the corresponding content of the target subject knowledge graph is associated with the keywords, so that when relevant financial field keywords are detected, financial knowledge can be used to answer. For example, when the stock market fluctuates violently, investors often sell out of panic or chase high prices out of greed. That is, when there are keywords such as investment or trading in the test questions, financial knowledge can be used to provide users with professional information, so that users can understand the current stock market situation and avoid blind investment.
[0095] In an embodiment of the present application, target knowledge data is acquired, and a target subject knowledge graph is constructed based on the target knowledge data; a test case is constructed based on the target subject knowledge graph through a dual-channel adversarial generative network; a target knowledge test is performed based on the test case by a question-answering robot to obtain a test result; an evaluation index is calculated based on the test result by a pre-constructed evaluation model to generate a target evaluation result; the test result is error-classified based on the target evaluation result, and problem location and problem feedback are performed based on the error classification result. The embodiment of the present invention automatically generates test cases by constructing a target subject knowledge graph, and realizes the automation of the test process by combining the adversarial generative network and the intelligent evaluation model, thereby solving the problems of low efficiency and insufficient coverage of traditional manual test case generation, having the advantages of improving the coverage and test efficiency of test cases, reducing manual dependence, and realizing automated testing of target knowledge.
[0096] Please refer to Figure 8 , as a response to the above Figure 2 The present application provides an embodiment of a knowledge testing device based on a question-answering robot. Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0097] like Figure 8 As shown, the knowledge testing device based on the question-answering robot of this embodiment includes: a knowledge graph construction module 61, a test case construction module 62, a test result generation module 63, an evaluation index calculation module 64 and a problem location module 65, wherein:
[0098] A knowledge graph construction module 61 is used to obtain target knowledge data and construct a target subject knowledge graph based on the target knowledge data;
[0099] A test case construction module 62 is configured to construct a test case based on the target subject knowledge graph through a dual-channel generative adversarial network;
[0100] A test result generating module 63 is configured to perform a target knowledge test based on the test case by a question-answering robot to obtain a test result;
[0101] An evaluation index calculation module 64 is configured to calculate evaluation indexes based on the test results using a pre-built evaluation model to generate a target evaluation result;
[0102] The problem location module 65 is used to divide the test results into errors based on the target evaluation results, and to perform problem location and problem feedback based on the error division results.
[0103] Furthermore, the knowledge graph construction module 61 includes:
[0104] a preprocessing unit, configured to obtain the target knowledge data and preprocess the target knowledge data to obtain preprocessed target knowledge data;
[0105] An entity recognition unit, configured to perform entity recognition on the preprocessed target knowledge data using a preset model to obtain an entity recognition result;
[0106] An entity relationship construction unit, configured to extract a subject-verb-object structure from the entity recognition result by using dependency syntactic analysis, and to construct an entity relationship based on the subject-verb-object structure and the entity recognition result;
[0107] A graph construction unit is used to construct the target topic knowledge graph based on the entity relationship and the entity recognition result.
[0108] Furthermore, the graph construction unit further includes:
[0109] a data acquisition unit, configured to acquire new target knowledge data through an incremental update engine if new target knowledge data is detected;
[0110] An updating unit, configured to perform incremental training on the target subject knowledge graph based on the new target knowledge data in a comparative learning manner, so as to update the nodes and relationships of the target subject knowledge graph and generate a new target subject knowledge graph;
[0111] The graph storage unit is used to store the new target subject knowledge graph using the Neo4j graph database.
[0112] Furthermore, the test case construction module 62 includes:
[0113] A traversal unit, configured to traverse the target topic knowledge graph through the generator in the dual-channel adversarial generative network to generate a question stem of the target topic causal chain;
[0114] A discriminant optimization unit, configured to perform discriminant optimization on the question stem through the discriminator of the dual-channel adversarial generative network to generate an optimized test question;
[0115] A use case generating unit is used to generate the test case based on the optimized test problem by adopting a heuristic search strategy.
[0116] Furthermore, the test result generating module 63 includes:
[0117] A use case receiving unit, configured to receive the test case through an interface corresponding to the question-answering robot;
[0118] A sequence generation unit, configured to generate a context-related question sequence based on the test plan of the test case using an LSTM time series model;
[0119] The question answering unit is used to answer questions based on the question sequence through the question answering robot to perform a target knowledge test and generate the test result.
[0120] Furthermore, the evaluation index calculation module 64 includes:
[0121] A similarity calculation unit, configured to calculate the similarity between the answer content in the test result and the standard answer in the target subject knowledge graph using a subgraph matching algorithm through the evaluation model to obtain a target similarity;
[0122] A knowledge point extraction unit, configured to extract the knowledge points of the answer content in the test result according to dependency syntax analysis, and calculate the coverage rate of the knowledge points covering the standard answer;
[0123] An indicator calculation unit is used to use a hierarchical analysis method to calculate an evaluation indicator based on the target similarity and the coverage, and generate the target evaluation result.
[0124] Furthermore, the problem location module 65 includes:
[0125] a classification unit, configured to perform error classification on the test result based on the target evaluation result using an SVM classifier to generate the error classification result;
[0126] a heat map generating unit, configured to generate an error distribution heat map based on the error partitioning result;
[0127] a problem locating unit, configured to locate the problem based on the error division result;
[0128] A problem feedback unit is used to provide problem feedback based on the error distribution heat map and the problem location.
[0129] In an embodiment of the present application, target knowledge data is acquired, and a target subject knowledge graph is constructed based on the target knowledge data; a test case is constructed based on the target subject knowledge graph through a dual-channel adversarial generative network; a target knowledge test is performed based on the test case by a question-answering robot to obtain a test result; an evaluation index is calculated based on the test result by a pre-constructed evaluation model to generate a target evaluation result; the test result is error-classified based on the target evaluation result, and problem location and problem feedback are performed based on the error classification result. The embodiment of the present invention automatically generates test cases by constructing a target subject knowledge graph, and realizes the automation of the test process by combining the adversarial generative network and the intelligent evaluation model, thereby solving the problems of low efficiency and insufficient coverage of traditional manual test case generation, having the advantages of improving the coverage and test efficiency of test cases, reducing manual dependence, and realizing automated testing of target knowledge.
[0130] To solve the above technical problems, the present application also provides a computer device. Figure 9 , Figure 9 This is a basic structural block diagram of the computer device in this embodiment.
[0131] The computer device 7 includes a memory 71, a processor 72, and a network interface 73 that are interconnected through a system bus. It should be noted that Figure 9 Only a computer device 7 having three components, memory 71, processor 72, and network interface 73, is shown. However, it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead. It should be understood by those skilled in the art that a computer device herein is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to a microprocessor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a digital signal processor (DSP), an embedded device, etc.
[0132] Computer devices can be desktop computers, laptops, PDAs, cloud servers, etc. Computer devices can interact with users through keyboards, mice, remote controls, touchpads, or voice-activated devices.
[0133] The memory 71 includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic storage, magnetic disk, optical disk, etc. In some embodiments, the memory 71 may be an internal storage unit of the computer device 7, such as the hard disk or memory of the computer device 7. In other embodiments, the memory 71 may also be an external storage device of the computer device 7, such as a plug-in hard disk, smart memory card (SMC), secure digital (SD) card, flash memory card, etc. equipped on the computer device 7. Of course, the memory 71 may also include both the internal storage unit of the computer device 7 and its external storage devices. In this embodiment, the memory 71 is generally used to store the operating system and various application software installed on the computer device 7, such as the program code of the knowledge testing method based on the question-answering robot. In addition, the memory 71 may also be used to temporarily store various types of data that have been output or are about to be output.
[0134] In some embodiments, the processor 72 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor 72 is generally used to control the overall operation of the computer device 7. In this embodiment, the processor 72 is used to execute program code stored in the memory 71 or process data, such as executing the program code of the knowledge testing method based on the question-answering robot described above, to implement various embodiments of the knowledge testing method based on the question-answering robot.
[0135] The network interface 73 may include a wireless network interface or a wired network interface. The network interface 73 is generally used to establish a communication connection between the computer device 7 and other electronic devices.
[0136] The present application also provides another embodiment, namely, providing a computer-readable storage medium, which stores a computer program, and the computer program can be executed by at least one processor to enable the at least one processor to perform the steps of the above-mentioned knowledge testing method based on a question-and-answer robot.
[0137] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods of each embodiment of the present application.
[0138] Obviously, the embodiments described above are only some of the embodiments of the present application, rather than all of the embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application has been described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions described in the aforementioned specific embodiments, or to make equivalent replacements for some of the technical features therein. Any equivalent structure made using the contents of the present application specification and the accompanying drawings, directly or indirectly used in other related technical fields, is also within the scope of patent protection of the present application.
Claims
1. A knowledge testing method based on a question-answering robot, characterized in that: include: Acquire target knowledge data, and construct a target subject knowledge graph based on the target knowledge data; Constructing test cases based on the target subject knowledge graph through a dual-channel generative adversarial network; Conducting a target knowledge test based on the test case by a question-answering robot to obtain a test result; Calculating evaluation indicators based on the test results using a pre-built evaluation model to generate target evaluation results; The test results are error-classified based on the target evaluation results, and problem location and problem feedback are performed based on the error classification results.
2. The knowledge testing method based on the question-answering robot according to claim 1, characterized in that: The acquiring of target knowledge data and constructing a target subject knowledge graph based on the target knowledge data includes: Acquiring the target knowledge data and preprocessing the target knowledge data to obtain preprocessed target knowledge data; Using a preset model to perform entity recognition on the preprocessed target knowledge data to obtain an entity recognition result; Extracting a subject-verb-object structure from the entity recognition result by using dependency parsing, and constructing an entity relationship based on the subject-verb-object structure and the entity recognition result; The target topic knowledge graph is constructed based on the entity relationships and the entity recognition results.
3. The knowledge testing method based on the question-answering robot according to claim 2, characterized in that: After constructing the target topic knowledge graph based on the entity relationship and the entity recognition result, the method further includes: If new target knowledge data is detected, the new target knowledge data is acquired through the incremental update engine; Performing incremental training on the target subject knowledge graph based on the new target knowledge data using a comparative learning approach to update the nodes and relationships of the target subject knowledge graph and generate a new target subject knowledge graph; The Neo4j graph database is used to store the new target subject knowledge graph.
4. The knowledge testing method based on the question-answering robot according to claim 1, characterized in that: The method of constructing a test case based on the target subject knowledge graph through a dual-channel generative adversarial network includes: Traversing the target topic knowledge graph through the generator in the dual-channel adversarial generative network to generate the question stem of the target topic causal chain; Performing discriminant optimization on the question stem through the discriminator of the dual-channel adversarial generative network to generate an optimized test question; The test case is generated based on the optimized test problem by adopting a heuristic search strategy.
5. The knowledge testing method based on the question-answering robot according to claim 1, characterized in that: The question-answering robot performs a target knowledge test based on the test case to obtain a test result, including: Receive the test case through the interface corresponding to the question-answering robot; Generate a context-sensitive question sequence based on the test plan of the test case using an LSTM timing model; The question-answering robot answers questions based on the question sequence to perform a target knowledge test and generate the test result.
6. The knowledge testing method based on the question-answering robot according to claim 1, characterized in that: The evaluation index calculation is performed based on the test results using a pre-built evaluation model to generate a target evaluation result, including: Calculate the similarity between the answer content in the test result and the standard answer in the target subject knowledge graph using the subgraph matching algorithm through the evaluation model to obtain the target similarity; Extracting knowledge points from the answer content in the test result according to dependency syntactic analysis, and calculating the coverage rate of the knowledge points covering the standard answer; The target similarity and the coverage are calculated using the hierarchical analysis method to generate the target evaluation result.
7. The knowledge testing method based on a question-answering robot according to any one of claims 1 to 6, characterized in that: The error classification of the test results based on the target evaluation results, and problem location and problem feedback based on the error classification results, include: Using an SVM classifier to perform error classification on the test result based on the target evaluation result to generate the error classification result; generating an error distribution heat map based on the error partitioning result; locating the problem based on the error division result; Problem feedback is performed based on the error distribution heat map and the problem location.
8. A knowledge testing device based on a question-answering robot, characterized in that: include: A knowledge graph construction module is used to obtain target knowledge data and construct a target subject knowledge graph based on the target knowledge data; A test case construction module, configured to construct a test case based on the target subject knowledge graph through a dual-channel generative adversarial network; A test result generation module is used to perform a target knowledge test based on the test case through a question-answering robot to obtain a test result; An evaluation index calculation module is used to calculate the evaluation index based on the test results using a pre-built evaluation model to generate a target evaluation result; The problem location module is used to divide the test results into errors based on the target evaluation results, and to perform problem location and problem feedback based on the error division results.
9. A computer device, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the knowledge testing method based on the question-answering robot as claimed in any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the knowledge testing method based on a question-answering robot according to any one of claims 1 to 7.