Method and device for identifying named entities

By using a graph neural network model to encode characters in the text, the problem of parallel processing in named entity recognition is solved, and the recognition efficiency and effect are improved.

CN113761917BActive Publication Date: 2025-09-09ALIBABA GROUP HOLDING LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010496481.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-03
Publication Date
2025-09-09
Estimated Expiration
2040-06-03

AI Technical Summary

Technical Problem

Existing named entity recognition technology is based on the temporal sequence of characters, which makes it impossible to process multiple characters in parallel, resulting in low recognition efficiency.

Method used

A graph neural network model is used to encode the characters in the text. The input graph is constructed by obtaining the vectors and association relationships of the characters. The graph neural network model is used for parallel encoding to replace the traditional recursive neural network to achieve parallel processing of characters.

Benefits of technology

It improves the efficiency of named entity recognition, reduces model training and decoding time, and ensures recognition effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113761917B_ABST
    Figure CN113761917B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for identifying named entities. The method comprises: obtaining the vector corresponding to the characters in the text and the association relationship between each character; encoding the vector of the first character and the vector of the second character at least once to obtain the encoding result corresponding to the first character, wherein the first character is any character in the text, and the second character is another character in the text that has an association relationship with the first character; decoding the encoding result of the first character to obtain an identifier corresponding to the first character, wherein the identifier is used to indicate whether the first character is an entity in the text. The present invention solves the technical problem in the prior art that named entity recognition is based on the time sequence of characters, resulting in the inability to perform entity recognition on multiple characters in parallel.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of text processing, and in particular to a method and device for identifying named entities. Background Art

[0002] When building various knowledge bases or top-level services (such as conversation and search), named entity recognition (NER) is required. Currently, NER is typically performed using supervised learning models. This model is learned from manually annotated training data and then used to perform NER on real-world text (called test data).

[0003] Typical supervised models treat input text as a linear, chain-like time series. The model structure generally consists of an encoder and a decoder, with the encoder implemented using a recurrent neural network (RNN, LSTM, GRU, etc.). Due to the sequential nature of the encoder input, each calculation of the output at a position requires the output of the previous position as input. Therefore, the model cannot implement parallel computations. Entity recognition must be performed sequentially according to the order of the characters in the text, resulting in long training and decoding times in practical applications, leading to low named entity recognition efficiency.

[0004] In the prior art, named entity recognition is performed based on the time sequence of characters, which makes it impossible to perform entity recognition on multiple characters in parallel. Currently, no effective solution has been proposed. Summary of the Invention

[0005] The embodiments of the present invention provide a method and apparatus for recognizing named entities, so as to at least solve the technical problem in the prior art that named entity recognition is performed based on the time sequence of characters, resulting in the inability to perform entity recognition on multiple characters in parallel.

[0006] According to one aspect of an embodiment of the present invention, a method for identifying named entities is provided, including: obtaining vectors corresponding to characters in a text and an association relationship between each character; encoding the vector of a first character and the vector of a second character at least once to obtain an encoding result corresponding to the first character, wherein the first character is any character in the text, and the second character is other characters in the text that have an association relationship with the first character; decoding the encoding result of the first character to obtain an identifier corresponding to the first character, wherein the identifier is used to indicate whether the first character is an entity in the text.

[0007] According to another aspect of an embodiment of the present invention, a method for identifying named entities is also provided, including: obtaining the initial vectors corresponding to characters in a text and the association relationship between each character; determining the input graph corresponding to the text based on the initial vectors corresponding to the characters and the association relationship, wherein the nodes of the input graph represent the initial vectors corresponding to the characters, and the directed edges between the nodes are determined according to the order of the characters in the text; performing graph encoding on the characters in the text through a graph neural network model based on the input graph to obtain the encoding result of the characters; decoding the encoding result of the characters to obtain the identifier corresponding to the character, wherein the identifier is used to indicate whether the character is an entity in the text.

[0008] According to another aspect of an embodiment of the present invention, a method for identifying named entities is also provided, including: obtaining a sentence in a text to be identified, the sentence consisting of multiple characters; performing graph modeling on the sentence to obtain a graph structure of the sentence, wherein the graph structure is a structure that models the sentence as a time series; using a graph neural network to encode the graph structure of the sentence to obtain an encoding result for each word in the sentence; decoding the encoding result of each word to obtain a recognition result of the named entity in the sentence, wherein the result of the named entity recognition is used to characterize whether the character is an entity in the sentence.

[0009] According to another aspect of an embodiment of the present invention, a method for identifying named entities is also provided, including: obtaining the initial vectors corresponding to the characters in the text and the association relationship between each character; determining the input graph corresponding to the text based on the initial vectors corresponding to the characters and the association relationship, wherein the nodes of the input graph represent the initial vectors corresponding to the characters, and the directed edges between the nodes are determined according to the order of the characters in the text; performing graph encoding on multiple characters in the text in parallel through a graph neural network model based on the input graph to obtain the encoding results of the characters; decoding the encoding results of the characters to obtain the identifier corresponding to the characters, wherein the identifier is used to indicate whether the character is an entity in the text.

[0010] According to another aspect of an embodiment of the present invention, a method for identifying named entities is also provided, including: receiving an input comment text, and obtaining vectors corresponding to characters in the comment text and the association relationship between each character; encoding the vector of the first character and the vector of the second character at least once to obtain an encoding result corresponding to the first character, wherein the first character is any character in the comment text, and the second character is other characters in the comment text that have an association relationship with the first character; decoding the encoding result of the first character to obtain an identifier corresponding to the first character, wherein the identifier is used to indicate whether the first character is an entity in the comment text; extracting an entity from the comment text according to the identifier, and determining that the extracted entity is the comment subject of the comment text.

[0011] According to another aspect of an embodiment of the present invention, a device for identifying named entities is also provided, including: an acquisition module for acquiring the vectors corresponding to characters in a text and the association relationship between each character; an encoding module for encoding the vector of a first character and the vector of a second character at least once to obtain an encoding result corresponding to the first character, wherein the first character is any character in the text, and the second character is other characters in the text that have an association relationship with the first character; a decoding module for decoding the encoding result of the first character to obtain an identifier corresponding to the first character, wherein the identifier is used to indicate whether the first character is an entity in the text.

[0012] According to another aspect of an embodiment of the present invention, a non-volatile storage medium is further provided, the non-volatile storage medium including a stored program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to perform the following steps: obtaining the vectors corresponding to the characters in the text and the association relationship between each character; encoding the vector of the first character and the vector of the second character at least once to obtain an encoding result corresponding to the first character, wherein the first character is any character in the text, and the second character is other characters in the text that have an association relationship with the first character; decoding the encoding result of the first character to obtain an identifier corresponding to the first character, wherein the identifier is used to indicate whether the first character is an entity in the text.

[0013] According to another aspect of an embodiment of the present invention, a processor is further provided, which is used to run a program, wherein the following steps are performed when the program is running: obtaining the vector corresponding to the characters in the text and the association relationship between each character; encoding the vector of the first character and the vector of the second character at least once to obtain an encoding result corresponding to the first character, wherein the first character is any character in the text, and the second character is other characters in the text that have an association relationship with the first character; decoding the encoding result of the first character to obtain an identifier corresponding to the first character, wherein the identifier is used to indicate whether the first character is an entity in the text.

[0014] In an embodiment of the present invention, the vector corresponding to the character in the text and the association relationship between each character are obtained; the vector of the first character and the vector of the second character are encoded at least once to obtain the encoding result corresponding to the first character, wherein the first character is any character in the text, and the second character is other characters in the text that have an association relationship with the first character; the encoding result of the first character is decoded to obtain an identifier corresponding to the first character, wherein the identifier is used to indicate whether the first character is an entity in the text. The above scheme obtains the encoding result of any character by encoding the vector of any character in the text and the vector of other characters related to the arbitrary character. Since the process only depends on the initial vector of each character in the text and the result of the previous encoding, but not on the encoding result of this encoding, multiple characters in the text can be encoded in parallel, thereby improving the encoding efficiency of the characters, and further improving the efficiency of the entity recognition of the characters, thereby solving the technical problem that the named entity recognition in the prior art is based on the time sequence of the characters, resulting in the inability to perform entity recognition on multiple characters in parallel. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0016] Figure 1 A hardware structure block diagram of a computing device for implementing a method for identifying named entities is shown;

[0017] Figure 2 is a flowchart of a method for identifying named entities according to Example 1 of the present application;

[0018] Figure 3 This is a schematic diagram of a model for named entity recognition based on recursive neural networks;

[0019] Figure 4 yes Figure 3 Schematic diagram of the process of implementing named entity recognition using recurrent neural networks in [1].

[0020] Figure 5 is a schematic diagram of an encoding according to Example 1 of the present application;

[0021] Figure 6 is a schematic diagram of an input graph according to Example 1 of the present application;

[0022] Figure 7 This is an illustration of multiple encoding of an input image according to Embodiment 1 of the present application;

[0023] Figure 8is a flowchart of a method for identifying named entities according to Example 2 of the present application;

[0024] Figure 9 is a schematic diagram of a named entity recognition device according to Example 3 of the present application;

[0025] Figure 10 is a schematic diagram of a named entity recognition device according to Example 4 of the present application; and

[0026] Figure 11 is a structural block diagram of a computing device according to embodiment 5 of the present application;

[0027] Figure 12 is a flowchart of a method for identifying named entities according to Example 7 of the present application;

[0028] Figure 13 is a schematic diagram of a named entity recognition device according to Example 8 of the present application;

[0029] Figure 14 is a flowchart of a method for identifying named entities according to Example 9 of the present application;

[0030] Figure 15 is a schematic diagram of a named entity recognition device according to embodiment 10 of the present application; and

[0031] Figure 16 This is a flowchart of a method for identifying named entities according to Example 11 of the present application. DETAILED DESCRIPTION

[0032] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only 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 making creative efforts should fall within the scope of protection of the present invention.

[0033] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0034] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following interpretations:

[0035] Named entities: words with actual meaning, such as names of people, organizations, places, and all other entities identified by names.

[0036] Named entity recognition: Through automated methods, computers can automatically identify named entities in text.

[0037] Graph: A data structure used to model a set of objects (nodes) and their relationships (edges).

[0038] Graph Neural Networks: Based on deep learning methods, they encode graphs and learn the vector representation of each node in the graph. Recursive Neural Networks: Based on deep learning methods, they encode the data structure of time series.

[0039] Example 1

[0040] According to an embodiment of the present invention, an embodiment of a method for identifying named entities is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0041] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computing device or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computing device for implementing a method for identifying named entities. Figure 1As shown, the computing device 10 may include one or more (illustrated as 102a, 102b, ..., 102n in the figure) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission module 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a power supply and / or a camera. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.

[0042] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuitry." The data processing circuitry may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuitry may be a single, independent processing module, or may be incorporated in whole or in part into any of the other components of the computing device 10. As described in the embodiments of the present application, the data processing circuitry serves as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0043] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the method for identifying named entities in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, realizes the method for identifying named entities of the above-mentioned application. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely located relative to the processor 102, and these remote memories may be connected to the computing device 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0044] The transmission module 106 is configured to receive or send data via a network. A specific example of the aforementioned network may include a wireless network provided by the communications provider of the computing device 10. In one embodiment, the transmission module 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission module 106 may be a radio frequency (RF) module, which is configured to communicate with the Internet wirelessly.

[0045] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of computing device 10 (or mobile device).

[0046] It should be noted that, in some optional embodiments, the above Figure 1 The computing device shown may include hardware elements (including circuits), software elements (including computer code stored on a computer-readable medium), or a combination of both hardware and software elements. Figure 1 This is merely one example of a particular embodiment and is intended to illustrate the types of components that may be present in the computing device described above.

[0047] Under the above operating environment, this application provides Figure 2 The named entity recognition method shown. Figure 2 This is a flowchart of a method for identifying named entities according to Example 1 of the present application.

[0048] Step S21: Obtain the vector corresponding to the characters in the text and the association relationship between each character.

[0049] Specifically, the text above is the text to be subjected to named entity recognition, and can be a sentence within the text to be subjected to named entity recognition. In an optional embodiment, in order to analyze product reviews, the product review text can be collected and entity recognition can be performed on the review text to determine the object discussed in the review. Entity recognition can also be applied to other top-level services, which will not be discussed here.

[0050] The above characters can be Chinese characters, Korean characters, or English words. In the following embodiments, Chinese characters are used as an example. The vectors corresponding to the characters can be vectors corresponding to the characters themselves obtained through methods such as word2vec. The relationship between each character can be reflected by the order of the characters in the text. There is a certain relationship between adjacent characters.

[0051] In an alternative embodiment, taking the text "Men's Basketball's First Game against Tunisia" as an example, among which, there is an association relationship between the character "basketball" and the characters "men" and "first".

[0052] Step S23: Perform at least one encoding on the vector of the first character and the vector of the second character to obtain the encoding result corresponding to the first character, where the first character is any character in the text, and the second character is another character in the text that has an association relationship with the first character.

[0053] The above first character is any character in the text, and the second character is a character that has an association relationship with the first character. Still taking the text "Men's Basketball's First Game against Tunisia" as an example, where when the first character is "basketball", the second characters are "men" and "first".

[0054] In the above solution, the encoding result of the first character in this encoding is determined by encoding the vector of the first character and the vector of the second character. In this process, it can be a process of encoding all characters in the text simultaneously, that is, encoding each character in the text in parallel.

[0055] It should be noted that when encoding the first character, the vectors of the first character and the second character are used, and both the vector of the first character and the vector of the second character can be obtained before this encoding and do not depend on the result of this encoding. Therefore, there is no need to serially encode in the order of characters in the text one by one, and thus it is possible to perform parallel encoding on all characters in the text.

[0056] In an alternative embodiment, if each character in the text is encoded once, the vectors of the first character and the second character used can be vectors obtained by means such as word2vec. If each character in the text is encoded for the Nth time, the vectors of the first character and the second character used when performing the nth (n ≤ N) encoding are the encoding results obtained from the (n - 1)th encoding.

[0057] Step S25: Decode the encoding result of the first character to obtain the identifier corresponding to the first character, where the identifier is used to indicate whether the first character is an entity in the text.

[0058] Specifically, the above identifier can indicate whether the first character is an entity in the text. Further, in the case where the character is an entity, it can also indicate which part (start, inside, end) of the entity the character is, and can identify the type (name, time, etc.) of the entity represented by the character.

[0059] In an optional embodiment, after performing the above encoding and decoding on each character in the text, an identifier corresponding to each character is obtained, and the character is labeled according to the obtained identifier. The identifier consists of a prefix + type. The prefix B indicates that the character is the beginning of an entity, the prefix I indicates that the character is inside an entity, the prefix E indicates that the character is the end of an entity, and the prefix S indicates that the entity is a single word. The type is defined by different data sets and can be time (TIME), place (LOC), name (PER), organization (ORG), or other custom types. Each type set must contain other types (O) to represent characters that are not classified into the predefined entity type set. For example, the sentence "Men's basketball team's first game against Tunisia" is converted into a label sequence of "B-PER E-PER OO B-LOC I-LOC E-LOC".

[0060] It should be noted here that the entity recognition method in the above-mentioned embodiment of the present application can be applied to the identification of e-commerce product-related information, for example, in the identification of product names, names of people, places or drama content in entertainment. The scheme provided in the embodiment of the present application can be used to encode the vector of any character in the relevant information of the above-mentioned e-commerce products and the vector of other characters related to any character to obtain the encoding result of any character. Since this process only depends on the initial vector of each character in the text and the result of the previous encoding, but does not depend on the encoding result of this encoding, multiple characters in the text can be encoded in parallel, thereby improving the encoding efficiency of the characters, and thus improving the efficiency of entity recognition of characters in product information.

[0061] Figure 3 This is a schematic diagram of a model for named entity recognition based on a recursive neural network, combined with Figure 3 As shown in the figure, for each input sentence, time series modeling is first performed on it, that is, the sentence is modeled as a time series structure, and then the time series is encoded using a recursive neural network. The recursive neural network can obtain a vector representation of each word (term) in the sentence, and the vector is input into the decoder to obtain the corresponding output.

[0062] from Figure 3 As can be seen in the figure, the output of each position of the recurrent neural network depends on the input of the current position and the output of the previous position. When the recurrent neural network is LSTM, the process can be done as follows: Figure 4 express, y t =σ(W ′ h t ), where h t-1 Represents the hidden layer output of the previous position, x tRepresents the input at the current position. First, use the current input x of LSTM t And h passed down from the previous state t-1 The splicing training obtains four states z, z f 、z i 、z o , and then use these four states to calculate the current position hidden layer output h t , and the current position output y t This structure shows that it cannot be parallelized, so it is impossible to achieve acceleration by increasing the size of the training machine.

[0063] Although the method of using convolutional neural networks to replace recurrent neural networks can perform processing in parallel, the convolutional neural network has a weak ability to extract local semantic information, which will damage the final entity recognition effect. The solution proposed in the above embodiment of this application can not only solve the problem of difficulty in parallelizing the named entity recognition model, but also ensure the recognition effect.

[0064] The above embodiment of the present application obtains the vector corresponding to the characters in the text and the association relationship between each character; encodes the vector of the first character and the vector of the second character at least once to obtain the encoding result corresponding to the first character, wherein the first character is any character in the text, and the second character is other characters in the text that have an association relationship with the first character; decodes the encoding result of the first character to obtain the identifier corresponding to the first character, wherein the identifier is used to indicate whether the first character is an entity in the text. The above scheme obtains the encoding result of any character by encoding the vector of any character in the text and the vector of other characters related to the arbitrary character. Since the process only depends on the initial vector of each character in the text and the result of the previous encoding, and does not depend on the encoding result of this encoding, multiple characters in the text can be encoded in parallel, thereby improving the encoding efficiency of the characters, and further improving the efficiency of the entity recognition of the characters, thereby solving the technical problem that the named entity recognition in the prior art is based on the time sequence of the characters, resulting in the inability to perform entity recognition on multiple characters in parallel.

[0065] As an optional embodiment, obtaining the vectors corresponding to the characters in the text and the association relationship between each character includes: obtaining the initial vectors of the characters; and determining the association relationship between each character according to the order of the characters in the text.

[0066] Specifically, the initial vector of the above character refers to the vector corresponding to the character itself, that is, the vector that does not depend on other characters. According to the order of characters in the text, adjacent characters are determined, and the adjacent characters are determined to have an associated relationship.

[0067] In an optional embodiment, since the acquisition of the initial vector of a character does not depend on the vectors of other characters, the initial vector of each character in the text can be acquired in parallel.

[0068] As an optional embodiment, after obtaining the vectors corresponding to the characters in the text and the association relationship between each character, the method also includes: obtaining an input graph corresponding to the text, the input graph represents a graph used to input into the encoding layer for encoding, wherein obtaining the input graph corresponding to the text includes: determining that the characters in the text are nodes of the input graph, wherein each node corresponds to a different character; and constructing directed edges between the nodes, wherein the directed edges point from the node of the previous character to the node of the next character.

[0069] In the above steps, taking a sentence as an example, the characters in the text are identified as nodes in the input graph. It's important to note that each node corresponds to a different character. That is, if a text contains multiple identical characters, only one node is created for that character. A directed edge is a directional edge connecting nodes. The directionality of a directed edge can be determined based on the order of the characters in the text.

[0070] Figure 5 is a schematic diagram of an encoding according to Example 1 of the present application, Figure 5 The left side is an input graph, combined with Figure 5 As shown in the figure, taking the text "some country X visits the UK" as an example, the text is graph modeled and six nodes are constructed, representing the characters "some", "country", "X", "visit", "question", and "UK" respectively. Then, the directed edges between the nodes are determined according to the order of the characters in the text, that is, "some" points to "country", "country" points to "X", "X" points to "visit", "visit" points to "question", "question" points to "UK", and "UK" points to "country", thus obtaining the following: Figure 3 The above scheme models the sentence as a graph rather than a time series, thereby achieving parallel encoding of multiple characters.

[0071] As an optional embodiment, the vector of the first character and the vector of the second character are encoded at least once to obtain the encoding result corresponding to the first character, including: inputting the input graph into the graph neural network model, and encoding the first character at least once through the graph neural network model.

[0072] Specifically, the Graph Neural Network Model (GNN) maps the nodes in the input graph to an m-dimensional Euclidean space through a function, and can directly process many applicable types of graphs, such as acyclic graphs, cyclic graphs, directed graphs, and undirected graphs. The above-mentioned graph neural network model can be a combination of any one or more of the following: graph attention mechanism, graph generation network, and graph spatiotemporal network. This application uses a graph neural network structure to replace the original recursive neural network as the encoding layer, which provides the possibility for parallel computing of the model while achieving similar effects to the mainstream model, thereby reducing the model training and decoding time.

[0073] Graph encoding is performed on the input graph. The process is as follows Figure 5 As shown on the right, by Figure 5 Encode each node in the input graph on the left (Encode nodes) and map it in the vector space (embedding space) to obtain the vector representation corresponding to each node.

[0074] As an optional embodiment, the input image is input into the graph neural network model, and the first character is encoded at least once through the graph neural network model, including: obtaining a preset number of encodings; inputting the input image into the graph neural network model, encoding the first character through the graph neural network model, obtaining an intermediate encoding result, and judging whether the number of encodings reaches the preset number of encodings; if the number of encodings reaches the preset number of encodings, determining the intermediate encoding result as the encoding result of the first character, and if the number of encodings does not reach the preset number of encodings, continuing to encode the input image through the graph neural network model.

[0075] Specifically, the above encoding times can be a specified number of times. In an optional embodiment, the above preset encoding times can be set to four times. After each encoding, it is determined whether the preset encoding times have been reached based on the current encoding times, thereby determining whether to continue encoding or directly output the encoding result.

[0076] Taking the preset number of encodings as an example, after the first to third encodings are completed, the number of encodings has not reached the preset number of encodings, so the encoding continues. When the fourth encoding is completed, the number of encodings reaches the preset number of encodings, so the encoding of the text is ended, and the fourth intermediate encoding result is output to the decoder as the encoding result for each character, and the decoder decodes it to perform entity recognition on the text.

[0077] As an optional embodiment, when the first character is encoded for the first time, the vector of the first character is the initial vector corresponding to the first character, and the vector of the second character is the initial vector corresponding to the second character. The initial vector is used to represent the vector corresponding to the character itself.

[0078] In the above scheme, when the first character is encoded for the first time, the initial vector of each character in the text is used for encoding.

[0079] Figure 6 This is a schematic diagram of an input diagram according to Example 1 of the present application, combined with Figure 6 As shown in , when performing the first encoding, we first give each node an initial vector, that is, an initial vector for each text amplitude. This initial vector can be the Word2vec corresponding to the character represented by the node, or other vectors. Then, we use the graph neural network model to calculate the graph encoding of each point, that is, to encode the character corresponding to each node. For example, Figure 6 In the graph, node A is adjacent to nodes B, C, and D. Then the graph encoding vector of node A should be calculated from the initial vectors of nodes A, B, C, and D. The same principle applies to other nodes.

[0080] A single encoding can also be performed to encode characters in a text, thereby enabling entity recognition. However, when encoding a character individually, the encoding result of each character only carries information about adjacent characters, making it difficult to carry information about characters further away, resulting in low accuracy in entity recognition. To ensure that each node carries information about other nodes further away, multiple encodings can be performed to improve entity recognition accuracy.

[0081] As an optional embodiment, the input graph is continued to be encoded through a graph neural network model, including: re-determining the vector corresponding to the first character and the vector corresponding to the second character, wherein the intermediate encoding result obtained by the previous encoding of the first character is determined to be the vector corresponding to the first character during this encoding, and the intermediate encoding result obtained by the previous encoding of the second character is determined to be the vector corresponding to the second character during this encoding; encoding the first character based on the re-determined vector of the first character and the re-determined vector of the second character to obtain the intermediate encoding result of the first character during this encoding.

[0082] In the above scheme, if the first character needs to be further encoded, the intermediate encoding result obtained in the previous encoding can be used as the input of this encoding to update the vector of the first character and the vector of the second character, and the updated vectors can be used for re-encoding.

[0083] Figure 7This is a schematic diagram of encoding an input image multiple times according to Example 1 of the present application, combined with Figure 7 As shown in the figure, if the information of nodes farther away from node A needs to be encoded into A, then the encoding operation is repeated. That is, the first graph encoding vector of A is calculated from the initial vectors A, B, C, and D. When the encoding operation is repeated again, the second graph encoding vector of A is calculated using the first graph encoding vectors of A, B, C, and D. Since the first graph encoding vector of C contains the information of E and F, the second graph encoding vector of A also contains the information of E and F. The encoding process follows the following formula, where t is used to indicate that the current encoding is the tth encoding, and H is used to indicate the hidden layer output of the previous encoding. It is used to represent the input vector of node v during the t-th encoding, ⊙ is used to represent the dot product, Used to represent the update gate (Update Gate), Used to indicate the reset gate. Used to represent the output of the t-th encoding:

[0084]

[0085] Since the graph encoding of each node only depends on the result of the previous encoding, the calculation of each point is independent and parallelizable.

[0086] As an optional embodiment, decoding the encoding result of the first character to obtain the identifier corresponding to the first character includes: performing conditional random field decoding on the encoding result of the first character to obtain the identifier corresponding to the first character.

[0087] Specifically, conditional random field (CRF) is a discriminant probability model and a type of random field. It uses the conditional probability distribution model P(Y|X) to represent the Markov random field of another set of output random variables Y under the condition of a given set of input random variables X. In other words, the characteristic of CRF is that it assumes that the output random field variables constitute a Markov random field.

[0088] It should be noted that for the aforementioned method embodiments, for simplicity of description, they are all expressed as a series of action combinations. However, those skilled in the art should be aware that the present invention is not limited by the order of the actions described, because according to the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.

[0089] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present invention, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a non-volatile storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to enable a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of various embodiments of the present invention.

[0090] Embodiment 2

[0091] According to an embodiment of the present invention, a method for identifying named entities is further provided. Figure 8 is a flowchart of a method for identifying named entities according to Embodiment 2 of the present application, as Figure 8 shown, the method includes:

[0092] Step S81, obtain the initial vector corresponding to the characters in the text and the association relationship between each character.

[0093] Specifically, the above text is the text to be identified for named entities, and can be a sentence in the text to be identified for entities. In an optional embodiment, in order to analyze the comments on a commodity, the comment text of the commodity can be collected, and entity recognition is performed on the comment text to determine the object discussed in the comment. Entity recognition can also be applied to other top-level services, which will not be elaborated here.

[0094] The vector corresponding to the above characters can be the vector corresponding to the characters themselves obtained by means of word2vec, etc. The association relationship between each character can be reflected by the arrangement order of the characters in the text, and there is a certain association relationship between adjacent characters.

[0095] In an optional embodiment, taking the text "The men's basketball team's first game against Tunisia" as an example, among them, the character "basketball" has an association relationship with "men" and "first".

[0096] Step S83, determine the input graph corresponding to the text according to the initial vector corresponding to the characters and the association relationship. Among them, the nodes of the input graph represent the initial vectors corresponding to the characters, and the directed edges between the nodes are determined according to the order of the characters in the text.

[0097] In the above steps, taking a sentence as an example, the characters in the text are identified as nodes in the input graph. It's important to note that each node corresponds to a different character. That is, if a text contains multiple identical characters, only one node is created for that character. A directed edge is a directional edge connecting nodes. The directionality of a directed edge can be determined based on the order of the characters in the text.

[0098] Figure 5 This is a schematic diagram of an input diagram according to Example 1 of the present application, combined with Figure 5 As shown, for the text "Some country X visits the UK" as an example, six nodes are constructed, representing the characters "some", "country", "X", "visit", "question", and "UK", respectively. Then, the directed edges between the nodes are determined according to the order of the characters in the text, that is, "some" points to "country", "country" points to "X", "X" points to "visit", "visit" points to "question", "question" points to "UK", and "UK" points to "country", thus obtaining the following: Figure 3 The above scheme models the sentence as a graph rather than a time series, thereby achieving parallel encoding of multiple characters.

[0099] Step S85: Graph encoding is performed on the characters in the text based on the input graph through a graph neural network model to obtain the encoding results of the characters.

[0100] Specifically, the Graph Neural Network Model (GNN) maps the nodes in the input graph to an m-dimensional Euclidean space through a function, and can directly perform graph encoding based on many types of graphs, such as acyclic graphs, cyclic graphs, directed graphs, and undirected graphs. The above-mentioned graph neural network model can be a combination of any one or more of the following: graph attention mechanism, graph generation network, and graph spatiotemporal network. This application uses a graph neural network structure to replace the original recursive neural network as the encoding layer, which provides the possibility for parallel computing of the model while achieving similar effects to the mainstream model, thereby reducing the model training and decoding time.

[0101] Step S87: Decode the encoding result of the character to obtain an identifier corresponding to the character, wherein the identifier is used to indicate whether the character is an entity in the text.

[0102] Specifically, the above-mentioned identifier can indicate whether the first character is an entity in the text. Furthermore, if the character is an entity, it can also indicate which step of the entity the character is in (start, inside, end), and can identify the type of entity represented by the character (name, time, etc.).

[0103] This application uses a graph neural network structure to replace the original recursive neural network as the encoding layer, which not only achieves effects similar to mainstream models but also provides the possibility for parallel computing of the model, thereby reducing the model training and decoding time.

[0104] As an optional embodiment, graph encoding is performed on characters in the text through a graph neural network model based on the input graph to obtain character encoding results, including: parallel encoding of multiple characters in the text through a graph neural network model based on the input graph to obtain character encoding results.

[0105] Since the graph neural network structure used encodes the input graph corresponding to the text, it can achieve the encoding effect. Therefore, in order to improve the encoding efficiency, multiple characters in the text can be encoded in parallel through the graph neural network model based on the input graph to obtain the character encoding results.

[0106] As an optional embodiment, multiple characters in the text are encoded in parallel through a graph neural network model based on the input graph to obtain character encoding results, including: first parallel encoding of multiple characters in the text through a graph neural network model based on the input graph to obtain a first encoding result of the character; updating the input graph according to the first encoding result to obtain an updated input graph; and parallel encoding of multiple characters in the text through a graph neural network model based on the updated input graph to obtain a second encoding result of the character.

[0107] In the above scheme, if the preset number of encodings is two, the second encoding result can be used as the final encoding result. If the preset number of encodings is greater than two, the character vector needs to be updated in the same way to continue encoding.

[0108] Combine Figure 6 , when performing the first encoding, first give each node an initial vector, that is, an initial vector for each text amplitude. This initial vector can be the Word2vec corresponding to the character represented by the node, or other. Then, use the graph neural network model to calculate the graph encoding of each point respectively, that is, to realize the encoding of the character corresponding to each node. For example, Figure 6 In the graph, node A is adjacent to nodes B, C, and D. Then the graph encoding vector of node A should be calculated from the initial vectors of nodes A, B, C, and D. The same principle applies to other nodes.

[0109] Recombination Figure 7As shown in the figure, if the information of nodes farther away from node A needs to be encoded into A, then the encoding operation is repeated. That is, the first graph encoding vector of A is calculated using the initial vectors A, B, C, and D. When the encoding operation is repeated again, the second graph encoding vector of A is calculated using the first graph encoding vectors A, B, C, and D. Since the first graph encoding vector of C contains the information of E and F, the second graph encoding vector of A also contains the information of E and F.

[0110] As an optional embodiment, the input graph is updated according to the first encoding result to obtain an updated input graph, including: maintaining the directed edges in the input graph, and using the first encoding result to update the nodes in the input graph to obtain the updated input graph.

[0111] Example 3

[0112] According to an embodiment of the present invention, a named entity recognition device for implementing the named entity recognition method in embodiment 1 is also provided. Figure 9 is a schematic diagram of a named entity recognition device according to Example 3 of the present application, such as Figure 9 As shown, the apparatus 900 includes:

[0113] The acquisition module 902 is used to acquire the vectors corresponding to the characters in the text and the association relationship between each character.

[0114] The encoding module 904 is used to encode the vector of the first character and the vector of the second character at least once to obtain an encoding result corresponding to the first character, wherein the first character is any character in the text, and the second character is other characters in the text that have an associated relationship with the first character.

[0115] The decoding module 906 is configured to decode the encoding result of the first character to obtain an identifier corresponding to the first character, wherein the identifier is used to indicate whether the first character is an entity in the text.

[0116] It should be noted that the acquisition module 902, encoding module 904, and decoding module 906 correspond to steps S21 to S25 in Example 1. The examples and application scenarios implemented by the three modules and the corresponding steps are the same, but are not limited to the contents disclosed in Example 1. It should be noted that the above modules, as part of the apparatus, can be run in the computing device 10 provided in Example 1.

[0117] As an optional embodiment, the acquisition module includes: an acquisition submodule, used to obtain the initial vector of the character; and a first determination submodule, used to determine the association relationship between each character according to the order of the characters in the text.

[0118] As an optional embodiment, the above-mentioned device also includes: an input graph acquisition module, which is used to obtain the input graph corresponding to the text after obtaining the vector corresponding to the characters in the text and the association relationship between each character, and the input graph represents the graph used to be input to the encoding layer for encoding, wherein the input graph acquisition module includes: a second determination submodule, which is used to determine that the characters in the text are nodes of the input graph, wherein the characters corresponding to each node are different; a construction submodule, which is used to construct directed edges between nodes, wherein the directed edges are from the node of the previous character to the node of the next character.

[0119] As an optional embodiment, the encoding module includes: an encoding submodule, used to input the input graph into the graph neural network model, and encode the first character at least once through the graph neural network model.

[0120] As an optional embodiment, the encoding submodule includes: an acquisition unit for acquiring a preset number of encodings; an input unit for inputting the input graph into the graph neural network model, encoding the first character through the graph neural network model, obtaining an intermediate encoding result, and judging whether the number of encodings reaches the preset number of encodings; a determination unit for determining that the intermediate encoding result is the encoding result of the first character if the number of encodings reaches the preset number of encodings, and continuing to encode the input graph through the graph neural network model if the number of encodings does not reach the preset number of encodings.

[0121] As an optional embodiment, when the first character is encoded for the first time, the vector of the first character is the initial vector corresponding to the first character, and the vector of the second character is the initial vector corresponding to the second character. The initial vector is used to represent the vector corresponding to the character itself.

[0122] As an optional embodiment, the determination unit includes: a determination subunit, used to re-determine the vector corresponding to the first character and the vector corresponding to the second character, wherein the intermediate encoding result obtained by the previous encoding of the first character is determined to be the vector corresponding to the first character during this encoding, and the intermediate encoding result obtained by the previous encoding of the second character is determined to be the vector corresponding to the second character during this encoding; an encoding subunit, used to encode the first character based on the re-determined vector of the first character and the re-determined vector of the second character, and obtain the intermediate encoding result of the first character during this encoding.

[0123] As an optional embodiment, the decoding module includes: a decoding submodule, configured to perform conditional random field decoding on the encoding result of the first character to obtain an identifier corresponding to the first character.

[0124] Example 4

[0125] According to an embodiment of the present invention, a named entity recognition device for implementing the named entity recognition method in embodiment 2 is also provided. Figure 10 is a schematic diagram of a named entity recognition device according to Example 4 of the present application, such as Figure 10 As shown, the device 1000 includes:

[0126] An acquisition module 1002 is used to acquire an initial vector corresponding to a character in a text and an association relationship between each character;

[0127] Determining module 1004, configured to determine an input graph corresponding to the text based on the initial vectors corresponding to the characters and the association relationships, wherein the nodes of the input graph represent the initial vectors corresponding to the characters, and the directed edges between the nodes are determined based on the order of the characters in the text;

[0128] An encoding module 1006 is configured to perform graph encoding on characters in the text based on the input graph using a graph neural network model to obtain encoding results of the characters;

[0129] The decoding module 1008 is used to decode the encoding result of the character to obtain an identifier corresponding to the character, wherein the identifier is used to indicate whether the character is an entity in the text.

[0130] It should be noted that the acquisition module 1002, determination module 1004, encoding module 1006, and decoding module 1008 described above correspond to steps S81 to S87 in Example 2. The examples and application scenarios implemented by the four modules and the corresponding steps are the same, but are not limited to the contents disclosed in Example 1. It should be noted that the above modules, as part of the apparatus, can be run in the computing device 10 provided in Example 1.

[0131] As an optional embodiment, the encoding module includes: a parallel encoding submodule, which is used to parallel encode multiple characters in the text through a graph neural network model based on the input graph to obtain character encoding results.

[0132] As an optional embodiment, the parallel encoding submodule includes: a first encoding unit, which is used to perform a first parallel encoding on multiple characters in the text based on the input graph through a graph neural network model to obtain a first encoding result of the character; an updating unit, which is used to update the input graph according to the first encoding result to obtain an updated input graph; and a second encoding unit, which is used to perform a parallel encoding on multiple characters in the text based on the updated input graph through a graph neural network model to obtain a second encoding result of the character.

[0133] As an optional embodiment, the updating unit includes: an updating subunit, configured to maintain directed edges in the input graph and update nodes in the input graph using the first encoding result to obtain an updated input graph.

[0134] Example 5

[0135] The embodiment of the present invention may provide a computing device, which may be any computing device in a computing device group. Optionally, in this embodiment, the computing device may also be replaced by a terminal device such as a mobile terminal.

[0136] Optionally, in this embodiment, the computing device may be located in at least one network device among a plurality of network devices of a computer network.

[0137] In this embodiment, the above-mentioned computing device can execute the program code of the following steps in the method for identifying named entities: obtaining the vectors corresponding to the characters in the text and the association relationship between each character; encoding the vector of the first character and the vector of the second character at least once to obtain the encoding result corresponding to the first character, wherein the first character is any character in the text, and the second character is other characters in the text that have an association relationship with the first character; decoding the encoding result of the first character to obtain the identifier corresponding to the first character, wherein the identifier is used to indicate whether the first character is an entity in the text.

[0138] Optionally, Figure 11 This is a structural block diagram of a computing device according to embodiment 5 of the present application. Figure 11 As shown, the computing device A may include: one or more (only one is shown in the figure) processors 1102 , a memory 1104 , and a peripheral interface 1106 .

[0139] Among them, the memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the method and device for identifying named entities in the embodiments of the present invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the above-mentioned entity identification method. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories can be connected to the terminal A via a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network and a combination thereof.

[0140] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: obtain the vector corresponding to the characters in the text and the association relationship between each character; encode the vector of the first character and the vector of the second character at least once to obtain the encoding result corresponding to the first character, wherein the first character is any character in the text, and the second character is other characters in the text that have an association relationship with the first character; decode the encoding result of the first character to obtain the identifier corresponding to the first character, wherein the identifier is used to indicate whether the first character is an entity in the text.

[0141] Optionally, the processor may further execute program code of the following steps: obtaining an initial vector of a character; and determining an association relationship between each character according to the order of the characters in the text.

[0142] Optionally, the processor may also execute the following program code: after obtaining the vectors corresponding to the characters in the text and the association relationship between each character, obtaining the input graph corresponding to the text, the input graph representing the graph used to be input to the encoding layer for encoding, wherein obtaining the input graph corresponding to the text includes: determining that the characters in the text are nodes of the input graph, wherein each node corresponds to a different character; and constructing directed edges between the nodes, wherein the directed edges point from the node of the previous character to the node of the next character.

[0143] Optionally, the processor may also execute the program code of the following steps: inputting the input graph into the graph neural network model, and encoding the first character at least once through the graph neural network model.

[0144] Optionally, the above-mentioned processor can also execute the program code of the following steps: obtaining a preset number of encodings; inputting the input graph into the graph neural network model, encoding the first character through the graph neural network model, obtaining an intermediate encoding result, and judging whether the number of encodings reaches the preset number of encodings; if the number of encodings reaches the preset number of encodings, determining the intermediate encoding result as the encoding result of the first character; if the number of encodings does not reach the preset number of encodings, continuing to encode the input graph through the graph neural network model.

[0145] Optionally, when the first character is encoded for the first time, the vector of the first character is the initial vector corresponding to the first character, and the vector of the second character is the initial vector corresponding to the second character. The initial vector is used to represent the vector corresponding to the character itself.

[0146] Optionally, the processor may also execute the program code of the following steps: re-determining the vector corresponding to the first character and the vector corresponding to the second character, wherein the intermediate encoding result obtained by the previous encoding of the first character is determined to be the vector corresponding to the first character during this encoding, and the intermediate encoding result obtained by the previous encoding of the second character is determined to be the vector corresponding to the second character during this encoding; encoding the first character based on the re-determined vector of the first character and the re-determined vector of the second character to obtain the intermediate encoding result of the first character during this encoding.

[0147] Optionally, the processor may further execute program code of the following steps: performing conditional random field decoding on the encoding result of the first character to obtain an identifier corresponding to the first character.

[0148] According to an embodiment of the present invention, a solution for identifying named entities is provided. By obtaining the vector corresponding to the characters in the text and the association relationship between each character; encoding the vector of the first character and the vector of the second character at least once, an encoding result corresponding to the first character is obtained, wherein the first character is any character in the text, and the second character is other characters in the text that have an association relationship with the first character; decoding the encoding result of the first character, an identifier corresponding to the first character is obtained, wherein the identifier is used to indicate whether the first character is an entity in the text. The above scheme encodes the vector of any character in the text and the vector of other characters related to the arbitrary character to obtain the encoding result of any character. Since the process only depends on the initial vector of each character in the text and the result of the previous encoding, but not on the encoding result of this encoding, multiple characters in the text can be encoded in parallel, thereby improving the encoding efficiency of the characters, and further improving the efficiency of the entity recognition of the characters, thereby solving the technical problem that the named entity recognition in the prior art is based on the time sequence of the characters, resulting in the inability to perform entity recognition on multiple characters in parallel.

[0149] It can be understood by those skilled in the art that Figure 11 The structure shown is for illustration only, and the computing device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a handheld computer, a mobile Internet device (MID), a PAD, or other terminal devices. Figure 11 It does not limit the structure of the above electronic device. For example, the computing device A may also include Figure 11 More or fewer components (such as network interfaces, display devices, etc.) shown in, or with Figure 11 Different configurations shown.

[0150] A person skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable non-volatile storage medium. The non-volatile storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0151] Example 6

[0152] The embodiment of the present invention further provides a non-volatile storage medium. Optionally, in this embodiment, the non-volatile storage medium can be used to store the program code executed by the method for identifying named entities provided in the first embodiment.

[0153] Optionally, in this embodiment, the non-volatile storage medium may be located in any one of the computing devices in the computing device group in the computer network, or in any one of the mobile terminals in the mobile terminal group.

[0154] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: obtaining the vectors corresponding to the characters in the text and the association relationship between each character; encoding the vector of the first character and the vector of the second character at least once to obtain the encoding result corresponding to the first character, wherein the first character is any character in the text, and the second character is other characters in the text that have an association relationship with the first character; decoding the encoding result of the first character to obtain an identifier corresponding to the first character, wherein the identifier is used to indicate whether the first character is an entity in the text.

[0155] Example 7

[0156] According to an embodiment of the present invention, a method for identifying a named entity is also provided. Figure 12 is a flowchart of a method for identifying named entities according to Example 7 of the present application, such as Figure 12 As shown, the method includes:

[0157] Step S1201: Obtain the initial vector corresponding to the characters in the text and the association relationship between each character.

[0158] Specifically, the text above is the text to be subjected to named entity recognition, and can be a sentence within the text to be subjected to named entity recognition. In an optional embodiment, in order to analyze product reviews, the product review text can be collected and entity recognition can be performed on the review text to determine the object discussed in the review. Entity recognition can also be applied to other top-level services, which will not be discussed here.

[0159] The vectors corresponding to the above characters can be the vectors corresponding to the characters themselves obtained by means such as word2vec. The association relationship between each character can be reflected by the arrangement order of the characters in the text, and there is a certain association relationship between adjacent characters.

[0160] In an optional embodiment, taking the text "Men's basketball team's first game against Tunisia" as an example, among them, there is an association relationship between the character "basketball" and "men" and "first".

[0161] Step S1203, determine the input graph corresponding to the text according to the initial vector corresponding to the character and the association relationship. Among them, the nodes of the input graph represent the initial vectors corresponding to the characters, and the directed edges between the nodes are determined according to the order of the characters in the text.

[0162] In the above step, taking the text as a sentence as an example, determine the characters in the text as the nodes of the input graph. It should be noted that the characters corresponding to each node are different. That is, when there are multiple identical characters in a text, only one node is created for that character. The directed edge is a variable with a direction used to connect nodes, and the directivity of the directed edge can be determined according to the order of the characters in the text.

[0163] Still combined with Figure 5 As shown, taking the text "Country X visits the UK" as an example, the six nodes constructed here respectively represent the characters "a certain", "country", "X", "visit", "ask", "UK". Then, determine the directed edges between the nodes according to the order of the characters in the text, that is, "a certain" points to "country", "country" points to "X", "X" points to "visit", "visit" points to "ask", "ask" points to "UK", and "UK" points to "country", so as to obtain the input graph as shown in [[ID=?]] Figure 3 As shown. The above solution models the sentence as a graph rather than a time series, thereby realizing parallel encoding of multiple characters.

[0164] Step S1205, based on the input graph, perform graph encoding on multiple characters in the text in parallel through a graph neural network model to obtain the encoding results of the characters.

[0165] Specifically, the Graph Neural Network Model (GNN) maps the nodes in the input graph to an m-dimensional Euclidean space through a function, and can directly perform graph encoding based on many types of graphs, such as acyclic graphs, cyclic graphs, directed graphs, and undirected graphs. The above-mentioned graph neural network model can be a combination of any one or more of the following: graph attention mechanism, graph generation network, and graph spatiotemporal network. The present application uses a graph neural network structure to replace the original recursive neural network as the encoding layer, while achieving an effect similar to that of the mainstream model, and provides the possibility for parallel computing of the model, so that the above-mentioned scheme can perform graph encoding on multiple characters in the text in parallel, thereby achieving the purpose of reducing model training and decoding time.

[0166] Step S1207: decode the encoding result of the character to obtain an identifier corresponding to the character, wherein the identifier is used to indicate whether the character is an entity in the text.

[0167] Specifically, the above-mentioned identifier can indicate whether the first character is an entity in the text. Furthermore, if the character is an entity, it can also indicate which step of the entity the character is in (start, inside, end), and can identify the type of entity represented by the character (name, time, etc.).

[0168] This application uses a graph neural network structure to replace the original recursive neural network as the encoding layer, achieving similar results to mainstream models while providing the possibility of parallel computing of the model, thereby achieving the goal of reducing model training and decoding time. And because the graph neural network structure used performs parallel graph encoding on the input graph corresponding to the text, it is possible to encode multiple characters in the text in parallel based on the input graph through the graph neural network model, thereby achieving the effect of improving encoding efficiency.

[0169] It should be noted that the solution of the above-mentioned embodiment 7 of the present application can also execute other steps of the entity identification method in embodiment 1 and embodiment 2 when there is no conflict, which will not be repeated here.

[0170] Example 8

[0171] According to an embodiment of the present invention, a named entity recognition device for implementing the named entity recognition method in Example 7 is also provided. Figure 13 is a schematic diagram of a named entity recognition device according to Example 8 of the present application, such as Figure 13 As shown, the apparatus 1300 includes:

[0172] An acquisition module 1302 is used to acquire an initial vector corresponding to a character in the text and an association relationship between each character;

[0173] Determining module 1304, configured to determine an input graph corresponding to the text based on the initial vectors corresponding to the characters and the association relationships, wherein the nodes of the input graph represent the initial vectors corresponding to the characters, and the directed edges between the nodes are determined based on the order of the characters in the text;

[0174] A parallel encoding module 1306 is configured to perform graph encoding on multiple characters in the text in parallel using a graph neural network model based on the input graph to obtain encoding results of the characters;

[0175] The decoding module 1308 is used to decode the encoding result of the character to obtain an identifier corresponding to the character, wherein the identifier is used to indicate whether the character is an entity in the text.

[0176] It should be noted that the acquisition module 1302, determination module 1304, parallel encoding module 1306, and decoding module 1308 correspond to steps S1201 to S1207 in Example 7. The examples and application scenarios implemented by the three modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned Example 1. It should be noted that the above-mentioned modules, as part of the apparatus, can be run in the computing device 10 provided in Example 1.

[0177] Example 9

[0178] According to an embodiment of the present invention, a method for identifying a named entity is also provided. Figure 14 is a flowchart of a method for identifying named entities according to Example 9 of the present application, such as Figure 14 As shown, the method includes:

[0179] Step S1401: receiving an input comment text, and obtaining vectors corresponding to characters in the comment text and the association relationship between each character.

[0180] The aforementioned comment text may be a comment on an e-commerce platform. In an optional embodiment, in order to centrally analyze user comments, comment text may be collected from the e-commerce platform and input into a device for performing an entity recognition method. The device receives the input comment text and obtains vectors corresponding to characters in the comment text and the association relationship between each character.

[0181] The above characters can be Chinese characters, Korean characters, or English words. In the following embodiments, Chinese characters are used as an example. The vectors corresponding to the characters can be vectors corresponding to the characters themselves obtained through methods such as word2vec. The relationship between each character can be reflected by the order of the characters in the text. There is a certain relationship between adjacent characters.

[0182] Step S1403: Encode the vector of the first character and the vector of the second character at least once to obtain an encoding result corresponding to the first character, wherein the first character is any character in the comment text, and the second character is other characters in the comment text that are associated with the first character.

[0183] In the above steps, taking the comment text as a sentence as an example, the characters in the comment text are determined as nodes in the input graph. It is important to note that each node corresponds to a different character. That is, if a comment text includes multiple identical characters, only one node is created for each character. A directed edge is a variable with a direction used to connect nodes. The directionality of a directed edge can be determined by the order of the characters in the comment text.

[0184] Step S1405 : Decode the encoding result of the first character to obtain an identifier corresponding to the first character, wherein the identifier is used to indicate whether the first character is an entity in the comment text.

[0185] Specifically, the Graph Neural Network Model (GNN) maps the nodes in the input graph to an m-dimensional Euclidean space through a function, and can directly perform graph encoding based on many types of graphs, such as acyclic graphs, cyclic graphs, directed graphs, and undirected graphs. The above-mentioned graph neural network model can be a combination of any one or more of the following: graph attention mechanism, graph generation network, and graph spatiotemporal network. This application uses a graph neural network structure to replace the original recursive neural network as the encoding layer, while achieving an effect similar to that of the mainstream model, and provides the possibility of parallel computing of the model, so that the above-mentioned scheme can perform graph encoding on multiple characters in the comment text in parallel, thereby achieving the purpose of reducing model training and decoding time.

[0186] Step S1407: extracting entities from the comment text according to the identifier, and determining the extracted entities as the comment subject of the comment text.

[0187] Specifically, the identifier can indicate whether the first character is an entity in the comment text, so that the entity of the comment text can be extracted based on the identifier of each character in the comment text. For the comment text, the entity it contains is the object of its evaluation, that is, the subject of the comment.

[0188] In an alternative embodiment, for example, consider the review text "YouXni has better water absorption than HuaX, but is also more expensive than HuaX." Using the aforementioned identification method, it can be determined that the entities in the review text include "YouXni" and "HuaX." Therefore, the review subjects can be determined to be "YouXni" and "HuaX." After identifying the review subjects, sentiment analysis can be performed on the review text to determine the user's emotional inclination toward the product.

[0189] Furthermore, when a character is an entity, it can also indicate which step of the entity the character is in (start, inside, end), and can identify the type of entity represented by the character (name, time, etc.).

[0190] This application uses a graph neural network structure to replace the original recursive neural network as the encoding layer, achieving similar results to mainstream models while providing the possibility of parallel computing of the model, thereby achieving the goal of reducing model training and decoding time. And because the graph neural network structure used performs parallel graph encoding on the input graph corresponding to the text, it is possible to encode multiple characters in the text in parallel based on the input graph through the graph neural network model, thereby achieving the effect of improving encoding efficiency.

[0191] It should be noted that the solution of the above-mentioned embodiment 9 of the present application can also execute other steps of the entity identification method in embodiment 1 and embodiment 2 when there is no conflict, which will not be repeated here.

[0192] Example 10

[0193] According to an embodiment of the present invention, a named entity recognition device for implementing the named entity recognition method in Example 9 is also provided. Figure 15 is a schematic diagram of a named entity recognition device according to Example 10 of the present application, such as Figure 15 As shown, the apparatus 1500 includes:

[0194] The receiving module 1502 is configured to receive an input comment text and obtain vectors corresponding to characters in the comment text and the association relationship between each character.

[0195] The encoding module 1504 is used to encode the vector of the first character and the vector of the second character at least once to obtain the encoding result corresponding to the first character, wherein the first character is any character in the comment text, and the second character is other characters in the comment text that have an association relationship with the first character.

[0196] A decoding module 1506 is configured to decode the encoding result of the first character to obtain an identifier corresponding to the first character, wherein the identifier is used to indicate whether the first character is an entity in the comment text;

[0197] The determination module 1508 is configured to extract entities from the comment text according to the identifiers, and determine that the extracted entities are the comment subjects of the comment text.

[0198] It should be noted that the receiving module 1502, encoding module 1504, decoding module 1506, and determination module 1508 described above correspond to steps S1401 to S1407 in Example 9. The examples and application scenarios implemented by the three modules and the corresponding steps are the same, but are not limited to the contents disclosed in Example 1. It should be noted that the above modules, as part of the apparatus, can be run in the computing device 10 provided in Example 1.

[0199] Example 11

[0200] According to an embodiment of the present invention, a method for identifying a named entity is also provided. Figure 16 is a flowchart of a method for identifying named entities according to Example 11 of the present application, such as Figure 16 As shown, the method for named entity recognition may include the following implementation steps:

[0201] Step S1601: Acquire a sentence in the text to be recognized, where the sentence consists of multiple characters.

[0202] The above-mentioned text to be recognized is the text to be subjected to named entity recognition, and the obtained sentence can be any sentence in the text to be subjected to named entity recognition. The following takes the application scenario of an e-commerce platform as an example, and the comments in the e-commerce platform are used as the text to be recognized as an application example. In an optional embodiment, in order to conduct a centralized analysis of user comments, the comment text can be collected from the e-commerce platform and input into a device for executing the entity recognition method. The device receives the input comment text and extracts sentences in the comment text as the basis for analysis.

[0203] It should be noted that the characters that make up the above sentence can be characters of different languages, such as Chinese characters, Korean characters, or English words. The following embodiments use Chinese characters as an example. The vectors corresponding to the characters can be vectors corresponding to the characters themselves obtained through methods such as word2vec. The relationship between each character can be reflected by the order of the characters in the text, and adjacent characters have a certain relationship.

[0204] Step S1603 , graph modeling is performed on the sentence to obtain a graph structure of the sentence, wherein the graph structure is a structure in which the sentence is modeled as a time series.

[0205] In the above steps, taking the comment text as a sentence as an example, the characters in the comment text sentence are arranged in a predetermined order, for example, the sentence is modeled as a time series, and these characters and the relationship between the characters constitute the graph structure of the sentence, wherein, when the graph structure is an input graph, the above characters can be nodes of the input graph. It should be noted that the characters corresponding to each node can be different, that is, when a comment text includes multiple identical characters, only one node is created for the character. A directed edge is an edge with a direction for connecting nodes, and the directionality of the directed edge can be determined according to the order of the characters in the comment text.

[0206] Step S1605: Use a graph neural network to encode the graph structure of the sentence to obtain the encoding result of each word in the sentence.

[0207] Specifically, the above-mentioned graph neural network model (GNN) maps the nodes in the input graph to an m-dimensional Euclidean space through a function, and can directly perform graph encoding based on many types of graphs, such as acyclic graphs, cyclic graphs, directed graphs, and undirected graphs. The above-mentioned graph neural network model can be a combination of any one or more of the following: graph attention mechanism, graph generation network, and graph spatiotemporal network. The present application uses a graph neural network structure to replace the original recursive neural network as the encoding layer, while achieving an effect similar to that of the mainstream model, and provides the possibility of parallel computing of the model, so that the above-mentioned scheme can perform graph encoding on multiple characters in the comment text in parallel, thereby achieving the purpose of reducing the model training and decoding time.

[0208] Step S1607 : decoding the encoding result of each word to obtain a recognition result of a named entity in the sentence, wherein the result of the named entity recognition is used to indicate whether the character is an entity in the sentence.

[0209] Specifically, the identifier can indicate whether the first character is an entity in the comment text, so that the entity of the comment text can be extracted based on the identifier of each character in the comment text. For the comment text, the entity it contains is the object of its evaluation, that is, the subject of the comment.

[0210] In an alternative embodiment, for example, consider the review text "YouXni has better water absorption than HuaX, but is also more expensive than HuaX." Using the aforementioned identification method, it can be determined that the entities in the review text include "YouXni" and "HuaX." Therefore, the review subjects can be determined to be "YouXni" and "HuaX." After identifying the review subjects, sentiment analysis can be performed on the review text to determine the user's emotional inclination toward the product.

[0211] This application uses a graph neural network structure to replace the original recursive neural network as the encoding layer, achieving similar results to mainstream models while providing the possibility of parallel computing of the model, thereby achieving the goal of reducing model training and decoding time. And because the graph neural network structure used performs parallel graph encoding on the input graph corresponding to the text, it is possible to encode multiple characters in the text in parallel based on the input graph through the graph neural network model, thereby achieving the effect of improving encoding efficiency.

[0212] In an optional embodiment, in the step S1605 above, the step of graph modeling the sentence to obtain the graph structure of the sentence can be implemented by the following optional solution:

[0213] Step S16051, obtain the vector of each character in the sentence.

[0214] Step S16053: Determine the association relationship between each character based on the sequence relationship between each character in the text.

[0215] Step S16055: Based on the vector of each character in the text and the association relationship between each character, a graph structure of the sentence is generated, wherein each character is a node on the graph structure, and the sequential relationship between each character serves as a directed edge between each node in the graph structure.

[0216] In the above embodiment, Chinese characters are used as an example for illustration. The vector corresponding to the character can be the vector corresponding to the character itself obtained through word2vec or other methods. The association relationship between each character can be reflected by the arrangement order of the characters in the text. There is a certain association relationship between adjacent characters.

[0217] by Figure 5 For example, the input graph provided here is a schematic diagram of the graph structure obtained by graph modeling of sentences. Figure 5 As shown in the figure, for the text "Some country X visits the UK," six nodes are constructed, representing the characters "Some," "Country," "X," "Visit," "Question," and "UK," respectively. Directed edges between the nodes are then determined based on the order of the characters in the text: "Some" points to "Country," "Country" points to "X," "X" points to "Visit," "Visit" points to "Question," "Question" points to "UK," and "UK" points to "Country," thus forming the modeled graph structure. This approach models sentences as a graph structure rather than a time series, enabling parallel encoding of multiple characters.

[0218] As an optional embodiment, how to obtain the vectors corresponding to the characters in the text and the association relationship between each character can be achieved through the following optional scheme: obtaining the initial vectors of the characters; determining the association relationship between each character according to the order of the characters in the text.

[0219] Specifically, the initial vector of the above character refers to the vector corresponding to the character itself, that is, the vector that does not depend on other characters. According to the order of characters in the text, adjacent characters are determined, and the adjacent characters are determined to have an associated relationship.

[0220] In an optional embodiment, since the acquisition of the initial vector of a character does not depend on the vectors of other characters, the initial vector of each character in the text can be acquired in parallel.

[0221] It should be noted here that the word2vec corresponding to the word represented by the first node can be used as the initial vector of the first node.

[0222] In another optional solution, the solution of using a graph neural network to encode the graph structure of a sentence implemented in the above step S1607 can be implemented by the following solution: obtaining an initial vector for each node in the graph structure; the first graph encoding of each node is calculated based on the initial vectors of its adjacent nodes.

[0223] Since the graph neural network structure used encodes the input graph corresponding to the text, it can achieve the encoding effect. Therefore, in order to improve the encoding efficiency, multiple characters in the text can be encoded in parallel through the graph neural network model based on the input graph to obtain the character encoding results.

[0224] As an optional embodiment, how to perform parallel encoding on multiple characters in a text through a graph neural network model based on an input graph to obtain the encoding results of the characters can be implemented by the following optional scheme: performing parallel encoding on multiple characters in a text for the first time through a graph neural network model based on the input graph to obtain the first encoding result of the characters; updating the input graph according to the first encoding result to obtain an updated input graph; performing parallel encoding on multiple characters in the text through a graph neural network model based on the updated input graph to obtain the second encoding result of the characters.

[0225] In the above scheme, if the preset number of encodings is two, the second encoding result can be used as the final encoding result. If the preset number of encodings is greater than two, the character vector needs to be updated in the same way to continue encoding.

[0226] Combine Figure 6 As can be seen from the example, when performing the first encoding, we can first give each node an initial vector, that is, an initial vector for each text amplitude. This initial vector can be the Word2vec corresponding to the character represented by the node, or other. Then, the graph neural network model is used to calculate the graph encoding of each point, that is, to encode the character corresponding to each node. For example, Figure 6In the graph, node A is adjacent to nodes B, C, and D. Then the graph encoding vector of node A should be calculated from the initial vectors of nodes A, B, C, and D. The same principle applies to other nodes.

[0227] Recombination Figure 7 As shown in the figure, if the information of nodes farther away from node A needs to be encoded into A, then the encoding operation is repeated. That is, the first graph encoding vector of A is calculated using the initial vectors A, B, C, and D. When the encoding operation is repeated again, the second graph encoding vector of A is calculated using the first graph encoding vectors A, B, C, and D. Since the first graph encoding vector of C contains the information of E and F, the second graph encoding vector of A also contains the information of E and F.

[0228] As an optional embodiment, the input graph can be updated according to the first encoding result to obtain an updated input graph. The directed edges in the input graph can be maintained, and the nodes in the input graph can be updated using the first encoding result to obtain an updated input graph.

[0229] It should be further explained here that, in an optional solution provided by the present application, the Nth graph code of each node in the above embodiment is calculated based on the N-1th graph code of its adjacent node, where N is a positive integer greater than or equal to 2.

[0230] It should be noted that the solution of the above-mentioned embodiment 11 of the present application can also execute other steps of the entity identification method in embodiment 1 and embodiment 2 when there is no conflict, which will not be repeated here.

[0231] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.

[0232] In the above embodiments of the present invention, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0233] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0234] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0235] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0236] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable non-volatile storage medium. Based on this understanding, the technical solution of the present invention, 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. The computer software product is stored in a non-volatile storage medium and includes several instructions for enabling a computing device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned non-volatile storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk, and other media that can store program code.

[0237] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.

Claims

1. A method for named entity recognition, characterized in that: include: Obtaining a sentence in a text to be recognized, where the sentence consists of a plurality of characters; Performing graph modeling on the sentence to obtain a graph structure of the sentence; Encode the graph structure of the sentence using a graph neural network to obtain an encoding result for each word in the sentence; Decoding the encoding result of each word to obtain a recognition result of a named entity in the sentence, wherein the result of the named entity recognition is used to indicate whether the character is an entity in the sentence; The directed edge in the graph structure is used to represent an edge from a node of a previous character to a node of a next character. The nodes in the graph structure are characters in the sentence, and each node corresponds to a different character.

2. The method according to claim 1, characterized in that Performing graph modeling on the sentence to obtain the graph structure of the sentence includes: Get the vector of each character in the sentence; Determining the association relationship between each character according to the sequence relationship between each character in the text; Based on the vector of each character in the text and the association relationship between each character, a graph structure of the sentence is generated, wherein each character is a node on the graph structure, and the sequential relationship between each character serves as a directed edge between each node in the graph structure.

3. The method according to claim 2, characterized in that Use a graph neural network to encode the graph structure of the sentence, including: Obtaining an initial vector for each node in the graph structure; The first graph encoding of each node is calculated based on the initial vectors of its neighboring nodes.

4. The method according to claim 3, wherein The method further comprises: The Nth graph code of each node is calculated based on the N-1th graph code of its adjacent nodes, where N is a positive integer greater than or equal to 2.

5. The method according to claim 3 or 4, characterized in that Obtaining and setting an initial vector for each node in the graph structure includes: The word2vec corresponding to the word represented by the first node is used as the initial vector of the first node.

6. A method for named entity recognition, characterized in that: include: Get the vectors corresponding to the characters in the text and the association between each character; Using a graph neural network, encode a vector of a first character and a vector of a second character at least once to obtain an encoding result corresponding to the first character, wherein the first character is any character in the text, and the second character is another character in the text that has an association with the first character; Decoding the encoding result of the first character to obtain an identifier corresponding to the first character, wherein the identifier is used to indicate whether the first character is an entity in the text; Among them, the text corresponds to an input graph, and the directed edges in the input graph are used to represent edges from the node of the previous character in the text to the node of the next character. The nodes in the input graph are characters in the text, and each node corresponds to a different character.

7. The method according to claim 6, characterized in that Get the vectors corresponding to the characters in the text and the relationship between each character, including: Obtaining an initial vector of the character; The association relationship between each character is determined according to the order of the characters in the text.

8. The method according to claim 6, characterized in that After obtaining the association relationship between the vectors corresponding to the characters in the text and each character, the method further includes: obtaining an input graph corresponding to the text, where the input graph represents a graph for inputting into the encoding layer for encoding, wherein obtaining the input graph corresponding to the text includes: Determining characters in the text as nodes of the input graph, wherein each node corresponds to a different character; Construct directed edges between the nodes.

9. The method according to claim 8, characterized in that Using a graph neural network to encode a vector of a first character and a vector of a second character at least once to obtain an encoding result corresponding to the first character, including: The input graph is input into the graph neural network model, and the first character is encoded at least once by the graph neural network model.

10. The method according to claim 9, characterized in that Inputting the input graph into a graph neural network model, and encoding the first character at least once by the graph neural network model, including: Get the preset number of encoding times; Inputting the input graph into a graph neural network model, encoding the first character through the graph neural network model to obtain an intermediate encoding result, and determining whether the number of encodings reaches the preset number of encodings; If the number of encodings reaches the preset number of encodings, the intermediate encoding result is determined to be the encoding result of the first character; if the number of encodings does not reach the preset number of encodings, the input graph continues to be encoded through the graph neural network model.

11. The method according to claim 10, characterized in that When the first character is encoded for the first time, the vector of the first character is the initial vector corresponding to the first character, and the vector of the second character is the initial vector corresponding to the second character. The initial vector is used to represent the vector corresponding to the character itself.

12. The method according to claim 10, characterized in that Continuing to encode the input graph through the graph neural network model, including: Re-determining a vector corresponding to the first character and a vector corresponding to the second character, wherein an intermediate encoding result obtained by performing a previous encoding on the first character is determined to be the vector corresponding to the first character during the current encoding, and an intermediate encoding result obtained by performing a previous encoding on the second character is determined to be the vector corresponding to the second character during the current encoding; The first character is encoded based on the re-determined vector of the first character and the re-determined vector of the second character to obtain an intermediate encoding result of the first character during this encoding.

13. The method according to claim 6, characterized in that Decoding the encoding result of the first character to obtain an identifier corresponding to the first character includes: performing conditional random field decoding on the encoding result of the first character to obtain an identifier corresponding to the first character.

14. A method for identifying named entities, characterized in that: include: Get the initial vector corresponding to the characters in the text and the association relationship between each character; Determining an input graph corresponding to the text according to the initial vectors corresponding to the characters and the association relationship, wherein the nodes of the input graph represent the initial vectors corresponding to the characters, and the directed edges between the nodes are determined according to the order of the characters in the text; Performing graph encoding on characters in the text using a graph neural network model based on the input graph to obtain encoding results of the characters; Decoding the encoding result of the character to obtain an identifier corresponding to the character, wherein the identifier is used to indicate whether the character is an entity in the text; The directed edges in the input graph are used to represent edges from the node of the previous character in the text to the node of the next character. The nodes in the input graph are characters in the text, and each node corresponds to a different character.

15. The method according to claim 14, characterized in that Performing graph encoding on characters in the text using a graph neural network model based on the input graph to obtain encoding results of the characters, including: Based on the input graph, multiple characters in the text are encoded in parallel through a graph neural network model to obtain encoding results of the characters.

16. The method according to claim 15, characterized in that Based on the input graph, multiple characters in the text are encoded in parallel using a graph neural network model to obtain encoding results of the characters, including: Performing a first parallel encoding of a plurality of characters in the text based on the input graph using a graph neural network model to obtain a first encoding result of the characters; Updating the input graph according to the first encoding result to obtain an updated input graph; Based on the updated input graph, multiple characters in the text are encoded in parallel through a graph neural network model to obtain a second encoding result of the characters.

17. The method according to claim 16, characterized in that The input graph is updated according to the first encoding result to obtain an updated input graph, including: The directed edges in the input graph are maintained, and the nodes in the input graph are updated using the first encoding result to obtain an updated input graph.

18. A named entity recognition device, characterized in that: include: The acquisition module is used to obtain the vectors corresponding to the characters in the text and the association relationship between each character; an encoding module, configured to encode a vector of a first character and a vector of a second character at least once using a graph neural network to obtain an encoding result corresponding to the first character, wherein the first character is any character in the text, and the second character is another character in the text that has an association with the first character; a decoding module, configured to decode the encoding result of the first character to obtain an identifier corresponding to the first character, wherein the identifier is used to indicate whether the first character is an entity in the text; Among them, the text corresponds to an input graph, and the directed edges in the input graph are used to represent edges from the node of the previous character in the text to the node of the next character. The nodes in the input graph are characters in the text, and each node corresponds to a different character.

19. A non-volatile storage medium, characterized in that: The non-volatile includes a stored program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to perform the following steps: obtaining the vector corresponding to the characters in the text and the association relationship between each character; using a graph neural network to encode the vector of the first character and the vector of the second character at least once to obtain the encoding result corresponding to the first character, wherein the first character is any character in the text, and the second character is other characters in the text that have an association relationship with the first character; decoding the encoding result of the first character to obtain an identifier corresponding to the first character, wherein the identifier is used to indicate whether the first character is an entity in the text; wherein the text corresponds to an input graph, and the directed edges in the input graph are used to represent edges from the node of the previous character in the text to the node of the next character, and the nodes in the input graph are characters in the text, and each node corresponds to a different character.

20. A processor, characterized in that: The processor is used to run a program, wherein the following steps are performed when the program is run: obtaining the association relationship between the vector corresponding to the characters in the text and each character; using a graph neural network to encode the vector of the first character and the vector of the second character at least once to obtain the encoding result corresponding to the first character, wherein the first character is any character in the text, and the second character is other characters in the text that have an association relationship with the first character; decoding the encoding result of the first character to obtain an identifier corresponding to the first character, wherein the identifier is used to indicate whether the first character is an entity in the text; wherein the text corresponds to an input graph, and the directed edges in the input graph are used to represent edges from the node of the previous character in the text to the node of the next character, and the nodes in the input graph are characters in the text, and each node corresponds to a different character.

21. A method for identifying named entities, characterized in that: include: Get the initial vector corresponding to the characters in the text and the association relationship between each character; Determining an input graph corresponding to the text according to the initial vectors corresponding to the characters and the association relationship, wherein the nodes of the input graph represent the initial vectors corresponding to the characters, and the directed edges between the nodes are determined according to the order of the characters in the text; Performing graph encoding on multiple characters in the text in parallel using a graph neural network model based on the input graph to obtain encoding results of the characters; Decoding the encoding result of the character to obtain an identifier corresponding to the character, wherein the identifier is used to indicate whether the character is an entity in the text; The directed edges in the input graph are used to represent edges from the node of the previous character in the text to the node of the next character. The nodes in the input graph are characters in the text, and each node corresponds to a different character.

22. A method for identifying named entities, characterized in that: include: Receive an input comment text, and obtain the vectors corresponding to the characters in the comment text and the association relationship between each character; Using a graph neural network, encode a vector of a first character and a vector of a second character at least once to obtain an encoding result corresponding to the first character, wherein the first character is any character in the comment text, and the second character is another character in the comment text that has an association with the first character; Decoding the encoding result of the first character to obtain an identifier corresponding to the first character, wherein the identifier is used to indicate whether the first character is an entity in the comment text; Extracting an entity from the comment text according to the identifier, and determining the extracted entity as the comment subject of the comment text; Among them, the comment text corresponds to an input graph, and the directed edges in the input graph are used to represent the edges from the node of the previous character in the text to the node of the next character. The nodes in the input graph are the characters in the comment text, and each node corresponds to a different character.