Knowledge question-answering method, device and equipment based on fire-fighting equipment and storage medium
By hierarchically splitting and vectorizing the storage of the firefighting equipment knowledge base, combined with preset question templates and a large language model, efficient and accurate retrieval and question-answering of firefighting equipment knowledge are achieved, solving the problems of information silos and low answer accuracy in traditional systems, and improving the accuracy and efficiency of professional question-answering.
Patent Information
- Application Number
- CN202510870611.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-26
- Publication Date
- 2025-10-10
AI Technical Summary
Traditional firefighting equipment knowledge retrieval systems have an information island effect and are unable to achieve cross-document knowledge integration. In addition, the question-answering system based on the rule engine has a low accuracy rate when answering professional questions, making it difficult to meet the complex query needs in the firefighting field.
The firefighting equipment knowledge base is hierarchically split into parent document blocks and child document blocks, and vectorized storage is performed. User inquiries are converted using preset question templates, and answers are generated through a large language model. The hierarchical vector library is used to accurately locate relevant document blocks, generate structured questions, and perform optimization.
It significantly improves the accuracy and efficiency of knowledge retrieval in the field of fire-fighting equipment, solves the problems of missing semantic associations and terminology processing, and provides complete and logically structured professional questions and answers.
Smart Images

Figure CN120764679A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data analysis, and in particular to a knowledge question and answer method and device based on fire-fighting equipment, equipment and a storage medium. BACKGROUND
[0002] With the acceleration of digital transformation and intelligent upgrading of the fire-fighting industry, the fire-fighting equipment field presents the characteristics of fast technology iteration, multiple product types, and complex knowledge system. The current fire-fighting equipment is diversified, and hundreds of new equipment are added every year. The technical documents derived from product standards, usage specifications, and maintenance guidelines have increased significantly. In actual application scenarios such as emergency rescue, facility maintenance, and safety training, there are multiple challenges in knowledge acquisition. First, traditional keyword search technology is limited by the information silo effect and cannot integrate cross-document knowledge based on semantic association, resulting in long search time. Second, traditional question and answer systems based on rule engines are difficult to handle complex queries and have low accuracy in handling professional problems. To address the above problems, although a large model can be used based on its strong natural language processing capabilities to perform corresponding question and answer, the knowledge transfer in the fire-fighting field faces technical problems such as incomplete domain ontology construction, lack of professional corpus, and difficulty in multi-modal data fusion, making it difficult to achieve accurate retrieval and deep interaction of fire-fighting equipment knowledge. SUMMARY
[0003] The purpose of the embodiments of the present application is to provide a knowledge question and answer method, device, equipment and storage medium based on fire-fighting equipment to solve the above technical problems.
[0004] The present application provides a knowledge question and answer method based on fire-fighting equipment, which comprises: acquiring a fire-fighting equipment knowledge base, and splitting the fire-fighting equipment knowledge base in layers to obtain a plurality of parent document blocks and child document blocks, and storing the plurality of parent document blocks and child document blocks in vectors to obtain a document vector library; receiving an initial inquiry question, and converting the initial inquiry question based on a first preset question template to obtain a to-be-processed question, the first preset question template including a fire-fighting equipment field professional term library and a preset standardized question expression structure; determining a target parent document block and a target child document block in the document vector library according to the to-be-processed question, and generating a target question according to the to-be-processed question, the target parent document block and the target child document block, to input the target question into a preset large language model to obtain a fire-fighting equipment knowledge answer.
[0005] In one embodiment of the present application, the fire-fighting equipment knowledge base is split into layers to obtain multiple parent document blocks and child document blocks, including: dividing the original document in the fire-fighting equipment knowledge base according to a first preset length to generate parent document blocks, and configuring a unique label for each parent document block; cutting each parent document block according to a second preset length to generate multiple child document blocks corresponding to each parent document block, and adding child document metadata to each child document block, wherein the child document metadata includes the unique label of the corresponding parent document block, the position index of the parent document block in the original document, and the paragraph sequence identifier of the child document block in the parent document block to which it belongs.
[0006] In one embodiment of the present application, vectorized storage is performed on multiple parent document blocks and child document blocks to obtain a document vector library, including: performing multimodal vector conversion on each parent document block to obtain a parent document block vector, and storing each parent document block vector to obtain a parent document vector library; performing multimodal vector conversion on each child document block to obtain a child document block vector, and associating and storing each child document block vector based on child document metadata to obtain a child document vector library; and determining the parent document vector library and the child document vector library as a document vector library.
[0007] In one embodiment of the present application, determining the target parent document block and the target child document block in the document vector library according to the problem to be processed includes: vectorizing the problem to be processed to obtain a problem vector to be processed; determining a preset number of child document block vectors with the highest similarity to the problem vector to be processed in the child document vector library in the document vector library, and determining the preset number of child document block vectors with the highest similarity as target child document blocks; extracting the corresponding parent document block from the parent document vector library according to the child document metadata of the target child document block, and deduplicating the extracted parent document block to obtain the target parent document block.
[0008] In one embodiment of the present application, generating a target question based on the pending question, target parent document block and target child document block includes: embedding the pending question, target parent document block and target child document block into a second preset question template to generate the target question, and the second preset question template includes fire equipment answer generation instructions and preset structured output specifications.
[0009] In one embodiment of the present application, before obtaining the fire-fighting equipment knowledge base, the fire-fighting equipment-based knowledge question and answer method also includes: obtaining fire-fighting equipment product manuals, technical specifications and use case documents; deduplicating the fire-fighting equipment product manuals, technical specifications and use case documents to obtain target fire-fighting equipment content; converting the target fire-fighting equipment content into a target electronic format to obtain a target electronic document set, and encoding and converting the target electronic document set and performing structured storage to obtain a fire-fighting equipment knowledge base.
[0010] In one embodiment of the present application, after the target question is input into the preset large language model to obtain a fire equipment knowledge answer, the fire equipment-based knowledge question and answer method further includes: obtaining historical fire equipment knowledge question and answer pairs within a target period, and constructing an optimized data set based on the historical fire equipment knowledge question and answer pairs, wherein the historical fire equipment knowledge question and answer pairs are obtained by collecting the target question within the target period and inputting the preset large language model to obtain a fire equipment knowledge answer; extracting the entity relationship and parameter constraint rules of the fire equipment in the optimized data set to obtain a target domain knowledge feature matrix, and calculating the parameter gradient offset of the preset large language model based on the target domain knowledge feature matrix to adjust the weight distribution of the fully connected layer in the preset large language model through the parameter gradient offset; constructing multiple sets of new first preset question templates and second preset question template combinations, and testing the multiple sets of new first preset question templates and second preset question template combinations according to the initial query questions in the optimized data set, recording the generated answers of each new set of first preset question templates and second preset question template combinations and comparing them with the optimized data set to determine the optimized first preset question template and second preset question template combination based on the comparison results.
[0011] An embodiment of the present application also provides a knowledge question and answer device based on fire-fighting equipment, which includes: a knowledge base decomposition module, which is used to obtain a fire-fighting equipment knowledge base and split the fire-fighting equipment knowledge base into layers to obtain multiple parent document blocks and child document blocks, and vectorize and store the multiple parent document blocks and child document blocks to obtain a document vector library; a question conversion and determination module, which is used to receive an initial inquiry question and convert the initial inquiry question based on a first preset question template to obtain a question to be processed, wherein the first preset question template includes a professional terminology library in the field of fire-fighting equipment and a preset standardized question expression structure; according to the question to be processed, a target parent document block and a target child document block are determined in the document vector library, and a target question is generated according to the question to be processed, the target parent document block and the target child document block; a target question question and answer module, which is used to input the target question into a preset large language model to obtain a knowledge answer about fire-fighting equipment.
[0012] An embodiment of the present application also provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the electronic device implements the knowledge question and answer method based on fire-fighting equipment as described in any one of the above embodiments.
[0013] An embodiment of the present application further provides a computer-readable storage medium having computer-readable instructions stored thereon. When the computer-readable instructions are executed by a processor of a computer, the computer is caused to execute a knowledge question-and-answer method based on firefighting equipment as described in any one of the above embodiments.
[0014] Beneficial effects of the present invention: The present application provides a knowledge question-answering method, device, equipment and storage medium based on fire-fighting equipment. The method obtains a fire-fighting equipment knowledge base, splits the fire-fighting equipment knowledge base into multiple parent document blocks and child document blocks, and vectorizes and stores the multiple parent document blocks and child document blocks to obtain a document vector library. An initial query question is received, and the initial query question is converted based on a first preset question template to obtain a question to be processed. The first preset question template includes a professional terminology library in the field of fire-fighting equipment and a preset standardized question expression structure. According to the question to be processed, a target parent document block and a target child document block are determined in the document vector library, and a target question is generated based on the question to be processed, the target parent document block and the target child document block, so as to input the target question into a preset large language model to obtain a knowledge answer about fire-fighting equipment. The present application realizes multi-granularity vectorized storage by hierarchically splitting the knowledge base, converts user queries in combination with preset question templates, and accurately locates relevant document blocks based on the document vector library to generate structured questions for input into the large language model, effectively solving the problems of missing semantic associations and terminology processing in knowledge retrieval in the field of fire-fighting equipment, and significantly improving the accuracy of professional question-answering and the efficiency of knowledge utilization.
[0015] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The accompanying drawings are incorporated into and constitute a part of the specification, illustrating embodiments consistent with the present application and, together with the specification, serving to explain the principles of the present application. It is obvious that the drawings described below are merely some embodiments of the present application, and a person of ordinary skill in the art can derive other drawings based on these drawings without inventive effort. In the drawings:
[0017] Figure 1 is a schematic diagram of an exemplary system architecture shown in an exemplary embodiment of the present application;
[0018] Figure 2 is a flow chart of a knowledge question-answering method based on firefighting equipment, shown in an exemplary embodiment of the present application;
[0019] Figure 3 This is a schematic diagram illustrating an implementation of a specific knowledge question-and-answer method based on firefighting equipment, as shown in an exemplary embodiment of the present application;
[0020] Figure 4This is a schematic diagram of a knowledge question-and-answer device based on firefighting equipment, shown in an exemplary embodiment of the present application;
[0021] Figure 5 It is a structural diagram of a computer system of an electronic device shown in an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0022] The following will describe the embodiments of the present application with reference to the accompanying drawings and specific embodiments. Those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be understood that the preferred embodiments are only for the purpose of illustrating the present application and are not intended to limit the scope of protection of the present application.
[0023] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application. Therefore, the illustrations only show components related to the present application and are not drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component can be changed at will, and the component layout type may also be more complicated.
[0024] In the following description, a large number of details are discussed to provide a more thorough explanation of the embodiments of the present application. However, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present application difficult to understand.
[0025] The term "and / or" used in this application describes a relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A exists alone, A and B exist simultaneously, or B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.
[0026] See Figure 1 , Figure 1 It is a schematic diagram of an exemplary system architecture shown in an exemplary embodiment of the present application.
[0027] Reference Figure 1As shown, the system architecture may include a terminal 110 and a computer device 120. The computer device 120 obtains a firefighting equipment knowledge base in the terminal 110, and splits the firefighting equipment knowledge base into layers to obtain multiple parent document blocks and child document blocks, and vectorizes and stores the multiple parent document blocks and child document blocks to obtain a document vector library. The computer device 120 receives an initial query question input by the terminal 110, and transforms the initial query question based on a first preset question template to obtain a pending question. A target parent document block and a target child document block are determined in the document vector library based on the pending question, and a target question is generated based on the pending question, the target parent document block, and the target child document block, so as to input the target question into a preset large language model to obtain a knowledge answer about firefighting equipment. The above-mentioned terminal 110 refers to an example support device used to store a fire-fighting equipment knowledge base, receive initial inquiry questions input by users, and display answers to fire-fighting equipment knowledge, including but not limited to mobile phones, tablet devices, microcomputers, and cloud virtual machines; the above-mentioned computer device 120 refers to a computing power support terminal device used to carry out a program implementation environment for executing a knowledge question-and-answer method based on fire-fighting equipment, including but not limited to tablet devices, microcomputers, embedded computers, industrial computers, and cloud servers.
[0028] Schematically, the computer device 120 obtains the fire equipment knowledge base in the terminal 110, and splits the fire equipment knowledge base into layers to obtain multiple parent document blocks and child document blocks, and vectorizes and stores the multiple parent document blocks and child document blocks to obtain a document vector library, receives the initial query question input by the terminal 110, and transforms the initial query question based on the first preset question template to obtain a question to be processed, determines the target parent document block and the target child document block in the document vector library according to the question to be processed, and generates a target question based on the question to be processed, the target parent document block and the target child document block, so as to input the target question into the preset large language model to obtain a fire equipment knowledge answer; the present application realizes multi-granularity vectorized storage by splitting the knowledge base into layers, transforms user queries in combination with preset question templates, and accurately locates relevant document blocks based on the document vector library to generate structured questions for input into the large language model, effectively solving the semantic association loss and terminology processing problems in knowledge retrieval in the field of fire equipment, and significantly improving the accuracy of professional questions and answers and the efficiency of knowledge utilization.
[0029] In the existing technology, the number of technical documents in the field of fire-fighting equipment is growing rapidly, and product types and standards are constantly updated. Traditional keyword retrieval technology has an information island effect and cannot effectively integrate cross-document semantic associations, resulting in an increase in the time consumption of a single search. When dealing with complex professional problems, traditional question-answering systems based on rule engines are limited by insufficient semantic understanding capabilities, and the accuracy of responses is difficult to meet actual needs. For example, in a fire-fighting facility maintenance scenario, technicians need to quickly obtain the installation specifications and maintenance points of a certain type of fire extinguisher, but the existing system may be unable to associate related content scattered across different documents, resulting in fragmented returned information or missing key parameters.
[0030] In order to solve the above problems, how to efficiently integrate the scattered firefighting equipment knowledge and achieve accurate question and answer becomes a technical difficulty. Simply relying on the general semantic understanding ability of a large language model is difficult to accurately capture the relationship between professional terms in the firefighting field, and the original documents are not structured, which leads to low retrieval efficiency. If the knowledge base is split into layers and a vectorized index is established, the coverage of semantic retrieval can be improved; at the same time, the user input is standardized and converted through preset question templates, which can effectively guide the large model to focus on domain knowledge. Based on this, a technical path is proposed to process document content and user questions in stages, narrow the search scope through a layered vector library, and optimize the input structure in combination with question templates, ultimately achieving efficient and accurate question and answer responses.
[0031] Therefore, this application proposes a knowledge question answering method based on firefighting equipment, such as Figure 2 As shown, Figure 2 This is a flowchart of a knowledge question-answering method based on firefighting equipment, which is shown in an exemplary embodiment of the present application. Figure 1 The implementation environment can be implemented in other implementation environments, and the above implementation environment is not specifically limited here. Figure 2 As shown, the flowchart of the knowledge question-answering method based on firefighting equipment includes at least steps S210 to S230, which are described in detail as follows:
[0032] In step S210, a firefighting equipment knowledge base is obtained and split into layers to obtain a plurality of parent document blocks and child document blocks, and the plurality of parent document blocks and child document blocks are vectorized and stored to obtain a document vector library.
[0033] In one embodiment of the present application, hierarchical splitting involves dividing the original document into parent document blocks of a preset length, which are then further divided into child document blocks, and adding metadata such as parent block labels and location indexes to the child document blocks. This hierarchical structure preserves document context, facilitating rapid location of related content during subsequent searches. Vectorized storage uses multimodal conversion technology to convert text into vector representations, such as extracting semantic features through the BERT model. Parent document blocks and child document blocks are stored separately to form independent vector libraries.
[0034] In one embodiment of the present application, the hierarchical splitting of the fire equipment knowledge base includes splitting the original documents in the fire equipment knowledge base according to a first preset length to generate parent document blocks, and configuring a unique label for each parent document block, cutting each parent document block according to a second preset length to generate multiple child document blocks corresponding to each parent document block, and adding child document metadata to each child document block, the child document metadata including the unique label of the corresponding parent document block, the position index of the parent document block in the original document, and the paragraph order identifier of the child document block in the parent document block to which it belongs.
[0035] The first preset length refers to a fixed character count or paragraph count threshold used when segmenting the original document. A sliding window algorithm or paragraph boundary detection algorithm can be used to control the length range of the parent document block to ensure semantic integrity. Parent document blocks are semantically independent text units segmented from the original document. They can be generated through natural paragraph division or chapter title recognition to preserve the document's contextual relevance. A unique label can be assigned to each parent document block using a globally unique identifier, specifically generated through hash value generation or serial number incrementing, to facilitate rapid locating of related content during retrieval.
[0036] The second preset length refers to the smaller granularity threshold used when performing secondary segmentation on the parent document block. In some specific embodiments, this can be set based on the number of sentences or characters. Refining the segmentation granularity improves retrieval accuracy. Sub-document blocks are fine-grained text fragments cut from the parent document block, used to match specific details in the user query. Sub-document metadata records structured information about the relationship between the sub-document block and the parent document block. This can be implemented, for example, through a key-value store or graph database, ensuring rapid retrieval of contextual information during retrieval.
[0037] Specifically, the original document is first segmented into multiple parent document blocks, with the length of each parent document block controlled by a first preset length, for example, using 1,000 characters as a segmentation unit, and each parent document block is assigned a unique label. Subsequently, each parent document block is further segmented into multiple child document blocks, for example, 200 characters as a child document block, and metadata containing the parent document block's unique label, the original document's position index, and paragraph sequence identifiers is attached to each child document block. Through the hierarchical structure, the complete semantic context of the parent document block is preserved, and fine-grained information matching is achieved through the child document blocks. This facilitates locating the precise answer in the child document block when the user's inquiry involves specific parameters or operation steps, while quickly retrieving supplementary information in the parent document block through metadata association.
[0038] This solution solves the need for fine-grained retrieval and avoids the problem of semantic fragmentation through the hierarchical division of parent document blocks and child document blocks, combined with a metadata association mechanism. For example, in the existing technology, if a user queries the pressure parameters of a fire extinguisher, only isolated data fragments may be returned without being able to associate the operating instructions in the maintenance guide. However, this solution can quickly locate the complete maintenance process in the parent document block through the metadata of the child document block, effectively solving the problem of semantic association and efficient retrieval of large-scale documents in the fire equipment knowledge base. Through hierarchical segmentation and metadata annotation, the system can maintain contextual coherence while ensuring retrieval accuracy, significantly improving the accuracy of responses to complex professional questions, and reducing duplication or omissions caused by improper document segmentation.
[0039] In one embodiment of the present application, when vectorizing and storing multiple parent document blocks and child document blocks, each parent document block is first converted into a multimodal vector to obtain a parent document block vector, and each parent document block vector is stored to obtain a parent document vector library; each child document block is converted into a multimodal vector to obtain a child document block vector, and each child document block vector is associated and stored based on the child document metadata to obtain a child document vector library, and the parent document vector library and the child document vector library are determined as a document vector library.
[0040] Among them, multimodal vector conversion refers to converting a document block containing text, images, or tables into a numerical vector representation. In the embodiments of the present application, a pre-trained multimodal encoding model is used for implementation. For example, the text portion is encoded using a BERT model, the image portion is encoded using a ResNet model, and then the vectors of different modalities are spliced or weighted fused. The above-mentioned associative storage refers to establishing an index relationship between the sub-document block vector and its corresponding parent document block metadata. The index relationship is established through database foreign key association or the metadata tag function of the vector storage engine, so that the sub-document block vector can be traced back to the contextual information of the parent document block to which it belongs.
[0041] In one embodiment of the present application, parent document block vectors are processed through a multimodal encoding model and stored in a separate storage space to form a parent document vector library. During the conversion process, child document block vectors simultaneously record the unique identifier, position index, and paragraph sequence identifier of their parent document block. Based on this metadata, the child document block vectors are then stored in the child document vector library. When performing knowledge retrieval, the child document vector library supports fine-grained matching, while the parent document vector library provides contextual expansion capabilities through metadata association. The two combine to form a hierarchical vector retrieval system.
[0042] This solution uses layered vectorized storage to enable sub-document block vectors to accurately match detailed features in the question. Meanwhile, the parent document block vector provides complete semantic context, effectively avoiding the contextual fragmentation caused by document splitting and resolving the incomplete semantic coverage of traditional single vector libraries in complex queries. The synergy between the parent and child document vector libraries enables the system to quickly locate sub-document fragments directly related to the question and automatically associate supplementary information from the parent document, thereby improving the accuracy and completeness of answers generated by large language models.
[0043] In one embodiment of the present application, before obtaining the fire equipment knowledge base, it also includes obtaining fire equipment product manuals, technical specifications and use case documents, deduplicating the fire equipment product manuals, technical specifications and use case documents to obtain the target fire equipment content, converting the target fire equipment content into a target electronic format to obtain a target electronic document set, and encoding and converting the target electronic document set and performing structured storage to obtain a fire equipment knowledge base.
[0044] Among them, the fire equipment product manual refers to the official document issued by the manufacturer containing product technical parameters, operating procedures and maintenance requirements, which can be collected in the form of specified document format or paper scans; technical specifications refer to the industry standard documents that must be followed during the design, installation and acceptance of fire equipment; use case documents refer to text or image materials that record the actual application scenarios and problem-solving processes of fire equipment, which can be extracted through the fire department's accident report library.
[0045] Deduplication eliminates duplicate or highly overlapping content by calculating document hash values or using a clustering algorithm based on semantic similarity. The target electronic format involves converting heterogeneous documents into a standardized, machine-parseable format, such as converting scanned documents into editable text or Word documents into HTML. Encoding the target electronic document set involves converting the document character set to a common encoding to avoid garbled characters. The document content is then categorized by semantic units and stored in a database or knowledge graph. For example, product parameters might be stored in a relational database and operational procedures might be stored in a graph database node.
[0046] In one embodiment of the present application, during the construction phase of the fire-fighting equipment knowledge base, multi-source data such as product manuals, technical specifications, and case documents are first collected from channels such as manufacturers, standard organizations, and fire departments. Duplicate document content is removed through hash value comparison and semantic similarity analysis. For example, for multiple versions of manuals for the same model of fire extinguisher, only the latest version is retained. Subsequently, the paper documents are scanned as images and text information is extracted. All documents are uniformly converted into XML format to ensure the consistency of the data structure, and encoding verification is performed to eliminate character parsing errors. Finally, the processed documents are stored in the database by subject classification, and an associated index is established between the documents. For example, the fire extinguisher technical specifications and its corresponding product manual are associated through the model field to form a knowledge base that can be quickly searched.
[0047] This solution eliminates duplicate data through deduplication operations, reduces storage resource waste, solves the problem of heterogeneous data integration through format conversion and unified encoding, establishes semantic associations through structured storage, and provides standardized input for subsequent vectorized processing, thereby improving knowledge base construction efficiency and data quality.
[0048] In step S220, an initial inquiry question is received, and the initial inquiry question is transformed based on a first preset question template to obtain a question to be processed.
[0049] In one embodiment of the present application, the above-mentioned first preset question template includes a professional terminology library in the field of fire-fighting equipment and a preset standardized question expression structure, such as standardized expressions such as "fire extinguisher pressure detection cycle" and "sprinkler system start-up threshold", by replacing non-professional vocabulary in user questions and adjusting the sentence structure to make them conform to the domain knowledge expression standards.
[0050] In one embodiment of the present application, when the user inputs the initial question, the system first identifies the non-standard terms in the question and converts them, for example, converting "fire extinguisher tank validity period" to "fire extinguisher certification validity period", and then adjusts and converts the format and word order of the initial inquiry question through the first preset question template to obtain a pending question that is more in line with the domain knowledge expression standards.
[0051] In step S230, the target parent document block and the target child document block are determined in the document vector library according to the question to be processed, and the target question is generated according to the question to be processed, the target parent document block and the target child document block, so that the target question is input into the preset large language model to obtain a knowledge answer about firefighting equipment.
[0052] In one embodiment of the present application, the problem to be processed is vectorized to obtain a vector of the problem to be processed, and a sub-document vector library in the document vector library determines a preset number of sub-document block vectors with the highest similarity to the vector of the problem to be processed, and the preset number of sub-document block vectors with the highest similarity are determined as target sub-document blocks. According to the sub-document metadata of the target sub-document block, the corresponding parent document block is extracted from the parent document vector library, and the extracted parent document block is deduplicated to obtain the target parent document block.
[0053] The question vector to be processed can be converted into a high-dimensional numerical representation of a natural language question through a vectorization model. In some embodiments, the BERT or Sentence-BERT model is used for vector conversion to convert semantic information into a computable vector space. The preset number of sub-document block vectors with the highest similarity refers to the sub-document blocks that are most relevant to the question semantics, screened using a similarity algorithm such as cosine similarity or Euclidean distance, to facilitate rapid location of knowledge fragments associated with the question.
[0054] The above-mentioned deduplication processing refers to merging duplicate items of the extracted parent document blocks, which can be achieved through methods including but not limited to hash tables or set data structures, etc., to eliminate redundant information and retain the complete context.
[0055] In one embodiment of the present application, after receiving the pending question input by the user, it is first converted into a vector form, and several sub-document blocks with the highest similarity are retrieved in the sub-document vector library. The metadata carried by these sub-document blocks can be reversely mapped to the corresponding parent document blocks, and the position of the parent document blocks in the original knowledge base can be quickly located through unique labels. Since the same parent document block may be referenced by multiple sub-document blocks, it is necessary to ensure that only one instance of each parent document block is retained through deduplication operations. For example, when a user asks about the "maintenance cycle of dry powder fire extinguishers", the system will give priority to matching sub-document blocks containing the keyword "maintenance cycle", and then associate it with the complete "Dry Powder Fire Extinguisher Operation Manual" parent document block through metadata, thereby obtaining extended information such as maintenance procedures and precautions.
[0056] This solution ensures both retrieval efficiency and the integrity of the knowledge system through a two-layer mechanism of precise matching of sub-document blocks and contextual supplementation of parent document blocks. For example, existing technologies may only return scattered fragments of maintenance steps, while this solution can provide complete operation manual chapters at the same time, avoiding users from having to search twice. Based on this, this application can effectively solve the problems of weak semantic association and lack of context in fire equipment knowledge retrieval. Through the collaborative retrieval of sub-document blocks and parent document blocks, while ensuring response speed, it provides answer content with a complete logical structure. For example, when answering professional parameter queries, it can return specific values and can also be related to the test conditions and applicable scope in the technical specifications, significantly improving the accuracy and practicality of the question and answer results.
[0057] In one embodiment of the present application, when generating a target question, the question to be processed, the target parent document block and the target child document block are embedded in a second preset question template to generate the target question. The second preset question template includes fire equipment answer generation instructions and preset structured output specifications.
[0058] In one embodiment of the present application, the second preset question template refers to a predefined framework that includes answer generation logic and output format requirements in the field of fire equipment. In some embodiments, standardized output is performed through a template structure that includes a question description field, a related document block reference field, and an answer generation instruction field. The scattered document blocks and user questions can be integrated into query statements that conform to the input specifications of the large language model.
[0059] Firefighting equipment answer generation instructions are control statements used to guide the large language model to generate answers that meet domain knowledge requirements. These include, but are not limited to, instructions based on firefighting equipment classification standards, parameter constraints, and operational specifications. This controls the professionalism and accuracy of the model's output. Pre-defined structured output specifications refer to predefined answer formats, content hierarchies, and data types to ensure the readability and information integrity of model-generated answers.
[0060] When the pending question and the target parent document block and child document block are embedded in the second preset question template, for example, for the pending question of "How to choose the type of fire extinguisher suitable for a chemical plant", the system will combine the question text, the chapter content about the fire risk level of a chemical plant in the parent document block, and the paragraph about the technical parameters of the foam fire extinguisher in the child document block according to the preset "problem description-associated document summary-generation instruction" structure in the template to form a target question input with clear context and generation constraints. For example, a complete query statement containing the instruction "According to a certain implementation standard, combined with the fire category description in Section 3.2 of the document, list the types of fire extinguishers that meet the requirements and their applicable scenarios in tabular form" is generated, and then input into the large language model for reasoning.
[0061] This solution uses structured templates to forcibly associate domain knowledge elements, ensuring that the answers generated by the large language model strictly adhere to the technical specifications of the fire-fighting equipment field. For example, when answering questions about fire extinguisher selection, the relevant standard numbers and parameter restrictions are automatically attached. At the same time, the preset output format eliminates the ambiguity of expression caused by free text generation, significantly improving the practicality and reliability of professional Q&A.
[0062] In one embodiment of the present application, after obtaining answers to firefighting equipment knowledge, historical firefighting equipment knowledge question-answer pairs within a target period are obtained, and an optimized dataset is constructed based on these historical firefighting equipment knowledge question-answer pairs. The historical firefighting equipment knowledge question-answer pairs are obtained by collecting target questions within the target period and inputting them into a preset large language model to obtain answers to firefighting equipment knowledge. The entity relationships and parameter constraint rules of the firefighting equipment in the optimized dataset are extracted to obtain a target domain knowledge feature matrix. Based on the target domain knowledge feature matrix, a parameter gradient offset of the preset large language model is calculated to adjust the weight distribution of the fully connected layer in the preset large language model using the parameter gradient offset.
[0063] Among them, the historical fire-fighting equipment knowledge question and answer pairs refer to the structured data set formed by collecting questions input into the preset large language model and the corresponding generated answers within the target period. They can be collected through database storage and timestamp marking to capture the knowledge interaction pattern in actual applications. Entity relationships and parameter constraint rules refer to the logical associations and numerical restrictions between the attributes of fire-fighting equipment extracted from the question and answer pairs. They can be implemented by knowledge graph construction and rule engine parsing to enhance the model's understanding of professional domain knowledge. The parameter gradient offset is a quantitative adjustment value for the update direction of the model parameters based on the domain knowledge feature matrix. In the embodiment of the present application, it is implemented through the backpropagation algorithm and the feature weight allocation strategy, which can optimize the model's reasoning ability in the field of fire protection.
[0064] Construct multiple new combinations of the first and second preset question templates, and test these new combinations based on the initial query questions in the optimized dataset. Record the generated answers for each new combination of the first and second preset question templates and compare them with the optimized dataset to determine an optimized combination of the first and second preset question templates based on the comparison results. The new combinations of the first and second preset question templates refer to multiple question combinations formed by expanding or reconstructing the original templates.
[0065] In one embodiment of the present application, user questions and model-generated answer data are automatically collected within a preset period, and after cleaning and annotation, an optimized data set is formed. The entity relationships in the data are identified through knowledge extraction technology, such as the association rules between fire extinguisher pressure parameters and usage scenarios, and these rules are encoded into a feature matrix. Based on this matrix, the gradient offset of the model parameters is calculated, for example, the weights of neurons related to fire equipment parameters in the fully connected layer are adjusted, so that the model pays more attention to domain features when generating answers. At the same time, multiple sets of new question template combinations are generated, such as replacing terms in the original template with synonyms or adjusting the question structure, and verifying the performance of different combinations in terms of answer accuracy and semantic coherence through testing, and finally the optimized template combination is screened out.
[0066] The present scheme realizes dynamic adjustment of model parameters and problem templates through periodic data collection and feature analysis, enabling the system to adapt to the rapid iteration of fire-fighting equipment knowledge and complex query requirements, solving the problem of low accuracy of professional problem reply caused by template rigidity and insufficient model generalization ability of traditional question and answer systems, and improving the domain adaptability and dynamic optimization ability of fire-fighting equipment knowledge question and answer. At the same time, through automatic testing and screening mechanism, the robustness and scalability of the problem transformation template are enhanced.
[0067] Please refer to Figure 3 , Figure 3 is an exemplary embodiment of the present application, which shows an embodiment of a fire-fighting equipment-based knowledge question and answer method, as Figure 3 shown in the figure, in a specific embodiment of the present application, the original documents in the fire-fighting equipment knowledge base, such as document 1 or document 2, are split to generate multiple parent document blocks and child document blocks. Wherein, when generating parent document blocks, first load each original document in the fire-fighting equipment knowledge base, and split it to generate multiple parent document blocks. The length of the parent document block is pre-set, and each parent document block is assigned a corresponding label. Further, the parent document block is split into n preset length child document blocks, and each child document block is set with metadata, which is the serial number of the corresponding parent document block. Wherein, another implementable way of constructing the fire-fighting equipment knowledge base includes collecting and screening various types of fire-fighting equipment related documents, such as product manuals, technical specifications, use cases, etc., converting them into text documents, and constructing the fire-fighting equipment knowledge base. And use the directory loader to load the text documents.
[0068] In a specific embodiment of the present application, the generated multiple parent document blocks and child document blocks are converted into vectors and stored in the parent document vector library and the child document vector library. As shown in the figure, the parent document vector library includes multiple parent document block vectors (parent document blocks 1-4), and the child document vector library includes multiple child document block vectors (child document blocks 1-12). The initial inquiry question raised by the user is combined with the fire-fighting knowledge stylized prompt template to generate a first preset problem template to generate a to-be-processed problem. The to-be-processed problem generated above is compared with the child document block to carry out similarity calculation and comparison, and the multiple child document block vectors with the best correlation degree are matched, and the parent documents associated with the metadata of these child document block vectors are recalled to generate a document set. Specifically, multiple child document block vectors with the best correlation degree are retrieved in the child document vector library with the help of a similarity retriever, the corresponding parent document is located in the parent document vector library according to the metadata carried by the child document block vector with the best correlation degree, and the obtained parent document vector library, or the child document block vector, is combined to form a document set.
[0069] In one specific embodiment of this application, a second preset question template, a response template suitable for a large model, is constructed. The generated pending question and the second preset question template of the document set are integrated to generate a target question. The target question is then input into the deployed preset large language model to generate a knowledge answer about firefighting equipment.
[0070] The pre-set large language model underwent secondary fine-tuning training using thousands of rounds of highly accurate questions and answers related to firefighting equipment. The model's parameters were adjusted to better align with the knowledge characteristics and Q&A requirements of the firefighting equipment field. The first and second pre-set question templates were modified multiple times, and after multiple comparative tests, the optimal template was selected.
[0071] The present application provides a knowledge question-answering method based on fire-fighting equipment. The method obtains a fire-fighting equipment knowledge base, splits the fire-fighting equipment knowledge base into multiple parent document blocks and child document blocks, and vectorizes and stores the multiple parent document blocks and child document blocks to obtain a document vector library. An initial query question is received, and the initial query question is transformed based on a first preset question template to obtain a question to be processed. The first preset question template includes a professional terminology library in the field of fire-fighting equipment and a preset standardized question expression structure. According to the question to be processed, a target parent document block and a target child document block are determined in the document vector library, and a target question is generated based on the question to be processed, the target parent document block and the target child document block, so as to input the target question into a preset large language model to obtain a knowledge answer about fire-fighting equipment. The present application realizes multi-granularity vectorized storage by hierarchically splitting the knowledge base, transforms user queries in combination with preset question templates, and accurately locates relevant document blocks based on the document vector library to generate structured questions for input into the large language model, effectively solving the problems of missing semantic associations and terminology processing in knowledge retrieval in the field of fire-fighting equipment, and significantly improving the accuracy of professional question-answering and the efficiency of knowledge utilization.
[0072] The following describes an embodiment of the device of the present application, which can be used to implement the firefighting equipment-based knowledge question-answering method described in the above embodiment of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the firefighting equipment-based knowledge question-answering method described in the above embodiment of the present application.
[0073] Figure 4 This is a schematic diagram of a knowledge question-answering device based on firefighting equipment, shown as an exemplary embodiment of the present application. Figure 2 The method implementation process shown in the figure can be based on Figure 1 The present invention is executed in the implementation environment shown in , and may also be applicable to other exemplary implementation environments and specifically configured in other devices. This embodiment does not limit the implementation environment to which the apparatus is applicable.
[0074] like Figure 4As shown, the example fire-fighting equipment-based knowledge question answering device includes a knowledge base disassembly module 401, a question conversion determination module 402, and a target question answering module 403.
[0075] The knowledge base disassembly module 401 is configured to acquire a fire-fighting equipment knowledge base, and perform hierarchical disassembly on the fire-fighting equipment knowledge base to obtain a plurality of parent document blocks and child document blocks, and perform vector storage on the plurality of parent document blocks and child document blocks to obtain a document vector library. The question conversion determination module 402 is configured to receive an initial inquiry question, and convert the initial inquiry question based on a first preset question template to obtain a to-be-processed question. The first preset question template includes a fire-fighting equipment field professional term library and a preset standardized question expression structure. The target parent document block and the target child document block are determined in the document vector library according to the to-be-processed question, and a target question is generated according to the to-be-processed question, the target parent document block, and the target child document block. The target question answering module 403 is configured to input the target question into a preset large language model to obtain a fire-fighting equipment knowledge answer.
[0076] Embodiments of the present application also provide an electronic device, comprising: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the electronic device implements the fire-fighting equipment-based knowledge question answering method provided in each of the above embodiments.
[0077] Figure 5 is a structural schematic diagram of a computer system of an example electronic device of the present application. It should be noted that, Figure 5 The computer system 500 of the electronic device shown is only an example, and should not impose any limitation on the functions and use range of the embodiments of the present application.
[0078] As Figure 5 As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 502 or programs loaded from a storage portion into a random access memory (RAM) 503, such as performing the methods in the above embodiments. In the RAM 503, various programs and data required for system operation are also stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. An I / O interface 505, which refers to an input / output (I / O) interface, is also connected to the bus 504.
[0079] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage section 508 including a hard disk; and a communication section 509 including a network interface card such as a LAN (Local Area Network) card or a modem. The communication section performs communication processing via a network such as the Internet. A drive is also connected to the I / O interface 505 as needed. Removable media 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., are installed in the drive 510 as needed so that computer programs read therefrom can be installed into the storage section 508 as needed.
[0080] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 509, and / or installed from a removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the various functions defined in the system of the present application are executed.
[0081] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable computer program. This propagated data signal can take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. A computer program embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, or any suitable combination thereof.
[0082] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. Among them, each box in the flowchart or block diagram can represent a module, program segment, or part of the code, and the above-mentioned module, program segment, or part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0083] In the corresponding drawings of the above embodiments, connecting lines can represent the connection relationship between various components to represent more constituent signal paths (constituent_signalpath) and / or one or more ends of some lines have arrows to indicate the main information flow direction. The connecting lines serve as an identifier and are not a limitation to the scheme itself. Instead, the use of these lines in combination with one or more exemplary embodiments helps to connect circuits or logic units more easily. Any represented signal (determined by design requirements or preferences) may actually include one or more signals that can be transmitted in any direction and can be implemented with any appropriate type of signal scheme.
[0084] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. In some cases, the names of these units do not constitute limitations on the units themselves.
[0085] Another aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the aforementioned method. The computer-readable storage medium may be included in the electronic device described in the above embodiments, or may exist independently and not be incorporated into the electronic device.
[0086] An embodiment of the present application further provides a computer program product, comprising a computer program, which, when executed by a processor, implements a knowledge question-and-answer method based on firefighting equipment as described in any one of the above embodiments.
[0087] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiment of the application, the features and functions of two or more modules or units described above can be concretized in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.
[0088] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of the present application.
[0089] The present application can be used in a wide variety of general-purpose or specialized computing system environments or configurations, such as personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments that include any of the above.
[0090] Those skilled in the art will readily conceive of other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of this application and include common knowledge or customary techniques in the art that are not disclosed herein.
[0091] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Anyone skilled in the art may modify or alter the above embodiments without departing from the spirit and scope of this invention. Therefore, all equivalent modifications or alterations made by one of ordinary skill in the art without departing from the spirit and technical concepts disclosed in this application shall be covered by the claims of this application.
Claims
1. A knowledge question-answering method based on firefighting equipment, characterized in that: The fire-fighting equipment-based knowledge question-answering method includes: Obtain a fire-fighting equipment knowledge base, and split the fire-fighting equipment knowledge base into layers to obtain a plurality of parent document blocks and child document blocks, and vectorize and store the plurality of parent document blocks and child document blocks to obtain a document vector library; Receiving an initial inquiry question and converting the initial inquiry question based on a first preset question template to obtain a question to be processed, wherein the first preset question template includes a professional terminology library in the field of firefighting equipment and a preset standardized question expression structure; According to the problem to be processed, the target parent document block and the target child document block are determined in the document vector library, and a target question is generated according to the problem to be processed, the target parent document block and the target child document block, so that the target question is input into a preset large language model to obtain a knowledge answer about fire equipment.
2. The knowledge question-answering method based on firefighting equipment according to claim 1 is characterized in that: The firefighting equipment knowledge base is split into layers to obtain multiple parent document blocks and child document blocks including: Splitting the original documents in the firefighting equipment knowledge base according to a first preset length to generate parent document blocks, and assigning a unique label to each parent document block; Each parent document block is cut according to a second preset length to generate multiple child document blocks corresponding to each parent document block, and child document metadata is added to each child document block. The child document metadata includes a unique label of the corresponding parent document block, a position index of the parent document block in the original document, and a paragraph sequence identifier of the child document block in the parent document block to which it belongs.
3. The knowledge question-answering method based on firefighting equipment according to claim 2 is characterized in that: Vectorized storage is performed on the plurality of parent document blocks and child document blocks to obtain a document vector library including: Performing multimodal vector conversion on each parent document block to obtain a parent document block vector, and storing each parent document block vector to obtain a parent document vector library; Performing multimodal vector conversion on each of the sub-document blocks to obtain a sub-document block vector, and associating and storing each of the sub-document block vectors based on sub-document metadata to obtain a sub-document vector library; The parent document vector library and the child document vector library are determined as a document vector library.
4. The knowledge question-answering method based on firefighting equipment according to claim 1 is characterized in that: Determining a target parent document block and a target child document block in the document vector library according to the problem to be processed includes: Vectorizing the problem to be processed to obtain a problem vector; Determine, in a sub-document vector library in a document vector library, a preset number of sub-document block vectors having the highest similarity to the question vector to be processed, and determine the preset number of sub-document block vectors having the highest similarity as target sub-document blocks; The corresponding parent document block is extracted from the parent document vector library according to the sub-document metadata of the target sub-document block, and the extracted parent document block is deduplicated to obtain the target parent document block.
5. The knowledge question-answering method based on firefighting equipment according to claim 1 is characterized in that: Generating a target question according to the to-be-processed question, the target parent document block, and the target child document block includes: The question to be processed, the target parent document block and the target child document block are embedded in a second preset question template to generate a target question, wherein the second preset question template includes fire equipment answer generation instructions and a preset structured output specification.
6. The knowledge question-answering method based on firefighting equipment according to any one of claims 1 to 5, characterized in that: Before obtaining the fire-fighting equipment knowledge base, the fire-fighting equipment-based knowledge question-answering method further includes: Obtain fire equipment product manuals, technical specifications, and use case documents; Deduplication is performed on the fire-fighting equipment product manuals, technical specifications, and use case documents to obtain the target fire-fighting equipment content; The target firefighting equipment content is converted into a target electronic format to obtain a target electronic document set, and the target electronic document set is subjected to coding conversion and structured storage to obtain a firefighting equipment knowledge base.
7. The knowledge question-answering method based on firefighting equipment according to any one of claims 1 to 5, characterized in that: After inputting the target question into a preset large language model to obtain a knowledge answer about firefighting equipment, the firefighting equipment-based knowledge question answering method further includes: Obtain historical firefighting equipment knowledge question-answer pairs within a target period, and construct an optimized data set based on the historical firefighting equipment knowledge question-answer pairs, wherein the historical firefighting equipment knowledge question-answer pairs are obtained by collecting the target questions within the target period and then inputting them into a preset large language model to obtain firefighting equipment knowledge answers; Extracting entity relationships and parameter constraint rules of firefighting equipment in the optimized dataset to obtain a target domain knowledge feature matrix, and calculating a parameter gradient offset of a preset large language model based on the target domain knowledge feature matrix, so as to adjust the weight distribution of a fully connected layer in the preset large language model by the parameter gradient offset; Construct multiple sets of new combinations of first preset question templates and second preset question templates, and test the multiple sets of new combinations of first preset question templates and second preset question templates based on the initial query questions in the optimized data set, record the generated answers of each set of new combinations of first preset question templates and second preset question templates and compare them with the optimized data set to determine the optimized combination of first preset question templates and second preset question templates based on the comparison results.
8. A knowledge question-answering device based on firefighting equipment, characterized in that: The knowledge question-answering device based on fire-fighting equipment includes: A knowledge base disassembly module is used to obtain a fire-fighting equipment knowledge base, and split the fire-fighting equipment knowledge base into layers to obtain multiple parent document blocks and child document blocks, and vectorize and store the multiple parent document blocks and child document blocks to obtain a document vector library; a question conversion and determination module, configured to receive an initial inquiry question and convert the initial inquiry question based on a first preset question template to obtain a pending question, wherein the first preset question template includes a professional terminology library in the field of firefighting equipment and a preset standardized question expression structure; determine a target parent document block and a target child document block in the document vector library based on the pending question, and generate a target question based on the pending question, the target parent document block, and the target child document block; The target question answering module is used to input the target question into a preset large language model to obtain a knowledge answer about firefighting equipment.
9. An electronic device, characterized in that: It includes a processor, a memory and a communication bus; the communication bus is used to connect the processor and the memory; the processor is used to execute the computer program stored in the memory to implement the knowledge question and answer method based on fire-fighting equipment as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that A computer program is stored thereon, and the computer program is used to enable a computer to execute the knowledge question-answering method based on fire-fighting equipment as described in any one of claims 1 to 7.
Citation Information
Cited By
Document interaction processing method, device and equipment oriented to large language model
CN121562775A
Document interaction processing method, device and equipment for large language model
CN121562775B