Intelligent question and answer method and natural language query system in field of fire safety
By constructing a semantic trajectory flow and a multi-layered verification network, combined with multi-path mapping of the fire protection knowledge graph, the problem of insufficient semantic parsing in complex queries in existing systems is solved, achieving higher accuracy and reliability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- LIAONING DAYI ZHUHE SAFETY TECHNOLOGY CO LTD
- Filing Date
- 2025-12-04
- Publication Date
- 2026-04-10
AI Technical Summary
Existing intelligent question-answering systems in the field of fire safety struggle to accurately capture semantic details when faced with complex, ambiguous, or implicit user queries, and lack support for multi-path semantic mapping, resulting in insufficient accuracy and robustness of the answers.
By constructing a semantic trajectory flow in the natural language query processing process, performing semantic density analysis, identifying key semantic regions, verifying the completeness of the parsing through a multi-layer verification network, performing multi-path semantic mapping based on the fire protection knowledge graph, and finally conducting confidence assessment to select the best answer.
It improves the accuracy of semantic parsing and the reliability of answers when facing complex problems, enhances the ability to handle complex or fuzzy queries, reduces the probability of misparsing, and improves the fault tolerance and comprehensiveness of the system.
Smart Images

Figure CN121833876A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent question-and-answer technology for fire safety, specifically to an intelligent question-and-answer method and natural language query system in the field of fire safety. Background Technology
[0002] Currently, intelligent question-answering systems in the fire safety field mostly rely on traditional natural language processing (NLP) techniques. These systems typically parse the user's input NLP query as a complete text unit, extracting keywords through syntactic analysis and entity recognition, and then directly retrieving them from a structured knowledge base or knowledge graph. This approach treats the query statement as a static analysis object, and its processing flow is relatively direct and fixed.
[0003] Existing technical solutions have shortcomings. Static, holistic parsing methods struggle to capture the dynamic evolution of query statements during semantic understanding, particularly overlooking key semantic focuses that only become clear through layer-by-layer analysis. When user queries contain complex, ambiguous, or implicit intents, a single-session parsing may lead to ambiguity or extract incomplete semantic elements. Furthermore, in the knowledge graph retrieval stage, conventional methods typically employ a single, pre-defined mapping path, lacking a parallel exploration mechanism for different interpretation possibilities of the same semantic element. This results in insufficient accuracy and robustness of the system's answers when facing unconventional or complex problems.
[0004] The root of these problems lies in the lack of refined measurement of the semantic parsing process and consideration of the diversity of answer generation paths in existing technologies. How to accurately locate the most core semantic units from the dynamic parsing process and ensure that these units are fully and multi-dimensionally mapped into the knowledge network to generate the optimal answer is a key issue that needs to be addressed to improve the performance of intelligent question-answering systems. Summary of the Invention
[0005] The purpose of this invention is to provide an intelligent question-answering method and a natural language query system in the field of fire safety, so as to solve the problems mentioned in the background art.
[0006] To achieve the above objectives, the present invention provides an intelligent question-answering method in the field of fire safety, the method comprising: Construct a semantic trajectory stream in the natural language query processing process, wherein the semantic trajectory stream contains multiple semantic trajectory segments arranged in chronological order; Semantic density analysis is performed on multiple semantic trajectory segments to generate a semantic density distribution map corresponding to each semantic trajectory segment; Based on the semantic density distribution map, key semantic regions in the semantic trajectory segment are identified, and the time markers corresponding to the key semantic regions are marked. Based on the time markers, semantic parsing units corresponding to key semantic regions are extracted from the semantic trajectory stream; The semantic parsing unit is input into a multi-layer verification network for parsing integrity verification. When the parsing integrity verification passes, the core semantic elements in the semantic parsing unit are obtained; Multi-path semantic mapping is performed on the fire protection knowledge graph based on the core semantic elements mentioned above. Generate a set of candidate answers based on the multi-path semantic mapping results; The set of candidate answers is evaluated for confidence, and the candidate answer with the highest confidence is selected as the intelligent question answering result.
[0007] Preferably, the step of constructing the semantic trajectory flow in the natural language query processing includes: Collect real-time semantic data points generated during the parsing process of natural language queries; Perform semantic integrity detection on the real-time semantic data points and filter out incomplete semantic data points; The detected semantic data points are arranged according to the time series to form an initial semantic trajectory; The initial semantic trajectory is subjected to semantic smoothing to eliminate noise fluctuations in the semantic trajectory; Extract semantic transition feature points from the initial semantic trajectory after semantic smoothing; Based on the semantic transition feature points, the initial semantic trajectory is segmented into multiple semantic trajectory segments; Add a timestamp to each semantic trajectory segment to form a complete semantic trajectory stream.
[0008] Preferably, the step of performing semantic density analysis on multiple semantic trajectory segments to generate a semantic density distribution map corresponding to each semantic trajectory segment includes: Calculate the distribution frequency of semantic elements in each semantic trajectory segment; Construct a semantic density function based on the distribution frequency; The semantic density function is used to analyze the degree of semantic concentration in different regions of the semantic trajectory segment. Regions whose semantic concentration exceeds a preset threshold are identified as high-density semantic regions. A semantic density distribution map is generated based on the high-density semantic region, and the density level is marked on the semantic density distribution map.
[0009] Preferably, the step of identifying key semantic regions in a semantic trajectory segment based on the semantic density distribution map includes: In the semantic density distribution map, locate the core region with the highest density level, and perform semantic correlation diffusion analysis from the core region to the surrounding area; Detect peripheral regions where the semantic relevance exceeds the relevance threshold; The core region and the detected peripheral region are merged into a key semantic region, and the start and end positions of the key semantic region in the semantic trajectory flow are recorded.
[0010] Preferably, the step of inputting the semantic parsing unit into a multi-layer verification network for parsing integrity verification includes: The first layer of the multi-layered verification network verifies the basic syntactic structure integrity of the semantic parsing unit. The semantic logical coherence of the semantic parsing unit is verified in the second layer of the multi-layer verification network; The matching degree between the third layer of the multi-layer verification network and the professional terminology in the field of fire protection; When all three layers of verification pass, the semantic parsing unit is determined to have passed the parsing integrity verification. If any layer of verification fails, the semantic parsing unit is returned to the semantic trajectory stream for re-extraction.
[0011] Preferably, the step of performing multi-path semantic mapping in the fire protection knowledge graph based on the core semantic elements includes: Analyze the fire protection professional concept entities contained in the core semantic elements, and locate the starting node corresponding to the fire protection professional concept entity in the fire protection knowledge graph; Starting from the initial node, perform multi-directional traversal expansion along the relational edges of the knowledge graph; During the extended traversal, record the knowledge nodes visited and their relationship paths; When the traversal depth reaches the preset level, the expansion traversal process is terminated. All valid knowledge nodes and relationship paths are aggregated as the result of multi-path semantic mapping.
[0012] Preferably, the step of generating a candidate answer set based on the multi-path semantic mapping result includes: Extract knowledge nodes related to natural language queries from the target mapping path; The knowledge nodes are semantically reorganized to form a preliminary answer; Multiple versions of preliminary answers are generated based on different semantic recombination rules; The initial answers from multiple versions are deduplicated to eliminate duplicate content. The initial answers after deduplication are combined into a candidate answer set.
[0013] Preferably, the step of evaluating the confidence level of the candidate answer set includes: Calculate the semantic match between each candidate answer and the natural language query; Evaluate the amount of supporting evidence for each candidate answer in the fire safety knowledge graph; Analyze the semantic clarity of each candidate answer; A confidence score is generated by combining semantic matching degree, the amount of supporting evidence, and the clarity of semantic expression.
[0014] Preferably, the step of selecting the candidate answer with the highest confidence level as the intelligent question-answering result includes: Compare the confidence scores of all candidate answers in the candidate answer set, and select the candidate answer with the highest confidence score as the preferred answer; The selected answers undergo semantic optimization to ensure they conform to natural language expression standards. The optimal answer, after semantic optimization, is output as the intelligent question answering result.
[0015] Preferably, the present invention also includes a natural language query system in the field of fire safety, the system including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the computer program, it implements the steps of the intelligent question-answering method in the field of fire safety as described above.
[0016] Compared with the prior art, the beneficial effects of the present invention are: By analyzing the semantic trajectory flow generated during natural language query processing in chronological order and plotting the density distribution of each semantic trajectory segment, the system can identify key regions with the highest information concentration from dynamic changes. Based on the density analysis results, time points are marked, thereby extracting the corresponding semantic parsing units from the process. This method transforms the object of semantic analysis from the static final statement to the dynamic parsing process itself, enabling the system to accurately capture key moments of semantic clarification and their corresponding intermediate parsing results. The granularity of semantic parsing is refined, the accuracy of core semantic element extraction is improved, and the probability of misparsing complex or ambiguous statements is reduced.
[0017] After extracting semantic parsing units, a multi-layered validation network is used to verify their completeness, ensuring that the semantic units input into subsequent mapping stages are complete and clear. Subsequently, the validated core semantic elements are semantically mapped through multiple paths within the fire safety knowledge graph, simultaneously attempting various reasonable semantic association logics to generate candidate answers. This mechanism of verification followed by multi-path exploration constructs a set of candidate answers for a single query. By evaluating the confidence of this set and selecting the best answer, the fault tolerance and comprehensiveness of the solution process are enhanced. The system no longer relies on a single, potentially inaccurate retrieval path, and its reasoning ability for handling complex problems and the reliability of its answers have achieved substantial progress. Attached Figure Description
[0018] Figure 1 This is a schematic diagram illustrating the working principle of the intelligent question-answering method in the field of fire safety described in this invention. Figure 2 This is a flowchart of semantic density analysis; Figure 3 A flowchart for generating a set of candidate answers; Figure 4 This is a multi-path semantic mapping analysis graph; Figure 5 This is a confidence level assessment chart. Detailed Implementation
[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0020] Please see Figure 1 This invention provides an intelligent question-answering method in the field of fire safety. The method includes: constructing a semantic trajectory stream in the natural language query processing process, the semantic trajectory stream containing multiple semantic trajectory segments arranged in chronological order; performing semantic density analysis on the multiple semantic trajectory segments to generate a semantic density distribution map corresponding to each semantic trajectory segment; identifying key semantic regions in the semantic trajectory segments based on the semantic density distribution map and marking the time markers corresponding to the key semantic regions; extracting semantic parsing units corresponding to the key semantic regions from the semantic trajectory stream based on the time markers; inputting the semantic parsing units into a multi-layer verification network for parsing integrity verification; when the parsing integrity verification passes, obtaining the core semantic elements in the semantic parsing units; performing multi-path semantic mapping on the fire safety knowledge graph based on the core semantic elements; generating a candidate answer set based on the multi-path semantic mapping results; evaluating the confidence of the candidate answer set, and selecting the candidate answer with the highest confidence as the intelligent question-answering result.
[0021] Example 1: In a specific implementation, real-time semantic data points generated during the parsing process of a natural language query are collected. These real-time semantic data points originate from the real-time output of the natural language processing pipeline. Each real-time semantic data point contains multiple attributes, including lexical units, grammatical roles, and basic semantic annotations. These attributes are generated in real-time using natural language processing techniques such as word segmentation, part-of-speech tagging, and dependency parsing. The collection process of real-time semantic data points adopts a streaming processing mechanism to ensure the temporality and integrity of the data points. The collection device or module continuously monitors the status of the parsing pipeline and immediately records each new semantic unit generated. The recorded content includes the data point content, the generation timestamp, and contextual information. In some embodiments, the collection of real-time semantic data points can be achieved using a high-performance message queue, such as Apache Kafka or similar technologies, to buffer and transmit data points to prevent data loss or out-of-order transmission. Simultaneously, the collection process maintains a data point buffer for temporary storage of unprocessed real-time semantic data points.
[0022] Semantic integrity detection of real-time semantic data points is a crucial step in constructing semantic trajectory streams. This detection employs a combination of rule-based and machine learning methods. The algorithm analyzes the internal structure of each real-time semantic data point to ensure it conforms to complete semantic unit standards, such as checking for complete subject-verb-object collocations or semantic role completeness. During semantic integrity detection, a series of integrity thresholds are set, such as minimum vocabulary requirements or semantic role coverage metrics. Real-time semantic data points that fail to meet these thresholds are marked as incomplete. Filtering incomplete semantic data points is achieved through a real-time filtering module. This module compares real-time semantic data points with predefined integrity templates; mismatched data points are discarded. In practice, semantic integrity detection can also incorporate contextual analysis, detecting the logical coherence between real-time semantic data points and their predecessors. Semantic breaks or contradictions are identified as incomplete. The filtering operation is performed asynchronously to avoid blocking the real-time data stream. It is understandable that the accuracy of semantic integrity detection directly affects the quality of subsequent semantic trajectories. Therefore, the detection model needs to be specially trained based on fire protection corpus to adapt to professional terminology and expression habits. The filtered real-time semantic data points will be marked with integrity and enter the next processing stage.
[0023] The detected semantic data points are arranged according to a time series to form an initial semantic trajectory. The arrangement process strictly follows the timestamp attributes of the real-time semantic data points, using a time-series sorting algorithm to organize the data points into a continuous trajectory. The initial semantic trajectory is essentially an ordered sequence, where each element represents a semantic unit and its occurrence time. In specific implementations, time-series arrangement can use a time window-based aggregation method to group real-time semantic data points within adjacent time periods, forming coarser-grained trajectory segments. However, the core principle is to maintain the strict monotonicity of the time series. The data structure of the initial semantic trajectory is typically implemented using linked lists or arrays to support efficient insertion and traversal operations. In some embodiments, the arrangement process also performs time alignment processing, that is, correcting for time series deviations caused by acquisition delays, ensuring that the initial semantic trajectory can truly reflect the temporal evolution of semantic parsing. After the initial semantic trajectory is generated, it is persisted to the storage system for subsequent processing.
[0024] The initial semantic trajectory undergoes semantic smoothing to eliminate noise fluctuations. This smoothing employs filtering techniques from digital signal processing, such as moving average filters or Kalman filters, to smooth out abnormal fluctuations in the trajectory. Noise fluctuations may originate from temporary ambiguities during the parsing process or external interference. In practice, the parameters of semantic smoothing need to be dynamically adjusted based on trajectory characteristics. For example, the size of the sliding window is adaptively determined based on the trajectory length and semantic density. The smoothing algorithm calculates the moving average of trajectory points and uses it to replace the original values, thereby suppressing random fluctuations. Semantic smoothing can also incorporate semantic context information, utilizing the semantic correlation between trajectory points to guide the smoothing process. For instance, cosine similarity can be calculated to identify and correct outliers. The smoothed initial semantic trajectory retains the main semantic trends while removing high-frequency noise.
[0025] Semantic inflection points are extracted from the initial semantic trajectory after semantic smoothing. These points are locations where the semantic direction changes significantly within the trajectory. The extraction method is based on trajectory curvature calculation and semantic vector analysis, locating inflection points by comparing angular changes or semantic distances between adjacent trajectory points. In practice, multi-scale detection algorithms can be used to extract semantic inflection points, analyzing trajectory curvature at different temporal granularities to avoid missed or false detections. The threshold for judging semantic inflection points is obtained through training on historical data, ensuring that the points accurately reflect changes in semantic structure. The extraction process also includes a feature point verification step, checking whether candidate feature points are consistent with the context semantics. For example, verifying the semantic coherence before and after the inflection point filters out false features. The extracted semantic inflection points record their temporal location and inflection intensity value.
[0026] The initial semantic trajectory is segmented into multiple semantic trajectory fragments based on semantic transition feature points. The segmentation operation uses these feature points as boundary points to divide the initial semantic trajectory into continuous segments, each representing a relatively complete semantic unit or parsing stage. In practice, the segmentation process employs a dynamic programming algorithm to optimize fragment boundaries, ensuring maximum semantic consistency within each semantic trajectory fragment. Fragment length can be adaptively adjusted based on feature point density, but minimum and maximum length limits must be set to prevent over-segmentation. After segmentation based on semantic transition feature points, the quality of each semantic trajectory fragment is evaluated, such as calculating semantic entropy or information density within the fragment. Low-quality fragments may be further subdivided or merged. The segmentation results are stored as a fragment list, and a temporal relationship index between fragments is established. Optionally, overlapping region processing can be introduced when segmenting semantic trajectory fragments, allowing for a small amount of overlap between adjacent fragments to capture semantic information near the boundaries and improve the continuity of the trajectory flow.
[0027] Each semantic trajectory segment is timestamped to form a complete semantic trajectory stream. The timestamp includes metadata such as the segment's start time, end time, and duration, calculated based on the timestamps of the original real-time semantic data points. In practice, the process of adding timestamps involves time normalization, unifying the time reference of all segments to the start time of the query parsing. The timestamps are generated using a high-precision timer to ensure their uniqueness and order. After forming the complete semantic trajectory stream, the trajectory stream data is encapsulated in a structured format.
[0028] Example 2: See Figure 2 In practical implementation, frequency distribution can be calculated using hash tables or frequency matrices. For example, a frequency dictionary can be maintained for each semantic trajectory segment, with the key being the semantic feature type and the value being the cumulative frequency of that feature within the segment. The calculation process considers the weight of the features; for example, common words have lower weights while specialized terms have higher weights, to ensure the representativeness of the frequency values. The frequency distribution results are stored in time series format, facilitating the subsequent construction of density functions. The frequency data is also normalized to eliminate biases caused by differences in segment length. In some embodiments, a sliding window mechanism can be introduced when calculating the frequency distribution. The window size is dynamically adjusted according to the average length of the semantic trajectory segments, and the window overlap rate is set to 50% to capture boundary effects. After the frequency statistics are completed, a frequency distribution curve is generated, visually displaying the temporal changes of the features.
[0029] A semantic density function is constructed based on the frequency distribution. This semantic density function is a mathematical model used to transform discrete frequency data into a continuous density estimate. The function form employs the kernel density estimation method, and its expression is as follows:
[0030] in: Indicates a point in time semantic density value, The bandwidth parameter is used to control the smoothness. It is the total number of semantic elements. It is the first The temporal location of each semantic element This is the distribution frequency value of the element. It's a kernel function. In practical implementation, the bandwidth parameter... The semantic density function is determined through maximum likelihood estimation or cross-validation to ensure it captures detail without overfitting. The kernel function is chosen based on the characteristics of the semantic data; for example, a Gaussian kernel is suitable for symmetrical distributions, while a triangular kernel is suitable for scenarios with prominent peaks. The semantic density function is constructed using numerical computation libraries, such as SciPy or a custom algorithm for convolution operations. The function output is a continuous curve covering the entire time range of the semantic trajectory segment.
[0031] The semantic concentration degree in different regions of a semantic trajectory segment is analyzed using semantic density functions. The analysis involves calculating the derivative and second derivative of the density function curve at each point to identify regions with large density variation rates. The semantic concentration degree is quantified by local maxima or information entropy of the density values. In specific implementations, the semantic concentration degree analysis employs peak detection algorithms, such as identifying points where the first derivative of the density function is zero and the second derivative is negative as local peaks. The height and width of these peaks are used to measure the concentration intensity, and the concentration degree values are mapped to a standardized range of 0-1 for easy threshold comparison. The analysis also includes region partitioning, dividing the semantic trajectory segment into multiple sub-intervals and calculating the average density of each sub-interval as a concentration degree index. The size of the sub-intervals is adaptively determined based on the segment length. In some embodiments, the semantic concentration degree analysis can be combined with multi-resolution analysis, such as using wavelet transform to examine the density distribution at different scales to capture macroscopic and microscopic concentration patterns.
[0032] Regions with semantic concentration exceeding a preset threshold are identified as high-density semantic regions. This preset threshold is dynamically set using a machine learning model based on domain knowledge; for example, an optimal threshold trained on question-and-answer data from the fire safety domain might be used. The threshold may vary depending on the type of semantic trajectory segment. In practice, a region growing algorithm is employed to identify high-density semantic regions. Starting from the peak concentration point, the region expands outwards until the concentration falls below the threshold. Gradient changes at adjacent points are checked during the expansion process to ensure region continuity. The start time, end time, and peak position of each identified high-density semantic region are recorded. The boundaries of high-density semantic regions are precisely located using interpolation methods, such as linear interpolation to estimate the time coordinates of the threshold point. The region identification results are stored in list form, with each region accompanied by a concentration score.
[0033] A semantic density distribution map is generated based on high-density semantic regions, and density levels are labeled on the map. The semantic density distribution map is a visual representation, typically in the form of a heatmap or contour map, with the horizontal axis representing time and the vertical axis representing density values. Different colors or shading represent different density levels. In specific implementations, the semantic density distribution map is generated using a plotting library. The image resolution is set according to display requirements, and density levels are automatically divided using clustering algorithms, such as K-means, which clusters density values into 3-5 classes, corresponding to high, medium, and low levels. When labeling density levels, legends and color bars are added to the distribution map, and the center points and boundaries of high-density semantic regions are marked. The distribution map is output in vector or raster format for easy viewing and subsequent processing. In some embodiments, the semantic density distribution map can be generated interactively, supporting zooming and clicking to query detailed information, but the core is a static image used for analysis. It can be understood that the semantic density distribution map is not only used for visualization but also serves as intermediate data for key region identification.
[0034] In the semantic density distribution map, the core region with the highest density level is located. Semantic relevance diffusion analysis is then performed radiating outwards from this core region. The core region is determined by finding the global maximum value point in the density distribution map; if multiple peaks exist, the region with the largest area or longest persistence is selected. In practice, a global search algorithm is used to locate the core region, traversing all high-density semantic regions, comparing their peak density and area, and selecting the region with the highest comprehensive score as the core. The coordinates of the center point of the core region are calculated using a weighted average, with the weight being the density value of each point. Semantic relevance diffusion analysis is then performed radiating outwards from the core region. The diffusion process simulates heat conduction or a random walk model. Starting from the center point, the semantic similarity between surrounding points and the core is calculated, based on word vector distance or knowledge graph relationship strength. During the diffusion analysis, the relevance value decays over time or distance, with the decay coefficient set according to the semantic trajectory characteristics. The analysis results generate a relevance distribution map, displaying the relevance strength between each point and the core. Optionally, the semantic relevance diffusion analysis can employ a graph traversal algorithm, treating the distribution map as a grid and using breadth-first search to calculate the relevance.
[0035] The detection process identifies peripheral regions whose semantic relevance exceeds a threshold. This threshold is set independently of a pre-set threshold and determined statistically, such as using the median or percentile of the relevance distribution. In practice, peripheral region detection involves scanning the relevance distribution map to identify all connected regions with relevance values greater than the threshold. Connectivity is determined based on temporal adjacency, and a connected component labeling algorithm is used to ensure region integrity. The boundaries of peripheral regions are defined by threshold segmentation, specifically the intersection of the relevance curve and the threshold line. Detected peripheral regions are recorded along with their temporal range and mean relevance. In some embodiments, multi-scale detection can be introduced, applying the threshold at different temporal granularities to avoid missing small regions. Detection results are output as a list of regions.
[0036] The core region and the detected peripheral regions are merged into a key semantic region. The merging operation employs a region fusion algorithm, such as calculating the intersection or union of the core and peripheral regions and checking semantic consistency to ensure semantic coherence within the merged region. In practice, the merging process prioritizes peripheral regions that overlap or are adjacent to the core region in time. The merging rule is based on the semantic distance between regions; only regions with a distance less than a threshold are merged. The start and end positions of the merged key semantic region are recalculated, using the minimum start time and maximum end time of the merged region. The start and end positions of the key semantic region in the semantic trajectory stream are recorded, stored as timestamps with millisecond precision, and a position index is established for subsequent extraction.
[0037] Example 3: In specific implementation, the multi-layer verification network adopts a software modular design. Each verification layer is encapsulated as an independent verifier class. These verifier classes share a unified interface specification, facilitating expansion and maintenance. The data format of the input semantic parsing unit is a structured object, containing attributes such as text content, syntax tree, and semantic role annotation. Before the verification process begins, the network state is initialized, and the parameters and thresholds of each layer are set. After the semantic parsing unit enters the multi-layer verification network, it is first cached in the input queue, and then distributed to each verification layer in sequence by the scheduler. The scheduler ensures the atomicity of verification, that is, the next layer is only entered after the verification of one layer is completed. The verification results are recorded in real time to the log system for monitoring and debugging. The first layer of the multi-layer verification network verifies the basic syntactic structure integrity of the semantic parsing unit. The basic syntactic structure integrity check focuses on the correctness at the lexical and syntactic levels. The verification algorithm analyzes the syntax parse tree constructed based on context-free grammar rules, checking the integrity of the tree structure and the legal relationships between nodes. In practice, the first layer of verification uses a bottom-up parsing algorithm, such as the Earley parser or the CYK algorithm, to convert the sentences of semantic parsing units into a syntax tree. Then, the syntax tree is traversed to verify component integrity, such as ensuring that each sentence has exactly one root node, and that the subject and predicate nodes exist and conform to grammatical rules. The verification process calculates a grammatical integrity score based on the number and severity of missing components; for example, a missing subject will result in a higher score deduction. A score below a threshold is considered a failure. This threshold is obtained through training on historical data and dynamically adjusted to adapt to different query complexities.
[0038] The second layer of the multi-layered verification network verifies the semantic logical coherence of the semantic parsing unit. Semantic logical coherence checks the logical consistency between semantic roles, such as whether the predicate and argument pairings are reasonable and whether the event sequence conforms to common-sense logic. The verification method is based on semantic role annotation technology and logical reasoning rules. In specific implementation, the second-layer verification adopts the principles of frame semantics, constructing frame elements for each predicate and checking whether the necessary elements are complete and type-matched. For example, the "fire extinguishing" event requires an agent (e.g., firefighter) and a subject (e.g., fire source). The verification algorithm calculates the association strength between semantic roles and uses vector space models or knowledge graph embeddings to measure similarity. Coherence verification includes checking for semantic conflicts, such as contradictory temporal relationships or impossible object states. The verification process generates a coherence score based on role filling rate and the number of logical errors. The scoring formula is:
[0039] in: This represents the consistency score, with a value range of [0,1]. A higher score indicates greater consistency. It is the total number of semantic role pairs in the semantic parsing unit. A role pair consists of a predicate and its arguments. It is the first The weight of each role is set based on the role type, such as core roles having a higher weight. It is the first The relevance score for each role pair is calculated using semantic similarity. The results are compared to a threshold, which is typically set to 0.7. If the threshold is higher, the test passes. The validation results include a score and a list of errors.
[0040] In the third layer of the multi-layer verification network, the semantic parsing unit is verified to match the professional terminology in the fire protection field. The terminology matching check ensures that the terms used in the parsing unit conform to fire protection standards, avoiding ambiguity or incorrect terms. The verification method is based on a fire protection professional dictionary and ontology database for term identification and matching. In specific implementation, the third layer verification loads a fire protection terminology database, such as the NFPA standard terminology set, and uses a combination of string matching and semantic matching to check whether the words in the parsing unit are in the terminology database or have synonyms. The matching degree calculation considers the contextual applicability of the term; for example, "ladder" is correct in a fire protection context, but may be invalid in common usage. The verification process generates a terminology matching score, based on the proportion of matched terms and the presence of key terms. A score below a threshold is considered a failure. The threshold is set according to the strictness of the domain. The verification algorithm uses an inverted index to accelerate matching and supports fuzzy matching to handle spelling variations.
[0041] When all three layers of verification pass, the semantic parsing unit is deemed to have passed the integrity verification. The system marks the parsing unit as complete only when the verification results of the first, second, and third layers are all true. The judgment process is executed by the verification coordinator, which aggregates the results from each layer and generates the final decision. In practice, after passing the judgment, the semantic parsing unit is marked as verified and an integrity stamp is added. It is then forwarded to subsequent processing modules, and the verification details are stored in the database for auditing. The judgment logic is implemented as a state machine to ensure consistency and traceability. It is understood that the conditions for passing the three layers of verification must be strictly met; failure at any layer will trigger a re-extraction process to prevent error propagation. Semantic parsing units that pass the judgment are considered high-quality input for core semantic element extraction.
[0042] If any layer of validation fails, the semantic parsing unit is returned to the semantic trajectory stream for re-extraction. The return mechanism involves error handling and retry logic. Failed parsing units are marked as invalid and accompanied by an error code indicating the failing layer. The re-extraction process adjusts the boundaries of key semantic regions in the semantic trajectory stream. In practice, the return operation is handled by a rollback manager. The manager re-inserts the parsing unit into the appropriate position in the semantic trajectory stream and triggers a new round of key region extraction. The number of retries is limited, such as a maximum of three to avoid looping. During re-extraction, the region boundaries may be relaxed or a more lenient validation threshold may be used. Optionally, an error report can be generated during the return process to help the system optimize validation parameters. Re-extracted parsing units are processed first to reduce latency and ensure the robustness of the overall question-answering process.
[0043] Example 4: See Figure 3 In its implementation, the parsing of fire protection professional concept entities employs a combination of rule-based and statistical methods. The rule-based part relies on a predefined fire protection terminology dictionary and regular expression patterns, while the statistical part uses conditional random fields or bidirectional long short-term memory network models to identify entity boundaries within the context. Each parsed fire protection professional concept entity is assigned a confidence score and its start and end positions in the text are marked. After parsing, the fire protection professional concept entities are normalized to standard terminology, for example, "smoke sensor" is uniformly mapped to "smoke detector" to ensure the accuracy of subsequent knowledge graph queries. The parsing results are output in the form of a structured entity list, with each entity containing metadata such as name, type, location, and confidence score. It is understandable that the accuracy of parsing fire protection professional concept entities directly affects the quality of multi-path semantic mapping; therefore, the entity recognition model needs to be trained and optimized based on large-scale fire protection domain text.
[0044] In a fire protection knowledge graph, the starting node corresponding to a fire protection professional concept entity is located. The location process involves string matching and semantic similarity calculation to find the node that precisely corresponds to the fire protection professional concept entity within the knowledge graph's node set. Nodes in the fire protection knowledge graph represent entities or concepts in the fire protection field, and edges represent relationships between nodes. In specific implementations, a multi-strategy matching algorithm is used to locate the starting node. First, precise string matching is performed; if this fails, fuzzy matching or semantic similarity matching based on word vectors is used. A similarity threshold of 0.8 or higher is set to ensure accuracy. The located starting node records its globally unique identifier and node attributes. During the location process, a fire protection professional concept entity may correspond to multiple candidate nodes. In this case, the most relevant node is selected based on contextual information, such as disambiguation by checking node type and adjacency relationships. After the starting node is located, the system verifies the node's validity to ensure it is active and contains sufficient relational information. In some embodiments, the location of the starting node can be accelerated using an index structure, such as an inverted index or the built-in indexing mechanism of a graph database, to improve query efficiency.
[0045] Starting from the initial node, a multi-directional expansion traversal is performed along the relational edges of the knowledge graph. This multi-directional expansion traversal means simultaneously exploring all outgoing and incoming edges from the initial node. The traversal strategy combines breadth-first search and depth-first search to balance coverage and computational efficiency. In practice, the multi-directional expansion traversal uses an iterative algorithm, maintaining a queue of nodes to be visited, initially containing the initial node. Each iteration removes a node from the queue, visits all its adjacent nodes, and adds the new node to the queue. The traversal path is recorded during the process to avoid loops. The directions of expansion traversal include all relation types defined in the knowledge graph, such as parent-child, sibling, and instance relationships. The width and depth of the traversal are limited by preset parameters, such as the maximum number of branches and the maximum depth, to ensure that the traversal terminates within a reasonable time. Optionally, the multi-directional expansion traversal can prioritize exploring certain high-weight relational edges. The weights are dynamically set based on the importance of the relation type; for example, an "is-a" relation may have a higher weight than a "related-to" relation.
[0046] During the extended traversal, the system records the knowledge nodes visited and their relational paths. The recording mechanism meticulously documents the identifier, attribute information, and path details for each visited knowledge node, including the sequence of nodes traversed and the sequence of edges connecting them. In practice, the recording process uses specialized data structures, such as path trees or path graphs, to store all traversal paths. Each knowledge node is accompanied by metadata such as an access timestamp and access depth. Relational paths are stored in a chained structure for easy backtracking and analysis. Recorded information is written to an in-memory database or file system in real time to prevent data loss. An index is also created to support fast path lookups. The recording format adopts a standardized protocol to ensure compatibility and scalability.
[0047] The traversal process terminates when the traversal depth reaches a preset level. The preset level is an integer parameter that controls the maximum traversal depth. For example, setting it to 3 means traversing a maximum of 3 hops from the starting node. The termination condition is achieved by comparing the current path length with the preset level value. In practice, the logic for terminating the traversal process is integrated into the traversal loop. Before expanding to a new node, the current path depth is checked. If it reaches or exceeds the preset level, further expansion stops. The preset level can be dynamically adjusted based on query complexity and system resources, but it usually has an upper limit to prevent infinite traversal. The termination process includes resource cleanup, such as releasing temporary data structures and closing database connections, and generating a traversal summary report to count the number of nodes visited and the total number of paths, ensuring that the traversal process is controllable and efficient.
[0048] All valid knowledge nodes and relationship paths are aggregated into a multi-path semantic mapping result. Validity is judged based on the relevance score between the path and the original query; paths with relevance scores below a threshold are filtered out. The aggregation operation integrates the scattered path data into a unified structured output. In specific implementation, the aggregation process uses an aggregation algorithm to classify knowledge nodes by type and group relationship paths by path pattern, generating a multi-path semantic mapping result graph. This graph is a subgraph of the original knowledge graph, containing all relevant nodes and edges. The aggregation result is stored in a graph data structure, supporting graph query operations, and can also be exported as a table or list for subsequent processing. During aggregation, the weight of each path is calculated based on factors such as path length, node importance, and relationship strength. The structure of the multi-path semantic mapping result is shown in Table 1. Table 1: Multipath Semantic Mapping Results Path ID starting node Termination Node Path length relational sequence Weighted Score P001 Smoke detector Fire alarm system 2 ["Part of Of", "Trigger"] 0.95 P002 Smoke detector Fire control room 3 ["part Of", "connection", "located in"] 0.87 P003 Automatic sprinkler system water source 2 ["Use", "Supply"] 0.92 The process involves extracting knowledge nodes relevant to the natural language query from the target mapping path. This extraction process analyzes the paths in the multi-path semantic mapping results, selecting those highly relevant to the query intent as the target mapping paths, and then extracting all knowledge nodes from these paths. In practice, semantic matching algorithms are used to extract relevant knowledge nodes, calculating the similarity between the query and the node content. Similarity is based on a bag-of-words model or deep learning embeddings; nodes with similarity scores above a threshold are retained. The global importance of nodes is considered during extraction, for example, using the PageRank algorithm to rank nodes. The extraction results generate a set of knowledge nodes, each with a relevance score. This set, after deduplication, serves as the raw material for the initial answer. The extraction process can be iterative, gradually refining the node range to improve accuracy. Optionally, a feedback mechanism can be introduced during the extraction of relevant knowledge nodes to adjust the extraction strategy based on subsequent processing results.
[0049] Semantic reorganization of knowledge nodes forms a preliminary answer. Semantic reorganization is the process of transforming discrete knowledge nodes into coherent natural language text. Reorganization methods are based on template filling, sentence generation, or text summarization techniques. In practice, semantic reorganization uses predefined answer templates containing slots, which are filled with extracted knowledge nodes. For example, the template "<device> is connected to <system> through <relationship>" forms a complete sentence after being filled. The reorganization process ensures grammatical correctness and logical coherence. After forming the preliminary answer, basic fact-checking and consistency verification are performed, such as verifying temporal relationships or numerical reasonableness. The preliminary answer is stored as text fragments with its source path marked for easy traceability.
[0050] Multiple versions of the initial answer are generated based on different semantic restructuring rules. These rules define strategies for organizing knowledge nodes into text, such as chronological order, causal relationships, or descending order of importance. Different rules produce answer versions with different styles. In practice, generating multiple versions of the initial answer is achieved by applying multiple restructuring rules in parallel. Each rule corresponds to a restructuring instance, and each instance works independently, producing one answer version. The number of versions is typically controlled to 3 to 5 to avoid information redundancy. Restructuring rules include, but are not limited to: timeline rules (organized according to event sequence), causal chain rules (emphasizing causal relationships), hierarchical structure rules (from whole to part), etc. Each answer version is accompanied by a rule identifier and a quality score, based on the answer's fluency, information content, and accuracy. The formula for the generation process is:
[0051] in: It is the first The initial answer in one version is a text string; It is the first Each semantic recombination rule corresponds to a processing function, which implements specific recombination logic. It is the set of input knowledge nodes, including node attributes and relationships; These are contextual constraints, such as query intent and user background. Multiple preliminary answers are generated simultaneously, increasing answer diversity.
[0052] The initial answer set from multiple versions undergoes deduplication to eliminate duplicate content. Deduplication identifies and merges repetitive or highly overlapping content by calculating the similarity between answer texts, retaining the most representative version. In practice, deduplication uses text similarity algorithms, such as the Jaccard coefficient or cosine similarity, to compare lexical and semantic overlap. Answers with similarity scores exceeding a threshold are grouped together, and the best version is selected from each group. The deduplication threshold is typically set to 0.7, adjusted experimentally. The deduplication process considers both the completeness and quality of expression of the answers, prioritizing the retention of information-rich and fluent versions. After deduplication, a concise candidate answer set is generated, with a controllable size to avoid burdening subsequent steps. In essence, deduplication ensures the diversity of the candidate answer set while reducing redundancy and improving system efficiency.
[0053] The deduplicated preliminary answers are grouped into a candidate answer set. This candidate answer set is a data structure containing multiple deduplicated preliminary answers and their metadata, such as version ID, reorganization rules, and generation time. In practice, the candidate answer set is formed through set operations. The deduplicated preliminary answers are added to a list or array, and each answer is assigned a unique identifier. The set supports add, delete, and query operations for easy access during subsequent confidence evaluation. The candidate answer set is serialized into a standard format for storage or transmission. The set also maintains an index, such as sorting by answer length or score, to optimize access performance.
[0054] See Figure 4 This graph visualizes the semantic relationships between various entities within a fire protection system through nodes and edges. Nodes represent different fire equipment entities, and their size and color depth reflect their confidence level; entities with higher confidence levels have greater importance in the system. Directed edges between nodes represent functional paths between entities, and edge labels display specific relationships and weight scores. The graph clearly shows the overall architecture of the fire protection system: detection equipment connects to the alarm system through triggering relationships, the fire extinguishing system connects to the water supply through control relationships, and emergency equipment works collaboratively with the main control system through linkage mechanisms. This multi-path mapping reveals the complex functional network within the fire protection system, providing a rich semantic understanding foundation for intelligent question-answering systems. Paths with higher weight scores represent the most core functional links in the system, and these paths have higher priority and credibility during answer generation.
[0055] Example 5: In specific implementation, the confidence assessment module receives a set of candidate answers as input. This set contains multiple deduplicated preliminary answers and their metadata. The assessment process processes each candidate answer in parallel, calculating three core metrics: semantic matching degree, number of supporting evidence, and semantic clarity. The confidence assessment module adopts a pipelined architecture, with each metric calculated by an independent submodule. Intermediate results are shared between submodules to reduce redundant calculations. Before assessment begins, parameters such as weight coefficients and thresholds are initialized; these parameters are trained based on historical data. The assessment process ensures transparency and reproducibility. Assessment details for each candidate answer are recorded in a log for monitoring and optimization. The output of the confidence assessment is a score list, with each candidate answer corresponding to a confidence score. It is understood that the accuracy of the confidence assessment directly determines the performance of the intelligent question-answering system; therefore, the assessment algorithm requires careful design and optimization.
[0056] The semantic matching degree between each candidate answer and the natural language query is calculated. This semantic matching degree measures the consistency between the candidate answer content and the original query intent. The calculation is based on a semantic similarity model, mapping the query and answer to the same vector space and comparing their distances. In specific implementations, the semantic matching degree calculation uses a pre-trained language model to generate semantic embedding vectors for the query and answer, and then calculates the cosine similarity as the matching degree score, normalized to between 0 and 1. The calculation process considers contextual information, such as using the complete parsing history of the query to enhance the vector representation and avoid local matching bias. The semantic matching degree calculation also introduces a domain adaptation mechanism, fine-tuning the model through fire-related domain corpora to improve relevance. In some embodiments, the semantic matching degree calculation can combine multi-granularity analysis, such as simultaneously calculating lexical, phrase, and sentence-level similarities, and then weighted and fused, but the core is a deep learning-based approach. The semantic matching degree score is calculated in real time, and the results are cached for subsequent use to ensure evaluation efficiency.
[0057] The evaluation assesses the number of supporting evidences for each candidate answer within the fire safety knowledge graph. The number of supporting evidences refers to the number of nodes and relationship paths in the fire safety knowledge graph that corroborate the correctness of the candidate answer; a higher number indicates greater reliability. In practice, the evaluation of supporting evidence is achieved by querying the fire safety knowledge graph. A graph query is constructed for each candidate answer to retrieve all nodes and paths related to the answer content, and then the number of unique pieces of evidence is counted. Evidence includes both direct and indirect evidence. A counting algorithm is used to avoid repeatedly counting the same evidence source, and evidence quantity normalization is supported by dividing by the total number of relevant nodes in the knowledge graph to eliminate scale bias. The evaluation process utilizes the query function of the graph database to efficiently perform traversal and aggregation operations, and supports storing the evidence quantity evaluation results as integer values or standardized scores. Optionally, evidence quality weighting can be introduced when evaluating the number of supporting evidences; for example, the evidence weight of core nodes is higher than that of edge nodes, but the basis is simple counting.
[0058] The semantic clarity of each candidate answer is analyzed. Semantic clarity assesses the readability and structural rationality of the answer text, including syntactic complexity, lexical difficulty, and logical coherence. In practice, natural language processing techniques are used to analyze semantic clarity, such as calculating sentence length, nesting depth, and passive voice proportion, while also employing readability formulas. Clarity analysis also includes checking text fluency, for example, calculating perplexity using a language model; lower perplexity indicates clearer expression. The analysis process generates a clarity score, which is based on a weighted average of multiple indicators, with weights learned through a regression model. The clarity assessment module integrates a text processing library for real-time analysis, ensuring low latency, and the analysis results are standardized to the 0-1 range for easy comparison. In some embodiments, a user feedback mechanism can be introduced to analyze semantic clarity, but offline evaluation primarily relies on automated metrics.
[0059] A confidence score is generated by combining semantic matching degree, the amount of supporting evidence, and semantic clarity. The synthesis process employs a weighted summation model, merging the scores of the three indicators into a single overall confidence score. The weights reflect the importance of each indicator. In practice, a linear combination formula is used to generate the confidence score:
[0060] in: This indicates the final confidence score; It is a semantic matching score, calculated using vector similarity. This is the score of the number of supporting evidence, after normalization. It is a semantic clarity score, based on text analysis metrics; , , These are weighting coefficients, obtained through machine learning optimization on the training data. and A higher confidence score is more important, reflecting the relevance of the content. After generating the confidence score, calibration is performed, for example, by using the sigmoid function to adjust the distribution, to ensure that the scores are fair and comparable. The scoring process is batch-processed, efficiently outputting the confidence score for each candidate answer.
[0061] The system compares the confidence scores of all candidate answers in the candidate answer set and selects the candidate answer with the highest confidence score as the preferred answer. This comparison operation is implemented using a sorting algorithm, ranking the candidate answers in descending order of confidence score and selecting the top answer as the preferred one. In practice, quicksort or heapsort algorithms are used to compare confidence scores, ensuring efficiency when handling a large number of candidate answers. The comparison process considers cases with equal scores, breaking ties through additional rules such as answer length or generation time. After selecting the preferred answer, the system verifies its usability, for example, by checking if the answer is empty or invalid, ensuring the quality of the preferred answer. The selection logic is implemented as a maximum value query and integrated into the decision module.
[0062] The selected answers undergo semantic optimization to ensure they conform to natural language expression standards. Semantic optimization includes text polishing, grammatical correction, and terminology standardization to improve readability and professionalism. In practice, a hybrid approach of rule-based and model-based methods is used. The rule component applies a grammar checker to correct syntactic errors, while the model component uses a sequence-to-sequence model for text rewriting. Optimization focuses on eliminating redundancy, adjusting word order, and improving coherence. Semantic optimization ensures answers conform to domain standards, such as standardizing the use of fire safety terminology and avoiding colloquial expressions. The process may be iterative until the answer quality reaches a threshold. Optimized answers undergo manual rule checking, but this is primarily automated to ensure consistency. The semantic optimization module outputs the optimized text and records a change log.
[0063] The semantically optimized answer is output as the intelligent question-answering result. The output process formats the answer content and selects the output format (plain text, HTML, or structured data) based on the application scenario. In practice, the intelligent question-answering result is output via API interface or message queue. The system encapsulates the answer and its metadata (such as confidence score and source path) as a response object and returns it to the client. Final verification is performed before output, such as checking whether the answer responds to the original query to prevent bias. The output result is recorded in the database for analysis and improvement. The intelligent question-answering result serves as the endpoint of the process, completing the entire question-answering cycle.
[0064] See Figure 5This bar chart presents the quality evaluation results of candidate answers in an intelligent question-answering system from multiple dimensions. Each candidate answer is comprehensively evaluated based on three core indicators: semantic matching degree, number of supporting evidence, and semantic clarity, ultimately deriving a comprehensive confidence score. Semantic matching degree reflects the consistency between the answer content and the user's query intent; the number of supporting evidence reflects the strength of the answer's corroboration within the knowledge graph; and semantic clarity assesses the readability and logical coherence of the answer text. By comparing the performance of different candidate answers across these dimensions, the optimal answer can be identified, and its strengths can be understood. Answers with high comprehensive confidence scores typically perform well across multiple dimensions, exhibiting good balance. This multi-dimensional evaluation mechanism ensures the accuracy and reliability of the intelligent question-answering system's output, while providing clear directions for system optimization. The evaluation results also show the performance differences of the system when processing different types of queries, providing important reference for subsequent algorithm tuning and model training.
[0065] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. An intelligent question and answer method in the field of fire safety, characterized by, The method comprises: constructing a semantic trajectory stream in a natural language query processing process, wherein the semantic trajectory stream comprises a plurality of semantic trajectory segments arranged in time sequence; performing semantic density analysis on a plurality of the semantic trajectory segments to generate a semantic density distribution map corresponding to each semantic trajectory segment; identifying a key semantic region in the semantic trajectory segment based on the semantic density distribution map, and marking a time marker point corresponding to the key semantic region; extracting a semantic analysis unit corresponding to the key semantic region from the semantic trajectory stream according to the time marker point; inputting the semantic analysis unit into a multi-layer verification network for analysis integrity verification; when the analysis integrity verification passes, obtaining a core semantic element in the semantic analysis unit; performing multi-path semantic mapping in the fire knowledge graph based on the core semantic element; generating a candidate answer set according to the multi-path semantic mapping result; performing confidence evaluation on the candidate answer set, and selecting the candidate answer with the highest confidence as the intelligent question and answer result.
2. The intelligent question answering method in the field of fire safety according to claim 1, characterized in that, The step of constructing a semantic trajectory stream in a natural language query processing process comprises: collecting real-time semantic data points generated in the analysis process of the natural language query; performing semantic integrity detection on the real-time semantic data points to filter incomplete semantic data points; arranging the detected semantic data points in time sequence to form an initial semantic trajectory; performing semantic smoothing processing on the initial semantic trajectory to eliminate noise fluctuations in the semantic trajectory; extracting semantic turning feature points from the initial semantic trajectory after semantic smoothing processing; segmenting the initial semantic trajectory into a plurality of semantic trajectory segments based on the semantic turning feature points; adding a time stamp identifier to each semantic trajectory segment to form a complete semantic trajectory stream.
3. The intelligent question answering method in the field of fire safety according to claim 2, characterized in that, The step of performing semantic density analysis on a plurality of the semantic trajectory segments to generate a semantic density distribution map corresponding to each semantic trajectory segment comprises: calculating the distribution frequency of semantic elements in each semantic trajectory segment; constructing a semantic density function according to the distribution frequency; analyzing the semantic concentration degree of different regions in the semantic trajectory segment through the semantic density function; identifying regions with a semantic concentration degree exceeding a preset threshold as high-density semantic regions; generating a semantic density distribution map based on the high-density semantic regions, and annotating the density level in the semantic density distribution map.
4. The intelligent question answering method in the field of fire safety according to claim 3, characterized in that, The step of identifying a key semantic region in the semantic trajectory segment based on the semantic density distribution map comprises: locating the core region with the highest density level in the semantic density distribution map, and performing semantic correlation degree diffusion analysis to the periphery centering on the core region; detecting peripheral regions with a semantic correlation degree exceeding a correlation threshold; merging the core region and the detected peripheral regions into a key semantic region, and recording the starting position and the ending position of the key semantic region in the semantic trajectory stream.
5. The intelligent question answering method in the field of fire safety according to claim 1, characterized in that, The step of inputting the semantic analysis unit into a multi-layer verification network for analysis integrity verification comprises: verifying the basic syntax structure integrity of the semantic analysis unit in the first layer of the multi-layer verification network; verifying the semantic logical coherence of the semantic analysis unit in the second layer of the multi-layer verification network; The third layer of the multi-layer verification network is matched with the professional terms in the fire safety field; When the three layers of verification are passed, the semantic parsing unit is determined to pass the integrity verification by parsing; If any layer of verification fails, the semantic parsing unit is returned to the semantic trajectory stream for re-extraction.
6. The intelligent question answering method in the field of fire safety according to claim 1, characterized in that, The step of performing multi-path semantic mapping in the fire knowledge graph based on the core semantic elements includes: Analyzing the fire professional concept entity contained in the core semantic element, and locating the starting node corresponding to the fire professional concept entity in the fire knowledge graph; Starting from the starting node, multi-directional expansion traversal is performed along the relationship edges of the knowledge graph; Record the knowledge nodes and their relationship paths during the expansion traversal process; When the traversal depth reaches the preset level, terminate the expansion traversal process; All valid knowledge nodes and relationship paths are summarized as multi-path semantic mapping results.
7. The intelligent question answering method in the field of fire safety according to claim 6, characterized in that, The step of generating a candidate answer set according to the multi-path semantic mapping results includes: Extracting the knowledge nodes related to the natural language query from the target mapping path; Performing semantic reorganization on the knowledge nodes to form a preliminary answer; Generating multiple versions of the preliminary answer based on different semantic reorganization rules; De-duplicate processing is performed on the multiple versions of the preliminary answer to eliminate duplicate answer content; The de-duplicated preliminary answer forms a candidate answer set.
8. The intelligent question answering method in the field of fire safety according to claim 1, characterized in that, The step of evaluating the confidence of the candidate answer set includes: Calculating the semantic matching degree of each candidate answer and the natural language query; Evaluating the number of supporting evidence of each candidate answer in the fire knowledge graph; Analyzing the semantic expression clarity of each candidate answer; Integrating the semantic matching degree, the number of supporting evidence, and the semantic expression clarity to generate a confidence score.
9. The intelligent question answering method in the field of fire safety according to claim 8, characterized in that, The step of selecting the candidate answer with the highest confidence as the intelligent question and answer result includes: Comparing the confidence scores of all candidate answers in the candidate answer set, and selecting the candidate answer with the highest confidence score as the preferred answer; Performing semantic optimization processing on the preferred answer to ensure that the answer conforms to the natural language expression specification; The preferred answer after semantic optimization processing is output as the intelligent question and answer result.
10. A natural language query system in the field of fire safety comprising a memory, a processor and a computer program stored in the memory and running on the processor, characterized in that, The processor, when executing the computer program, implements the steps of the intelligent question and answer method in the fire safety field according to any one of claims 1 to 9.
Citation Information
Patent Citations
Question and answer pair generation method and system based on large language model and data enhancement
CN120067274A
Intelligent question and answer method based on knowledge graph
CN120297415A
Question and answer method and device based on knowledge graph retrieval and large language model
CN120950652A