A BRT maintenance question and answer method and device based on expert feedback
By employing an expert feedback-driven continuous learning and dynamic optimization approach, initial answers are generated using text classification and named entity recognition. Expert feedback is collected and parsed into knowledge update items and strategy optimization items. SHACL rule verification and LoRA technology are used for incremental fine-tuning, and the Prompt template and knowledge graph are optimized to generate optimized answers containing evidence chains. This solves the problem of lagging knowledge updates in the BRT maintenance question-and-answer system and improves the accuracy and adaptability of question answering.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- XIAMEN UNIV OF TECH
- Filing Date
- 2025-11-17
- Publication Date
- 2026-04-17
AI Technical Summary
The existing BRT maintenance Q&A system cannot dynamically absorb new knowledge, resulting in lagging knowledge updates, low accuracy of intelligent Q&A, and high maintenance costs.
By employing an expert feedback-driven continuous learning and dynamic optimization approach, initial answers are generated using text classification and named entity recognition. Expert feedback is collected and parsed into knowledge update items and strategy optimization items. SHACL rule verification and LoRA technology are used for incremental fine-tuning to optimize the Prompt template and knowledge graph, generating optimized answers containing evidence chains.
It significantly improved the accuracy, adaptability, and interpretability of BRT maintenance Q&A, enabling continuous learning and dynamic optimization driven by expert feedback.
Smart Images

Figure CN121119178B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence and transportation infrastructure operation and maintenance technology, and in particular to a BRT maintenance question-and-answer method and device based on expert feedback. Background Technology
[0002] The maintenance of BRT systems faces challenges such as fragmented storage of heterogeneous data from multiple sources, delayed knowledge updates, and low accuracy of intelligent question answering.
[0003] Existing question-answering systems based on static knowledge graphs or single-time fine-tuning cannot dynamically absorb new knowledge and struggle to adapt to complex reasoning needs. Currently, some intelligent question-answering systems rely primarily on offline-built fixed knowledge bases and pre-set question-answer templates, such as answering BRT maintenance-related questions using manually written question-answer pairs or rule bases. However, these methods cannot respond promptly to emerging maintenance scenarios, lack automatic update mechanisms, resulting in delayed knowledge updates and high maintenance costs.
[0004] How to achieve continuous learning and dynamic optimization driven by expert feedback, thereby improving the accuracy, adaptability, and interpretability of BRT maintenance Q&A, is a problem that needs to be solved by those skilled in the art. Summary of the Invention
[0005] This invention provides a BRT maintenance question-and-answer method and apparatus based on expert feedback, which can realize continuous learning and dynamic optimization driven by expert feedback, and significantly improve the accuracy, adaptability and interpretability of BRT maintenance questions and answers.
[0006] The first aspect of this invention provides a BRT maintenance Q&A method based on expert feedback, comprising:
[0007] The system obtains BRT maintenance questions input by users, identifies the question type through a text classification model, and extracts key entities through a named entity recognition model.
[0008] Relevant subgraphs are obtained by retrieving key entities from the knowledge graph, and the relevant subgraphs and BRT maintenance questions are input into the large language model to generate initial answers.
[0009] The initial answer is submitted to experts via a web form for evaluation. The expert feedback is collected and analyzed into knowledge update items and strategy optimization items.
[0010] Consistency checks based on SHACL rules are performed on the knowledge update entries to obtain qualified entries, and the qualified entries are written into the knowledge graph to obtain the updated knowledge graph.
[0011] Based on the strategy optimization items and question types, the corresponding Prompt template is dynamically optimized to obtain the optimized Prompt template;
[0012] An incremental training dataset is constructed based on knowledge update items and strategy optimization items. LoRA technology is used to incrementally fine-tune the large language model to obtain the fine-tuned large language model.
[0013] The BRT maintenance problem is reprocessed based on the updated knowledge graph, the optimized Prompt template, and the fine-tuned large language model to generate an optimized answer containing a chain of evidence.
[0014] Optionally, the initial answer can be submitted to experts for evaluation via a web form, including:
[0015] Provides a web form interface that includes entity selectors, relation selectors, attribute annotators, and free text description boxes;
[0016] Experts used a form to annotate and correct the entities, relationships, and attributes in the initial answers;
[0017] The system maps form content to standardized triples through a unified ontology schema, including mapping entity selection results to ontology concept instances, mapping relation selection results to object attribute assertions, and converting attribute annotation information into data attribute assertions.
[0018] Optionally, expert feedback is collected and parsed into knowledge update items and strategy optimization items.
[0019] Identify entity objects from expert feedback text using the BiLSTM-CRF model;
[0020] Use a BERT-based relation extraction model to identify semantic relationships between entity objects;
[0021] The text classifier is used to categorize feedback content containing entity objects and semantic relationships into knowledge update items and strategy optimization items.
[0022] Optionally, a consistency check based on SHACL rules is performed on the knowledge update entries to obtain qualified entries, including:
[0023] Load the predefined SHACL rule set for BRT maintenance domain. The rule set includes entity type constraints, relation domain value range constraints, attribute value range constraints, and business logic constraints.
[0024] Perform semantic verification on each knowledge update entry and delete entries that violate mandatory constraints;
[0025] For qualified entries that pass the verification, they are written to the Neo4j graph database in batches under the ACID transaction mechanism, and a unique version identifier is generated for each update.
[0026] Optionally, based on the strategy optimization items and question types, the corresponding Prompt template is dynamically optimized to obtain an optimized Prompt template, including:
[0027] When the question type is causal reasoning, select the chain reasoning template and insert the background knowledge of causal relationships and the reasoning steps requirements into the Prompt template;
[0028] When the question type is multi-hop retrieval, select the multi-hop inference template and explicitly specify the number of hops in the retrieval path and the type constraints of intermediate nodes in the Prompt template.
[0029] Optionally, LoRA technology can be used to incrementally fine-tune the large language model.
[0030] Low-rank adaptation matrices are inserted in parallel at the query, key-value, and feedforward network layers of the Transformer architecture;
[0031] During fine-tuning, the original pre-trained parameters are kept frozen, and the low-rank matrix parameters are updated only through the gradient descent algorithm.
[0032] Optionally, the BRT maintenance problem is reprocessed based on the updated knowledge graph, the optimized Prompt template, and the fine-tuned large language model to generate an optimized answer containing a chain of evidence.
[0033] Perform multi-hop path search in the updated knowledge graph, starting from the key entity in the BRT maintenance problem, to find all possible paths to the answer entity;
[0034] The optimal path is determined by scoring all possible paths based on path length, relation confidence, and entity importance using a weighted breadth-first search algorithm.
[0035] The optimal path is transformed into two display formats: a structured sequence of triples and a natural language description text;
[0036] The chain of evidence is integrated with the final answer in the output. The triples are kept machine-readable in the structured output, and the description is made fluent and understandable in the natural language output.
[0037] A second aspect of the present invention provides a BRT maintenance Q&A device based on expert feedback, comprising:
[0038] The problem processing unit is used to obtain BRT maintenance problems input by users, identify problem types through a text classification model, and extract key entities through a named entity recognition model.
[0039] The initial answer generation unit is used to retrieve relevant subgraphs from the knowledge graph based on key entities, and input the relevant subgraphs and BRT maintenance questions into the large language model to generate the initial answer.
[0040] The feedback processing unit is used to submit the initial answer to experts for evaluation via a web form, collect expert feedback and parse it into knowledge update items and strategy optimization items.
[0041] The knowledge graph update unit is used to perform consistency verification on knowledge update entries based on SHACL rules, obtain qualified entries, and write qualified entries into the knowledge graph to obtain the updated knowledge graph.
[0042] The template optimization unit is used to dynamically optimize the corresponding Prompt template based on the strategy optimization items and question types, so as to obtain the optimized Prompt template.
[0043] The model fine-tuning unit is used to construct an incremental training dataset based on knowledge update items and policy optimization items, and uses LoRA technology to incrementally fine-tune the large language model to obtain the fine-tuned large language model.
[0044] The answer generation unit is used to reprocess the BRT maintenance problem based on the updated knowledge graph, the optimized Prompt template, and the fine-tuned large language model, and generate the target answer containing the evidence chain.
[0045] A third aspect of the present invention provides a BRT maintenance Q&A device based on expert feedback, comprising:
[0046] One or more processors;
[0047] A memory on which one or more programs are stored;
[0048] When the one or more programs are executed by the one or more processors, the one or more processors implement the BRT maintenance Q&A method based on expert feedback as described in any of the preceding claims.
[0049] A fourth aspect of the present invention provides a computer storage medium for storing a program, which, when executed, is used to implement the BRT maintenance question-and-answer method based on expert feedback as described in any of the preceding claims.
[0050] This invention discloses a method and apparatus for BRT maintenance question answering based on expert feedback. The method first parses user questions using text classification and entity recognition technologies, generating an initial answer based on knowledge graph retrieval. Then, it collects expert feedback via a web form, parsing it into knowledge update items and strategy optimization items. Next, it updates the knowledge graph after performing SHACL rule consistency checks on the knowledge update items, dynamically optimizes the Prompt template based on the strategy optimization items, and incrementally fine-tunes the large language model using LoRA technology based on the feedback items. Finally, it generates an optimized answer containing a chain of evidence based on the optimized knowledge graph, Prompt template, and large language model. This invention, through expert feedback-driven system continuous optimization, significantly improves the accuracy, adaptability, and interpretability of BRT maintenance question answering. Attached Figure Description
[0051] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0052] Figure 1 A flowchart illustrating a BRT maintenance Q&A method based on expert feedback, provided for an embodiment of the present invention;
[0053] Figure 2 A flowchart illustrating an expert feedback collection and analysis method provided in an embodiment of the present invention;
[0054] Figure 3 A flowchart illustrating a knowledge graph updating and consistency verification method provided in an embodiment of the present invention;
[0055] Figure 4 A schematic diagram of a Prompt template adaptive generation strategy tree provided in an embodiment of the present invention;
[0056] Figure 5 A flowchart illustrating a LoRA incremental fine-tuning method for a large language model provided in an embodiment of the present invention;
[0057] Figure 6 A schematic diagram illustrating the process of answer generation and evidence chain output provided in an embodiment of the present invention;
[0058] Figure 7 A schematic diagram of a BRT maintenance Q&A device based on expert feedback provided in an embodiment of the present invention;
[0059] Figure 8This is a schematic diagram of a BRT maintenance Q&A device based on expert feedback, provided as an embodiment of the present invention. Detailed Implementation
[0060] This invention provides a BRT maintenance question-and-answer method and apparatus based on expert feedback, which can realize continuous learning and dynamic optimization driven by expert feedback, and significantly improve the accuracy, adaptability and interpretability of BRT maintenance questions and answers.
[0061] See Figure 1 This figure is a flowchart illustrating a BRT maintenance Q&A method based on expert feedback provided in an embodiment of the present invention. The BRT maintenance Q&A method based on expert feedback provided in this embodiment of the present invention can be implemented, for example, through the following steps S101-107.
[0062] S101: Obtain BRT maintenance questions input by the user, identify the question type through a text classification model, and extract key entities through a named entity recognition model.
[0063] In this embodiment of the invention, a BRT maintenance problem is received from the user's natural language input, a text classification model based on a convolutional neural network is invoked to determine the problem type, and a BiLSTM-CRF named entity recognition model is used to extract the key entities involved.
[0064] S102: Based on key entities, retrieve relevant subgraphs from the knowledge graph, and input the relevant subgraphs and BRT maintenance questions into the large language model to generate initial answers.
[0065] In this embodiment of the invention, a SPARQL query is executed in the Neo4j knowledge graph to retrieve the subgraph related to the question, and the retrieval results are obtained. The retrieval results and the question input are fed into the large language model, and an initial answer is generated under the guidance of the preset Prompt template in the strategy library.
[0066] S103: Submit the initial answer to experts via a web form for evaluation, collect expert feedback, and parse it into knowledge update items and strategy optimization items.
[0067] In this embodiment of the invention, a web form interface is provided, including an entity selector, a relation selector, an attribute annotator, and a free text description box. Experts annotate and correct entities, relations, and attributes in their initial answers using the form. The system maps form content to standardized triples using a unified ontology schema, including mapping entity selection results to ontology concept instances, relation selection results to object attribute assertions, and attribute annotation information to data attribute assertions. A BiLSTM-CRF model is used to identify entity objects from expert feedback text; a BERT-based relation extraction model is used to identify semantic relationships between entity objects; and a text classifier is used to classify feedback content containing entity objects and semantic relationships into knowledge update items and strategy optimization items.
[0068] Specifically, Figure 2 Flowchart for expert feedback collection and analysis. Figure 2 The example illustrates the process of collecting and parsing expert feedback. Experts submit feedback via a web form, which includes fields for entity selection, relation selection, attribute annotations, and free text descriptions. The system first maps the form content to a standardized ontology representation. Then, it uses a BiLSTM-CRF model for entity recognition, a BERT relation extraction model to extract relationships between entities, and a text classifier to analyze the free text. The feedback is categorized into "knowledge updates" and "strategy optimizations," and structured entries are output. Finally, structured knowledge update entries and strategy optimization entries are generated as output.
[0069] During the parsing process, structured fields from the form (such as entity and relation selection results, attribute annotations) and free text descriptions provided by experts are processed together. After mapping the complete information from the form using a unified ontology schema, entities are extracted using a BiLSTM-CRF model, relationships between entities are identified using a BERT model, and the free text descriptions are analyzed using a text classifier. The feedback content is then divided into knowledge update items and strategy optimization items. Knowledge update items typically include newly added or modified entity, relation, or attribute information, while strategy optimization items include suggestions for the Prompt template or answer strategy. The final generated structured items, known as "feedback items" from the experts, will be used for subsequent knowledge graph updates, Prompt template optimization, and model fine-tuning. Feedback items include knowledge update items (newly added or modified entity, relation, and attribute triples), strategy optimization items (suggestions for modifying the Prompt template, answer strategy, and output format), and correct text answers (used to correct system output).
[0070] S104: Perform consistency verification on the knowledge update entries based on SHACL rules to obtain qualified entries, and write the qualified entries into the knowledge graph to obtain the updated knowledge graph.
[0071] In this embodiment of the invention, a predefined SHACL rule set for BRT maintenance domain is loaded. The rule set includes entity type constraints, relation domain value range constraints, attribute value range constraints, and business logic constraints. Semantic verification is performed on each knowledge update entry, and entries that violate mandatory constraints are deleted. For qualified entries that pass the verification, they are written to the Neo4j graph database in batches under the ACID transaction mechanism, and a unique version identifier is generated for each update.
[0072] Specifically, Figure 3 This is a schematic diagram of knowledge graph updates and consistency checks. Figure 3 This demonstrates the consistency verification and update process of a knowledge graph based on SHACL rules. New knowledge entries are first sent to the SHACL rule engine for verification, checking whether each entry conforms to the constraints defined in the domain ontology. For entries that conform to the rules, they are written to the Neo4j knowledge graph under ACID transactions and a new version number is generated; entries that violate the rules are marked as unqualified and discarded. Furthermore, if multiple entries conflict about the same knowledge (e.g., the same entity has different values), a weighted vote is performed based on the confidence scores of each entry, and the fact with the highest confidence score is ultimately retained and written to the database.
[0073] The SHACL rule engine performs consistency checks on newly added knowledge, rejecting invalid entries directly. A predefined domain ontology SHACL rule set is loaded, and semantic verification is performed on each new triple. For example, in a BRT maintenance scenario, rules can be defined to constrain the attributes or relationships required for specific entity types, such as requiring the "road segment" entity to contain the "maintenance status" attribute, or requiring the target entity type of the "road segment - crack type" relationship to appear in the ontology definition. Entries violating these constraints are marked as invalid and discarded; valid entries are written to the Neo4j database under a transaction mechanism, generating a new version number and archiving it to identify the updated version of the knowledge graph data. The generated new version number uniquely identifies each knowledge graph update operation for tracking and managing different versions of data. Conflicting entries are adjudicated using a confidence-weighted voting mechanism, retaining the high-confidence facts. "Conflicting entries" refer to entries generated in the feedback that contradict the same knowledge point in the existing knowledge graph. The system evaluates the confidence level of each conflicting entry, taking into account factors such as the historical accuracy of the feedback experts, the consistency between the entry and the existing knowledge base, and the confidence level of the large language model that generated the entry. Finally, a weighted vote is used to determine the fact entry with the highest confidence level to be retained and written into the database.
[0074] S105: Based on the strategy optimization items and the question type, dynamically optimize the corresponding Prompt template to obtain the optimized Prompt template.
[0075] In this embodiment of the invention, when the question type is causal reasoning, a chain reasoning template is selected, and background knowledge of causal relationships and reasoning step requirements are inserted into the Prompt template; when the question type is multi-hop retrieval, a multi-hop reasoning template is selected, and the number of hops of the retrieval path and the type constraints of intermediate nodes are explicitly specified in the Prompt template.
[0076] Specifically, Figure 4 A schematic diagram of adaptive strategy tree generation for Prompt template. Figure 4 The diagram illustrates the strategy tree structure of Prompt template management and its adaptive update mechanism. The strategy tree branches according to question type: chain-based reasoning templates are selected for causal reasoning or step-by-step decomposition questions, while multi-hop reasoning templates are selected for multi-hop retrieval questions. Template nodes are stored in the database, containing question type judgment conditions and corresponding preset Prompt templates. When the system identifies new knowledge updates or strategy optimization needs, it automatically modifies the template content of the corresponding nodes, such as inserting new prompts, supplementing domain background information, or adjusting the answer output format, thus achieving dynamic optimization of the Prompt templates.
[0077] A strategy tree-based template management method is adopted. For questions involving causal reasoning or step-by-step decomposition, a chain-based reasoning template is used; for multi-hop retrieval questions, a multi-hop reasoning template is used. When a template is updated, knowledge update entries are automatically inserted, and answer formatting instructions are added. During implementation, the Prompt template library is stored using a strategy tree structure and can reside in a Neo4j database or an external configuration system. When new strategy optimization entries or knowledge update requirements are detected, the corresponding template nodes are automatically modified, such as inserting prompts for new entities or relationships, or expanding the template's background information. For answer formatting instructions, predefined formatting requirements are used, such as output language style and level of detail. These instructions can be pre-defined by domain experts and stored in the template library, or automatically generated by the system according to domain specifications to ensure consistency and readability of the answer style.
[0078] S106: Construct an incremental training dataset based on knowledge update items and policy optimization items, and use LoRA technology to incrementally fine-tune the large language model to obtain the fine-tuned large language model.
[0079] In this embodiment of the invention, low-rank adaptation matrices are inserted in parallel into the query, key-value, and feedforward network layers of the Transformer architecture; during fine-tuning, the original pre-trained parameters are kept frozen, and the low-rank matrix parameters are updated only through the gradient descent algorithm.
[0080] Specifically, Figure 5 This is a diagram of the LoRA incremental fine-tuning structure for a large language model. Figure 5 A schematic diagram of the structure for incremental fine-tuning of a large language model based on LoRA technology is given. The Transformer layers of the original pre-trained model are kept frozen, with only a low-rank adaptation module (LoRA layer) inserted in each layer. During fine-tuning, only the low-rank matrix parameters within the LoRA layer are updated, such as... Figure 5 As shown, other parameters remain unchanged. By backpropagating to the new training samples, optimization is applied only to these additional adaptation matrices, thus enabling incremental training of the model under conditions of limited GPU memory and computing resources.
[0081] An incremental training dataset is constructed based on feedback entries, and the LoRA module is used to fine-tune the model. A low-rank matrix is introduced into each Transformer layer; only the matrix parameters are updated, freezing the original weights to reduce computational overhead and avoid catastrophic forgetting. The incremental training dataset consists of knowledge update entries parsed from expert feedback and their reference answer pairs. LoRA is used to fine-tune the model using these new samples. Keeping the original model weights frozen during fine-tuning avoids catastrophic forgetting and significantly reduces memory and computational overhead. During fine-tuning, the system only updates the parameters of these low-rank matrices, for example, by adjusting parameter values based on the loss gradient of the incremental data using the Adam optimizer; other original weights remain unchanged.
[0082] In this embodiment of the invention, the rank r of the LoRA low-rank matrix can be set to 8, and the scaling factor α can be set to 16, thereby controlling the capacity and learning rate of the incremental adaptation layer. The specific values of the rank r and scaling factor α of the LoRA low-rank matrix are set according to actual needs, and this embodiment of the invention does not impose specific limitations.
[0083] S107: Based on the updated knowledge graph, the optimized Prompt template, and the fine-tuned large language model, the BRT maintenance problem is reprocessed to generate an optimized answer containing a chain of evidence.
[0084] In this embodiment of the invention, a multi-hop path search is performed in the updated knowledge graph. Starting from the key entity in the BRT maintenance problem, all possible paths to the answer entity are found. A weighted breadth-first search algorithm is used to score all possible paths based on path length, relation confidence, and entity importance to determine the optimal path. The optimal path is then transformed into two display formats: a structured triple sequence and a natural language description text. The evidence chain is fused with the final answer for output. The machine readability of the triples is maintained in the structured output, while the fluency and comprehensibility of the description are ensured in the natural language output.
[0085] Specifically, Figure 6This is a diagram illustrating the generation of the answer and the output of the evidence chain. Figure 6 This demonstrates the process of generating the final answer and outputting the chain of evidence. First, a multi-hop path search is performed using the updated knowledge graph to find the shortest path from the question entity to the answer entity. Then, the retrieved subgraph and Prompt template are input into a finely tuned large language model to generate the answer, which includes an interpretable chain of evidence based on the path. The output describes this path as a sequence of structured triples and their corresponding natural language representation, providing users with intuitive evidence for the answer.
[0086] The system uses a graph traversal algorithm to search for the shortest path from the question entity to the answer entity, outputting the entities and relations along the path as an evidence chain, which is then appended to the answer. The generated evidence chain output includes a sequence of structured triples and corresponding natural language descriptions. The system converts the path from the question entity to the answer entity into a readable text description, outlining the entity relationships and reasoning logic along the chain. For example, for each triple in the path, the system can generate a statement like "Entity A is connected to entity B through relation R," allowing users to intuitively understand the reasoning behind the answer.
[0087] This invention proposes a BRT maintenance question-and-answer method based on expert feedback. The method collects structured and unstructured feedback from experts on the question-and-answer results via a web form. Named entity recognition, relation extraction, and text classification algorithms are used to parse the feedback into structured knowledge update items and strategy optimization items. A consistency verification mechanism based on SHACL rules is employed to semantically verify newly added entities and relations in the knowledge graph, and these are written to the Neo4j database under a transaction mechanism. Conflicting items are adjudicated through a confidence-weighted voting mechanism. A dynamic prompt generation method based on a policy tree is used, selecting either a chain-like reasoning template or a multi-hop reasoning template according to the question type and automatically supplementing domain background information and answer format requirements. LoRA (Low-Rank Adaptation) technology is used for incremental fine-tuning of the large language model, updating only the low-rank parameter matrix to maintain model stability and reduce training overhead. In the answer generation stage, the system performs multi-hop path search based on the knowledge graph, extracting the relational paths from question entities to answer entities and appending them to the output, forming an interpretable chain of evidence. This invention achieves continuous learning and dynamic optimization driven by expert feedback, significantly improving the accuracy, adaptability, and interpretability of BRT maintenance question-and-answer.
[0088] Now combined Figure 1 For example, let's take the maintenance of a BRT line section in a certain city as an example. Suppose a user asks, "Cracks have appeared in the asphalt pavement of section 105. What maintenance measures should be taken?"
[0089] Step S1: Classify the input problem, identify it as a structural pathogenesis analysis problem, and use the named entity recognition model to extract "Road Section 105" and "Asphalt Pavement" as key entities.
[0090] Step S2: Execute a SPARQL query in the Neo4j knowledge graph to retrieve subgraphs related to pavement crack repair. Set the query timeout to 10 seconds to ensure timely response. Input the search results and the question into the large language model and use the Prompt template of chain reasoning to generate an initial answer, such as "For the crack problem of section 105, hot-mix asphalt can be used for repair".
[0091] Step S3: The domain expert provides feedback on the answer via a web form. In the form, the expert selects the entity "temperature crack," the relation "exists crack type," and notes the attribute "repair method = hot-mix asphalt overlay." Simultaneously, in the free text, the expert explains, "Note the difference between the treatment methods for temperature cracks and ruts." The feedback is parsed, mapping the structured fields and text information of the form to standardized ontology triples. The BiLSTM-CRF model identifies the newly added entity "temperature crack," the BERT model extracts the relation (Road Segment 105, exists crack type, temperature crack), and the text classifier categorizes this feedback as a knowledge update item.
[0092] Step S4: Load SHACL rules to validate the newly added triples. Rules can be set such that "temperature crack" must conform to the crack ontology definition. If the validation passes, the triple is written to the knowledge graph under a transaction and a new version number (e.g., V2) is generated, indicating that the knowledge base has been updated.
[0093] Step S5: After discovering new knowledge, update the Prompt template, automatically insert background information related to "temperature cracks" into the causal reasoning template, and retain the original answer format description.
[0094] Step S6: Construct incremental training samples based on feedback. For example, pair the question "Repair methods for cracks in section 105" with the correct answers recommended by experts, and fine-tune the large language model using the LoRA module, where the rank of the low-rank matrix r=8 and α=16. The original model weights remain frozen, and only the parameters of the LoRA adaptation layer are updated. After fine-tuning, the model can more accurately identify and answer similar crack repair questions.
[0095] Step S7: Perform a SPARQL multi-hop search again. The relationship path from "Road Segment 105" to "Hot Mix Asphalt Cover" is retrieved and added as a chain of evidence to the final answer. The final output includes a readable reasoning description (e.g., "Road Segment 105 is connected to temperature cracks through the relationship of crack type, and connected to hot mix asphalt cover through the relationship of repair method") and a corresponding list of structured triples, improving the interpretability of the answer.
[0096] Based on the methods provided in the above embodiments, this invention also provides a BRT maintenance Q&A device based on expert feedback. The following describes the BRT maintenance Q&A device based on expert feedback in conjunction with the accompanying drawings.
[0097] See Figure 7 The figure is a schematic diagram of a BRT maintenance Q&A device based on expert feedback provided in an embodiment of the present invention.
[0098] The BRT maintenance question-and-answer device 700 based on expert feedback provided in this embodiment of the invention includes: a question processing unit 701, an initial answer generation unit 702, a feedback processing unit 703, a knowledge graph updating unit 704, a template optimization unit 705, a model fine-tuning unit 706, and an answer generation unit 707.
[0099] Problem processing unit 701 is used to acquire BRT maintenance problems input by users, identify problem types through a text classification model, and extract key entities through a named entity recognition model.
[0100] The initial answer generation unit 702 is used to retrieve relevant subgraphs from the knowledge graph based on key entities, and input the relevant subgraphs and BRT maintenance questions into the large language model to generate the initial answer;
[0101] The feedback processing unit 703 is used to submit the initial answer to experts for evaluation via a web form, collect expert feedback and parse it into knowledge update items and strategy optimization items.
[0102] The knowledge graph update unit 704 is used to perform consistency verification on knowledge update entries based on SHACL rules, obtain qualified entries, and write the qualified entries into the knowledge graph to obtain the updated knowledge graph.
[0103] The template optimization unit 705 is used to dynamically optimize the corresponding Prompt template according to the strategy optimization items and question types, so as to obtain the optimized Prompt template.
[0104] Model fine-tuning unit 706 is used to construct an incremental training dataset based on knowledge update items and policy optimization items, and to use LoRA technology to incrementally fine-tune the large language model to obtain the fine-tuned large language model.
[0105] Answer generation unit 707 is used to reprocess the BRT maintenance problem based on the updated knowledge graph, the optimized Prompt template, and the fine-tuned large language model, and generate a target answer containing a chain of evidence.
[0106] In one possible implementation, the feedback processing unit 703 is specifically used for:
[0107] Provides a web form interface that includes entity selectors, relation selectors, attribute annotators, and free text description boxes;
[0108] Experts used a form to annotate and correct the entities, relationships, and attributes in the initial answers;
[0109] The system maps form content to standardized triples through a unified ontology schema, including mapping entity selection results to ontology concept instances, mapping relation selection results to object attribute assertions, and converting attribute annotation information into data attribute assertions.
[0110] In one possible implementation, the feedback processing unit 703 is specifically used for:
[0111] Identify entity objects from expert feedback text using the BiLSTM-CRF model;
[0112] Use a BERT-based relation extraction model to identify semantic relationships between entity objects;
[0113] The text classifier was used to categorize feedback content containing entity objects and semantic relationships into knowledge update items and strategy optimization items.
[0114] In one possible implementation, the knowledge graph update unit 704 is specifically used for:
[0115] Load the predefined SHACL rule set for BRT maintenance domain. The rule set includes entity type constraints, relation domain value range constraints, attribute value range constraints, and business logic constraints.
[0116] Perform semantic verification on each knowledge update entry and delete entries that violate mandatory constraints;
[0117] For qualified entries that pass the verification, they are written to the Neo4j graph database in batches under the ACID transaction mechanism, and a unique version identifier is generated for each update.
[0118] In one possible implementation, the template optimization unit 705 has the following functions:
[0119] When the question type is causal reasoning, select the chain reasoning template and insert the background knowledge of causal relationships and the reasoning steps requirements into the Prompt template;
[0120] When the question type is multi-hop retrieval, select the multi-hop inference template and explicitly specify the number of hops in the retrieval path and the type constraints of intermediate nodes in the Prompt template.
[0121] In one possible implementation, the model fine-tuning unit 706 has the following functions:
[0122] Low-rank adaptation matrices are inserted in parallel at the query, key-value, and feedforward network layers of the Transformer architecture;
[0123] During fine-tuning, the original pre-trained parameters are kept frozen, and the low-rank matrix parameters are updated only through the gradient descent algorithm.
[0124] In one possible implementation, the answer generation unit 707 has the following functions:
[0125] Perform multi-hop path search in the updated knowledge graph, starting from the key entity in the BRT maintenance problem, to find all possible paths to the answer entity;
[0126] The optimal path is determined by scoring all possible paths based on path length, relation confidence, and entity importance using a weighted breadth-first search algorithm.
[0127] The optimal path is transformed into two display formats: a structured sequence of triples and a natural language description text;
[0128] The chain of evidence is integrated with the final answer in the output. The triples are kept machine-readable in the structured output, and the description is made fluent and understandable in the natural language output.
[0129] Since the BRT maintenance Q&A device 700 based on expert feedback is a device corresponding to the BRT maintenance Q&A method based on expert feedback provided in the above method embodiments, the specific implementation of each unit of the BRT maintenance Q&A device 700 based on expert feedback is based on the same concept as in the above method embodiments. Therefore, for the specific implementation of each unit of the BRT maintenance Q&A device 700 based on expert feedback, please refer to the description of the BRT maintenance Q&A method based on expert feedback in the above method embodiments, and it will not be repeated here.
[0130] This invention also provides a BRT maintenance Q&A device based on expert feedback, the device comprising: a processor and a memory;
[0131] The memory is used to store instructions;
[0132] The processor is configured to execute the instructions in the memory and perform the BRT maintenance Q&A method based on expert feedback mentioned in the above embodiments.
[0133] It should be noted that the hardware structure of the BRT maintenance Q&A device based on expert feedback provided in the embodiments of the present invention can be as follows: Figure 8 The structure shown, Figure 8 This is a schematic diagram of a BRT maintenance Q&A device based on expert feedback, provided as an embodiment of the present invention.
[0134] Please see Figure 8 As shown, device 800 includes: a processor 810, a communication interface 820, and a memory 830. The number of processors 810 in device 800 can be one or more. Figure 8 Taking a processor as an example, in this embodiment of the invention, the processor 810, communication interface 820, and memory 830 can be connected via a bus system or other means. Figure 8 Taking the connection between China and Israel via the 840 bus system as an example.
[0135] Processor 810 may be a central processing unit (CPU), a network processor (NP), or a combination of a CPU and an NP. Processor 810 may further include hardware chips. These hardware chips may be application-specific integrated circuits (ASICs), programmable logic devices (PLDs), or combinations thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), generic array logic (GAL), or any combination thereof.
[0136] The memory 830 may include volatile memory, such as random-access memory (RAM); the memory 830 may also include non-volatile memory, such as flash memory, hard disk drive (HDD) or solid-state drive (SSD); the memory 830 may also include a combination of the above types of memory.
[0137] Optionally, the memory 830 stores an operating system and programs, executable modules, or data structures, or subsets thereof, or extended sets thereof. The programs may include various operation instructions for implementing various operations. The operating system may include various system programs for implementing various basic services and handling hardware-based tasks. The processor 810 can read the programs in the memory 830 to implement the BRT maintenance question-and-answer method based on expert feedback provided in this embodiment of the invention.
[0138] The bus system 840 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus system 840 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 8 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0139] This invention also provides a computer-readable storage medium including instructions that, when executed on a computer, cause the computer to perform the BRT maintenance question-and-answer method based on expert feedback mentioned in the above embodiments.
[0140] This invention also provides a computer program product containing instructions that, when run on a computer, causes the computer to execute the BRT maintenance Q&A method based on expert feedback mentioned in the above embodiments.
[0141] Although the invention has been specifically shown and described in conjunction with preferred embodiments, those skilled in the art should understand that various changes in form and detail may be made to the invention without departing from the spirit and scope of the invention as defined in the appended claims, all of which shall be within the scope of protection of the invention.
Claims
1. A BRT maintenance question and answer method based on expert feedback, characterized by, The method includes: The system obtains BRT maintenance questions input by users, identifies the question type through a text classification model, and extracts key entities through a named entity recognition model. Based on the key entities, relevant subgraphs are retrieved from the knowledge graph, and the relevant subgraphs and the BRT maintenance problem are input into a large language model to generate an initial answer. The initial answer is submitted to experts for evaluation through a web form containing entity selectors, relation selectors, attribute annotators, and free text description boxes. Expert feedback is collected, and entity objects are identified through the BiLSTM-CRF model and semantic relations are identified through the BERT-based relation extraction model. Finally, the results are parsed into knowledge update items and strategy optimization items. Load the predefined BRT maintenance domain SHACL rule set, which includes entity type constraints, relation domain value range constraints, attribute value range constraints, and business logic constraints; perform semantic verification on each knowledge update entry and delete entries that violate mandatory constraints; for qualified entries that pass the verification, write them in batches to the Neo4j graph database under the ACID transaction mechanism, and generate a unique version identifier for each update to obtain the updated knowledge graph; Based on the strategy optimization items and the question type, the corresponding Prompt template is dynamically optimized to obtain the optimized Prompt template; An incremental training dataset is constructed based on the knowledge update items and the policy optimization items. The LoRA technique is used to incrementally fine-tune the large language model to obtain the fine-tuned large language model. Based on the updated knowledge graph, the optimized Prompt template, and the fine-tuned large language model, the BRT maintenance problem is reprocessed to generate an optimized answer containing a chain of evidence.
2. The method of claim 1, wherein, The process of submitting the initial answer to experts for evaluation via a web form that includes entity selectors, relation selectors, attribute annotators, and free text description boxes includes: Experts used the form to annotate and correct the entities, relationships, and attributes in the initial answers; The system maps form content to standardized triples through a unified ontology schema, including mapping entity selection results to ontology concept instances, mapping relation selection results to object attribute assertions, and converting attribute annotation information into data attribute assertions.
3. The method according to claim 1, characterized in that, The parsing is divided into knowledge update items and strategy optimization items, including: The feedback content containing the entity objects and semantic relationships is classified into knowledge update items and strategy optimization items using a text classifier.
4. The method according to claim 1, characterized in that, The step of dynamically optimizing the corresponding Prompt template based on the strategy optimization items and the question type to obtain the optimized Prompt template includes: When the question type is causal reasoning, select the chain reasoning template and insert the background knowledge of causal relationships and the reasoning steps requirements into the Prompt template; When the problem type is a multi-hop retrieval type, select the multi-hop inference template and explicitly specify the number of hops in the retrieval path and the type constraints of intermediate nodes in the Prompt template.
5. The method according to claim 1, characterized in that, The incremental fine-tuning of the large language model using LoRA technology includes: Low-rank adaptation matrices are inserted in parallel at the query, key-value, and feedforward network layers of the Transformer architecture; During fine-tuning, the original pre-trained parameters are kept frozen, and the low-rank adaptation matrix parameters are updated only using the gradient descent algorithm.
6. The method according to claim 1, characterized in that, The process of reprocessing the BRT maintenance problem based on the updated knowledge graph, the optimized Prompt template, and the fine-tuned large language model to generate an optimized answer containing a chain of evidence includes: Perform a multi-hop path search in the updated knowledge graph, starting from the key entity in the BRT maintenance problem, to find all possible paths to the answer entity; The optimal path is determined by scoring all possible paths using a weighted breadth-first search algorithm based on path length, relation confidence, and entity importance. The optimal path is transformed into two display formats: a structured triple sequence and a natural language description text; The chain of evidence is integrated with the final answer in the output. The triples are kept machine-readable in the structured output, and the description is made fluent and understandable in the natural language output.
7. A BRT maintenance Q&A device based on expert feedback, characterized in that, The device includes: The problem processing unit is used to obtain BRT maintenance problems input by users, identify problem types through a text classification model, and extract key entities through a named entity recognition model. The initial answer generation unit is used to retrieve relevant subgraphs from the knowledge graph based on the key entities, and input the relevant subgraphs and the BRT maintenance problem into the large language model to generate an initial answer; The feedback processing unit is used to submit the initial answer to experts for evaluation through a web form containing entity selectors, relation selectors, attribute annotators and free text description boxes, collect expert feedback, identify entity objects through the BiLSTM-CRF model, identify semantic relations through the BERT-based relation extraction model, and finally parse it into knowledge update items and strategy optimization items. The knowledge graph update unit is used to load a predefined SHACL rule set for the BRT maintenance domain. The rule set includes entity type constraints, relation domain value range constraints, attribute value range constraints, and business logic constraints. Semantic verification is performed on each knowledge update entry, and entries that violate mandatory constraints are deleted. For qualified entries that pass the verification, they are written to the Neo4j graph database in batches under the ACID transaction mechanism, and a unique version identifier is generated for each update to obtain the updated knowledge graph. The template optimization unit is used to dynamically optimize the corresponding Prompt template according to the strategy optimization items and the question type, so as to obtain the optimized Prompt template. The model fine-tuning unit is used to construct an incremental training dataset based on the knowledge update items and the policy optimization items, and to perform incremental fine-tuning on the large language model using LoRA technology to obtain the fine-tuned large language model. The answer generation unit is used to reprocess the BRT maintenance problem based on the updated knowledge graph, the optimized Prompt template, and the fine-tuned large language model to generate a target answer containing a chain of evidence.
8. A BRT maintenance Q&A device based on expert feedback, characterized in that, The device includes: a processor and a memory; The memory is used to store instructions; The processor is configured to execute the instructions in the memory to perform the method according to any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, Including instructions that, when run on a computer, cause the computer to perform the method described in any one of claims 1-6 above.
Citation Information
Patent Citations
Intelligent question and answer method based on knowledge graph
CN120297415A