Named entity recognition method, device, electronic device and computer storage medium
By generating a basic graph and adding connecting edges of word collocation rules, named entities are identified, which solves the problem of low accuracy of named entity recognition caused by word ambiguity in the existing technology, and achieves correct identification and accurate understanding of polysemous words.
Patent Information
- Application Number
- CN201911425813.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-31
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2039-12-31
AI Technical Summary
In the prior art, the accuracy of named entity recognition is low due to word ambiguity, and it is difficult to correctly identify named entities with ambiguous words.
By generating a basic graph of the text to be recognized, we obtain the word collocation rules that match the text, determine the character nodes corresponding to the words, and add connecting edges to the graph according to the word order relationship, generate a target graph to identify named entities, and incorporate word collocation rules to eliminate Discrepancy.
It improves the accuracy of named entity recognition, ensures that polysemous words have fixed and unique meanings when used according to word collocation rules, and correctly understands the meaning of words in the text to be recognized.
Smart Images

Figure CN113128226B
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of data processing technology, and more particularly to a method and device for named entity recognition, a method and device for named entity recognition for an e-commerce platform, a method and device for identifying case clues, a method and device for identifying content, an electronic device, and a computer storage medium. Background Art
[0002] Named Entity Recognition (NER), also known as "proper name recognition", refers to the automatic recognition of entities with specific meanings in texts through automated methods, mainly including names of people, places, institutions, products, proper nouns, etc. Named entity recognition plays an important role in text processing fields, such as question-answering systems and translation.
[0003] However, some words can be understood to have different meanings in different situations, that is, they need to be recognized as different entities. For example, the "card" in "card phone" should be recognized as a type of electronic product, while the "card" in "DIY card" should be recognized as the name of an item. Since words can be understood to have different meanings, ambiguity will occur when recognizing named entities, resulting in a low accuracy rate of named entity recognition.
[0004] Therefore, how to provide a method for word sense disambiguation is a technical problem that technicians in this field urgently need to solve. Summary of the invention
[0005] In view of this, one of the technical problems solved by the embodiments of the present application is to provide a named entity recognition method and device, a named entity recognition method and device for an e-commerce platform, a case clue recognition method and device, a content recognition method and device, an electronic device and a computer storage medium, so as to overcome the problem of low accuracy of named entity recognition caused by ambiguity in the prior art.
[0006] In a first aspect, an embodiment of the present application provides a method for named entity recognition, comprising: generating a basic graph corresponding to a text to be recognized, the basic graph comprising multiple character nodes; obtaining a word collocation rule matching the text to be recognized, the word collocation rule comprising a plurality of words and a word order relationship between the plurality of words; determining a plurality of first character nodes corresponding to the words in the word collocation rule from the plurality of character nodes of the basic graph; adding at least a connecting edge for representing the word collocation rule to the basic graph according to the word order relationship between the words in the word collocation rule, and generating a target graph to recognize named entities in the text to be recognized, wherein the connecting edge for representing the word collocation rule is connected to some or all of the plurality of first character nodes.
[0007] In a second aspect, an embodiment of the present application provides a named entity recognition device, comprising: a basic graph generation module, used to generate a basic graph corresponding to the text to be recognized, the basic graph comprising multiple character nodes; a rule determination module, used to obtain a word collocation rule matching the text to be recognized, the word collocation rule comprising a plurality of words and a word order relationship between the plurality of words; a first character node determination module, used to determine a plurality of first character nodes corresponding to the words in the word collocation rule from a plurality of character nodes of the basic graph; a target graph generation module, used to add at least a connecting edge for representing the word collocation rule to the basic graph according to the word order relationship between the words in the word collocation rule, to generate a target graph to recognize named entities in the text to be recognized, wherein the connecting edge for representing the word collocation rule is connected to some or all of the plurality of first character nodes.
[0008] In a third aspect, an embodiment of the present application provides a method for named entity recognition, comprising: generating a basic graph corresponding to a text to be recognized, the basic graph comprising multiple character nodes; obtaining a word collocation rule matching the text to be recognized, the word collocation rule comprising a number of words and a word order relationship between the several words; determining a number of first character nodes corresponding to the words in the word collocation rule from the multiple character nodes of the basic graph; according to the word order relationship between the words in the word collocation rule, adding at least a connecting edge for representing the word collocation rule to the basic graph to generate a target graph, wherein the connecting edge for representing the word collocation rule is connected to some or all of the several first character nodes; inputting the target graph into a graph neural network model, and determining the character encoding corresponding to each character in the text to be recognized through the graph neural network model; inputting the character encoding into a named entity recognition model, and recognizing the named entities in the text to be recognized through the named entity recognition model.
[0009] In a fourth aspect, an embodiment of the present application provides a named entity recognition device, comprising: a basic graph generation module, used to generate a basic graph corresponding to a text to be recognized, the basic graph comprising multiple character nodes; a rule determination module, used to obtain a word collocation rule matching the text to be recognized, the word collocation rule comprising a plurality of words and a word order relationship between the plurality of words; a first character node determination module, used to determine a plurality of first character nodes corresponding to the words in the word collocation rule from a plurality of character nodes in the basic graph; a target graph generation module, used to add at least a connecting edge for representing the word collocation rule to the basic graph according to the word order relationship between the words in the word collocation rule, to generate a target graph, wherein the connecting edge for representing the word collocation rule is connected to some or all of the plurality of first character nodes; a graph neural network module, used to input the target graph into a graph neural network model, and determine the character encoding corresponding to each character in the text to be recognized through the graph neural network model; a named entity recognition module, used to input the character encoding into a named entity recognition model, and recognize the named entities in the text to be recognized through the named entity recognition model.
[0010] In a fifth aspect, an embodiment of the present application provides a method for named entity recognition for an e-commerce platform, comprising: generating a basic graph corresponding to a text to be recognized for an e-commerce platform, the basic graph comprising multiple character nodes; obtaining a word collocation rule matching the text to be recognized, the word collocation rule comprising a number of words and a word order relationship between the words, the words comprising a brand name and / or a product name; determining from the multiple character nodes of the basic graph a number of first character nodes corresponding to the words in the word collocation rule; according to the word order relationship between the words in the word collocation rule, adding at least a connecting edge for representing the word collocation rule to the basic graph, generating a target graph to identify the brand name and / or product name in the text to be recognized, wherein the connecting edge for representing the word collocation rule is connected to some or all of the several first character nodes.
[0011] In a sixth aspect, an embodiment of the present application provides a named entity recognition device for an e-commerce platform, comprising: a basic graph generation module, used to generate a basic graph corresponding to a text to be recognized for the e-commerce platform, the basic graph comprising multiple character nodes; a rule determination module, used to obtain a word collocation rule matching the text to be recognized, the word collocation rule comprising a plurality of words and a word order relationship between the words, the words comprising a brand name and / or a product name; a first character node determination module, used to determine a plurality of first character nodes corresponding to the words in the word collocation rule from a plurality of character nodes in the basic graph; a target graph generation module, used to add at least a connecting edge for representing the word collocation rule to the basic graph according to the word order relationship between the words in the word collocation rule, to generate a target graph to recognize the brand name and / or product name in the text to be recognized, wherein the connecting edge for representing the word collocation rule is connected to some or all of the plurality of first character nodes.
[0012] In the seventh aspect, an embodiment of the present application provides a method for identifying case clues, including: generating a basic graph corresponding to a case document to be identified, the basic graph including multiple character nodes; obtaining a word collocation rule matching the case document to be identified, the word collocation rule including a plurality of words and a word order relationship in which a plurality of the words are combined into case clues; determining a plurality of first character nodes corresponding to the words in the word collocation rule from the multiple character nodes of the basic graph; according to the word order relationship between the words in the word collocation rule, adding at least a connecting edge for representing the word collocation rule to the basic graph, generating a target graph to identify case clues in the case document to be identified, wherein the connecting edge for representing the word collocation rule is connected to some or all of the plurality of first character nodes.
[0013] In an eighth aspect, an embodiment of the present application provides a device for identifying case clues, comprising: a basic graph generation module, used to generate a basic graph corresponding to the case document to be identified, the basic graph comprising multiple character nodes; a rule determination module, used to obtain a word collocation rule matching the case document to be identified, the word collocation rule comprising a plurality of words and a word order relationship in which a plurality of the words are combined into a case clue; a first character node determination module, used to determine, from the multiple character nodes of the basic graph, a plurality of first character nodes corresponding to the words in the word collocation rule; a target graph generation module, used to add at least a connecting edge for representing the word collocation rule to the basic graph according to the word order relationship between the words in the word collocation rule, to generate a target graph to identify the case clues in the case document to be identified, wherein the connecting edge for representing the word collocation rule is connected to some or all of the plurality of first character nodes.
[0014] In the ninth aspect, an embodiment of the present application provides a content identification method, including: generating a basic graph corresponding to an indictment to be identified, the basic graph including multiple character nodes; obtaining a word collocation rule matching the indictment to be identified, the word collocation rule including a plurality of words and a word order relationship in which the words are combined into key content; determining a plurality of first character nodes corresponding to the words in the word collocation rule from the multiple character nodes of the basic graph; adding at least a connecting edge for representing the word collocation rule to the basic graph according to the word order relationship between the words in the word collocation rule, generating a target graph to identify the key content in the indictment to be identified, wherein the connecting edge for representing the word collocation rule is connected to some or all of the plurality of first character nodes; and performing structured processing on the indictment to be identified according to the identified key content.
[0015] In the tenth aspect, an embodiment of the present application provides a content recognition device, including: a basic graph generation module, used to generate a basic graph corresponding to the indictment to be recognized, the basic graph including multiple character nodes; a rule determination module, used to obtain a word collocation rule matching the indictment to be recognized, the word collocation rule including a plurality of words and a word order relationship in which a plurality of the words are combined into key content; a first character node determination module, used to determine a plurality of first character nodes corresponding to the words in the word collocation rule from the plurality of character nodes of the basic graph; a target graph generation module, used to add at least a connecting edge for representing the word collocation rule in the basic graph according to the word order relationship between the words in the word collocation rule, to generate a target graph to identify the key content in the indictment to be recognized, wherein the connecting edge for representing the word collocation rule is connected to some or all of the plurality of first character nodes; a structuring module, used to structure the indictment to be recognized according to the identified key content.
[0016] In the eleventh aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the method described above.
[0017] In a twelfth aspect, an embodiment of the present application provides a computer storage medium on which a computer program is stored, and when the program is executed by a processor, the method described above is implemented.
[0018] The scheme of the embodiment of the present application generates a basic graph corresponding to the text to be recognized, the basic graph includes multiple character nodes; obtains word collocation rules matching the text to be recognized, the word collocation rules include multiple words and word order relationships between the multiple words; determines multiple first character nodes corresponding to the words in the word collocation rules from multiple character nodes of the basic graph; according to the word order relationships between the words in the word collocation rules, adds at least connecting edges connected to some or all of the multiple first character nodes and used to represent the word collocation rules in the basic graph, that is, integrates the word collocation rules into the basic graph, and generates a target graph, so that the target graph can not only represent the text to be recognized, but also represent the collocation rules corresponding to the text to be recognized, and when words with two or more meanings are used according to the word collocation rules, the meanings of the words are relatively fixed and unique, so that according to the target graph that can represent the collocation rules corresponding to the text to be recognized, the meanings of the words in the text to be recognized can be correctly understood, and word disambiguation can be achieved, so that when the named entities in the text to be recognized are recognized according to the target graph, the accuracy of named entity recognition can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Hereinafter, some specific embodiments of the present application will be described in detail in an exemplary and non-limiting manner with reference to the accompanying drawings. The same reference numerals in the accompanying drawings indicate the same or similar components or parts. It should be understood by those skilled in the art that these drawings are not necessarily drawn to scale. In the accompanying drawings:
[0020] Figure 1a A schematic diagram of the structure of a named entity recognition system for implementing the named entity recognition method provided in an embodiment of the present application;
[0021] Figure 1b A flowchart of a method for named entity recognition according to Embodiment 1 of the present application;
[0022] Figure 1c This is a schematic diagram of the target graph generation process of the first embodiment of the present application;
[0023] Figure 2a A flowchart of a method for named entity recognition according to Embodiment 2 of the present application;
[0024] Figure 2b This is a schematic diagram of the process of generating a target graph according to the second embodiment of the present application;
[0025] Figure 2c This is a schematic diagram of the named entity recognition process of Embodiment 2 of the present application;
[0026] Figure 3a This is a flowchart of a method for named entity recognition according to Embodiment 3 of the present application;
[0027] Figure 3bThis is a schematic diagram of the named entity recognition process of Example 3 of the present application;
[0028] Figure 4 This is a flow chart of a method for named entity recognition on an e-commerce platform in Embodiment 4 of the present application;
[0029] Figure 5 This is a flow chart of a method for identifying case clues in Embodiment 5 of the present application;
[0030] Figure 6 This is a flowchart of a content identification method according to Embodiment 6 of the present application;
[0031] Figure 7 This is a schematic diagram of the structure of a named entity recognition device in Embodiment 7 of the present application;
[0032] Figure 8 This is a schematic diagram of the structure of a named entity recognition device in Embodiment 8 of the present application;
[0033] Fig. 9 This is a schematic diagram of the structure of the content identification device in the eleventh embodiment of the present application;
[0034] Fig.10 This is a schematic diagram of the structure of the electronic device in the twelfth embodiment of the present application. DETAILED DESCRIPTION
[0035] The implementation of any technical solution of the embodiments of the present application does not necessarily require achieving all of the above advantages at the same time.
[0036] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the embodiments of the present application should fall within the scope of protection of the embodiments of the present application.
[0037] Typically, named entity recognition is performed using a neural network model, such as a conditional random field model based on a bidirectional long short-term memory network (LSTM-CRF).
[0038] When performing named entity recognition through LSTM-CRF, most of the time, the character numbers corresponding to the characters in the text to be recognized are determined by table lookup or other methods, and the found character numbers are input into the LSTM-CRF model according to the word order of the characters in the text to be recognized.
[0039] The LSTM-CRF model includes an LSTM sub-model and a CRF sub-model. After the character number is input into the LSTM-CRF model, the LSTM sub-model will first perform time series modeling on the input character number in the order of word order and output it. The output also includes the probability of each character corresponding to multiple labels. The labels can specifically include B-LOC and E-LOC. The prefix B in the label indicates that the character is the beginning of an entity, and the prefix E indicates that the character is the end of an entity. The prefix can also include I, indicating that the character is inside an entity, and S indicates that the entity is a single word. The suffix in the label is used to indicate a predefined type. For example, LOC indicates a location. The CRF sub-model can calculate a label path based on the probability output by the LSTM sub-model, and the identified named entity can be determined based on the label path.
[0040] However, in the above method, only the meaning of the characters themselves is considered. If there are ambiguous words in the text to be recognized, that is, the words composed of characters can be understood as two or more meanings, and the correct semantics cannot be determined simply by the meaning of the characters, then when the above method is used for recognition, it is possible to calculate at least two label paths corresponding to the correct semantics and the ambiguous semantics, respectively, which may lead to errors in the recognition results obtained by named entity recognition based on the label path, that is, the accuracy of named entity recognition is low.
[0041] In order to solve the above problems, an embodiment of the present application provides a named entity recognition solution, which generates a basic graph corresponding to the text to be recognized, the basic graph includes multiple character nodes; obtains word collocation rules matching the text to be recognized, the word collocation rules include multiple words and word order relationships between the multiple words; determines multiple first character nodes corresponding to the words in the word collocation rules from multiple character nodes of the basic graph; according to the word order relationship between the words in the word collocation rules, adds at least connecting edges connected to some or all of the multiple first character nodes and used to represent the word collocation rules in the basic graph, that is, integrates the word collocation rules into the basic graph, and generates a target graph, so that the target graph can not only represent the text to be recognized, but also represent the collocation rules corresponding to the text to be recognized, and when words with two or more meanings are used according to the word collocation rules, the meanings of the words are relatively fixed and unique, so that according to the target graph that can represent the collocation rules corresponding to the text to be recognized, the meanings of the words in the text to be recognized can be correctly understood, and word disambiguation is achieved, so that when the named entities in the text to be recognized are recognized according to the target graph, the accuracy of named entity recognition can be improved.
[0042] The specific implementation of the embodiment of the present application is further explained below in conjunction with the accompanying drawings of the embodiment of the present application.
[0043] Below, a named entity recognition system is first described. Figure 1a , a structural diagram of a named entity recognition system for implementing the named entity recognition method provided in an embodiment of the present application, the system may include a server and a terminal device A, it should be understood that, Figure 1a The server and terminal device A presented are only exemplary illustrations and do not limit the implementation forms of the two.
[0044] In actual applications, the server and terminal device A can be connected by a wired or wireless network, and the communication connection can be achieved through mobile networks such as GSM, GPRS, LTE, or through Bluetooth, WIFI, infrared, etc. The embodiment of the present application does not limit the specific communication connection method between the server and terminal device A.
[0045] The server can be a service device that provides services to users. Specifically, it can be an independent application service device, or it can be a service cluster composed of multiple servers. In actual applications, it can be a cloud server, a cloud host, a virtual center, etc. The embodiment of the present application does not limit the structure of the server and its implementation form.
[0046] The terminal device A can be a terminal facing the user and capable of interacting with the user, such as a mobile phone, notebook, computer, iPad, smart speaker, etc., and can also be various self-service terminals, such as self-service machines in hospitals, banks, stations, etc. In addition, the terminal device A can also be an intelligent machine that supports interaction, such as a chat robot, a sweeping robot, a meal ordering service robot, etc. The embodiment of the present application does not limit the product type and physical form of the terminal device. The embodiment of the present application requires that it has an interactive function, which can be achieved by installing interactive applications such as news browsing.
[0047] When performing named entity recognition, terminal device A can send a named entity recognition request for the text to be recognized to the server through the network. The server receives the named entity recognition request for the text to be recognized sent by terminal device A, and returns a response result to the named entity recognition request to terminal device A based on the named entity recognition request. For example, when the text to be recognized is "China", the named entity recognition request carries the text to be recognized "China", and the response result to the named entity recognition request is "China (B-LOC) China (E-LOC)", where B indicates that this word is the beginning of an entity (China), E indicates that this word is the end of an entity (China), and LOC indicates that the type of entity (China) is a location. It can be seen that the named entity recognition method provided in the embodiment of the present application can be executed by a server, and the specific implementation process can refer to the description of the method embodiment below.
[0048] Combined with Figure 1a The system structure diagram shown in Figure 1b , which is a flowchart of a named entity recognition method according to the first embodiment of the present application, can be applied to text recognition processes in various application scenarios, and can be specifically executed by a server, and of course, can also be executed by other terminals with computing capabilities, such as Figure 1b As shown, the method may include but is not limited to the following steps:
[0049] S102: Generate a basic graph corresponding to the text to be recognized.
[0050] In the embodiment of the present application, the text to be recognized is the text used for named entity recognition.
[0051] The basic graph in this step and the target graph in the subsequent steps are all graph structure data. Graph structure data refers to the data structure as a graph structure, which is a nonlinear structure that is more complex than a tree structure. In a graph structure, multiple nodes and edges are included, and any two nodes may be connected by edges. For this reason, graph structures are often used to describe various complex data objects and have very wide applications in many fields such as natural sciences, social sciences, and humanities. In the present application, nodes may specifically include character nodes corresponding to characters, rule nodes corresponding to collocation rules, etc., and edges connecting nodes may specifically include connecting edges for representing word order relationships between characters, connecting edges for representing word collocation rules, etc.
[0052] In an embodiment of the present application, a basic graph of the text to be recognized is generated, that is, graph structure data corresponding to the text to be recognized is generated, so that the text to be recognized can be represented by the basic graph. The basic graph includes multiple character nodes, and the character nodes in the basic graph can correspond one-to-one to the characters in the text to be recognized. The method of generating the basic graph can refer to related technologies, and this embodiment will not be repeated here.
[0053] In addition, this embodiment does not limit the language type of the text to be recognized. For example, the language type can be Chinese or English. When the text to be recognized is Chinese, the character nodes in the basic graph can correspond one-to-one to the Chinese characters in the text to be recognized. When the text to be recognized is English, the character nodes in the basic graph can correspond one-to-one to the words in the text to be recognized.
[0054] S104: Obtain word collocation rules that match the text to be recognized.
[0055] In the embodiment of the present application, a plurality of collocation rules may be pre-set, and the collocation rules are used to indicate the words that are commonly used together, which characterizes the collocation and usage habits of these words in scenes such as daily life or work. The collocation rules may be determined by a person skilled in the art according to recognition needs, or may be determined by learning sample data such as a neural network model, and this embodiment does not limit this.
[0056] In addition, the word collocation rules are not fixed but can be updated. The word collocation rules can be updated by technicians in this field or by a neural network model, and this embodiment does not limit this.
[0057] The word collocation rules may include several words and the word order relationship between several words. The number of words included in the word collocation rules is generally two, and may include more than two, which is not limited in this embodiment; the word order relationship between several words refers to the order relationship of the combination of several words. For example, the word order relationship between words can indicate that two words are adjacent, one of the two words is in front and the other is behind, etc. In a word collocation rule, the word order relationship between several words may include one or multiple, which is not limited in this embodiment. Since words appear in different positions and have different meanings when used with different words, therefore, through the word collocation rules that match the text to be identified, the words used in combination in the text to be identified can be determined, and the word order relationship between the words when used in combination can be determined, so that through the word collocation rules, the meaning of the words can be correctly understood, and word disambiguation can be achieved, and then it can be determined whether certain words are named entities, what type of named entities they are, etc., which improves the accuracy of named entity recognition.
[0058] For example, the word collocation rules may include the two words "card" and "mobile phone", and the word order relationship between the two words is that "card" comes first and "mobile phone" comes second.
[0059] In a specific example, a word collocation rule can be matched according to characters in the text to be recognized. For example, according to the characters of the text to be recognized, it can be determined that all the words in a certain word collocation rule are included in the text to be recognized, and then it can be determined that the word collocation rule matches the text to be recognized. It is understood that the above description is only exemplary, and the embodiments of the present application do not impose any limitation on this.
[0060] S106: Determine a plurality of first character nodes corresponding to the words in the word collocation rule from the plurality of character nodes in the basic graph.
[0061] The basic graph is generated based on the text to be recognized. Therefore, the character nodes in the basic graph correspond to all the characters in the text to be recognized. Then, in step S106, the multiple character nodes of the basic graph can be filtered according to the collocation matching rules, and the filtered character nodes corresponding to the words in the word collocation rules are the first character nodes.
[0062] A specific implementation method may be, for example, to determine the first ID value corresponding to each character in the text to be recognized, and to determine multiple character nodes based on multiple first ID values, where the character nodes may correspond one to one with the first ID values. Then, the second ID value of the character corresponding to the word in the word collocation rule is determined. Since the same character corresponds to the same ID value, it is possible to directly search in multiple character nodes based on the second ID value, thereby determining a number of first character nodes corresponding to the word in the word collocation rule.
[0063] It will be understood that the above description is merely illustrative and the embodiments of the present application do not impose any limitation thereto. A person skilled in the art may adopt other methods to determine several first character nodes corresponding to words in the word collocation rules from multiple character nodes of the basic graph, which is also within the scope of protection of the present application.
[0064] Since the number of words included in the word collocation rule is several, that is, two or more, the number of corresponding first character nodes is also several, that is, two or more. It should be noted that the number of first character nodes can be the same as or different from the number of words in the word collocation rule, and this embodiment does not limit this.
[0065] S108. According to the word order relationship between words in the word collocation rule, at least a connection edge for representing the word collocation rule is added to the basic graph to generate a target graph to identify named entities in the text to be identified.
[0066] The connection edge used to represent the word collocation rule is connected to part or all of the first character nodes.
[0067] In the embodiment of the present application, a connection edge connected to some or all of the first character nodes and used to represent the word collocation rules is added, that is, at least one end of the connection edge added to represent the word collocation rules is connected to the first character node. In addition, since the connection edge added to the base graph to represent the word collocation rules is determined according to the word order relationship between the words in the collocation rules, the word collocation rules can be integrated into the base graph by adding the connection edge to represent the word collocation rules, so that the generated target graph can not only represent the text to be recognized, but also represent the word collocation rules corresponding to the text to be recognized.
[0068] When generating a target graph to identify named entities in the text to be recognized, the tag sequence corresponding to the text to be recognized can be determined according to the target graph. The tag sequence can represent the categories of each word in the text to be recognized, etc. The named entities in the text to be recognized can be determined according to the tag sequence. For example, the tag sequence corresponding to the two characters "中国" can be: B-LOC; E-LOC. Among them, B-LOC is the tag corresponding to "中", and E-LOC is the tag corresponding to "国". B indicates that this character is the start of an entity, E indicates that this character is the end of an entity, and LOC indicates that the type of the entity is location.
[0069] Since the target graph can not only represent the text to be recognized, but also represent the collocation rules corresponding to the text to be recognized, when identifying the named entities in the text to be recognized according to the target graph, the text to be recognized itself and the collocation rules of the text to be recognized can be considered simultaneously, thereby increasing the accuracy of named entity recognition.
[0070] For better understanding, the generation process of the target graph is illustrated as follows. Figure 1c Suppose the text to be recognized is "最新款卡片手机". First, each character in the text to be recognized can be identified by a character node, so as to obtain character nodes c1, c2, c3, c4, c5, c6, c7. Then, the character nodes can be connected by the connection edge L1 used to represent the word order relationship between characters to generate a basic graph. Then, according to the words "卡片" and "手机" in the collocation rules of words, the first character nodes c4, c5, c6, c7 are determined from the character nodes. Then, the first character nodes c4, c5, c6, c7 can be connected by the connection edge L2 used to represent the collocation rules of words to generate a target graph. After generating the target graph, named entity recognition can be performed according to the target graph to determine the tag sequence corresponding to the text to be recognized, so as to determine the named entities in "最新款卡片手机" according to the tag sequence.
[0071] In this embodiment, a basic graph corresponding to the text to be recognized is generated, the basic graph includes multiple character nodes; a word collocation rule matching the text to be recognized is obtained, the word collocation rule includes multiple words and word order relationships between the multiple words; a number of first character nodes corresponding to the words in the word collocation rule are determined from the multiple character nodes of the basic graph; according to the word order relationships between the words in the word collocation rule, at least a connection edge connected to some or all of the multiple first character nodes and used to represent the word collocation rule is added to the basic graph, that is, the word collocation rule is integrated into the basic graph, and a target graph is generated, so that the target graph can not only represent the text to be recognized, but also represent the collocation rules corresponding to the text to be recognized, and when words with two or more meanings are used according to the word collocation rules, the meaning of the words is relatively fixed and unique, so that according to the target graph that can represent the collocation rules corresponding to the text to be recognized, the meaning of the words in the text to be recognized can be correctly understood, and word disambiguation is achieved, so that when the named entities in the text to be recognized are recognized according to the target graph, the accuracy of named entity recognition can be improved.
[0072] The named entity recognition method of this embodiment can be executed by any appropriate electronic device with data processing capabilities, including but not limited to: servers, mobile terminals (such as tablet computers, mobile phones, etc.) and PCs, etc.
[0073] Reference Figure 2a , is a flowchart of a method for named entity recognition according to Embodiment 2 of the present application, such as Figure 2a As shown, the method may include but is not limited to the following steps:
[0074] S202: Generate a basic graph corresponding to the text to be recognized.
[0075] In some optional embodiments, step S202 may include: determining multiple character nodes based on the characters in the text to be recognized; adding connecting edges for representing the word order relationship between the characters between the multiple character nodes based on the word order relationship between the characters in the text to be recognized, to generate a basic graph.
[0076] By generating a basic graph in the above manner, the character nodes in the basic graph can correspond one-to-one with the characters in the text to be recognized, and multiple character nodes in the basic graph can be connected by connecting edges used to represent the word order relationship between characters, so as to represent the text to be recognized as completely as possible in the basic graph, thereby improving the accuracy of identifying named entities. It can be understood that the above description is only exemplary and the embodiments of the present application do not impose any limitation on this. A specific implementation method can be, for example, the above Figure 1c As shown, no further details are given here.
[0077] S204: Obtain word collocation rules that match the text to be recognized.
[0078] This step is similar to step S104 in the above embodiment and will not be described again.
[0079] S206: Determine a plurality of first character nodes corresponding to the words in the word collocation rule from the plurality of character nodes in the basic graph.
[0080] The specific implementation method of this step can refer to the above step S106, which will not be repeated here.
[0081] S208. According to the words in the word collocation rule, a rule node corresponding to the word collocation rule is added to the basic graph.
[0082] The start rule node can be used to represent the starting position of the word collocation rule in the text to be recognized, the end rule node can represent the ending position of the word collocation rule in the text to be recognized, and the transition rule node can represent the starting position of a word in the word collocation rule in the text to be recognized or the ending position of a word in the text to be recognized.
[0083] In some optional embodiments, in order to reduce the amount of data of the generated target graph, only one or two of the three types of rule nodes may be added, or the number of rule nodes may be controlled; of course, in order to achieve a better recognition effect, all three types of rule nodes may be added, and this embodiment does not limit this.
[0084] S210 . According to the word order relationship between words in the word collocation rule, the rule node is connected to a plurality of first character nodes through a connection edge used to represent the word collocation rule to generate a target graph.
[0085] The connection edge used to represent the word collocation rule is connected to some or all of the first character nodes.
[0086] In some optional embodiments, if the rule node includes a starting rule node, according to the word order relationship between words in the word collocation rule, the rule node is connected to the plurality of first character nodes through a connecting edge for representing the word collocation rule, including:
[0087] According to the word order relationship between the words in the word collocation rule, determining a character node corresponding to the starting character of the word in the word collocation rule from a plurality of first character nodes;
[0088] The starting rule node is connected to the character node corresponding to the starting character through the connecting edge used to represent the word collocation rule.
[0089] Alternatively, in some optional embodiments, if the rule node includes an end rule node, if the rule node includes an end rule node, according to the word order relationship between words in the word collocation rule, the rule node is connected to the plurality of first character nodes through a connecting edge for representing the word collocation rule, including:
[0090] According to the word order relationship between the words in the word collocation rule, determining the character node corresponding to the end character of the word in the word collocation rule from the plurality of first character nodes;
[0091] The end rule node is connected to the character node corresponding to the end character through the connection edge used to represent the word collocation rule.
[0092] Alternatively, in some optional embodiments, if the rule node includes a transition rule node, if the rule node includes a transition rule node, according to the word order relationship between the words in the word collocation rule, the rule node is connected to a plurality of first character nodes through a connection edge used to characterize the word collocation rule, including: according to the word order relationship between the words in the word collocation rule, a first word and a second word are determined from the words in the word collocation rule, wherein the first word is adjacent to the second word and the first word is located before the second word; from a plurality of first character nodes, a character node corresponding to the end character of the first word is determined, and a character node corresponding to the start character of the second word is determined; through a connection edge used to characterize the word collocation rule, the character node corresponding to the end character of the first word is connected to the transition rule node, and the transition rule node is connected to the character node corresponding to the start character of the second word. Thus, through the transition rule node, the change position of the words included in the word collocation rule in the text to be recognized can be accurately identified, so that the word collocation rule can be better integrated into the basic graph, and the accuracy of named entity recognition is improved.
[0093] Taking "card" and "mobile phone" as examples, when in use, "card" is generally in front and "mobile phone" is in the back, that is, "card" can be the first word and "mobile phone" can be the second word. After adding the transition rule node, the first character node corresponding to "piece" and the transition rule node can be connected through the connecting edge used to represent the word collocation rule, and the transition rule node and the first character node corresponding to "hand" can be connected through the connecting edge used to represent the word collocation rule.
[0094] In addition, the connecting edges used to represent the collocation rules of words can be directed edges, for example Figure 2bIn L2, specifically, the order of the first character nodes can be determined first according to the word order relationship between the words in the word collocation rule; and then directed edges corresponding to the order of the first character nodes are added between the first character nodes as connecting edges for representing the word collocation rule. Thus, the word order of the words included in the word collocation rule can be accurately identified through the direction indicated by the connecting edge for representing the word collocation rule, so that the word collocation rule can be better integrated into the basic graph and the accuracy of named entity recognition can be improved.
[0095] Similarly, the connecting edges used to represent the word order relationship between characters can also be directed edges, so that the word order of characters in the text to be recognized can be accurately identified by the direction indicated by the connecting edges used to represent the word order relationship between characters, thereby representing the text to be recognized as completely as possible in the basic graph, thereby improving the accuracy of identifying named entities.
[0096] In addition, after adding the connecting edges for representing the word collocation rules, the weights of the connecting edges for representing the word collocation rules can be determined according to the usage probability of the word collocation rules, and then the target graph is generated.
[0097] The usage probability of the word collocation rule is used to indicate the probability that the word can be interpreted as a fixed meaning when the word included in the word collocation rule is included in the text to be recognized. For example, when "card phone" appears in the text to be recognized, the probability that "card" is interpreted as a type of electronic product is 0.9, and the weight of the connecting edge used to characterize the word collocation rule can be set to 0.9. It can be understood that the above description is only exemplary, and the embodiments of the present application do not impose any limitation on this.
[0098] The usage probability of the word collocation rules can be set by a person skilled in the art as needed, or can be determined by a method such as learning sample data through a neural network model, and this embodiment does not limit this.
[0099] By setting the weights of the connecting edges used to characterize the word collocation rules, the word collocation rules can be better integrated into the basic graph, thereby improving the accuracy of named entity recognition.
[0100] When the connecting edges used to represent the word collocation rules have weights, the connecting edges used to represent the word order relationship between characters can also be set with weights. For example, the weights of the connecting edges used to represent the word order relationship between characters can be uniformly set to 1, etc. This embodiment does not limit this.
[0101] In order to better understand, the generation process of the target graph is as follows Figure 2b. Assume that the text to be recognized is "the latest card phone". First, each word in the text to be recognized can be identified with a character node, so as to obtain character nodes c1, c2, c3, c4, c5, c6, c7. Then, the character nodes can be connected through the directed edge L1 (the connecting edge used to represent the word order relationship between characters) to generate a basic graph. The direction of L1 corresponds to the word order relationship of the characters. After that, rule nodes can be added to the basic graph. The rule nodes include the starting rule node v1, the transition rule node v2, and the ending rule node v3. According to the words "card" and "mobile phone" in the word collocation rules, the first character nodes c4, c5, c6, and c7 are determined from the character nodes. Then, the directed edge L2 (the connecting edge used to represent the word collocation rules) can be connected in the order of v1→c4→c5→v2→c6→c7→v3 to generate a target graph. After the target graph is generated, named entity recognition can be performed according to the target graph to determine the label sequence corresponding to the text to be recognized, so as to determine the named entities in "the latest card phone" according to the label sequence.
[0102] S212: Determine the character code corresponding to each character in the text to be recognized according to the target graph.
[0103] The character encoding may specifically be a vector representation corresponding to the character.
[0104] S214: Identify named entities in the text to be identified according to character encoding.
[0105] Taking the text to be recognized as "the latest card phone" as an example, the character code corresponding to each character in the text to be recognized can be determined in step S212, and based on the character code, the label path corresponding to the text to be recognized can be determined.
[0106] Specifically, the word "most" in the text to be recognized obtains the predefined label "O", the word "new" in the text to be recognized obtains the predefined label "B-TIME", the word "style" in the text to be recognized obtains the predefined label "E-TIME", the word "card" in the text to be recognized obtains the predefined label "B-TYP", the word "piece" in the text to be recognized obtains the predefined label "E-TYP", the word "hand" in the text to be recognized obtains the predefined label "B-PRO", and the word "machine" in the text to be recognized obtains the predefined label "E-PRO". Among them, the prefix B indicates that the word is the beginning of an entity, the prefix I indicates that the word is inside an entity, the prefix E indicates that the word is the end of an entity, and the prefix S indicates that the entity is a single word. The predefined entity types are defined by different data sets, which can be time (TIME), location (LOC), name (PER), organization (ORG), commodity (PRO), brand (BRA), category (TYP), or other custom entity types. The set of entity types must contain other types (O) to represent words that are not classified into the set of predefined entity types.
[0107] Based on the determined label path, the named entities in the text to be identified can be determined.
[0108] In a specific example, Figure 2c As shown, in Figure 2c The application scenario shown includes a terminal device A and a server. The terminal device A is used to obtain the text to be recognized, and send a named entity recognition request carrying the text to be recognized to the server, and the server is used to execute the named entity recognition method provided in the embodiment of the present application to recognize the named entities in the text to be recognized.
[0109] The basic graph generation module in the server is used to generate a basic graph corresponding to the text to be recognized, and the rule determination module is used to determine the word collocation rules corresponding to the text to be recognized; the first character node determination module can determine a number of first character nodes from the basic graph according to the word collocation rules; the target graph generation module can generate a target graph according to the first character nodes; the encoding module can determine the character encoding corresponding to each character in the text to be recognized according to the target graph, and the recognition module can recognize the named entities in the text to be recognized according to the character encoding. Thus, the server can return the named entity recognition result to the terminal device A.
[0110] In this embodiment, by adding rule nodes to the basic graph and setting the connecting edges used to represent the word collocation rules as directed edges to generate the target graph, the word collocation rules can be better integrated into the basic graph to generate the target graph, thereby improving the accuracy of named entity recognition.
[0111] The named entity recognition method of this embodiment can be executed by any appropriate electronic device with data processing capabilities, including but not limited to: servers, mobile terminals (such as tablet computers, mobile phones, etc.) and PCs, etc.
[0112] Reference Figure 3a , is a flowchart of a method for named entity recognition according to Embodiment 3 of the present application. As shown in FIG3 , the method may include but is not limited to the following steps:
[0113] S302: Generate a basic graph corresponding to the text to be recognized.
[0114] The base graph includes multiple character nodes.
[0115] In one implementation of the present application, step S302 may include: determining multiple character nodes based on the characters in the text to be recognized; adding connecting edges for representing the word order relationship between the characters between the multiple character nodes based on the word order relationship between the characters in the text to be recognized, and generating a basic graph.
[0116] S304: Obtain word collocation rules that match the text to be recognized.
[0117] The collocation rules include a number of words and the word order relationship between them;
[0118] S306: Determine a plurality of first character nodes corresponding to the words in the word collocation rule from the plurality of character nodes in the basic graph.
[0119] S308. According to the word order relationship between words in the word collocation rule, at least a connecting edge for representing the word collocation rule is added to the basic graph to generate a target graph.
[0120] The connection edge used to represent the word collocation rule is connected to some or all of the first character nodes.
[0121] The specific implementation of steps S302 - S308 may refer to the above embodiment, which will not be described in detail in this embodiment.
[0122] In one implementation of the present application, step S308 may include: determining the sequence of several first character nodes based on the word order relationship between words in the word collocation rule; adding directed edges corresponding to the sequence of several first character nodes between the several first character nodes as connecting edges for representing the word collocation rule.
[0123] In another implementation of the present application, step S308 may include: according to the words in the word collocation rule, adding a rule node corresponding to the word collocation rule to the basic graph; according to the word order relationship between the words in the word collocation rule, connecting the rule node with several first character nodes through a connecting edge used to represent the word collocation rule.
[0124] Specifically, if the rule node includes a starting rule node, the rule node is connected to several first character nodes through a connecting edge used to represent the word collocation rule according to the word order relationship between the words in the word collocation rule, including: determining the character node corresponding to the starting character of the word in the word collocation rule from several first character nodes according to the word order relationship between the words in the word collocation rule; connecting the starting rule node with the character node corresponding to the starting character through a connecting edge used to represent the word collocation rule.
[0125] Alternatively, if the rule node includes an end rule node, the rule node is connected to several first character nodes according to the word order relationship between words in the word collocation rule through a connecting edge used to represent the word collocation rule, including: determining the character node corresponding to the end character of the word in the word collocation rule from several first character nodes according to the word order relationship between words in the word collocation rule; and connecting the end rule node to the character node corresponding to the end character through a connecting edge used to represent the word collocation rule.
[0126] Alternatively, if the rule node includes a transition rule node, the rule node is connected to a number of first character nodes through a connecting edge used to represent the word collocation rule according to the word order relationship between the words in the word collocation rule, including: determining a first word and a second word from the words in the word collocation rule according to the word order relationship between the words in the word collocation rule, wherein the first word is adjacent to the second word and the first word is located before the second word; determining a character node corresponding to the end character of the first word from the number of first character nodes, and determining a character node corresponding to the start character of the second word; connecting the character node corresponding to the end character of the first word to the transition rule node through a connecting edge used to represent the word collocation rule, and connecting the transition rule node to the character node corresponding to the start character of the second word.
[0127] Of course, the above two implementations can be used simultaneously.
[0128] In another implementation of the present application, when executing step S308, at least a connecting edge for representing the word collocation rule is added to the basic graph according to the word order relationship between the words in the word collocation rule. Thereafter, the method further includes: determining the weight of the connecting edge for representing the word collocation rule according to the usage probability of the word collocation rule.
[0129] S310. Input the target graph into the graph neural network model, and determine the character encoding corresponding to each character in the text to be recognized through the graph neural network model.
[0130] Thus, through the graph neural network model, the data of the target graph can be encoded, so as to accurately determine the character encoding corresponding to each character. The character encoding can be specifically a vector representation corresponding to the character.
[0131] In a specific example, a graph neural network (GNN) model can refer to a generalized graph structure that uses a recursive aggregation method to propagate the information of the nodes in the graph and eventually learn the encoding of each graph node. In an embodiment of the present application, the target graph can include not only character nodes but also rule nodes. In this case, the encoding of the two types of nodes can be learned during learning, and only the character encoding corresponding to the character node can be output during output.
[0132] More specifically, the graph neural network model in deep learning theory can be a set of functions organized by graph structure in topological space for relational reasoning. The graph neural network model can be a graph convolutional network model, a deep walk model (also known as the DeepWalk model, a model that uses vector modeling for nodes in a graph), a large-scale information network embedding (LINE, Large-scale Information Network Embedding) model, a node-to-vector model (also known as the Node2vec model, a model that uses vector modeling for nodes in a graph), a structural deep network embedding (SDNE, Structural Deep Network Embedding) model, and a graph autoencoder model, etc. It can be understood that the above description is only exemplary and the embodiments of the present application do not limit this in any way.
[0133] S312: Input the character code into a named entity recognition model, and use the named entity recognition model to recognize named entities in the text to be recognized.
[0134] Thus, through the entity recognition model, the label can be annotated according to the character encoding, so as to accurately identify the named entity. Specifically, as mentioned above, the character encoding can be a vector representation corresponding to the character, and the label is annotated according to the character encoding, that is, the label is annotated according to the vector representation corresponding to the character.
[0135] In a specific example, the named entity recognition model can be a conditional random field model (LSTM-CRF) based on a bidirectional long short-term memory network, which includes an LSTM sub-model and a CRF sub-model. The LSTM sub-model can perform time series modeling on the input character encoding and output the probability that each character encoding corresponds to multiple labels. The CRF sub-model can determine a label sequence based on the probability output by the LSTM. The labels in the label sequence correspond one-to-one to the character encoding. According to the label sequence, the named entities in the text to be recognized can be determined.
[0136] For a better understanding, Figure 3b As shown, taking the text to be recognized as "the latest card phone" as an example, the named entity recognition process is explained in detail.
[0137] First, generate the basic graph corresponding to "latest card phone", integrate the word collocation rules into the basic graph, generate the target graph, input the target graph corresponding to "latest card phone" into the graph neural network model, and output the character codes corresponding to each character of "latest card phone" through the graph neural network model, which are code 1 to code 7. Input the codes 1 to code 7 corresponding to the characters into the named entity recognition model, and first perform time series modeling on codes 1 to code 7 through the named entity recognition model; then, through the recursive neural network of the named entity recognition model, perform the encoding operation again on each code in the time series "code 1 to code 7" to obtain the feature encoding vector of each character in "latest card phone", and then use the recursive neural network to calculate the probability that each feature encoding vector corresponds to each label. A recursive neural network is an artificial neural network with a tree-like hierarchical structure and network nodes that recursively input information (i.e., feature coding vectors) in the order in which they are connected. It can convert the input sequence into a higher-level understanding, annotate the content in the sequence (i.e., determine the probability that each feature coding vector corresponds to each label) and output it; finally, it uses the conditional random field model (CRF) in the named entity recognition model to decode it, that is, according to the multiple labels corresponding to the feature coding vector and the probability corresponding to each label, a label path is calculated. The label path includes multiple labels and the labels correspond one-to-one to the characters in the text to be recognized, so that the recognition result of the named entity is determined according to the label path.
[0138] Specifically, the character "most" in the text to be recognized is assigned the predefined tag "O", the character "new" is assigned the predefined tag "B-TIME", the character "model" is assigned the predefined tag "E-TIME", the character "card" is assigned the predefined tag "B-TYP", the character "slice" is assigned the predefined tag "E-TYP", the character "hand" is assigned the predefined tag "B-PRO", and the character "machine" is assigned the predefined tag "E-PRO".
[0139] In addition, it should be noted that the tag can be composed of a prefix and a predefined entity type. The prefix B indicates that this character is the start of an entity, the prefix I indicates that this character is inside an entity, the prefix E indicates that this character is the end of an entity, and the prefix S indicates that this entity is a single-character word. The predefined entity type is defined by different data sets and can be time (TIME), location (LOC), person name (PER), organization (ORG), product (PRO), brand (BRA), category (TYP), or other custom entity types. The set of entity types must include the other type (O) to represent the characters that are not classified into the predefined entity type set.
[0140] The embodiment of this application provides a named entity recognition scheme. By generating a basic graph corresponding to the text to be recognized, the basic graph includes multiple character nodes; obtaining the collocation rules matching the text to be recognized, the collocation rules include several words and the word order relationships between several words; determining several first character nodes corresponding to the words in the collocation rules from the multiple character nodes of the basic graph; according to the word order relationships between the words in the collocation rules, at least add connection edges connected to some or all of the several first character nodes in the basic graph and used to represent the collocation rules, that is, integrate the collocation rules into the basic graph to generate a target graph, so that the target graph can not only represent the text to be recognized, but also represent the collocation rules corresponding to the text to be recognized. When a word with two or more meanings is used according to the collocation rules, its meaning is relatively fixed and unique. Thus, after inputting the target graph into the graph neural network model and determining the character encodings corresponding to each character in the text to be recognized through the graph neural network model, the obtained character encodings also integrate the collocation rules. When the character encodings are input into the named entity recognition model, the named entity recognition model can correctly understand the meaning of the words in the text to be recognized according to the character encodings and accurately recognize the named entities therein, realizing word disambiguation and improving the accuracy of named entity recognition.
[0141] The named entity recognition method of this embodiment can be executed by any appropriate electronic device with data processing capabilities, including but not limited to: servers, mobile terminals (such as tablet computers, mobile phones, etc.) and PCs, etc.
[0142] In practical applications, the named entity recognition method provided in the embodiment of the present application can be applied to the recognition of text to be recognized on an e-commerce platform. Figure 4 , is a flow chart of a method for named entity recognition for an e-commerce platform according to Embodiment 4 of the present application, such as Figure 4 As shown, the method may include but is not limited to the following steps:
[0143] S402: Generate a basic graph corresponding to the text to be recognized for the e-commerce platform, where the basic graph includes multiple character nodes.
[0144] In one implementation of the present application, step S402 includes: determining multiple character nodes based on the characters in the text to be recognized; adding connecting edges for representing the word order relationship between the characters between the multiple character nodes based on the word order relationship between the characters in the text to be recognized, and generating a basic graph.
[0145] S404: Obtain word collocation rules that match the text to be recognized.
[0146] The word collocation rules include a number of words and word order relationships between the words, and the words include brand names and / or product names.
[0147] Specifically, the word collocation rules may be, for example, the word collocation rules corresponding to “card” and “mobile phone” in the above embodiments, which will not be described in detail here.
[0148] S406: Determine a plurality of first character nodes corresponding to the words in the word collocation rule from the plurality of character nodes in the basic graph.
[0149] S408. According to the word order relationship between words in the word collocation rule, at least a connection edge for representing the word collocation rule is added to the basic graph to generate a target graph to identify the brand name and / or product name in the text to be identified.
[0150] The connection edge used to represent the word collocation rule is connected to some or all of the first character nodes.
[0151] In this embodiment, the specific steps of steps S402-S408 can refer to the above embodiment, and will not be repeated in this embodiment.
[0152] In one implementation of the present application, connecting edges for representing the word collocation rules are added to the basic graph according to the word order relationship between the words in the word collocation rules, including: determining the sequence of several first character nodes according to the word order relationship between the words in the word collocation rules; adding directed edges corresponding to the sequence of several first character nodes between the several first character nodes as connecting edges for representing the word collocation rules.
[0153] In one implementation of the present application, according to the word order relationship between words in the word collocation rule, connecting edges for representing the word collocation rule are added to the basic graph, including: according to the words in the word collocation rule, rule nodes corresponding to the word collocation rule are added to the basic graph; according to the word order relationship between words in the word collocation rule, the rule node is connected to several first character nodes through the connecting edges for representing the word collocation rule.
[0154] Specifically, if the rule node includes a starting rule node, the rule node is connected to several first character nodes through a connecting edge used to represent the word collocation rule according to the word order relationship between the words in the word collocation rule, including: determining the character node corresponding to the starting character of the word in the word collocation rule from several first character nodes according to the word order relationship between the words in the word collocation rule; connecting the starting rule node with the character node corresponding to the starting character through a connecting edge used to represent the word collocation rule.
[0155] Alternatively, if the rule node includes an end rule node, the rule node is connected to several first character nodes according to the word order relationship between words in the word collocation rule through a connecting edge used to represent the word collocation rule, including: determining the character node corresponding to the end character of the word in the word collocation rule from several first character nodes according to the word order relationship between words in the word collocation rule; and connecting the end rule node to the character node corresponding to the end character through a connecting edge used to represent the word collocation rule.
[0156] Alternatively, if the rule node includes a transition rule node, the rule node is connected to a number of first character nodes through a connecting edge used to represent the word collocation rule according to the word order relationship between the words in the word collocation rule, including: determining a first word and a second word from the words in the word collocation rule according to the word order relationship between the words in the word collocation rule, wherein the first word is adjacent to the second word and the first word is located before the second word; determining a character node corresponding to the end character of the first word from the number of first character nodes, and determining a character node corresponding to the start character of the second word; connecting the character node corresponding to the end character of the first word to the transition rule node through a connecting edge used to represent the word collocation rule, and connecting the transition rule node to the character node corresponding to the start character of the second word.
[0157] In one implementation of the present application, at least a connecting edge for representing the word collocation rule is added to the basic graph according to the word order relationship between the words in the word collocation rule. Thereafter, the method further includes: determining the weight of the connecting edge for representing the word collocation rule according to the usage probability of the word collocation rule.
[0158] The solution provided in this embodiment generates a basic graph corresponding to the text to be recognized for the e-commerce platform, the basic graph includes multiple character nodes; obtains a word collocation rule matching the text to be recognized, the word collocation rule includes multiple words and word order relationships between the multiple words, and the words include brand names and / or product names; determines multiple first character nodes corresponding to the words in the word collocation rule from multiple character nodes of the basic graph; according to the word order relationship between the words in the word collocation rule, at least add connecting edges connected to some or all of the multiple first character nodes and used to represent the word collocation rule to the basic graph, that is, integrate the word collocation rule into the basic graph, and generate a target graph, so that the target graph can not only represent the text to be recognized, but also represent the collocation rules corresponding to the text to be recognized, and when words with two or more meanings are used according to the word collocation rules, the meaning of the words is relatively fixed and unique, so that according to the target graph that can represent the collocation rules corresponding to the text to be recognized, the meaning of the words in the text to be recognized can be correctly understood, and word disambiguation is achieved, so that when the brand name and / or product name in the text to be recognized is recognized according to the target graph, the accuracy of named entity recognition can be improved.
[0159] The named entity recognition method for an e-commerce platform of this embodiment can be executed by any appropriate electronic device with data processing capabilities, including but not limited to: servers, mobile terminals (such as tablet computers, mobile phones, etc.) and PCs, etc.
[0160] In practical applications, the named entity recognition method provided in the embodiment of the present application can be applied to the recognition of case documents. Figure 5, is a flow chart of a method for identifying case clues in Embodiment 5 of the present application, such as Figure 5 As shown, the method may include but is not limited to the following steps:
[0161] S502: Generate a basic graph corresponding to the case document to be identified, where the basic graph includes multiple character nodes.
[0162] In one implementation of the present application, step S502 may include: determining multiple character nodes based on the characters in the text to be recognized; adding connecting edges for representing the word order relationship between characters between the multiple character nodes based on the word order relationship between the characters in the text to be recognized, and generating a basic graph.
[0163] S504: Obtain word collocation rules that match the case document to be identified, where the word collocation rules include a number of words and a word order relationship of a number of word combinations as case clues.
[0164] The words included in the word collocation rules may be, for example, "chewing gum" and "unlock", and the word order relationship between the two may be that "chewing gum" comes first and "unlock" comes second.
[0165] S506: Determine a plurality of first character nodes corresponding to the words in the word collocation rule from the plurality of character nodes in the basic graph.
[0166] S508. According to the word order relationship between words in the word collocation rules, at least a connecting edge for representing the word collocation rules is added to the basic graph to generate a target graph to identify case clues in the case documents to be identified.
[0167] The connecting edge used to represent the word collocation rule is connected to some or all of the first character nodes. In this embodiment, the specific steps of steps S502-S508 can refer to the above embodiment, and will not be repeated in this embodiment.
[0168] In this embodiment, a case map can be established based on the identified key clues.
[0169] In one implementation of the present application, connecting edges for representing the word collocation rules are added to the basic graph according to the word order relationship between the words in the word collocation rules, including: determining the sequence of several first character nodes according to the word order relationship between the words in the word collocation rules; adding directed edges corresponding to the sequence of several first character nodes between the several first character nodes as connecting edges for representing the word collocation rules.
[0170] In one implementation of the present application, according to the word order relationship between words in the word collocation rule, connecting edges for representing the word collocation rule are added to the basic graph, including: according to the words in the word collocation rule, rule nodes corresponding to the word collocation rule are added to the basic graph; according to the word order relationship between words in the word collocation rule, the rule node is connected to several first character nodes through the connecting edges for representing the word collocation rule.
[0171] Specifically, if the rule node includes a starting rule node, the rule node is connected to several first character nodes through a connecting edge used to represent the word collocation rule according to the word order relationship between the words in the word collocation rule, including: determining the character node corresponding to the starting character of the word in the word collocation rule from several first character nodes according to the word order relationship between the words in the word collocation rule; connecting the starting rule node with the character node corresponding to the starting character through a connecting edge used to represent the word collocation rule.
[0172] Alternatively, if the rule node includes an end rule node, the rule node is connected to several first character nodes according to the word order relationship between words in the word collocation rule through a connecting edge used to represent the word collocation rule, including: determining the character node corresponding to the end character of the word in the word collocation rule from several first character nodes according to the word order relationship between words in the word collocation rule; and connecting the end rule node to the character node corresponding to the end character through a connecting edge used to represent the word collocation rule.
[0173] Alternatively, if the rule node includes a transition rule node, the rule node is connected to a number of first character nodes through a connecting edge used to represent the word collocation rule according to the word order relationship between the words in the word collocation rule, including: determining a first word and a second word from the words in the word collocation rule according to the word order relationship between the words in the word collocation rule, wherein the first word is adjacent to the second word and the first word is located before the second word; determining a character node corresponding to the end character of the first word from the number of first character nodes, and determining a character node corresponding to the start character of the second word; connecting the character node corresponding to the end character of the first word to the transition rule node through a connecting edge used to represent the word collocation rule, and connecting the transition rule node to the character node corresponding to the start character of the second word.
[0174] In one implementation of the present application, at least a connecting edge for representing the word collocation rule is added to the basic graph according to the word order relationship between the words in the word collocation rule. Thereafter, the method further includes: determining the weight of the connecting edge for representing the word collocation rule according to the usage probability of the word collocation rule.
[0175] The solution provided by this embodiment generates a basic graph corresponding to the case document to be identified, the basic graph includes multiple character nodes; obtains a word collocation rule matching the case document to be identified, the word collocation rule includes a number of words and a word order relationship of a combination of the words as a case clue; determines a number of first character nodes corresponding to the words in the word collocation rule from the multiple character nodes of the basic graph; according to the word order relationship between the words in the word collocation rule, adds at least a connection edge connected to some or all of the first character nodes and used to represent the word collocation rule in the basic graph, that is, integrates the word collocation rule into the basic graph, and generates a target graph, so that the target graph can not only represent the case document to be identified, but also represent the collocation rules corresponding to the case document to be identified, and when used according to the word collocation rules, the words can generally be determined as key clues, so that according to the target graph that can represent the collocation rules corresponding to the case document to be identified, the correct case clues can be screened and the accuracy of case clue identification can be improved.
[0176] The case clue identification method of this embodiment can be executed by any appropriate electronic device with data processing capabilities, including but not limited to: servers, mobile terminals (such as tablet computers, mobile phones, etc.) and PCs, etc.
[0177] In practical applications, the named entity recognition method provided in the embodiment of the present application can be applied to the recognition of indictments. Figure 6 , is a flowchart of a content identification method according to Embodiment 6 of the present application. Figure 6 As shown, the method may include but is not limited to the following steps:
[0178] S602: Generate a basic graph corresponding to the indictment to be identified.
[0179] The base graph includes multiple character nodes.
[0180] In one implementation of the present application, step S602 includes: determining multiple character nodes based on the characters in the text to be recognized; adding connecting edges for representing the word order relationship between the characters between the multiple character nodes based on the word order relationship between the characters in the text to be recognized, and generating a basic graph.
[0181] S604: Obtain word matching rules that match the indictment to be identified.
[0182] The collocation rules include the word order relationship of several words and several word combinations as key content.
[0183] The words included in the word collocation rules may be, for example, "plaintiff" and "Xiao Ming", and the word order relationship between the two may be that "plaintiff" comes first and "Xiao Ming" comes second.
[0184] S606: Determine a plurality of first character nodes corresponding to the words in the word collocation rule from the plurality of character nodes in the basic graph.
[0185] S608. According to the word order relationship between words in the word collocation rules, at least a connecting edge for representing the word collocation rules is added to the basic graph to generate a target graph to identify key content in the indictment to be identified.
[0186] The connection edge used to represent the word collocation rule is connected to part or all of the first character nodes.
[0187] In this embodiment, the specific steps of steps S602-S608 can refer to the above embodiment, and will not be repeated in this embodiment.
[0188] In one implementation of the present application, connecting edges for representing the word collocation rules are added to the basic graph according to the word order relationship between the words in the word collocation rules, including: determining the sequence of several first character nodes according to the word order relationship between the words in the word collocation rules; adding directed edges corresponding to the sequence of several first character nodes between the several first character nodes as connecting edges for representing the word collocation rules.
[0189] In one implementation of the present application, according to the word order relationship between words in the word collocation rule, connecting edges for representing the word collocation rule are added to the basic graph, including: according to the words in the word collocation rule, rule nodes corresponding to the word collocation rule are added to the basic graph; according to the word order relationship between words in the word collocation rule, the rule node is connected to several first character nodes through the connecting edges for representing the word collocation rule.
[0190] Specifically, if the rule node includes a starting rule node, the rule node is connected to several first character nodes through a connecting edge used to represent the word collocation rule according to the word order relationship between the words in the word collocation rule, including: determining the character node corresponding to the starting character of the word in the word collocation rule from several first character nodes according to the word order relationship between the words in the word collocation rule; connecting the starting rule node with the character node corresponding to the starting character through a connecting edge used to represent the word collocation rule.
[0191] Alternatively, if the rule node includes an end rule node, the rule node is connected to several first character nodes according to the word order relationship between words in the word collocation rule through a connecting edge used to represent the word collocation rule, including: determining the character node corresponding to the end character of the word in the word collocation rule from several first character nodes according to the word order relationship between words in the word collocation rule; and connecting the end rule node to the character node corresponding to the end character through a connecting edge used to represent the word collocation rule.
[0192] Alternatively, if the rule node includes a transition rule node, the rule node is connected to a number of first character nodes through a connecting edge used to represent the word collocation rule according to the word order relationship between the words in the word collocation rule, including: determining a first word and a second word from the words in the word collocation rule according to the word order relationship between the words in the word collocation rule, wherein the first word is adjacent to the second word and the first word is located before the second word; determining a character node corresponding to the end character of the first word from the number of first character nodes, and determining a character node corresponding to the start character of the second word; connecting the character node corresponding to the end character of the first word to the transition rule node through a connecting edge used to represent the word collocation rule, and connecting the transition rule node to the character node corresponding to the start character of the second word.
[0193] In one implementation of the present application, at least a connecting edge for representing the word collocation rule is added to the basic graph according to the word order relationship between the words in the word collocation rule. Thereafter, the method further includes: determining the weight of the connecting edge for representing the word collocation rule according to the usage probability of the word collocation rule.
[0194] S610. Based on the identified key contents, the indictment to be identified is structured.
[0195] For the specific method of performing structured processing, please refer to the relevant technology, which will not be described in detail in this embodiment.
[0196] The solution provided by this embodiment determines several first character nodes corresponding to words in the word collocation rules from multiple character nodes of the basic graph; according to the word order relationship between the words in the word collocation rules, at least connecting edges connected to some or all of the several first character nodes and used to represent the word collocation rules are added to the basic graph, that is, the word collocation rules are integrated into the basic graph to generate a target graph, so that the target graph can not only represent the characters in the indictment to be identified, but also represent the collocation rules corresponding to the indictment to be identified. When the words are used according to the word collocation rules, the content corresponding to the words can generally be directly determined as the key content in the indictment to be identified. Therefore, according to the target graph that can represent the collocation rules corresponding to the indictment to be identified, the key content in the indictment to be identified can be accurately identified, the accuracy of key content identification is improved, and the indictment to be identified can be structured according to the identified key content.
[0197] The content identification method of this embodiment can be executed by any appropriate electronic device with data processing capabilities, including but not limited to: a server, a mobile terminal (such as a tablet computer, a mobile phone, etc.) and a PC, etc.
[0198] Figure 7Schematic diagram of the structure of the named entity recognition device in the seventh embodiment of the present application; Figure 7 As shown, it includes: a basic graph generation module 702, a rule determination module 704, a first character node determination module 706, and a target graph generation module 708.
[0199] The basic graph generation module 702 is used to generate a basic graph corresponding to the text to be recognized, and the basic graph includes multiple character nodes.
[0200] The rule determination module 704 is used to obtain a word collocation rule that matches the text to be recognized. The word collocation rule includes a number of words and word order relationships between the words.
[0201] The first character node determination module 706 is used to determine a plurality of first character nodes corresponding to the words in the word collocation rule from the plurality of character nodes in the basic graph.
[0202] The target graph generation module 708 is used to add at least a connecting edge for representing the word collocation rule in the basic graph according to the word order relationship between the words in the word collocation rule, and generate a target graph to identify the named entities in the text to be identified, wherein the connecting edge for representing the word collocation rule is connected to some or all of the first character nodes.
[0203] Optionally, in any embodiment of the present application, the target graph generation module 708 includes: a sequence determination module, used to determine the sequence of a number of first character nodes based on the word order relationship between words in the word collocation rules; an edge addition module, used to add directed edges corresponding to the sequence of a number of first character nodes between the number of first character nodes as connecting edges for representing the word collocation rules.
[0204] Optionally, in any embodiment of the present application, the target graph generation module 708 includes: a rule node determination module, which is used to add rule nodes corresponding to the word collocation rules to the basic graph according to the words in the word collocation rules; and a node connection module, which is used to connect the rule nodes with several first character nodes through connecting edges used to characterize the word collocation rules according to the word order relationship between the words in the word collocation rules.
[0205] Optionally, in any embodiment of the present application, if the rule node includes a starting rule node, the node connection module includes: a starting node determination module, used to determine, from a number of first character nodes, a character node corresponding to the starting character of a word in the word collocation rule based on the word order relationship between words in the word collocation rule; and a starting node connection module, used to connect the starting rule node with the character node corresponding to the starting character through a connecting edge used to characterize the word collocation rule.
[0206] Optionally, in any embodiment of the present application, if the rule node includes an end rule node, the node connection module includes: an end node determination module, used to determine, from a number of first character nodes, a character node corresponding to the end character of a word in the word collocation rule based on the word order relationship between words in the word collocation rule; and an end node connection module, used to connect the end rule node with the character node corresponding to the end character through a connecting edge used to represent the word collocation rule.
[0207] Optionally, in any embodiment of the present application, if the rule node includes a transition rule node, the node connection module includes: an adjacent word determination module, used to determine a first word and a second word from the words in the word collocation rule according to the word order relationship between the words in the word collocation rule, wherein the first word is adjacent to the second word and the first word is located before the second word; a transition node determination module, used to determine, from a number of first character nodes, a character node corresponding to the end character of the first word, and determine a character node corresponding to the start character of the second word; a transition node connection module, using a connection edge for representing the word collocation rule to connect the character node corresponding to the end character of the first word with the transition rule node, and to connect the transition rule node with the character node corresponding to the start character of the second word.
[0208] Optionally, in any embodiment of the present application, the target graph generation module 708 includes: a weight determination module, used to determine the weight of the connection edge used to characterize the word collocation rule according to the usage probability of the word collocation rule.
[0209] Optionally, in any embodiment of the present application, the basic graph generation module 702 includes: a character node determination module, used to determine multiple character nodes based on the characters in the text to be recognized; a basic graph generation sub-module, used to add connecting edges for representing the word order relationship between characters between multiple character nodes based on the word order relationship between characters in the text to be recognized, so as to generate a basic graph.
[0210] The solution provided in this embodiment generates a basic graph corresponding to the text to be recognized, the basic graph includes multiple character nodes; determines the word collocation rules matching the text to be recognized, the word collocation rules include multiple words and the word order relationship between the multiple words; determines multiple first character nodes corresponding to the words in the word collocation rules from the multiple character nodes of the basic graph; according to the word order relationship between the words in the word collocation rules, at least add connecting edges connected to some or all of the multiple first character nodes and used to represent the word collocation rules to the basic graph, that is, integrate the word collocation rules into the basic graph, and generate a target graph, so that the target graph can not only represent the text to be recognized, but also represent the collocation rules corresponding to the text to be recognized, and when words with two or more meanings are used according to the word collocation rules, the meanings of the words are relatively fixed and unique, so that according to the target graph that can represent the collocation rules corresponding to the text to be recognized, the meanings of the words in the text to be recognized can be correctly understood, and word disambiguation can be achieved, so that when the named entities in the text to be recognized are recognized according to the target graph, the accuracy of named entity recognition can be improved.
[0211] The named entity recognition device of this embodiment can be executed by any appropriate electronic device with data processing capabilities, including but not limited to: a server, a mobile terminal (such as a tablet computer, a mobile phone, etc.) and a PC, etc.
[0212] Figure 8 Schematic diagram of the structure of the named entity recognition device in the eighth embodiment of the present application; Figure 7 As shown, it includes: a basic graph generation module 802, a rule determination module 804, a first character node determination module 806, a target graph generation module 808, a graph neural network module 810, and a named entity recognition module 812.
[0213] The basic graph generation module 802 is used to generate a basic graph corresponding to the text to be recognized, and the basic graph includes multiple character nodes.
[0214] The rule determination module 804 is used to obtain a word collocation rule that matches the text to be recognized. The word collocation rule includes a number of words and word order relationships between the words.
[0215] The first character node determination module 806 is used to determine a plurality of first character nodes corresponding to the words in the word collocation rule from the plurality of character nodes in the basic graph.
[0216] The target graph generation module 808 is used to add at least a connecting edge for representing the word collocation rule in the basic graph according to the word order relationship between the words in the word collocation rule to generate a target graph, wherein the connecting edge for representing the word collocation rule is connected to some or all of the first character nodes.
[0217] The graph neural network module 810 is used to input the target graph into the graph neural network model, and determine the character encoding corresponding to each character in the text to be recognized through the graph neural network model.
[0218] The named entity recognition module 812 is used to input the character code into the named entity recognition model, and recognize the named entities in the text to be recognized through the named entity recognition model.
[0219] Optionally, in any embodiment of the present application, the target graph generation module 808 includes: a sequence determination module, used to determine the sequence of a number of first character nodes based on the word order relationship between words in the word collocation rules; an edge adding module, used to add directed edges corresponding to the sequence of a number of first character nodes between the number of first character nodes as connecting edges for representing the word collocation rules.
[0220] Optionally, in any embodiment of the present application, the target graph generation module 808 includes: a rule node determination module, which is used to add rule nodes corresponding to the word collocation rules to the basic graph according to the words in the word collocation rules; and a node connection module, which is used to connect the rule nodes with several first character nodes through connecting edges used to characterize the word collocation rules according to the word order relationship between the words in the word collocation rules.
[0221] Optionally, in any embodiment of the present application, if the rule node includes a starting rule node, the node connection module includes: a starting node determination module, used to determine, from a number of first character nodes, a character node corresponding to the starting character of a word in the word collocation rule based on the word order relationship between words in the word collocation rule; and a starting node connection module, used to connect the starting rule node with the character node corresponding to the starting character through a connecting edge used to characterize the word collocation rule.
[0222] Optionally, in any embodiment of the present application, if the rule node includes an end rule node, the node connection module includes: an end node determination module, used to determine, from a number of first character nodes, a character node corresponding to the end character of a word in the word collocation rule based on the word order relationship between words in the word collocation rule; and an end node connection module, used to connect the end rule node with the character node corresponding to the end character through a connecting edge used to represent the word collocation rule.
[0223] Optionally, in any embodiment of the present application, if the rule node includes a transition rule node, the node connection module includes: an adjacent word determination module, used to determine a first word and a second word from the words in the word collocation rule according to the word order relationship between the words in the word collocation rule, wherein the first word is adjacent to the second word and the first word is located before the second word; a transition node determination module, used to determine, from a number of first character nodes, a character node corresponding to the end character of the first word, and determine a character node corresponding to the start character of the second word; a transition node connection module, using a connection edge for representing the word collocation rule to connect the character node corresponding to the end character of the first word with the transition rule node, and to connect the transition rule node with the character node corresponding to the start character of the second word.
[0224] Optionally, in any embodiment of the present application, the target graph generation module 808 includes: a weight determination module, used to determine the weight of the connection edge used to characterize the word collocation rule according to the usage probability of the word collocation rule.
[0225] Optionally, in any embodiment of the present application, the basic graph generation module 802 includes: a character node determination module, used to determine multiple character nodes based on the characters in the text to be recognized; a basic graph generation sub-module, used to add connecting edges for representing the word order relationship between characters between multiple character nodes based on the word order relationship between characters in the text to be recognized, so as to generate a basic graph.
[0226] The embodiment of the present application provides a named entity recognition solution, which generates a basic graph corresponding to a text to be recognized, the basic graph includes multiple character nodes; obtains a word collocation rule matching the text to be recognized, the word collocation rule includes multiple words and a word order relationship between the multiple words; determines multiple first character nodes corresponding to the words in the word collocation rule from multiple character nodes of the basic graph; according to the word order relationship between the words in the word collocation rule, at least adds a connection edge connected to part or all of the multiple first character nodes and used to represent the word collocation rule in the basic graph, that is, integrates the word collocation rule into the basic graph, and generates a target graph, so that the target graph It can not only represent the text to be recognized, but also represent the collocation rules corresponding to the text to be recognized. When words with two or more meanings are used according to the collocation rules, their meanings are relatively fixed and unique. Therefore, the target graph is input into the graph neural network model. After the character encoding corresponding to each character in the text to be recognized is determined by the graph neural network model, the obtained character encoding is also integrated with the collocation rules. After the character encoding is input into the named entity recognition model, the named entity recognition model can correctly understand the meaning of the words in the text to be recognized and accurately identify the named entities therein, thereby realizing word disambiguation and improving the accuracy of named entity recognition.
[0227] The named entity recognition device of this embodiment can be executed by any appropriate electronic device with data processing capabilities, including but not limited to: a server, a mobile terminal (such as a tablet computer, a mobile phone, etc.) and a PC, etc.
[0228] Embodiment 9 of the present application provides a named entity recognition device for an e-commerce platform, which includes: a basic graph generation module, a rule determination module, a first character node determination module, and a target graph generation module. The structure diagram of the named entity recognition device for an e-commerce platform provided in this embodiment can also be referred to Figure 7 .
[0229] The basic graph generation module is used to generate a basic graph corresponding to the text to be recognized for the e-commerce platform, and the basic graph includes multiple character nodes.
[0230] The rule determination module is used to obtain a word collocation rule that matches the text to be recognized. The word collocation rule includes a number of words and word order relationships between the words. The words include brand names and / or product names.
[0231] The first character node determination module is used to determine a plurality of first character nodes corresponding to the words in the word collocation rule from the plurality of character nodes in the basic graph.
[0232] A target graph generation module is used to add at least a connection edge for representing the word collocation rule in the basic graph according to the word order relationship between the words in the word collocation rule, and generate a target graph to identify the brand name and / or product name in the text to be identified, wherein the connection edge for representing the word collocation rule is connected to some or all of the first character nodes.
[0233] Optionally, in any embodiment of the present application, the target graph generation module includes: a sequence determination module, used to determine the sequence of several first character nodes according to the word order relationship between words in the word collocation rules; an edge addition module, used to add directed edges corresponding to the sequence of several first character nodes between the several first character nodes as connecting edges for representing the word collocation rules.
[0234] Optionally, in any embodiment of the present application, the target graph generation module includes: a rule node determination module, which is used to add rule nodes corresponding to the word collocation rules to the basic graph according to the words in the word collocation rules; and a node connection module, which is used to connect the rule nodes with several first character nodes through connecting edges used to characterize the word collocation rules according to the word order relationship between the words in the word collocation rules.
[0235] Optionally, in any embodiment of the present application, if the rule node includes a starting rule node, the node connection module includes: a starting node determination module, used to determine, from a number of first character nodes, a character node corresponding to the starting character of a word in the word collocation rule based on the word order relationship between words in the word collocation rule; and a starting node connection module, used to connect the starting rule node with the character node corresponding to the starting character through a connecting edge used to characterize the word collocation rule.
[0236] Optionally, in any embodiment of the present application, if the rule node includes an end rule node, the node connection module includes: an end node determination module, used to determine, from a number of first character nodes, a character node corresponding to the end character of a word in the word collocation rule based on the word order relationship between words in the word collocation rule; and an end node connection module, used to connect the end rule node with the character node corresponding to the end character through a connecting edge used to represent the word collocation rule.
[0237] Optionally, in any embodiment of the present application, if the rule node includes a transition rule node, the node connection module includes: an adjacent word determination module, used to determine a first word and a second word from the words in the word collocation rule according to the word order relationship between the words in the word collocation rule, wherein the first word is adjacent to the second word and the first word is located before the second word; a transition node determination module, used to determine, from a number of first character nodes, a character node corresponding to the end character of the first word, and determine a character node corresponding to the start character of the second word; a transition node connection module, using a connection edge for representing the word collocation rule to connect the character node corresponding to the end character of the first word with the transition rule node, and to connect the transition rule node with the character node corresponding to the start character of the second word.
[0238] Optionally, in any embodiment of the present application, the target graph generation module includes: a weight determination module, used to determine the weight of the connecting edge used to characterize the word collocation rule according to the usage probability of the word collocation rule.
[0239] Optionally, in any embodiment of the present application, the basic graph generation module includes: a character node determination module, used to determine multiple character nodes based on the characters in the text to be recognized; a basic graph generation sub-module, used to add connecting edges for representing the word order relationship between characters between multiple character nodes based on the word order relationship between characters in the text to be recognized, so as to generate a basic graph.
[0240] The solution provided in this embodiment generates a basic graph corresponding to the text to be recognized for the e-commerce platform, the basic graph includes multiple character nodes; obtains a word collocation rule matching the text to be recognized, the word collocation rule includes multiple words and word order relationships between the multiple words, and the words include brand names and / or product names; determines multiple first character nodes corresponding to the words in the word collocation rule from multiple character nodes of the basic graph; according to the word order relationship between the words in the word collocation rule, at least add connecting edges connected to some or all of the multiple first character nodes and used to represent the word collocation rule to the basic graph, that is, integrate the word collocation rule into the basic graph, and generate a target graph, so that the target graph can not only represent the text to be recognized, but also represent the collocation rules corresponding to the text to be recognized, and when words with two or more meanings are used according to the word collocation rules, the meaning of the words is relatively fixed and unique, so that according to the target graph that can represent the collocation rules corresponding to the text to be recognized, the meaning of the words in the text to be recognized can be correctly understood, and word disambiguation is achieved, so that when the brand name and / or product name in the text to be recognized is recognized according to the target graph, the accuracy of named entity recognition can be improved.
[0241] The named entity recognition device for the e-commerce platform of this embodiment can be executed by any appropriate electronic device with data processing capabilities, including but not limited to: servers, mobile terminals (such as tablet computers, mobile phones, etc.) and PCs, etc.
[0242] The tenth embodiment of the present application provides a case clue identification device, which includes: a basic graph generation module, a rule determination module, a first character node determination module, and a target graph generation module. The structural diagram of the case clue identification device provided in this embodiment can also refer to Figure 7 .
[0243] The basic graph generation module is used to generate a basic graph corresponding to the case document to be identified, and the basic graph includes multiple character nodes.
[0244] The rule determination module is used to obtain word collocation rules that match the case document to be identified. The word collocation rules include a number of words and a word order relationship of a number of word combinations as case clues.
[0245] The first character node determination module is used to determine a plurality of first character nodes corresponding to the words in the word collocation rule from the plurality of character nodes in the basic graph.
[0246] A target graph generation module is used to add at least a connecting edge for representing the word collocation rules in the basic graph according to the word order relationship between the words in the word collocation rules, and generate a target graph to identify case clues in the case documents to be identified, wherein the connecting edge for representing the word collocation rules is connected to some or all of the first character nodes.
[0247] Optionally, in any embodiment of the present application, the target graph generation module includes: a sequence determination module, used to determine the sequence of several first character nodes according to the word order relationship between words in the word collocation rules; an edge addition module, used to add directed edges corresponding to the sequence of several first character nodes between the several first character nodes as connecting edges for representing the word collocation rules.
[0248] Optionally, in any embodiment of the present application, the target graph generation module includes: a rule node determination module, which is used to add rule nodes corresponding to the word collocation rules to the basic graph according to the words in the word collocation rules; and a node connection module, which is used to connect the rule nodes with several first character nodes through connecting edges used to characterize the word collocation rules according to the word order relationship between the words in the word collocation rules.
[0249] Optionally, in any embodiment of the present application, if the rule node includes a starting rule node, the node connection module includes: a starting node determination module, used to determine, from a number of first character nodes, a character node corresponding to the starting character of a word in the word collocation rule based on the word order relationship between words in the word collocation rule; and a starting node connection module, used to connect the starting rule node with the character node corresponding to the starting character through a connecting edge used to characterize the word collocation rule.
[0250] Optionally, in any embodiment of the present application, if the rule node includes an end rule node, the node connection module includes: an end node determination module, used to determine, from a number of first character nodes, a character node corresponding to the end character of a word in the word collocation rule based on the word order relationship between words in the word collocation rule; and an end node connection module, used to connect the end rule node with the character node corresponding to the end character through a connecting edge used to represent the word collocation rule.
[0251] Optionally, in any embodiment of the present application, if the rule node includes a transition rule node, the node connection module includes: an adjacent word determination module, used to determine a first word and a second word from the words in the word collocation rule according to the word order relationship between the words in the word collocation rule, wherein the first word is adjacent to the second word and the first word is located before the second word; a transition node determination module, used to determine, from a number of first character nodes, a character node corresponding to the end character of the first word, and determine a character node corresponding to the start character of the second word; a transition node connection module, using a connection edge for representing the word collocation rule to connect the character node corresponding to the end character of the first word with the transition rule node, and to connect the transition rule node with the character node corresponding to the start character of the second word.
[0252] Optionally, in any embodiment of the present application, the target graph generation module includes: a weight determination module, used to determine the weight of the connecting edge used to characterize the word collocation rule according to the usage probability of the word collocation rule.
[0253] Optionally, in any embodiment of the present application, the basic graph generation module includes: a character node determination module, used to determine multiple character nodes based on the characters in the text to be recognized; a basic graph generation sub-module, used to add connecting edges for representing the word order relationship between characters between multiple character nodes based on the word order relationship between characters in the text to be recognized, so as to generate a basic graph.
[0254] The solution provided by this embodiment generates a basic graph corresponding to the case document to be identified, the basic graph includes multiple character nodes; obtains a word collocation rule matching the case document to be identified, the word collocation rule includes a number of words and a word order relationship of a combination of the words as a case clue; determines a number of first character nodes corresponding to the words in the word collocation rule from the multiple character nodes of the basic graph; according to the word order relationship between the words in the word collocation rule, adds at least a connection edge connected to some or all of the first character nodes and used to represent the word collocation rule in the basic graph, that is, integrates the word collocation rule into the basic graph, and generates a target graph, so that the target graph can not only represent the case document to be identified, but also represent the collocation rules corresponding to the case document to be identified, and when used according to the word collocation rules, the words can generally be determined as key clues, so that according to the target graph that can represent the collocation rules corresponding to the case document to be identified, the correct case clues can be screened and the accuracy of case clue identification can be improved.
[0255] The case clue identification device of this embodiment can be executed by any appropriate electronic device with data processing capabilities, including but not limited to: servers, mobile terminals (such as tablet computers, mobile phones, etc.) and PCs, etc.
[0256] Fig. 9 This is a structural diagram of the content identification device in Example 11 of the present application; Example 11 of the present application provides a content identification device, which includes: a basic graph generation module 902, a rule determination module 904, a first character node determination module 906, a target graph generation module 908, and a structuring module 910.
[0257] The basic graph generation module 902 is used to generate a basic graph corresponding to the indictment to be identified, and the basic graph includes multiple character nodes.
[0258] The rule determination module 904 is used to obtain the word collocation rules that match the indictment to be identified. The word collocation rules include a plurality of words and a word order relationship of a plurality of words combined as key content.
[0259] The first character node determination module 906 is used to determine a plurality of first character nodes corresponding to the words in the word collocation rule from the plurality of character nodes in the basic graph.
[0260] The target graph generation module 908 is used to add at least a connecting edge used to represent the word collocation rules in the basic graph according to the word order relationship between the words in the word collocation rules, and generate a target graph to identify the key content in the indictment to be identified, wherein the connecting edge used to represent the word collocation rules is connected to some or all of the first character nodes.
[0261] The structuring module 910 is used to structure the indictment to be identified according to the identified key contents.
[0262] Optionally, in any embodiment of the present application, the target graph generation module 908 includes: a sequence determination module, used to determine the sequence of a number of first character nodes based on the word order relationship between words in the word collocation rules; an edge addition module, used to add directed edges corresponding to the sequence of a number of first character nodes between the number of first character nodes as connecting edges for representing the word collocation rules.
[0263] Optionally, in any embodiment of the present application, the target graph generation module 908 includes: a rule node determination module, which is used to add rule nodes corresponding to the word collocation rules to the basic graph according to the words in the word collocation rules; and a node connection module, which is used to connect the rule nodes with several first character nodes through connecting edges used to characterize the word collocation rules according to the word order relationship between the words in the word collocation rules.
[0264] Optionally, in any embodiment of the present application, if the rule node includes a starting rule node, the node connection module includes: a starting node determination module, used to determine, from a number of first character nodes, a character node corresponding to the starting character of a word in the word collocation rule based on the word order relationship between words in the word collocation rule; and a starting node connection module, used to connect the starting rule node with the character node corresponding to the starting character through a connecting edge used to characterize the word collocation rule.
[0265] Optionally, in any embodiment of the present application, if the rule node includes an end rule node, the node connection module includes: an end node determination module, used to determine, from a number of first character nodes, a character node corresponding to the end character of a word in the word collocation rule based on the word order relationship between words in the word collocation rule; and an end node connection module, used to connect the end rule node with the character node corresponding to the end character through a connecting edge used to represent the word collocation rule.
[0266] Optionally, in any embodiment of the present application, if the rule node includes a transition rule node, the node connection module includes: an adjacent word determination module, used to determine a first word and a second word from the words in the word collocation rule according to the word order relationship between the words in the word collocation rule, wherein the first word is adjacent to the second word and the first word is located before the second word; a transition node determination module, used to determine, from a number of first character nodes, a character node corresponding to the end character of the first word, and determine a character node corresponding to the start character of the second word; a transition node connection module, using a connection edge for representing the word collocation rule to connect the character node corresponding to the end character of the first word with the transition rule node, and to connect the transition rule node with the character node corresponding to the start character of the second word.
[0267] Optionally, in any embodiment of the present application, the target graph generation module 908 includes: a weight determination module, used to determine the weight of the connection edge used to characterize the word collocation rule according to the usage probability of the word collocation rule.
[0268] Optionally, in any embodiment of the present application, the basic graph generation module 902 includes: a character node determination module, used to determine multiple character nodes based on the characters in the text to be recognized; a basic graph generation sub-module, used to add connecting edges for representing the word order relationship between characters between multiple character nodes based on the word order relationship between characters in the text to be recognized, so as to generate a basic graph.
[0269] The solution provided by this embodiment determines several first character nodes corresponding to words in the word collocation rules from multiple character nodes of the basic graph; according to the word order relationship between the words in the word collocation rules, at least connecting edges connected to some or all of the several first character nodes and used to represent the word collocation rules are added to the basic graph, that is, the word collocation rules are integrated into the basic graph to generate a target graph, so that the target graph can not only represent the characters in the indictment to be identified, but also represent the collocation rules corresponding to the indictment to be identified. When the words are used according to the word collocation rules, the content corresponding to the words can generally be directly determined as the key content in the indictment to be identified. Therefore, according to the target graph that can represent the collocation rules corresponding to the indictment to be identified, the key content in the indictment to be identified can be accurately identified, the accuracy of key content identification is improved, and the indictment to be identified can be structured according to the identified key content.
[0270] The content recognition device of this embodiment can be executed by any appropriate electronic device with data processing capabilities, including but not limited to: a server, a mobile terminal (such as a tablet computer, a mobile phone, etc.) and a PC, etc.
[0271] Fig.10It is a schematic diagram of the hardware structure of some electronic devices that implement the named entity recognition method of this application.
[0272] like Fig.10 As shown, the electronic device may include: a processor (processor) 1002 , a communication interface (Communications Interface) 1004 , a memory (memory) 1006 , and a communication bus 1008 .
[0273] in:
[0274] The processor 1002 , the communication interface 1004 , and the memory 1006 communicate with each other via a communication bus 1008 .
[0275] The communication interface 1004 is used to communicate with other electronic devices or servers.
[0276] The processor 1002 is used to execute the program 1010, and specifically can execute the relevant steps in the above-mentioned register allocation method embodiment.
[0277] Specifically, the program 1010 may include program codes, which include computer operation instructions.
[0278] The processor 1002 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. The one or more processors included in the smart device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.
[0279] The memory 1006 is used to store the program 1010. The memory 1006 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory. One or more modules are stored in the memory 1004, and when executed by one or more processors 1002, the named entity recognition method in any of the above method embodiments is executed.
[0280] The above-mentioned product can execute the method provided in the embodiment of the present application, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in this embodiment, please refer to the method provided in the embodiment of the present application.
[0281] The electronic device of the embodiment of the present application exists in various forms, including but not limited to:
[0282] (1) Mobile communication devices: These devices are characterized by having mobile communication functions and their main purpose is to provide voice and data communications. These terminals include: smart phones (such as iPhone), multimedia phones, functional phones, and low-end phones.
[0283] (2) Ultra-mobile personal computer devices: These devices fall into the category of personal computers, have computing and processing capabilities, and generally also have mobile Internet access features. These terminals include: PDA, MID and UMPC devices, such as iPad.
[0284] (3) Portable entertainment devices: These devices can display and play multimedia content. They include audio and video players (such as iPods), handheld game consoles, e-books, smart toys, and portable car navigation devices.
[0285] (4) Server: A device that provides computing services. The server consists of a processor, hard disk, memory, system bus, etc. The server is similar to a general computer architecture, but because it needs to provide highly reliable services, it has higher requirements in terms of processing power, stability, reliability, security, scalability, and manageability.
[0286] (5) Other electronic devices with data interaction functions.
[0287] Thus far, specific embodiments of the subject matter have been described. Other embodiments are within the scope of the appended claims. In some cases, the actions recited in the claims may be performed in a different order and still achieve the desired results. Additionally, the processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing may be advantageous.
[0288] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0289] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.
[0290] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0291] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0292] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0293] The present application is described with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, and the combination of the process and / or box in the flowchart and / or block diagram can be realized by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for realizing the function specified in one process or multiple processes in the flowchart and / or one box or multiple boxes in the block diagram.
[0294] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0295] These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0296] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0297] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0298] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0299] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0300] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0301] The present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific transactions or implement specific abstract data types. The present application may also be practiced in distributed computing environments where transactions are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0302] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0303] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A method for named entity recognition, comprising: Generate a basic graph corresponding to the text to be recognized, wherein the basic graph includes a plurality of character nodes; Acquire a word collocation rule that matches the text to be recognized, wherein the word collocation rule includes a plurality of words and a word order relationship between the plurality of words; Determining a plurality of first character nodes corresponding to the words in the word collocation rule from the plurality of character nodes in the basic graph; According to the words in the word collocation rule, rule nodes corresponding to the word collocation rule are added to the basic graph, and according to the word order relationship between the words in the word collocation rule, the rule nodes are connected to the several first character nodes through connecting edges used to characterize the word collocation rule, so as to generate a target graph to identify named entities in the text to be identified, wherein the connecting edges used to characterize the word collocation rule are connected to some or all of the several first character nodes.
2. The method according to claim 1, wherein: If the rule node includes a start rule node, the rule node is connected to the plurality of first character nodes through the connection edge used to characterize the word collocation rule according to the word order relationship between the words in the word collocation rule, including: According to the word order relationship between the words in the word collocation rule, determining a character node corresponding to the starting character of the word in the word collocation rule from the plurality of first character nodes; The starting rule node is connected to the character node corresponding to the starting character through the connecting edge used to represent the word collocation rule.
3. The method according to claim 1, wherein: If the rule node includes an end rule node, the step of connecting the rule node and the plurality of first character nodes through the connection edge used to characterize the word collocation rule according to the word order relationship between the words in the word collocation rule includes: According to the word order relationship between the words in the word collocation rule, determining a character node corresponding to the end character of the word in the word collocation rule from the plurality of first character nodes; The end rule node is connected to the character node corresponding to the end character through the connection edge used to represent the word collocation rule.
4. The method according to claim 1, wherein: If the rule node includes a transition rule node, the rule node is connected to the plurality of first character nodes through the connection edge used to characterize the word collocation rule according to the word order relationship between the words in the word collocation rule, including: Determining a first word and a second word from the words in the word collocation rule according to the word order relationship between the words in the word collocation rule, wherein the first word is adjacent to the second word and the first word is located before the second word; From the plurality of first character nodes, determine a character node corresponding to the end character of the first word, and determine a character node corresponding to the start character of the second word; The character node corresponding to the ending character of the first word is connected to the transition rule node, and the transition rule node is connected to the character node corresponding to the starting character of the second word through the connecting edge used to represent the word collocation rule.
5. The method according to claim 1, wherein: According to the word order relationship between the words in the word collocation rule, at least a connecting edge for representing the word collocation rule is added to the basic graph, and then the method further includes: The weight of the connecting edge used to characterize the word collocation rule is determined according to the usage probability of the word collocation rule.
6. The method according to claim 1, wherein: The step of generating a basic graph corresponding to the text to be recognized includes: Determining the plurality of character nodes according to the characters in the text to be recognized; According to the word order relationship between characters in the text to be recognized, connecting edges for representing the word order relationship between the characters are added between the multiple character nodes to generate the basic graph.
7. The method according to claim 1, wherein: The generating a target graph to identify the named entities in the to-be-identified text includes: Determine the character code corresponding to each character in the text to be recognized according to the target graph; The named entities in the text to be recognized are identified according to the character encoding.
8. A named entity recognition device, comprising: A basic graph generation module, used to generate a basic graph corresponding to the text to be recognized, wherein the basic graph includes a plurality of character nodes; A rule determination module, used for obtaining a word collocation rule matching the text to be recognized, wherein the word collocation rule includes a plurality of words and a word order relationship between the plurality of words; A first character node determination module, configured to determine a plurality of first character nodes corresponding to the words in the word collocation rule from the plurality of character nodes in the basic graph; A target graph generation module is used to add rule nodes corresponding to the word collocation rules in the basic graph according to the words in the word collocation rules, and connect the rule nodes with the multiple first character nodes through connecting edges used to represent the word collocation rules according to the word order relationship between the words in the word collocation rules, so as to generate a target graph to identify named entities in the text to be identified, wherein the connecting edges used to represent the word collocation rules are connected to some or all of the multiple first character nodes.
9. A method for named entity recognition, comprising: Generate a basic graph corresponding to the text to be recognized, wherein the basic graph includes a plurality of character nodes; Acquire a word collocation rule that matches the text to be recognized, wherein the word collocation rule includes a plurality of words and a word order relationship between the plurality of words; Determining a plurality of first character nodes corresponding to the words in the word collocation rule from the plurality of character nodes in the basic graph; According to the words in the word collocation rule, a rule node corresponding to the word collocation rule is added to the basic graph, and according to the word order relationship between the words in the word collocation rule, the rule node is connected to the plurality of first character nodes through a connection edge used to represent the word collocation rule to generate a target graph, wherein the connection edge used to represent the word collocation rule is connected to some or all of the plurality of first character nodes; Inputting the target graph into a graph neural network model, and determining the character encoding corresponding to each character in the text to be recognized through the graph neural network model; The character code is input into a named entity recognition model, and the named entity in the to-be-recognized text is recognized by the named entity recognition model.
10. The method according to claim 9, wherein: The adding of connecting edges for representing the word collocation rules in the basic graph according to the word order relationship between the words in the word collocation rules comprises: Determining the sequence of the plurality of first character nodes according to the word order relationship between the words in the word collocation rule; A directed edge corresponding to the sequence of the first character nodes is added between the first character nodes as the connecting edge for representing the word collocation rule.
11. The method according to claim 9, wherein: The adding of connecting edges for representing the word collocation rules in the basic graph according to the word order relationship between the words in the word collocation rules comprises: According to the words in the word collocation rule, adding a rule node corresponding to the word collocation rule to the basic graph; According to the word order relationship between the words in the word collocation rule, the rule node and the plurality of first character nodes are connected through the connection edge used to characterize the word collocation rule.
12. The method according to claim 9, wherein: According to the word order relationship between the words in the word collocation rule, at least a connecting edge for representing the word collocation rule is added to the basic graph, and then the method further includes: The weight of the connecting edge used to characterize the word collocation rule is determined according to the usage probability of the word collocation rule.
13. The method according to claim 9, wherein: The step of generating a basic graph corresponding to the text to be recognized includes: Determining the plurality of character nodes according to the characters in the text to be recognized; According to the word order relationship between characters in the text to be recognized, connecting edges for representing the word order relationship between the characters are added between the multiple character nodes to generate the basic graph.
14. A named entity recognition device, comprising: A basic graph generation module, used to generate a basic graph corresponding to the text to be recognized, wherein the basic graph includes a plurality of character nodes; A rule determination module, used for obtaining a word collocation rule matching the text to be recognized, wherein the word collocation rule includes a plurality of words and a word order relationship between the plurality of words; A first character node determination module, configured to determine a plurality of first character nodes corresponding to the words in the word collocation rule from the plurality of character nodes in the basic graph; A target graph generation module is used to add rule nodes corresponding to the word collocation rules to the basic graph according to the words in the word collocation rules, and connect the rule nodes with the plurality of first character nodes through connecting edges used to represent the word collocation rules according to the word order relationship between the words in the word collocation rules to generate a target graph, wherein the connecting edges used to represent the word collocation rules are connected to some or all of the plurality of first character nodes; A graph neural network module, used to input the target graph into a graph neural network model, and determine the character encoding corresponding to each character in the text to be recognized through the graph neural network model; The named entity recognition module is used to input the character code into a named entity recognition model, and recognize the named entities in the text to be recognized through the named entity recognition model.
15. A method for named entity recognition for an e-commerce platform, comprising: Generate a basic graph corresponding to the text to be recognized for the e-commerce platform, wherein the basic graph includes a plurality of character nodes; Acquire a word collocation rule that matches the text to be recognized, wherein the word collocation rule includes a plurality of words and word order relationships between the plurality of words, wherein the words include brand names and / or product names; Determining a plurality of first character nodes corresponding to the words in the word collocation rule from the plurality of character nodes in the basic graph; According to the words in the word collocation rule, rule nodes corresponding to the word collocation rule are added to the basic graph, and according to the word order relationship between the words in the word collocation rule, the rule nodes are connected to the several first character nodes through connecting edges used to characterize the word collocation rule, so as to generate a target graph to identify the brand name and / or product name in the text to be identified, wherein the connecting edges used to characterize the word collocation rule are connected to some or all of the several first character nodes.
16. The method according to claim 15, wherein: The adding of connecting edges for representing the word collocation rules in the basic graph according to the word order relationship between the words in the word collocation rules comprises: Determining the sequence of the plurality of first character nodes according to the word order relationship between the words in the word collocation rule; A directed edge corresponding to the sequence of the first character nodes is added between the first character nodes as the connecting edge for representing the word collocation rule.
17. The method according to claim 15, wherein: The adding of connecting edges for representing the word collocation rules in the basic graph according to the word order relationship between the words in the word collocation rules comprises: According to the words in the word collocation rule, adding a rule node corresponding to the word collocation rule to the basic graph; According to the word order relationship between the words in the word collocation rule, the rule node and the plurality of first character nodes are connected through the connection edge used to characterize the word collocation rule.
18. The method according to claim 15, wherein: According to the word order relationship between the words in the word collocation rule, at least a connecting edge for representing the word collocation rule is added to the basic graph, and then the method further includes: The weight of the connecting edge used to characterize the word collocation rule is determined according to the usage probability of the word collocation rule.
19. The method according to claim 15, wherein: The generating of the basic graph corresponding to the text to be recognized for the e-commerce platform includes: Determining the plurality of character nodes according to the characters in the text to be recognized; According to the word order relationship between characters in the text to be recognized, connecting edges for representing the word order relationship between the characters are added between the multiple character nodes to generate the basic graph.
20. A named entity recognition device for an e-commerce platform, wherein: include: A basic graph generation module, used to generate a basic graph corresponding to the text to be recognized for the e-commerce platform, wherein the basic graph includes a plurality of character nodes; A rule determination module, used for obtaining a word collocation rule matching the text to be recognized, wherein the word collocation rule includes a plurality of words and a word order relationship between the plurality of words, wherein the words include a brand name and / or a product name; A first character node determination module, configured to determine a plurality of first character nodes corresponding to the words in the word collocation rule from the plurality of character nodes in the basic graph; A target graph generation module is used to add rule nodes corresponding to the word collocation rules in the basic graph according to the words in the word collocation rules, and connect the rule nodes with the multiple first character nodes through connecting edges used to characterize the word collocation rules according to the word order relationship between the words in the word collocation rules, so as to generate a target graph to identify brand names and / or product names in the text to be identified, wherein the connecting edges used to characterize the word collocation rules are connected to some or all of the multiple first character nodes.
21. A method for identifying case clues, comprising: Generate a basic graph corresponding to the case document to be identified, wherein the basic graph includes a plurality of character nodes; Acquire a word collocation rule that matches the case document to be identified, wherein the word collocation rule includes a plurality of words and a word order relationship of a plurality of words combined into a case clue; Determining a plurality of first character nodes corresponding to the words in the word collocation rule from the plurality of character nodes in the basic graph; According to the words in the word collocation rules, rule nodes corresponding to the word collocation rules are added to the basic graph, and according to the word order relationship between the words in the word collocation rules, the rule nodes are connected to the several first character nodes through connecting edges used to characterize the word collocation rules to generate a target graph to identify case clues in the case documents to be identified, wherein the connecting edges used to characterize the word collocation rules are connected to some or all of the several first character nodes.
22. The method according to claim 21, wherein: The adding, in the basic graph, a connection edge for representing the word collocation rule according to the word order relationship between the words in the word collocation rule comprises: Determining the sequence of the plurality of first character nodes according to the word order relationship between the words in the word collocation rule; A directed edge corresponding to the sequence of the first character nodes is added between the first character nodes as the connecting edge for representing the word collocation rule.
23. The method according to claim 21, wherein: The adding, in the basic graph, a connection edge for representing the word collocation rule according to the word order relationship between the words in the word collocation rule comprises: According to the words in the word collocation rule, adding a rule node corresponding to the word collocation rule to the basic graph; According to the word order relationship between the words in the word collocation rule, the rule node and the plurality of first character nodes are connected through the connection edge used to characterize the word collocation rule.
24. The method according to claim 21, wherein: According to the word order relationship between the words in the word collocation rule, at least a connecting edge for representing the word collocation rule is added to the basic graph, and then the method further includes: The weight of the connecting edge used to characterize the word collocation rule is determined according to the usage probability of the word collocation rule.
25. The method according to claim 21, wherein: The generating of the basic graph corresponding to the case document to be identified includes: Determining the plurality of character nodes according to the characters in the case document to be identified; According to the word order relationship between characters in the case document to be identified, connecting edges for representing the word order relationship between the characters are added between the multiple character nodes to generate the basic graph.
26. A device for identifying case clues, comprising: A basic graph generation module, used to generate a basic graph corresponding to the case document to be identified, wherein the basic graph includes a plurality of character nodes; A rule determination module, used to obtain a word collocation rule that matches the case document to be identified, wherein the word collocation rule includes a plurality of words and a word order relationship of a plurality of combinations of the words as case clues; A first character node determination module, configured to determine a plurality of first character nodes corresponding to the words in the word collocation rule from the plurality of character nodes in the basic graph; A target graph generation module is used to add rule nodes corresponding to the word collocation rules in the basic graph according to the words in the word collocation rules, and connect the rule nodes with the multiple first character nodes through connecting edges used to characterize the word collocation rules according to the word order relationship between the words in the word collocation rules, so as to generate a target graph to identify case clues in the case documents to be identified, wherein the connecting edges used to characterize the word collocation rules are connected to some or all of the multiple first character nodes.
27. A content identification method, comprising: Generate a basic graph corresponding to the indictment to be identified, wherein the basic graph includes a plurality of character nodes; Acquire a word collocation rule that matches the indictment to be identified, wherein the word collocation rule includes a plurality of words and a word order relationship in which a plurality of the words are combined into key contents; Determining a plurality of first character nodes corresponding to the words in the word collocation rule from the plurality of character nodes in the basic graph; According to the words in the word collocation rule, a rule node corresponding to the word collocation rule is added to the basic graph, and according to the word order relationship between the words in the word collocation rule, the rule node is connected with the plurality of first character nodes through a connection edge used to represent the word collocation rule, so as to generate a target graph to identify the key content of the indictment to be identified, wherein the connection edge used to represent the word collocation rule is connected with some or all of the plurality of first character nodes; Based on the identified key contents, the indictment to be identified is structured.
28. The method according to claim 27, wherein: The adding of connecting edges for representing the word collocation rules in the basic graph according to the word order relationship between the words in the word collocation rules comprises: Determining the sequence of the plurality of first character nodes according to the word order relationship between the words in the word collocation rule; A directed edge corresponding to the sequence of the first character nodes is added between the first character nodes as the connecting edge for representing the word collocation rule.
29. The method according to claim 27, wherein: The adding of connecting edges for representing the word collocation rules in the basic graph according to the word order relationship between the words in the word collocation rules comprises: According to the words in the word collocation rule, adding a rule node corresponding to the word collocation rule to the basic graph; According to the word order relationship between the words in the word collocation rule, the rule node and the plurality of first character nodes are connected through the connection edge used to characterize the word collocation rule.
30. The method of claim 27, wherein: According to the word order relationship between the words in the word collocation rule, at least a connecting edge for representing the word collocation rule is added to the basic graph, and then the method further includes: The weight of the connecting edge used to characterize the word collocation rule is determined according to the usage probability of the word collocation rule.
31. The method of claim 27, wherein: The generating of the basic graph corresponding to the indictment to be identified includes: Determining the plurality of character nodes according to the characters in the case document to be identified; According to the word order relationship between characters in the case document to be identified, connecting edges for representing the word order relationship between the characters are added between the multiple character nodes to generate the basic graph.
32. A content recognition device, comprising: A basic graph generation module, used to generate a basic graph corresponding to the indictment to be identified, wherein the basic graph includes a plurality of character nodes; A rule determination module, used for obtaining a word collocation rule matching the indictment to be identified, wherein the word collocation rule includes a plurality of words and a word order relationship of a plurality of words combined as key contents; A first character node determination module, configured to determine a plurality of first character nodes corresponding to the words in the word collocation rule from the plurality of character nodes in the basic graph; A target graph generation module is used to add rule nodes corresponding to the word collocation rules to the basic graph according to the words in the word collocation rules, and connect the rule nodes with the plurality of first character nodes through connecting edges used to represent the word collocation rules according to the word order relationship between the words in the word collocation rules, so as to generate a target graph to identify the key content of the indictment to be identified, wherein the connecting edges used to represent the word collocation rules are connected to some or all of the plurality of first character nodes; The structuring module is used to structure the indictment to be identified based on the identified key contents.
33. An electronic device comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform an operation corresponding to the method as described in any one of claims 1-7, 9-13, 15-19, 21-25, and 27-31.
34. A computer storage medium having a computer program stored thereon, which, when executed by a processor, implements the method as claimed in any one of claims 1-7, 9-13, 15-19, 21-25, 27-31.
