Knowledge extraction method, system and equipment for intelligent operation and maintenance and storage medium
By performing sentence-breaking word segmentation and nested entity annotation on texts in the field of intelligent operation and maintenance, combined with the feature fusion of semantics and positional features, the problem of nested entity recognition and entity relationship extraction is solved, and the accuracy of knowledge extraction is improved.
Patent Information
- Application Number
- CN202411192498.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2025-02-07
AI Technical Summary
The prior art does not have the best recognition of nested entities in the field of intelligent operation and maintenance, and cannot fully capture all types of information in structured input, especially in scenarios where an in-depth understanding of entity relationships in a specific domain is required.
By obtaining the text to be identified, performing sentence-breaking and word-partitioning processing to obtain multiple named entities, and performing entity type annotation on nested entities, using semantic features and position features to fusion to generate entity type tags. At the same time, a global relationship classification mechanism is used to extract relationships between entities to build a relationship triple.
It improves the recognition effect of nested entities in texts in the intelligent operation and maintenance field, enhances the accuracy of relationship extraction between named entities, and thus improves the accuracy of knowledge extraction results.
Smart Images

Figure CN119398048A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent operation and maintenance, and in particular to a knowledge extraction method, system, device and storage medium for intelligent operation and maintenance. Background Art
[0002] The construction of knowledge graphs mostly relies on knowledge extraction technology, which includes three elements: entity extraction (named entity recognition), entity relationship extraction, and attribute extraction. Attribute extraction can be done by using python crawlers to crawl websites such as Baidu Encyclopedia and Wikipedia, which is relatively simple to operate. Therefore, named entity recognition and entity relationship extraction are very important parts of knowledge extraction. Named entity recognition and entity relationship extraction are two independent tasks. The named entity recognition task is to find entities with descriptive meaning in a sentence, while relationship extraction is to extract the relationship between two entities and extract useful triple information from the entities.
[0003] The existing technology usually uses deep learning-based methods to realize knowledge extraction. When performing named entity recognition, the named entity recognition task is usually converted into a sequence labeling task, and the BIO labeling system is used to label each token with a label. The full name of BIO in English is Begin-Inside-Outside, where B (Begin) represents the starting part of the entity, I (Inside) represents the internal composition of the entity, X represents the category of the entity, and O (Outside) represents other non-entity parts. The BIO labeling system consists of two parts: the entity name and the entity category. For simple entities, two-segment labels are used; for complex entities, three-segment labels are used to represent a word. The first segment describes the position of the simple entity to which the word belongs in the complex entity, the second segment describes the position of the word in the complex entity, and the third segment represents the entity category of the complex entity to which the word belongs.
[0004] Then the neural network model is used as the relation extraction model for relation extraction. At present, the joint neural model proposed by Bekoulis et al. in 2017 is often used for relation extraction. The joint neural model proposed by Bekoulis et al. in 2017 is a multi-head selection framework that can perform joint entity relation extraction. The joint neural model detects the head entity and then extracts the corresponding relationship and tail entity, thereby achieving the purpose of automatically extracting multiple entities and relationships at one time.
[0005] However, the existing knowledge extraction technology still has the following problems:
[0006] 1. The current named entity recognition model does not perform well in recognizing nested entities in texts in the field of intelligent operation and maintenance. Nested entities refer to situations in which one entity contains another entity in a text. Take the sentence "System warning: Unable to connect to the database server. Please check the network connection and make sure the database service is running." as an example. The two entities "database server" and "database service" appear in the text at the same time, and there is a certain semantic association between them. "Database server" and "database service" are nested entities. The current relationship extraction model cannot fully utilize entity information, resulting in limited representation capabilities of entity relationships, which affects the performance of the model.
[0007] 2. Although the multi-head selection model proposed by Bekoulis et al. can focus on input information from different angles through the multi-head attention mechanism, it may still not be able to fully capture all types of information in the structured input, especially in scenarios that require a deep understanding of entity relationships in a specific field. At the same time, in the field of intelligent operation and maintenance, the relationship between entities is often not limited to a single sentence or paragraph, but spans multiple text units (each sentence in the text is regarded as a text unit). This complex relationship across text units places higher requirements on the knowledge extraction model. The existing knowledge extraction technology performs poorly when processing complex relationships across text units. Summary of the invention
[0008] In order to improve the accuracy of knowledge extraction results, a knowledge extraction method, system, device and storage medium for intelligent operation and maintenance are provided.
[0009] In order to achieve the above-mentioned objective of the present invention, according to a first aspect of the present invention, the present invention provides a knowledge extraction method for intelligent operation and maintenance.
[0010] The present invention provides a knowledge extraction method for intelligent operation and maintenance, comprising:
[0011] Get the text to be recognized;
[0012] Perform sentence segmentation and word segmentation processing on each sentence in the text to divide it into multiple text segments, and obtain multiple named entities through the multiple text segments;
[0013] The entity type of each named entity is marked. If there are nested entities in the sentence, the probability of each nested entity belonging to each entity type is calculated to obtain a statistical result, and the entity type of each nested entity is determined according to the statistical result;
[0014] Input the sentence with the named entities marked into the relation extraction model, and the relation extraction model extracts the relations of all the named entities in the text to obtain the relation information between the entities;
[0015] Extract attribute information of each named entity in the text;
[0016] The entity type, attribute information and relationship information between entities of each named entity in the text are stored to complete knowledge extraction.
[0017] Optionally, the labeling of the entity type of each named entity includes:
[0018] Predict the entity type of each named entity in the text and obtain the semantic features of each named entity;
[0019] Assign a position code to each named entity to obtain the position features of each named entity;
[0020] The semantic features and position features of each named entity are fused to obtain composite features;
[0021] An entity type label of the named entity is generated based on the composite feature, and an entity type label is added to both ends of the named entity to complete the entity type labeling of the named entity.
[0022] Optionally, the method further comprises:
[0023] Determine whether the named entity is the first named entity in the sentence, and if the named entity is the first named entity in the sentence, add head entity tags at both ends of the named entity;
[0024] It is determined whether the named entity is the last named entity in the sentence. If the named entity is the last named entity in the sentence, a tail entity tag is added to both ends of the named entity.
[0025] Optionally, the relation extraction model extracts relations from all named entities in the text, and obtains the relationship information between entities including:
[0026] Perform relation extraction on all entity pairs in each sentence, where each entity pair includes two matching named entities.
[0027] A global relationship classification mechanism is used to extract the features of each entity pair and obtain the entity relationship of each entity pair;
[0028] By constructing entity relationship triples for each entity pair and storing them in the knowledge base, the relationship information between entities is obtained.
[0029] Optionally, the extracting features of the two named entities using a global relationship classification mechanism to obtain entity relationships of each entity pair includes:
[0030] The dense feature matrix of the two named entities is extracted through the maximum pooling operation to obtain two entity feature vectors;
[0031] Extract the semantic features of the sentences containing the two named entities to obtain the sentence feature vector;
[0032] Perform a dimension-up operation on the two entity feature vectors so that the entity feature vector and the sentence feature vector are consistent in dimension;
[0033] The two entity feature vectors after dimension upgrade are fused with the sentence feature vector to obtain a comprehensive feature vector;
[0034] The comprehensive feature vector is normalized and then input into the classifier. The classifier scores multiple candidate entity relationships between two named entities and selects the candidate entity relationship with the highest score as the final entity relationship output.
[0035] Optionally, the method further includes annotating the relationship between each statement and the entity pairs in the statement:
[0036] Traverse all the sentences in the article and filter out the sentences that contain only one named entity. The sentences that contain only one named entity are recorded as first-category sentences, and the sentences that contain at least two named entities are recorded as second-category sentences.
[0037] Identify the first type of sentences as sentences that do not contain relations, and classify the first type of sentences into the set of unlabeled sentences;
[0038] Determine the number of entity relationship triples in each second-category sentence:
[0039] If the second type of statement contains only one entity relationship triple, the relationship between the second type of statement and the entity pair is annotated in the format of: statement + entity pair + entity relationship;
[0040] If the second-category statement contains more than two entity relationship triples, the second-category statement is copied so that the number of second-category statements is consistent with the number of entity relationship triples in the second-category statement, so as to ensure that each second-category statement corresponds to only one entity relationship triple, and the relationship between each second-category statement and the entity pair is marked respectively;
[0041] Put the annotated second-category sentences into the annotated sentence set.
[0042] Optionally, a data dictionary is established, the data dictionary including a plurality of different business domain modules, each of which stores common word information corresponding to each business domain, the common word information including naming information, entity type information and attribute information of the common words.
[0043] In order to solve the above problems, the present invention also provides a knowledge extraction method system for intelligent operation and maintenance, the system comprising:
[0044] An acquisition module, used to acquire text to be recognized;
[0045] A recognition module, used for segmenting each sentence in the text into multiple text segments, and obtaining multiple named entities through the multiple text segments;
[0046] A first labeling module is used to label the entity type of each named entity. If there are nested entities in the sentence, the probability of each nested entity belonging to each entity type is calculated to obtain a statistical result, and the entity type of each nested entity is determined according to the statistical result;
[0047] A relation extraction module is used to input the sentence with the named entities marked into the relation extraction model, and the relation extraction model extracts the relations of all the named entities in the text to obtain the relation information between the entities;
[0048] The attribute extraction module is used to extract the attribute information of each named entity in the text;
[0049] The storage module is used to store the entity type, attribute information and relationship information between entities of each named entity in the text to complete knowledge extraction.
[0050] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:
[0051] at least one processor; and,
[0052] a memory communicatively connected to the at least one processor; wherein,
[0053] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the above-mentioned knowledge extraction method for intelligent operation and maintenance.
[0054] In order to solve the above problems, the present invention also provides a computer-readable storage medium, in which at least one computer program is stored. The at least one computer program is executed by a processor in an electronic device to implement the above-mentioned knowledge extraction method for intelligent operation and maintenance.
[0055] In summary, this application includes the following beneficial technical effects:
[0056] This method constructs the named entity recognition task as a text classification task, and selects the named entities in the sentence according to the segmentation results of the sentence. For nested entities, the entity type of the nested entity is determined by calculating the probability that two semantically similar texts belong to each entity category, so as to distinguish between semantically similar nested entities and improve the recognition effect of nested entities in the text of intelligent operation and maintenance field.
[0057] Adding information about the location of named entities to entity tags. Since two named entities in a text may be far apart, but the relationship between them is closely connected, encoding the location features of each named entity can more effectively capture the long-distance association of each named entity. Even if the named entities are not in directly adjacent positions, their relationship can be understood, thereby further improving the accuracy of the relationship extraction results between named entities, and thus improving the accuracy of the knowledge extraction results;
[0058] By establishing a domain-specific dictionary, the accuracy of the basic word segmentation algorithm and the keyword extraction algorithm can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 A schematic diagram of a flow chart of a knowledge extraction method for intelligent operation and maintenance provided by an embodiment of the present invention;
[0060] Figure 2 A schematic diagram of a flow chart of steps for labeling entity types of each named entity provided in an embodiment of the present invention;
[0061] Figure 3 A flowchart of the step of extracting relations among all named entities in a text and obtaining information about relations between entities using a relation extraction model provided in one embodiment of the present invention;
[0062] Figure 4 A schematic diagram of a process for extracting features of each entity pair using a global relationship classification mechanism to obtain entity relationships of each entity pair provided by an embodiment of the present invention;
[0063] Figure 5 A schematic diagram of a flow chart of a knowledge extraction method for intelligent operation and maintenance provided by another embodiment of the present invention;
[0064] Figure 6 A functional module diagram of a knowledge extraction method system for intelligent operation and maintenance provided by an embodiment of the present invention;
[0065] Figure 7 A schematic diagram of the structure of an electronic device for implementing the knowledge extraction method for intelligent operation and maintenance provided by an embodiment of the present invention.
[0066] Figure numerals: 10, processor; 11, memory; 12, communication bus; 13, communication interface; 61, acquisition module; 62, identification module; 63, first labeling module; 64, relationship extraction module; 65, attribute extraction module; 66, storage module.
[0067] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0068] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0069] In the description of the present invention, it is necessary to understand that the terms "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating the orientation or position relationship, are based on the orientation or position relationship shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention.
[0070] In the description of the present invention, unless otherwise specified and limited, it should be noted that the terms "installed", "connected" and "connected" should be understood in a broad sense. For example, it can be a mechanical connection or an electrical connection, or it can be the internal connection between two components. It can be a direct connection or an indirect connection through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to the specific circumstances.
[0071] Example 1
[0072] Reference Figure 1 In this embodiment, the knowledge extraction method for intelligent operation and maintenance includes:
[0073] S1. Obtain the text to be recognized.
[0074] The text to be recognized is unstructured free text. Specifically, the text to be recognized is in the form of natural language description. The text to be recognized can be manually input by the staff, or imported from an external device such as a USB flash drive or a removable hard disk. The text to be recognized can also be obtained with the help of a cloud platform. The staff can also use other methods to obtain the text, which is not limited in this embodiment.
[0075] S2. Segment each sentence in the text into multiple paragraphs by word segmentation, and obtain multiple named entities through the multiple paragraphs.
[0076] In this embodiment, the named entity recognition task is constructed as a text classification task. First, the text is analyzed and broken down into several sentences. Then, each sentence is segmented to generate all possible text combinations, which are named text units. These text units are regarded as potential candidate entities. The candidate entities are analyzed according to the field to which the text belongs and the content in the knowledge base, and finally suitable text units are selected from the candidate entities as named entities.
[0077] The classification task based on entity paragraphs can reduce the number of multi-classification categories. For a named entity composed of N words (the number of characters in the named entity is N), when the entity category is C, the traditional sequence labeling model needs to make N (3C + 1) judgments during classification; while the model in this paper only needs to make C judgments during classification, which greatly reduces the difficulty of classification.
[0078] S3. Label the entity type of each named entity.
[0079] After identifying the named entities in the text, the named entities are classified into predefined categories to obtain the entity type of each named entity; the entity type includes entity class, time class and number class, among which the entity class includes personnel roles, monitoring objects, events and servers, etc. The named entities of the entity class are the basic nodes in the knowledge graph, representing specific individuals or organizations in the real world; the time class includes date, time or moment. The named entities of the time class provide the time context of the event, which is very important for understanding the order of events and activities within the time period; the number class includes numerical information, and the named entities of the number class provide quantitative information, which helps to accurately analyze and calculate the data in the knowledge graph.
[0080] Reference Figure 2 In a preferred implementation of this embodiment, the step of marking the entity type of each named entity includes:
[0081] S31. Predict the entity type of each named entity in the text to obtain the semantic features of each named entity.
[0082] First, the semantic features of the named entities in each sentence in the text are extracted to obtain the semantic features of each named entity; then, it is determined whether there are nested entities in the sentence. A nested entity refers to a situation in which a named entity contains another named entity in a text; if there are nested entities in the sentence, the probability of each nested entity belonging to each entity type is calculated to obtain statistical results, and the entity type of each nested entity is determined based on the statistical results.
[0083] The following describes the processing method of nested entities with a specific example: Take the sentence "System warning: Unable to connect to the database server. Please check the network connection and make sure the database service is running." as an example. The two entities "database server" and "database service" appear at the same time in the text, and there is a certain semantic association between them. By introducing the method of entity paragraphs, we identify "database server" and "database service" as two independent paragraphs:
[0084] Paragraph 1 [Database server], marked as entity type "Server", represents the database hosting device at the hardware level;
[0085] Section 2 [Database Service], marked as entity type "Service", indicates the database operation status at the software level.
[0086] According to the semantic features of paragraph 1 and paragraph 2, the entity category to which paragraph 1 (or paragraph 2) may belong is determined to achieve multi-classification of nested entities; then, by calculating the possibility that paragraph 1 and paragraph 2 belong to each entity category respectively, the probability that paragraph 1 and paragraph 2 belong to each entity type is obtained, and the entity type of the nested entity is determined according to the statistical results of the probability statistics of the two named entities, thereby improving the recognition effect of nested entities in the text in the field of intelligent operation and maintenance.
[0087] S32. Assign a position code to each named entity to obtain the position feature of each named entity.
[0088] Specifically, a position code based on a sine function is assigned to each named entity to obtain the position feature of each named entity; the position code is used to record the starting position and the ending position of each named entity in the text.
[0089] The position encoding of named entities is represented by two vectors, where vector sh represents the starting position of the entity in a sentence, and vector st represents the ending position of the entity in a sentence. Both vector sh and vector st are composed of n elements arranged in sequence, where n is the number of characters in the sentence where the named entity is located. In addition, the elements of vector sh and vector st are composed of multiple "0"s and one "1", where sh[i]=1 indicates that the starting position of the named entity is the position of the i-th character in the sentence, and i is the starting position index of the named entity in the sentence; st[j]=1 indicates that the starting position of the named entity is the position of the j-th character in the sentence, and j is the ending position index of the named entity in the sentence.
[0090] To facilitate understanding by those skilled in the art, the table form of position coding is described below in conjunction with specific examples: for example, the sentence "A memory leak was detected when the server performance degraded" identifies the named entity pair "server" and "memory leak"; wherein the position coding of the "server" named entity is sh=[1,0,0,0,0,0,0,0,...,0], st=[0,0,1,0,0,0,0,0,...,0], which means that the starting position of the "server" named entity is the first character in the sentence, and the ending position of the "server" named entity is the third character in the sentence.
[0091] In a sentence, two named entities may be far apart, but the relationship between them is closely connected. By encoding the relative positions between named entities, this long-distance association can be captured more effectively, and their relationship can be understood even if the entities are not in direct adjacent positions.
[0092] S33, fusing the semantic features and position features of each named entity to obtain a composite feature.
[0093] S34. Generate an entity type label for the named entity based on the composite feature, and add an entity type label at both ends of the named entity to complete the entity type labeling of the named entity.
[0094] In this embodiment, in the preferred implementation of this embodiment, the BERT model is used to identify and extract the semantic features of the named entity, and the semantic features and position features of the named entity are fused to obtain composite features; BERT stands for Bidirectional Encoder Representations from Transformers, which is a deep learning model based on Transformer;
[0095] Injecting the relative position features unique to named entities into the semantic features of named entities allows the BERT model to fully utilize the distance information between named entities and contextual text units. Specifically, in the self-attention mechanism of the BERT model, for text units belonging to named entities, the position encoding of the text units belonging to the named entities is used to calculate the attention weight; the weight of text units that do not belong to named entities is set to 0, so that the BERT model will only consider named entities when calculating attention, so as to facilitate the BERT model to extract named entity information in the text.
[0096] In a preferred implementation of this embodiment, after the named entities are labeled, the knowledge extraction method for intelligent operation and maintenance further includes:
[0097] Determine whether the named entity is the first named entity in the sentence. If the named entity is the first named entity in the sentence, add head entity tags at both ends of the annotated named entity.
[0098] Determine whether the named entity is the last named entity in the sentence. If the named entity is the last named entity in the sentence, add tail entity tags at both ends of the named entity.
[0099] For example, in the sentence "A memory leak was detected when server performance degraded", there are named entity pairs "server" and "memory leak". Since the named entity "server" is the first named entity in the sentence, the entity type tags [head entity: hardware] are added to both ends of "server" so that the model used for relationship extraction can understand that "server" is the head entity and the entity type is "hardware" when the relationship between entities is extracted later; the entity type tags [tail entity: fault] are added to both ends of "memory leak" so that the model used for relationship extraction can understand that "memory leak" is the tail entity and the entity type is "fault".
[0100] S4. Input the sentence with the labeled named entities into the relation extraction model. The relation extraction model extracts the relations of all the named entities in the text to obtain the relation information between the entities.
[0101] Furthermore, in a preferred implementation of this embodiment, a multi-head selection relationship extraction model can be used to process named entities, because each named entity in a sentence may have multiple relationships with other named entities. In the multi-head selection relationship extraction model, each named entity can be regarded as having multiple "heads", and each head is responsible for extracting a relationship; for example, in a sentence, the entity "server" may be both the executor (subject) of an action and the target (object) of the action, or have other types of relationships with other named entities; the multi-head selection relationship extraction model includes multiple extraction modules. After the composite features of the comprehensive named entity semantic features and positional characteristics are input into the multi-head selection relationship extraction model, each extraction module focuses on extracting a specific relationship, thereby realizing the simultaneous consideration of multiple relationships.
[0102] In this embodiment, before the sentences with labeled named entities are input into the relation extraction model, the relation extraction model is trained. When the output result of the relation extraction model meets the preset standard, the sentence with labeled named entities is processed by the relation extraction model.
[0103] Specifically, the training steps of the relation extraction model are:
[0104] Get the training dataset;
[0105] Construct the network structure of the relationship extraction model;
[0106] The network of the relationship extraction model is trained using a training data set. In each training, the output result of the current relationship extraction model is evaluated to obtain an evaluation result. The network parameters of the relationship extraction model are optimized and adjusted according to the evaluation result. When the evaluation result meets the preset value, the current network parameter is used as the final network parameter of the relationship extraction model to obtain the final relationship extraction model. The preset value can be adjusted according to the actual situation, and other training methods can be used to train the relationship extraction model. As long as a relationship extraction model that can accurately extract the relationship between named entities can be trained, this embodiment does not limit it.
[0107] Reference Figure 3 , the relation extraction model extracts relations from all named entities in the text, and the steps to obtain the relation information between entities include:
[0108] S41. Perform relationship extraction on all entity pairs in each sentence, where each entity pair includes two matching named entities.
[0109] For example, there are three named entities in sentence 1, namely named entity 1, named entity 2 and named entity 3, then there are three entity pairs in sentence 1:
[0110] Named entity 1 and named entity 2 are a group of named entity pairs, named entity 1 and named entity 3 are a group of named entity pairs, and named entity 2 and named entity 3 are a group of named entity pairs.
[0111] S42. Use a global relationship classification mechanism to extract features of each entity pair to obtain entity relationships of each entity pair.
[0112] Reference Figure 4 In this embodiment, the specific implementation process of step S42 includes:
[0113] S421. Extract dense feature matrices of the two named entities through a maximum pooling operation to obtain two entity feature vectors.
[0114] Extracting the dense feature matrix of two entities through the maximum pooling operation can reduce the dimension of the feature vector and reduce information redundancy.
[0115] S422. Extract semantic features of the sentences containing the two named entities to obtain a sentence feature vector.
[0116] S423. Perform a dimensionality increase operation on the two entity feature vectors so that the entity feature vector and the sentence feature vector are consistent in dimension.
[0117] Performing a dimensionality increase operation on the two entity feature vectors can ensure that the entity feature vectors are consistent with the global sentence feature vector in dimension, which facilitates subsequent fusion processing.
[0118] S424, performing feature fusion on the two entity feature vectors after dimension upgrade and the sentence feature vector to obtain a comprehensive feature vector;
[0119] Specifically, the adjusted entity feature representation and sentence feature representation are input into a feedforward neural network (FFNN) together. The structural design of FFNN can effectively fuse the entity feature vector and the sentence feature vector to generate a feature representation that integrates the semantic information of the entity and the sentence.
[0120] S425. After normalizing the comprehensive feature vector, the vector is input into a classifier. The classifier scores multiple candidate entity relationships between two named entities and selects the candidate entity relationship with the highest score as the final entity relationship output.
[0121] After normalizing the comprehensive feature vector, it can ensure that the feature values are on a uniform scale, which is convenient for subsequent relationship classification; finally, the normalized feature representation is input into the relationship classifier, which scores the possible entity relationships; by selecting the relationship with the highest score as the final entity relationship output, the problem that a pair of named entities may belong to multiple entity relationships is effectively solved, thereby improving the accuracy of relationship extraction.
[0122] S43. By constructing entity relationship triples of each entity pair and storing them in a knowledge base, information on the relationship between entities is obtained.
[0123] The preferred implementation of the knowledge extraction method for intelligent operation and maintenance in this embodiment also includes labeling the relationship between each statement and the entity pairs in the statement.
[0124] Specifically, the method for marking the relationship between each sentence and the entity pairs in the sentence includes:
[0125] Traverse all the sentences in the article and filter out the sentences that contain only one named entity. The sentences that contain only one named entity are recorded as first-category sentences, and the sentences that contain at least two named entities are recorded as second-category sentences.
[0126] Identify the first type of sentences as sentences that do not contain relations, and classify the first type of sentences into the set of unlabeled sentences;
[0127] If the second category of sentences is a sentence in which no entity pair and no relation word are found, the second category of sentences in which no entity pair and no relation word are found are put into the unlabeled sentence set;
[0128] If there are entity relationship triples in the second-category statements, then determine the number of entity relationship triples in each second-category statement.
[0129] If the second type of statement contains only one entity relationship triple, the relationship between the second type of statement and the entity pair is annotated in the format of: statement + entity pair + entity relationship;
[0130] If the second-category statement contains more than two entity relationship triples, the second-category statement is copied so that the number of second-category statements is consistent with the number of entity relationship triples in the second-category statement, to ensure that each second-category statement corresponds to only one entity relationship triple, and the relationship between each second-category statement and the entity pair is annotated respectively;
[0131] To facilitate understanding by those skilled in the art, the process of copying and annotating the second type of statements is described below with reference to specific examples; for example, if statement 1 has three entity relationship triples, statement 1 is copied twice so that the three entity relationship triples can correspond to one statement 1 respectively, to ensure that each statement corresponds to only one entity relationship triplet, and the three statements 1 are annotated respectively, with the annotation contents being "statement 1+entity pair 1+relationship type 1", "statement 1+entity pair 2+relationship type 2" and "statement 1+entity pair 3+relationship type 3".
[0132] Put the annotated second-category sentences into the annotated sentence set.
[0133] Traverse all sentences in the text until all sentences with entity relationship triples are labeled.
[0134] It should be noted that in the above technical solution, some components can be replaced according to the actual situation and the development and update of technology. For example, the BERT model can be replaced with other deep learning models or domain-specific pre-trained models such as convolutional neural networks (CNN), recurrent neural networks (RNN) or graph neural networks (GNNs); the relationship extraction part can be carried out by other unsupervised, semi-supervised or supervised methods and remote supervision methods. The specific selection rules depend on the type and attributes of the data, and this embodiment does not limit it.
[0135] S5. Extract attribute information of each named entity in the text.
[0136] The attribute information of a named entity includes the attributes of the entity and the attribute values of the entity; entity attributes refer to the basic attributes of an entity, while attribute values are the specific values of these attributes. Specifically, entity attributes can be any information that describes an entity, such as a person's birthplace, occupation, or the geographical location and climate type of a place; and attribute values are the specific values or descriptions of these attributes, such as a person's birthplace is "Beijing", his occupation is "teacher", and the geographical location of the place is "39 degrees north latitude, 116 degrees east longitude". These attributes and attribute values together describe the characteristics of the entity, constitute the nodes and edges in the knowledge graph, and form a complex information network, so that the knowledge graph can intuitively display the relationships and attributes between entities.
[0137] The entity type of a named entity focuses on "what it is", that is, what type of object the entity itself is, while the attribute information of a named entity focuses on "what it has", that is, what characteristics or attributes the entity has.
[0138] S6. Store the entity type, attribute information and relationship information between entities of each named entity in the text to complete knowledge extraction.
[0139] In this embodiment, the entity type, attribute information, and inter-entity relationship information of each named entity in the text are associated and stored in a knowledge base in the field of intelligent operation and maintenance.
[0140] Reference Figure 5 In another embodiment of the present application, the knowledge extraction method for intelligent operation and maintenance further includes:
[0141] S10. Establish a data dictionary, which includes a plurality of different business domain modules. Each business domain module stores common word information corresponding to each business domain. The common word information includes naming information, entity type information and attribute information of the common words.
[0142] By establishing a domain-specific dictionary, the accuracy of the basic word segmentation algorithm and the keyword extraction algorithm can be improved. The process of establishing a data dictionary can be done by combining automation and manual work. First, the existing word segmentation model is used in conjunction with the new word discovery algorithm for preliminary screening, and then manual work is performed based on business domain knowledge to fill in the gaps, thereby improving the efficiency of improving domain-specific dictionaries.
[0143] Reference Figure 6 Based on the same inventive concept, an embodiment of the present invention provides a knowledge extraction method system for intelligent operation and maintenance.
[0144] The knowledge extraction method system for intelligent operation and maintenance described in the present invention can be loaded in an electronic device. According to the functions to be implemented, the knowledge extraction method system for intelligent operation and maintenance includes an acquisition module 61, an identification module 62, a first annotation module 63, a relationship extraction module 64, an attribute extraction module 65 and a storage module 66. The module described in the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, which are stored in the memory of the electronic device.
[0145] Among them, the acquisition module 61 can acquire the text to be recognized; the recognition module 62 can segment each sentence in the text into multiple paragraphs, and obtain multiple named entities through multiple paragraphs; the first labeling module 63 can label the entity type of each named entity, and if there are nested entities in the sentence, the probability that each nested entity belongs to each entity type is calculated to obtain statistical results, and the entity type of each nested entity is determined according to the statistical results; the relationship extraction module 64 can input the sentence with the marked named entity into the relationship extraction model, and the relationship extraction model extracts the relationship of all named entities in the text to obtain the relationship information between entities; the attribute extraction module 65 can extract the attribute information of each named entity in the text; the storage module 66 can store the entity type, attribute information and relationship information between entities of each named entity in the text to complete knowledge extraction.
[0146] In a preferred implementation of this embodiment, the BERT model entity type can be used for identification and prediction and the multi-head relationship extraction model can be used to process the named entities; the BERT model includes a CRF module and a relative position processing module, the multi-head selection relationship extraction model includes multiple extraction modules, and CRF represents conditional random field (full name: Conditional Random Field); in the multi-head selection relationship extraction model, the CRF module is used to solve the entity recognition task, and the potential multiple relationships of each entity are identified by treating the relationship extraction as a multi-head selection problem; the relative position processing module is used to determine the positional relationship between each named entity, and the extraction module is used to extract the relationship between two matching named entities.
[0147] When processing each named entity pair, the CRF module first generates a label sequence for the entity. Subsequently, these label sequences are converted into distributed representations in a high-dimensional space, namely "label embeddings", according to the conversion rules. The dimensions of the label sequence vector can be flexibly set according to specific parameters. The conversion rules from labels to embeddings can be set through a mapping dictionary. The mapping dictionary is randomly initialized at the beginning of the multi-head selection relation extraction model training, and is continuously adjusted and optimized as the training progresses, in order to achieve the best feature representation effect.
[0148] The relative position processing module is used to determine the positional relationship between named entities to obtain the relative position of the named entities in the sentence structure. The label embedding and position information are fused through feature concatenation to generate a composite feature vector that combines semantic and positional characteristics; this composite feature vector is then fed into the multi-head selection model, where each extraction module focuses on extracting a specific relationship, thereby achieving simultaneous consideration of multiple relationships between named entities.
[0149] The knowledge extraction method system for intelligent operation and maintenance also includes a second annotation module, which can annotate the relationship between each statement and the entity pair in the statement, thereby further improving the accuracy of the knowledge extraction result. The various variations and specific examples in the knowledge extraction method for intelligent operation and maintenance provided in the above embodiments are also applicable to the knowledge extraction method system for intelligent operation and maintenance of this embodiment. Through the above detailed description of the knowledge extraction method for intelligent operation and maintenance, those skilled in the art can clearly know the implementation method of the knowledge extraction method system for intelligent operation and maintenance in this embodiment. For the sake of brevity of the specification, it will not be described in detail here.
[0150] The present application also discloses an electronic device, such as Figure 7 , which is a schematic diagram of the structure of an electronic device for a knowledge extraction method for intelligent operation and maintenance provided by an embodiment of the present invention. The electronic device may include at least one processor 10, a memory 11 connected to the at least one processor for communication, a communication bus 12, and a communication interface 13, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a knowledge extraction method program for intelligent operation and maintenance.
[0151] Among them, the processor 10 can be composed of an integrated circuit in some embodiments, for example, it can be composed of a single packaged integrated circuit, or it can be composed of multiple integrated circuits packaged with the same function or different functions, including one or more central processing units (CPU), microprocessors, digital processing chips, graphics processors and various control chips. The processor 10 is the control core (Control Unit) of the electronic device, which uses various interfaces and lines to connect the various components of the entire electronic device, and executes or executes the program or module stored in the memory 11 (for example, executing the knowledge extraction method for intelligent operation and maintenance, etc.), and calls the data stored in the memory 11 to execute various functions of the electronic device and process data.
[0152] The memory 11 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (for example, SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. In some embodiments, the memory 11 may be an internal storage unit of an electronic device, such as a mobile hard disk of the electronic device. In other embodiments, the memory 11 may also be an external storage device of an electronic device, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. Furthermore, the memory 11 may also include both an internal storage unit of the electronic device and an external storage device. The memory 11 can not only be used to store application software and various types of data installed in the electronic device, such as the code of the knowledge extraction method program for intelligent operation and maintenance, but also can be used to temporarily store data that has been output or is to be output.
[0153] The communication bus 12 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize connection and communication between the memory 11 and at least one processor 10, etc.
[0154] The communication interface 13 is used for communication between the above-mentioned electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a display (Display), an input unit (such as a keyboard (Keyboard)), and optionally, the user interface may also be a standard wired interface, a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc. Among them, the display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface.
[0155] Figure 7 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 7The structure shown does not constitute a limitation on the electronic device, and may include fewer or more components than shown, or combine certain components, or arrange the components differently. For example, although not shown, the electronic device may also include a power supply (such as a battery) for supplying power to each component. Preferably, the power supply may be logically connected to at least one processor 10 through a power management device, so that functions such as charging management, discharging management, and power consumption management are implemented through the power management device. The power supply may also include any components such as one or more DC or AC power supplies, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, etc. The electronic device may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
[0156] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited by this structure.
[0157] Furthermore, if the module / unit integrated in the electronic device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile.
[0158] The present application embodiment provides a computer-readable storage medium, for example, including: any entity or device, recording medium, USB flash drive, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM) that can carry the computer program code. The computer-readable storage medium stores a computer program that can be loaded by a processor and execute the knowledge extraction method for intelligent operation and maintenance of the above embodiment.
[0159] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", "an implementation", "a preferred implementation" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0160] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.
Claims
1. A knowledge extraction method for intelligent operation and maintenance, characterized in that: The method comprises: Get the text to be recognized; Perform sentence segmentation and word segmentation processing on each sentence in the text to divide it into multiple text segments, and obtain multiple named entities through the multiple text segments; The entity type of each named entity is marked. If there are nested entities in the sentence, the probability of each nested entity belonging to each entity type is calculated to obtain a statistical result, and the entity type of each nested entity is determined according to the statistical result; Input the sentence with the named entities marked into the relation extraction model, and the relation extraction model extracts the relations of all the named entities in the text to obtain the relation information between the entities; Extract attribute information of each named entity in the text; The entity type, attribute information and relationship information between entities of each named entity in the text are stored to complete knowledge extraction.
2. The knowledge extraction method for intelligent operation and maintenance according to claim 1, characterized in that: The marking of the entity type of each named entity includes: Predict the entity type of each named entity in the text and obtain the semantic features of each named entity; Assign a position code to each named entity to obtain the position features of each named entity; The semantic features and position features of each named entity are fused to obtain composite features; An entity type label of the named entity is generated based on the composite feature, and an entity type label is added to both ends of the named entity to complete the entity type labeling of the named entity.
3. The knowledge extraction method for intelligent operation and maintenance according to claim 1, characterized in that: The method further comprises: Determine whether the named entity is the first named entity in the sentence, and if the named entity is the first named entity in the sentence, add head entity tags at both ends of the named entity; It is determined whether the named entity is the last named entity in the sentence. If the named entity is the last named entity in the sentence, a tail entity tag is added to both ends of the named entity.
4. The knowledge extraction method for intelligent operation and maintenance according to claim 1, characterized in that: The relation extraction model extracts relations from all named entities in the text, and obtains the relationship information between entities, including: Perform relation extraction on all entity pairs in each sentence, where each entity pair includes two matching named entities. A global relationship classification mechanism is used to extract the features of each entity pair and obtain the entity relationship of each entity pair; By constructing entity relationship triples for each entity pair and storing them in the knowledge base, the relationship information between entities is obtained.
5. The method for extracting knowledge for intelligent operation and maintenance as claimed in claim 4, characterized in that: The global relationship classification mechanism is used to extract the features of the two named entities to obtain the entity relationship of each entity pair, including: The dense feature matrix of the two named entities is extracted through the maximum pooling operation to obtain two entity feature vectors; Extract the semantic features of the sentences containing the two named entities to obtain the sentence feature vector; Perform a dimension-up operation on the two entity feature vectors so that the entity feature vector and the sentence feature vector are consistent in dimension; The two entity feature vectors after dimension upgrade are fused with the sentence feature vector to obtain a comprehensive feature vector; The comprehensive feature vector is normalized and then input into the classifier. The classifier scores multiple candidate entity relationships between two named entities and selects the candidate entity relationship with the highest score as the final entity relationship output.
6. The knowledge extraction method for intelligent operation and maintenance according to claim 4, characterized in that: The method further includes annotating the relationship between each sentence and the entity pairs in the sentence: Traverse all the sentences in the article and filter out the sentences that contain only one named entity. The sentences that contain only one named entity are recorded as first-category sentences, and the sentences that contain at least two named entities are recorded as second-category sentences. Identify the first type of sentences as sentences that do not contain relations, and classify the first type of sentences into the set of unlabeled sentences; Determine the number of entity relationship triples in each second-category sentence: If the second type of statement contains only one entity relationship triple, the relationship between the second type of statement and the entity pair is annotated in the format of: statement + entity pair + entity relationship; If the second-category statement contains more than two entity relationship triples, the second-category statement is copied so that the number of second-category statements is consistent with the number of entity relationship triples in the second-category statement, so as to ensure that each second-category statement corresponds to only one entity relationship triple, and the relationship between each second-category statement and the entity pair is marked respectively; Put the annotated second-category sentences into the annotated sentence set.
7. The knowledge extraction method for intelligent operation and maintenance according to any one of claims 1 to 6, characterized in that: A data dictionary is established, wherein the data dictionary includes a plurality of different business domain modules, each of which stores common word information corresponding to each business domain, and the common word information includes naming information, entity type information and attribute information of the common words.
8. A knowledge extraction method system for intelligent operation and maintenance, used to implement the knowledge extraction method for intelligent operation and maintenance according to any one of claims 1 to 7, characterized in that: include: An acquisition module (61), used for acquiring text to be recognized; A recognition module (62) is used to perform sentence segmentation and word segmentation processing on each sentence in the text and divide it into multiple text segments, and obtain multiple named entities through the multiple text segments; A first labeling module (63) is used to label the entity type of each named entity. If there are nested entities in the sentence, the probability of each nested entity belonging to each entity type is calculated to obtain a statistical result, and the entity type of each nested entity is determined according to the statistical result; A relation extraction module (64) is used to input the sentence with the named entities marked into a relation extraction model, and the relation extraction model extracts the relations of all the named entities in the text to obtain the relation information between the entities; An attribute extraction module (65), used to extract attribute information of each named entity in the text; The storage module (66) is used to store the entity type, attribute information and inter-entity relationship information of each named entity in the text to complete knowledge extraction.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor (10); and, a memory (11) communicatively connected to the at least one processor (10); The memory (11) stores a computer program executable by the at least one processor (10), and the computer program is executed by the at least one processor (10) so that the at least one processor (10) can execute the knowledge extraction method for intelligent operation and maintenance as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer storage medium stores a computer program; when the computer program is executed by the processor, the knowledge extraction method for intelligent operation and maintenance as described in any one of claims 1 to 7 is implemented.