Knowledge graph construction method, device and system based on multi-source data information
By using the Span BERT model and Levenshtein/jacard distance for entity alignment, combined with the N-Gram model and Neo4j storage, the problem of low accuracy in entity alignment and disambiguation in multi-source data is solved, and efficient knowledge graph construction is achieved.
Patent Information
- Application Number
- CN202310165820.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-24
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2043-02-24
AI Technical Summary
Existing technologies for knowledge graph construction have low accuracy in entity alignment and disambiguation of multi-source data, resulting in many redundant entities, increasing the demand for data storage resources, and traditional methods rely on manual annotation, which is costly and has poor scalability.
The Span BERT model is used for referential resolution, Levenshtein distance and Jacard distance are used for entity alignment, and N-Gram model is used for information extraction. Neo4j is used to store the graph database to improve the accuracy of entity disambiguation and alignment.
It improves the accuracy of knowledge fusion, reduces redundant entities, lowers the cost of manual annotation, and enables efficient knowledge graph construction from multi-source data.
Smart Images

Figure CN116244448B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, more particularly, to a knowledge graph construction method, device and system based on multi-source data information. BACKGROUND
[0002] Knowledge graph refers to a series of various different graphs showing the development process and structural relationship of knowledge, using visualization technology to describe knowledge resources and their carriers, and to mine, analyze, construct, draw and display knowledge and their mutual relationships. The structured storage characteristics of knowledge graph make it have very broad application prospects. With the rise of knowledge graph, the storage method of database has entered a new stage of development. Target knowledge graph has been gradually applied to search software, e-commerce software and other service software to realize information retrieval, etc. Meanwhile, it can also be applied to instant monitoring and report generation of complex public opinion information from various sources, and can bring huge economic value. As an important step of knowledge graph, the construction of knowledge graph needs continuous exploration and practice.
[0003] The research on knowledge graph construction mainly includes information extraction, knowledge fusion and knowledge processing. The biggest obstacle in the construction of knowledge graph is that the machine has low accuracy in the implementation of knowledge fusion, resulting in many redundant entities in the knowledge graph, which increases the resources required for data storage. The characteristics of knowledge graph are considered to be an important way for the next generation of data storage, so the construction of knowledge graph is also an important research field of data storage in artificial intelligence.
[0004] Due to the importance of knowledge graph to data storage application, the construction method of knowledge graph has attracted a lot of attention in the process of widespread promotion of knowledge graph. However, because of the conflicts and ambiguities of entities in multi-source data, the construction process is challenging, and the progress of knowledge graph construction method is very slow. Therefore, how to align a large number of entities with conflicts and ambiguities in multi-source data in a more effective way, disambiguate, etc. to realize the construction of knowledge graph, improve the accuracy of entity disambiguation, entity alignment and reference resolution, is still a difficult problem in the current knowledge graph construction process.
[0005] In recent years, knowledge fusion methods have been constantly improving from machine learning to deep learning, with certain accuracy improvement in performance and accuracy. The most important step in the construction of knowledge graph is knowledge fusion, which consists of entity alignment, entity disambiguation and reference resolution. The entity alignment method is divided into two categories, including pair-wise entity alignment based on the similarity of instances and their attributes, and collective entity alignment based on the mutual relationship between instances on the basis of pair-wise entity alignment; the entity linking and disambiguation method can be divided into machine learning-based method and deep learning-based method.
[0006] For entity alignment:
[0007] Traditional instance-based and attribute similarity-based entity alignment methods usually require a large amount of manual annotation of data or carefully designed alignment features. The Yago3 method carefully designed alignment features by hand, enabling entities in Wikipedia to align with existing YAGO entities, and achieved high alignment accuracy. Anguera et al. manually defined the similarity between letters and phonemes. Tapaswi et al. defined the similarity between visual scenes and sentences based on the appearance of the same characters to align TV programs and episode summaries. Bojanowski et al. proposed a method similar to typical time warping, but also extended it to use existing (weak) supervised alignment data for model training. Plummer et al. used CCA to find a coordinated space between image regions and phrases for alignment. Multi-source knowledge base entity alignment model based on network semantic tags Various entity tags are used to achieve Chinese entity alignment and achieve high accuracy and recall. Instance-based and attribute similarity-based entity alignment methods are intuitive and simple, and can achieve high entity alignment results. However, this traditional entity alignment method relies on a large amount of prior knowledge, and using manual data annotation will result in a large waste of time and high labor costs. In addition, the designed entity features often have poor scalability and are not universally applicable.
[0008] Collective entity alignment method based on inter-instance action relationship is based on pairwise entity alignment method and considers the action relationship between instances to calculate similarity. Zhuang et al. used machine learning methods to perform coarse-grained alignment of domain knowledge bases, then used inference models to infer the answers to questions, and finally used fault-tolerant algorithms to obtain entity alignment results. Yu Chuanming et al. aimed at the problem of data redundancy and inconsistency in knowledge fusion, proposed a domain knowledge alignment model based on deep learning from the perspective of knowledge graph. The model uses multi-source heterogeneous and cross-language datasets for computational experiments, and the experiments show that the model improves the entity alignment effect and improves the correctness and coverage of domain knowledge.
[0009] In recent years, some methods have focused on entity alignment using heterogeneous and heterogeneous knowledge in different knowledge graphs. The method of multi-source entity alignment through concept annotation uses concept annotation to enrich the internal links in the knowledge graph, iteratively predicts new multi-source knowledge pairs, and uses this iterative alignment method to achieve high accuracy, but often requires a large amount of training time. Kong et al. trained a Markov random field to align objects in a three-dimensional scene with nouns and pronouns in text descriptions. Mao et al. used a long short-term memory language model and a convolutional neural network visual model to evaluate the matching quality between reference expressions and objects in images. Zhu et al. measured the similarity between scenes and texts by training a convolutional neural network to align books with corresponding movies / scripts. Yu et al. extended this model to include relative appearance and contextual information, which can better disambiguate between objects of the same type. Hu et al. used a scoring function based on long short-term memory networks to find similarities between image regions and their descriptions. With the advent of knowledge representation learning methods, the MTransE method directly uses known knowledge triples to achieve multilingual knowledge alignment between English and French. The IPTransE method uses shared parameters to implement knowledge embedding and uses a soft rule method to implement entity alignment. The HolisticEM method only uses structured information in the knowledge graph to implement vectorized representation of triples, and iteratively implements multi-source entity alignment. The JAPE method learns entity embeddings and relationships between different knowledge graphs in a unified semantic space.
[0010] For entity linking and disambiguation methods:
[0011] In machine learning-based methods, the core of entity disambiguation is to calculate the similarity between the given entity and the entity to be disambiguated, and then select the entity with the highest similarity as the target entity. Milne et al. used entity statistical information and name statistical information to disambiguate target entities. Han et al. used encyclopedic data as background knowledge to assist in disambiguation. Ji et al. proposed a global reasoning algorithm to consider the mutual relationships between entities in the text to find the globally optimal decision. In addition, to solve the problem of corpus annotation, efficient weakly supervised or unsupervised strategies have been studied in recent years. Shen et al. combined features such as entity popularity and semantic correlation, calculated the weights of each feature using the maximum margin algorithm, and implemented entity disambiguation using a ranking algorithm. In addition, the semi-supervised algorithm proposed by Agichtein et al., the distant supervision algorithm proposed by Etzioni et al., and the self-learning method based on massive data redundancy proposed by Shi et al. also solve the problem of corpus annotation to some extent.
[0012] Traditional supervised machine learning algorithm needs a large amount of labeled corpus, and the existing labeled corpus of the project is difficult to meet the needs of entity disambiguation. In the method based on deep learning, the essence of entity disambiguation is to construct a unified representation of triplets, and to model the connection between multi-source information and multi-source text. The deep learning method maps different types of information to the same feature space and proposes an efficient end-to-end training algorithm, which provides a powerful tool for the above task. Francis et al. added a convolutional neural network model to the original neural network language model, which greatly improved the effect of entity disambiguation. Ganea et al. proposed a vector representation learning method for multi-source heterogeneous evidence, which uniformly represented the knowledge in different source knowledge bases in the same space, and then completed entity disambiguation. Sil et al. proposed to represent the evidence information as a vector, learn the similarity between different evidences based on the representation vector, and then perform similarity fusion to finally complete entity disambiguation. Mao Ersong et al. proposed to use the Skip-Gram model to train word vectors, and use word vectors to calculate similarity to realize entity linking and disambiguation. Huai Baoxing et al. proposed to map the context of the disambiguated entity and the entity to be disambiguated into the same space, and based on the probability space model, disambiguate the entity based on the spatial vector of the entity. Fengchong et al. use the Skip-Gram model to train word vectors, and propose a semantic classification method based on the short text features of microblog to complete entity disambiguation.
[0013] Although the above methods improve the effect of knowledge fusion to some extent, most of them perform better in handling the disambiguation between characters, and the disambiguation algorithm for common event knowledge does not provide a good solution effect. SUMMARY
[0014] The purpose of the present application is to overcome the shortcomings of the prior art, provide a knowledge graph construction method, device and system based on multi-source data information, improve the knowledge fusion accuracy, and complete the construction of the knowledge graph.
[0015] The purpose of the present application is achieved by the following scheme:
[0016] A knowledge graph construction method based on multi-source data information, comprising the following steps:
[0017] S1, data acquisition;
[0018] S2, information extraction;
[0019] S3, knowledge fusion, integrating the knowledge in multiple knowledge bases to form a knowledge base process, in which, the reference resolution, entity disambiguation, entity alignment are included; wherein, the reference resolution is used for the case of unclear reference, the pronoun appearing in different places points to which entity appearing in the previous text, which is processed by Span BERT model; the entity disambiguation is used for the polysemy phenomenon, according to the current context, the context information is used to accurately find the corresponding entity and establish entity link; the entity alignment is used for the case that multiple entities have different names but are actually the same thing, and the repetition and redundancy of entities occur, the Levenshtein distance and jacard distance are used for entity alignment, and if the similarity is greater than a certain threshold, it is judged as similar entities;
[0020] S4, knowledge storage.
[0021] Further, in step S1, the data acquisition includes the following sub-steps:
[0022] S11, judge whether the web page is a static web page or a dynamic web page, all the contents of the static web page are in the source code, while the dynamic web page is not all;
[0023] S12, after distinguishing the type of the web page, judge the web page request method, which is divided into 'get' and 'post' two ways; judge and select the corresponding crawler algorithm to obtain data for different web page types; store the obtained data through the python file storage code, and store the obtained text, image and video data, and preliminarily establish the database;
[0024] S13, write regular expressions through the re library in Python, and perform sentence segmentation operation through punctuation as the basis for regular expression judgment.
[0025] Further, in step S2, the information extraction includes the following sub-steps: using N-Gram model to extract information, detecting whether the event reported in the text exists, if it exists, extracting event elements from natural language text, constructing event trigram word part-of-speech templates, and finally presenting in a structured way.
[0026] Further, in step S3, the reference resolution specifically includes the following sub-steps:
[0027] S3a, input data x is mapped to a common feature space through word embedding Embbeding module, byte encoding, segment and position information word embedding;
[0028] S3b, the data after word embedding is sent into the Span BERT pre-training model;
[0029] S3c, according to the reference resolution task, fine-tuning the model, changing the output of the original model from CLS to the output of the pronoun and the corresponding entity byte code, adding an output layer, and outputting the pronoun and the actual corresponding specific entity.
[0030] Further, in step S3, in the entity alignment, the threshold is set in advance.
[0031] Further, in step S3, the entity disambiguation includes the following sub-steps: generating a vector representation of the context sentence and an entity representation of the candidate concept for a given sentence context and the corresponding entity to be disambiguated, and then using the cosine similarity to determine the similarity between the candidate concept and the context, thereby completing the entity disambiguation task.
[0032] Further, in step S4, the knowledge storage includes the following sub-steps: Neo4j-based knowledge graph storage.
[0033] Further, the information extraction using the N-Gram model specifically includes the following sub-steps:
[0034] The verbs, phrases and nouns in the sentence are extracted using the jieba tool, the noise words are removed, the phrases that cannot be split are identified, the noun words or phrases are stored as entities, and the verbs or attributes are stored as relationships.
[0035] Event extraction in a closed domain first extracts trigger words indicating event types, and then extracts events.
[0036] A knowledge graph construction device based on multi-source data information, comprising a processor and a memory, the memory storing a computer program, when the computer program is loaded by the processor and executes the method as claimed in any one of the above.
[0037] A knowledge graph construction system based on multi-source data information, comprising the device as claimed above.
[0038] The beneficial effects of the present application include:
[0039] The present application proposes an information extraction scheme based on a part-of-speech template method, which improves the extraction accuracy of unstructured text data by constructing a part-of-speech template of event triplets.
[0040] The improvement of the present application to Bert mainly lies in the improvement of the mask method, discarding the NSP task and adding the SBO (Span Boundary Objective) task, which greatly improves the accuracy of the reference resolution.
[0041] The application improves the knowledge fusion accuracy and completes the construction of the knowledge graph by the knowledge fusion technical scheme in the method in the case that entities are redundant and miscellaneous and event types are various in acquired multi-source data information.
[0042] The application obtains the required data through data acquisition and word segmentation operation, and further extracts event triplets by the information extraction scheme based on the part-of-speech template. The position coding of the triplets is sent to the improved Bert to complete the tasks of reference resolution, entity disambiguation and entity alignment, and then the knowledge fusion in multiple knowledge bases is completed. The application combines three improved algorithms to realize the integrated deployment of multiple steps from data acquisition to knowledge storage, and completes the construction of the multi-source information knowledge graph. BRIEF DESCRIPTION OF DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description only some embodiments of the application, and for those skilled in the art, other drawings can be obtained without creative labor under the premise of these drawings.
[0044] Fig. 1 The flow chart for the implementation of the embodiment of the application is shown in the figure.
[0045] Fig. 2 The reference resolution model in the embodiment of the application is shown in the figure.
[0046] Fig. 3 The Neo4j knowledge storage in the embodiment of the application is shown in the figure. DETAILED DESCRIPTION
[0047] All the features disclosed by all the embodiments in the specification, or all the steps in the methods or processes implied by the specification, can be combined and / or extended, replaced, unless the features and / or steps are mutually exclusive.
[0048] The application provides a knowledge graph construction method based on multi-source data information, comprising the following steps:
[0049] (1) Data acquisition
[0050] We obtain the network open source data by the way of crawler, and after simple sentence processing, the data is used as the data source in the knowledge graph construction process, and provides data for subsequent information extraction operation.
[0051] (2) Information extraction
[0052] We use N-Gram model for information extraction, by detecting whether the event reported in the text exists, if it exists, the event elements are extracted from the natural language text, the word part of speech template of the event triple is constructed, and finally it is presented in a structured way.
[0053] (3) Knowledge fusion
[0054] Integrating knowledge in multiple knowledge bases to form a knowledge base process, in this process, the main key technologies include reference resolution, entity disambiguation and entity alignment.
[0055] (3a) Reference resolution
[0056] For the case of unclear reference, the pronoun in different places points to which entity in the previous text, the technology uses Span BERT model, which is stacked by multiple encoders.
[0057] (3b) Entity disambiguation
[0058] For the polysemy phenomenon, we accurately find the corresponding entity according to the current context and contact the context information to establish entity linking.
[0059] (3c) Entity alignment
[0060] For multiple entities with different names but actually the same thing, entity repetition and redundancy will occur. We use Levenshtein distance and jacard distance to align entities, and similarity greater than a certain threshold is judged as similar entities.
[0061] (4) Knowledge storage
[0062] Neo4j is a popular graph database at present, which has the characteristics of free and open source and easy deployment.
[0063] The current mainstream dependency syntax method for event triple extraction is limited by the accuracy of the dependency syntax performance, but frankly speaking, the performance of the current dependency syntax analyzer is not very high, therefore the technical scheme of the present application proposes an information extraction based on the part of speech template method, the idea of which is to construct the word part of speech template of the event triple, such as a typical IP phrase, NP phrase, VP phrase, etc., to improve the extraction accuracy of unstructured text data.
[0064] The spanbert model used in the technical scheme of the embodiment of the present application performs reference resolution, and the improvement of Bert mainly reflects the improvement of the mask method, discards the NSP task and increases the SBO (Span Boundary Objective) task, which greatly improves the accuracy of reference resolution.
[0065] It should be noted that within the scope of protection defined in the claims of the present application, the following embodiments can be combined and / or extended, replaced, in any logical manner from the above specific embodiments, such as disclosed technical principles, disclosed technical features or implied disclosed technical features, etc.
[0066] As shown in Figs. 1-3 The implementation steps of the present application are as follows:
[0067] Step 1, data acquisition
[0068] We obtain network open source data by means of crawler, select appropriate crawler mode by judging the web state, and perform simple sentence processing by means of regular expression in re library in Python, as data source in the process of knowledge graph construction, to provide data for subsequent information extraction operation.
[0069] The specific implementation of this step is as follows:
[0070] 3.1) Crawler data acquisition
[0071] First, judge whether the web page is a static web page or a dynamic web page. The content of the static web page is in the source code, while the content of the dynamic web page is not. After distinguishing the types of web pages, judge the web page request mode, which mainly includes 'get' and 'post' two modes. By judging, select appropriate crawler algorithm, among which re parsing, Bs4 parsing, xpath parsing are commonly used for data acquisition operation. Through the pre-study of crawler technology, xpath is the most commonly used and most convenient and efficient way in crawler technology, and it has strong universality. It does not need to write new code for each website. Only the corresponding parameters need to be changed. The data obtained is stored by python file storage code, and the obtained text, image and video data are stored to preliminarily establish the database.
[0072] 3.2) Sentence processing
[0073] Regular expression writing is performed by means of re library in Python, and sentence operation is performed by taking punctuation marks as the basis for regular expression judgment.
[0074] Step 2, information extraction
[0075] The present application uses N-Gram model to carry out information extraction, detects whether the event reported in the text exists, if it exists, extracts event elements from natural language text, constructs event trigram word part of speech template, and finally presents in a structured manner. The verbs, phrases, nouns and the like in the sentence are extracted by using jieba tool, the noise words are removed, the phrases that cannot be split are identified, the noun words or phrases are stored as entities, and the verbs or attributes are stored as relations. The event extraction in the closed domain first extracts the trigger word indicating the event type, and then extracts the event.
[0076] Step 3, knowledge fusion
[0077] The relationship between the information units after information extraction is flat, lacks hierarchy and logic, and there are a large amount of redundant or even erroneous information fragments. Knowledge fusion, simply put, is the process of integrating knowledge in multiple knowledge bases to form a knowledge base. In this process, the main key technologies include coreference resolution, entity disambiguation, and entity alignment. Different knowledge bases have different focuses in collecting knowledge. For the same entity, some knowledge bases may focus on describing a certain aspect of the entity itself, and some knowledge bases may focus on describing the relationship between the entity and other entities. The purpose of knowledge fusion is to integrate the descriptions of entities from different knowledge bases, so as to obtain a complete description of the entity. Knowledge fusion aims to solve how to fuse multiple source description information about the same entity or concept.
[0078] The specific implementation of this step is as follows:
[0079] 3.1) Coreference resolution
[0080] The Span BERT model used in the present technology is a multi-layer encoder stack, and the specific prediction process is as follows:
[0081] (1) The input data x is input into the Embbeding module to perform token, segment and position Embbeding, and all x are mapped to a common feature space.
[0082] (2) The Embbeded data is input into the Span BERT pre-training model.
[0083] (3) According to the specific coreference resolution task, the model is fine-tuned (Fine-Tuning), the original model uses CLS as the output, which is changed to the output of the pronoun and the corresponding entity token, an output layer is added, and the pronoun and the actual corresponding specific entity are output.
[0084] 3.2) Entity alignment
[0085] The entity alignment is different for multiple entities, but actually refers to the same thing, and the repetition and redundancy of the entity will appear, and we use Levenshtein distance and jacard distance to perform entity alignment.
[0086] Levenshtein distance refers to the minimum number of editing operations required to convert one string into another. The permitted editing operations include replacing one character with another, inserting a character, and deleting a character. Generally speaking, the smaller the edit distance, the greater the similarity of the two strings.
[0087]
[0088] Jaccard similarity coefficient, also known as Jaccard index, is a measure of the similarity of two sets, which is defined as the number of elements in the intersection of the two sets divided by the number of elements in the union of the two sets.
[0089]
[0090] Jaccard distance is a measure of the difference between two sets, which is the complement of Jaccard similarity coefficient, defined as 1 minus Jaccard similarity coefficient.
[0091]
[0092] Levenshtein distance and jacard distance are used to determine the similarity between entities. If the similarity is greater than a certain threshold, it is considered similar entities. If the entities are similar and the relationship is the same, delete directly; if the relationship is different, move the relationship to any entity and then delete. The appropriate threshold can be selected according to the actual situation.
[0093] 3.3) Entity disambiguation
[0094] For a given sentence context and corresponding entity words to be disambiguated, we generate vector representations of the context sentence and candidate concept entity representations, and then use cosine similarity to determine the similarity between the candidate concept and the context, thereby completing the entity disambiguation task. The candidate concept entity is provided by the Chinese Baidu Encyclopedia polysemy page.
[0095]
[0096] Step 4: Knowledge graph storage based on Neo4j
[0097] Compared with traditional relational databases, graph databases are naturally suitable for storing data with complex associations, which represent each entity as a node, and the relationship between entities as an edge between nodes, and the entity / relationship and the contained attributes are similar to their Key / Value key-value pairs. Neo4j is a relatively popular graph database at present, which has the characteristics of free open source and easy deployment.
[0098] The effect of the technical scheme of the application is further verified and described below in combination with simulation:
[0099] 1. Simulation experiment conditions:
[0100] The hardware platform in the simulation experiment of the application is: the CPU model is Intel(R) i9-7960X, the GPU model is GeForce RTX 3080Ti*1, the video memory is 10G, and the memory is 32G*8.
[0101] The software platform in the simulation experiment of the application is: ubuntu 20.0LTS system, Python 3.6, pytorch >=2.0.
[0102] The data set used in the simulation experiment of the application is from a self-built data set.
[0103] 2. Simulation content and result analysis:
[0104] The calculation results of the knowledge fusion in the knowledge graph construction using the application and the self-built data set are shown in the following table:
[0105] Table 1 Knowledge fusion results of the application
[0106]
[0107] As can be seen from Table 1, the method of the application combines advanced algorithms of coreference resolution, entity alignment and entity disambiguation, and obtains better knowledge graph construction effect. Therefore, it is proved that the knowledge graph construction method proposed by the application is more suitable for actual application scenarios.
[0108] Embodiment 1
[0109] A knowledge graph construction method based on multi-source data information, comprising the following steps:
[0110] S1, data acquisition;
[0111] S2, information extraction;
[0112] S3, knowledge fusion, integrating the knowledge in multiple knowledge bases to form a knowledge base process, in this process, including anaphora resolution, entity disambiguation, entity alignment; wherein, the anaphora resolution is used for the case of unclear reference, the pronoun appearing in different places points to which entity appearing in the previous text, which is processed by using the Span BERT model; the entity disambiguation is used for the polysemy phenomenon, according to the current context, the context information is used to accurately find the corresponding entity and establish entity linkage; the entity alignment is used for the case that multiple entities have different names but are actually the same thing, and the repetition and redundancy of entities occur, the Levenshtein distance and jacard distance are used for entity alignment, and if the similarity is greater than a certain threshold, it is judged as similar entities;
[0113] S4, knowledge storage.
[0114] Embodiment 2
[0115] On the basis of embodiment 1, in step S1, the data acquisition includes the following sub-steps:
[0116] S11, determine whether the web page is a static web page or a dynamic web page, all the contents of the static web page are in the source code, and the dynamic web page is not all;
[0117] S12, after distinguishing the type of the web page, determine the web page request method, which is divided into 'get' and 'post' two ways; determine the corresponding crawler algorithm to obtain data for different web page types; store the obtained data through the python file storage code, and store the obtained text, image and video data to preliminarily establish a database;
[0118] S13, write regular expressions through the re library in Python, and perform sentence segmentation operation through punctuation as the basis for regular expression judgment.
[0119] Embodiment 3
[0120] On the basis of embodiment 1, in step S2, the information extraction includes the following sub-steps: using N-Gram model to extract information, detecting whether the event reported in the text exists, if it exists, extracting event elements from natural language text, constructing event trigram word part-of-speech templates, and finally presenting in a structured manner.
[0121] Embodiment 4
[0122] On the basis of embodiment 1, in step S3, the anaphora resolution specifically includes the following sub-steps:
[0123] S3a, input data x is passed through the word embedding Embbeding module, byte encoding, segment and location information word embedding, all x is mapped to a common feature space;
[0124] S3b, the data after word embedding is sent to the Span BERT pre-training model;
[0125] S3c, according to the anaphora resolution task, the model is fine-tuned, the original model uses CLS as the output, which is changed to the output of the pronoun and the corresponding entity byte encoding, an output layer is added, and the pronoun and the corresponding specific entity are output.
[0126] Embodiment 5
[0127] On the basis of embodiment 1, in step S3, the entity alignment, the threshold value is set in advance.
[0128] Embodiment 6
[0129] On the basis of embodiment 1, in step S3, the entity disambiguation includes the following sub-steps: for a given sentence context and the corresponding entity word to be disambiguated, the vector representation of the context sentence and the entity representation of the candidate concept are generated respectively, and then the similarity between the candidate concept and the context is judged by using the cosine similarity, so as to complete the entity disambiguation task.
[0130] Embodiment 7
[0131] On the basis of embodiment 1, in step S4, the knowledge storage includes the following sub-steps: Neo4j-based knowledge graph storage.
[0132] Embodiment 8
[0133] On the basis of embodiment 3, the information extraction using the N-Gram model includes the following sub-steps:
[0134] The verbs, phrases and nouns in the sentence are extracted by using the jieba tool, the noise words are removed, the phrases that cannot be split are recognized, the noun words or phrases are stored as entities, and the verbs or attributes are stored as relations.
[0135] The event extraction in the closed domain first extracts the trigger word indicating the event type, and then extracts the event.
[0136] Embodiment 9
[0137] A knowledge graph construction device based on multi-source data information, the device comprises a processor and a memory, the memory stores a computer program, when the computer program is loaded by the processor and executes the method as described in any one of embodiments 1-8.
[0138] Embodiment 10
[0139] A knowledge graph construction system based on multi-source data information comprises the device of embodiment 9.
[0140] The units described in the embodiments of the present application can be implemented by software, or can be implemented by hardware, and the described units can also be set in a processor. In some cases, the names of the units do not constitute a limitation on the units themselves.
[0141] According to an aspect of the embodiments of the present application, a computer program product or computer program is provided, which includes computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method provided in the various optional implementation manners described above.
[0142] As another aspect, the embodiments of the present application also provide a computer readable medium, which can be included in the electronic device described in the above embodiments, or can exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs, which, when executed by the electronic device, enable the electronic device to implement the method described in the above embodiments.
[0143] The parts of the present application not involved are the same as or can be realized by the prior art.
[0144] The above technical solution is only one embodiment of the present application. For those skilled in the art, on the basis of the application disclosed application methods and principles, various types of improvements or modifications can be easily made, and are not limited to the methods described in the above embodiments, therefore the above described methods are only preferred, and do not have limiting significance.
[0145] In addition to the above examples, those skilled in the art can obtain other embodiments by being inspired by the above disclosure or by making modifications using knowledge or technology in related fields. The features of each embodiment can be interchanged or replaced, and the modifications and changes made by those skilled in the art do not deviate from the spirit and scope of the present application, and should be within the protection scope of the claims of the present application.
Claims
1. A method for constructing a knowledge graph based on multi-source data information, characterized in that, Includes the following steps: S1, Data Acquisition; S2, Information Extraction; S3, Knowledge Fusion, is the process of integrating knowledge from multiple knowledge bases to form a single knowledge base. This process includes referential resolution, entity disambiguation, and entity alignment. Referential resolution addresses ambiguous referents, using the Span BERT model to handle situations where pronouns appearing in different contexts do not clearly refer to specific entities mentioned earlier. Entity disambiguation addresses polysemy by accurately identifying the corresponding entity based on the current context and related information, and establishing entity links. Entity alignment addresses situations where multiple entities have different names but are actually the same thing, leading to entity duplication and redundancy. It uses Levenshtein distance and Jacard distance for entity alignment, classifying entities as similar if the similarity exceeds a certain threshold. S4, knowledge storage; In step S1, the data acquisition includes the following sub-steps: S11, determine whether the webpage is static or dynamic. All the content of a static webpage is in the source code, while not all of the content of a dynamic webpage is in the source code. S12, after distinguishing the webpage type, determine the webpage request method, which is divided into 'get' and 'post'; select the appropriate crawler algorithm for different webpage types to obtain data; store the obtained data through Python files, and store the obtained text, image, and video data to initially establish a database; S13 uses the re library in Python to write regular expressions and uses punctuation marks as the basis for regular expression judgment to perform sentence segmentation. In step S2, the information extraction includes the following sub-steps: using an N-Gram model to extract information by detecting whether the reported events exist in the text; if they exist, extracting event elements from the natural language text, constructing part-of-speech templates for event triples, and finally presenting them in a structured manner. In step S3, the referential resolution specifically includes the following sub-steps: S3a, the input data x is processed by the word embedding module, which performs byte encoding, word embedding of segment and position information, and maps all x to a common feature space; S3b feeds the word-embedded data into the Span BERT pre-trained model; S3c, based on the referential resolution task, fine-tunes the model by changing the original model's output from CLS to the output of pronouns and their corresponding entity byte encodings, and adding an output layer to output the pronouns and their actual corresponding specific entities.
2. The knowledge graph construction method based on multi-source data information according to claim 1, characterized in that, In step S3, the set threshold is preset during entity alignment.
3. The knowledge graph construction method based on multi-source data information according to claim 1, characterized in that, In step S3, the entity disambiguation includes the following sub-steps: for a given sentence context and the corresponding entity words to be disambiguated, a vector representation of the context sentence and an entity representation of the candidate concept are generated respectively. Then, the cosine similarity method is used to determine the similarity between the candidate concept and the context, thereby completing the entity disambiguation task.
4. The knowledge graph construction method based on multi-source data information according to claim 1, characterized in that, In step S4, the knowledge storage includes the sub-step of storing a knowledge graph based on Neo4j.
5. The knowledge graph construction method based on multi-source data information according to claim 1, characterized in that, The use of the N-Gram model for information extraction specifically includes the following sub-steps: The jieba tool is used to extract verbs, phrases, and nouns from sentences, remove noise words, identify phrases that cannot be split, store noun words or phrases as entities, and store verbs or attributes as relations. To extract events from a closed domain, first extract the trigger words that indicate the event type, and then extract the event itself.
6. A knowledge graph construction device based on multi-source data information, characterized in that, The device includes a processor and a memory, the memory storing a computer program that, when loaded by the processor, executes the method as described in any one of claims 1 to 5.
7. A knowledge graph construction system based on multi-source data information, characterized in that, Includes the device as described in claim 6.
Citation Information
Patent Citations
Geographic knowledge acquisition method
CN112256888A
Industrial equipment fault diagnosis method and system based on knowledge graph
CN112596495A