Natural language question and answer method, electronic equipment and storage medium

By performing entity and intent recognition on natural language questions in the field of test engineering, knowledge graph query statements are generated, solving the problems of slow response speed and low answer reliability in existing technologies, and realizing efficient and reliable knowledge query.

CN121301532APending Publication Date: 2026-01-09CHINA FAW CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202511781796.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-29
Publication Date
2026-01-09

AI Technical Summary

Technical Problem

In the field of test engineering, existing natural language question answering systems suffer from slow response speeds and low answer reliability, mainly due to problems such as knowledge fragmentation and inaccurate semantic understanding.

Method used

By acquiring natural language questions for entity and intent recognition, a knowledge graph query statement is generated. Relevant knowledge is then retrieved from the knowledge graph of the testing engineering field to generate a natural language answer.

Benefits of technology

It achieves efficient and reliable knowledge retrieval, significantly improves the accuracy and depth of semantic parsing, shortens query response time, and ensures the comprehensiveness and professionalism of the answers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121301532A_ABST
    Figure CN121301532A_ABST
Patent Text Reader

Abstract

The invention discloses a natural language question and answer method, electronic equipment and a storage medium, and relates to the technical field of natural language processing. The method comprises the following steps: acquiring a natural language question; performing question entity recognition on the natural language question to obtain an entity recognition result, and performing question intention recognition on the natural language question to obtain an intention recognition result; a knowledge graph query statement is generated based on the entity recognition result and the intention recognition result, and the knowledge graph query statement is used for querying related knowledge of the natural language question from a knowledge graph in the field of test engineering; and generating a natural language answer by executing the knowledge graph query statement. The technical problems that in the field of test engineering, due to knowledge fragmentation and inaccurate semantic understanding, a natural language question answering system is low in response speed and low in answer reliability are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of natural language processing technology, and more specifically, to a natural language question-answering method, electronic device, and storage medium. Background Technology

[0002] In the field of automotive testing engineering, efficiently and accurately acquiring test-related knowledge is crucial for ensuring test quality and promoting technological innovation. However, current knowledge retrieval technologies face multiple challenges.

[0003] Test engineers typically rely on document management systems for manual retrieval. This approach is not only time-consuming but also struggles to integrate information across different data sources and systems, leading to inefficiency and information fragmentation in the knowledge acquisition process. Traditional question-answering robots are limited by fixed sentence structure matching and cannot understand or handle test requirements in complex contexts, particularly performing poorly in recognizing complex entities involving specific test objects, environments, and parameters. This directly impacts the practicality of question-answering systems. Furthermore, while general-purpose search engines provide extensive information, their results are often redundant and inaccurate for highly specialized test data that demands high precision, failing to meet the information quality requirements of testing scenarios. Therefore, in the field of test engineering, achieving efficient and reliable knowledge retrieval is one of the key technical challenges.

[0004] There is currently no effective solution to the above problems. Summary of the Invention

[0005] This invention provides a natural language question answering method, electronic device, and storage medium to at least solve the technical problems of slow response speed and low answer reliability in natural language question answering systems caused by knowledge fragmentation and inaccurate semantic understanding in the field of testing engineering.

[0006] According to one aspect of the present invention, a natural language question answering method is provided, comprising: acquiring a natural language question; performing question entity recognition on the natural language question to obtain an entity recognition result, and performing question intent recognition on the natural language question to obtain an intent recognition result; generating a knowledge graph query statement based on the entity recognition result and the intent recognition result, wherein the knowledge graph query statement is used to query relevant knowledge of the natural language question from a knowledge graph in the field of testing engineering; and generating a natural language answer by executing the knowledge graph query statement.

[0007] Optionally, natural language question answering methods also include: constructing a knowledge graph of the test engineering domain based on multi-source heterogeneous test data.

[0008] Optionally, the multi-source heterogeneous test data includes structured data, semi-structured data, and unstructured data. Constructing a knowledge graph for the test engineering domain based on this multi-source heterogeneous test data involves: building an ontology model based on predefined entity types, entity attributes, and entity relationships within the test engineering domain; cleaning the structured and semi-structured data, and parsing the unstructured data to obtain data in a unified format; extracting knowledge from the unified format data using an entity relationship extraction model to obtain triple data for the test engineering domain; and constructing a knowledge graph for the test engineering domain based on the triple data, guided by the ontology model.

[0009] Optionally, entity recognition is performed on the natural language question to obtain entity recognition results, including: encoding the natural language question using an encoding model in the test engineering domain to obtain an encoding result; weighting the encoding result with keywords using an attention mechanism to obtain a weighted result; and annotating the weighted result with a probabilistic graphical model to obtain entity recognition results.

[0010] Optionally, performing question intent recognition on natural language questions to obtain intent recognition results includes: using a text classification model from the field of test engineering to select the intent category corresponding to the natural language question from multiple predefined intent categories to obtain intent recognition results.

[0011] Optionally, generating a knowledge graph query statement based on entity recognition results and intent recognition results includes: selecting a matching query template from a template library based on the intent recognition results; and filling the query template with the entity recognition results to generate a knowledge graph query statement.

[0012] Optionally, generating a natural language answer by executing a knowledge graph query statement includes: obtaining the fill-in prompt words by executing a knowledge graph query statement; and using a question-answering model from the test engineering field to answer the questions based on the fill-in prompt words and generate a natural language answer.

[0013] Optionally, obtaining the fill-in prompt words by executing a knowledge graph query statement includes: obtaining the triple knowledge to be filled from the knowledge graph of the test engineering domain by executing a knowledge graph query statement; filling the triple knowledge as known facts into a preset prompt word template to obtain the fill-in prompt words.

[0014] According to another aspect of the present invention, an electronic device is also provided, comprising: a memory storing an executable program; and a processor for running the program, wherein the program executes any of the natural language question-answering methods described above during runtime.

[0015] According to another aspect of the present invention, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored executable program, wherein, when the executable program is executed, it controls the device where the storage medium is located to execute the natural language question-answering method described above.

[0016] This invention provides a natural language question answering method, comprising: acquiring a natural language question; performing question entity recognition on the natural language question to obtain entity recognition results, and performing question intent recognition on the natural language question to obtain intent recognition results; generating a knowledge graph query statement based on the entity recognition results and intent recognition results, wherein the knowledge graph query statement is used to query relevant knowledge of the natural language question from a knowledge graph in the field of testing engineering; and generating a natural language answer by executing the knowledge graph query statement. This invention firstly, by acquiring the natural language question and performing question entity recognition and intent recognition, can deeply understand the semantics and purpose of the user's query. This process significantly improves the accuracy and depth of semantic parsing, thereby accurately capturing user needs and avoiding the misunderstanding of complex questions in traditional models, laying a solid foundation for subsequent accurate retrieval. Secondly, the knowledge graph query statement generated based on the entity recognition results and intent recognition results can efficiently retrieve information highly related to the natural language question from the knowledge graph in the field of testing engineering, not only significantly shortening the query response time but also ensuring the comprehensiveness and professionalism of the answer, effectively overcoming the inefficiency and fragmentation problems of information retrieval in the prior art. Finally, the generated query statement is executed to produce a natural language answer, resulting in a natural, fluent, and highly accurate answer. In summary, this invention achieves efficient and reliable knowledge retrieval in the field of test engineering, thereby solving the technical problems of slow response speed and low answer reliability in natural language question-answering systems caused by knowledge fragmentation and inaccurate semantic understanding in the test engineering field. Attached Figure Description

[0017] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:

[0018] Figure 1 This is a flowchart of a natural language question-answering method according to one embodiment of the present invention;

[0019] Figure 2 This is a model structure diagram for entity recognition according to one embodiment of the present invention;

[0020] Figure 3 This is an example flowchart of a natural language question-answering method according to one embodiment of the present invention;

[0021] Figure 4 This is a flowchart of the question-answering engine according to one embodiment of the present invention. Detailed Implementation

[0022] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0023] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0024] According to an embodiment of the present invention, an embodiment of a natural language question answering method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0025] This invention provides a natural language question answering method. Figure 1 This is a flowchart of a natural language question-answering method according to one embodiment of the present invention, such as... Figure 1 As shown, the natural language question answering method includes the following steps:

[0026] Step S101: Obtain the natural language question;

[0027] Step S102: Perform question entity recognition on the natural language question to obtain the entity recognition result, and perform question intent recognition on the natural language question to obtain the intent recognition result;

[0028] Step S103: Generate a knowledge graph query statement based on the entity recognition result and the intent recognition result. The knowledge graph query statement is used to query relevant knowledge of natural language questions from the knowledge graph of the test engineering field.

[0029] Step S104: Generate a natural language answer by executing a knowledge graph query statement.

[0030] In one alternative embodiment, natural language questions from a user are received. These questions can be any questions related to areas such as test specification queries, fault diagnosis, and test strategy consultation. For example, a user might ask, "What are the test standards and common failure modes for cameras used in advanced driver assistance systems at -40°C?"

[0031] In one alternative embodiment, a neural network model for entity recognition is used to identify key entities in natural language questions, such as test objects, test environments, test standards, etc., which is the basis for understanding the semantics of the questions.

[0032] The aforementioned intent recognition refers to determining the core need or purpose expressed in a natural language question, such as querying test standards or seeking explanations for a fault. Optionally, intent recognition is typically accomplished using a text classification model.

[0033] For example, an attention-enhanced BERT-BiLSTM-CRF model (i.e., bidirectional transformer-bidirectional long short-term memory network-conditional random field model) is used to perform entity recognition on natural language questions, yielding entity recognition results. The pre-trained BERT model captures the semantic features of each word, the BiLSTM layer learns the contextual dependencies of the question, and the CRF layer ensures the rationality of the label sequence throughout the entity recognition process. The BERT-RCNN model (i.e., bidirectional transformer-recurrent convolutional network model) is then used to perform question intent recognition on the natural language questions, identifying the specific query intent.

[0034] The aforementioned knowledge graph query statements refer to statements constructed according to a specific query syntax, used to accurately locate knowledge content related to the question from the knowledge graph.

[0035] In one optional embodiment, a knowledge graph query statement conforming to the Cypher (a query language) specification is dynamically generated based on entity recognition results and intent recognition results.

[0036] Optionally, the knowledge graph described above uses nodes to represent entities and edges to represent relationships between entities, enabling efficient storage and management of large amounts of related knowledge. In the field of test engineering, the knowledge graph covers test standards, historical cases, equipment information, and other content.

[0037] In one alternative embodiment, a knowledge graph query is executed to retrieve relevant information from a knowledge graph in the test engineering domain, and the retrieved information is incorporated into a specific prompt word template. The filled prompt word template is then input into a pre-trained large language model to obtain the final natural language answer.

[0038] This invention provides a natural language question answering method, comprising: acquiring a natural language question; performing question entity recognition on the natural language question to obtain entity recognition results, and performing question intent recognition on the natural language question to obtain intent recognition results; generating a knowledge graph query statement based on the entity recognition results and intent recognition results, wherein the knowledge graph query statement is used to query relevant knowledge of the natural language question from a knowledge graph in the field of testing engineering; and generating a natural language answer by executing the knowledge graph query statement. This invention firstly, by acquiring the natural language question and performing question entity recognition and intent recognition, can deeply understand the semantics and purpose of the user's query. This process significantly improves the accuracy and depth of semantic parsing, thereby accurately capturing user needs and avoiding the misunderstanding of complex questions in traditional models, laying a solid foundation for subsequent accurate retrieval. Secondly, the knowledge graph query statement generated based on the entity recognition results and intent recognition results can efficiently retrieve information highly related to the natural language question from the knowledge graph in the field of testing engineering, not only significantly shortening the query response time but also ensuring the comprehensiveness and professionalism of the answer, effectively overcoming the inefficiency and fragmentation problems of information retrieval in the prior art. Finally, the generated query statement is executed to produce a natural language answer, resulting in a natural, fluent, and highly accurate answer. In summary, this invention achieves efficient and reliable knowledge retrieval in the field of test engineering, thereby solving the technical problems of slow response speed and low answer reliability in natural language question-answering systems caused by knowledge fragmentation and inaccurate semantic understanding in the test engineering field.

[0039] The natural language question answering method in the embodiments of this application will be further described below.

[0040] Optionally, natural language question answering methods also include: constructing a knowledge graph of the test engineering domain based on multi-source heterogeneous test data.

[0041] The aforementioned multi-source heterogeneous test data refers to a collection of data with different structures and formats from multiple different sources within a specific testing domain.

[0042] Multi-source means that the data comes from different systems, platforms, or documents. Heterogeneous, on the other hand, emphasizes that the data has different formats and organizational structures.

[0043] Optionally, in the field of vehicle testing, test data can come from test specification libraries (containing various test standards and procedures), historical test case reports (recording the detailed process, results and analysis of previous tests, usually in semi-structured form), equipment manuals (providing operating instructions, technical specifications and other information for test equipment, usually in document form), failure analysis reports (deeply analyzing the causes of equipment or system failures under specific conditions, and possible solutions), and national or industry standard documents (such as newly released national standards or industry guidelines).

[0044] In the field of test engineering, knowledge graphs display various knowledge and information within the domain, such as test standards, equipment characteristics, historical test cases, and fault diagnosis logic, in the form of nodes and edges. Each node represents an entity (such as test item, equipment model, standard clause, etc.), while edges represent the relationships between entities (such as "comply with", "applies to", "leads to", etc.).

[0045] Optionally, the multi-source heterogeneous test data includes structured data, semi-structured data, and unstructured data. A knowledge graph for the test engineering domain is constructed based on this multi-source heterogeneous test data, including the following steps:

[0046] Step S1051: Construct an ontology model based on the predefined entity types, entity attributes, and entity relationships of the test project domain;

[0047] Step S1052: Perform data cleaning on structured and semi-structured data, and data parsing on unstructured data to obtain data in a unified format.

[0048] Step S1053: Use the entity relation extraction model to extract knowledge from the unified format data to obtain triple data in the test engineering domain.

[0049] Step S1054: Under the guidance of the ontology model, construct a knowledge graph of the test engineering domain based on the triple data of the test engineering domain.

[0050] The structured data mentioned above refers to data with clearly defined fields and record structures, such as tables in a database.

[0051] The aforementioned semi-structured data refers to data that has a certain data structure but is not as strict as that of traditional databases, such as documents in XML and JSON formats.

[0052] The aforementioned unstructured data refers to data that does not have a fixed data structure and requires techniques such as text mining and natural language processing to extract useful information, such as free text, images, and PDF documents.

[0053] The aforementioned ontology model is a conceptual model used to define concepts, entities, and relationships between them within a specific domain. It provides a formalized and explicit vocabulary to facilitate knowledge sharing and exchange.

[0054] Optionally, first identify common core entity types within the test engineering domain, including but not limited to test projects, test standards, test equipment, test environments, test results, and failure modes. Define an attribute set for each entity type; for example, test project attributes might include name, ID, test time, and test location. Further, define various relationships between entities, such as "complies" (a test project follows a certain test standard), "belongs to" (a test environment belongs to a specific test scenario), and "causes" (a specific test device causes a certain type of failure mode). Based on the identified entity types, entity attributes, and entity relationships, construct an ontology model.

[0055] The aforementioned data cleaning refers to removing or correcting incomplete, erroneous, inaccurate, or irrelevant records in a dataset, and is a key step in ensuring the accuracy of knowledge extraction.

[0056] The aforementioned data parsing refers to extracting the text content from unstructured data, such as PDF reports and Word documents, using technologies such as optical character recognition and natural language processing, and then performing preliminary structuring processing.

[0057] Specifically, structured and semi-structured data are cleaned, and unstructured data is parsed to obtain data in a unified format.

[0058] The triplet data mentioned above is usually represented in the form of (subject, predicate, object), which is the most basic data storage unit in a knowledge graph and can clearly express the relationships between entities.

[0059] In one alternative embodiment, an entity recognition model (such as the BERT-BiLSTM-CRF model) is used to identify entities in the uniformly formatted data, thus identifying various entities. Further, an entity relation extraction model is used to extract the relationships between entities. The identified entities and their relationships are combined into triples, such as ("Vehicle Braking Test Item", "Complies with", "ISO16800 Standard").

[0060] Guided by the ontology model, a knowledge graph for the test engineering domain is constructed based on triple data from the test engineering domain. In one optional embodiment, based on the constructed ontology model, corresponding nodes, such as "test project" and "test standard," are created in the graph database. Based on the triple data, edge relationships are established between the corresponding nodes; for example, the "test project" node and the "test standard" node are connected through a "follow" relationship, thereby obtaining the knowledge graph.

[0061] Optionally, the generated knowledge graph can be optimized, including but not limited to eliminating redundant nodes and relationships, and performing entity alignment, to ensure the consistency and integrity of the knowledge graph.

[0062] Optionally, perform question entity recognition on the natural language question to obtain the entity recognition result, including the following steps:

[0063] Step S1021: Perform question encoding on the natural language question using a coding model in the testing engineering field to obtain the encoding result;

[0064] Step S1022: The encoding result is weighted by keywords using an attention mechanism to obtain a weighted result;

[0065] Step S1023: Entity labeling is performed on the weighted results using a probabilistic graphical model to obtain entity recognition results.

[0066] The encoding model described above can be a pre-trained BERT model. Alternatively, a natural language question can be input into the BERT model, which will convert it into a series of word vector representations. These vectors not only contain the semantic information of the words themselves, but also incorporate the contextual information of the question.

[0067] The attention mechanism described above is a technique in deep learning that allows models to learn importance weights when processing sequential data, thus focusing more on the important parts in the output. In natural language processing, attention mechanisms can be used to highlight key entities in questions and reduce interference from irrelevant words.

[0068] For example, an attention layer is added to the word vector representation output by BERT. This layer calculates the importance of each word vector relative to the entire question. By calculating weights, the model can weight each word in the encoded result, highlighting entities that are closely related to the intent of the question.

[0069] The probabilistic graphical model described above can be a Conditional Random Field (CRF) model. A CRF is a statistical model used for sequence labeling that predicts a label for each element in a sequence given observations. Compared to traditional sequence labeling methods, CRF can consider the labels of the entire sequence simultaneously, ensuring the coherence and reasonableness of the labels within the sequence.

[0070] In one alternative embodiment, the weighted word vector sequence is input into the CRF model, which predicts an entity label for each word in the sequence, thereby obtaining the entity recognition result.

[0071] In one alternative embodiment, Figure 2This is a model structure diagram of entity recognition according to one embodiment of the present invention, such as... Figure 2 As shown, the entity recognition process includes: encoding the question to obtain the encoding result; weighting the encoding result through an attention mechanism to obtain the weighted result; and decoding and annotating the weighted result to obtain the entity recognition result.

[0072] Optionally, perform question intent recognition on the natural language question to obtain intent recognition results, including: using a text classification model in the field of test engineering to select the intent category corresponding to the natural language question from multiple predefined intent categories to obtain intent recognition results.

[0073] In one optional embodiment, the user-input natural language question is preprocessed to remove unnecessary punctuation and stop words. The preprocessed question is then fed into a trained text classification model (such as the BERT-RCNN model). The model outputs the predicted probability of each intent category, and the intent category with the highest predicted probability is selected as the intent category corresponding to the natural language question.

[0074] Optionally, a knowledge graph query statement is generated based on the entity recognition result and the intent recognition result, including the following steps:

[0075] Step S1031: Select a matching query template from the template library based on the intent recognition result;

[0076] Step S1032: Fill the query template with the entity recognition results to generate a knowledge graph query statement.

[0077] The template library described above stores graph query templates covering all preset intent categories to improve the efficiency and accuracy of query generation.

[0078] In one optional embodiment, when the intent category corresponding to the natural language question is identified (such as querying test criteria, diagnosing fault causes, etc.), the query template that best matches the intent category is selected from a pre-built query template library. Optionally, the query templates are example statements written for a specific intent category, which contain placeholders for subsequent steps to be filled based on entity recognition results.

[0079] In one alternative embodiment, the entity recognition results are formatted as a list or dictionary containing all key entities. Subsequently, the names or parameter values ​​of these entities are populated into the corresponding positions in the query template to generate specific, targeted knowledge graph query statements.

[0080] Optionally, a natural language answer can be generated by executing a knowledge graph query, including the following steps:

[0081] Step S1041: Obtain the suggested words after filling by executing the knowledge graph query statement;

[0082] Step S1042: Use a question-answering model from the field of test engineering to answer the questions based on the filled prompts and generate natural language answers.

[0083] The above knowledge graph query statements can be constructed using Cypher (Neo4j's query language), SPARQL (RDF graph database's standard query language), or other query languages ​​suitable for knowledge graphs, and are used to retrieve specific entities and their relationships from the graph database.

[0084] In one optional embodiment, relevant information is retrieved from the knowledge graph database based on the knowledge graph query statement to obtain the populated prompt words. The knowledge graph query statement is dynamically generated based on the user's intent and entity recognition results.

[0085] The question-answering model described above can be a large language model. After fine-tuning with a dataset specific to the testing engineering domain, the large language model can understand technical terms, testing processes, and fault logic, thereby providing users with accurate natural language question-answering services.

[0086] In one optional embodiment, the acquired padded prompts are input into a question-answering model in the test engineering domain. The model, based on the information in the padded prompts and its own understanding of the test engineering domain, generates a human-readable natural language answer. The generation process strives to preserve the accuracy of the information provided in the knowledge graph as much as possible, while also aiming for a clear, professional, and natural expression of the answer.

[0087] Optionally, the suggested words after being filled can be obtained by executing a knowledge graph query, including the following steps:

[0088] Step S10411: Obtain the triple knowledge to be filled from the knowledge graph of the test engineering domain by executing the knowledge graph query statement;

[0089] Step S10412: The triplet knowledge is used as known facts and filled into the preset prompt word template to obtain the filled prompt word.

[0090] The aforementioned triplet knowledge refers to a knowledge structure consisting of two entities and the relationship between them, which is the basic unit for expressing the relationship between entities in a knowledge graph.

[0091] The aforementioned prompt word template refers to a text template used to guide the question-answering model in generating answers. It contains specific placeholders that will be filled with entity and relation information from the triple knowledge.

[0092] In one alternative embodiment, a knowledge graph query is executed to retrieve entities, attributes, and relationships directly related to the query from the knowledge graph of the test engineering domain. These retrieval results will appear in the form of triplet knowledge, i.e., an entity-relationship-entity structure, facilitating subsequent processing and integration.

[0093] Furthermore, the knowledge of triples is treated as known facts and integrated into a pre-defined prompt template to form a complete and structured post-filled prompt. The post-filled prompt contains specific entity and relational information, guiding the question-answering model to generate more natural and professional natural language answers.

[0094] In one alternative embodiment, Figure 3 This is an example flowchart of a natural language question-answering method according to one embodiment of the present invention, such as... Figure 3 As shown, the natural language question answering method can be implemented as follows: Obtain the user's question; perform entity extraction and intent recognition on the user's question to obtain entity recognition results and intent recognition results; generate a knowledge graph query statement based on the entity recognition results and intent recognition results; query the knowledge graph based on the knowledge graph query statement to obtain relevant knowledge, and generate fill-in prompts based on the relevant knowledge; input the fill-in prompts into a question answering model in the test engineering domain. The question answering model will generate a human-readable natural language answer, i.e., an answer with supporting evidence, based on the information in the fill-in prompts and its own understanding of the test engineering domain. A detailed explanation follows.

[0095] Optionally, a knowledge graph can be constructed. This involves transforming multi-source, heterogeneous test data into a structured knowledge graph. Specifically, this includes: defining core entity types (e.g., test items, devices under test, test standards), attributes, and relationships (e.g., following, causing) within the test domain using ontology building tools to form an ontology model; cleaning and transforming structured and semi-structured data; parsing unstructured text (e.g., Word / PDF reports) to extract plain text content; employing an end-to-end entity relationship joint extraction model based on a pre-trained language model for knowledge extraction; and finally, aligning entities extracted from different sources to eliminate redundancy and storing triplet data in a graph database to complete the knowledge graph construction. This process, through automated and high-precision knowledge extraction, provides an accurate and comprehensive knowledge foundation for intelligent question answering.

[0096] Optionally, the user's question is parsed. This process is responsible for understanding the natural language question input by the user, specifically including two parts: question entity recognition and question intent recognition. In the entity recognition stage, a BERT-BiLSTM-CRF model enhanced with an attention mechanism is used for fine-grained semantic parsing. This model has the following characteristics: the BERT encoding layer uses a pre-trained model from the test engineering domain, improving the understanding of technical terms; the attention mechanism can automatically focus on key entities in the question, reducing interference from irrelevant words; the CRF layer ensures the rationality of the output label sequence, avoids illegal label transfer, and improves the recognition accuracy of complex entities and technical terms. In the intent recognition stage, the user's question is input into a text classification model and classified into predefined intent categories (such as "query test standards" or "query reason for failure"). This process, through deep semantic understanding, achieves accurate parsing of complex entities and implicit intents, enabling the system to understand diverse natural questions and breaking through the limitations of traditional templates.

[0097] Optionally, a knowledge graph query statement is generated and relevant knowledge is retrieved from the knowledge graph. The query statement is dynamically assembled based on the parsed entity list and intent categories.

[0098] Optionally, a final answer is generated. This process ensures that the answer is both accurate and natural, specifically including: executing the generated knowledge graph query statement to retrieve relevant structured knowledge triples from the knowledge graph; using these triples as known facts to fill in preset prompt word templates; inputting the filled prompt words into a large language model, instructing it to strictly organize and generate a natural language answer based on the provided facts.

[0099] In one alternative embodiment, Figure 4 This is a flowchart of the question-answering engine according to one embodiment of the present invention, such as... Figure 4 As shown, the specific workflow includes: classifying the question type based on the user's question; if the user's question is a structured question, directly retrieving the knowledge graph based on the user's question and returning results with supporting evidence; if the user's question is an open-ended question, generating a natural language answer using generative reasoning (such as the natural language question answering method mentioned in the embodiments of this application), and determining whether secondary intent verification is required; when secondary intent verification is required, outputting an option list, allowing the user to make a selection based on the option list, and further performing generative reasoning based on the user's selection result; when secondary intent verification is not required, outputting the generated answer.

[0100] In one optional embodiment, the present invention provides an intelligent question-answering system for test engineering based on multi-source knowledge fusion. The system includes four core modules: a knowledge graph construction module, a question parsing module, a query retrieval module, and an answer generation module.

[0101] Optionally, the knowledge graph construction module is responsible for integrating multi-source heterogeneous test data to establish a structured knowledge system. This module first defines entity types (such as test items, devices under test, test standards, failure modes, etc.) and relationship types (such as complying with, causing, and applying to) within the testing domain through ontology modeling. Then, it employs deep learning-based knowledge extraction technology to automatically extract entities and relationships from unstructured texts such as test specifications, historical case reports, and equipment manuals. Finally, it eliminates data redundancy through entity alignment to form a knowledge graph.

[0102] Optionally, the question parsing module employs a multi-level semantic understanding architecture. At the entity recognition level, an attention-enhanced BERT-BiLSTM-CRF model is used. This model captures the semantic representation of test terminology through domain-pre-trained BERT encoding layers, learns contextual features through BiLSTM layers, focuses on key information through the attention mechanism, and ensures the rationality of the label sequence through the CRF layer. At the intent recognition level, a BERT-RCNN model is used to perform deep classification of user questions, dividing them into 12 preset intent categories such as "querying test standards" and "diagnosing fault causes." This module supports the parsing of complex questions.

[0103] Optionally, the query retrieval module dynamically generates knowledge graph query statements based on the parsing results. This module converts the semantic parsing results into the standard Cypher query language, supporting multi-hop queries and related searches. For example, for complex queries involving test standards, historical cases, and solutions, the system automatically generates query statements with multiple matching conditions to ensure the completeness and relevance of the retrieval results.

[0104] Optionally, the answer generation module first retrieves relevant fact triples from the knowledge graph and then inputs them as constraints into the large language model. Through prompt word templates, the large language model is guided to generate natural and fluent answers based on accurate facts, maintaining the professionalism and readability of the responses.

[0105] For example, if a test engineer needs to query "Test standards and common failure modes of ADAS cameras in -40℃ environments," the system's workflow is as follows: The question parsing module first performs in-depth analysis of the question, and the entity recognition component accurately identifies key entities such as "ADAS camera" (the device under test), "-40℃" (the test environment), "test standards" (the query target), and "failure modes" (the query target). The intent recognition component determines that the question contains a dual intent: "querying test standards" and "querying failure modes." The query retrieval module then generates a knowledge graph query statement, which simultaneously retrieves three aspects of information from the knowledge graph: the applicable low-temperature test standard clauses for ADAS cameras, historical failure cases of this model of camera in low-temperature environments, and solutions to related failures. The knowledge graph query statement also has sorting rules, prioritizing the return of results with the highest matching degree. The answer generation module integrates the retrieved standard clauses (such as image performance requirements in ISO 16505 at -40℃), historical failure data (such as image transmission delay issues in a project), and their solutions (such as optimizing image compression algorithms) into the prompt words, and generates a structured answer through a large language model.

[0106] According to another aspect of the present invention, an electronic device is also provided, comprising: a memory storing an executable program; and a processor for running the program, wherein the program executes any of the natural language question-answering methods described above during runtime.

[0107] Optionally, in this embodiment, the processor is configured to run a computer program to perform the following steps:

[0108] Step S101: Obtain the natural language question;

[0109] Step S102: Perform question entity recognition on the natural language question to obtain the entity recognition result, and perform question intent recognition on the natural language question to obtain the intent recognition result;

[0110] Step S103: Generate a knowledge graph query statement based on the entity recognition result and the intent recognition result. The knowledge graph query statement is used to query relevant knowledge of natural language questions from the knowledge graph of the test engineering field.

[0111] Step S104: Generate a natural language answer by executing a knowledge graph query statement.

[0112] Optionally, the processor is configured to run a computer program to perform the following steps: constructing a knowledge graph of the test engineering domain based on multi-source heterogeneous test data.

[0113] Optionally, the multi-source heterogeneous test data includes structured data, semi-structured data, and unstructured data. The processor is configured to run a computer program to perform the following steps: construct an ontology model based on predefined entity types, entity attributes, and entity relationships within the test engineering domain; perform data cleaning on the structured and semi-structured data, and data parsing on the unstructured data to obtain data in a unified format; extract knowledge from the unified format data using an entity relationship extraction model to obtain triple data for the test engineering domain; and construct a knowledge graph for the test engineering domain based on the triple data under the guidance of the ontology model.

[0114] Optionally, the processor is configured to run a computer program to perform the following steps: perform question encoding on a natural language question using a coding model in the field of test engineering to obtain an encoding result; perform keyword weighting on the encoding result using an attention mechanism to obtain a weighted result; and perform entity annotation on the weighted result using a probabilistic graphical model to obtain an entity recognition result.

[0115] Optionally, the processor is configured to run a computer program to perform the following steps: using a text classification model in the field of test engineering, selecting the intent category corresponding to a natural language question from multiple predefined intent categories, and obtaining the intent recognition result.

[0116] Optionally, the processor is configured to run a computer program to perform the following steps: selecting a matching query template from a template library based on the intent recognition result; populating the query template according to the entity recognition result to generate a knowledge graph query statement.

[0117] Optionally, the processor is configured to run a computer program to perform the following steps: obtain the populated prompt words by executing a knowledge graph query statement; and use a question-answering model from the test engineering domain to answer the questions based on the populated prompt words and generate a natural language answer.

[0118] Optionally, the processor is configured to run a computer program to perform the following steps: obtain the triple knowledge to be filled from the knowledge graph of the test engineering domain by executing a knowledge graph query statement; fill the triple knowledge into a preset prompt word template as known facts to obtain the filled prompt word.

[0119] According to another aspect of the present invention, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored executable program, wherein, when the executable program is executed, it controls the device where the storage medium is located to execute the natural language question-answering method described above.

[0120] Optionally, in this embodiment, the executable program can be configured to store an executable program for performing the following steps:

[0121] Step S101: Obtain the natural language question;

[0122] Step S102: Perform question entity recognition on the natural language question to obtain the entity recognition result, and perform question intent recognition on the natural language question to obtain the intent recognition result;

[0123] Step S103: Generate a knowledge graph query statement based on the entity recognition result and the intent recognition result. The knowledge graph query statement is used to query relevant knowledge of natural language questions from the knowledge graph of the test engineering field.

[0124] Step S104: Generate a natural language answer by executing a knowledge graph query statement.

[0125] Optionally, the executable program described above can be configured to store an executable program for performing the following steps: constructing a knowledge graph of the test engineering domain based on multi-source heterogeneous test data.

[0126] Optionally, the multi-source heterogeneous test data includes: structured data, semi-structured data, and unstructured data. The executable program can be configured to store an executable program for performing the following steps: constructing an ontology model based on predefined entity types, entity attributes, and entity relationships in the test engineering domain; performing data cleaning on the structured and semi-structured data, and data parsing on the unstructured data to obtain data in a unified format; extracting knowledge from the unified format data using an entity relationship extraction model to obtain triple data in the test engineering domain; and constructing a knowledge graph of the test engineering domain based on the triple data in the test engineering domain, guided by the ontology model.

[0127] Optionally, the executable program described above can be configured to store an executable program for performing the following steps: performing question encoding processing on natural language questions using an encoding model in the field of test engineering to obtain an encoding result; performing keyword weighting processing on the encoding result using an attention mechanism to obtain a weighted result; and performing entity annotation processing on the weighted result using a probabilistic graphical model to obtain an entity recognition result.

[0128] Optionally, the executable program described above can be configured to store an executable program for performing the following steps: using a text classification model in the field of test engineering, selecting the intent category corresponding to a natural language question from multiple predefined intent categories, and obtaining the intent recognition result.

[0129] Optionally, the executable program can be configured to store an executable program for performing the following steps: selecting a matching query template from the template library based on the intent recognition result; populating the query template according to the entity recognition result to generate a knowledge graph query statement.

[0130] Optionally, the executable program described above can be configured to store an executable program for performing the following steps: obtaining the filled-in prompt words by executing a knowledge graph query statement; and using a question-answering model from the test engineering domain to answer the questions based on the filled-in prompt words and generate a natural language answer.

[0131] Optionally, the executable program can be configured to store an executable program for performing the following steps: obtaining the triple knowledge to be filled from the knowledge graph of the test engineering domain by executing a knowledge graph query statement; filling the triple knowledge as known facts into a preset prompt word template to obtain the filled prompt word.

[0132] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.

[0133] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0134] In the embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The system embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection of units or modules may be electrical or other forms.

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

[0136] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0137] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0138] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A natural language question answering method, characterized in that, include: Acquire natural language questions; The natural language question is subjected to question entity recognition to obtain entity recognition results, and the natural language question is subjected to question intent recognition to obtain intent recognition results; A knowledge graph query statement is generated based on the entity recognition result and the intent recognition result, wherein the knowledge graph query statement is used to query relevant knowledge of the natural language question from the knowledge graph of the test engineering field; A natural language answer is generated by executing the knowledge graph query statement.

2. The natural language question-answering method according to claim 1, characterized in that, The natural language question answering method also includes: A knowledge graph for the test engineering domain is constructed based on multi-source heterogeneous test data.

3. The natural language question-answering method according to claim 2, characterized in that, The multi-source heterogeneous test data includes: structured data, semi-structured data, and unstructured data. Constructing a knowledge graph for the test engineering domain based on the multi-source heterogeneous test data includes: Based on the predefined entity types, entity attributes, and entity relationships in the test engineering domain, an ontology model is constructed. The structured and semi-structured data are cleaned, and the unstructured data is parsed to obtain data in a unified format. The entity relation extraction model is used to extract knowledge from the unified format data to obtain triple data in the test engineering domain; Guided by the ontology model, a knowledge graph for the test engineering domain is constructed based on the triple data of the test engineering domain.

4. The natural language question-answering method according to claim 1, characterized in that, Performing question entity recognition on the natural language question yields the following entity recognition results: The natural language question was processed by a coding model in the field of test engineering to obtain the coding result; The encoded result is weighted by keywords using an attention mechanism to obtain a weighted result. The entity recognition result is obtained by performing entity annotation processing on the weighted result using a probabilistic graphical model.

5. The natural language question-answering method according to claim 1, characterized in that, Performing question intent recognition on the natural language question yields the following intent recognition results: Using the text classification model in the aforementioned test engineering domain, the intent category corresponding to the natural language question is selected from multiple predefined intent categories to obtain the intent recognition result.

6. The natural language question-answering method according to claim 1, characterized in that, Generating the knowledge graph query statement based on the entity recognition result and the intent recognition result includes: Based on the intent recognition result, a matching query template is selected from the template library; The query template is populated based on the entity recognition results to generate the knowledge graph query statement.

7. The natural language question-answering method according to claim 1, characterized in that, By executing the knowledge graph query statement, the natural language answer is generated, including: By executing the knowledge graph query statement, the populated suggestion words are obtained; A question-answering model from the field of test engineering is used to answer the questions based on the filled-in prompts, generating the natural language answers.

8. The natural language question-answering method according to claim 7, characterized in that, By executing the knowledge graph query statement, the following suggestions are obtained after filling in the information: By executing the knowledge graph query statement, the triple knowledge to be filled is obtained from the knowledge graph of the test engineering domain; The triplet knowledge is used as known facts and filled into a preset prompt word template to obtain the filled prompt word.

9. An electronic device, characterized in that, include: Memory, which stores executable programs; A processor for running the executable program, wherein the executable program, when running, performs the natural language question answering method according to any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored executable program, wherein, when the executable program is executed, it controls the device on which the computer-readable storage medium is located to perform the natural language question-answering method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Knowledge graph query statement generation method and device, equipment and storage medium

    CN112818092A

  • Question and answer method and system based on tin smelting knowledge graph

    CN118779424A

  • Knowledge graph-based medical question answering method and apparatus, device and medium

    WO2023029512A1