Chinese relation extraction method combining word-level features and external knowledge base
The method enhances Chinese relation extraction by combining word-level features with an external knowledge base and graph neural networks to improve accuracy and robustness, addressing the challenges of word boundaries and polysemy in Chinese language.
Patent Information
- Application Number
- CN202411191443.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2024-12-20
AI Technical Summary
Chinese relation extraction methods face challenges due to the lack of clear word boundaries and polysemy, leading to poor extraction efficiency and accuracy, especially in word-based approaches that rely heavily on word segmentation and meaning recognition.
A method combining word-level features with an external knowledge base using graph neural networks, involving data preprocessing, word segmentation, heterogeneous information network construction, and entity linking with a Chinese knowledge base to enhance accuracy and robustness.
The method effectively addresses the complexity of Chinese language by utilizing word-level features and external knowledge, reducing the impact of word segmentation errors and improving relationship extraction accuracy through deep integration and contextual understanding.
Smart Images

Figure CN119167941A_ABST
Abstract
Description
Technical Field
[0001] The disclosed embodiments relate to the field of data processing technology, and more particularly to a Chinese relationship extraction method combining word-level features with an external knowledge base. Background Art
[0002] At present, the concept of knowledge graph has been widely popularized mainly because Google introduced its knowledge graph in 2012 to improve the relevance and depth of search engine results. Since then, the concept of knowledge graph has been widely adopted and has demonstrated its application value in many fields. Knowledge graph is essentially a structured semantic knowledge database that integrates and organizes a large amount of information in a graphical way. The nodes represent various entities, and the edges describe the various semantic relationships between entities. Knowledge graph plays a core role in many technical fields and industry applications. Relation extraction technology is one of the key technologies for building knowledge graphs.
[0003] Although numerous pipeline and joint extraction methods have been developed in the field of Chinese relation extraction, the task of relation extraction still faces special challenges in the Chinese environment due to the unique language characteristics of Chinese. At present, Chinese relation extraction technology is mainly divided into two methods: character-based relation extraction and word-based relation extraction. The character-based relation extraction method converts sentences into character sequences, and each character is processed as an independent token. The advantage of this method is that it is simple to operate and can directly process characters without considering the division of vocabulary. However, the disadvantages of this method are also obvious. It cannot make full use of complete vocabulary information and may ignore the semantic connection within words, thereby affecting the accuracy of relation extraction. Compared with character-based methods, word-based relation extraction methods attempt to utilize information at the vocabulary level. Since Chinese lacks obvious vocabulary boundaries, this method usually relies on word segmentation technology to identify words in sentences. The accuracy of word segmentation directly affects the effect of relation extraction. In addition, the polysemy of Chinese vocabulary also brings additional challenges to relation extraction, because a word may have different meanings in different contexts, and correct word meaning recognition is the key to achieving efficient relation extraction.
[0004] It can be seen that there is an urgent need for a Chinese relationship extraction method that combines word-level features with an external knowledge base with high extraction efficiency and accuracy. Summary of the invention
[0005] In view of this, the embodiments of the present disclosure provide a Chinese relationship extraction method that combines word-level features with an external knowledge base, which at least partially solves the problems of poor extraction efficiency and accuracy in the prior art.
[0006] The present disclosure provides a Chinese relation extraction method combining word-level features with an external knowledge base, including:
[0007] Step 1, obtaining the original text dataset to be processed;
[0008] Step 2: perform data preprocessing and word segmentation on the original text data set to obtain the word segmentation result;
[0009] Step 3, constructing a heterogeneous information network by combining word-level features in the word segmentation results;
[0010] Step 4, set the corresponding external Chinese knowledge base;
[0011] Step 5: Relationship extraction is performed through graph neural networks combined with heterogeneous information networks and external knowledge bases.
[0012] According to a specific implementation of the embodiment of the present disclosure, step 2 specifically includes:
[0013] Step 2.1, the original text data set is segmented into sentences, and the segmented text is de-duplicated, garbled, and space-removed;
[0014] Step 2.2, performing word segmentation processing on the processed text to obtain the word segmentation result;
[0015] Step 2.3, use Chinese part-of-speech tagging tools to perform part-of-speech tagging.
[0016] According to a specific implementation of the embodiment of the present disclosure, step 3 specifically includes:
[0017] Step 3.1, extract the character-level representation for each word in the sentence;
[0018] Step 3.2, use the preset vocabulary model to convert each word in the sentence into a word embedding vector;
[0019] Step 3.3, convert the part of speech of each word in the sentence into a part of speech embedding vector;
[0020] Step 3.4, fuse the word embedding vector with the part-of-speech embedding vector to express it as a fused word embedding vector;
[0021] In step 3.5, define the node types and edge types, and construct a heterogeneous information network containing character-level representations and fused word embedding vectors.
[0022] According to a specific implementation of the embodiment of the present disclosure, step 3.4 specifically includes:
[0023] The word embedding vector is connected with the part-of-speech embedding vector through the concatenation operation to obtain the fused word embedding vector.
[0024] According to a specific implementation manner of the embodiment of the present disclosure, the node types include character nodes and vocabulary nodes, and the edge types include character-to-character edges, character-to-vocabulary edges, and vocabulary-to-vocabulary edges.
[0025] According to a specific implementation of the embodiment of the present disclosure, before step 5, the method further includes:
[0026] Input the sample data into the graph neural network to obtain the predicted relationship extraction result, and use the actual labeled data to evaluate the accuracy of the predicted relationship extraction result to obtain the evaluation result;
[0027] Adjust the graph neural network structure, training strategy, and hyperparameters based on the evaluation results.
[0028] According to a specific implementation of the embodiment of the present disclosure, step 5 specifically includes:
[0029] Step 5.1, entity link the word segmentation results with the Chinese knowledge base;
[0030] Step 5.2, embed the linked knowledge base as an attribute into the fused word embedding vector;
[0031] Step 5.3: Use graph neural network to aggregate features of heterogeneous information networks and perform relationship extraction operations.
[0032] According to a specific implementation of the embodiment of the present disclosure, step 5.2 specifically includes:
[0033] Step 5.2.1, for each linked entity, extract relevant attribute information from the knowledge base;
[0034] Step 5.2.2, encoding the extracted attribute information;
[0035] In step 5.2.3, the encoded attribute vector is combined with the original fused word embedding vector using vector fusion technology.
[0036] According to a specific implementation of the embodiment of the present disclosure, step 5.3 specifically includes:
[0037] Step 5.3.1, embed the information network that integrates the external knowledge base information as the input of the graph neural network;
[0038] Step 5.3.2, at each layer of the graph neural network, update the feature representation of the current node by aggregating the features of neighboring nodes;
[0039] Step 5.3.3, using the node and edge features updated by the multi-layer network, perform relationship prediction;
[0040] Step 5.3.4: Based on the output of the graph neural network, decode the specific relationship between entities.
[0041] The Chinese relationship extraction scheme combining word-level features with an external knowledge base in the disclosed embodiment includes: step 1, obtaining the original text data set to be processed; step 2, performing data preprocessing and word segmentation on the original text data set to obtain the word segmentation result; step 3, constructing a heterogeneous information network in combination with the word-level features in the word segmentation result; step 4, setting a corresponding external Chinese knowledge base; step 5, extracting relationships by combining the heterogeneous information network and the external knowledge base through a graph neural network.
[0042] The beneficial effects of the embodiments of the present disclosure are as follows: through the scheme of the present disclosure, the complexity of the lack of clear word boundaries in the Chinese language is effectively dealt with by combining word-level features in view of the linguistic characteristics unique to Chinese. This method not only utilizes the information of a single character, but also comprehensively considers the semantics at the vocabulary level, so that effective relationship extraction can be achieved without relying on completely accurate word segmentation results. Secondly, by integrating word-level features, the present invention reduces the impact of word segmentation errors on the accuracy of relationship extraction, making the relationship extraction process more robust. In addition, the present invention introduces an external knowledge base to enhance the system's ability to understand word meanings, especially when dealing with polysemous words, it can more accurately determine word meanings based on the context and information in the knowledge base, thereby improving the accuracy of relationship extraction. Finally, the present invention uses graph neural network technology to perform deep integration and processing of word-level features. Graph neural networks can effectively capture and utilize the complex relationships between words, further improving the performance of relationship extraction tasks. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0044] Figure 1 A flowchart of a Chinese relation extraction method combining word-level features with an external knowledge base provided in an embodiment of the present disclosure;
[0045] Figure 2 A system architecture diagram corresponding to a Chinese relationship extraction method combining word-level features with an external knowledge base provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0046] The embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
[0047] The following describes the embodiments of the present disclosure through specific examples, and those skilled in the art can easily understand other advantages and effects of the present disclosure from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all of the embodiments. The present disclosure can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present disclosure. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present disclosure.
[0048] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein may be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present disclosure, it should be understood by those skilled in the art that an aspect described herein may be implemented independently of any other aspect, and two or more of these aspects may be combined in various ways. For example, any number of aspects described herein may be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein may be used to implement this device and / or practice this method.
[0049] It should also be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present disclosure. The drawings only show components related to the present disclosure rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0050] Additionally, in the following description, specific details are provided to facilitate a thorough understanding of the examples. However, it will be understood by those skilled in the art that the aspects described may be practiced without these specific details.
[0051] The disclosed embodiments provide a Chinese relationship extraction method that combines word-level features with an external knowledge base. The method can be applied to the relationship extraction process in a knowledge graph construction scenario.
[0052] See also Figure 1 , is a flow chart of a Chinese relation extraction method combining word-level features with an external knowledge base provided by an embodiment of the present disclosure. Figure 1 As shown, the method mainly comprises the following steps:
[0053] Step 1, obtaining the original text dataset to be processed;
[0054] Step 2: perform data preprocessing and word segmentation on the original text data set to obtain the word segmentation result;
[0055] Furthermore, the step 2 specifically includes:
[0056] Step 2.1, the original text data set is segmented into sentences, and the segmented text is de-duplicated, garbled, and space-removed;
[0057] Step 2.2, performing word segmentation processing on the processed text to obtain the word segmentation result;
[0058] Step 2.3, use Chinese part-of-speech tagging tools to perform part-of-speech tagging.
[0059] In specific implementation, data preprocessing and word segmentation are performed on the original text, including:
[0060] S2.1: Process the text into sentences, and perform deduplication, garbled characters, and space operations on the text after sentence division. Sentence division is to divide the text into separate sentences. This can be achieved using the sent_tokenize function in Python's nltk library. To remove garbled characters, it is usually necessary to define the scope of garbled characters according to the specific situation, and regular expressions can be used to remove abnormal characters. To remove extra spaces, the strip() method of the string can be used to remove spaces at the beginning and end of the sentence, and the replace() method can be used to remove extra spaces in the sentence. Deduplication refers to removing repeated sentences in the text to ensure that each sentence appears only once in the text. This can be automatically deduplicated by storing the sentences in a set, because the set does not allow repeated elements.
[0061] S2.2: Use Jieba word segmentation to perform word segmentation on the processed text to obtain the word segmentation result. Jieba provides four different word segmentation modes to meet various application requirements: precise mode, full mode, search engine mode and Paddle mode.
[0062] Exact mode is Jieba's default word segmentation method, which aims to segment words as accurately as possible. When using this mode, the word segmentation results do not contain redundant words and usually do not segment non-word components. This mode mainly relies on the Hidden Markov Model (HMM) to process Chinese word segmentation, and is particularly suitable for scenarios that require high-precision word segmentation, such as text analysis and natural language processing.
[0063] The full mode performs word segmentation by scanning all possible words in a sentence, and its word segmentation speed is very fast. This mode starts from the first word of the sentence, traverses each word one by one, and tries to use each word as the starting word of a word to generate all possible word combinations, so it may generate repeated words and characters. Although the full mode can quickly generate a large number of words, it may not effectively resolve ambiguity in the meaning of words.
[0064] The search engine mode is based on the precise mode, but it adds a re-segmentation of long words on its basis to improve the recall rate during search. This mode is suitable for search engine word segmentation. It can match more potential search results by performing full-mode segmentation on long words without losing accuracy.
[0065] Paddle mode uses the PaddlePaddle deep learning framework to implement word segmentation, using a sequence tagging network model based on a bidirectional gated recurrent unit. This mode not only provides word segmentation, but also supports part-of-speech tagging. Paddle mode can better handle some complex word segmentation and part-of-speech tagging tasks, especially when dealing with semantically challenging corpora.
[0066] S2.3: Use Jieba word segmentation to perform part-of-speech tagging. The default Jieba word segmentation tool uses a dictionary to perform part-of-speech tagging, but if a word has different parts of speech in different contexts, there will be tagging errors. Jieba word segmentation uses lazy loading in Paddle mode, and with the help of deep learning, it can better solve complex tasks.
[0067] Step 3, constructing a heterogeneous information network by combining word-level features in the word segmentation results;
[0068] Based on the above embodiment, step 3 specifically includes:
[0069] Step 3.1, extract the character-level representation for each word in the sentence;
[0070] Step 3.2, use the preset vocabulary model to convert each word in the sentence into a word embedding vector;
[0071] Step 3.3, convert the part of speech of each word in the sentence into a part of speech embedding vector;
[0072] Step 3.4, fuse the word embedding vector with the part-of-speech embedding vector to express it as a fused word embedding vector;
[0073] In step 3.5, define the node types and edge types, and construct a heterogeneous information network containing character-level representations and fused word embedding vectors.
[0074] Furthermore, the step 3.4 specifically includes:
[0075] The word embedding vector is connected with the part-of-speech embedding vector through the concatenation operation to obtain the fused word embedding vector
[0076] Optionally, the node types include character nodes and vocabulary nodes, and the edge types include character-to-character edges, character-to-vocabulary edges, and vocabulary-to-vocabulary edges.
[0077] In specific implementation, the process of building a heterogeneous information network by combining word-level features may include:
[0078] S3.1: Use the pre-trained language model RoBerta to extract character-level representations for each word in the sentence. Pre-trained language models are a powerful tool in the field of natural language processing. The core idea is to train a model on a large-scale text dataset to learn the basic statistical properties and semantic structure of the language. Such models usually use deep learning techniques such as recurrent neural networks, convolutional neural networks, or the more popular Transformer architecture. Pre-trained models can capture rich language information from basic vocabulary associations to complex sentence structures. Once pre-training is completed, these models can be further fine-tuned to adapt to specific downstream tasks. This pre-training and fine-tuning method has been shown to significantly improve the performance of various NLP tasks.
[0079] S3.2: Use the pre-trained language model Bert to convert each word in the sentence into a word embedding vector.
[0080] S3.3: Convert the part-of-speech of each word in the sentence into a part-of-speech embedding vector by defining a mapping that converts part-of-speech tags to numerical indices, and then use these indices to query or create embedding vectors.
[0081] S3.4: The word embedding vector is fused with the part-of-speech embedding vector through concatenation operation, which is represented as a fused word embedding vector.
[0082] S3.5: Define node types and edge types, and build a heterogeneous information network with the above characteristics.
[0083] S3.6: Define node types: Nodes can be divided into two categories: character nodes and word nodes. Character nodes represent each unique character in the text, while word nodes represent each unique word or phrase.
[0084] S3.7: Define edge types: Edges can be divided into three categories: character-to-character edges, character-to-word edges, and word-to-word edges. Character-to-character edges reflect the sequential relationship of characters in the text, that is, one character is followed by another character. Character-to-word edges are based on the containment relationship, that is, if a word contains a specific character, we establish an edge between the character node and the word node. Finally, word-to-word edges are established based on the proximity of words in the sentence or the grammatical structure between them, which can help us understand the interaction and dependency between words.
[0085] Step 4, set the corresponding external Chinese knowledge base;
[0086] During specific implementation, you can choose to use Chinese Wikipedia as an external Chinese knowledge base to facilitate subsequent operations.
[0087] Step 5: Relationship extraction is performed through graph neural networks combined with heterogeneous information networks and external knowledge bases.
[0088] Optionally, before step 5, the method further includes:
[0089] Input the sample data into the graph neural network to obtain the predicted relationship extraction result, and use the actual labeled data to evaluate the accuracy of the predicted relationship extraction result to obtain the evaluation result;
[0090] Adjust the graph neural network structure, training strategy, and hyperparameters based on the evaluation results.
[0091] Furthermore, the step 5 specifically includes:
[0092] Step 5.1, entity link the word segmentation results with the Chinese knowledge base;
[0093] Step 5.2, embed the linked knowledge base as an attribute into the fused word embedding vector;
[0094] Step 5.3: Use graph neural network to aggregate features of heterogeneous information networks and perform relationship extraction operations.
[0095] Furthermore, the step 5.2 specifically includes:
[0096] Step 5.2.1, for each linked entity, extract relevant attribute information from the knowledge base;
[0097] Step 5.2.2, encoding the extracted attribute information;
[0098] In step 5.2.3, the encoded attribute vector is combined with the original fused word embedding vector using vector fusion technology.
[0099] Furthermore, the step 5.3 specifically includes:
[0100] Step 5.3.1, embed the information network that integrates the external knowledge base information as the input of the graph neural network;
[0101] Step 5.3.2, at each layer of the graph neural network, update the feature representation of the current node by aggregating the features of neighboring nodes;
[0102] Step 5.3.3, using the node and edge features updated by the multi-layer network, perform relationship prediction;
[0103] Step 5.3.4: Based on the output of the graph neural network, decode the specific relationship between entities.
[0104] In specific implementation, before using graph neural networks for Chinese relation extraction, considering the need to ensure the accuracy of its extraction, the model can be trained first and optimized using Adam. Adam combines momentum and adaptive learning rate technology to adaptively adjust the update steps of each parameter, which makes it particularly good at handling non-uniform data updates. In the initial stage of training, the model parameters are usually randomly initialized. Then, the data in each training batch is used to calculate the gradient of the loss function. These gradients describe the local slope of the loss function under the current model parameters and guide how to adjust the parameters to reduce the loss. The Adam optimizer maintains a dynamically adjusted learning rate for the gradient of each parameter. Specifically, it calculates the first-order and second-order moments of the gradient and uses these moments to adjust the learning rate of each parameter. This method reduces fluctuations in the learning process, speeds up convergence, and improves the stability of the training process. In addition, Adam also includes a bias correction mechanism that can correct the estimated first-order and second-order moments in the early stages of training to avoid inaccurate calculations due to initialization to 0 values. As training progresses, the process of forward propagation, loss calculation, back propagation, and parameter update is repeated until the performance of the model on the validation dataset no longer improves or the preset number of training cycles is reached.
[0105] The process of extracting relationships by combining graph neural networks with contextual information and external knowledge bases specifically includes:
[0106] S5.1: The process of entity linking the word segmentation results with the Chinese knowledge base involves identifying entities in free text and accurately and unambiguously mapping the identified entities to specific entities in the knowledge base. The process first retrieves all possible candidate entities in the knowledge base, then calculates similarity through feature extraction, and scores the candidate entities. The entity with the highest score will be selected as the link target. Given that the knowledge base may not contain some target entities, a prediction mechanism for unlinkable mentions is introduced to verify whether the highest-scoring entity is indeed the target entity. If it is not the target entity, "NIL" is returned, indicating that it cannot be linked.
[0107] S5.2: Encode the extracted attribute information using the Bert pre-trained model.
[0108] S5.3: Use vector concatenation to combine the encoded attribute vector with the original word embedding vector.
[0109] S5.4: Choose graph convolutional network as the base architecture.
[0110] S5.5: Use the word heterogeneous graph that integrates the external knowledge base information as the input layer for embedding. The structure of the graph is usually represented by an adjacency matrix. The adjacency matrix is a square matrix whose element A[i][j] indicates whether there is an edge from node i to node j. If there is an edge, it is 1, and if there is no edge, it is 0.
[0111] S5.6: At each layer of the graph neural network, the feature representation of the current node is updated by aggregating the features of neighboring nodes. This step takes advantage of the topological structure between nodes and learns how to best combine the information of neighbors to extract deeper semantic relationships. The graph convolution layer is the core of the graph convolutional network, which uses the adjacency matrix and node features to update the feature representation of each node. Each layer can be expressed as:
[0112]
[0113] Among them, H (l) is the node feature matrix of the lth layer, W (l) is the weight matrix of this layer, (A is the adjacency matrix and I is the identity matrix), yes is the degree matrix, and σ is the activation function.
[0114] A nonlinear activation function is usually used to increase the expressive power of the network. ReLU is used here:
[0115]
[0116] Multi-classification cross entropy loss is used here as the loss function:
[0117]
[0118] Among them, y ic Indicates whether the i-th sample belongs to class c, if so, it is 1, otherwise it is 0. is the probability that the model predicts that the i-th sample belongs to class c, C is the total number of categories, and N is the total number of samples.
[0119] S5.7: Using the node and edge features updated by the multi-layer network, perform relationship prediction to classify each possible entity pair and the potential relationship between them.
[0120] S5.8: Based on the output of the graph neural network, select the relationship type with the highest confidence and obtain the specific relationship between entities.
[0121] The Chinese relationship extraction method provided in this embodiment combines word-level features with an external knowledge base, and pre-processes the text based on the original Chinese text data set using a word segmentation tool, and constructs a heterogeneous information network by fusing word-level features to reduce the impact of word segmentation errors. At the same time, the method effectively solves the ambiguity problem of Chinese vocabulary and improves the accuracy of relationship extraction by using a graph neural network combined with contextual information and a knowledge base. The specific steps include: obtaining the original Chinese text data set to be processed; performing data preprocessing and word segmentation on the original text; constructing a heterogeneous information network in combination with word-level features; selecting a suitable external Chinese knowledge base; and extracting relationships by combining contextual information and an external knowledge base through a graph neural network. The present invention significantly improves the effect of Chinese relationship extraction and effectively alleviates the challenges caused by word segmentation quality and word ambiguity.
[0122] It should be understood that various parts of the present disclosure may be implemented in hardware, software, firmware, or a combination thereof.
[0123] The above is only a specific implementation of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present disclosure should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A Chinese relation extraction method combining word-level features with an external knowledge base, characterized in that: include: Step 1, obtaining the original text dataset to be processed; Step 2: perform data preprocessing and word segmentation on the original text data set to obtain the word segmentation result; Step 3, constructing a heterogeneous information network by combining word-level features in the word segmentation results; Step 4, set the corresponding external Chinese knowledge base; Step 5: Relationship extraction is performed through graph neural networks combined with heterogeneous information networks and external knowledge bases.
2. The method according to claim 1, characterized in that , the step 2 specifically includes: Step 2.1, the original text data set is segmented into sentences, and the segmented text is de-duplicated, garbled, and space-removed; Step 2.2, performing word segmentation processing on the processed text to obtain the word segmentation result; Step 2.3, use Chinese part-of-speech tagging tools to perform part-of-speech tagging.
3. The method according to claim 2, characterized in that , the step 3 specifically includes: Step 3.1, extract the character-level representation for each word in the sentence; Step 3.2, use the preset vocabulary model to convert each word in the sentence into a word embedding vector; Step 3.3, convert the part of speech of each word in the sentence into a part of speech embedding vector; Step 3.4, fuse the word embedding vector with the part-of-speech embedding vector to express it as a fused word embedding vector; In step 3.5, define the node types and edge types, and construct a heterogeneous information network containing character-level representations and fused word embedding vectors.
4. The method according to claim 3, characterized in that , the step 3.4 specifically includes: The word embedding vector is connected with the part-of-speech embedding vector through the concatenation operation to obtain the fused word embedding vector.
5. The method according to claim 3, characterized in that ,The node types include character nodes and vocabulary nodes, and the edge types include character to character edges, character to vocabulary edges, and ,vocabulary to vocabulary edges.
6. The method according to claim 3, characterized in that , before step 5, the method further includes: Input the sample data into the graph neural network to obtain the prediction relationship extraction result, and use the actual labeled data to evaluate the accuracy of the prediction relationship extraction result to obtain the evaluation result; Adjust the graph neural network structure, training strategy, and hyperparameters based on the evaluation results.
7. The method according to claim 6, characterized in that , the step 5 specifically includes: Step 5.1, entity link the word segmentation results with the Chinese knowledge base; Step 5.2, embed the linked knowledge base as an attribute into the fused word embedding vector; Step 5.3: Use graph neural network to aggregate features of heterogeneous information networks and perform relationship extraction operations.
8. The method according to claim 7, characterized in that , the step 5.2 specifically includes: Step 5.2.1, for each linked entity, extract relevant attribute information from the knowledge base; Step 5.2.2, encoding the extracted attribute information; In step 5.2.3, the encoded attribute vector is combined with the original fused word embedding vector using vector fusion technology.
9. The method according to claim 7, characterized in that , the step 5.3 specifically includes: Step 5.3.1, embed the information network that integrates the external knowledge base information as the input of the graph neural network; Step 5.3.2, at each layer of the graph neural network, update the feature representation of the current node by aggregating the features of neighboring nodes; Step 5.3.3, using the node and edge features updated by the multi-layer network, perform relationship prediction; Step 5.3.4: Based on the output of the graph neural network, decode the specific relationship between entities.
