A knowledge graph construction method integrating information acquisition and triple extraction
The construction of a marine knowledge graph through crawler technology and natural language processing tools solves the problem of information integration and linkage utilization in the marine industry, enables the ability to discover knowledge from scattered data, reduces user costs, and helps organizations make decisions.
Patent Information
- Application Number
- CN202111538747.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-15
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2041-12-15
AI Technical Summary
Existing technology cannot realize the interconnection and linked utilization of information between marine industries, resulting in the inability to discover knowledge from scattered data and increasing user costs.
A knowledge graph construction method that integrates information acquisition and triple extraction is adopted. Marine-related text content is crawled through crawler technology, and natural language processing tools are used to extract entities and relationships to build a knowledge graph and visualize it in a data browser to obtain Knowledge connection.
It reduces user costs, builds a marine knowledge map, discovers knowledge from scattered data, explores the correlation of things, and helps organizations make guided decisions.
Smart Images

Figure CN114328951B
Abstract
Description
Technical Field
[0001] The present invention relates to a field, and more specifically, to a knowledge graph construction method integrating information acquisition and triple extraction. Background Art
[0002] With the continuous advancement of global integration, better and faster development of the marine industry has always been the country's primary strategic goal. As a broad field, the marine industry includes marine fisheries, marine economy, marine military, marine environmental protection and other industrial directions. Since there are certain connections between the various industries, but also due to their respective characteristics There are certain differences, how to achieve information penetration and linkage between the various industries has become a bottleneck in the development of the marine industry. With the development of technology, knowledge graphs have gradually entered people's field of vision as a tool that reveals the dynamic development laws of the knowledge field and provides practical and valuable references for disciplinary research. At this stage, the work on the marine industry knowledge base is basically blank due to the professionalism of its information, so it has become necessary to build a large-scale semantic knowledge base for the emerging marine industry.
[0003] The knowledge graph is a semantic representation of the real world, in which each node represents an entity, and the edges connecting the nodes correspond to the relationship between entities. Heterogeneous data is expressed as knowledge through integration. The so-called knowledge is the information corresponding to the point or edge. The knowledge graph uses relationships to organize all entities to form a directed graph structure, and the expression of the graph reflects the way humans perceive the world. The knowledge graph displays complex knowledge fields and knowledge systems through data mining, information processing, knowledge measurement and graphics drawing, reveals the development dynamics and laws of the field, and provides a comprehensive, holistic, and relational chain reference for research in the field. It is an important means of production for the intelligent society. Traditional research directions mainly focus on building knowledge graphs, such as updating knowledge graphs, knowledge fusion, and other operations. In specific practice, in addition to considering the final construction of the knowledge graph, it is also necessary to consider data acquisition and data cleaning, because these two steps will deeply affect the quality of the final knowledge graph.
[0004] The existing technology discloses a system and method for promoting the construction of structured knowledge graphs by using group learning behavior, including an information extraction module, an individual knowledge graph construction module, a group knowledge graph construction module, a knowledge point graph construction module, and a feedback module. The present invention is suitable for primary and secondary school teaching and online learning. During the learning process of knowledge point Ki, learners establish an association between knowledge point Ki and the subject knowledge point set K{K1, K2, K3…Ki…Kt} to which Ki belongs by operating the relevant content of the knowledge point to form an individual knowledge graph. The knowledge associations are all in the form of triples.<concept,relation,property> The individual knowledge graphs of multiple learners are aggregated to form a group knowledge graph Gc. The credibility of all triples in the group knowledge graph is analyzed, and the triples that do not reach the credibility threshold are removed to obtain the authoritative knowledge point graph Gk of the knowledge point Ki. Experts can improve the formed knowledge point graph. The final knowledge point graph can provide feedback for learners' learning, but it is unable to achieve the connection and linkage of information acquisition. Summary of the invention
[0005] In order to solve the technical defects of how to achieve information integration and linkage utilization among existing industries, which cannot discover knowledge in scattered data and increases the user's usage cost, the present invention provides a knowledge graph construction method that integrates information acquisition and triple extraction.
[0006] In order to achieve the above invention purpose, the technical solution adopted is:
[0007] A method for constructing a knowledge graph integrating information acquisition and triple extraction includes the following steps:
[0008] S1: Use crawler technology to periodically crawl ocean-related text content including news from designated web pages;
[0009] S2: Use natural language processing tools to extract entities and relations from text content to obtain news triplets, which are then stored in a database.
[0010] S3: Build a knowledge graph based on the triples of news in the database and visualize the knowledge graph in the data browser;
[0011] S4: Obtain knowledge associations based on the visualized knowledge graph.
[0012] In the above solution, information acquisition and triple extraction are integrated to build a knowledge graph, and the entire process is built into an end-to-end task to reduce user usage costs; an ocean knowledge graph is built to discover knowledge from scattered data, explore the correlation between things, and help organizations make guiding decisions.
[0013] Preferably, step S1 comprises the following steps:
[0014] S11: Set the target crawler address, perform a simple analysis of the website's HTML language, complete the crawler framework according to the template, and obtain news;
[0015] In the above scheme, the following fields are parsed and stored: news title (news_title), news type (news_type), news date (news_date), news summary (news_summary), news text (news_content), news web page (news_web_url) and news source (news_source).
[0016] The database news table fields are as follows:
[0017]
[0018]
[0019] S12: searching in a database using the URL of the news as an identifier to determine whether the news is a duplicate;
[0020] S13: In order to simplify the user operation, a timing function is set so that the crawler program crawls the news of the designated website regularly according to the user's setting.
[0021] Preferably, in step S12, the initial data set is constructed and the news of the specified type and its beginning and end pages are crawled. When duplicate news is crawled, the current news is skipped and the next news is continued; when duplicate news is crawled, it means that the secondary website of the news type has been crawled, and then the next type of secondary website is crawled.
[0022] Preferably, step S2 comprises the following steps:
[0023] S21: construct a relation triple data table, parse and store the fields;
[0024] In the above scheme, the following fields are parsed and stored: index (id), subject (triple_subject), subject label (triple_subject_label), verb (triple_verb), object (triple_object), object label (triple_object_label), original text (original_text), the table where the original text is located (original_text_table) and the index of the table where the original text is located (original_text_table_id).
[0025] The fields of the database triple relationship table are as follows:
[0026]
[0027]
[0028] S22: when reading the data in the database obtained in the information acquisition phase, first read the data in the news title field into the cache, and perform part-of-speech tagging on the news title that has been read into the cache;
[0029] S23: Perform syntactic analysis on the sentences of the news, and maintain a dictionary storing syntactic dependency child nodes for each word in the sentence;
[0030] S24: Use the results of S21 and S22 to perform semantic analysis on the sentence and label the semantic roles;
[0031] S25: extract triples with the help of the results of S21, S22 and S23;
[0032] In the above scheme, if the semantic role marker is empty, dependency syntax is used to extract fact triples centered on the predicate: it mainly deals with the following three situations: subject, predicate, and object; postposition of the attributive, verb-object relationship; and subject, predicate, verb-complement relationship containing preposition-object relationship.
[0033] S26: Filter out repeated triple relations and remove meaningful punctuation marks using regular expressions, then write the triples into a triple table, and store the triples of the news into a database.
[0034] Preferably, in step S22, before extracting the triples, it is first checked whether the data has been extracted. If it has been extracted, it is skipped; if it has not been extracted, it is processed by using the natural language processing platform for word segmentation, and word segmentation is the process of recombining continuous word sequences into word sequences according to certain specifications;
[0035] Part-of-speech tagging is a text data processing technology in corpus linguistics that marks the parts of speech of words in a corpus according to their meaning and context.
[0036] Preferably, in step S23, the sentence is subjected to syntactic analysis, and a dictionary storing syntactic dependency child nodes is maintained for each word in the sentence;
[0037] Syntactic analysis refers to the analysis of the grammatical functions of words in a sentence. It is a direct implementation of the idea of chunk analysis. Chunk analysis simplifies the description of a sentence by identifying high-level structural units. The results of S21 and S22 are used to find the son nodes of the sentence.
[0038] Preferably, in step S24, semantic role labeling is a shallow semantic analysis technology, which analyzes the predicate-argument structure of a sentence on a sentence basis, without performing an in-depth analysis of the semantic information contained in the sentence; the task of semantic role labeling is to focus on the predicate of the sentence, study the relationship between each component in the sentence and the predicate, and use semantic roles to describe the relationship between them.
[0039] Preferably, step S3 comprises the following steps:
[0040] S31: constructing a triple data table according to the triples in the database, obtaining triple relations from the triple data table in sequence, and obtaining the subject, subject label, predicate, object and object label in the triple relationship;
[0041] S32: Use Neo4j's graph query language Cypher to find out whether the subject and object exist in the knowledge graph; if the same subject exists, check whether the same subject label exists; if the same object exists, check whether the same object label exists;
[0042] S33: Use Cypher statements to try to insert subjects, subject labels, predicates, objects, and object labels into the knowledge graph. If unsuccessful, it is judged that the relationship does not exist;
[0043] S34: Then, a new subject label and object label are added to the relationship to create a new relationship. After writing all triple relationships, the user starts the neo4j service and enters the visualization interface of the knowledge graph.
[0044] Preferably, in step S32, if the same subject exists, it is checked whether the same subject tag exists: if the same subject tag does not exist, a new subject tag is added to the subject; if the same subject tag exists, the next step is performed; if the same subject does not exist, a new node is created on the knowledge graph;
[0045] If the same object exists, check whether there is the same object tag: if there is no same object tag, add a new object tag for the subject; if there is the same object tag, go to step S33. If there is no same object, create a new node on the knowledge graph.
[0046] Preferably, in step S4, the knowledge in the knowledge graph is displayed in the form of triple relationships, which include a subject, a subject label, a predicate, an object, and an object label. A certain element is queried separately through the knowledge base, and information on other elements associated with the element is obtained based on the element. If there are overlapping elements between multiple triples, it means that there is a certain relationship between the triples.
[0047] Compared with the prior art, the present invention has the following beneficial effects:
[0048] The present invention provides a knowledge graph construction method that integrates information acquisition and triple extraction, which integrates information acquisition and triple extraction to construct a knowledge graph, and builds the entire process into an end-to-end task, reducing user usage costs; constructs an ocean knowledge graph, and then discovers knowledge from scattered data, explores the correlation between things, and helps organizations make guiding decisions. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 is a flow chart of the method of the present invention;
[0050] Figure 2 A flow chart of the method for obtaining information of the present invention;
[0051] Figure 3 A flow chart of a method for triple extraction of the present invention;
[0052] Figure 4 A flow chart of the method for constructing the knowledge graph of the present invention;
[0053] Figure 5 It is the information acquisition flow chart of the present invention;
[0054] Figure 6 It is a triple extraction flow chart of the present invention;
[0055] Figure 7 Constructing a flow chart for the knowledge graph of the present invention;
[0056] Figure 8 This is a search result diagram of the noun "Guangdong" in the knowledge graph of the present invention;
[0057] Fig. 9 The effect diagram of "a province with a strong marine economy" is developed in the knowledge graph of the present invention;
[0058] Fig.10 The effect diagram of the invention is to expand the "Chinese Coast Guard Ship" in the knowledge graph;
[0059] Fig.11 This is a rendering of "a 200,000-ton British cargo ship" expanded in the knowledge graph of the present invention. DETAILED DESCRIPTION
[0060] The drawings are for illustrative purposes only and should not be construed as limiting the present patent;
[0061] The present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0062] Example 1
[0063] like Figure 1 , Figure 2 , Figure 3 and Figure 4 As shown, a knowledge graph construction method integrating information acquisition and triple extraction includes the following steps:
[0064] S1: Use crawler technology to periodically crawl ocean-related text content including news from designated web pages;
[0065] S2: Use natural language processing tools to extract entities and relations from text content to obtain news triplets, which are then stored in a database.
[0066] S3: Build a knowledge graph based on the triples of news in the database and visualize the knowledge graph in the data browser;
[0067] S4: Obtain knowledge associations based on the visualized knowledge graph.
[0068] In the above solution, information acquisition and triple extraction are integrated to build a knowledge graph, and the entire process is built into an end-to-end task to reduce user usage costs; an ocean knowledge graph is built to discover knowledge from scattered data, explore the correlation between things, and help organizations make guiding decisions.
[0069] Preferably, step S1 comprises the following steps:
[0070] S11: Set the target crawler address, perform a simple analysis of the website's HTML language, complete the crawler framework according to the template, and obtain news;
[0071] In the above scheme, the following fields are parsed and stored: news title (news_title), news type (news_type), news date (news_date), news summary (news_summary), news text (news_content), news web page (news_web_url) and news source (news_source).
[0072] The database news table fields are as follows:
[0073]
[0074] S12: searching in a database using the URL of the news as an identifier to determine whether the news is a duplicate;
[0075] S13: In order to simplify the user operation, a timing function is set so that the crawler program crawls the news of the designated website regularly according to the user's setting.
[0076] Preferably, in step S12, the initial data set is constructed and the news of the specified type and its beginning and end pages are crawled. When duplicate news is crawled, the current news is skipped and the next news is continued; when duplicate news is crawled, it means that the secondary website of the news type has been crawled, and then the next type of secondary website is crawled.
[0077] Preferably, step S2 comprises the following steps:
[0078] S21: construct a relation triple data table, parse and store the fields;
[0079] In the above scheme, the following fields are parsed and stored: index (id), subject (triple_subject), subject label (triple_subject_label), verb (triple_verb), object (triple_object), object label (triple_object_label), original text (original_text), the table where the original text is located (original_text_table) and the index of the table where the original text is located (original_text_table_id).
[0080] The fields of the database triple relationship table are as follows:
[0081]
[0082] S22: when reading the data in the database obtained in the information acquisition phase, first read the data in the news title field into the cache, and perform part-of-speech tagging on the news title that has been read into the cache;
[0083] S23: Perform syntactic analysis on the sentences of the news, and maintain a dictionary storing syntactic dependency child nodes for each word in the sentence;
[0084] S24: Use the results of S21 and S22 to perform semantic analysis on the sentence and label the semantic roles;
[0085] S25: extract triples with the help of the results of S21, S22 and S23;
[0086] In the above scheme, if the semantic role marker is empty, dependency syntax is used to extract fact triples centered on the predicate: it mainly deals with the following three situations: subject, predicate, and object; postposition of the attributive, verb-object relationship; and subject, predicate, verb-complement relationship containing preposition-object relationship.
[0087] S26: Filter out repeated triple relations and remove meaningful punctuation marks using regular expressions, then write the triples into a triple table, and store the triples of the news into a database.
[0088] Preferably, in step S22, before extracting the triples, it is first checked whether the data has been extracted. If it has been extracted, it is skipped; if it has not been extracted, it is processed by using the natural language processing platform for word segmentation, and word segmentation is the process of recombining continuous word sequences into word sequences according to certain specifications;
[0089] Part-of-speech tagging is a text data processing technology in corpus linguistics that marks the parts of speech of words in a corpus according to their meaning and context.
[0090] Preferably, in step S23, the sentence is subjected to syntactic analysis, and a dictionary storing syntactic dependency child nodes is maintained for each word in the sentence;
[0091] Syntactic analysis refers to the analysis of the grammatical functions of words in a sentence. It is a direct implementation of the idea of chunk analysis. Chunk analysis simplifies the description of a sentence by identifying high-level structural units. The results of S21 and S22 are used to find the son nodes of the sentence.
[0092] Preferably, in step S24, semantic role labeling is a shallow semantic analysis technology, which analyzes the predicate-argument structure of a sentence on a sentence basis, without performing an in-depth analysis of the semantic information contained in the sentence; the task of semantic role labeling is to focus on the predicate of the sentence, study the relationship between each component in the sentence and the predicate, and use semantic roles to describe the relationship between them.
[0093] Preferably, step S3 comprises the following steps:
[0094] S31: constructing a triple data table according to the triples in the database, obtaining triple relations from the triple data table in sequence, and obtaining the subject, subject label, predicate, object and object label in the triple relationship;
[0095] S32: Use Neo4j's graph query language Cypher to find out whether the subject and object exist in the knowledge graph; if the same subject exists, check whether the same subject label exists; if the same object exists, check whether the same object label exists;
[0096] S33: Use Cypher statements to try to insert subjects, subject labels, predicates, objects, and object labels into the knowledge graph. If unsuccessful, it is judged that the relationship does not exist;
[0097] S34: Then, a new subject label and object label are added to the relationship to create a new relationship. After writing all triple relationships, the user starts the neo4j service and enters the visualization interface of the knowledge graph.
[0098] Preferably, in step S32, if the same subject exists, it is checked whether the same subject tag exists: if the same subject tag does not exist, a new subject tag is added to the subject; if the same subject tag exists, the next step is performed; if the same subject does not exist, a new node is created on the knowledge graph;
[0099] If the same object exists, check whether there is the same object tag: if there is no same object tag, add a new object tag for the subject; if there is the same object tag, go to step S33. If there is no same object, create a new node on the knowledge graph.
[0100] Preferably, in step S4, the knowledge in the knowledge graph is displayed in the form of triple relationships, which include a subject, a subject label, a predicate, an object, and an object label. A certain element is queried separately through the knowledge base, and information on other elements associated with the element is obtained based on the element. If there are overlapping elements between multiple triples, it means that there is a certain relationship between the triples.
[0101] Example 2
[0102] like Figure 5 As shown, crawler technology is used to periodically crawl ocean-related text content including news from a specified web page, which includes the following steps:
[0103] First, set the target crawler address, parse the website's HTML language, and complete the crawler framework according to the template. For the next step, we will parse and store the following fields: news title, news type, news date, news summary, news text, news web page, and news source.
[0104] Then, the news URL is used as an identifier to search in the database to determine whether the news is repeated. The initial data set is constructed and the specified type of news and its start and end pages are crawled. When duplicate news is crawled, the news will be skipped and the next news will be continued. The crawling of updated news is different in that when duplicate news is crawled, it means that the secondary URL of the news type has been crawled, and the next type of secondary URL can be crawled.
[0105] Finally, in order to simplify user operations, we set up a timing function so that the crawler program can regularly crawl news from specified websites according to user settings.
[0106] Example 3
[0107] like Figure 6As shown, natural language processing tools are used to extract entities and relations from text content to obtain news and triples, and then the news and triples are stored in a database, which includes the following steps:
[0108] First, we build a relational triple data table. We will parse and store the following fields: index, subject, subject label, verb, object, object label, original text, the table where the original text is located, and the index of the table where the original text is located.
[0109] Secondly, read the data in the database obtained in the information acquisition stage, and first try to read the data in the news title (news_title) field into the cache. Before extracting the triple, check whether the data has been extracted. If it has been extracted, skip it; if it has not been extracted, use the Harbin Institute of Technology Natural Language Processing Platform (pyltp) for word segmentation, and word segmentation is the process of recombining continuous word sequences into word sequences according to certain specifications. For example: News title: "The first domestic submarine high-speed rail tunnel has completed offshore drilling work", the results after word segmentation are: 'domestic', 'first', 'article', 'undersea', 'high-speed rail', 'tunnel', 'already', 'completed', 'offshore', 'drilling', 'work'.
[0110] After that, the news title (news_title) that has been read into the cache is tagged with part of speech. Part of speech tagging is a text data processing technology in corpus linguistics that marks the part of speech of words in the corpus according to their meaning and context. For example, the news title: "The first submarine high-speed rail tunnel in China has completed offshore drilling work" is tagged with the results of S1 as follows: ['nl', 'm', 'q', 'n', 'n', 'n', 'd', 'v', 'nl', 'v', 'v']. If the display corresponds to the results of S1 one by one, it is: {'domestic': 'nl', 'first': 'm', 'article': 'q', 'undersea': 'n', 'high-speed rail': 'n', 'tunnel': 'n', 'already': 'd', 'completed': 'v', 'offshore': 'nl', 'drilling': 'v', 'work': 'v'}.
[0111] Then, perform syntactic analysis on the sentence and maintain a dictionary of syntactic dependent child nodes for each word in the sentence. Syntactic analysis refers to the analysis of the grammatical functions of words in a sentence. It is a direct implementation of the idea of chunk analysis. Chunk analysis simplifies the description of a sentence by identifying high-level structural units. Using the results of the first two steps, the child nodes of the sentence can be found. For example, if we continue to use the title, the child nodes can be found as: [{},{},{'ATT':[1]},{},{'ATT':[3]},{'ATT':[0,2,4]},{},{'SBV':[5],'ADV':[6],'VOB':
[10] },{},{'ADV':[8]},{'ATT':[9]}].
[0112] The results of the first two steps are used to perform semantic analysis on the sentence and to label the semantic roles. Semantic role labeling is a shallow semantic analysis technique that analyzes the predicate-argument structure of the sentence in units of sentences without conducting an in-depth analysis of the semantic information contained in the sentence. Specifically, the task of semantic role labeling is to focus on the predicate of the sentence, study the relationship between the components and the predicate in the sentence, and use semantic roles to describe the relationship between them. If we continue to use the news title, the result of semantic role labeling is: {7:{'A0':['A0',0,5],'ADV':['ADV',6,6],'A1':['A1',8,10]}}; if it corresponds to the news title, it is: {"Completed":{'A0':['A0',"China's first undersea high-speed rail tunnel"],'ADV':['ADV',6,"Has"],'A1':['A1',"Offshore drilling work"]}}.
[0113] The results of the first four steps are used to extract triples. If the semantic role tag is empty, the dependency syntax is used to extract the predicate-centered fact triples: mainly dealing with the following three situations: subject, predicate, and object; postposition of the attributive, verb-object relationship; subject, predicate, verb-complement relationship with preposition-object relationship. If the news title is continued to be used, the results of the first four steps can be used to obtain the triple relationship: ['China's first undersea high-speed railway tunnel', 'Completed', 'Offshore drilling work'].
[0114] Finally, duplicate triples are filtered out and meaningful punctuation is removed using regular expressions, and then the triples are written into the triple table. If the title is empty, all steps are repeated in the abstract.
[0115] Example 4
[0116] like Figure 7 As shown in the figure, a knowledge graph is constructed based on the triples in the database, and the knowledge graph is visualized in the data browser, which includes the following steps:
[0117] First, obtain the triple relations from the triple data table in turn, and obtain the subject, subject label, predicate, object and object label in the triple relation. For example, if the triple is ['the first domestic submarine high-speed rail tunnel', 'completed', 'offshore drilling work'], the subject is 'the first domestic submarine high-speed rail tunnel', the subject label is 'noun', the predicate is 'completed', the object is 'offshore drilling work', and the object label is 'event'.
[0118] Secondly, use Neo4j's graph query language Cypher to try to find out whether the subject and object exist in the knowledge graph. For example, if the results obtained by S1 are used, the subject query statement is: Match(n)where n.name = "{'China's first submarine high-speed railway tunnel'}" return n, and the object query statement is: Match(n)where n.name = "{'Offshore drilling work'}" return n.
[0119] Again, if there is the same subject, check whether there is the same subject label: if there is no same subject label, add a new subject label for the subject; if there is the same subject label, go to the next step. If there is no same subject, create a new node on the knowledge graph.
[0120] After that, if there are identical objects, check whether there are identical object tags. If there are no identical object tags, add a new object tag for the subject. If there are identical object tags, proceed to the next step. If there are no identical objects, create a new node on the knowledge graph.
[0121] Then, use Cypher statements to try to insert the subject, subject label, predicate, object, and object label obtained from the first step into the knowledge graph. For example, if the result of the first step is used, the insertion statement is Match(n:'noun')-[:'completion']->(m:'event')where n.name = "China's first submarine high-speed rail tunnel" and m.name = "offshore drilling work" return m, and then check whether the insertion is successful.
[0122] Afterwards, if it is unsuccessful, it can be judged that the relationship does not exist. Then, a new subject label and object label are added to the relationship, and then a new relationship is created.
[0123] Finally, after writing all triple relationships, the user can start the neo4j service. After entering the visual interface, click the relevant button and type the Cypher statement, and finally perform query-based knowledge reasoning.
[0124] Example 5
[0125] like Figure 8 , Fig. 9 , Fig.10 and Fig.11 As shown in the figure, in the knowledge base, knowledge is displayed in the form of triples, {subject, subject label, predicate, object, object label}. The subject refers to the initiator of the action, the predicate refers to the connection between the subject and the object, and the object refers to the recipient of the predicate action. Through the knowledge base, you can query a certain element separately, and then obtain the information of other elements related to it based on this element. If there are overlapping elements between multiple triples, it means that there is a certain relationship between the triples.
[0126] Example 1: Query all elements associated with the element "Guangdong". The results show that first, there is no arrow pointing to "Guangdong", which means that its in-degree is 0, and the out-degree is the number of elements associated with it. "Guangdong" is always used as a subject in the knowledge base, so we can conclude that "most of the captured news is explained from the perspective of Guangdong." Figure 8 On this basis, we showcase the element of “a province with strong marine economy”.
[0127] exist Fig. 9 We can see that the subjects associated with "a strong province in marine economy" include "Fujian Provincial Party Committee and Fujian Provincial Government". This can help us obtain knowledge connections to a certain extent, and we can understand that "Guangdong" and "Fujian Provincial Party Committee and Fujian Provincial Government" have similar construction goals.
[0128] Example 2: Query all elements associated with the element "deep sea". Fig.10 The results show that, first of all, we can see that there are arrows pointing to the "deep sea", and there are also arrows pointing from the "deep sea" to other elements, which shows that the relationship between other elements and the "deep sea" is diverse.
[0129] We click on "Homework", one of the elements that forms a host-guest relationship with "Deep Sea". Fig.10 and Fig.11 We can see that subjects such as "Chinese Coast Guard Ship" and "a 200,000-ton British cargo ship" are operating in the deep sea. In this way, we can learn other related knowledge from one element "deep sea".
[0130] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the embodiments here. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the claims of the present invention.
Claims
1. A knowledge graph construction method integrating information acquisition and triple extraction, characterized in that: The following steps are involved: S1: Use crawler technology to periodically crawl ocean-related text content including news from designated web pages; S2: Use natural language processing tools to extract entities and relations from text content to obtain news triplets, which are then stored in a database. S3: Build a knowledge graph based on the triples of news in the database and visualize the knowledge graph in the data browser; S4: Obtain knowledge associations based on the visualized knowledge graph; Step S2 includes the following steps: S21: construct a relation triple data table, parse and store the fields; S22: when reading the data in the database obtained in the information acquisition phase, first read the data in the news title field into the cache, and perform part-of-speech tagging on the news title that has been read into the cache; S23: Perform syntactic analysis on the sentences of the news, and maintain a dictionary storing syntactic dependency child nodes for each word in the sentence; S24: Use the results of S21 and S22 to perform semantic analysis on the sentence and label the semantic roles; S25: extract triples with the help of the results of S21, S22 and S23; S26: Filter out duplicate triple relations and remove meaningful punctuation marks using regular expressions, then write the triples into a triple table, and store the triples of the news in a database; Step S3 includes the following steps: S31: constructing a triple data table according to the triples in the database, obtaining triple relations from the triple data table in sequence, and obtaining the subject, subject label, predicate, object and object label in the triple relationship; S32: Use Neo4j's graph query language Cypher to find out whether the subject and object exist in the knowledge graph; if the same subject exists, check whether the same subject label exists; if the same object exists, check whether the same object label exists; S33: Use Cypher statements to try to insert subjects, subject labels, predicates, objects, and object labels into the knowledge graph. If unsuccessful, it is judged that the relationship does not exist; S34: Then, a new subject label and object label are added to the relationship to create a new relationship. After writing all triple relationships, the user starts the neo4j service and enters the visualization interface of the knowledge graph.
2. A knowledge graph construction method integrating information acquisition and triple extraction according to claim 1, characterized in that: Step S1 includes the following steps: S11: Set the target crawler address, perform a simple analysis of the website's HTML language, complete the crawler framework according to the template, and obtain news; S12: searching in a database using the URL of the news as an identifier to determine whether the news is a duplicate; S13: In order to simplify the user operation, a timing function is set so that the crawler program crawls the news of the designated website regularly according to the user's setting.
3. A knowledge graph construction method integrating information acquisition and triple extraction according to claim 2, characterized in that: In step S12, the initial data set is constructed and the news of the specified type and its beginning and end pages are crawled. When duplicate news is crawled, the current news is skipped and the next news is continued. When duplicate news is crawled, it means that the secondary website of the news type has been crawled, and then the next type of secondary website is crawled.
4. A knowledge graph construction method integrating information acquisition and triple extraction according to claim 3, characterized in that: In step S22, before extracting triples, check whether the data has been extracted. If it has been extracted, skip it; if it has not been extracted, use the natural language processing platform to perform word segmentation processing, and word segmentation is the process of recombining continuous word sequences into word sequences according to certain specifications; Part-of-speech tagging is a text data processing technology in corpus linguistics that marks the parts of speech of words in a corpus according to their meaning and context.
5. A knowledge graph construction method integrating information acquisition and triple extraction according to claim 4, characterized in that: In step S23, the sentence is parsed syntactically, and a dictionary storing syntactic dependency child nodes is maintained for each word in the sentence; Syntactic analysis refers to the analysis of the grammatical functions of words in a sentence. It is a direct implementation of the idea of chunk analysis. Chunk analysis simplifies the description of a sentence by identifying high-level structural units. The results of S21 and S22 are used to find the son nodes of the sentence.
6. A knowledge graph construction method integrating information acquisition and triple extraction according to claim 5, characterized in that: In step S24, semantic role labeling is a shallow semantic analysis technology that analyzes the predicate-argument structure of sentences in units of sentences without conducting an in-depth analysis of the semantic information contained in the sentences; The task of semantic role labeling is to focus on the predicate of a sentence, study the relationship between each component in the sentence and the predicate, and use semantic roles to describe the relationship between them.
7. A knowledge graph construction method integrating information acquisition and triple extraction according to claim 6, characterized in that: In step S32, if the same subject exists, check whether the same subject tag exists: if the same subject tag does not exist, add a new subject tag for the subject; if the same subject tag exists, proceed to the next step; if the same subject does not exist, create a new node on the knowledge graph; If the same object exists, check whether the same object tag exists: if the same object tag does not exist, add a new object tag for the subject; if the same object tag exists, go to step S33; if the same object does not exist, create a new node on the knowledge graph.
8. A knowledge graph construction method integrating information acquisition and triple extraction according to claim 7, characterized in that: In step S4, the knowledge in the knowledge graph is displayed in the form of triple relationships, including a subject, a subject label, a predicate, an object, and an object label. A single element is queried through the knowledge base, and information about other elements associated with the element is obtained based on the element. If there are overlapping elements between multiple triples, it means that there is a certain relationship between the triples.
Citation Information
Patent Citations
Question-answering system based on domain knowledge graph and construction method thereof
CN110555153A
Judicial case knowledge graph construction method of dependency syntactic analysis relation extraction model
CN110597999A
Entity information extraction and knowledge graph construction method for field of comprehensive pipe galleries
CN111897914A
Open knowledge graph mining method and system
CN113486189A
The semantic knowledge database automatic constructiondevice on the on-line document, and the method, therecord medium for that.
KR1020000063488A
