Knowledge graph-based named entity recognition method, device, equipment and medium

By constructing a basic word segmentation dictionary based on knowledge graphs and expanding its features, and combining semantic word vectors and conditional random field methods, the problem of low accuracy in named entity recognition in specific domains is solved, and more efficient named entity recognition is achieved.

CN117094322BActive Publication Date: 2026-01-23E SURFING IOT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311058249.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-21
Publication Date
2026-01-23
Estimated Expiration
2043-08-21

AI Technical Summary

Technical Problem

Traditional named entity recognition methods have low accuracy in certain domains, especially in recognizing proper nouns.

Method used

A basic word segmentation dictionary is constructed based on knowledge graphs. Features are expanded using the TF-IDF method. Sentence feature vectors are generated by combining word segmentation results, text data, and a pre-set basic semantic word vector table. Named entity recognition is performed using a classification prediction model and a conditional random field method.

Benefits of technology

It improves the accuracy of named entity recognition in specific domains and enhances the recognition effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117094322B_ABST
    Figure CN117094322B_ABST
Patent Text Reader

Abstract

Embodiments of the application disclose a named entity recognition method and device based on a knowledge graph, equipment and a medium. The method belongs to the technical field of Internet of Things and natural language processing, and comprises the following steps: if a knowledge graph of a specific field is graph data, the knowledge graph is exported as text data, and a basic word segmentation dictionary is constructed according to the text data; a target word segmentation dictionary is obtained by performing feature expansion on the basic word segmentation dictionary, and text data is segmented according to the target word segmentation dictionary to obtain a segmentation result; a sentence feature vector is generated according to the segmentation result, the text data and a preset basic semantic word vector table; each word in the text data is vectorized according to the preset basic semantic word vector table to obtain a basic semantic vector; and named entity recognition is performed through a classification prediction model and a conditional random field method according to the sentence feature vector and the basic semantic vector. The embodiments of the application can improve the accuracy of named entity recognition in a specific field.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of Internet of Things and natural language processing technology, and in particular to a method, apparatus, device and medium for named entity recognition based on knowledge graph. Background Technology

[0002] Named entity recognition (NER) is a fundamental task in natural language processing (NLP), aiming to identify entities with specific meanings within text. With the generation of massive amounts of data on the internet, NER has gained increasing attention from both academia and industry, and is widely used in machine translation, intelligent question answering, information retrieval, and other NLP tasks. Traditional NER methods and models primarily identify common nouns such as names of people, organizations, and locations. However, their accuracy and performance are low when dealing with domain-specific proper nouns. Summary of the Invention

[0003] This invention provides a knowledge graph-based named entity recognition method, apparatus, device, and medium, aiming to improve the recognition accuracy of named entity recognition in specific domains.

[0004] In a first aspect, embodiments of the present invention provide a named entity recognition method based on a knowledge graph, comprising:

[0005] If the knowledge graph in a specific domain is graph data, then the knowledge graph is exported as text data, and a basic word segmentation dictionary is constructed based on the text data;

[0006] The basic word segmentation dictionary is augmented with features to obtain a target word segmentation dictionary, and the text data is segmented according to the target word segmentation dictionary to obtain the word segmentation result;

[0007] Generate sentence feature vectors based on the word segmentation results, the text data, and the pre-set basic semantic word vector table;

[0008] Based on the preset basic semantic word vector table, each word in the text data is vectorized to obtain a basic semantic vector;

[0009] Named entity recognition is performed using the sentence feature vector and the basic semantic vector through a classification prediction model and a conditional random field method.

[0010] Secondly, embodiments of the present invention also provide a named entity recognition device based on a knowledge graph, comprising:

[0011] An export building unit is used to export the knowledge graph as text data if the knowledge graph in a specific domain is graph data, and to build a basic word segmentation dictionary based on the text data;

[0012] An expanded word segmentation unit is used to expand the features of the basic word segmentation dictionary to obtain a target word segmentation dictionary, and to segment the text data according to the target word segmentation dictionary to obtain the word segmentation result;

[0013] The generation unit is used to generate sentence feature vectors based on the word segmentation results, the text data, and a preset basic semantic word vector table.

[0014] A vectorization unit is used to vectorize each word in the text data according to the preset basic semantic word vector table to obtain a basic semantic vector.

[0015] The recognition unit is used to perform named entity recognition based on the sentence feature vector and the basic semantic vector using a classification prediction model and a conditional random field method.

[0016] Thirdly, embodiments of the present invention also provide a computer device, the computer device having a named entity recognition system based on a knowledge graph, the computer device including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the above-described method.

[0017] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing a computer program that, when executed by a processor, can implement the above-described method.

[0018] This invention provides a method, apparatus, device, and medium for named entity recognition based on knowledge graphs. The method includes: if the knowledge graph for a specific domain is graph data, exporting the knowledge graph as text data and constructing a basic word segmentation dictionary based on the text data; expanding the basic word segmentation dictionary with features to obtain a target word segmentation dictionary, and segmenting the text data according to the target word segmentation dictionary to obtain segmentation results; generating sentence feature vectors based on the segmentation results, the text data, and a preset basic semantic word vector table; vectorizing each word in the text data according to the preset basic semantic word vector table to obtain a basic semantic vector; and performing named entity recognition using a classification prediction model and a conditional random field method based on the sentence feature vectors and the basic semantic vectors. The technical solution of this invention constructs a basic word segmentation dictionary based on a knowledge graph of a specific domain, segments text data according to the basic word segmentation dictionary to obtain word segmentation results, generates sentence feature vectors and basic semantic vectors based on the word segmentation results, text data, and a pre-set basic semantic word vector table, and performs named entity recognition through a classification prediction model and a conditional random field method based on the sentence feature vectors and basic semantic vectors, which can improve the accuracy of named entity recognition in a specific domain. Attached Figure Description

[0019] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0020] Figure 1 A flowchart illustrating a knowledge graph-based named entity recognition method provided in an embodiment of the present invention;

[0021] Figure 2 This is a schematic diagram illustrating the construction of a basic word segmentation dictionary provided in an embodiment of the present invention;

[0022] Figure 3 This is a schematic diagram illustrating the expansion of a basic word segmentation dictionary to generate a target word segmentation dictionary, as provided in an embodiment of the present invention.

[0023] Figure 4 This is a schematic diagram illustrating the segmentation of text data based on a target word segmentation dictionary, provided as an embodiment of the present invention.

[0024] Figure 5 A schematic block diagram of a knowledge graph-based named entity recognition device provided in an embodiment of the present invention;

[0025] Figure 6 This is a schematic block diagram of a computer device provided in an embodiment of the present invention. Detailed Implementation

[0026] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0027] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0028] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.

[0029] It should also be further understood that the term "and / or" used in the specification and appended claims of the present invention refers to any combination and all possible combinations of one or more of the associated listed items, and includes such combinations.

[0030] As used in this specification and the appended claims, the term "if" may be construed, depending on the context, as "when", "once", "in response to determining", or "in response to detecting". Similarly, the phrase "if determined" or "if [the described condition or event] is detected" may be construed, depending on the context, as meaning "once determined", "in response to determining", "once [the described condition or event] is detected", or "in response to detecting [the described condition or event]".

[0031] Please refer to Figure 1 , Figure 1 is a schematic flowchart of a named entity recognition method based on a knowledge graph provided by an embodiment of the present invention. The named entity recognition method based on a knowledge graph in an embodiment of the present invention can be applied to a named entity recognition system based on a knowledge graph. For example, the named entity recognition method based on a knowledge graph can be implemented by a software program configured on the named entity recognition based on a knowledge graph. As Figure 1 shown, the method includes the following steps S100 - S140.

[0032] S100. If the knowledge graph in a specific domain is graph data, export the knowledge graph as text data, and construct a basic word segmentation dictionary according to the text data.

[0033] In an embodiment of the present invention, for the convenience of understanding, the named entity recognition system based on a knowledge graph is first introduced. The named entity recognition system based on a knowledge graph includes a word segmentation dictionary construction module, a word segmentation module, a word vectorization module, and a discriminator module. Among them, the word segmentation dictionary construction module is used to construct a basic word segmentation dictionary; the word segmentation module is used to perform word segmentation on text data to generate a word segmentation result; the word vectorization module is used to generate a sentence feature vector and a basic semantic vector; the discriminator module is used to perform named entity recognition. It can be understood that whether the knowledge graph itself is stored in a graph database in the form of a graph or stored in text form, its basic structure is in the form of triples, such as <Intelligent Door Magnet, Data Transmission, NB Network>, <DS - 7800N - Q1, Type, Network Video Recorder>, <DS - 7800N - Q1, Manufacturer, Company A>, etc. This form can be recognized as <Entity, Attribute, Entity>, <Entity, Attribute, Attribute Name>. When the above triple information is sufficient, it can be interwoven into a network structure to form a knowledge graph.

[0034] In practical applications, if the knowledge graph for a specific domain is graph data, it is exported as text data. The triples in the text data are traversed and split to extract entities, attributes, and attribute names from the triples. During extraction, the entities, attributes, and attribute names are counted and deduplicated to generate a basic word segmentation dictionary. This basic word segmentation dictionary is a list including words, frequency, type, and length. Understandably, if the specific domain is not a graph but text data, then exporting is unnecessary. It should be noted that in this implementation, counting specifically refers to the number of times each word appears and the word length; deduplication refers to removing duplicate words; the format of the basic word segmentation dictionary is [vocabulary frequency type length]. Figure 2 As shown. It should also be noted that in this embodiment, text sentences are composed of characters and words. Characters and words are the smallest units that preserve the semantics of a sentence. Since subsequent processing is based on the character / word dimension, rather than the sentence dimension, word segmentation is an essential part of the text, and the segmentation results will affect subsequent processing. Compared to the vocabulary dictionary of a general corpus, building a basic word segmentation dictionary using a domain-specific knowledge graph is more suitable for domain-specific recognition tasks. General corpora may fail to recognize domain-specific terms completely because the probability of such terms appearing in general large text corpora is extremely low, or even zero.

[0035] Furthermore, in a knowledge graph, in addition to existing knowledge, reasoning can also be performed based on existing knowledge. Through reasoning, more knowledge can be mined to form new triples, thereby expanding the basic word segmentation dictionary. The reasoning process can be carried out by training the triples in the knowledge graph using a representation learning model. After training, the representation learning model can obtain new relationships between entities and attributes. Based on these relationships between entities and attributes, the triple pairs can be expanded, thereby expanding the basic word segmentation dictionary.

[0036] S110. The basic word segmentation dictionary is expanded with features to obtain a target word segmentation dictionary, and the text data is segmented according to the target word segmentation dictionary to obtain the word segmentation result.

[0037] In this embodiment of the invention, the TF-IDF values ​​of the entity, the attribute, and the attribute name are calculated using the TF-IDF method to obtain the entity TF-IDF, attribute TF-IDF, and attribute name TF-IDF, respectively. The attribute state value is obtained by multiplying the attribute TF-IDF by a preset ratio parameter, where the preset ratio parameter is α (0 < α < 1). A ratio allocation parameter is calculated based on the preset ratio parameter, where the ratio allocation parameter is 1 - α. The entity state value is obtained by multiplying the ratio allocation parameter by the entity TF-IDF. The attribute name state value is obtained by multiplying the ratio allocation parameter by the attribute name TF-IDF. The attribute state value, the entity state value, and the attribute name state value are added as state values ​​to the basic word segmentation dictionary to obtain the target word segmentation dictionary. Specifically, in this embodiment, based on the idea of ​​TF-IDF, the higher the frequency of a word appearing in a text but the fewer times it appears in the overall text corpus, the more likely the word can be considered a core keyword of the text. Therefore, the TF-IDF value in the basic word segmentation dictionary is calculated as follows: TF = (number of times noun A appears in the basic word segmentation dictionary / total number of entries in the basic word segmentation dictionary), IDF = log(total number of texts / number of texts containing noun A + 1), then TF-IDF = TF × IDF. To increase the proportion of entities and decrease the proportion of attributes, a proportional parameter α (0 < α < 1) is set for proportional allocation. The proportion of attribute values ​​is considered according to the actual situation, i.e., the value of α is set according to the actual situation. Finally, the TF-IDF of entities and attribute names = (1-α) × TF × IDF; the TF-IDF of attributes = α × TF × IDF. The attribute TF-IDF (attribute state value), entity TF-IDF (entity state value), and attribute name TF-IDF (attribute name state value) are used as state values. Finally, the state values ​​are recorded in the basic word segmentation dictionary to obtain the target word segmentation dictionary table. The target word segmentation dictionary is [vocabulary frequency type length state value]. The target word segmentation dictionary is as follows: Figure 3 As shown.

[0038] Further, after obtaining the target word segmentation dictionary, the shortest length in the target word segmentation dictionary is used as the matching length, and words corresponding to the matching length are obtained from the target word segmentation dictionary as words to be matched; the words to be matched are matched with words in the text data; if the match is successful, the words in the text data that match the words to be matched are marked; the matching length is incremented by 1, and the step of obtaining words corresponding to the matching length from the target word segmentation dictionary as words to be matched is returned, until the matching length is greater than the longest length in the target word segmentation dictionary, so as to segment the text data to obtain the word segmentation result. Specifically, for a sentence S, assuming it is fully segmented into individual characters, according to the definition of traditional language models, the reasonable probability of this sentence S can be written as P(S) = P(w1)P(w2|w1)P(w3|w1,w2)……P(wn|w1,w2,...,wn-1). Based on the Markov assumption, which assumes that the probability of a word appearing is only semantically related to the preceding few words, and then using the Bi-gram assumption (that the appearance of a word is related to the preceding two words), the above probability can be expressed as P(S) = P(w1)P(w2|w1)P(w3|w1,w2)……P(wn|wn-2,wn-1). Therefore, the state values ​​in the aforementioned target word segmentation dictionary, combined with segmentation probabilities, are used to score the text data segmentation results. The state value is defined as sw, and the scoring after segmentation is based on P(S) = sw1P(w1)sw2P(w2|w1)sw3P(w3|w1,w2)……swnP(wn|wn-2,wn-1), with the highest probability being taken as the segmentation result. For example... Figure 4 As shown, the specific word segmentation method starts with the shortest word in the dictionary. It selects the shortest word from the beginning of the sentence and matches it character by character from the word segmentation dictionary. If a match is successful, it is marked (let's say word A). Then, starting from word A, it continues matching words of length +1 (if the length exceeds the current length, if the first few words match, it continues matching; otherwise, it skips the current length), words of length +2, words of length +3, and so on, until the longest word is found. When a matching word is found, recursion can be performed, i.e., recursively returning to A and moving A one unit forward for matching. If a match is successful, the previous operation continues. This process continues until all possible segmentations are completed. All words not in the dictionary are fully segmented. Finally, for all possible segmentations, the probabilities described above are calculated, and the segmentation result with the highest probability is selected.

[0039] S120. Generate sentence feature vectors based on the word segmentation results, the text data, and the preset basic semantic word vector table.

[0040] In this embodiment of the invention, the text data is divided into multiple sentences, and each sentence is processed to obtain a vocabulary. Based on the vocabulary and the corresponding word segmentation results, the one-hot encoding of each word in the sentence is obtained, and the positional features of the sentence are obtained based on the one-hot encoding. The product of the positional features and a pre-set basic semantic word vector table is calculated to obtain the sentence feature vector. Specifically, the text data is divided into sentences, and then the sentences are segmented. After segmentation, deduplication is performed, and a vocabulary is built based on all deduplicated words. Combining the vocabulary and the word segmentation results of the sentences, the one-hot encoding representation of each word is obtained. Then, the one-hot encoding representations of all words are concatenated and aggregated to obtain the positional features of the sentence. It should be noted that in this embodiment, a parallel concatenation method is adopted.

[0041] S130. Vectorize each word in the text data according to the preset basic semantic word vector table to obtain a basic semantic vector.

[0042] In this embodiment of the invention, the pre-set basic semantic word vector table is a vector table generated after training and validating the text using model tools such as word2vec and BERT. During training, unregistered terms need to be added to prepare for subsequent smoothing processing. It should be noted that when calculating the product of the positional features and the pre-set basic semantic word vector table to obtain the sentence feature vector, the length of the maximum vector is considered. For sentences with a length smaller than the maximum vector, zero-padding is performed when vectorizing them to obtain the sentence feature vector.

[0043] S140. Named entity recognition is performed using a classification prediction model and a conditional random field method based on the sentence feature vector and the basic semantic vector.

[0044] In this embodiment of the invention, the sentence feature vector and the basic semantic vector are multiplied by a dot product to obtain an association matrix vector. The association matrix vector is then input into the classification prediction model for label prediction to generate a prediction result. This prediction result includes pre-defined scores for B, I, E, O, and S labels. Named entity recognition is performed based on the prediction result using the Conditional Random Field (CRF) method. Specifically, the CRF method is used to calculate the state and offset probabilities of the B, I, E, O, and S labels to obtain the B state offset probability, I state offset probability, O state offset probability, E state offset probability, and S state offset probability. The highest probability among these probabilities is selected as the target result. The target result is decoded to obtain the final label, and the text corresponding to the final label is used as the identified named entity. It should be noted that the reason for performing a dot product operation on the sentence feature vector and the basic semantic vector is that the two vectors have different dimensions, and the dot product operation can fuse the two vectors; the classification prediction model includes, but is not limited to, BiLSTM and RNN models.

[0045] It should be noted that in this embodiment, during the word segmentation stage, a basic word segmentation dictionary is constructed based on the knowledge graph of a specific domain. After expanding the basic word segmentation dictionary based on TF-IDF, word segmentation results are obtained. Sentence feature vectors and basic semantic vectors are generated based on the word segmentation results, text data, and a pre-set basic semantic word vector table. Named entity recognition is performed using a classification prediction model and a conditional random field method based on the sentence feature vectors and basic semantic vectors. This can improve the accuracy of named entity recognition in a specific domain, thereby improving the recognition effect.

[0046] Figure 5 This is a schematic block diagram of a knowledge graph-based named entity recognition device 200 provided in an embodiment of the present invention. Figure 5 As shown, corresponding to the above-described knowledge graph-based named entity recognition method, the present invention also provides a knowledge graph-based named entity recognition apparatus 200. This knowledge graph-based named entity recognition apparatus 200 includes units for performing the above-described knowledge graph-based named entity recognition method. Specifically, please refer to... Figure 5 The knowledge graph-based named entity recognition device 200 includes an export construction unit 201, an expanded vocabulary unit 202, a generation unit 203, a vectorization unit 204, and a recognition unit 205.

[0047] The derivation and construction unit 201 is used to export the knowledge graph as text data if the knowledge graph in a specific domain is graph data, and construct a basic word segmentation dictionary based on the text data; the word segmentation expansion unit 202 is used to expand the basic word segmentation dictionary to obtain a target word segmentation dictionary, and perform word segmentation on the text data based on the target word segmentation dictionary to obtain word segmentation results; the generation unit 203 is used to generate sentence feature vectors based on the word segmentation results, the text data, and a preset basic semantic word vector table; the vectorization unit 204 is used to vectorize each word in the text data based on the preset basic semantic word vector table to obtain a basic semantic vector; and the recognition unit 205 is used to perform named entity recognition based on the sentence feature vectors and the basic semantic vectors using a classification prediction model and a conditional random field method.

[0048] In some embodiments, such as this one, the export building unit 201 includes a splitting extraction unit and a counting deduplication unit.

[0049] The splitting and extraction unit is used to traverse and split the triples in the text data to extract the entities, attributes, and attribute names in the triples; the counting and deduplication unit is used to count and deduplicate the entities, attributes, and attribute names during the extraction process to generate a basic word segmentation dictionary, wherein the basic word segmentation dictionary is a list including words, frequencies, types, and lengths.

[0050] In some embodiments, such as this one, the expanded word unit 202 includes a first calculation unit, a second calculation unit, a third calculation unit, a fourth calculation unit, a fifth calculation unit, an addition unit, a first acquisition unit, a matching unit, a tagging unit, and an execution unit.

[0051] The first calculation unit is used to calculate the TF-IDF values ​​of the entity, the attribute, and the attribute name respectively using the TF-IDF method to obtain the entity TF-IDF, attribute TF-IDF, and attribute name TF-IDF; the second calculation unit is used to calculate the product of the attribute TF-IDF and a preset ratio parameter to obtain an attribute state value; the third calculation unit is used to calculate a ratio allocation parameter according to the preset ratio parameter; the fourth calculation unit is used to calculate the product of the ratio allocation parameter and the entity TF-IDF to obtain an entity state value; the fifth calculation unit is used to calculate the product of the ratio allocation parameter and the attribute name TF-IDF to obtain an attribute name state value; and the adding unit is used to combine the attribute state value, the entity state value, and the attribute name state value. The state value is added to the basic word segmentation dictionary to obtain the target word segmentation dictionary; the first acquisition unit is used to take the shortest length in the target word segmentation dictionary as the matching length, and to acquire words corresponding to the matching length from the target word segmentation dictionary as words to be matched; the matching unit is used to match the words to be matched with the words in the text data; the marking unit is used to mark the words in the text data that match the words to be matched if the match is successful; the execution unit is used to increment the matching length by 1, and return to execute the step of acquiring words corresponding to the matching length from the target word segmentation dictionary as words to be matched, until the matching length is greater than the longest length in the target word segmentation dictionary, so as to segment the text data to obtain the word segmentation result.

[0052] In some embodiments, such as this one, the generation unit 203 includes a partitioning unit, a second acquisition unit, and a sixth calculation unit.

[0053] The segmentation unit is used to segment the text data into multiple sentences and process each sentence to obtain a vocabulary; the second acquisition unit is used to obtain the one-hot encoding of each word in the sentence based on the vocabulary and the word segmentation result corresponding to the sentence, and to obtain the positional features of the sentence based on the one-hot encoding; the sixth calculation unit is used to calculate the product of the positional features and the preset basic semantic word vector table to obtain the sentence feature vector.

[0054] In some embodiments, such as this one, the identification unit 205 includes a seventh calculation unit, a prediction unit, and a first identification subunit.

[0055] The seventh calculation unit is used to perform a dot product operation between the sentence feature vector and the basic semantic vector to obtain an association matrix vector; the prediction unit is used to input the association matrix vector into the classification prediction model to perform label prediction and generate a prediction result; the first recognition subunit is used to perform named entity recognition based on the prediction result using the conditional random field method.

[0056] In some embodiments, such as this one, the first identification subunit includes an eighth calculation unit, a selection unit, and a second identification subunit.

[0057] The eighth calculation unit is used to calculate the state and offset probabilities of the B-state, I-state, O-state, E-state, and S-state using the conditional random field method. The selection unit is used to select the highest probability among the B-state, I-state, O-state, E-state, and S-state offset probabilities as the target result. The second recognition subunit decodes the target result to obtain the final label and uses the text corresponding to the final label as the recognized named entity.

[0058] It should be noted that users skilled in the field can clearly understand that the specific implementation process of the knowledge graph-based named entity recognition device 200 and its various units can be found in the corresponding descriptions in the foregoing method embodiments. For the sake of convenience and brevity, these details will not be repeated here.

[0059] The aforementioned knowledge graph-based named entity recognition device can be implemented as a computer program, which can, for example, Figure 6 It runs on the computer device shown.

[0060] Please see Figure 6 , Figure 6 This is a schematic block diagram of a computer device provided in an embodiment of this application. The computer device 900 is a device equipped with named entity recognition based on a knowledge graph.

[0061] See Figure 6 The computer device 900 includes a processor 902, a memory, and an interface 907 connected via a system bus 901, wherein the memory may include a storage medium 903 and internal memory 904.

[0062] The storage medium 903 can store the operating system 9031 and the computer program 9032. When the computer program 9032 is executed, it enables the processor 902 to perform the aforementioned knowledge graph-based named entity recognition method.

[0063] The processor 902 provides computing and control capabilities to support the operation of the entire computer device 900.

[0064] The internal memory 904 provides an environment for the execution of the computer program 9032 in the storage medium 903. When the computer program 9032 is executed by the processor 902, the processor 902 can execute a knowledge graph-based named entity recognition method.

[0065] This interface 905 is used for communication with other devices. Those skilled in the art will understand that... Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device 900 to which the present application is applied. The specific computer device 900 may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0066] The processor 902 is used to run a computer program 9032 stored in a memory to implement any embodiment of the knowledge graph-based named entity recognition method described above.

[0067] It should be understood that in the embodiments of this application, the processor 902 may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0068] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a storage medium, which is a computer-readable storage medium. The computer program is executed by at least one processor in the wireless communication system to implement the process steps of the embodiments of the above methods.

[0069] Therefore, the present invention also provides a storage medium. This storage medium can be a computer-readable storage medium. The storage medium stores a computer program. When executed by a processor, the computer program causes the processor to perform any of the embodiments of the knowledge graph-based named entity recognition method described above.

[0070] The storage medium can be any computer-readable storage medium capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), magnetic disk, or optical disk.

[0071] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, wireless communication software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0072] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of each unit is merely a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.

[0073] The steps in the method of this invention can be adjusted, merged, or reduced in order according to actual needs. The units in the device of this invention can be merged, divided, or reduced according to actual needs. Furthermore, the functional units in the various embodiments of this invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0074] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This wireless communication software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a user wireless communication device, terminal, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.

[0075] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0076] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Since these modifications and variations fall within the scope of the claims and their equivalents, this invention also intends to include these modifications and variations.

[0077] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and such modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A named entity recognition method based on knowledge graphs, characterized in that, include: If the knowledge graph in a specific domain is graph data, then the knowledge graph is exported as text data, and a basic word segmentation dictionary is constructed based on the text data; The basic word segmentation dictionary is augmented with features to obtain a target word segmentation dictionary, and the text data is segmented according to the target word segmentation dictionary to obtain the word segmentation result; Generate sentence feature vectors based on the word segmentation results, the text data, and the pre-set basic semantic word vector table; Based on the preset basic semantic word vector table, each word in the text data is vectorized to obtain a basic semantic vector; Named entity recognition is performed using a classification prediction model and a conditional random field method based on the sentence feature vector and the basic semantic vector. The step of constructing a basic word segmentation dictionary based on the text data includes: The triples in the text data are traversed and split to extract the entity, attribute, and attribute name from the triples; During the extraction process, the entities, attributes, and attribute names are counted and deduplicated to generate a basic word segmentation dictionary, wherein the basic word segmentation dictionary is a list including words, frequencies, types, and lengths; The process of expanding the basic word segmentation dictionary to obtain the target word segmentation dictionary includes: The TF-IDF values ​​of the entity, the attribute, and the attribute name are calculated using the TF-IDF method to obtain the entity TF-IDF, attribute TF-IDF, and attribute name TF-IDF, respectively. The attribute state value is obtained by multiplying the attribute TF-IDF by a preset scaling parameter. Calculate the proportional allocation parameters based on the preset proportional parameters; The entity state value is obtained by calculating the product of the proportional allocation parameter and the entity TF-IDF. The attribute name status value is obtained by calculating the product of the proportional allocation parameter and the attribute name TF-IDF. The attribute status value, the entity status value, and the attribute name status value are added as status values ​​to the basic word segmentation dictionary to obtain the target word segmentation dictionary.

2. The named entity recognition method based on knowledge graphs according to claim 1, characterized in that, The step of segmenting the text data according to the target word segmentation dictionary to obtain the word segmentation result includes: The shortest length in the target word segmentation dictionary is used as the matching length, and words corresponding to the matching length are obtained from the target word segmentation dictionary as words to be matched; Match the words to be matched with the words in the text data; If a match is successful, the words in the text data that match the word to be matched are marked. Increment the matching length by 1, and return to the step of obtaining the word corresponding to the matching length from the target word segmentation dictionary as the word to be matched, until the matching length is greater than the longest length in the target word segmentation dictionary, so as to perform word segmentation on the text data to obtain the word segmentation result.

3. The named entity recognition method based on knowledge graphs according to claim 1, characterized in that, The step of generating sentence feature vectors based on the word segmentation results, the text data, and a pre-set basic semantic word vector table includes: The text data is divided into multiple sentences, and each sentence is processed to obtain a vocabulary. Based on the vocabulary and the word segmentation results corresponding to the sentence, obtain the one-hot code of each word in the sentence, and obtain the positional features of the sentence based on the one-hot code; The sentence feature vector is obtained by multiplying the positional features by the preset basic semantic word vector table.

4. The named entity recognition method based on knowledge graphs according to claim 1, characterized in that, The step of performing named entity recognition based on the sentence feature vector and the basic semantic vector using a classification prediction model and a conditional random field method includes: The sentence feature vector is multiplied by the basic semantic vector to obtain the association matrix vector. The correlation matrix vector is input into the classification prediction model to perform label prediction and generate prediction results; Named entity recognition is performed using the conditional random field method based on the prediction results.

5. The named entity recognition method based on knowledge graphs according to claim 4, characterized in that, The prediction results include pre-defined scores for B-label, I-label, E-label, O-label, and S-label. The process of performing named entity recognition using the conditional random field method based on these pre-defined results includes: The B-state offset probability, I-state offset probability, O-state offset probability, E-state offset probability, and S-state offset probability are obtained by calculating the state and offset of the B-label score, I-label score, E-label score, O-label score, and S-label score using the conditional random field method. The highest probability among the B-state offset probability, the I-state offset probability, the O-state offset probability, the E-state offset probability, and the S-state offset probability is selected as the target result; The target result is decoded to obtain the final label, and the text corresponding to the final label is used as the identified named entity.

6. A named entity recognition device based on knowledge graphs, characterized in that, include: An export building unit is used to export the knowledge graph as text data if the knowledge graph in a specific domain is graph data, and to build a basic word segmentation dictionary based on the text data; An expanded word segmentation unit is used to expand the features of the basic word segmentation dictionary to obtain a target word segmentation dictionary, and to segment the text data according to the target word segmentation dictionary to obtain the word segmentation result; The generation unit is used to generate sentence feature vectors based on the word segmentation results, the text data, and a preset basic semantic word vector table. A vectorization unit is used to vectorize each word in the text data according to the preset basic semantic word vector table to obtain a basic semantic vector. The recognition unit is used to perform named entity recognition based on the sentence feature vector and the basic semantic vector using a classification prediction model and a conditional random field method. The derived building unit includes: The splitting and extraction unit is used to traverse and split the triples in the text data to extract the entity, attribute, and attribute name in the triples. The counting and deduplication unit is used to count and deduplicate the entities, attributes, and attribute names during the extraction process to generate a basic word segmentation dictionary, wherein the basic word segmentation dictionary is a list including words, frequencies, types, and lengths; The expanded term unit includes: The first calculation unit is used to calculate the TF-IDF values ​​of the entity, the attribute, and the attribute name respectively using the TF-IDF method to obtain the entity TF-IDF, the attribute TF-IDF, and the attribute name TF-IDF; The second calculation unit is used to calculate the product of the attribute TF-IDF and the preset ratio parameter to obtain the attribute state value; The third calculation unit is used to calculate the proportional allocation parameters according to the preset proportional parameters; The fourth calculation unit is used to calculate the product of the proportional allocation parameter and the entity TF-IDF to obtain the entity state value; The fifth calculation unit is used to calculate the product of the proportional allocation parameter and the attribute name TF-IDF to obtain the attribute name status value; An adding unit is used to add the attribute status value, the entity status value, and the attribute name status value as status values ​​to the basic word segmentation dictionary to obtain the target word segmentation dictionary.

7. A computer device, characterized in that, The computer device is equipped with a knowledge graph-based named entity recognition system. The computer device includes a memory and a processor. The memory stores a computer program. When the processor executes the computer program, it implements the method as described in any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, The storage medium stores a computer program that, when executed by a processor, can implement the method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Entity recognition model generation method, computing equipment and readable storage medium

    CN113378570A

  • Sequence labeling model training method and device, equipment and storage medium

    CN113408279A