Social governance knowledge graph construction method and device

By preprocessing text data in the field of social governance and multi-level relationship identification, and generating a knowledge graph, the shortcomings of traditional technologies in data complexity and relationship accuracy are solved, and efficient and accurate data mining and public services are achieved.

CN119537613AInactive Publication Date: 2025-02-28中电信数字城市科技有限公司
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202510073462.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-17
Publication Date
2025-02-28
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Due to irregular and complex content, data in the field of social governance is inefficient and inaccurate when using traditional knowledge graph construction technology to mine entities and relationships between entities.

Method used

By obtaining the initial text data in the field of social governance for pre-processing, including cleaning, sentence segmentation, word segmentation, part-of-speech labeling, etc.; then naming entity recognition and subject word recognition are carried out to determine the text position relationship between named entities; based on these results, grammatical rule sets and relationship extraction models are used to identify inter-entities relationships, clustering algorithms are used to identify relationships between entities and subject words, and finally, event triplets are identified through dependent syntax analysis to generate a knowledge graph.

Benefits of technology

It has achieved rapid and accurate mining of entities, subject words and events, as well as inter-entities and relationships between entities and subject words from social governance data, and constructed an accurate knowledge graph, thereby improving public service efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119537613A_ABST
    Figure CN119537613A_ABST
Patent Text Reader

Abstract

The invention provides a social governance knowledge graph construction method and device, and the method comprises the steps: carrying out the preprocessing of initial text data in a social governance field, and carrying out the named entity recognition and subject term recognition of the preprocessed text data; then, determining a text position relationship between named entities contained in the preprocessed text data based on a named entity recognition result, and performing inter-entity relationship recognition, entity and subject term relationship recognition and event triple recognition on the preprocessed text data based on a named entity recognition result, the text position relationship and a subject term recognition result; and generating a knowledge graph corresponding to the initial text data based on the identification result of the relationship between the entities, the identification result of the relationship between the entities and the subject terms and the identification result of the event triple. By adopting the method, the entities, the subject terms, the events, the relationship between the entities and the relationship between the entities and the subject terms can be quickly and accurately mined from the social governance data so as to construct the knowledge graph.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a method and device for constructing a social governance knowledge graph. Background Art

[0002] Knowledge graph is an important branch in the field of artificial intelligence and has a wide range of applications in reality. For example, search engines and e-commerce platforms used by people in daily life all use knowledge graphs. The application of knowledge graphs can also be extended to the field of social governance, such as urban management, public safety and social services. Building knowledge graphs can effectively organize and analyze data, improve decision-making efficiency and service quality. However, data in the field of social governance often presents irregularities and complex content. Using traditional knowledge graph construction technology to mine entities and relationships between entities from social governance data is inefficient and inaccurate. Summary of the invention

[0003] In view of this, the purpose of the present invention is to provide a method and device for constructing a social governance knowledge graph to alleviate the above-mentioned problems existing in related technologies.

[0004] In a first aspect, an embodiment of the present invention provides a method for constructing a social governance knowledge graph, comprising: obtaining initial text data in the field of social governance, and preprocessing the initial text data; wherein the preprocessing includes at least one of the following: cleaning, sentence segmentation, word segmentation, and part-of-speech tagging; performing named entity recognition and subject word recognition on the preprocessed text data, and determining the text position relationship between the named entities contained in the preprocessed text data based on the named entity recognition result; based on the named entity recognition result, the text position relationship, and a pre-established grammatical rule set and / or a pre-trained first level knowledge graph, A system extraction model is used to identify the relationship between entities on the preprocessed text data; based on the named entity recognition result, the subject word recognition result, and a pre-trained second relationship extraction model and a preset clustering algorithm, the relationship between entities and subject words is identified on the preprocessed text data; based on the named entity recognition result, the subject word recognition result, and a preset dependency syntax analysis algorithm, event triples are identified on the preprocessed text data; based on the relationship recognition results between entities, the relationship recognition results between entities and subject words, and the event triple recognition results, a knowledge graph corresponding to the initial text data is generated.

[0005] In a second aspect, an embodiment of the present invention further provides a device for constructing a social governance knowledge graph, comprising: a preprocessing module, for acquiring initial text data in the field of social governance, and preprocessing the initial text data; wherein the preprocessing includes at least one of the following: cleaning, sentence segmentation, word segmentation, and part-of-speech tagging; a first recognition module, for performing named entity recognition and subject word recognition on the preprocessed text data, and determining the text position relationship between the named entities contained in the preprocessed text data based on the named entity recognition result; a second recognition module, for performing named entity recognition and subject word recognition based on the named entity recognition result, the text position relationship, and a pre-established grammatical rule set and / or a pre-trained first relational knowledge graph. A system extraction model is used to identify the relationship between entities on the preprocessed text data; a third recognition module is used to identify the relationship between entities and subject words on the preprocessed text data based on the named entity recognition result, the subject word recognition result, and a pre-trained second relationship extraction model and a preset clustering algorithm; a fourth recognition module is used to identify event triples on the preprocessed text data based on the named entity recognition result, the subject word recognition result and a preset dependency syntax analysis algorithm; a generation module is used to generate a knowledge graph corresponding to the initial text data based on the relationship recognition result between entities, the relationship recognition result between entities and subject words, and the event triple recognition result.

[0006] A method and device for constructing a social governance knowledge graph provided by an embodiment of the present invention obtains initial text data in the field of social governance and preprocesses the initial text data; performs named entity recognition and subject word recognition on the preprocessed text data, and determines the text position relationship between the named entities contained in the preprocessed text data based on the named entity recognition result; performs entity relationship recognition on the preprocessed text data based on the named entity recognition result, the text position relationship, and a pre-established grammatical rule set and / or a pre-trained first relationship extraction model; performs entity and subject word relationship recognition on the preprocessed text data based on the named entity recognition result, the subject word recognition result, a pre-trained second relationship extraction model and a preset clustering algorithm; performs event triple recognition on the preprocessed text data based on the named entity recognition result, the subject word recognition result and a preset dependency syntax analysis algorithm; generates a knowledge graph corresponding to the initial text data based on the entity relationship recognition result, the entity and subject word relationship recognition result, and the event triple recognition result. By using the above technology, entities, keywords, events, relationships between entities, and relationships between entities and keywords can be quickly and accurately mined from social governance data to construct a knowledge graph, so that relevant personnel can quickly identify key information and complex relationships based on the knowledge graph and thus more effectively understand the problems and formulate corresponding measures, thereby improving the efficiency of public services.

[0007] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.

[0008] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0010] Figure 1 A schematic diagram of a process for constructing a social governance knowledge graph in an embodiment of the present invention; Figure 2 This is a display example diagram of a knowledge graph in an embodiment of the present invention; Figure 3 is an example diagram of a dependency tree in an embodiment of the present invention; Figure 4 This is an example diagram of the process of constructing a knowledge graph in an embodiment of the present invention; Figure 5 This is an example diagram of the LTP model parameter fine-tuning process in an embodiment of the present invention; Figure 6 This is an example diagram of extracting relationships between entities in an embodiment of the present invention; Figure 7 This is an example diagram of a process for modifying the relationship between entities in an embodiment of the present invention; Figure 8 This is a schematic diagram of the structure of a social governance knowledge graph construction device in an embodiment of the present invention. DETAILED DESCRIPTION

[0011] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described in combination with the embodiments below. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0012] To facilitate understanding of this embodiment, a method for constructing a social governance knowledge graph disclosed in an embodiment of the present invention is first described in detail. Figure 1 As shown, the method may include the following steps: Step S101, obtaining initial text data in the field of social governance and preprocessing the initial text data.

[0013] Among them, preprocessing may include cleaning, sentence segmentation, word segmentation, part-of-speech tagging, etc., which are not limited.

[0014] Step S102, performing named entity recognition and keyword recognition on the preprocessed text data, and determining the text position relationship between the named entities contained in the preprocessed text data based on the named entity recognition result.

[0015] Step S103, based on the named entity recognition result, the text position relationship, and the pre-established grammatical rule set and / or the pre-trained first relationship extraction model, the entity relationship is recognized on the pre-processed text data.

[0016] Step S104, based on the named entity recognition result, the subject word recognition result, the pre-trained second relationship extraction model and the preset clustering algorithm, the relationship between entities and subject words is identified on the pre-processed text data.

[0017] Step S105 , based on the named entity recognition result, the keyword recognition result and the preset dependency syntax analysis algorithm, event triples are recognized on the preprocessed text data.

[0018] Step S106, based on the results of inter-entity relationship recognition, entity-to-keyword relationship recognition, and event triple recognition, a knowledge graph corresponding to the initial text data is generated.

[0019] Among them, nodes can be used to represent entities and topics in the knowledge graph, and edges between nodes can be used to represent the relationships between entities, the relationships between entities and keywords, and event triples. Figure 2 The display form of the knowledge graph is shown.

[0020] A method for constructing a social governance knowledge graph provided by an embodiment of the present invention obtains initial text data in the field of social governance and preprocesses the initial text data; performs named entity recognition and subject word recognition on the preprocessed text data, and determines the text position relationship between the named entities contained in the preprocessed text data based on the named entity recognition result; performs entity relationship recognition on the preprocessed text data based on the named entity recognition result, the text position relationship, and a pre-established grammatical rule set and / or a pre-trained first relationship extraction model; performs entity and subject word relationship recognition on the preprocessed text data based on the named entity recognition result, the subject word recognition result, a pre-trained second relationship extraction model and a preset clustering algorithm; performs event triple recognition on the preprocessed text data based on the named entity recognition result, the subject word recognition result and a preset dependency syntax analysis algorithm; generates a knowledge graph corresponding to the initial text data based on the entity relationship recognition result, the entity and subject word relationship recognition result, and the event triple recognition result. By using the above technology, entities, keywords, events, relationships between entities, and relationships between entities and keywords can be quickly and accurately mined from social governance data to construct a knowledge graph, so that relevant personnel can quickly identify key information and complex relationships based on the knowledge graph and thus more effectively understand the problems and formulate corresponding measures, thereby improving the efficiency of public services.

[0021] As a possible implementation, the text position relationship may include a neighboring lexeme relationship and / or a long-interval lexeme relationship. The neighboring lexeme relationship may indicate that named entities with adjacent text positions are in the same sentence or two adjacent sentences, and the long-interval lexeme relationship may indicate that named entities with adjacent text positions are separated by at least one sentence or at least one paragraph. Based on this, the above step S103 (i.e., based on the named entity recognition result, the text position relationship, and a pre-established grammatical rule set and / or a pre-trained first relationship extraction model, entity relationship recognition is performed on the pre-processed text data) may include: Step 1, using a grammatical rule set to identify a first relationship between first entities having a neighboring word position relationship in the preprocessed text data, and / or, using a pre-trained first relationship extraction model to identify a second relationship between second entities having a long-interval word position relationship in the preprocessed text data.

[0022] Exemplarily, the training steps of the first relationship extraction model may include: establishing a knowledge base containing multiple entity relationships; obtaining text data to be annotated, and using the knowledge base to annotate the entity relationships for the text data to be annotated; using the annotated text data to establish a training set and a verification set for the first relationship extraction model; using the training set to train the first relationship extraction model, and using the verification set to verify the performance of the first relationship extraction model during the training process to adjust the parameters of the first relationship extraction model until the training of the first relationship extraction model is completed.

[0023] Step 2: Determine the inter-entity relationship recognition result based on the obtained first relationship and / or second relationship and the pre-established third relationship set.

[0024] Exemplarily, each first relationship and / or each second relationship may have scores corresponding to multiple relationship types; the above step 2 (i.e., determining the inter-entity relationship recognition result based on the obtained first relationship and / or second relationship and the pre-established third relationship set) may include the following steps 21 to 24: Step 21, determining the credibility of each first relationship based on the score of each first relationship corresponding to multiple relationship types, and / or determining the credibility of each second relationship based on the score of each second relationship corresponding to multiple relationship types.

[0025] Step 22: Determine, from the obtained first relationship and / or second relationship, a first target relationship whose credibility is not less than a preset credibility threshold and / or a second target relationship whose credibility is less than a preset credibility threshold.

[0026] Step 23: determine each determined first target relationship as a trusted relationship, and / or determine a trusted relationship from the determined second target relationships based on the third relationship set.

[0027] Exemplarily, the above-mentioned step of determining a trusted relationship from the determined second target relationships based on the third relationship set may include: for each determined second target relationship, determining whether there is a corresponding third relationship in the third relationship set that matches the second target relationship; if there is a corresponding third relationship in the third relationship set that matches the second target relationship, determining the second target relationship as a trusted relationship; if there is no corresponding third relationship in the third relationship set that matches the second target relationship, manually determining whether the second target relationship is a trusted relationship.

[0028] The second target relationship and the third relationship may mean: the second target relationship is the same as the third relationship, or the entity with the second target relationship is similar to the entity with the third relationship and the type of the second target relationship is the same as the type of the third relationship. The specific information can be determined according to the actual situation and is not limited to this. For example, if a second target relationship is a containment relationship between two specific entities, the third relationship matching the second target relationship is also a containment relationship between the two specific entities.

[0029] Step 24, the determined trusted relationships are combined into an inter-entity relationship recognition result.

[0030] Exemplarily, after the trusted relationships are determined from the obtained first relationship and / or second relationship, all the determined trusted relationships can be grouped into a trusted relationship set, and the trusted relationship set is the inter-entity relationship identification result.

[0031] As a possible implementation, performing named entity recognition and keyword recognition on the preprocessed text data in step S102 may include: Step A1: Use a pre-trained entity recognition model to perform named entity recognition on the pre-processed text data.

[0032] Exemplarily, the entity recognition model may include an ELECTRA model, an Adapted-Transformer model, and a linear classifier, and the above step A1 (i.e., using a pre-trained entity recognition model to perform named entity recognition on the pre-processed text data) may include the following steps A11 to A13: Step A11, using the pre-trained ELECTRA model to extract the hidden layer representation of the preprocessed text data, to obtain the hidden layer representation corresponding to the preprocessed text data.

[0033] Step A12, using a pre-trained Adapted-Transformer model to perform feature extraction on the obtained hidden layer representation to obtain a feature vector corresponding to the hidden layer representation.

[0034] For example, after the preprocessed text data is input into the pre-trained ELECTRA model, the ELECTRA model will calculate and output the corresponding hidden layer representation in vector form. Then, the hidden layer representation output by the ELECTRA model is input into the pre-trained Adapted-Transformer model. The Adapted-Transformer model will calculate and output the corresponding feature vector using the following formula:

[0035] in, represents the initial embedding representation of word i (i.e., the hidden layer representation in vector form), Representatives The output embedding (i.e., feature vector) obtained after calculation by the Adapted-Transformer model, Contains relevant features of the context and entity.

[0036] Step A13, using a pre-trained linear classifier to perform entity classification on the obtained feature vector to obtain a named entity recognition result.

[0037] Continuing with the previous example, after the Adapted-Transformer model outputs the feature vector, the feature vector output by the Adapted-Transformer model can be input into a pre-trained linear classifier. The linear classifier will use the following formula to perform entity classification calculations on the feature vector and output the corresponding entity category:

[0038] in, represents the entity category of word i, Represents the weight matrix of the linear classifier, which is used to Linear mapping into the space of entity categories; Represents the bias term of the linear classifier, used to adjust The linear mapping result.

[0039] Step A2: Use a pre-trained topic identification model to perform topic word identification on the pre-processed text data.

[0040] Exemplarily, the topic identification model may adopt an LDA (Latent Dirichlet Allocation) model, and the above step A2 (i.e., using a pre-trained topic identification model to perform topic word identification on the pre-processed text data) may include the following steps A21 to A23: Step A21, determining the initial number of topics for the topic identification model.

[0041] Step A22, iteratively optimize the number of topics of the topic identification model based on the initial number of topics and a test set of the topic identification model established in advance, and use the test set to determine the perplexity of the topic identification model each time the number of topics of the topic identification model is optimized, until the number of topics of the topic identification model is optimized when a preset stopping condition is met; wherein the preset stopping condition includes: the perplexity of the topic identification model is less than a preset perplexity threshold, and / or the difference between the perplexities corresponding to the last two times the number of topics of the topic identification model is optimized is within a preset range.

[0042] The LDA model uses an unsupervised learning method, that is, the LDA model can automatically learn topic information from unlabeled text data without pre-labeled training data. However, the LDA model needs to specify the number of topics in advance. The selection of the number of topics is crucial for the LDA model. Too few topics will cause the LDA model to be overly simplified and unable to fully explore the diverse topics in the text. Too many topics may cause the LDA model to have redundant information between topics due to overfitting. After training the LDA model, in order to evaluate the performance of the LDA model, perplexity is introduced as an indicator to evaluate the performance of the LDA model. In layman's terms, perplexity refers to the uncertainty of using the trained LDA model to judge whether a text document belongs to a specific topic. The lower the perplexity, the better the topic word recognition effect of the LDA model. A test set for testing the performance of the LDA model in the corpus can be established in advance, and a number of topics can be set for the initialization of the LDA model. Then, the number of topics of the LDA model can be iteratively adjusted from the number of topics set initially within the specified number of topics according to a certain step size. During the iteration process, the perplexity of the LDA model is calculated using the following formula each time the number of topics is adjusted:

[0043] Where D represents the test set in the corpus, and the test set has a total of M text documents. represents the number of words in the text document d, Represents the word in the text document d Probability of occurrence; In order to select the number of topics when the perplexity is the lowest or the number of topics when the perplexity changes slowly, a perplexity threshold, a maximum number of adjustments, and a range can be pre-set so that the number of topics can be stopped from being adjusted when at least one of the following conditions is met: the maximum number of adjustments is reached, the perplexity calculated this time is less than the perplexity threshold, and the change value of the perplexity calculated this time compared to the perplexity calculated last time is within the range. After stopping adjusting the number of topics, the number of topics adjusted corresponding to the last adjustment of the number of topics can be used as the number of topics that need to be set for the LDA model in the end.

[0044] Step A23, inputting the preprocessed text data into the optimized topic identification model for topic word identification, so as to output the topic word identification result through the optimized topic identification model.

[0045] Continuing with the previous example, after setting the number of topics for the trained LDA model, the preprocessed text data can be input into the LDA model. The LDA model extracts the subject words from the preprocessed text data and outputs them. The obtained subject words can be combined into a subject word set as the subject word recognition result.

[0046] As a possible implementation manner, the above step S104 (that is, based on the named entity recognition result, the subject word recognition result, the pre-trained second relation extraction model, and the preset clustering algorithm, perform the recognition of the relationship between entities and subject words on the preprocessed text data) may include: Use the second relation extraction model to vectorize the named entity recognition result and the subject word recognition result to generate word vectors, and use the preset clustering algorithm to cluster the obtained word vectors to obtain the recognition result of the relationship between entities and subject words.

[0047] Exemplarily, the second relation extraction model may adopt the BERT model. The pre-trained BERT model can be used to convert the entity words and subject words included in the preprocessed text data into word vectors, and then the clustering algorithm is used to cluster the entity word vectors and subject word vectors with a similarity less than a certain value together to form entity word vector - subject word vector pairs, so as to represent the relationship between the corresponding entity word and the corresponding subject word through the entity word vector - subject word vector pairs. The obtained entity word vector - subject word vector pairs are the recognition results of the relationship between entities and subject words.

[0048] As a possible implementation manner, the above step S105 (that is, based on the named entity recognition result, the subject word recognition result, and the preset dependency syntax analysis algorithm, perform event triple recognition on the preprocessed text data) may include: Step a1, use the preset dependency syntax analysis algorithm to perform dependency syntax analysis on the preprocessed text data to generate the dependency relationship tree of the sentence, and generate event triples based on the obtained dependency relationship tree; wherein, the dependency relationship tree can represent the grammatical relationship between words in the sentence.

[0049] Figure 3 shows the structure of the dependency relationship tree. In Figure 3 the shown dependency relationship tree, the marked relationship types include HED (i.e., the core relationship, used to indicate the core word of the sentence, Figure 3 in which the core word is "is"), SBV (subject-predicate relationship, such as Figure 3 in "XXXX" → "is"), VOB (verb-object relationship, such as Figure 3 in "is" → "relic"), PW (punctuation, such as Figure 3 in "。"), ATT (modifier-head relationship, such as Figure 3 in "a" ← "relic", "archaeology" ← "relic", "history" ← "relic"). The dependency relationship tree also marks the part-of-speech of each word in the sentence, the punctuation in the sentence, and the entities in the sentence (i.e., the place name "XXXX").

[0050] Step a2, determining the target event triple from the obtained event triples based on the named entity recognition results and the keyword recognition results, and forming the obtained target event triples into event triple recognition results; wherein, the target event triple can be an event triple containing named entities and / or keyword.

[0051] by Figure 3 Taking the dependency tree shown in the figure as an example, for the sentence "XXXX is an archaeological historical site.", the entity word contained in the sentence is the place name "XXXX", the SBV related tuple in the sentence is ("XXXX", "is"), and the VOB related tuple in the sentence is ("is", "relic"), ("XXXX", "is") and ("is", "relic") can be connected into an event triple ("XXXX", "is", "relic") containing the subject, predicate and object in the sentence. Since this event triple contains the place name "XXXX", that is, the subject of this event triple is an entity word, this event triple can be used as the target event triple for constructing the knowledge graph.

[0052] To facilitate understanding, the implementation method of the above-mentioned social governance knowledge graph construction method is illustratively described below using a specific application as an example.

[0053] In the process of designing the knowledge graph, entities identified from the text (such as people, institutions, places, etc.) and keywords extracted from the text are used as the main nodes, and the relationships between entities, the relationships between entities and keywords, and event triples are used as edges to construct the knowledge graph. This knowledge graph design method can construct a knowledge graph with richer and more accurate information to intuitively display the complex associations in social governance data.

[0054] See also Figure 4 As shown in the figure, the knowledge graph construction process mainly includes: Step S1, text preprocessing and entity recognition.

[0055] Since most of the text data collected in the field of social governance are unstructured data (structured data may also exist), it is necessary to perform preliminary cleaning of the collected text data (including removing extra spaces and special characters, etc.) to ensure that the text data is basically neat, and then use LTP (Language Technology Plantform) to perform sentence segmentation, word segmentation, part-of-speech tagging, and named entity recognition on the text data after preliminary cleaning. However, the models used by existing LTP are usually trained on general data sets. Directly applying the existing LTP to the field of social governance for entity recognition is not effective. It is necessary to label the entities for the text data in the field of social governance and use this part of the text data with labeled entities to establish a professional dictionary for social governance, so as to train the model used by LTP in combination with the professional dictionary for social governance, so as to fine-tune the parameters of the model used by LTP during the model training process.

[0056] LTP can have ELECTRA model, Adapted-Transformer model and linear classifier, see Figure 5 As shown in Figure 1, the LTP model parameter fine-tuning process mainly includes: First, collect and annotate text data in the field of social governance to ensure that the annotated text data covers common entity categories and contextual information; then, use the tools provided by LTP to perform word segmentation and part-of-speech tagging on the text data after the previous step of annotation to provide basic semantic information for subsequent processing; then, input the data after word segmentation and part-of-speech tagging in the previous step into the pre-trained ELECTRA model to extract hidden layer representation to capture context and semantic features; on this basis, input the hidden layer representation output by the ELECTRA model into the Adapted-Transformer model, and the Adapted-Transformer model combines specific improvement mechanisms (such as the feature extraction mechanism formed after improving feature extraction of direction, distance, etc.) to extract features from the hidden layer representation to enhance the effect of entity recognition. The loss value is calculated by comparing the difference between the model prediction results and the annotated text data (that is, the value of the loss function is calculated, which can specifically include the loss function values ​​of the ELECTRA model and the Adapted-Transformer model. The value of the loss function can be selected as the cross entropy loss function or other types of loss functions according to the actual situation), and the parameters of the model (specifically, the ELECTRA model and the Adapted-Transformer model) are fine-tuned using optimization algorithms such as back propagation and gradient descent to ensure that it can adapt to the specific needs of the social governance field. After the fine-tuning is completed, the fine-tuned model is used to process the actual social governance data, thereby improving the accuracy and efficiency of named entity recognition.

[0057] The goal of named entity recognition is to find the start and end positions of an entity in a text and the category of the entity. The named entity recognition process mainly includes: first, using the Adapted-Transformer model to extract features from the data input into it. The Adapted-Transformer model introduces domain knowledge in the social governance field on the basis of the traditional Transformer to enhance the model's understanding of the context so as to generate a feature representation that is more suitable for the target task, as shown in formula (1):

[0058] in, represents the initial embedding representation of word i; represent The output embedding representation calculated by the Adapted-Transformer model contains contextual and entity-related features; Then use a linear classifier to classify the output embedding representation to obtain the entity category, as shown in formula (2):

[0059] in, Represents the weight matrix, which is used to Mapping to the space of entity categories; Represents the bias term, which is used to adjust the linear mapping result. Through the above preprocessing and entity recognition steps, the structured information in the text can be effectively extracted, laying the foundation for the subsequent knowledge graph construction.

[0060] Step S2: keyword recognition.

[0061] When constructing a knowledge graph in the field of social governance, if only entities (such as names, institutions, places, etc.) are used as nodes, key information in the event may be ignored. Therefore, the LDA (Latent Dirichlet Allocation) model is introduced to mine the subject words in text data and use the subject words as nodes of the knowledge graph. The LDA model requires the number of topics to be specified in advance. Here, the perplexity is selected as an indicator to evaluate the performance of the LDA model to determine the number of topics in the LDA model. The calculation formula of the perplexity is shown in formula (3):

[0062] Where D represents the test set in the corpus, which contains M text documents; represents the number of words in the text document d, represents the words in the text document d, Words in a text document The probability of generation. You can first set an initial value for the number of topics, and iteratively optimize the number of topics of the LDA model from the initial value within a certain range of topic numbers according to a certain step size. The number of topics when the perplexity is the lowest or the number of topics when the perplexity changes slowly should be selected as the number of topics that need to be specified for the LDA model in the end.

[0063] Step S3: entity relationship extraction.

[0064] Entity relations are divided into relations between entities and relations between entities and topics. Accordingly, the above step S3 can be divided into step S31 (i.e., extraction of relations between entities) and step S32 (i.e., extraction of relations between entities and topics): Step S31, extracting relationships between entities.

[0065] Social governance data is often unstructured data, and the length of text varies. Some shorter text records have certain format rules, and the relationship between entities can be extracted based on grammatical rules. However, long text records often have redundant information, so it is not suitable to extract the relationship between entities through text mining. To address this problem, a method for extracting entities based on grammatical rules and remote supervision is proposed: after identifying the entities contained in the text data, it is first necessary to determine the sentences and paragraphs in the text data, and then divide the positional relationship between the entities to be extracted into two categories: neighbor word position relationship and long-interval word position relationship. The neighbor word position relationship refers to the two entities being located in the same sentence or two adjacent sentences, and the long-interval word position relationship refers to the two entities being separated by at least one complete sentence or at least one complete paragraph and spanning multiple sentences or multiple paragraphs. Then, the relationship between entities with neighbor word position relationship is extracted using grammatical rules and the relationship between entities with long-interval word position relationship is extracted using remote supervision, so that the entity relationship extraction results of these two methods can be combined to realize the construction of social governance knowledge graph.

[0066] In order to implement the entity extraction method based on grammatical rules, a grammatical rule set containing general dependency syntactic rules can be established. If two entities are located in the same sentence or two adjacent sentences, that is, the position relationship between the two entities is a neighboring word position relationship, the established grammatical rule set is used to extract the relationship between the entities. The specific implementation method can be: first, perform syntactic analysis on the text to generate a syntactic tree or a sentence dependency tree; then, apply these rules in the grammatical rule set to the syntactic analysis results to identify entities and extract the relationship between entities, and finally output the relationship between entities in the form of structured data, such as the relationship between entities output in the form of triples (entity 1, relationship, entity 2).

[0067] In order to extract entity relationships using remote supervision, we first need to establish a knowledge base containing multiple pre-defined entity relationships, and use the knowledge base to automatically annotate the entity relationships for unannotated text data through remote supervision to generate training data; then, select the BERT model and use the training data to train the BERT model so that the BERT model can learn and identify entity relationships in long-distance contexts; after the BERT model is trained, the BERT model performance is evaluated using the validation set, and the model parameters are optimized based on the evaluation results. If the distance between two entities is far, that is, they span multiple sentences or multiple paragraphs, that is, the positional relationship between the two entities is a long-interval word position relationship, then use remote supervision to extract entity relationships. The specific implementation method can be: apply the trained BERT model to extract entity relationships from new unannotated text so that the extraction results can be integrated into the knowledge graph later. In addition, the accuracy and comprehensiveness of the BERT model's inter-entity relationship extraction can be maintained by continuously updating data and iteratively improving the BERT model. In this way, the BERT model can effectively process long-distance context data across multiple sentences or across multiple paragraphs to fully capture complex inter-entity relationships.

[0068] The specific implementation method of generating training data can be: first extract pre-defined entity pairs and their relationships from the knowledge base, then search for sentences containing these entity pairs in unlabeled text, then automatically annotate the relationships between entities for these sentences, and convert the sentences with annotated entity relationships into data in an input format acceptable to the BERT model as training samples.

[0069] See also Figure 6 As shown, the main implementation steps of entity relationship extraction may include: after cleaning the text data in the field of social governance, first perform entity recognition on the cleaned text data, and then determine the first entity with a neighbor word position relationship and the second entity with a long-interval word position relationship according to the positional relationship between the entities in the cleaned text, and use the entity relationship extraction method based on the grammatical rule set to extract the entity relationship for the first entity, and use the remote supervision method to extract the entity relationship for the second entity; because when actually extracting the entity relationship, it is impossible to directly judge the correctness of the entity relationship extraction result, it is necessary to correct the extracted relationship to form a final entity relationship library based on the corrected entity relationship.

[0070] In order to achieve the correction of the relationship between entities, the R value of the entity relationship classification can be selected as an indirect indicator to determine the credibility of the entity relationship classification. For the entity relationship whose R value is not less than the specified threshold R0, the entity relationship is considered to be credible and can be directly used for subsequent knowledge graph construction; for the entity relationship whose R value is less than the specified threshold R0, it is necessary to further determine whether the entity relationship is credible, so that if the entity relationship is judged to be credible, the entity relationship can be used for subsequent knowledge graph construction, and if the entity relationship is judged to be untrustworthy, the entity relationship can be deleted.

[0071] The calculation formula of R value is shown in formula (4) and formula (5):

[0072] in, Indicates the number of votes that the entity word pair (including two entity words) is predicted to be the i-th relationship (the values ​​of i are 0, 1, and 2, indicating inclusion, non-inclusion, and no relationship, respectively); Represents the ratio of the number of votes for the entity word pair predicted as the i-th relationship to the total number of votes for the entity word pair predicted as the three relationships; , Respectively , , The maximum and sub-maximum values ​​in .

[0073] See also Figure 7 As shown, the process of modifying the relationship between entities can mainly include: Step A, the entity relationships extracted using grammatical rules and the entity relationships extracted using remote supervision methods form a classification result set; Step B, take out an entity pair (with corresponding entity relationship) from the classification result set; calculate the R value of the entity relationship of the entity pair, and determine whether the R value of the entity relationship is not less than R0; Step C: if the R value of the inter-entity relationship is not less than R0, the inter-entity relationship is trusted, and the inter-entity relationship is stored in the corresponding relationship set according to the relationship type (that is, the inclusion relationship is stored in the inclusion relationship set, and the non-inclusion relationship is stored in the non-inclusion relationship set); Step D, if the R value of the relationship between the entities is less than R0, further determining whether the entity pair exists in a pre-established rule extraction relationship set containing multiple entity pairs with known inclusion relationships; Step E: if the entity pair exists in the rule extraction relationship set, the relationship between the entities is stored in the inclusion relationship set; Step F, if the entity pair exists in the rule extraction relationship set, then the relationship between the entities is stored in the non-inclusion relationship set; Step G, determining whether the classification result set is empty; If the classification result set is not empty, return to the above step B, and then execute steps C to G after executing step B; if the classification result set is empty, end the process.

[0074] Step S32, extracting the relationship between entities and topics.

[0075] Extracting the relationship between entities and topics is crucial for building a knowledge graph with a deep semantic structure. In the process of building a knowledge graph, richer semantic information can be displayed by using the relationship between entities and topics as edges in the knowledge graph.

[0076] The implementation method of the above step S32 can be: first, select a pre-trained BERT model to vectorize entity words and subject words. The BERT model can capture the semantic features of rich vocabulary with its bidirectional context encoding ability to generate high-quality word vectors; next, use a clustering algorithm (such as K-means, hierarchical clustering, etc.) to perform cluster analysis on these word vectors, and cluster entity words and subject words with similar semantics together. Through the clustering analysis results, it is possible to accurately identify which entity words and subject words have significant correlations, thereby revealing the deep relationship between entity words and subject words. Structurally mapping the relationship between entities and subjects into the knowledge graph can not only help relevant personnel understand the complex relationship between entities and subjects, but also provide an important basis for subsequent knowledge discovery and decision support.

[0077] Step S4: event triple extraction.

[0078] For social governance data, the dependency syntactic analysis algorithm can be used to extract event triples. The dependency syntactic analysis algorithm is a text analysis algorithm based on syntactic structure. By analyzing the dependency relationship between words in a sentence, the subject, predicate, and object in the text can be identified, thereby constructing event triples.

[0079] The implementation steps of event triple extraction are as follows: Step S41, dependency syntax analysis.

[0080] Perform dependency syntactic analysis on the text to generate a dependency tree of the sentence. The dependency tree describes the grammatical relationship between words in the sentence (such as subject-predicate relationship, verb-object relationship, etc.).

[0081] Step S42, triple extraction.

[0082] According to the dependency tree, the subject, predicate and object in the sentence are identified. The subject is usually the initiator of the action, the predicate is the action itself, and the object is the recipient of the action; the subject, predicate and object in the identified sentence are used to construct event triples.

[0083] Step S43, event summary.

[0084] The event triplets in all texts are aggregated and summarized to generate a comprehensive event list.

[0085] Step S44, based on the entity recognition results and the keyword recognition results, filter out events whose subjects are named entities or keywords.

[0086] The process of step S44 is as follows: if the subject of the event triple is neither a named entity nor a keyword, the event triple is ignored (the event triple will not be included in the knowledge graph construction); if the subject of the event triple is a named entity or a keyword, the event triple is included in the knowledge graph construction. This method can ensure the simplicity and efficiency of the knowledge graph construction. Figure 3 For example, from the sentence "XXXX is an archaeological historical site.", we can identify the subject, predicate, and object as "XXXX", "is", and "sites" respectively, and generate an event triple (XXXX, is, site). Since "XXXX" is a place name and belongs to one of the named entities, this event triple can be used to construct the knowledge graph.

[0087] By adopting the operation method of the above-mentioned step S4 (i.e., event triple extraction), the constructed knowledge graph can not only contain static entity information and subject information but also reflect dynamic event information, making the information contained in the knowledge graph richer and the knowledge graph more practical.

[0088] Step S5, using the obtained entities, topics, relationships between entities, relationships between entities and topics, and event triples to visualize the knowledge graph to generate a knowledge graph.

[0089] In summary, the implementation of the above social governance knowledge graph construction method mainly includes the following aspects: 1) Fine-tune the parameters of the model used by LTP in combination with the professional dictionary of social governance, so that the model used by LTP is suitable for social governance data.

[0090] 2) Combining the characteristics of social governance texts, the LDA model is used to mine the keywords in social governance texts and use them as nodes in the knowledge graph.

[0091] 3) Combining the characteristics of social governance texts and indicators for evaluating the credibility of inter-entity relationship extraction, an inter-entity extraction method based on grammatical rules and remote supervision is proposed.

[0092] By adopting the above-mentioned social governance knowledge graph construction method, we can provide relevant personnel with more accurate and practical information in the field of social governance based on social governance data, integrating LDA models, clustering algorithms, remote supervision and related technologies of knowledge graph construction, so that relevant personnel can cope with the challenges brought about by handling complex events.

[0093] Based on the above-mentioned social governance knowledge graph construction method, the embodiment of the present invention also provides a social governance knowledge graph construction device, see Figure 8 As shown, the device may include the following modules: The preprocessing module 801 is used to obtain initial text data in the field of social governance and preprocess the initial text data; wherein the preprocessing includes at least one of the following: cleaning, sentence segmentation, word segmentation, and part-of-speech tagging.

[0094] The first recognition module 802 is used to perform named entity recognition and keyword recognition on the preprocessed text data, and determine the text position relationship between the named entities contained in the preprocessed text data based on the named entity recognition result.

[0095] The second recognition module 803 is used to perform entity relationship recognition on the preprocessed text data based on the named entity recognition result, the text position relationship and a pre-established grammatical rule set and / or a pre-trained first relationship extraction model.

[0096] The third recognition module 804 is used to identify the relationship between entities and keywords on the preprocessed text data based on the named entity recognition result, the keyword recognition result, and the pre-trained second relationship extraction model and the preset clustering algorithm.

[0097] The fourth recognition module 805 is used to perform event triple recognition on the preprocessed text data based on the named entity recognition result, the keyword recognition result and a preset dependency syntax analysis algorithm.

[0098] The generation module 806 is used to generate a knowledge graph corresponding to the initial text data based on the results of inter-entity relationship recognition, entity and subject word relationship recognition, and event triple recognition.

[0099] By using the above-mentioned social governance knowledge graph construction device, entities, keywords and events as well as relationships between entities and relationships between entities and keywords can be quickly and accurately mined from social governance data to construct a knowledge graph, so that relevant personnel can quickly identify key information and complex relationships based on the knowledge graph and thus more effectively understand the problems and formulate corresponding measures, thereby improving the efficiency of public services.

[0100] The above-mentioned text position relationship may include a neighbor word position relationship and / or a long-interval word position relationship. The neighbor word position relationship may represent that named entities with adjacent text positions are in the same sentence or two adjacent sentences, and the long-interval word position relationship may represent that named entities with adjacent text positions are separated by at least one sentence or at least one paragraph. Based on this, the above-mentioned second recognition module 803 may also be used to: use the grammatical rule set to identify a first relationship between first entities with a neighbor word position relationship in the preprocessed text data, and / or use a pre-trained first relationship extraction model to identify a second relationship between second entities with a long-interval word position relationship in the preprocessed text data; determine the entity relationship recognition result based on the obtained first relationship and / or second relationship and a pre-established third relationship set.

[0101] Each first relationship and / or each second relationship can each have scores corresponding to multiple relationship types; based on this, the above-mentioned second identification module 803 can also be used to: determine the credibility of each first relationship based on the scores of each first relationship corresponding to multiple relationship types, and / or, determine the credibility of each second relationship based on the scores of each second relationship corresponding to multiple relationship types; determine a first target relationship whose credibility is not less than a preset credibility threshold and / or a second target relationship whose credibility is less than a preset credibility threshold from the obtained first relationships and / or second relationships; determine each determined first target relationship as a trusted relationship, and / or, determine a trusted relationship from the determined second target relationships based on the third relationship set; and compose the determined trusted relationships into the inter-entity relationship identification results.

[0102] The first recognition module 802 may also be used to: perform named entity recognition on the preprocessed text data using a pretrained entity recognition model; and perform topic word recognition on the preprocessed text data using a pretrained topic recognition model.

[0103] The above-mentioned entity recognition model may include an ELECTRA model, an Adapted-Transformer model and a linear classifier; based on this, the above-mentioned first recognition module 802 may also be used to: use a pre-trained ELECTRA model to extract the hidden layer representation of the pre-processed text data to obtain the hidden layer representation corresponding to the pre-processed text data; use a pre-trained Adapted-Transformer model to perform feature extraction on the obtained hidden layer representation to obtain a feature vector corresponding to the hidden layer representation; use a pre-trained linear classifier to perform entity classification on the obtained feature vector to obtain the named entity recognition result.

[0104] The above-mentioned topic identification model can adopt the LDA model; based on this, the above-mentioned first identification module 802 can also be used to: determine the initial number of topics of the topic identification model; iteratively optimize the number of topics of the topic identification model based on the initial number of topics and the pre-established test set of the topic identification model, and use the test set to determine the perplexity of the topic identification model each time the number of topics of the topic identification model is optimized, until the number of topics of the topic identification model is optimized when the preset stop condition is met; wherein, the preset stop condition includes: the perplexity of the topic identification model is less than the preset perplexity threshold, and / or, the difference between the perplexities corresponding to the last two optimizations of the number of topics of the topic identification model is within a preset range; the pre-processed text data is input into the optimized topic identification model for topic word recognition, so as to output the topic word recognition result through the optimized topic identification model.

[0105] The above-mentioned third recognition module 804 can also be used to: use the second relationship extraction model to vectorize the named entity recognition results and the keyword recognition results to generate word vectors, and use the preset clustering algorithm to cluster the obtained word vectors to obtain the relationship recognition results between the entities and the keywords.

[0106] The above-mentioned fourth recognition module 805 can also be used for: using the preset dependency syntax analysis algorithm to perform dependency syntax analysis on the preprocessed text data to generate a dependency tree of the sentence, and generating event triples based on the obtained dependency tree; wherein the dependency tree represents the grammatical relationship between words in the sentence; based on the named entity recognition result and the subject word recognition result, determining the target event triple from the obtained event triples, and forming the obtained target event triple into the event triple recognition result; wherein the target event triple is an event triple containing named entities and / or subject words.

[0107] The social governance knowledge graph construction device provided in the embodiment of the present invention has the same implementation principle and technical effects as those in the aforementioned social governance knowledge graph construction method embodiment. For the sake of brief description, for matters not mentioned in the embodiment of the social governance knowledge graph construction device, reference may be made to the corresponding content in the aforementioned social governance knowledge graph construction method embodiment.

[0108] Unless otherwise specifically stated, the relative steps, numerical expressions and values ​​of the components and steps set forth in these embodiments do not limit the scope of the present invention.

[0109] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that can be executed by a processor. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., various media that can store program codes.

[0110] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.

[0111] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A method for constructing a social governance knowledge graph, characterized in that: include: Acquire initial text data in the field of social governance, and preprocess the initial text data; wherein the preprocessing includes at least one of the following: cleaning, sentence segmentation, word segmentation, and part-of-speech tagging; Performing named entity recognition and subject word recognition on the preprocessed text data, and determining the text position relationship between the named entities contained in the preprocessed text data based on the named entity recognition result; Based on the named entity recognition result, the text position relationship, and a pre-established grammatical rule set and / or a pre-trained first relationship extraction model, performing entity relationship recognition on the pre-processed text data; Based on the named entity recognition result, the subject word recognition result, the pre-trained second relationship extraction model and the preset clustering algorithm, the relationship between the entity and the subject word is identified on the pre-processed text data; Based on the named entity recognition result, the subject word recognition result and a preset dependency syntax analysis algorithm, event triple recognition is performed on the preprocessed text data; Based on the results of inter-entity relationship recognition, entity-to-keyword relationship recognition, and event triple recognition, a knowledge graph corresponding to the initial text data is generated.

2. The method for constructing a social governance knowledge graph according to claim 1, characterized in that: The text position relationship includes a neighboring lexeme relationship and / or a long-interval lexeme relationship, wherein the neighboring lexeme relationship indicates that named entities with adjacent text positions are in the same sentence or two adjacent sentences, and the long-interval lexeme relationship indicates that named entities with adjacent text positions are separated by at least one sentence or at least one paragraph; based on the named entity recognition result, the text position relationship, and a pre-established grammatical rule set and / or a pre-trained first relationship extraction model, the pre-processed text data is subjected to entity relationship recognition, including: Using the grammatical rule set to identify a first relationship between first entities having a neighboring lexeme relationship in the preprocessed text data, and / or using a pre-trained first relationship extraction model to identify a second relationship between second entities having a long-interval lexeme relationship in the preprocessed text data; The inter-entity relationship recognition result is determined based on the obtained first relationship and / or second relationship and a pre-established third relationship set.

3. The method for constructing a social governance knowledge graph according to claim 2 is characterized in that: Each first relationship and / or each second relationship has scores corresponding to a plurality of relationship types; Determining the inter-entity relationship recognition result based on the obtained first relationship and / or second relationship and a pre-established third relationship set includes: Determine the credibility of each first relationship based on the score of each first relationship corresponding to the plurality of relationship types, and / or determine the credibility of each second relationship based on the score of each second relationship corresponding to the plurality of relationship types; Determine, from the obtained first relationship and / or second relationship, a first target relationship whose credibility is not less than a preset credibility threshold and / or a second target relationship whose credibility is less than a preset credibility threshold; Determine each determined first target relationship as a trusted relationship, and / or, determine a trusted relationship from the determined second target relationships based on the third relationship set; The determined trusted relationships constitute the inter-entity relationship identification result.

4. The method for constructing a social governance knowledge graph according to claim 2, characterized in that: Determining a trusted relationship from the determined second target relationship based on the third relationship set includes: For each second target relationship determined, determine whether there is a corresponding third relationship in the third relationship set that matches the second target relationship. If there is a corresponding third relationship in the third relationship set that matches the second target relationship, determine the second target relationship as a trusted relationship. If there is no corresponding third relationship in the third relationship set that matches the second target relationship, manually determine whether the second target relationship is a trusted relationship.

5. The method for constructing a social governance knowledge graph according to claim 1, characterized in that: Perform named entity recognition and keyword recognition on the preprocessed text data, including: Using a pre-trained entity recognition model to perform named entity recognition on the pre-processed text data; A pre-trained topic identification model is used to perform topic word identification on the pre-processed text data.

6. The method for constructing a social governance knowledge graph according to claim 5 is characterized in that: The entity recognition model includes an ELECTRA model, an Adapted-Transformer model and a linear classifier; using a pre-trained entity recognition model to perform named entity recognition on the pre-processed text data includes: Using a pre-trained ELECTRA model to extract hidden layer representations from the pre-processed text data, to obtain hidden layer representations corresponding to the pre-processed text data; Using a pre-trained Adapted-Transformer model to perform feature extraction on the obtained hidden layer representation to obtain a feature vector corresponding to the hidden layer representation; A pre-trained linear classifier is used to perform entity classification on the obtained feature vector to obtain the named entity recognition result.

7. The method for constructing a social governance knowledge graph according to claim 5, characterized in that: The topic identification model adopts LDA model; Using a pre-trained topic identification model to perform topic word identification on the pre-processed text data includes: Determining an initial number of topics for the topic identification model; Iteratively optimize the number of topics of the topic identification model based on the initial number of topics and a pre-established test set of the topic identification model, and use the test set to determine the perplexity of the topic identification model each time the number of topics of the topic identification model is optimized, until the number of topics of the topic identification model is optimized when a preset stop condition is met; wherein the preset stop condition includes: the perplexity of the topic identification model is less than a preset perplexity threshold, and / or the difference between the perplexities corresponding to the last two times the number of topics of the topic identification model is optimized is within a preset range; The preprocessed text data is input into the optimized topic identification model for topic word identification, so as to output the topic word identification result through the optimized topic identification model.

8. The method for constructing a social governance knowledge graph according to claim 1, characterized in that: Based on the named entity recognition result, the subject word recognition result, the pre-trained second relationship extraction model and the preset clustering algorithm, the relationship between the entity and the subject word is identified on the pre-processed text data, including: The second relationship extraction model is used to vectorize the named entity recognition results and the subject word recognition results to generate word vectors, and the preset clustering algorithm is used to cluster the obtained word vectors to obtain the relationship recognition results between the entities and subject words.

9. The method for constructing a social governance knowledge graph according to claim 1, characterized in that: Based on the named entity recognition result, the subject word recognition result and a preset dependency syntax analysis algorithm, event triples are recognized on the preprocessed text data, including: Using the preset dependency syntactic analysis algorithm to perform dependency syntactic analysis on the preprocessed text data to generate a dependency tree of the sentence, and generating event triples based on the obtained dependency tree; wherein the dependency tree represents the grammatical relationship between words in the sentence; Based on the named entity recognition result and the keyword recognition result, a target event triple is determined from the obtained event triples, and the obtained target event triples are combined into the event triple recognition result; wherein, the target event triple is an event triple containing named entities and / or keyword.

10. A social governance knowledge graph construction device, characterized in that: include: A preprocessing module, used to obtain initial text data in the field of social governance and preprocess the initial text data; wherein the preprocessing includes at least one of the following: cleaning, sentence segmentation, word segmentation, and part-of-speech tagging; A first recognition module is used to perform named entity recognition and subject word recognition on the preprocessed text data, and determine the text position relationship between the named entities contained in the preprocessed text data based on the named entity recognition result; A second recognition module is used to perform entity relationship recognition on the preprocessed text data based on the named entity recognition result, the text position relationship, and a pre-established grammatical rule set and / or a pre-trained first relationship extraction model; A third recognition module is used to identify the relationship between entities and subject words on the preprocessed text data based on the named entity recognition result, the subject word recognition result, and the pre-trained second relationship extraction model and the preset clustering algorithm; A fourth recognition module, configured to perform event triple recognition on the preprocessed text data based on the named entity recognition result, the subject word recognition result and a preset dependency syntax analysis algorithm; A generation module is used to generate a knowledge graph corresponding to the initial text data based on the results of inter-entity relationship recognition, entity and subject word relationship recognition, and event triple recognition.

Citation Information

Patent Citations

  • Chinese entity relation extraction method based on keyword and verb dependency

    CN109241538A

  • Topic dimension self-adaptive determination method in topic mining model

    CN111241846A

  • Text processing method, device and equipment

    CN112347767A

  • Text processing method and device, electronic equipment and computer readable medium

    CN113486146A

  • Knowledge graph construction method and device and readable storage medium

    CN116955634A