Knowledge graph construction method and device, computer equipment and storage medium

By processing data in the refining and chemical industry and using self-attention mechanism encoder, extracting and classifying entity relationships, the problems of low efficiency and insufficient accuracy of knowledge graph construction in the refining and chemical industry in the existing technology are solved, and efficient Accurate knowledge graph construction.

CN119476432APending Publication Date: 2025-02-18RICHFIT INFORMATION TECH +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311014271.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-11
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The prior art is inefficient when building knowledge graphs in the field of refining and chemical engineering, and it is difficult to meet the high requirements for knowledge accuracy and particle size, and requires a lot of manual participation.

Method used

By processing structured, semi-structured and unstructured data in the refining and chemical industry, encode word elements in text fragments using a self-attention mechanism, extract entities with different knowledge granularity, and classify them through relationships The model determines the type of relationship between entities and ultimately constructs a knowledge graph.

Benefits of technology

It improves the efficiency and accuracy of knowledge graph construction in the field of refining and chemical engineering, meets the high requirements for knowledge particle size and accuracy, and improves the accuracy of relationship extraction through the joint methods of entity extraction and relationship extraction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119476432A_ABST
    Figure CN119476432A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a knowledge graph construction method and device, computer equipment and a storage medium, and relates to the field of artificial intelligence. The method includes: acquiring plain text data in the field of oil refining and chemical engineering; constructing a body structure; encoding the lexical elements through an encoder with a self-attention mechanism to obtain lexical element features; extracting entities based on the lexical element features; combining the entities in pairs to form candidate entity pairs; fusing the lexical element features corresponding to the first entity to obtain a first entity feature, and fusing the lexical element features corresponding to the second entity to obtain a second entity feature; fusing the lexical element features between the first entity and the second entity to obtain local context features; based on the first entity feature, the second entity feature, the local context feature, the first width feature and the second width feature, determining a relationship type corresponding to the candidate entity pair through a relationship classification model; and constructing the knowledge graph based on the relationship types between the entities.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of artificial intelligence, and in particular to a knowledge graph construction method, apparatus, computer equipment and storage medium. Background Art

[0002] As an emerging knowledge representation and processing method, knowledge graph has been widely used in many fields.

[0003] In the field of petroleum refining and chemical engineering, there are few studies on building knowledge graphs. In related technologies, a large amount of manpower is usually required to complete tasks such as ontology construction, entity and relationship extraction through manual construction or rule-based methods.

[0004] However, the above approach is inefficient on the one hand, and it is difficult to meet the high requirements of knowledge accuracy and knowledge granularity in the field of petroleum refining and chemical industry on the other hand. Summary of the invention

[0005] The present application provides a knowledge graph construction method, device, computer equipment and storage medium. The technical solution is as follows:

[0006] On the one hand, an embodiment of the present application provides a method for constructing a knowledge graph, the method comprising:

[0007] Process structured data, semi-structured data and unstructured data in the field of petroleum refining and chemical industry to form plain text data;

[0008] Constructing an ontology structure in the field of oil refining and chemical engineering, wherein the ontology structure includes ontologies of different knowledge granularities; the different knowledge granularities include different knowledge granularities;

[0009] By means of an encoder with a self-attention mechanism, a word unit in a text segment of the plain text data is encoded to obtain a word unit feature corresponding to the word unit; the word unit feature is integrated with a global context feature corresponding to the word unit, and the global context feature reflects the global information of the text segment related to the word unit;

[0010] Based on the word-meta features, extracting entities corresponding to the ontology of different knowledge granularities from the text fragments;

[0011] Combining the entities in pairs to form candidate entity pairs, wherein the candidate entity pairs include a first entity and a second entity;

[0012] The word-gram features corresponding to the word-grams in the first entity are merged to obtain a first entity feature, and the word-gram features corresponding to the word-grams in the second entity are merged to obtain a second entity feature;

[0013] fusing the word-gram features corresponding to the word-grams between the first entity and the second entity in the text segment to obtain local context features, where the local context features reflect local information between the first entity and the second entity in the text segment;

[0014] Based on the first entity feature, the second entity feature, the local context feature, the first width feature and the second width feature, determining the relationship type corresponding to the candidate entity pair through a relationship classification model; the first width feature represents the width feature of all the word-grams in the first entity, the second width feature represents the width feature of all the word-grams in the second entity, and the relationship type represents the association relationship between the first entity and the second entity;

[0015] Based on the entities and the relationship types between the entities, a knowledge graph in the field of petroleum refining and chemical engineering is constructed.

[0016] On the other hand, an embodiment of the present application provides a knowledge graph construction device, the device comprising:

[0017] The text processing module is used to process structured data, semi-structured data and unstructured data in the field of petroleum refining and chemical industry to form plain text data;

[0018] An ontology construction module is used to construct an ontology structure in the field of oil refining and chemical engineering, wherein the ontology structure includes ontologies of different knowledge granularities; the different knowledge granularities include different knowledge granularities;

[0019] A word-gram encoding module, used for encoding word-grams in the text segment of the plain text data by an encoder with a self-attention mechanism to obtain word-gram features corresponding to the word-grams; the word-gram features are integrated with global context features corresponding to the word-grams, and the global context features reflect global information of the text segment related to the word-grams;

[0020] An entity extraction module, used for extracting entities corresponding to the ontology of different knowledge granularities from the text segment based on the word-meta features;

[0021] A relationship extraction module, used for combining the entities in pairs to form candidate entity pairs, wherein the candidate entity pairs include a first entity and a second entity;

[0022] The relationship extraction module is further used to fuse the word-gram features corresponding to the word-gram in the first entity to obtain a first entity feature, and to fuse the word-gram features corresponding to the word-gram in the second entity to obtain a second entity feature;

[0023] The relationship extraction module is further used to fuse the word-gram features corresponding to the word-grams between the first entity and the second entity in the text segment to obtain local context features, wherein the local context features reflect local information between the first entity and the second entity in the text segment;

[0024] The relationship extraction module is further used to determine the relationship type corresponding to the candidate entity pair through a relationship classification model based on the first entity feature, the second entity feature, the local context feature, the first width feature and the second width feature; the first width feature represents the width feature of all the word-grams in the first entity, the second width feature represents the width feature of all the word-grams in the second entity, and the relationship type represents the association relationship between the first entity and the second entity;

[0025] The knowledge graph construction module is used to construct a knowledge graph in the field of petroleum refining and chemical industry based on the entities and the relationship types between the entities.

[0026] On the other hand, an embodiment of the present application provides a computer device, which includes a processor and a memory, wherein at least one instruction is stored in the memory, and the at least one instruction is loaded and executed by the processor to implement the method described in any of the above embodiments.

[0027] On the other hand, an embodiment of the present application provides a computer-readable storage medium, in which at least one instruction is stored, and the instruction is loaded and executed by a processor to implement the method described in the above aspect.

[0028] On the other hand, an embodiment of the present application provides a computer program product, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a terminal reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the terminal executes the method provided in various optional implementations of the above aspects.

[0029] In an embodiment of the present application, from plain text data formed by structured data, semi-structured data and unstructured data in the field of petroleum refining and chemical industry, the word units in the text fragments of the plain text data are encoded by an encoder with a self-attention mechanism to obtain word unit features; based on the word unit features, entities corresponding to the ontology of different knowledge granularities are extracted from the text fragments, and at the same time, based on the word unit features, width features and local context features between the entities, the relationship between the entities is extracted through a relational classification model. On the one hand, the efficiency of constructing the knowledge graph in the field of petroleum refining and chemical industry can be improved, and on the other hand, the high requirements of the field of petroleum refining and chemical industry for knowledge granularity can be met. On the other hand, since the entity extraction and relationship extraction tasks simultaneously use the encoding results of the encoder with a self-attention mechanism, the dependency relationship between the two tasks of entity extraction and relationship extraction can be obtained, thereby further improving the accuracy of relationship extraction and meeting the high requirements of the field of petroleum refining and chemical industry for the accuracy of knowledge, thereby constructing an accurate knowledge graph in the field of petroleum refining and chemical industry. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0031] Figure 1 is a flowchart of a knowledge graph construction method provided by an exemplary embodiment of the present application;

[0032] Figure 2 It is a schematic diagram of a main structure in the field of oil refining and chemical industry provided by an exemplary embodiment of the present application;

[0033] Figure 3 is a schematic diagram of an RDF triad of a cycloolefin polymer provided by an exemplary embodiment of the present application;

[0034] Figure 4 is a schematic diagram of entity extraction and relationship extraction provided by an exemplary embodiment of the present application;

[0035] Figure 5 is a schematic diagram of entity extraction provided by another exemplary embodiment of the present application;

[0036] Figure 6 is a flowchart of a knowledge graph construction method provided by another exemplary embodiment of the present application;

[0037] Figure 7 is a schematic diagram of a visualization interface provided by an exemplary embodiment of the present application;

[0038] Figure 8 This is a structural block diagram of a knowledge graph construction device in the field of oil refining and chemical industry provided by an exemplary embodiment of the present application;

[0039] Fig. 9 It is a structural diagram of a computer device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0040] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0041] After more than 30 years of exploration and development, China's oil refining and chemical industry has gone through several stages of data dispersion, centralization, integration, and intelligence, and has invested a lot of manpower and funds to manage massive amounts of data (including structured, semi-structured, and unstructured data). However, most of the files and materials exist in an unstructured form, with obvious multi-source heterogeneity. It is difficult for experts and scholars or industry practitioners to make full use of this knowledge. Therefore, some technical means are needed to integrate these multi-dimensional heterogeneous data and turn them into usable knowledge.

[0042] As an emerging knowledge representation and processing method, knowledge graph has been widely used in various fields. At present, there are many construction methods in the field of knowledge graph construction, such as ontology-based, semantic web-based, machine learning-based, etc.

[0043] In the field of petroleum refining and chemical engineering, there are few studies on building knowledge graphs. In related technologies, a large amount of manpower is usually required to complete tasks such as ontology construction, entity and relationship extraction through manual construction or rule-based methods.

[0044] However, on the one hand, the above method requires a lot of manual participation and knowledge input, which is inefficient and prone to errors; on the other hand, it is difficult to meet the high requirements of knowledge accuracy and knowledge granularity in the field of petroleum refining and chemical industry.

[0045] The present application provides a knowledge graph construction method, which extracts entities and relationships from structured data, semi-structured data and unstructured data in the field of petroleum refining and chemical industry, and mines the intrinsic correlation between entities such as chemical materials, products, processes and results such as patents, papers, and research reports. It has a strong auxiliary effect on scientific researchers engaged in the petroleum refining and chemical industry to quickly retrieve information and improve their understanding, greatly improves data management capabilities, and also provides strong support for the research and development of new materials in the field of petroleum refining and chemical industry.

[0046] See also Figure 1 , Figure 1This is a flow chart of a knowledge graph construction method provided by an exemplary embodiment of the present application. The method comprises the following steps:

[0047] Step 101, processing structured data, semi-structured data and unstructured data in the field of oil refining and chemical industry to form plain text data.

[0048] Structured data in the field of petroleum refining and chemical industry are data in a fixed format, including database files; semi-structured data in the field of petroleum refining and chemical industry include web pages with associated tags; semi-unstructured data in the field of petroleum refining and chemical industry include refining-related news information, scientific research literature (such as papers, patents, technical reports), etc.

[0049] Among them, the above data can be obtained through channels such as internal databases of the petroleum industry in the field of refining and chemical engineering, Internet data, and third-party research data.

[0050] In some embodiments, data processing includes removing duplication, special symbol processing, missing value processing, etc. to form plain text data.

[0051] Optionally, a data warehouse is established to store the plain text data after data processing.

[0052] Step 102, constructing an ontology structure in the field of oil refining and chemical engineering, wherein the ontology structure includes ontologies of different knowledge granularities.

[0053] Knowledge granularity represents the size of the basic knowledge unit. The field of petroleum refining and chemical engineering has high requirements for the accuracy and depth of knowledge. Therefore, the constructed ontology needs to divide the knowledge into different knowledge granularities, and the different knowledge granularities include the minimum knowledge granularity that meets the knowledge depth requirements.

[0054] The minimum knowledge granularity is the knowledge granularity corresponding to the lowest level concept among different knowledge granularities. For example, in the ontology "equipment and apparatus", the ontology "production equipment" and the ontology "reactor", "reactor" is a lower level concept of "production equipment" and "production equipment" is a lower level concept of "equipment and apparatus", so the minimum knowledge granularity is the third level knowledge granularity corresponding to "reactor".

[0055] In some embodiments, an ontology can be constructed from a coarser knowledge granularity based on a top-down approach, and the coarser knowledge granularity can be refined to determine a finer knowledge granularity until the minimum knowledge granularity is determined. For example, an ontology such as "product", "process", "frontier information", "equipment and apparatus" is constructed from a coarser knowledge granularity, and then the above-mentioned ontologies are subdivided, and an ontology "material" with a smaller knowledge granularity is determined based on the ontology "product", an ontology "aggregation method" with a smaller knowledge granularity is determined based on the ontology "process", and an ontology "paper" and "patent" with a smaller knowledge granularity are determined based on the ontology "frontier information".

[0056] In other embodiments, the ontology of the smallest knowledge granularity may be summarized based on a bottom-up approach to form an ontology corresponding to a coarser knowledge granularity to complete the construction of the ontology structure.

[0057] In the process of constructing the ontology structure, the knowledge, concepts and names in the field of petroleum refining and chemical engineering can be uniformly labeled, and the hierarchical relationship between ontologies can be constructed based on industry knowledge, and the association relationship between ontologies can be determined.

[0058] See also Figure 2 , Figure 2 It is a schematic diagram of a main structure in the field of oil refining and chemical industry provided by an exemplary embodiment of the present application.

[0059] like Figure 2 As shown in the figure, the ontology structure includes multiple ontologies of different knowledge granularities. For example, the ontology of the first level of knowledge granularity (shown in bold font) includes "frontier information", "equipment and equipment", "technical route", "product", "process", "production", "organization" and "material".

[0060] The subordinate ontologies corresponding to the ontology of the first-level knowledge granularity belong to the second-level knowledge granularity. For example, the subordinate ontologies "patents", "research reports", "papers" and "policy documents" corresponding to "frontier information" belong to the second-level knowledge granularity, the subordinate ontologies "product manufacturers" corresponding to "institutions" belong to the second-level knowledge granularity, the subordinate ontologies "structure" and "performance" corresponding to "materials" belong to the second-level knowledge granularity, and the subordinate ontologies "production equipment" corresponding to "equipment and instruments" belong to the second-level knowledge granularity, etc.

[0061] The subordinate ontology corresponding to the ontology of the second-level knowledge granularity belongs to the third-level knowledge granularity. For example, the subordinate ontology "reactor" corresponding to "production equipment" belongs to the third-level knowledge granularity.

[0062] The minimum knowledge granularity is the knowledge granularity corresponding to the lowest concept among different knowledge granularities. For example, "reactor" is the lowest concept, and its corresponding knowledge granularity is the minimum knowledge granularity (third-level knowledge granularity), or "patent" is the lowest concept, and its corresponding knowledge granularity is the minimum knowledge granularity (second-level knowledge granularity).

[0063] Step 103, encode the word-grams in the text fragment of the plain text data through an encoder with a self-attention mechanism to obtain word-gram features corresponding to the word-grams; the word-gram features are integrated with the global context features corresponding to the word-grams, and the global context features reflect the global information of the text fragment related to the word-grams.

[0064] In some embodiments, the encoder with a self-attention mechanism is a BERT model (Bidirectional Encoder Representation from Transformers). In some embodiments, the encoder with a self-attention mechanism can also be other models.

[0065] A text fragment is a fragment in pure text data. For example, it can be an article, a paragraph, or a sentence in pure text data.

[0066] A token is a single word in a text fragment. For example, in the text fragment "Using a titanium complex as a catalyst for copolymerization reaction", words such as "采", "用", "钛" are tokens. In a possible scenario, a token can also be referred to as a token.

[0067] A token feature is a feature vector obtained by the encoder encoding a token.

[0068] Since the encoder has a self-attention mechanism, the global context features corresponding to the tokens are fused in the token features. The global context features reflect the global information of the text fragment related to the token. For different tokens, the global context features are different; or for the same token, the corresponding global context features are also different in different text fragments. Therefore, in the case where a word has multiple meanings, the token features can reflect the meanings in different contexts, thus solving the problem of "polysemy".

[0069] Step 104: Based on the token features, extract entities corresponding to ontologies with different knowledge granularities from the text fragment.

[0070] In some embodiments, entity extraction can be performed by a named entity recognition method.

[0071] In some embodiments, entities corresponding to ontologies with different knowledge granularities can be extracted from the text fragment based on a machine learning model. The machine learning model is trained based on training samples and training labels. The training samples are sample text fragments, and the training labels are sample entities corresponding to ontologies with different knowledge granularities in the ontology structure.

[0072] Step 105: Combine the entities in pairs to form candidate entity pairs. The candidate entity pairs include a first entity and a second entity.

[0073] Exemplarily, in the text fragment "Using a titanium complex as a catalyst for copolymerization reaction", the entities "titanium complex" and "copolymerization reaction" are extracted, and then a candidate entity pair is formed. The candidate entity pair includes a first entity "titanium complex" and a second entity "copolymerization reaction".

[0074] Step 106: Fuse the token features corresponding to the tokens in the first entity to obtain the first entity feature, and fuse the token features corresponding to the tokens in the second entity to obtain the second entity feature.

[0075] In some embodiments, all the token features in the first entity can be fused by max pooling to obtain the first entity feature. For example, fuse the token features corresponding to all the tokens "titanium", "coordination", "compound", and "complex" in the first entity "titanium complex" by max pooling as the first entity feature.

[0076] Similarly, all the token features in the second entity can be fused by max pooling to obtain the second entity feature.

[0077] In some embodiments, other methods can also be adopted to fuse the token features in the first entity, and the embodiments of the present application do not limit this.

[0078] Step 107: Fuse the token features corresponding to the tokens between the first entity and the second entity in the text fragment to obtain the local context feature, which reflects the local information between the first entity and the second entity in the text fragment.

[0079] Exemplarily, in the text fragment "Use titanium complex as the catalyst for copolymerization reaction", the tokens between the first entity "titanium complex" and the second entity "copolymerization reaction" are "as" and "for", then the token features corresponding to "as" and "for" can be fused to obtain the local context feature.

[0080] Since the local context feature reflects the local information between the first entity and the second entity in the text fragment, the local context feature can, to a certain extent, reflect the association between the first entity and the second entity.

[0081] Step 108: Based on the first entity feature, the second entity feature, the local context feature, the first width feature, and the second width feature, determine the relationship type corresponding to the candidate entity pair through a relationship classification model; the first width feature represents the width feature of all the tokens in the first entity, the second width feature represents the width feature of all the tokens in the second entity, and the relationship type represents the association relationship between the first entity and the second entity.

[0082] Exemplarily, the width features of the first entity "titanium complex" and the second entity "copolymerization reaction" both represent that the width of all the tokens of the entity is 4.

[0083] In some embodiments, the local context features obtained by fusing the first entity feature corresponding to "titanium complex", the second entity feature corresponding to "copolymerization reaction", the token features corresponding to "act as", the first width feature corresponding to "titanium complex" and the second width feature corresponding to "copolymerization reaction" are input into the relationship classification model, and the output relationship type between "titanium complex" and "copolymerization reaction" is an inclusion relationship, that is, "copolymerization reaction" (the entity corresponding to the "polymerization method" ontology) includes "titanium complex" (the entity corresponding to the "raw material" ontology).

[0084] Optionally, the relationship classification model includes classification models such as logistic regression, naive Bayes, decision tree, support vector machine, random forest, and gradient boosting tree.

[0085] For relationship extraction between the first entity and the second entity, the input of the relationship classification model includes the first entity feature and the second entity feature. Among them, the first entity feature and the second entity feature are obtained by fusing the token features corresponding to the entities corresponding to different knowledge granularities of the ontology extracted from the text segment. Therefore, the relationship extraction method adopted by the relationship classification model is the joint extraction method, that is, entity extraction and relationship extraction are carried out jointly, and the encoding results of the tokens by the encoder with self-attention mechanism are shared during entity extraction and relationship extraction. Compared with taking entity extraction and relationship extraction as two independent tasks (referred to as pipeline tasks), adopting the method of the embodiments of the present application can simultaneously obtain the dependency relationship between the two tasks of entity extraction and relationship extraction, and effectively solve problems such as error accumulation and exposure bias caused by the pipeline method.

[0086] Optionally, the association relationship between the first entity and the second entity is represented by an RDF triple (Resource Description Framework).

[0087] In some embodiments, the RDF triple can be used to represent both the relationship type between entities (entity-relationship-entity) and the attributes of entities (entity-attribute-attribute value).

[0088] See Figure 3 , Figure 3 is a schematic diagram of the RDF triple of the cycloolefin polymer provided by an exemplary embodiment of the present application.

[0089] As Figure 3 shown, using the RDF triple to represent the "cycloolefin polymer" entity corresponding to the "product" ontology, the following representations can be obtained:

[0090] 1. "Cyclic Olefin Polymer-Produced-XX Production Company" indicates that the relationship type between the entity "Cyclic Olefin Polymer" and the entity "XX Production Company" is produced.

[0091] 2. “Cyclic olefin polymer-for-packaging materials” indicates that the relationship type between the entity “Cyclic olefin polymer” and the entity “packaging materials” is usage.

[0092] 3. “Cyclo Olefin Polymer-Alias-COP (Cyclo Olefin Polymer)” indicates that the attribute type between the entity “Cyclo Olefin Polymer” and the attribute value “COP” is an alias.

[0093] 4. "Cyclic Olefin Polymer - Haze - 91%" indicates that the attribute type between the entity "Cyclic Olefin Polymer" and the attribute value "91%" is haze.

[0094] 5. "Cyclic olefin polymer - pure solvent viscosity - 26.3 ml / g" means that the attribute type between the entity "Cyclic olefin polymer" and the attribute value "26.3 ml / g" is pure solvent viscosity.

[0095] 6. "Cyclic Olefin Polymer-Color-Transparent" indicates that the attribute type between the entity "Cyclic Olefin Polymer" and the attribute value "Transparent" is color.

[0096] 7. "Cycloolefin polymer-transmittance-92%" indicates that the attribute type between the entity "cycloolefin polymer" and the attribute value "92%" is transmittance.

[0097] Step 109, constructing a knowledge graph in the field of petroleum refining and chemical engineering based on entities and relationship types between entities.

[0098] In summary, from the plain text data formed by structured data, semi-structured data and unstructured data in the field of petroleum refining and chemical industry, the word units in the text fragments of the plain text data are encoded by an encoder with a self-attention mechanism to obtain word unit features; based on the word unit features, entities corresponding to the ontology of different knowledge granularities are extracted from the text fragments, and at the same time, based on the word unit features, width features and local context features between entities, the relationship between entities is extracted through a relational classification model. On the one hand, the efficiency of knowledge graph construction in the field of petroleum refining and chemical industry can be improved, and on the other hand, the high requirements of knowledge granularity in the field of petroleum refining and chemical industry can be met. On the other hand, since the encoding results of the encoder with a self-attention mechanism are used for both entity extraction and relationship extraction tasks, the dependency relationship between the two tasks of entity extraction and relationship extraction can be obtained, thereby further improving the accuracy of relationship extraction and meeting the high requirements of knowledge accuracy in the field of petroleum refining and chemical industry, thereby constructing an accurate knowledge graph in the field of petroleum refining and chemical industry.

[0099] See also Figure 4 , Figure 4 It is a schematic diagram of entity extraction and relationship extraction provided by an exemplary embodiment of the present application.

[0100] In some embodiments, at least two consecutive word-grams may be determined from a text segment to form a candidate entity according to an entity width requirement, where the entity width requirement is used to limit the number of word-grams in a candidate entity.

[0101] For example, if the entity width is required to be 10, the text consisting of all continuous words with a width less than or equal to 10 in the text segment "using titanium complex as a catalyst for copolymerization reaction" can be used as candidate entities. For example, the candidate entity "titanium complex" with a width of 4, the candidate entity "copolymerization reaction" with a width of 4, the candidate entity "catalyst" with a width of 3, etc.

[0102] In some embodiments, word-gram features corresponding to word-grams in a candidate entity may be fused to form candidate entity features.

[0103] like Figure 4 In the figure, the first color is used to represent the word-meta features of the candidate entities. The candidate entity features corresponding to the candidate entity “titanium complex” can be obtained by fusion of the word-meta features corresponding to “titanium”, “match”, “combination” and “object”, and the candidate entity features corresponding to the candidate entity “copolymerization reaction” can be obtained by fusion of the word-meta features corresponding to “co”, “polymerization”, “anti” and “response”.

[0104] In some embodiments, the recognition result of the candidate entity may be determined based on the candidate entity features through the candidate entity recognition model, wherein the recognition result includes that the candidate entity is an entity or non-entity corresponding to an ontology of different knowledge granularities.

[0105] In some embodiments, a classification tag feature (CLS) corresponding to a text segment can be obtained through an encoder with a self-attention mechanism, wherein the classification tag feature is used to extract semantic information of the text segment.

[0106] In some embodiments, a candidate entity width feature corresponding to the candidate entity may be obtained, wherein the candidate entity width feature represents a width feature of all word units in the candidate entity. Figure 4 The second color is used to characterize the width features of the candidate entities. For example, the candidate entity “titanium complex” corresponds to a candidate entity width feature characterization width of 4, the candidate entity “copolymerization” corresponds to a candidate entity width feature characterization width of 4, and the candidate entity “catalyst” corresponds to a candidate entity width feature characterization width of 3.

[0107] In some embodiments, the candidate entity features, the candidate entity width features, and the classification tag features may be input into a candidate entity recognition model to determine the recognition result of the candidate entity.

[0108] In some embodiments, the candidate entity recognition model is a machine learning model trained based on entity samples and entity labels corresponding to ontologies of different knowledge granularities.

[0109] like Figure 4 As shown, taking the candidate entity "copolymerization reaction" as an example, the candidate entity features corresponding to the candidate entity "copolymerization reaction" ( Figure 4 ), the candidate entity width feature corresponding to the candidate entity “copolymerization reaction” ( Figure 4 ) and classification marker features ( Figure 4 The candidate entity “copolymerization reaction” (shown in the third color) is input into the candidate entity recognition model, and the recognition result corresponding to the candidate entity “copolymerization reaction” is the entity corresponding to the “process” ontology, which means that “copolymerization reaction” is the entity corresponding to the “process” in the ontology structure.

[0110] Similarly, the candidate entity recognition model can be used to identify the candidate entity "titanium complex" and the candidate entity "catalyst", and the recognition result corresponding to the candidate entity "titanium complex" is the entity corresponding to the "raw material" entity, and the recognition result corresponding to the candidate entity "catalyst" is a non-entity.

[0111] In some embodiments, all candidate entities that meet the entity width requirement can be identified to obtain entities corresponding to all ontologies of different knowledge granularities in the text segment, so as to achieve extraction of entities in the text segment.

[0112] After extracting entities corresponding to ontologies of different knowledge granularities, the entities may be combined in pairs to form candidate entity pairs, where the candidate entity pairs include a first entity and a second entity.

[0113] like Figure 4 The first entity is "titanium complex" and the second entity is "copolymerization reaction". In some embodiments, the word element features corresponding to the word elements in the first entity are merged to obtain the first entity feature ( Figure 4 ), and the word-letter features corresponding to the word-letters in the second entity are fused to obtain the second entity features ( Figure 4 1 is shown in the first color).

[0114] In some embodiments, the word-unit features corresponding to the word-units between the first entity and the second entity in the text segment can be fused to obtain the local context feature ( Figure 4 4).

[0115] Among them, the local context feature reflects the local information between the first entity "titanium complex" and the second entity "copolymerization reaction" in the text segment.

[0116] In some embodiments, a first width feature of a first entity “titanium complex” may be obtained ( Figure 4 ), and a second width feature of the second entity “copolymerization” ( Figure 4 shown in the second color).

[0117] In some embodiments, based on the first entity feature, the second entity feature, the local context feature, the first width feature and the second width feature, the relationship type corresponding to the candidate entity pair is determined through a relationship classification model, wherein the relationship type represents the association relationship between the first entity and the second entity.

[0118] By adopting the method of this embodiment, on the one hand, since the entity extraction and relationship extraction tasks simultaneously use the encoding results of the encoder with the self-attention mechanism, the dependency relationship between the two tasks can be obtained, thereby further improving the accuracy of relationship extraction and meeting the high requirements for knowledge accuracy in the field of petroleum refining and chemical industry; on the other hand, the recognition results of the candidate entities are determined by combining the width features of the candidate entities and the classification tag features with semantic information of the text fragments, thereby improving the extraction accuracy of the candidate entities.

[0119] See also Figure 5 , Figure 5 It is a schematic diagram of entity extraction provided by another exemplary embodiment of the present application.

[0120] In some embodiments, the text fragment can be processed based on the embedding layer and the BERT model to obtain word-unit features.

[0121] For example, for the text fragment "Benzoaryl has...", we can use embedding to embed the words and get the word vectors x1, x2, x3, x4, x5 and x6 corresponding to the word units respectively. Then the word vectors are input into the BERT model for encoding to get the encoded word unit features y1, y2, y3, y4, y5 and y6.

[0122] In some embodiments, the word-unit features can be processed by a Bi-LSTM model to obtain deep features. In some embodiments, the word-unit features can be input into a forward long short-term memory network to obtain a first deep feature; the word-unit features can be input into a backward long short-term memory network to obtain a second deep feature; and the first deep feature, the second deep feature and the word-unit features can be concatenated to obtain a concatenated feature ( Figure 5 , shown as concat in the figure).

[0123] In some embodiments, the concatenated features are input into a conditional random field model (CRF) to obtain entity extraction results corresponding to the word-grams, and the entity extraction results include the first word-gram, non-first word-gram or non-entity of the entity corresponding to the ontology with different knowledge granularities.

[0124] The CRF model is a probabilistic graphical model that follows Markov properties. It is an algorithm that uses random variables as input to output the conditional probability distribution of random variables. Since CRF can fully consider the dependencies between different word units through state transition constraints, it has a good entity extraction effect.

[0125] For example, for the text segment "Benzene-substituted aromatic group has...", the entity extraction results output by the conditional random field model are "material-B", "material-I", "material-I", "material-I", "O", "O". Among them, "material-B" means that "benzene" is the first word of the entity corresponding to the entity "material", "material-I" means that "substituted", "aromatic" and "base" are non-first words of the entity corresponding to the entity "material", and "O" means that "have" and "have" are non-entities.

[0126] In some embodiments, entities corresponding to ontologies of different knowledge granularities may be extracted based on entity extraction results corresponding to all word-grams in a text segment.

[0127] By adopting the method implemented in this paper, the deep features of word units can be extracted through the Bi-LSTM model, and the state transition constraints on the output results of the Bi-LSTM model can be performed through the CRF model, thereby improving the accuracy of entity extraction.

[0128] Since knowledge in the field of petroleum refining and chemical engineering comes from different sources and data is heterogeneous, knowledge fusion is needed to form an accurate knowledge graph in the field of petroleum refining and chemical engineering.

[0129] In one possible scenario, as knowledge develops, research and data in the field of petroleum refining and chemical engineering are constantly updated, so the ontology structure and entity data in the knowledge graph also need to be updated.

[0130] See also Figure 6 , Figure 6 It is a flowchart of a knowledge graph construction method provided by another exemplary embodiment of the present application. The flowchart includes the following steps.

[0131] Step 601, constructing a basic data layer based on unstructured data, semi-structured data, and structured data.

[0132] Optionally, collect relevant literature, patents, technical reports and other data in the field of oil refining and chemical engineering, which come from internal databases of the oil industry, the Internet, and third parties. These data include structured data (fixed format, such as database files), semi-structured data (such as web pages with associated tags), and unstructured data (news consultation, scientific research literature, etc.).

[0133] Step 602: Process the data in the basic data layer.

[0134] Optionally, data processing includes removing duplicate data, processing special symbols, processing missing values, etc.

[0135] In some embodiments, after data processing is completed, a data warehouse is constructed to store the plain text data.

[0136] Step 603: construct an ontology structure in the field of oil refining and chemical engineering, wherein the ontology structure includes ontologies of different knowledge granularities.

[0137] In some embodiments, an initial ontology structure may be first constructed based on industry knowledge in the field of oil refining and chemical engineering.

[0138] The initial ontology structure contains ontologies of different knowledge granularities related to the industry knowledge in the field of petroleum refining and chemical engineering, such as "product", "process", "polymerization method" and "material".

[0139] In some embodiments, supplemental ontology structures may be extracted from petroleum refining research literature.

[0140] In a possible implementation, the title and abstract of the oil refining research literature can be processed by a machine learning model to extract a supplementary ontology structure, wherein the supplementary ontology structure is an ontology related to the oil refining and chemical industry involved in the cutting-edge research, which is different from the initial ontology structure.

[0141] In some embodiments, the initial ontology structure and the supplementary ontology structure may be merged, and the hierarchical and associative relationships between the ontologies in the initial ontology structure and the supplementary ontology structure may be determined; in some embodiments, the attributes contained in the ontology may be determined to form a complete and accurate ontology structure.

[0142] Step 604, extracting entities and relationships between entities from the plain text data.

[0143] In some embodiments, entity extraction and relationship extraction tasks can be completed by joint extraction. For more information about entity extraction and relationship extraction, see Figure 1 , Figure 4 And its description will not be repeated here.

[0144] Step 605: perform knowledge fusion on the results of entity extraction and relationship extraction.

[0145] The data in the knowledge graph often has heterogeneity due to different sources, resulting in uneven knowledge quality. In some embodiments, knowledge fusion can be used to fuse heterogeneous data from different sources. Among them, knowledge fusion includes entity alignment and knowledge merging.

[0146] Entity alignment is used to solve entity conflicts, unclear pointing and other inconsistencies in heterogeneous data. For example, "ethylene / norbornene (NB) copolymer" and "ethylene / NB copolymer" both represent ethylene-norbornene copolymer, and COC copolymer and COC both represent cycloolefin copolymer. Through entity alignment, the complex and diverse chemical names, aliases, abbreviations, etc. in the field of petroleum refining and chemical industry can be aligned to form complete and accurate entities.

[0147] In some embodiments, entity conflict situations of at least two entities may be determined, wherein the entity conflict situation indicates whether the at least two entities are entities with the same meaning in the field of petroleum refining and chemical engineering.

[0148] In some embodiments, the entity conflict of at least two entities can be determined based on a standard naming convention table in the field of petroleum refining and chemical engineering. In some embodiments, it is also possible to determine whether the relationship type between at least two entities is "same entity" based on a relationship classification model to determine the entity conflict.

[0149] When the entity conflict situation represents that at least two entities have entity conflict, entity alignment is performed on the at least two entities; and based on the entities after entity alignment and the relationship types between the entities, a knowledge graph in the field of petroleum refining and chemical engineering is constructed.

[0150] Knowledge merging refers to merging data from an external database with data obtained through entity extraction and relationship extraction. In some embodiments, knowledge merging includes the integration of ontology structures, integrating newly obtained ontology from an external database into the existing ontology structure. In some embodiments, knowledge merging also includes the integration of entity data, such as the integration of entity names, attributes, relationships, and categories.

[0151] Through knowledge fusion, we can avoid conflicts between entities and relationships, reduce unnecessary redundancy, and improve the accuracy and completeness of the knowledge graph in the field of petroleum refining and chemical engineering.

[0152] Step 606, storing and updating the knowledge graph in the field of petroleum refining and chemical engineering.

[0153] Optionally, the knowledge graph is stored in a Neo4j graph database, or in a Jena RDF table database or a 3store RDF table database.

[0154] In some embodiments, updated plain text data may be formed based on updated structured data, semi-structured data, and unstructured data to perform domain knowledge update.

[0155] Among them, domain knowledge updates include updates to the ontology structure and updates to entity data, such as adding or updating entities, relationships, attribute values, etc.

[0156] In some embodiments, updating the data layer needs to consider the reliability of the data source, the consistency of the data (whether there are contradictions or redundancies, etc.), and select knowledge and attributes that appear frequently in each data source to be added to the knowledge graph.

[0157] Step 607, visually displaying the knowledge graph in the field of petroleum refining and chemical engineering through a visual interface.

[0158] Since the knowledge graph information in the database is difficult for R&D personnel in the field of petroleum refining and chemical engineering to use intuitively, the knowledge graph in the field of petroleum refining and chemical engineering can be visualized on a web page using a visual interface and Canvas technology.

[0159] In some embodiments, the nodes in the visualization interface and the connection relationships between the nodes can be determined based on the knowledge graph in the field of petroleum refining and chemical engineering.

[0160] The visualization interface is used to display the content of the knowledge graph in the field of petroleum refining and chemical engineering. The nodes in the visualization interface represent entities, and the connection relationship between nodes represents the relationship type between entities.

[0161] In some embodiments, the knowledge graph can be loaded into the visualization interface through a JavaScript library, and the nodes and connection relationships can be drawn in the visualization interface through Canvas technology.

[0162] In some embodiments, interactive functions may be added to the nodes in the visualization interface, wherein the interactive functions at least include viewing functions and dragging functions, so that users can perform operations such as viewing and dragging on entities.

[0163] In some embodiments, the drawn visualization interface can be exported as an HTML file and used in a Web page.

[0164] See also Figure 7 , Figure 7 It is a schematic diagram of a visualization interface provided by an exemplary embodiment of the present application.

[0165] like Figure 7 As shown, in the visualization interface 711, the contents of the knowledge graph related to the entity "cycloolefin polymer" are displayed, including other entities related to "cycloolefin polymer", and the relationship types between other entities and "cycloolefin polymer".

[0166] Among them, the relationship types between the entity "cycloolefin polymer" and the entity "microelectronics", the entity "packaging materials" and the entity "medicine" are all "used for"; the relationship type between the entity "cycloolefin polymer" and the entity "A scientific research institution" is "research and development"; the relationship type between the entity "cycloolefin polymer" and the entity "B company" is "production"; the relationship type between the entity "cycloolefin polymer" and the entity "cycloolefin" and the entity "ethylene" are all "synthesis"; the relationship type between the entity "cycloolefin polymer" and the entity "Zhang San" and the entity "Li Si" are all "research".

[0167] The visualization interface 711 also displays an ontology legend column 712, which is used to characterize the ontology corresponding to the entities appearing in the visualization interface 711. For example, the entity "cycloolefin", the entity "cycloolefin polymer" and the entity "ethylene" all correspond to the ontology "material"; the entity "microelectronics", the entity "packaging material" and the entity "medicine" all correspond to the ontology "application scenario"; the entity "A scientific research institution" corresponds to the ontology "scientific research institution"; the entity "B company" corresponds to the ontology "company"; the entity "Zhang San" and the entity "Li Si" all correspond to the ontology "talent".

[0168] In some embodiments, the user may perform interactive operations on the node corresponding to the entity “cycloolefin polymer”, such as viewing operations or dragging operations.

[0169] In some embodiments, when a viewing operation on a node corresponding to the entity “cycloolefin polymer” is received, the visualization interface 711 displays an attribute table 713 to show attribute values ​​of various attributes included in the entity “cycloolefin polymer”.

[0170] Optionally, the attribute table 713 shows that the name corresponding to the entity "cycloolefin polymer" is "cycloolefin polymer", the aliases are "COC", "COP", the haze is "91%", the average dispersion is "36", the birefringence is "<20nm"...

[0171] In this embodiment, the content in the knowledge graph of the oil refining and chemical industry can be intuitively displayed through a visual interface, and interactive functions are added to the nodes, allowing users to view the attributes of the entities or drag the positions of the nodes.

[0172] See also Figure 8 , Figure 8This is a structural block diagram of a knowledge graph construction device provided by an exemplary embodiment of the present application. The device includes:

[0173] The text processing module 801 is used to process structured data, semi-structured data and unstructured data in the field of oil refining and chemical industry to form plain text data;

[0174] Ontology construction module 802, used to construct an ontology structure in the field of oil refining and chemical engineering, wherein the ontology structure includes ontologies of different knowledge granularities;

[0175] The word-gram encoding module 803 is used to encode the word-grams in the text segment of the plain text data by using an encoder with a self-attention mechanism to obtain word-gram features corresponding to the word-grams; the word-gram features are integrated with global context features corresponding to the word-grams, and the global context features reflect the global information of the text segment related to the word-grams;

[0176] An entity extraction module 804 is used to extract entities corresponding to the ontology of different knowledge granularities from the text segment based on the word-meta features;

[0177] A relationship extraction module 805 is used to combine the entities in pairs to form candidate entity pairs, wherein the candidate entity pairs include a first entity and a second entity;

[0178] The relationship extraction module 805 is further configured to fuse the word-gram features corresponding to the word-gram in the first entity to obtain a first entity feature, and fuse the word-gram features corresponding to the word-gram in the second entity to obtain a second entity feature;

[0179] The relationship extraction module 805 is further used to fuse the word-gram features corresponding to the word-grams between the first entity and the second entity in the text segment to obtain local context features, wherein the local context features reflect local information between the first entity and the second entity in the text segment;

[0180] The relationship extraction module 805 is further used to determine the relationship type corresponding to the candidate entity pair through a relationship classification model based on the first entity feature, the second entity feature, the local context feature, the first width feature and the second width feature; the first width feature represents the width feature of all the words in the first entity, the second width feature represents the width feature of all the words in the second entity, and the relationship type represents the association relationship between the first entity and the second entity;

[0181] The knowledge graph construction module 806 is used to construct a knowledge graph in the field of petroleum refining and chemical engineering based on the entities and the relationship types between the entities.

[0182] Optionally, the entity extraction module 804 is used to:

[0183] Determining at least two consecutive word-grams from the text segment to form a candidate entity according to an entity width requirement, wherein the entity width requirement is used to limit the number of word-grams in the candidate entity;

[0184] The word-gram features corresponding to the word-grams in the candidate entity are merged to form candidate entity features;

[0185] Based on the candidate entity features, determining a recognition result of the candidate entity through a candidate entity recognition model, the recognition result including that the candidate entity is an entity or non-entity corresponding to the ontology of the different knowledge granularities, and the candidate entity recognition model is trained based on entity samples and entity labels corresponding to the ontology of the different knowledge granularities;

[0186] All the candidate entities that meet the entity width requirement are identified to obtain the entities corresponding to all the ontologies of different knowledge granularities in the text segment.

[0187] Optionally, the entity extraction module 804 is used to:

[0188] Obtaining classification mark features corresponding to the text segment through the encoder with a self-attention mechanism, wherein the classification mark features are used to extract semantic information of the text segment;

[0189] Obtaining a candidate entity width feature, wherein the candidate entity width feature represents a width feature of all the word elements in the candidate entity;

[0190] The classification mark feature, the candidate entity feature and the candidate entity width feature are input into the candidate entity recognition model to determine the recognition result of the candidate entity.

[0191] Optionally, the entity extraction module 804 is used to:

[0192] Input the word-unit feature into a forward long short-term memory network to obtain a first deep feature;

[0193] Input the word-unit feature into a backward long short-term memory network to obtain a second deep feature;

[0194] Concatenate the first deep feature, the second deep feature and the word-unit feature to obtain a concatenated feature;

[0195] Inputting the concatenated features into a conditional random field model to obtain entity extraction results corresponding to the word-grams, wherein the entity extraction results include the word-grams being the first word-gram, non-first word-gram or non-entity of entities corresponding to the ontology of the different knowledge granularities;

[0196] Based on the entity extraction results corresponding to all word-grams in the text segment, entities corresponding to the ontology of different knowledge granularities are extracted.

[0197] Optionally, ontology building module 802 is used to:

[0198] Based on the industry knowledge of oil refining and chemical industry, the initial ontology structure is constructed;

[0199] Supplementary ontology structures were extracted from the oil refining research literature;

[0200] Determine the hierarchical relationship and the association relationship between the ontologies in the initial ontology structure and the supplementary ontology structure;

[0201] The attributes contained in the ontology are determined to form the ontology structure.

[0202] Optionally, the knowledge graph construction module 806 is used to:

[0203] Determine an entity conflict situation of at least two of the entities, wherein the entity conflict situation indicates whether the at least two entities are entities with the same meaning in the field of petroleum refining and chemical engineering;

[0204] When the entity conflict situation indicates that at least two of the entities have entity conflict, performing entity alignment on the at least two entities;

[0205] Based on the entities after entity alignment and the relationship types between the entities, a knowledge graph in the field of petroleum refining and chemical engineering is constructed.

[0206] Optionally, the device further comprises a visualization module, wherein the visualization module is used to:

[0207] Based on the knowledge graph in the field of petroleum refining and chemical engineering, determine the nodes in a visualization interface and the connection relationship between the nodes, and the visualization interface is used to display the content of the knowledge graph;

[0208] Loading the knowledge graph into the visualization interface via a JavaScript library;

[0209] Drawing the nodes and the connection relationships in the visualization interface by using Canvas technology;

[0210] An interactive function is added to the node, wherein the interactive function at least includes a viewing function and a dragging function.

[0211] See also Fig. 9 , Fig. 9 It is a structural diagram of a computer device provided by an exemplary embodiment of the present application.

[0212] The computer device is a device that can implement the knowledge graph construction method in the field of oil refining and chemical engineering, such as a server or terminal. The computer device may also be called a user device, a portable computer device, etc. The computer device may also include one or more of the following components: a processor 910 and a memory 920.

[0213] Optionally, the processor 910 uses various interfaces and lines to connect various parts of the entire electronic device, and executes various functions of the electronic device and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 920, and calling data stored in the memory 920. Optionally, the processor 910 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 910 can integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), a neural network processor (NPU), and a baseband chip. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing the content that needs to be displayed on the touch display; the NPU is used to implement artificial intelligence (AI) functions; and the baseband chip is used to process wireless communications. It is understandable that the above baseband chip may not be integrated into the processor 910, but may be implemented by a separate chip.

[0214] The memory 920 may include a random access memory (RAM) or a read-only memory (ROM). Optionally, the memory 920 includes a non-transitory computer-readable storage medium. The memory 920 may be used to store instructions, programs, codes, code sets, or instruction sets. The memory 920 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc.; the data storage area may store data created according to the use of the electronic device (such as audio data, a phone book), etc.

[0215] In addition, those skilled in the art will appreciate that the structure of the electronic device shown in the above figures does not constitute a limitation on the electronic device, and the electronic device may include more or fewer components than shown in the figures, or a combination of certain components, or a different arrangement of components.

[0216] The embodiment of the present application also provides a computer-readable storage medium, in which at least one instruction is stored, and the at least one instruction is loaded and executed by a processor to implement the method described in the above embodiment. Optionally, the computer-readable storage medium may include: ROM, RAM, solid state drive (SSD, Solid State Drives) or optical disk, etc. Among them, RAM may include resistance random access memory (ReRAM, Resistance Random Access Memory) and dynamic random access memory (DRAM, Dynamic Random Access Memory).

[0217] The embodiment of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method provided in various optional implementations of the above aspects.

[0218] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A knowledge graph construction method, characterized in that: The method comprises: Process structured data, semi-structured data and unstructured data in the field of petroleum refining and chemical industry to form plain text data; Constructing an ontology structure in the field of oil refining and chemical engineering, wherein the ontology structure includes ontologies of different knowledge granularities; By means of an encoder with a self-attention mechanism, a word unit in a text segment of the plain text data is encoded to obtain a word unit feature corresponding to the word unit; the word unit feature is integrated with a global context feature corresponding to the word unit, and the global context feature reflects the global information of the text segment related to the word unit; Based on the word-meta features, extracting entities corresponding to the ontology of different knowledge granularities from the text fragments; Combining the entities in pairs to form candidate entity pairs, wherein the candidate entity pairs include a first entity and a second entity; The word-gram features corresponding to the word-grams in the first entity are merged to obtain a first entity feature, and the word-gram features corresponding to the word-grams in the second entity are merged to obtain a second entity feature; fusing the word-gram features corresponding to the word-grams between the first entity and the second entity in the text segment to obtain local context features, where the local context features reflect local information between the first entity and the second entity in the text segment; Based on the first entity feature, the second entity feature, the local context feature, the first width feature and the second width feature, determining the relationship type corresponding to the candidate entity pair through a relationship classification model; the first width feature represents the width feature of all the word-grams in the first entity, the second width feature represents the width feature of all the word-grams in the second entity, and the relationship type represents the association relationship between the first entity and the second entity; Based on the entities and the relationship types between the entities, a knowledge graph in the field of petroleum refining and chemical engineering is constructed.

2. The method according to claim 1, characterized in that The extracting entities corresponding to the ontology of different knowledge granularities from the text segment based on the word-meta features includes: Determining at least two consecutive word-grams from the text segment to form a candidate entity according to an entity width requirement, wherein the entity width requirement is used to limit the number of word-grams in the candidate entity; The word-gram features corresponding to the word-grams in the candidate entity are merged to form candidate entity features; Based on the candidate entity features, determining a recognition result of the candidate entity through a candidate entity recognition model, the recognition result including that the candidate entity is an entity or non-entity corresponding to the ontology of the different knowledge granularities, and the candidate entity recognition model is trained based on entity samples and entity labels corresponding to the ontology of the different knowledge granularities; All the candidate entities that meet the entity width requirement are identified to obtain the entities corresponding to all the ontologies of different knowledge granularities in the text segment.

3. The method according to claim 2, characterized in that The determining the recognition result of the candidate entity based on the candidate entity feature through a candidate entity recognition model includes: Obtaining classification mark features corresponding to the text segment through the encoder with a self-attention mechanism, wherein the classification mark features are used to extract semantic information of the text segment; Obtaining a candidate entity width feature, wherein the candidate entity width feature represents a width feature of all the word elements in the candidate entity; The classification mark feature, the candidate entity feature and the candidate entity width feature are input into the candidate entity recognition model to determine the recognition result of the candidate entity.

4. The method according to claim 1, characterized in that: The step of extracting entities corresponding to the ontology of different knowledge granularities from the text segment based on the word-meta features further includes: Input the word-unit feature into a forward long short-term memory network to obtain a first deep feature; Input the word-unit feature into a backward long short-term memory network to obtain a second deep feature; Concatenate the first deep feature, the second deep feature, and the word-unit feature to obtain a concatenated feature; Inputting the concatenated features into a conditional random field model to obtain entity extraction results corresponding to the word-grams, wherein the entity extraction results include the word-grams being the first word-gram, non-first word-gram or non-entity of entities corresponding to the ontology of the different knowledge granularities; Based on the entity extraction results corresponding to all word-grams in the text segment, entities corresponding to the ontology of different knowledge granularities are extracted.

5. The method according to claim 1, characterized in that The construction of the ontology structure in the field of oil refining and chemical industry includes: Based on the industry knowledge of oil refining and chemical industry, the initial ontology structure is constructed; Supplementary ontology structures were extracted from the oil refining research literature; Determine the hierarchical relationship and the association relationship between the ontologies in the initial ontology structure and the supplementary ontology structure; The attributes contained in the ontology are determined to form the ontology structure.

6. The method according to claim 1, characterized in that The knowledge graph in the field of oil refining and chemical engineering is constructed based on the entities and the relationship types between the entities, including: Determine an entity conflict situation of at least two of the entities, wherein the entity conflict situation indicates whether the at least two entities are entities with the same meaning in the field of petroleum refining and chemical engineering; When the entity conflict situation indicates that at least two of the entities have entity conflict, performing entity alignment on the at least two entities; Based on the entities after entity alignment and the relationship types between the entities, a knowledge graph in the field of petroleum refining and chemical engineering is constructed.

7. The method according to claim 1, characterized in that The method further comprises: Based on the knowledge graph in the field of petroleum refining and chemical engineering, determine the nodes in a visualization interface and the connection relationship between the nodes, and the visualization interface is used to display the content of the knowledge graph; Loading the knowledge graph into the visualization interface via a JavaScript library; Drawing the nodes and the connection relationships in the visualization interface by using Canvas technology; An interactive function is added to the node, wherein the interactive function at least includes a viewing function and a dragging function.

8. A knowledge graph construction device, characterized in that: The device comprises: The text processing module is used to process structured data, semi-structured data and unstructured data in the field of petroleum refining and chemical industry to form plain text data; An ontology construction module is used to construct an ontology structure in the field of oil refining and chemical engineering, wherein the ontology structure contains ontologies of different knowledge granularities; A word-gram encoding module, used for encoding word-grams in the text segment of the plain text data by an encoder with a self-attention mechanism to obtain word-gram features corresponding to the word-grams; the word-gram features are integrated with global context features corresponding to the word-grams, and the global context features reflect global information of the text segment related to the word-grams; An entity extraction module, used for extracting entities corresponding to the ontology of different knowledge granularities from the text segment based on the word-meta features; A relationship extraction module, used for combining the entities in pairs to form candidate entity pairs, wherein the candidate entity pairs include a first entity and a second entity; The relationship extraction module is further used to fuse the word-gram features corresponding to the word-gram in the first entity to obtain a first entity feature, and to fuse the word-gram features corresponding to the word-gram in the second entity to obtain a second entity feature; The relationship extraction module is further used to fuse the word-gram features corresponding to the word-grams between the first entity and the second entity in the text segment to obtain local context features, wherein the local context features reflect local information between the first entity and the second entity in the text segment; The relationship extraction module is further used to determine the relationship type corresponding to the candidate entity pair through a relationship classification model based on the first entity feature, the second entity feature, the local context feature, the first width feature and the second width feature; the first width feature represents the width feature of all the word-grams in the first entity, the second width feature represents the width feature of all the word-grams in the second entity, and the relationship type represents the association relationship between the first entity and the second entity; The knowledge graph construction module is used to construct a knowledge graph in the field of petroleum refining and chemical industry based on the entities and the relationship types between the entities.

9. A computer device, characterized in that: The computer device includes a processor and a memory; the memory stores at least one instruction, and the at least one instruction is used to be executed by the processor to implement the knowledge graph construction method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction, which is loaded and executed by the processor to implement the knowledge graph construction method as described in any one of claims 1 to 7.

11. A computer program product, characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium; the processor of the terminal reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the terminal executes the knowledge graph construction method as described in any one of claims 1 to 7.