A method, device, equipment and machine-readable medium for named entity recognition
By splitting text in named entity recognition, calculating the distance between language units and merging units, the problem of low efficiency in naming entity recognition in the prior art is solved, and efficient recognition of nested structural entities is achieved.
Patent Information
- Application Number
- CN202010140584.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-03-03
- Publication Date
- 2025-02-21
- Estimated Expiration
- 2040-03-03
AI Technical Summary
Existing named entity recognition methods are inefficient, especially when dealing with named entities with nested structures.
By dividing the text to be recognized into multiple language units, the distance between any two adjacent language units is calculated, and the combined language units are merged according to the distance, thereby determining the entity recognition result.
This method can improve the efficiency of naming entity recognition, can identify entities with nested structures, and does not rely on hierarchical neural network structures.
Smart Images

Figure CN113343693B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a named entity recognition method, a named entity recognition apparatus, a device and a machine-readable medium. Background Art
[0002] With the popularization of computers and the rapid development of the Internet, a large amount of information appears in the form of electronic documents. In order to cope with the severe challenges brought by the information explosion, automated tools are needed to extract truly valuable information from massive data, and information extraction came into being. Named entities refer to entities with specific meanings in text, such as names of people, places, institutions, proper nouns, etc. Named entity recognition (NER) plays an important role in information extraction. It can accurately identify and classify proper nouns representing named entities in text, and further provide important semantic support for many natural language processing tasks such as automatic question answering, opinion mining, and semantic analysis.
[0003] Named entities usually exist in the form of continuous characters. Inevitably, named entities are nested, that is, within a named entity, there are multiple entities with nested structures, such as "Peking University's Yanyuan" includes "Peking University", "Yanyuan" and "Peking University's Yanyuan" and other named entities. Different entities generated by the nested structure are often rich in different semantic information. In order to improve the semantic integrity of the original text, it is necessary to effectively identify and classify multiple multi-layer nested entities.
[0004] In order to identify entities with nested structures, the current named entity method adopts a multi-level long short-term memory (LSTM) model, in which the first layer of LSTM predicts the innermost entity, the second layer of LSTM predicts the second innermost entity, and so on, and the last layer of LSTM predicts the outermost entity.
[0005] In practical applications, multi-level LSTMs usually have high complexity, making named entity recognition less efficient. Summary of the invention
[0006] The technical problem to be solved by the embodiments of the present application is to provide a method for named entity recognition, which can improve the efficiency of named entity recognition.
[0007] Correspondingly, the embodiments of the present application also provide a named entity recognition device, a device and a machine-readable medium to ensure the implementation and application of the above method.
[0008] In order to solve the above problems, the present application discloses a method for named entity recognition, including:
[0009] Divide the text to be recognized into multiple language units;
[0010] Among the multiple language units, calculating the distance between any two adjacent language units;
[0011] According to the distance between any two adjacent language units, the plurality of language units are merged to obtain one or more merged language units;
[0012] An entity recognition result corresponding to the text to be recognized is determined according to the entity information respectively corresponding to the one or more merged language units.
[0013] On the other hand, an embodiment of the present application further discloses a named entity recognition device, the device comprising:
[0014] A segmentation module, used to segment the text to be recognized into multiple language units;
[0015] A distance calculation module, used for calculating the distance between any two adjacent language units among the plurality of language units;
[0016] a merging module, configured to merge the plurality of language units according to the distance between any two adjacent language units to obtain one or more merged language units; and
[0017] The result determination module is used to determine the entity recognition result corresponding to the text to be recognized according to the entity information respectively corresponding to the one or more merged language units.
[0018] On the other hand, the embodiment of the present application further discloses a device, including:
[0019] one or more processors; and
[0020] One or more machine-readable media having instructions stored thereon, when executed by the one or more processors, cause the device to perform one or more of the methods described above.
[0021] On the other hand, an embodiment of the present application discloses one or more machine-readable media having instructions stored thereon, which, when executed by one or more processors, enable a device to execute one or more of the methods described above.
[0022] The embodiments of the present application include the following advantages:
[0023] The embodiment of the present application merges multiple language units in the text to be recognized based on the distance between any two adjacent language units in the text to be recognized, and the merged information obtained in the above merging process may include: entity information corresponding to the merged language unit; the above entity information may indicate whether the merged language unit is an entity, and the entity label corresponding to the merged language unit when the merged language unit is an entity, etc. Since the embodiment of the present application can obtain the entity information corresponding to the merged language unit in the process of merging multiple language units in the text to be recognized, it can recognize entities with nested structures.
[0024] Furthermore, the embodiment of the present application may not rely on a hierarchical neural network structure to merge multiple language units in the above-mentioned text to be recognized, and determine the entity information corresponding to the merged language units, thereby improving the efficiency of named entity recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 is a flowchart of a method for named entity recognition according to an embodiment of the present application;
[0026] Figure 2 It is a schematic diagram of a tree structure in an embodiment of the present application;
[0027] Figure 3 It is a schematic diagram of a processing flow of a method for named entity recognition in an embodiment of the present application;
[0028] Figure 4 is a structural block diagram of an embodiment of a named entity recognition device of the present application; and
[0029] Figure 5 It is a structural schematic diagram of a device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0030] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0031] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions 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 present application belong to the scope of protection of this application.
[0032] The concept of the present application is susceptible to various modifications and alternative forms, and its specific embodiments have been shown in the form of drawings and will be described in detail herein. However, it should be understood that the above content is not intended to limit the concept of the present application to the specific form disclosed. On the contrary, the specification and appended claims of the present application are intended to cover all modifications, equivalents and alternative forms.
[0033] In this specification, "one embodiment", "embodiment", "a specific embodiment", etc., indicate that the described embodiment may include a specific feature, structure or characteristic, but each embodiment may or may not necessarily include the specific feature, structure or characteristic. In addition, such phrases do not necessarily refer to the same embodiment. In addition, when a specific feature, structure or characteristic is described in connection with one embodiment, whether or not it is explicitly described, it can be considered that such a feature, structure or characteristic is also related to other embodiments within the scope known to those skilled in the art. In addition, it should be understood that the items in the list included in the form of "at least one of A, B and C" may include the following possible items: (A); (B); (C); (A and B); (A and C); (B and C); or (A, B and C). Similarly, the items listed in the form of "at least one of A, B or C" may mean (A); (B); (C); (A and B); (A and C); (B and C); or (A, B and C).
[0034] In some cases, the disclosed embodiments may be implemented as hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried or stored in one or more temporary or non-temporary machine-readable (e.g., computer-readable) storage media, which may be executed by one or more processors. The machine-readable storage medium may be implemented as a storage device, mechanism, or other physical structure (e.g., volatile or non-volatile memory, media disk, or other media other physical structure device) for storing or transmitting information in a form that can be read by a machine.
[0035] In the accompanying drawings, some structural or method features may be shown in a specific arrangement and / or order. However, preferably, such a specific arrangement and / or order is not necessary. On the contrary, in some embodiments, such features may be arranged in a different manner and / or order, rather than as shown in the accompanying drawings. In addition, the content included in the structural or method features in a specific figure does not mean to imply that such features are necessary in all embodiments, and in some embodiments, these features may not be included, or these features may be combined with other features.
[0036] In response to the technical problem of low efficiency in named entity recognition, an embodiment of the present application provides a named entity recognition solution, which specifically includes: dividing the text to be recognized into multiple language units; calculating the distance between any two adjacent language units among the multiple language units; merging the multiple language units based on the distance between any two adjacent language units to obtain one or more merged language units; and determining the entity recognition result corresponding to the text to be recognized based on the entity information corresponding to the one or more merged language units.
[0037] The embodiment of the present application merges multiple language units in the text to be recognized based on the distance between any two adjacent language units in the text to be recognized, and the merged information obtained in the above merging process may include: entity information corresponding to the merged language unit; the above entity information may indicate whether the merged language unit is an entity, and the entity label corresponding to the merged language unit when the merged language unit is an entity, etc. Since the embodiment of the present application can obtain the entity information corresponding to the merged language unit in the process of merging multiple language units in the text to be recognized, it can recognize entities with nested structures.
[0038] Furthermore, the embodiment of the present application may not rely on a hierarchical neural network structure to merge multiple language units in the above-mentioned text to be recognized, and determine the entity information corresponding to the merged language units, thereby improving the efficiency of named entity recognition.
[0039] The method provided in the embodiment of the present application can be applied to an application environment corresponding to a client and a server. The client and the server are located in a wired or wireless network, and the client and the server interact with each other through the wired or wireless network.
[0040] Optionally, the client can run on a terminal, which specifically includes but is not limited to: smart phones, tablet computers, e-book readers, MP3 (Moving Picture Experts Group Audio Layer III) players, MP4 (Moving Picture Experts Group Audio Layer IV) players, laptop computers, car computers, desktop computers, set-top boxes, smart TVs, wearable devices, etc.
[0041] In the embodiment of the present application, the client may correspond to any APP (application). For example, the APP corresponding to the client may include: entity recognition APP, etc. The client may receive the text to be recognized input by the user, and return the entity recognition result corresponding to the text to be recognized to the user.
[0042] According to an embodiment, the client can use the solution of the embodiment of the present application to determine the entity recognition result corresponding to the text to be recognized.
[0043] According to another embodiment, the client may send the text to be recognized to the server, and the server may use the solution of the embodiment of the present application to determine the entity recognition result corresponding to the text to be recognized.
[0044] Method Embodiment
[0045] Reference Figure 1 , shows a flowchart of a method for named entity recognition according to an embodiment of the present application, which method may specifically include the following steps:
[0046] Step 101, dividing the text to be recognized into multiple language units;
[0047] Step 102: Calculate the distance between any two adjacent language units in the above-mentioned multiple language units;
[0048] Step 103: merging the plurality of language units according to the distance between any two adjacent language units to obtain one or more merged language units;
[0049] Step 104: Determine an entity recognition result corresponding to the text to be recognized based on the entity information corresponding to the one or more merged language units.
[0050] At least one step included in the method of the embodiment of the present application can be executed by the client or the server. It can be understood that the embodiment of the present application does not limit the specific execution entity of the steps included in the method.
[0051] In step 101, the text to be recognized can be used for entity naming recognition in the embodiment of the present application, which can represent the text to be recognized for entity naming. The text to be recognized can come from a user, or the text to be recognized can come from a client, or the text to be recognized can come from a computing device. It can be understood that the embodiment of the present application does not limit the specific source of the text to be recognized.
[0052] In the embodiment of the present application, optionally, the language unit corresponding to the above-mentioned language unit may include: a single character, or a word. For example, if the language corresponding to the text to be recognized is Chinese, the language unit corresponding to the above-mentioned language unit may include: a single character. For another example, if the language corresponding to the text to be recognized is English, the language unit corresponding to the above-mentioned language unit may include: a word, etc. It can be understood that the embodiment of the present application does not limit the specific language unit corresponding to the language unit.
[0053] In the embodiments of the present application, after the text to be recognized is segmented into multiple language units, the multiple language units in the text to be recognized can represent the text segments or parts corresponding to the text to be recognized.
[0054] For example, if the text A to be recognized is "Yanyuan of Peking University", then the text A to be recognized can be segmented into the following multiple language units: "North", "Beijing", "University", "of", "Yan", "Yuan".
[0055] In step 102, the distance between any two adjacent language units in the text to be recognized can be the semantic distance between any two adjacent language units, which can represent the matching degree of any two adjacent language units in terms of semantics.
[0056] In an alternative embodiment of the present application, calculating the distance between any two adjacent language units specifically may include: determining the features corresponding to the multiple language units respectively; and determining the semantic distance between any two adjacent language units in the text to be recognized according to the features corresponding to the multiple language units respectively.
[0057] In an alternative embodiment of the present application, a word embedding method can be used to determine the features corresponding to the multiple language units respectively. The word embedding method can map a language unit to a vector of real numbers, so that the vector can contain semantic and syntactic information.
[0058] The word embedding method can include: Word2Vec (word-to-vector), or Glove (glove) method, etc. It can be understood that the embodiments of the present application do not limit the specific word embedding method.
[0059] In an alternative embodiment of the present application, determining the features corresponding to the multiple language units respectively specifically includes: using a word embedding method to determine the first vectors corresponding to the multiple language units respectively; and using a CNN (Convolutional Neural Networks) to perform feature extraction on the first vectors to obtain second vectors. The second vectors can contain character-level features, such as the glyph features of Chinese characters' radicals and strokes, or the features of English words' prefixes and suffixes.
[0060] In an optional embodiment of the present application, the above-mentioned determination of the features corresponding to the above-mentioned multiple language units specifically includes: using a word embedding method to determine the first vectors corresponding to the above-mentioned multiple language units; using CNN (Convolutional Neural Networks) to extract features from the first vector to obtain a second vector. The second vector may include character-level features, such as the radicals and other glyph features of Chinese characters, and features such as prefixes and suffixes of English words.
[0061] In another optional embodiment of the present application, the above-mentioned determination of features corresponding to the above-mentioned multiple language units specifically includes: using a word embedding method to determine the first vectors corresponding to the above-mentioned multiple language units; using a bidirectional neural network to extract features from the first vector to obtain a third vector.
[0062] The basic idea of a bidirectional neural network is that an input sequence passes through the neural network once in both the forward and reverse directions. This bidirectional structure provides the output layer with complete past and future context information of the nodes in the input sequence. Bidirectional neural networks can include: bidirectional LSTM, or bidirectional RNN (Recurrent Neural Network), etc.
[0063] In another optional embodiment of the present application, the above-mentioned determination of features corresponding to the above-mentioned multiple language units specifically includes: using a word embedding method to determine the first vectors corresponding to the above-mentioned multiple language units; using CNN to extract features from the first vector to obtain a second vector; using a bidirectional neural network to extract features from the second vector to obtain a third vector.
[0064] The embodiment of the present application does not limit the specific process of calculating the distance between any two adjacent language units.
[0065] According to an embodiment, a similarity measurement method may be used to calculate the distance between any two adjacent language units. The similarity measurement method may include: a cosine similarity method, a Euclidean distance method, and the like.
[0066] According to another embodiment, FCN (Fully Convolutional Networks) can be used to calculate the distance between any two language units in the text to be recognized.
[0067] FCN replaces the fully connected layer with a convolutional layer to form a fully convolutional network, which can perform semantic segmentation on language units. On the basis of semantic segmentation of language units, it can improve the accuracy of the distance between any two adjacent language units.
[0068] In step 103, according to the distances between any two adjacent language units described above, the multiple language units are merged, and the language units corresponding to the language units can be gradually merged into the text to be recognized.
[0069] The merging information obtained in the above merging process may include: the entity information corresponding to the merged language unit; the entity information may characterize whether the merged language unit is an entity, and in the case where the merged language unit is an entity, the entity label corresponding to the merged language unit, etc. Since the embodiments of the present application can obtain the entity information corresponding to the merged language unit during the merging process of multiple language units in the text to be recognized, entities with nested structures can be recognized.
[0070] Optionally, the entity label may characterize the entity category. The entity label may include: PER (person name), LOC (place name), ORG (organization name), MISC (proper noun), etc.
[0071] Optionally, the merging of the multiple language units in the text to be recognized described above may include: determining the entity information corresponding to the merged language unit. The merged language unit can be used to represent the merging result of a certain merging. Determining the entity information corresponding to the merged language unit is used to determine the entity information corresponding to the merging result of a certain time.
[0072] The embodiments of the present application can use a named entity recognition method to determine the entity information corresponding to the merged language unit. The named entity recognition method may include: a rule- and dictionary-based method, a statistics-based method, or a neural network-based method, etc.
[0073] In an alternative embodiment of the present application, the determining the entity information corresponding to the merged language unit may specifically include: determining the first feature of the first merged object corresponding to the merged language unit and the second feature of the second merged object corresponding to the merged language unit; using a FCN to process the first feature and the second feature to obtain a processing result; using a normalization function to process the processing result to obtain the entity information corresponding to the merged language unit.
[0074] The merged language unit can be obtained by merging the first merged object and the second merged object. For example, "North" and "Beijing" in the aforementioned text to be recognized A can be merged into "Beijing", where "North" represents the first merged object, "Beijing" represents the second merged object, and "Beijing" represents the merged language unit. Another example is that "University" can be obtained by merging "Big" and "School" in the aforementioned text to be recognized A, where "Big" represents the first merged object, "School" represents the second merged object, and "University" represents the merged language unit.
[0075] It can be understood that the first merged object or the second merged object can be a single language unit, or the first merged object or the second merged object can be multiple language units after merging. For example, the two merged language universities in the aforementioned text to be recognized A can be further merged, such as merging "Beijing" and "University" into "Peking University", where "Beijing" represents the first merged object, "University" represents the second merged object, and "Peking University" represents the merged language unit.
[0076] By processing the first feature and the second feature using FCN, semantic segmentation can be performed on the first merged object and the second merged object, thereby improving the accuracy of the entity information corresponding to the merged language unit. The normalization function may include: Softmax() function, etc. The normalization function is used to determine the probability that the merged language unit corresponds to a certain entity information. It can be understood that the embodiments of the present application do not limit the specific normalization function.
[0077] In another optional embodiment of the present application, the above-mentioned determination of the entity information corresponding to the merged language unit may specifically include: determining the entity information corresponding to the merged language unit based on a pre-saved mapping relationship between text and entity information. Specifically, the merged language unit may be matched with the text in the mapping relationship to obtain the entity information corresponding to the merged language unit.
[0078] Optionally, the merging information may further include: a merging order corresponding to the multiple language units in the text to be recognized. For example, the merging order may include: first merging two adjacent language units into a merged language unit, then merging the merged language unit with the language unit, and so on.
[0079] The embodiment of the present application can provide the following technical solution for merging multiple language units in the above-mentioned text to be recognized:
[0080] Technical solution A1,
[0081] In technical solution A1, the merging of the multiple language units in the text to be recognized may specifically include: merging the multiple language units in the text to be recognized in the order of the distance between any two adjacent language units from small to large.
[0082] The distance between any two adjacent language units in the above-mentioned text to be recognized can be the semantic distance between any two adjacent language units, which can represent the semantic matching degree between any two adjacent language units. Generally, the smaller the distance, the higher the semantic matching degree between any two adjacent language units; conversely, the larger the distance, the lower the semantic matching degree between any two adjacent language units.
[0083] Technical solution A1 merges multiple language units in the text to be recognized in ascending order of distance, and can preferentially merge language units with high matching degrees.
[0084] In an alternative embodiment of the present application, the merging of multiple language units in the text to be recognized specifically includes: saving the distances between any two adjacent language units in ascending order to a distance set; selecting a target distance from the distance set in the order from front to back, and merging the two adjacent merging objects corresponding to the target distance; the types of the two adjacent merging objects specifically include: language unit and language unit, or language unit and merged language unit, or merged language unit and merged language unit.
[0085] According to one embodiment, the target distance may include: a first distance ranked first. The merging of the two adjacent merging objects corresponding to the target distance includes: merging the two adjacent language units corresponding to the first distance to obtain a first merged language unit.
[0086] In the embodiment of the present application, the two adjacent language units with the smallest distance can be merged first. Taking the text to be recognized A as an example, assuming that the two adjacent language units corresponding to the smallest distance are "big" and "school", then "big" and "school" can be merged first.
[0087] According to another embodiment, the target distance further includes: a second distance ranked non-first. The merging of the two adjacent merging objects corresponding to the target distance may further include: determining a first language unit from the language units adjacent to the first merged language unit according to the second distance; merging the first merged language unit and the first language unit to obtain a second merged language unit. In the embodiment of the present application, the first merged language unit and the first language unit can be merged.
[0088] Optionally, the first merged language unit specifically includes: a second language unit, the second language unit is adjacent to the first language unit, and the distance between the second language unit and the first language unit is the second distance.
[0089] According to still another embodiment, the target distance may further include: a third distance ranked non-first. The merging of the two adjacent merging objects corresponding to the target distance may further include: merging two adjacent first merged language units according to the third distance.
[0090] In the case where two first merged language units are adjacent, embodiments of the present application can merge the two adjacent first merged language units. The distance between two adjacent first merged language units can be obtained from the distance between two adjacent language units corresponding to the two adjacent first merged language units. Taking the text A to be recognized as an example, two adjacent first merged language units include: "Beijing" and "University", then the distance between "Beijing" and "University" can be determined by the distance between two adjacent single characters, that is, the distance between "Beijing" and "University" is determined based on the distance between "Jing" and "Da".
[0091] According to another embodiment, the above target distance may further include: a fourth distance that is not in the first position. The merging of the two adjacent merging objects corresponding to the above target distance may further include: merging the adjacent first merged language unit and the second merged language unit according to the above fourth distance.
[0092] It can be understood that in other embodiments of the present application, in the case where two second merged language units are adjacent, the two adjacent second merged language units can be merged. It can be understood that embodiments of the present application do not limit the first merging object and the second merging object corresponding to the merging process.
[0093] It can be understood that regardless of whether the merging object corresponding to a distance is a language unit or a merged language unit, as long as the distance meets the sorting condition, the two adjacent merging objects corresponding to the distance can be merged.
[0094] Technical solution A2
[0095] In technical solution A2, the merging of multiple language units in the text to be recognized may specifically include: dividing the multiple language units into at least two categories; merging one or more language units belonging to the same category to obtain corresponding sub-merging results; and merging the sub-merging results corresponding to the at least two categories.
[0096] Technical solution A2 can divide the language units in the text to be recognized into at least two categories, and the merging process corresponding to a single category can be independent. For example, the merging processes corresponding to different categories are independent and parallel to each other, so the merging efficiency can be improved.
[0097] In an embodiment of the present application, it is optional that the above-mentioned division of the language units in the text to be recognized into at least two categories may specifically include: dividing the language units in the text to be recognized into at least two categories based on the maximum distance between any two adjacent language units. Specifically, among the above-mentioned multiple language units, the i-th language unit and the (i+1)-th language unit with the largest distance between two adjacent language units are obtained; the i-th language unit is divided into one category, and the (i+1)-th language unit is divided into another category. It can be understood that the language unit before the i-th language unit can be divided into one category, and the language unit after the (i+1)-th language unit can be divided into another category.
[0098] Optionally, the at least two categories may include: a first category and a second category, wherein the maximum distance may be used to determine the boundary between the first category and the second category. For example, the text to be recognized includes N characters, wherein the distance between the i-th character and the (i+1)-th character is the largest, so the 1st character and the i-th character may be taken as the first category, and the (i+1)-th character and the N-th character may be taken as the second category; wherein i and N are both natural numbers greater than 0.
[0099] Taking the text A to be recognized as an example, assuming that the first category includes: "Beijing", "University", "School", and "De", and the second category includes: "Yan", "Yuan", then "University" and "School" in the first category can be merged, and "Yan" and "Yuan" in the second category can be merged; the corresponding mergers of the first category and the second category can be parallel.
[0100] Technical solution A3,
[0101] In technical solution A3, the above-mentioned merging of multiple language units in the above-mentioned text to be recognized may specifically include: when the first merged object and the second merged object are adjacent, judging whether to merge the first merged object and the second merged object based on the distance between the first merged object and the second merged object; the above-mentioned first merged object is a language unit or a merged language unit, and the second merged object is a language unit or a merged language unit.
[0102] According to an embodiment, when a first merged object and a second merged object are adjacent, if the first merged object corresponds to the only second merged object, and the second merged object corresponds to the only first merged object, the first merged object and the second merged object may be merged.
[0103] According to another embodiment, when a first merged object and a second merged object are adjacent, if the first merged object corresponds to multiple second merged objects, a target second merged object is determined from the multiple second merged objects based on the distance between the first merged object and the second merged object, and the first merged object and the target second merged object are merged. The distance between the target second merged object and the first merged object is the minimum value of the distances between the first merged object and the multiple second merged objects.
[0104] According to another embodiment, when the first merged object and the second merged object are adjacent, if the second merged object corresponds to multiple first merged objects, a target first merged object is determined from the multiple first merged objects based on the distance between the first merged object and the second merged object, and the second merged object is merged with the target first merged object. The distance between the target first merged object and the second merged object is the minimum value of the distances between the second merged object and the multiple first merged objects.
[0105] The above technical solutions A1 to A3 introduce in detail the process of merging multiple language units in the above-mentioned text to be recognized. It can be understood that those skilled in the art can adopt any one or a combination of technical solutions A1 to A3 according to actual application requirements. The embodiment of the present application does not limit the specific process of merging multiple language units in the above-mentioned text to be recognized.
[0106] In step 104, the entity recognition result corresponding to the text to be recognized is determined according to the entity information corresponding to the one or more merged language units. After the entity recognition result is obtained, the entity recognition result can be output to the outside world, or the entity recognition result can be saved.
[0107] Optionally, the entity recognition result includes: a tree structure, the root node of the tree structure corresponds to the text to be recognized, the parent node of the tree structure corresponds to the merged language unit, and the leaf node of the tree node corresponds to the language unit.
[0108] The embodiment of the present application represents the entity recognition result through a tree structure. The levels of the tree structure can represent the merging order, and the nodes of the tree structure can represent the merged language units that appear in the merging process.
[0109] Reference Figure 2, showing a schematic diagram of a tree structure of an embodiment of the present application, the tree structure can correspond to the text A to be recognized "Yanyuan of Peking University", the root node of the tree structure can correspond to "Yanyuan of Peking University", and the leaf nodes of the tree structure correspond to the following multiple language units: "North", "Beijing", "Da", "Xue", "De", "Yan", "Yuan". In the tree structure, "North" and "Beijing" are merged into "Beijing", "Da" and "Xue" are merged into "Da", "Beijing" and "Da" are merged into "Peking University", "Yan" and "Yuan" are merged into "Yanyuan", "Peking University" and "De" are merged into "Peking University", "Peking University" and "Yanyuan" are merged into "Peking University's Yanyuan". In the tree structure, the merged language unit corresponding to the parent node is annotated with entity information, such as entity or non-entity.
[0110] In an optional embodiment of the present application, the method may further include: determining entity information corresponding to the language unit. In the case where the language unit corresponding to the language unit is a word, it may also be determined whether the language unit is an entity.
[0111] In summary, the named entity recognition method of the embodiment of the present application merges multiple language units in the text to be recognized based on the distance between any two adjacent language units in the text to be recognized, and the merged information obtained in the above merging process may include: entity information corresponding to the merged language unit; the above entity information may indicate whether the merged language unit is an entity, and the entity label corresponding to the merged language unit when the merged language unit is an entity, etc. Since the embodiment of the present application can obtain the entity information corresponding to the merged language unit in the process of merging multiple language units in the text to be recognized, it can recognize entities with nested structures.
[0112] Furthermore, the embodiment of the present application may not rely on a hierarchical neural network structure to merge multiple language units in the above-mentioned text to be recognized, and determine the entity information corresponding to the merged language units, thereby improving the efficiency of named entity recognition.
[0113] The embodiment of the present application can recognize the text to be recognized by a named entity recognition device. The named entity recognition device can specifically include: a word embedding module, a bidirectional LSTM module, a first prediction module, a merging module, and a second prediction module.
[0114] The word embedding module is used to determine the first features corresponding to the multiple language units by using the word embedding method. The bidirectional LSTM module is used to process the first feature by using the bidirectional LSTM, and the obtained second feature may include context information. The first prediction module is used to predict the entity information corresponding to the language unit. The merging module is used to merge the multiple language units according to the distance between any two adjacent language units to obtain the merged language unit. The second prediction module is used to predict the entity information corresponding to the merged language unit.
[0115] In order to enable those skilled in the art to better understand the embodiments of the present application, a named entity recognition method of the embodiments of the present application is described herein through specific examples.
[0116] Reference Figure 3 , which shows a schematic diagram of the processing flow of a named entity recognition method in an embodiment of the present application, wherein named entity recognition can be performed on a text to be recognized B "g0160-included AP-1 complex", and the text to be recognized B can be divided into the following multiple language units: "g0160", "-", "included", "AP", "-", "1" and "complex". Figure 3 middle," <s> " indicates the start tag, "< / s> " indicates the end tag.
[0117] Figure 3 In the embodiment, the word embedding module is used to determine the first features corresponding to the plurality of language units respectively by using the word embedding method. The bidirectional LSTM module is used to process the first features by using the bidirectional LSTM, and the obtained second features may include context information.
[0118] Figure 3 In the embodiment, the merging module is used to merge multiple language units according to the distance between two adjacent language units. The distance between two adjacent language units can be: d1, d2, d3, d4, d5 and d6, wherein d5<d4<d6<d1<d2<d3.
[0119] Figure 3 In the example, entity information may include: "empty", "G#Protein", where "G#Protein" represents an entity and "empty" represents a non-entity.
[0120] According to an embodiment, the multiple language units in the above-mentioned text to be recognized can be merged according to the order of the distance between any two adjacent language units from small to large, and the corresponding merging process specifically includes:
[0121] First, merge the "-" and "1" corresponding to d5 into "-1", and the entity information corresponding to "-1" is "empty";
[0122] Then, the "AP" and "-1" corresponding to d4 are merged into "AP-1", and the entity information corresponding to "AP-1" is "G#Protein";
[0123] Then, "AP-1" and "complex" corresponding to d6 are merged into "AP-1 complex", and the entity information corresponding to "AP-1 complex" is "empty";
[0124] Then, the "g0160" and "-" corresponding to d1 are merged into "g0160-", and the entity information corresponding to "g0160-" is "empty";
[0125] Next, merge "g0160-" and "included" corresponding to d2 into "g0160-included", and the entity information corresponding to "g0160-included" is "empty";
[0126] Finally, the “g0160-included” and “AP-1 complex” corresponding to d3 are merged into “g0160-includedAP-1 complex”, and the entity information corresponding to “g0160-included AP-1 complex” is “G#Protein”.
[0127] According to another embodiment, the text to be recognized may be divided into a first category and a second category. The boundaries corresponding to the first category and the second category may be the position corresponding to the maximum distance d3. The language units corresponding to the first category may include: "g0160", "-", "included", and the language units corresponding to the second category may include: "AP", "-", "1", and "complex". The language units corresponding to the first category or the second category may be merged respectively; then, the merged language units corresponding to the first category and the second category are merged.
[0128] The text to be recognized in the embodiment of the present application can come from any application field, such as logistics, medical, geography, e-commerce, etc.
[0129] In one embodiment of the present application, the text to be recognized may be derived from the field of logistics. For example, the text to be recognized C may be "No. 969, Wenyi West Road, Yuhang District, Hangzhou City", where the text to be recognized C may be divided into the following multiple language units: "Hangzhou", "State", "City", "Yu", "Hangzhou", "District", "Wen", "One", "West", "Road", "9", "6", "9", "No.", and the distances between two adjacent language units may be: d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12 and d13, where d3, d6, and d10 are greater than other distances.
[0130] The processing of the text to be recognized C may include:
[0131] First, based on d3, d6 and d10, the text to be recognized C is divided into four categories, namely: the first category "Hangzhou City", the second category "Yuhang District", the third category "Wenyi West Road" and the fourth category "No. 969";
[0132] Then, the first category, the second category, the third category and the fourth category are merged respectively to obtain the corresponding merged language units: "Hangzhou City", "Yuhang District", "Wenyi West Road" and "No. 969", where "Hangzhou City" corresponds to the city name, "Yuhang District" corresponds to the district name, "Wenyi West Road" corresponds to the road name, and "No. 969" corresponds to the house number name;
[0133] Then, the merged language units corresponding to the first category, the second category, the third category and the fourth category are merged to obtain the address name corresponding to "No. 969, Wenyi West Road, Yuhang District, Hangzhou City".
[0134] In another embodiment of the present application, the text to be recognized may be derived from the medical field. For example, the text to be recognized D may be "left pleural effusion", wherein the text to be recognized D may be divided into the following multiple language units: "left", "side", "chest", "cavity", "effusion", "fluid", and the distances between two adjacent language units may be: d1, d2, d3, d4 and d5, wherein d3 is greater than the other distances.
[0135] The processing of the text D to be recognized may include:
[0136] First, according to d3, the text to be recognized is divided into two categories: the first category "left chest cavity" and the second category "effusion";
[0137] Then, the first category and the second category are merged respectively to obtain corresponding merged language units: "left thoracic cavity" and "effusion", where "left thoracic cavity" corresponds to the name of a body part;
[0138] Then, the merged language units corresponding to the first category and the second category are merged, and the obtained "left pleural effusion" corresponds to the disease symptom name.
[0139] It should be noted that, for the method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present application are not limited by the described order of actions, because according to the embodiments of the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present application.
[0140] An embodiment of the present application also provides a named entity recognition device.
[0141] Reference Figure 4 , shows a structural block diagram of an embodiment of a named entity recognition device of the present application, and the above-mentioned device may specifically include the following modules: a segmentation module 401, a distance determination module 402, a merging module 403 and a result determination module 404.
[0142] The segmentation module 401 is used to segment the text to be recognized into a plurality of language units;
[0143] A distance calculation module 402 is used to calculate the distance between any two adjacent language units in the above-mentioned multiple language units;
[0144] A merging module 403 is used to merge the above-mentioned multiple language units according to the distance between any two adjacent language units to obtain one or more merged language units; and
[0145] The result determination module 404 is used to determine the entity recognition result corresponding to the text to be recognized according to the entity information corresponding to the one or more merged language units.
[0146] Optionally, the merging module 403 may include:
[0147] The first merging module is used to merge the multiple language units in the text to be recognized according to the distance between any two adjacent language units in ascending order.
[0148] Optionally, the merging module 403 may include:
[0149] A category division module, used for dividing the above-mentioned multiple language units into at least two categories;
[0150] A second merging module is used to merge one or more language units belonging to the same category to obtain corresponding merged results; and
[0151] The fusion module is used to merge the sub-merge results corresponding to the at least two categories.
[0152] Optionally, the above-mentioned category classification module may include:
[0153] A demarcation point determination module is used to obtain, from the above-mentioned multiple language units, the i-th language unit and the (i+1)-th language unit with the largest distance between two adjacent language units;
[0154] The demarcation point category determination module is used to classify the i-th language unit into one category and the (i+1)-th language unit into another category.
[0155] Optionally, the first merging module may include:
[0156] A set saving module, used for saving the distances between any two adjacent language units in order from small to large to a distance set;
[0157] The set sequential merging module is used to select a target distance from the distance set in a front-to-back order, and merge two adjacent merged objects corresponding to the target distance; the types of the two adjacent merged objects may include: a language unit and a language unit, or a language unit and a merged language unit, or a merged language unit and a merged language unit.
[0158] Optionally, the target distance may include: a first distance ranked first, and the set order merging module may include:
[0159] The first set sequential merging module is used to merge two adjacent language units corresponding to the first distance to obtain a first merged language unit.
[0160] Optionally, the target distance may further include: a second distance that is not ranked first, and the set order merging module may further include:
[0161] A first language unit determining module, configured to determine a first language unit from language units adjacent to the first merged language unit according to the second distance;
[0162] The second set sequential merging module is used to merge the first merged language unit with the first language unit to obtain a second merged language unit.
[0163] Optionally, the first merged language unit may include: a second language unit, the second language unit is adjacent to the first language unit, and the distance between the second language unit and the first language unit is a second distance.
[0164] Optionally, the target distance may further include: a third distance that is not ranked first, and the set order merging module may further include:
[0165] The third set sequential merging module is used to merge two adjacent first merged language units according to the third distance.
[0166] Optionally, the target distance may further include: a fourth distance that is not ranked first, and the set order merging module may further include:
[0167] The fourth set sequential merging module is used to merge adjacent first merged language units and second merged language units according to the fourth distance.
[0168] Optionally, the merging module 403 may include:
[0169] The third merging module is used to determine whether to merge the first merged object and the second merged object according to the distance between the first merged object and the second merged object when the first merged object and the second merged object are adjacent to each other; the above-mentioned first merged object is a language unit or a merged language unit, and the second merged object is a language unit or a merged language unit.
[0170] Optionally, the distance calculation module may include:
[0171] Determine the features corresponding to the multiple language units respectively;
[0172] The semantic distance between any two adjacent language units in the text to be recognized is determined based on the features corresponding to the multiple language units.
[0173] Optionally, the entity recognition result may include: a tree structure, the root node of the tree structure corresponds to the text to be recognized, the parent node of the tree structure corresponds to the merged language unit, and the leaf nodes of the tree node correspond to the language unit.
[0174] Optionally, the language unit corresponding to the above language unit may include: a single character or a word.
[0175] As for the device 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.
[0176] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0177] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0178] The embodiments of the present application may be implemented as a system or device using any appropriate hardware and / or software to perform a desired configuration. Figure 5 An exemplary device 1300 that can be used to implement the various embodiments described above in the present application is schematically shown.
[0179] For one embodiment, Figure 5 An exemplary device 1300 is shown, which may include one or more processors 1302, a system control module (chip set) 1304 coupled to at least one of the processors 1302, a system memory 1306 coupled to the system control module 1304, a non-volatile memory (NVM) / storage device 1308 coupled to the system control module 1304, one or more input / output devices 1310 coupled to the system control module 1304, and a network interface 1312 coupled to the system control module 1306. The system memory 1306 may include instructions 1362, which may be executed by the one or more processors 1302.
[0180] The processor 1302 may include one or more single-core or multi-core processors, and the processor 1302 may include any combination of general-purpose processors or special-purpose processors (such as graphics processors, application processors, baseband processors, etc.). In some embodiments, the device 1300 can be used as the server, target device, wireless device, etc. mentioned above in the embodiments of the present application.
[0181] In some embodiments, the device 1300 may include one or more machine-readable media having instructions (e.g., system memory 1306 or NVM / storage device 1308) and one or more processors 1302 that are combined with the one or more machine-readable media and configured to execute instructions to implement the modules included in the aforementioned device, thereby performing the above-mentioned actions in the embodiments of the present application.
[0182] System control module 1304 for one embodiment may include any suitable interface controller for providing any suitable interface to at least one of processors 1302 and / or any suitable device or component in communication with system control module 1304 .
[0183] System control module 1304 for one embodiment may include one or more memory controllers for providing an interface to system memory 1306. A memory controller may be a hardware module, a software module, and / or a firmware module.
[0184] The system memory 1306 of one embodiment may be used to load and store data and / or instructions 1362. For one embodiment, the system memory 1306 may include any suitable volatile memory, such as a suitable DRAM (dynamic random access memory). In some embodiments, the system memory 1306 may include: double data rate type four synchronous dynamic random access memory (DDR4 SDRAM).
[0185] System control module 1304 for one embodiment may include one or more input / output controllers to provide interfaces to NVM / storage 1308 and input / output device(s) 1310 .
[0186] NVM / storage 1308 of one embodiment may be used to store data and / or instructions 1382. NVM / storage 1308 may include any suitable non-volatile memory (e.g., flash memory, etc.) and / or may include any suitable non-volatile storage device(s), such as, for example, one or more hard disk drives (HDDs), one or more compact disk (CD) drives, and / or one or more digital versatile disk (DVD) drives, etc.
[0187] NVM / storage 1308 may include storage resources that are physically part of the device on which device 1300 is installed, or that may be accessible to the device without being part of the device. For example, NVM / storage 1308 may be accessible over a network via network interface 1312 and / or through input / output devices 1310.
[0188] The input / output device(s) 1310 of one embodiment may provide an interface for the device 1300 to communicate with any other suitable device and the input / output device 1310 may include a communication component, an audio component, a sensor component, and the like.
[0189] The network interface 1312 of one embodiment may provide an interface for the device 1300 to communicate through one or more networks and / or with any other suitable device. The device 1300 may wirelessly communicate with one or more components of a wireless network according to any of one or more wireless network standards and / or protocols, for example, accessing a wireless network based on a communication standard, such as WiFi (Wireless Fidelity), 2G or 3G or 4G or 5G, or a combination thereof for wireless communication.
[0190] For one embodiment, at least one of the processors 1302 may be packaged together with the logic of one or more controllers (e.g., a memory controller) of the system control module 1304. For one embodiment, at least one of the processors 1302 may be packaged together with the logic of one or more controllers of the system control module 1304 to form a system-in-package (SiP). For one embodiment, at least one of the processors 1302 may be integrated on the same product with the logic of one or more controllers of the system control module 1304. For one embodiment, at least one of the processors 1302 may be integrated on the same chip with the logic of one or more controllers of the system control module 1304 to form a system on chip (SoC).
[0191] In various embodiments, the device 1300 may include, but is not limited to, a computing device such as a desktop computing device or a mobile computing device (e.g., a laptop computing device, a handheld computing device, a tablet computer, a netbook, etc.). In various embodiments, the device 1300 may have more or fewer components and / or a different architecture. For example, in some embodiments, the device 1300 may include one or more cameras, a keyboard, a liquid crystal display (LCD) screen (including a touch screen display), a non-volatile memory port, multiple antennas, a graphics chip, an application specific integrated circuit (ASIC), and a speaker.
[0192] Wherein, if the display includes a touch panel, the display screen can be implemented as a touch screen display to receive input signals from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor can not only sense the boundary of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.
[0193] The embodiment of the present application also provides a non-volatile readable storage medium, which stores one or more modules (programs). When the one or more modules are applied to a device, the device can execute instructions (instructions) of each method in the embodiment of the present application.
[0194] In one example, a device is provided, including: one or more processors; and instructions in one or more machine-readable media stored thereon, which, when executed by the one or more processors, cause the device to perform a method as in an embodiment of the present application, and the method may include: Figure 1 or Figure 2 or Figure 3 The method shown.
[0195] In one example, one or more machine-readable media are provided, on which instructions are stored. When executed by one or more processors, the device performs a method in an embodiment of the present application. The method may include: Figure 1 or Figure 2 or Figure 3 The method shown.
[0196] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here. For relevant matters, please refer to the partial description of the method embodiment.
[0197] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0198] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented 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 named entity recognition device to produce a machine, so that the instructions executed by the processor of the computer or other programmable named entity recognition device generate instructions for implementing the processes in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0199] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable named entity recognition device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0200] These computer program instructions can also be loaded onto a computer or other programmable named entity recognition device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0201] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.
[0202] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article 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, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0203] The above is a detailed introduction to a named entity recognition method, a named entity recognition device, a device, and a machine-readable medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for named entity recognition, characterized in that: The method comprises: The text to be recognized is divided into a plurality of language units; the language units are single characters or words; Among the plurality of language units, calculating the distance between any two adjacent language units; According to the distance between any two adjacent language units, the multiple language units are merged to obtain one or more merged language units; the merged information obtained by the merging includes: whether the merged language unit is an entity, and, if the merged language unit is an entity, an entity label corresponding to the merged language unit; Determine an entity recognition result corresponding to the text to be recognized according to the entity information respectively corresponding to the one or more merged language units; the entity recognition result includes: a tree structure, the root node of the tree structure corresponds to the text to be recognized, the parent node of the tree structure corresponds to the merged language unit, and the leaf node of the tree structure corresponds to the language unit; The merging of the multiple language units includes: Merging the multiple language units in the text to be recognized according to the distance between any two adjacent language units in ascending order; or The multiple language units are divided into at least two categories; one or more language units belonging to the same category are merged to obtain corresponding merged results; and the merged results corresponding to the at least two categories are merged.
2. The method according to claim 1, characterized in that The dividing the plurality of language units into at least two categories comprises: Among the multiple language units, obtain the i-th language unit and the (i+1)-th language unit with the largest distance between two adjacent language units; The i-th language unit is classified into one category, and the (i+1)-th language unit is classified into another category.
3. The method according to claim 1, characterized in that The merging of multiple language units in the text to be recognized includes: In order from small to large, the distances between any two adjacent language units are sequentially saved in a distance set; In order from front to back, a target distance is selected from the distance set, and two adjacent merged objects corresponding to the target distance are merged; the types of the two adjacent merged objects include: a language unit and a language unit, or a language unit and a merged language unit, or a merged language unit and a merged language unit.
4. The method according to claim 3, characterized in that The target distance includes: a first distance that is ranked first, and merging two adjacent merging objects corresponding to the target distance includes: Two adjacent language units corresponding to the first distance are merged to obtain a first merged language unit.
5. The method according to claim 4, characterized in that The target distance also includes: a second distance that is not ranked first, and the merging of two adjacent merging objects corresponding to the target distance also includes: determining a first language unit from language units adjacent to the first merged language unit according to the second distance; The first merged language unit is merged with the first language unit to obtain a second merged language unit.
6. The method according to claim 5, characterized in that The first merged language unit includes: a second language unit, the second language unit is adjacent to the first language unit, and the distance between the second language unit and the first language unit is a second distance.
7. The method according to claim 5, characterized in that The target distance also includes: a third distance that is not ranked first, and the merging of two adjacent merging objects corresponding to the target distance also includes: Two adjacent first merged language units are merged according to the third distance.
8. The method according to claim 5, characterized in that The target distance also includes: a fourth distance that is not ranked first, and the merging of two adjacent merging objects corresponding to the target distance also includes: According to the fourth distance, adjacent first merged language units and second merged language units are merged.
9. The method according to claim 1, characterized in that: The merging of multiple language units in the text to be recognized includes: When a first merged object and a second merged object are adjacent to each other, whether to merge the first merged object and the second merged object is determined based on a distance between the first merged object and the second merged object; the first merged object is a language unit or a merged language unit, and the second merged object is a language unit or a merged language unit.
10. The method according to any one of claims 1 to 9, characterized in that: The calculating the distance between any two adjacent language units comprises: Determining features corresponding to the multiple language units respectively; The semantic distance between any two adjacent language units in the text to be recognized is determined according to the features respectively corresponding to the multiple language units.
11. A named entity recognition device, characterized in that: The device comprises: A segmentation module, used for segmenting the text to be recognized into a plurality of language units; the language units are single characters or words; A distance calculation module, used for calculating the distance between any two adjacent language units among the plurality of language units; a merging module, configured to merge the plurality of language units according to the distance between any two adjacent language units to obtain one or more merged language units; the merged information obtained by the merging includes: whether the merged language unit is an entity, and, if the merged language unit is an entity, an entity label corresponding to the merged language unit; and A result determination module is used to determine the entity recognition result corresponding to the text to be recognized according to the entity information corresponding to the one or more merged language units respectively; the entity recognition result includes: a tree structure, the root node of the tree structure corresponds to the text to be recognized, the parent node of the tree structure corresponds to the merged language unit, and the leaf node of the tree structure corresponds to the language unit; The merging of the multiple language units includes: Merging the multiple language units in the text to be recognized according to the distance between any two adjacent language units in ascending order; or The multiple language units are divided into at least two categories; one or more language units belonging to the same category are merged to obtain corresponding merged results; and the merged results corresponding to the at least two categories are merged.
12. A device, characterized in that: include: one or more processors; and One or more machine-readable media having instructions stored thereon, which when executed by the one or more processors, cause the apparatus to perform the method of one or more of claims 1-10.
13. One or more machine-readable media having instructions stored thereon which, when executed by one or more processors, cause a device to perform the method of one or more of claims 1-10.
Citation Information
Patent Citations
Dynamic maintenance system for large-scale semantic knowledge base
CN102402599A
Text sentiment analysis method and text sentiment analysis system
CN104731773A
Chinese natural language processing tool system based on machine learning and deep learning
CN110705296A