Fire knowledge graph construction method and device, equipment and storage medium

The automated construction of fire knowledge graphs using named entity annotation and dynamic label vectors addresses the inefficiency of manual methods, enhancing robot efficiency in fire rescue by integrating fire fighting knowledge.

CN119128165APending Publication Date: 2024-12-13SHENZHEN UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410937285.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-12
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

The low degree of automated construction of knowledge graphs in fire environments hinders the efficiency of robots in fire rescue, as current methods rely heavily on manual construction by experts.

Method used

A method for constructing a fire knowledge graph involving named entity annotation, entity relationship determination, and knowledge triple construction using a preset named entity recognition model, which includes dynamically adjusting label vectors and utilizing character representation vectors to automate the process.

Benefits of technology

Automated construction of fire knowledge graphs enhances the efficiency of robots in fire rescue by systematically integrating fire fighting knowledge, improving the accuracy and rationality of decision-making processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119128165A_ABST
    Figure CN119128165A_ABST
Patent Text Reader

Abstract

The invention discloses a fire knowledge graph construction method and device, equipment and a storage medium, and relates to the technical field of knowledge graph construction, and the method comprises the steps: carrying out the named entity labeling of a fire corpus, and obtaining a fire entity data set based on the labeled fire corpus; wherein a character representation vector corresponding to the named entity in the fire entity data set is composed of a character vector of a character in the named entity and a dynamic label vector corresponding to the character; determining entity relationships corresponding to all entity pairs in the fire entity data set through a preset named entity recognition model; constructing a fire knowledge triple based on the fire entity data set and the entity relationship; and constructing a fire knowledge graph based on the fire knowledge triple. According to the technical scheme, the technical problem that the fire rescue efficiency of the robot is affected due to the fact that the automatic construction degree of the knowledge graph in the fire environment is low in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of knowledge graph construction, and in particular to methods, devices, equipment and storage media for constructing fire knowledge graphs. Background Art

[0002] With the continuous development and maturity of robotics technology, robotics technology has been widely used in various industries, including emergency rescue fields with high risks and high complexity. When facing complex and high-risk fire environments, the autonomous decision-making of robots plays a vital role. As one of the emerging technologies in the field of artificial intelligence, knowledge graphs play a key role in fire scenes. They can help robots better understand and reason about the relationship between entities and make autonomous decisions. Among them, the automatic construction of fire knowledge graphs for fire knowledge, the design of efficient reasoning methods for unmanned systems, and the realization of reasoning in complex and harsh fire environments have broad research and application prospects.

[0003] However, many application scenarios of domain knowledge graphs are extremely cautious and serious, so the quality of knowledge is extremely high. This means that the construction process relies heavily on the participation of experts and requires manual construction, resulting in a relatively low degree of automated construction of knowledge graphs in fire environments, which in turn affects the efficiency of robots in fire rescue.

[0004] The above contents are only used to assist in understanding the technical solution of the present invention and do not constitute an admission that the above contents are prior art. Summary of the invention

[0005] The main purpose of this application is to provide a method, device, equipment and storage medium for constructing a fire knowledge graph, aiming to solve the technical problem in the prior art that the degree of automated construction of knowledge graphs in fire environments is low, which affects the efficiency of robots in fire rescue.

[0006] To achieve the above objectives, this application proposes a method for constructing a fire knowledge graph, the method comprising:

[0007] Performing named entity annotation on a fire corpus, and obtaining a fire entity data set based on the annotated fire corpus; wherein the character representation vector corresponding to the named entity in the fire entity data set is composed of a character vector of a character in the named entity and a dynamic label vector corresponding to the character;

[0008] Determine the entity relationships corresponding to all entity pairs in the fire entity dataset by using a preset named entity recognition model;

[0009] Constructing a fire knowledge triple based on the fire entity data set and the entity relationship;

[0010] A fire knowledge graph is constructed based on the fire knowledge triples.

[0011] In one embodiment, the step of performing named entity tagging on the fire corpus and obtaining a fire entity dataset based on the annotated fire corpus includes:

[0012] The fire corpus is annotated with named entities using the BIO annotation method to obtain an annotated fire corpus, wherein the annotated fire corpus is annotated with the start character, middle character and end character of the named entity, and non-named entity characters;

[0013] Determining an initial label weight vector set based on the annotated fire corpus;

[0014] Dynamically adjusting the label vectors of all characters in the annotated fire corpus according to the initial label weight vector set to obtain dynamic label vectors corresponding to the characters;

[0015] Concatenate the character vector of the character and the dynamic label vector to obtain a character representation vector;

[0016] The named entities in the annotated fire corpus are determined based on the character representation vectors to obtain a fire entity dataset based on the named entities.

[0017] In one embodiment, the step of dynamically adjusting the label vectors of all characters in the annotated fire corpus according to the initial label weight vector set to obtain the dynamic label vectors corresponding to the characters includes:

[0018] Searching for an initial label vector of a target character in the annotated fire corpus from the initial label weight vector set;

[0019] Determine a sum of label weights of a first label and a second label of the initial label vector;

[0020] Determine whether the tag weight sum is less than a non-entity tag threshold;

[0021] If yes, the character after the target character and adjacent to the target character in the annotated fire corpus is determined as a new target character, and the process returns to the step of searching the initial label vector of the target character in the annotated fire corpus from the initial label weight vector set;

[0022] or, if not, comparing the entity length of the entity corresponding to the target character with a target value;

[0023] Based on the comparison result, the label vectors of all characters in the annotated fire corpus are dynamically adjusted to obtain dynamic label vectors corresponding to the characters.

[0024] In one embodiment, the step of dynamically adjusting the label vectors of all characters in the annotated fire corpus based on the comparison result to obtain the dynamic label vectors corresponding to the characters includes:

[0025] If the entity length of the entity corresponding to the target character is the target value, the label of the target character is determined to be the first label, and the position of the second label in the initial label vector is set to zero;

[0026] Comparing a first weighted sum of the first tags with the non-entity tag threshold;

[0027] If the first weight sum is less than the non-entity tag threshold, returning to the step of determining the character after the target character and adjacent to the target character in the annotated fire corpus as a new target character;

[0028] Alternatively, if the entity length of the entity corresponding to the target character is greater than the target value, the length weight of the target character is determined, and the label vector of the target character is dynamically adjusted based on the length weight to obtain a dynamic label vector corresponding to the character.

[0029] In one embodiment, the step of determining the entity relationships corresponding to all entity pairs in the fire entity dataset by using a preset named entity recognition model includes:

[0030] Determine a first starting position and a first ending position of a head entity in the fire entity data set, and a second starting position and a second ending position of a tail entity by a preset named entity recognition model;

[0031] Constructing an entity pair vector of entity pairs in the fire entity dataset based on the first starting position, the first ending position, the second starting position, and the second ending position;

[0032] The entity pair vector is input into a fully connected layer to determine the entity relationships corresponding to all entity pairs in the fire entity dataset.

[0033] In one embodiment, the step of constructing a fire knowledge graph based on the fire knowledge triples includes:

[0034] Determine the frequency of occurrence of the head entity and the co-occurrence frequency of entity pairs in the fire knowledge triple; wherein the frequency of occurrence of the head entity is the frequency of the entity in the fire entity data set appearing as the head entity, and the co-occurrence frequency of the entity pair is the frequency of the co-occurrence of the head entity and the tail entity in the fire entity data set;

[0035] Determining the probability of the entity pair according to the occurrence frequency of the head entity and the co-occurrence frequency of the entity pair;

[0036] Determine the frequency of occurrence of the tail entity in the fire knowledge triple; wherein the frequency of occurrence of the tail entity is the frequency of the entity in the fire entity data set appearing as the tail entity;

[0037] Determining the specificity of the entity pair according to the occurrence frequency of the tail entity and the co-occurrence frequency of the entity pair;

[0038] A fire knowledge graph is constructed based on the probability, the specificity and the fire knowledge triples.

[0039] In one embodiment, after the step of constructing a fire knowledge graph based on the fire knowledge triples, the method further includes:

[0040] Constructing the fire knowledge graph to determine the decision polynomial for executing tasks in a fire scenario;

[0041] Constructing a decision weight strategy tree based on the decision polynomial;

[0042] Determine whether a target fire entity in the decision weight strategy tree is associated in the fire knowledge graph;

[0043] If so, determining the association weight value between the target fire entities;

[0044] An optimal entity combination is determined based on the association weight value, and a fire rescue plan is generated based on the optimal entity combination.

[0045] In addition, to achieve the above purpose, the present application also proposes a fire knowledge graph construction device, the device comprising:

[0046] An entity annotation module, used to annotate a fire corpus with named entities, and obtain a fire entity data set based on the annotated fire corpus; wherein the character representation vector corresponding to the named entity in the fire entity data set is composed of a character vector of a character in the named entity and a dynamic label vector corresponding to the character;

[0047] An entity relationship determination module, used to determine the entity relationships corresponding to all entity pairs in the fire entity data set by using a preset named entity recognition model;

[0048] A triple construction module, used for constructing fire knowledge triples based on the fire entity data set and the entity relationship;

[0049] A knowledge graph construction module is used to construct a fire knowledge graph based on the fire knowledge triples.

[0050] In addition, to achieve the above-mentioned purpose, the present application also proposes a fire knowledge graph construction device, which includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, and the computer program is configured to implement the steps of the fire knowledge graph construction method as described above.

[0051] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the fire knowledge graph construction method described above are implemented.

[0052] The present application provides a method for constructing a fire knowledge graph, which discloses named entity annotation of a fire corpus and obtaining a fire entity data set based on the annotated fire corpus; wherein the character representation vector corresponding to the named entity in the fire entity data set is composed of the character vector of the character in the named entity and the dynamic label vector corresponding to the character; the entity relationship corresponding to all entity pairs in the fire entity data set is determined by a preset named entity recognition model; fire knowledge triples are constructed based on the fire entity data set and the entity relationship; a fire knowledge graph is constructed based on the fire knowledge triples; compared with the prior art, the domain knowledge graph needs to be manually constructed by human, resulting in a relatively low degree of automated construction of the knowledge graph in the fire environment. Since the present invention constructs fire knowledge triples based on the fire entity data set and the entity relationship of all entity pairs in the fire entity data set, and realizes the automated construction of the fire knowledge graph based on the fire knowledge triples, the technical problem of the prior art that the automated construction of the knowledge graph in the fire environment is low and affects the efficiency of the robot in fire rescue is solved. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0054] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0055] Figure 1 A flow chart of the first embodiment of the fire knowledge graph construction method of the present application;

[0056] Figure 2 A framework diagram for automatically constructing a fire knowledge graph in the fire knowledge graph construction method of this application;

[0057] Figure 3 A flow chart of the second embodiment of the fire knowledge graph construction method of the present application;

[0058] Figure 4 This is a schematic diagram of the process of dynamically calculating label vectors in Embodiment 2 of the fire knowledge graph construction method of this application;

[0059] Figure 5 A flow chart of the fire knowledge graph construction method provided in Example 3 of this application;

[0060] Figure 6 This is a framework diagram of the relationship extraction model in Embodiment 3 of the fire knowledge graph construction method of this application;

[0061] Figure 7 This is a diagram showing the decision weight strategy tree in the fire knowledge graph construction method of this application;

[0062] Figure 8 A diagram showing the fire scene decision weight strategy tree in the fire knowledge graph construction method of this application;

[0063] Fig. 9 This is a schematic diagram of the module structure of the fire knowledge graph construction device of the embodiment of the present application;

[0064] Fig.10 This is a schematic diagram of the device structure of the hardware operating environment involved in the fire knowledge graph construction method in the embodiment of the present application.

[0065] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0066] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0067] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0068] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a fire knowledge graph construction device, etc. The following takes the fire knowledge graph construction device as an example (hereinafter referred to as the device) to illustrate this embodiment and the following embodiments.

[0069] Based on this, the present application embodiment provides a method for constructing a fire knowledge graph, referring to Figure 1 , Figure 1This is a flow chart of the first embodiment of the fire knowledge graph construction method of the present application.

[0070] In this embodiment, the fire knowledge graph construction method includes steps S10 to S40:

[0071] Step S10: perform named entity annotation on the fire corpus, and obtain a fire entity dataset based on the annotated fire corpus; wherein the character representation vector corresponding to the named entity in the fire entity dataset is composed of the character vector of the character in the named entity and the dynamic label vector corresponding to the character.

[0072] It should be noted that the fire corpus can be a database composed of sentences related to fire knowledge. In practical applications, data such as fire science knowledge related to fire can be obtained from relevant web pages by crawling, so as to build a fire corpus based on these data.

[0073] In this embodiment, we can first determine the ontology concepts involved in the fire field: the fire ontology is formed by abstracting the information, data and knowledge related to fire fighting to form a consensus entity or object, and the system is composed according to the specific relationship between entity types. The purpose of constructing a fire knowledge graph in this scheme is to systematically integrate fire fighting knowledge as the knowledge brain for autonomous unmanned systems to provide fire support. Therefore, the designed fire ontology only needs to focus on the objective knowledge of fire fighting. First, it is necessary to determine the scope of the fire ontology field and clearly define fire support as the scope of application. Since current research lacks discussion on the fire ontology and there is no ontology to refer to, it is necessary to combine expert knowledge to summarize and abstract the concepts in the fire field and determine their hierarchical relationships.

[0074] Specifically, the ontology of fire in this embodiment may include: a fire environment ontology and a fire task ontology, wherein the fire environment ontology uniformly describes the conceptual hierarchical relationship and association relationship of the fire environment, and is a unified description of fire knowledge and the on-site environment. The fire environment ontology defined in this scheme is divided into two categories: fire scenarios and fire-fighting commands, wherein the fire scenarios are further divided into five subcategories: combustibles, fire types, fire environment types, meteorological conditions, and emergency situations, and the fire-fighting commands are further divided into two subcategories: fire resources and fire buildings. The fire task ontology uniformly describes the classification and association relationship of fire tasks, and is a unified description of different tasks in fire scenarios. The fire task ontology defined in this scheme can abstract the tasks involved therein, and divide the fire task ontology into two categories: fire-fighting tasks and prevention tasks.

[0075] It should be noted that after the information, data and knowledge related to fire fighting are abstracted and formed into entities or objects with consensus, the text data collected in the fire corpus can be annotated with named entities according to the ontology concept. In this embodiment, the named entity annotation can be performed through the NER model (Named Entity Recognition, named entity recognition model), that is, words with specific named entities are identified from the unstructured text in the fire corpus, and they are classified into predefined entity categories. In this embodiment, the NER model can be annotated with BIO, which can be used to annotate the boundaries and categories of named entities. In this embodiment, the starting character of a named entity can be annotated with B, the middle and end characters can be annotated with I, and the non-named entity characters can be annotated with O, thereby obtaining the annotated fire corpus.

[0076] It should be noted that the fire entity dataset may be a dataset composed of fire entities in a fire corpus. In this embodiment, since the annotated fire corpus is annotated with the start character, middle character, and end character of the named entity and the non-named entity character, the fire entities can be directly obtained from the annotated fire corpus, and the fire entity dataset can be constructed based on these fire entities.

[0077] It should be noted that the above-mentioned character representation vector can be a weight-based vector used to characterize each character in the fire entity; accordingly, the above-mentioned character vector can be a static vector used to characterize each character in the fire entity; the above-mentioned dynamic label vector can be a dynamic vector used to characterize each character in the fire entity.

[0078] In practical applications, for NER models, the traditional dictionary vector space and computational complexity are low, but there are problems of context loss and static representation, and the traditional BERT pre-training model can effectively capture the contextual information of the text, but it is insensitive to local information at the entity level. Therefore, this scheme can combine the advantages of these two methods and propose a weighted dynamic label vector to replace the static character vector generated by Word2Vec. First, the label vector of each character is dynamically calculated according to the input sentence and the designed weight algorithm by word frequency-inverse document frequency weighting (that is, the above-mentioned dynamic label vector is obtained), and then it is spliced ​​with the character vector obtained by the BERT pre-training model during pre-training to obtain the final character representation vector. Among them, the weighted dynamic label vector can not only dynamically adjust the character vector according to the input corpus, but also its vector dimension is only related to the entity category, so that it can supplement the BERT vector with a lower dimension. The fusion of character dynamic vectors and static vectors in this scheme improves the perception ability of the NER model to entity label information.

[0079] Step S20: Determine the entity relationships corresponding to all entity pairs in the fire entity dataset by using a preset named entity recognition model.

[0080] It should be understood that the above-mentioned preset named entity recognition model is a model used to recognize words of a specific named entity. The preset named entity recognition model in this embodiment may include but is not limited to a NER model.

[0081] It is understandable that the entity pair may be a structure obtained by combining the head entity and the tail entity in the named entity. Correspondingly, the entity relationship may be a relationship between the head entity and the tail entity in the entity pair.

[0082] Step S30: constructing fire knowledge triples based on the fire entity dataset and the entity relationships.

[0083] It should be noted that the fire knowledge triple can be a triple consisting of a head entity, a tail entity, and the relationship between the head entity and the tail entity related to fire. In this embodiment, during the model training process, the relationship extraction model can be trained to learn the characteristics of each entity pair relationship in the sentence in the fire entity data set, and combined with the NER model, so as to input a natural language text and automatically obtain all the fire knowledge triples involved in the text.

[0084] Step S40: constructing a fire knowledge graph based on the fire knowledge triples.

[0085] It should be understood that the fire knowledge graph may be a graph used for performing knowledge reasoning in fire scenarios.

[0086] In practical applications, a fire knowledge graph can be constructed based on knowledge graph embedding technology. Specifically, fire knowledge triples can be mapped into a vector space to simplify reasoning operations and retain the inherent structure between triples, so that entities of the same category or with similar semantics are adjacent in the vector space, and the relationship between triples can be implicit in the vector space, thereby obtaining a fire knowledge graph.

[0087] In the specific implementation, refer to Figure 2 , Figure 2 This is a framework diagram for automatically constructing a fire knowledge graph in the fire knowledge graph construction method of this application. Figure 2As shown, first, data such as fire science knowledge can be obtained from relevant web pages by crawling, so as to build a fire corpus based on these data, and the data in the fire corpus can be cleaned and labeled, so as to build a fire entity data set based on the labeled fire corpus. After that, the fire entity data set can be input into the NER model for training, wherein the NER model can obtain named entities and entity relationships of entity pairs from the fire entity data set, and input this information into the relation extraction model, so that the relation extraction model outputs fire knowledge triples based on this information, and finally builds a fire knowledge graph based on the fire knowledge triples, thereby realizing the automatic construction of the fire knowledge graph.

[0088] The present embodiment provides a method for constructing a fire knowledge graph, which discloses named entity annotation of a fire corpus, and obtains a fire entity data set based on the annotated fire corpus; wherein the character representation vector corresponding to the named entity in the fire entity data set is composed of the character vector of the character in the named entity and the dynamic label vector corresponding to the character; the entity relationship corresponding to all entity pairs in the fire entity data set is determined by a preset named entity recognition model; fire knowledge triples are constructed based on the fire entity data set and the entity relationship; a fire knowledge graph is constructed based on the fire knowledge triples; compared with the prior art, the domain knowledge graph needs to be manually constructed by human, resulting in a relatively low degree of automated construction of the knowledge graph in the fire environment. Since the present embodiment constructs the fire knowledge triples based on the fire entity data set and the entity relationship of all entity pairs in the fire entity data set, and realizes the automated construction of the fire knowledge graph based on the fire knowledge triples, the technical problem of the prior art that the automated construction of the knowledge graph in the fire environment is low and affects the efficiency of the robot in fire rescue is solved.

[0089] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 3 , Figure 3 A flow chart of the second embodiment of the fire knowledge graph construction method of the present application is provided.

[0090] In this embodiment, step S10 further includes steps S101 to S105:

[0091] Step S101: using the BIO annotation method to annotate the fire corpus with named entities to obtain an annotated fire corpus, wherein the annotated fire corpus is annotated with the start character, middle character and end character of the named entity, and non-named entity characters.

[0092] It should be noted that the BIO marking method may be a method for marking the boundaries and categories of named entities, which may mark the starting character of a named entity as B, the middle and ending characters as I, and non-named entity characters as O.

[0093] Step S102: determining an initial label weight vector set based on the annotated fire corpus.

[0094] It should be noted that the initial label weight vector set can be a set of weights of the labels of each entity in the annotated fire corpus. In practical applications, there are 18 entity categories in the fire ontology, and according to the definition of BIO labels, each entity has two labels, namely, B and I labels of this type of entity, so the dimension of each label vector is 19 dimensions, as shown in equations (1) and (2). The value of each dimension in the label vector can be calculated from the entire annotated training data set using the TF-IDF frequency. Specifically, e BIO Each value in represents the weight of each tag in the corpus:

[0095] e BIO =[O,B resource ,I resource ,…,B mission ,I mission ] (1)

[0096]

[0097] Step S103: dynamically adjusting the label vectors of all characters in the annotated fire corpus according to the initial label weight vector set to obtain dynamic label vectors corresponding to the characters.

[0098] In this embodiment, the label vector of each character in the character sequence in the annotated fire corpus can be dynamically modified according to the initial label weight vector set. Specifically, step S103 includes:

[0099] Step S103a: searching for the initial label vector of the target character in the annotated fire corpus from the initial label weight vector set.

[0100] It is understandable that the target character can be any character in a character sequence in the annotated fire corpus. Accordingly, the initial label vector is the label vector of the target character initially stored in the initial label weight vector set.

[0101] Step S103b: Determine the sum of the label weights of the first label and the second label of the initial label vector.

[0102] It should be noted that the first tag may be a B tag; correspondingly, the second tag may be an I tag.

[0103] Step S103c: Determine whether the tag weight sum is less than the non-entity tag threshold.

[0104] It should be noted that the non-entity label threshold is the threshold of label O.

[0105] Step S103d: If yes, the character after the target character and adjacent to the target character in the annotated fire corpus is determined as a new target character, and the process returns to the step of searching the initial label vector of the target character in the annotated fire corpus from the initial label weight vector set.

[0106] In practical applications, refer to Figure 4 , Figure 4 This is a schematic diagram of the process of dynamically calculating the label vector in the second embodiment of the fire knowledge graph construction method of this application. Figure 4 As shown, the process of dynamically modifying the label vector can be: Step 1: Define 4 parameters, T O , T I , T E , l and w il , where T O represents the threshold of label O (i.e. the above non-entity label threshold); T I represents the threshold of label I; T E Indicates the threshold for the end of the entity; l indicates the length of the entity being processed, that is, the current judgment is up to the lth bit; w il represents the length weight of the current character, which is negatively correlated with l. The order of processing the input character sequence is from front to back, T O , T I , T E is a global parameter. Step 2: First, from the initial label weight vector set E BIO Find the current character c i (i.e. the target character above) iBIO , then calculate the weights and w of the B label and I label iBI , and then determine the weight and w iBI Is it less than the non-entity label threshold T? O , if w iBI Less than T O , indicating c i The probability is very high that it is an O label, and there is no need to dynamically modify e at this time iBIO , read the next character c i+1 (i.e. the new target character), that is, c i+1 Determine the new target character and proceed to step 2.

[0107] Or, step S103e: if not, then comparing the entity length of the entity corresponding to the target character with the target value.

[0108] Specifically, the step S103f includes: if the entity length of the entity corresponding to the target character is the target value, determining the label of the target character as the first label, and setting the position of the second label in the initial label vector to zero; comparing the first weight sum of the first label with the non-entity label threshold; if the first weight sum is less than the non-entity label threshold, returning to the step of determining the character after the target character and adjacent to the target character in the annotated fire corpus as a new target character; or, if the entity length of the entity corresponding to the target character is greater than the target value, determining the length weight of the target character, and dynamically adjusting the label vector of the target character based on the length weight to obtain the dynamic label vector corresponding to the character.

[0109] Step S103f: dynamically adjusting the label vectors of all characters in the annotated fire corpus based on the comparison result to obtain dynamic label vectors corresponding to the characters.

[0110] In this embodiment, if Figure 4 As shown, the process of dynamically modifying the label vector also includes: Step 3: Determine the value of l (i.e., the entity length of the entity corresponding to the target character). If l is 1 (i.e., the above target value), it means that c i is the beginning of an entity, that is, it belongs to the B tag, then e iBIO The positions of the I labels are all set to 0, and then the weights of the B labels and w are calculated. iB , if w iBI Less than T O Then it means c i There is still a high probability that it is an O label, read the next character c i+1 , repeat step 2. Otherwise, c i The highest probability is B label, so e iBIO Temporarily save as e B , return to step 2 to process c i+1 Step 4: If the entity length l of the entity corresponding to the target character is greater than the target value 1, it means c i is an internal character of an entity, and the length weight w of the target character is obtained by formula (3): il , where the weight is inversely proportional to l and decreases as l increases, playing a role in constraining the I label. Then use w il With e B Dynamically modify the label vector. Specifically, for the I label, it is as shown in formula (4); for the B label, it is as shown in formula (5).

[0111] w il =e 5-l (3)

[0112] e′ iI =e iI ·w il ·e B (4)

[0113]

[0114] In the formula, e iI Indicates e iBIO The vector of the I label position, e iB Indicates e iBIO The vector of the label position in B, e′ iI and e′ iB They represent the modified label vectors respectively. Therefore, as l increases, the weight of the I label will decrease and the weight of the B label will increase, indicating that it is more likely to be a new entity.

[0115] Step 5: After the fourth step, calculate the label vector e of the previous character one by one (i-1)BIO The I label weight w (i-1)j , j represents the jth I label and is related to the dynamic I label threshold T I ′ comparison, where T I ' is calculated by formula (6), e (i-1)O Indicates the O label weight of the previous character. If there is w (i-1)j Greater than T I ′, then it means c i-1 The possibility of being an I label is still very large, so c is enhanced by formula (7) i The weight of the label in, where e iIB Indicates e iBIO The vector of B and I labels in e′ iI and e′ iB The vector combination of e′ iIB Indicates the modified label vector. Otherwise, there is no need to modify the label vector.

[0116] T I ′=T I ×e (i-1)O (6)

[0117] e′ iIB =e iIB ·w il (7)

[0118] Step 6: Finally calculate e iBIO The I label weight and w iI , if less than TE Then it means c i There is a high probability that it is an O label, c i-1 is the last character of the previous entity, go back to step 2, and replace the modified e′ iBIO Reset back to the initial vector and set l to 1. Otherwise, set c i Treat it as an I label and return to step 2 to process c i+1 .

[0119] This embodiment can dynamically adjust the label vector of a character through the above steps, and then obtain the dynamic label vector corresponding to the character.

[0120] Step S104: concatenate the character vector of the character and the dynamic label vector to obtain a character representation vector.

[0121] In this embodiment, the BERT vector E of the character sequence is BERT (i.e. the above character vector) and the dynamic label vector E BIO The concatenation is called TagBERT vector, which makes the semantic vector representation of each character more consistent with the corpus characteristics of the field, forming a more comprehensive vector representation E concat (i.e. the above character representation vector), as shown in formula (8):

[0122] E concat =[E BERT ,E BIO ] (8)

[0123] This solution concatenates the dynamic label vector with the vector obtained by the BERT pre-training model. On the one hand, it replaces the high-dimensional character vector of Word2Vec technology with a low-dimensional label vector. On the other hand, it can adapt to the input character sequence and flexibly modify the vector representation, so that the final concatenated vector can reasonably represent the input sequence while considering the entire corpus, thereby improving the performance of the NER model.

[0124] Step S105: determining named entities in the annotated fire corpus based on the character representation vectors, so as to obtain a fire entity dataset based on the named entities.

[0125] In practical applications, the NER model can adapt to the input character sequence and flexibly modify the vector representation to reasonably represent the input character sequence, that is, to obtain the character representation vector. Then, the named entities in the character sequence in the annotated fire corpus can be obtained according to the character representation vector, and a fire entity dataset can be constructed based on these named entities.

[0126] In this embodiment, a BIO annotation method is used to annotate a fire corpus with named entities to obtain an annotated fire corpus; an initial label weight vector set is determined based on the annotated fire corpus; the label vectors of all characters in the annotated fire corpus are dynamically adjusted according to the initial label weight vector set to obtain a dynamic label vector corresponding to the character; the character vector and the dynamic label vector of the character are concatenated to obtain a character representation vector; the named entities in the annotated fire corpus are determined based on the character representation vector to obtain a fire entity data set based on the named entities. This embodiment improves the perception ability of the NER model to entity label information by fusing the dynamic vector of the character with the static vector, thereby improving the accuracy and rationality of the constructed fire knowledge graph.

[0127] In the third embodiment of the present application, the same or similar contents as those in the above embodiment can be referred to the above description, and will not be described in detail later. Figure 5 , Figure 5 A flow chart of the third embodiment of the fire knowledge graph construction method of the present application is provided.

[0128] In this embodiment, step S20 further includes steps S201 to S203:

[0129] Step S201: Determine a first starting position and a first ending position of a head entity, and a second starting position and a second ending position of a tail entity in the fire entity data set by using a preset named entity recognition model.

[0130] It should be noted that the first start position and the first end position are the start position and the end position of the head entity respectively; the second start position and the second end position are the start position and the end position of the tail entity respectively. Figure 6 , Figure 6 This is a framework diagram of the relationship extraction model in the third embodiment of the fire knowledge graph construction method of this application. Figure 6 As shown in the figure, the character sequence c1,…,c n After inputting into the preset named entity recognition model NER, the starting position h of the head entity $h$ can be obtained Start and end position h End , if there are multiple tail entities, then get the starting positions of multiple tail entities t Start and end position t EndAt the same time, after the character sequence passes through the NER module, it will not only output the location information of the entity, but also the BIO tag information of each character. At this time, the BIO tag information of each character can be expanded to a 19-dimensional one-hot encoding representation and concatenated with the BERT vector generated by the BERT module to achieve a joint representation of named entities and labels. This vector representation enables the model to learn the implicit features of BIO tag information and relationship classification, thereby improving the accuracy of relationship extraction.

[0131] Step S202: constructing an entity pair vector of entity pairs in the fire entity data set based on the first starting position, the first ending position, the second starting position and the second ending position.

[0132] In practical applications, after obtaining the entity and label joint representation vector of each character in the previous step, we can Start ,h End , t Start , t End Find the overall vector e of each entity h ,e t1 ,…,e tn Since in the original relation extraction model, only the head and tail pointer vectors of the entity are used to calculate the representation of an entity, this processing cannot fully capture the characteristics of the entity. Therefore, the relation extraction model of this scheme can use the averaging method to calculate the vector representation of each entity. Specifically, Figure 6 As shown, in this embodiment, the head entity h can be associated with each tail entity t1, ..., t n Combine to form entity pairs, and use vector addition to obtain the vector representation of each entity pair, and obtain the above entity pair vector, which is represented by e h-t1 ,…,e h-tn .

[0133] Step S203: input the entity pair vector into a fully connected layer to determine the entity relationships corresponding to all entity pairs in the fire entity dataset.

[0134] In this embodiment, after obtaining the vector representation of each entity pair in the previous step, the vector representation of each entity pair can be obtained as follows: h-t1 ,…,e h-tn Input to have N r A fully connected layer with N output units, where N r Indicates the number of relationship categories of entity pairs. The activation function of this fully connected layer is the sigmoid function, which consists of multiple linear classifiers, and the number of classifiers is N. r , as shown in formula (9):

[0135]

[0136] In the formula, represents the relationship prediction vector of the i-th entity pair, which has N r Dimensions, e i represents the vector representation of the input entity pair, and the weight matrix W r With the bias vector b r is the training parameter.

[0137] The maximum likelihood function for training optimization is shown in formula (10):

[0138]

[0139] In the formula, r represents the predicted relationship (i.e., entity relationship), e represents the set of entity pairs, L represents the number of entity pairs, if z is true, then I{z} = 1, otherwise I{z} = 0, Indicates whether the predicted relationship r of the i-th entity pair is correct, and the parameter θ = {W r ,b r}.

[0140] Its loss function is expressed by the cross entropy loss function, as shown in formula (11):

[0141]

[0142] Furthermore, the step S40 includes:

[0143] Step S401: Determine the frequency of occurrence of the head entity and the co-occurrence frequency of entity pairs in the fire knowledge triplet; wherein the frequency of occurrence of the head entity is the frequency of the entity in the fire entity data set appearing as the head entity, and the co-occurrence frequency of the entity pair is the frequency of the co-occurrence of the head entity and the tail entity in the fire entity data set.

[0144] It should be noted that knowledge graph embedding technology is a widely used knowledge representation method, which maps knowledge triples into vector space to simplify reasoning operations and retain the inherent structure between triples, so that entities of the same category or with similar semantics are adjacent in the vector space, and the relationship between triples can be implicit in the vector space. However, existing knowledge graph embedding technologies focus on mining the connection between entities and relationships, ignoring the objective fact that entity pairs will appear repeatedly in large-scale triples. Therefore, this scheme can make full use of the characteristics of the co-occurrence frequency of entity pairs and design two types of universal attribute values ​​for entity pairs, namely probability and specificity, to improve the performance of link prediction tasks of different models.

[0145] Step S402: Determine the probability of the entity pair according to the occurrence frequency of the head entity and the co-occurrence frequency of the entity pair.

[0146] It should be understood that the probability of an entity pair can be a value used to represent the possibility of repeated occurrence of an entity pair. In practical applications, the frequency of repeated occurrence of an entity pair, to a certain extent, represents the strength of the semantic relationship of the entity pair. If an entity pair appears multiple times in a triple, it means that the head entity and the tail entity have a strong semantic connection even in different relationships. Therefore, the probability of an entity pair can be defined in this solution and used to improve the link prediction task.

[0147] In the specific implementation, we can first count the frequency N of each entity appearing as the head entity from the fire knowledge triples. o (H), that is, the head entity h i The out-degree n represents the number of head entities contained in the overall triple, and counts the co-occurrence frequency N of each head entity and its tail entity co (H,T), where N co (h i ,t j ) represents the number of co-occurrences between the i-th head entity and its j-th tail entity, and m represents the number of tail entities t that the i-th head entity has. Finally, according to the head entity frequency N o (H) Co-occurrence frequency with entity pair N co (H, T), calculate the probability of the entity pair.

[0148] Step S403: determining the occurrence frequency of the tail entity in the fire knowledge triple; wherein the occurrence frequency of the tail entity is the frequency of the entity in the fire entity data set appearing as the tail entity.

[0149] Step S404: determining the specificity of the entity pair according to the occurrence frequency of the tail entity and the co-occurrence frequency of the entity pair.

[0150] It should be noted that the specificity of an entity pair can be a value indicating the importance of the tail entity in the entity pair. i ,r,t j ), in all j The proportion of triples with tail entities is high, indicating that t j It has unique representation capabilities for this entity pair.

[0151] In the specific implementation, the frequency N of each entity appearing as the tail entity can be counted from the fire knowledge triples. o (T), that is, the tail entity t j The in-degree, m represents the number of tail entities contained in the overall triple, and then according to the tail entity frequency N o (T) Co-occurrence frequency with entity pair N co (H,T), calculate each entity pair (h i ,r,tj ) specificity.

[0152] Step S405: construct a fire knowledge graph based on the probability, the specificity and the fire knowledge triples.

[0153] In practical applications, the above steps can be used to obtain the probability and specificity attribute values ​​of each triple (h, r, t). Then, the PS function can be defined to combine it with various link prediction scores based on knowledge graph embedding to correct the link prediction scores and improve the accuracy of the link prediction task. Specifically, the definition of the PS function is divided into two categories according to the scoring function of the knowledge graph embedding model. If the scoring function value of the knowledge graph embedding model used is smaller, the better the effect, such as the translation-based and distance-based embedding model TransE, the definition of the PS function is as shown in formula (12):

[0154] PS(h i ,t j )=(P(h i ,t j ))·9S9h i ,t j )) (12)

[0155] Since the scoring function at this time represents the error of translating from the head entity h to the tail entity t using the relationship r, the smaller the value of the scoring function, the smaller the conversion error, the more reasonable the representation of the knowledge triple in the vector space, and the better the prediction effect of the model.

[0156] In addition, if the value of the scoring function of the knowledge graph embedding model used is larger, the effect is better, such as the embedding model DistMult based on semantic similarity, then the definition of the PS function is as shown in formula (13):

[0157] P9h i ,t j )=(1+P(h i ,t j ))·(1+S(h i ,t j )) (13)

[0158] Since the scoring function at this time represents the degree of semantic association between entity pairs and their relationships, the larger the value of the function, the closer the entity pairs and their relationships with the same semantics are distributed in the vector space, the more reasonable the representation of knowledge triples in the vector space, and the better the prediction effect of the model.

[0159] Under the above two types of knowledge graph embedding models, the final link prediction scoring function is as shown in formula (14):

[0160] f r′(h i ,t j ) = f r (h i ,t j )·PS(h i ,t j ) (14)

[0161] In the formula, f r (h,t) represents the triple (h i ,r,t j ), the original score is obtained by embedding the knowledge graph, f′ r (h, t) represents the score after correction by PS function.

[0162] Furthermore, after step S40, the method further includes:

[0163] Step S501: construct the fire knowledge graph to determine the decision polynomial for executing tasks in a fire scenario.

[0164] It should be noted that, according to the fire knowledge graph, firefighting resources can be divided into the following categories according to their components: foam fire extinguishers, carbon dioxide fire extinguishers, and water-type fire extinguishers. The weight values ​​of different types of fire extinguishers are set to 1, 2, and 3, which can be seen as: "Foam fire extinguisher: 1", "Carbon dioxide fire extinguisher: 2", and "Water-type fire extinguisher: 3", but in fact it can be converted to: "Firefighting resources: foam fire extinguisher, carbon dioxide fire extinguisher, water-type fire extinguisher". This model can classify the types of firefighting resources, and only needs to set weights for different categories to distinguish them. Figure 7 , Figure 7 This is a diagram showing the decision weight strategy tree in the fire knowledge graph construction method of this application. Figure 7 As shown, in this scheme, according to the above description, {("foam fire extinguisher" or "carbon dioxide fire extinguisher" or "water-type fire extinguisher") and "wood"} can be designed as the access strategy logic expression of the task decision, and the classification of fire-fighting resources is assigned corresponding weights. The logical type of the decision can be converted to: {"fire-fighting resources: W" and "wood"}, where "fire-fighting resources: W" in the fire-fighting resource classification includes {"foam fire extinguisher: 1", "carbon dioxide fire extinguisher: 2", "water-type fire extinguisher: 3"}, thereby constructing a decision weight strategy tree.

[0165] Step S502: constructing a decision weight strategy tree based on the decision polynomial.

[0166] It should be noted that the decision polynomial may be a polynomial used to make decisions on tasks to be performed in a fire scene. The decision weight strategy tree may be a strategy tree constructed based on weights for making decisions on fire rescue plans. Figure 8, Figure 8 This is a diagram showing the fire scene decision weight strategy tree in the fire knowledge graph construction method of this application. As shown in formula (15), the visualization of the decision polynomial and the entity type represented by each letter are as follows: Figure 8 As shown:

[0167] Mission=(a or b) and (c or (d or (e or (f or g)))) (15)

[0168] Among them, the weight table based on the decision weight strategy tree consists of three dimensions: the first dimension represents the number of fire entities in the fire knowledge graph: {e1,e2,…,e n}; The second dimension represents the fire relationship type in the fire knowledge graph: {r1,r2,…,r m}; The third dimension represents the weight of the entity in the first dimension and all other fire entities: {w1,…,w i ,…,w n-1}.

[0169] Step S503: Determine whether the target fire entity in the decision weight strategy tree is associated in the fire knowledge graph.

[0170] It should be noted that when making decisions on fire rescue plans, you can first perform a search access, that is, determine whether the input keyword group (that is, the above-mentioned target fire entity) has a relational association in the fire knowledge graph. Specifically, the decision weight strategy tree can query the weight values ​​of the associations of these keyword groups through the category weight set. The time complexity is O(d). If the threshold access value is reached, it is determined that there is an association.

[0171] Step S504: If so, determine the association weight value between the target fire entities.

[0172] In this embodiment, if there is an association between target fire entities, it is possible to determine whether the entity category of the target fire entity meets the access condition based on the decision polynomial. If the entity category meets the polynomial, the weight value of the input entity category is queried, the credibility is determined based on the scoring function, and the task operation is given.

[0173] Step S505: determining an optimal entity combination based on the association weight value, and generating a fire rescue plan based on the optimal entity combination.

[0174] It should be noted that if the entity category does not satisfy the polynomial, the missing entity category can be obtained through the decision polynomial, the weight of the input keyword can be compared with all the entities in the missing entity category, and the optimal entity combination can be obtained by sorting, and then the task operation is given through the above operation to generate a fire rescue plan.

[0175] In this embodiment, the access strategy can be combined with the fire entity set by designing a decision weight strategy tree, and weight values ​​are assigned to the attribute nodes of the strategy tree based on the knowledge graph embedding technology, so that reasonable fire-fighting support plans can be efficiently generated or recommended, thereby improving the efficiency of fire rescue.

[0176] In this embodiment, an entity pair vector of an entity pair in a fire entity data set is constructed based on the first starting position, the first ending position of the head entity and the second starting position and the second ending position of the tail entity; the entity pair vector is input into a fully connected layer to determine the entity relationships corresponding to all entity pairs in the fire entity data set, thereby forming a fire knowledge triple. In addition, since this embodiment can construct a fire knowledge graph based on the probability, specificity and fire knowledge triples of entity pairs, the characteristics of the co-occurrence frequency of entity pairs can be fully utilized, thereby improving the accuracy of link prediction and the efficiency of knowledge reasoning.

[0177] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the fire knowledge graph construction method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0178] This application also provides a fire knowledge graph construction device, please refer to Fig. 9 , the fire knowledge graph construction device comprises:

[0179] The entity annotation module 10 is used to annotate the fire corpus with named entities and obtain a fire entity data set based on the annotated fire corpus; wherein the character representation vector corresponding to the named entity in the fire entity data set is composed of the character vector of the character in the named entity and the dynamic label vector corresponding to the character;

[0180] An entity relationship determination module 20, used to determine the entity relationships corresponding to all entity pairs in the fire entity data set by using a preset named entity recognition model;

[0181] A triple construction module 30, used to construct a fire knowledge triple based on the fire entity data set and the entity relationship;

[0182] The knowledge graph construction module 40 is used to construct a fire knowledge graph based on the fire knowledge triples.

[0183] The fire knowledge graph construction device provided by the present application adopts the fire knowledge graph construction method in the above embodiment, which can solve the technical problem that the degree of automation construction of the knowledge graph in the fire environment in the prior art is low, which affects the efficiency of the robot in fire rescue. Compared with the prior art, the beneficial effects of the fire knowledge graph construction device provided by the present application are the same as the beneficial effects of the fire knowledge graph construction method provided by the above embodiment, and the other technical features in the fire knowledge graph construction device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0184] The present application provides a fire knowledge graph construction device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the fire knowledge graph construction method in the above-mentioned embodiment one.

[0185] Reference below Fig.10 , which shows a schematic diagram of the structure of a fire knowledge graph construction device suitable for implementing the embodiment of the present application. The fire knowledge graph construction device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig.10 The fire knowledge graph construction device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0186] like Fig.10As shown, the fire knowledge graph construction device may include a processing device 1001 (such as a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. Various programs and data required for the operation of the fire knowledge graph construction device are also stored in RAM1004. The processing device 1001, ROM1002 and RAM1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 can allow the fire knowledge graph construction device to communicate wirelessly or wired with other devices to exchange data. Although the figure shows a fire knowledge graph construction device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have alternatively.

[0187] The fire knowledge graph construction device provided by the present application adopts the fire knowledge graph construction method in the above embodiment, which can solve the technical problem of fire knowledge graph construction. Compared with the prior art, the beneficial effects of the fire knowledge graph construction device provided by the present application are the same as the beneficial effects of the fire knowledge graph construction method provided by the above embodiment, and the other technical features in the fire knowledge graph construction device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0188] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0189] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the fire knowledge graph construction method in the above-mentioned embodiment.

[0190] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may 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 or 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 this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0191] The above-mentioned computer-readable storage medium may be included in the fire knowledge graph construction device; or it may exist independently without being assembled into the fire knowledge graph construction device.

[0192] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned fire knowledge graph construction method, and can solve the technical problem that the degree of automation construction of the knowledge graph in the fire environment in the prior art is low, which affects the efficiency of the robot in fire rescue. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the fire knowledge graph construction method provided by the above-mentioned embodiment, and will not be repeated here.

[0193] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A method for constructing a fire knowledge graph, characterized in that: The method includes: Performing named entity annotation on a fire corpus, and obtaining a fire entity data set based on the annotated fire corpus; wherein the character representation vector corresponding to the named entity in the fire entity data set is composed of a character vector of a character in the named entity and a dynamic label vector corresponding to the character; Determine the entity relationships corresponding to all entity pairs in the fire entity dataset by using a preset named entity recognition model; Constructing a fire knowledge triple based on the fire entity data set and the entity relationship; A fire knowledge graph is constructed based on the fire knowledge triples.

2. The method according to claim 1, characterized in that The step of performing named entity annotation on the fire corpus and obtaining a fire entity dataset based on the annotated fire corpus includes: The fire corpus is annotated with named entities using the BIO annotation method to obtain an annotated fire corpus, wherein the annotated fire corpus is annotated with the start character, middle character and end character of the named entity, and non-named entity characters; Determining an initial label weight vector set based on the annotated fire corpus; Dynamically adjusting the label vectors of all characters in the annotated fire corpus according to the initial label weight vector set to obtain dynamic label vectors corresponding to the characters; Concatenate the character vector of the character and the dynamic label vector to obtain a character representation vector; The named entities in the annotated fire corpus are determined based on the character representation vectors to obtain a fire entity dataset based on the named entities.

3. The method according to claim 2, characterized in that The step of dynamically adjusting the label vectors of all characters in the annotated fire corpus according to the initial label weight vector set to obtain the dynamic label vectors corresponding to the characters comprises: Searching for an initial label vector of a target character in the annotated fire corpus from the initial label weight vector set; Determine a sum of label weights of a first label and a second label of the initial label vector; Determine whether the tag weight sum is less than a non-entity tag threshold; If yes, the character after the target character and adjacent to the target character in the annotated fire corpus is determined as a new target character, and the process returns to the step of searching the initial label vector of the target character in the annotated fire corpus from the initial label weight vector set; or, if not, comparing the entity length of the entity corresponding to the target character with a target value; Based on the comparison result, the label vectors of all characters in the annotated fire corpus are dynamically adjusted to obtain dynamic label vectors corresponding to the characters.

4. The method according to claim 3, characterized in that The step of dynamically adjusting the label vectors of all characters in the annotated fire corpus based on the comparison result to obtain the dynamic label vectors corresponding to the characters includes: If the entity length of the entity corresponding to the target character is the target value, the label of the target character is determined to be the first label, and the position of the second label in the initial label vector is set to zero; Comparing a first weighted sum of the first tags with the non-entity tag threshold; If the first weight sum is less than the non-entity tag threshold, returning to the step of determining the character after the target character and adjacent to the target character in the annotated fire corpus as a new target character; Or, if the entity length of the entity corresponding to the target character is greater than the target value, the length weight of the target character is determined, and the label vector of the target character is dynamically adjusted based on the length weight to obtain the dynamic label vector corresponding to the character.

5. The method according to any one of claims 1 to 4, characterized in that The step of determining the entity relationships corresponding to all entity pairs in the fire entity data set by using a preset named entity recognition model includes: Determine a first starting position and a first ending position of a head entity in the fire entity data set, and a second starting position and a second ending position of a tail entity by a preset named entity recognition model; Constructing an entity pair vector of entity pairs in the fire entity dataset based on the first starting position, the first ending position, the second starting position, and the second ending position; The entity pair vector is input into a fully connected layer to determine the entity relationships corresponding to all entity pairs in the fire entity dataset.

6. The method according to claim 5, characterized in that The step of constructing a fire knowledge graph based on the fire knowledge triples includes: Determine the frequency of occurrence of the head entity and the co-occurrence frequency of entity pairs in the fire knowledge triple; wherein the frequency of occurrence of the head entity is the frequency of the entity in the fire entity data set appearing as the head entity, and the co-occurrence frequency of the entity pair is the frequency of the co-occurrence of the head entity and the tail entity in the fire entity data set; Determining the probability of the entity pair according to the occurrence frequency of the head entity and the co-occurrence frequency of the entity pair; Determine the frequency of occurrence of the tail entity in the fire knowledge triple; wherein the frequency of occurrence of the tail entity is the frequency of the entity in the fire entity data set appearing as the tail entity; Determining the specificity of the entity pair according to the occurrence frequency of the tail entity and the co-occurrence frequency of the entity pair; A fire knowledge graph is constructed based on the probability, the specificity and the fire knowledge triples.

7. The method according to claim 1, characterized in that After the step of constructing a fire knowledge graph based on the fire knowledge triples, the method further includes: Constructing the fire knowledge graph to determine the decision polynomial for executing tasks in a fire scenario; Constructing a decision weight strategy tree based on the decision polynomial; Determine whether a target fire entity in the decision weight strategy tree is associated in the fire knowledge graph; If so, determining the association weight value between the target fire entities; An optimal entity combination is determined based on the association weight value, and a fire rescue plan is generated based on the optimal entity combination.

8. A fire knowledge graph construction device, characterized in that: The device comprises: An entity annotation module, used to annotate a fire corpus with named entities, and obtain a fire entity data set based on the annotated fire corpus; wherein the character representation vector corresponding to the named entity in the fire entity data set is composed of a character vector of a character in the named entity and a dynamic label vector corresponding to the character; An entity relationship determination module, used to determine the entity relationships corresponding to all entity pairs in the fire entity data set by using a preset named entity recognition model; A triple construction module, used for constructing fire knowledge triples based on the fire entity data set and the entity relationship; A knowledge graph construction module is used to construct a fire knowledge graph based on the fire knowledge triples.

9. A fire knowledge graph construction device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the method for constructing a fire knowledge graph as described in any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the fire knowledge graph construction method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Forest fire danger notification semantic analysis method based on knowledge graph

    CN121902817A