A method and device for named entity recognition and a device for named entity recognition
By identifying and splicing subject words and expression words in text and matching entity templates, the problem of inaccurate identification of medical entities by traditional named entity recognition methods is solved, and the accuracy of recognition results and the quality of search results are improved.
Patent Information
- Application Number
- CN202010614432.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-30
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2040-12-24
AI Technical Summary
The traditional naming entity recognition method is not accurate enough to identify medical entities, which affects the accuracy of subsequent search results.
By identifying the subject words and expression words in the target text, splicing and combining them, matching predefined entity templates, determining the naming entity recognition results, and improving the recognition accuracy of medical entities.
It improves the comprehensiveness and accuracy of medical entities identification, and thus improves the accuracy and recall rate of search results.
Smart Images

Figure CN111898382B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network technology, and in particular to a method and device for named entity recognition and a device for named entity recognition. Background Art
[0002] Named entity recognition refers to the identification of entities with specific meanings in text. Named entity recognition is a basic task in natural language processing and information retrieval.
[0003] Traditional named entity recognition methods are mainly divided into rule-based dictionary methods and statistical model-based methods. The rule-based dictionary method mainly builds a large-scale offline entity dictionary to perform recognition in the form of string matching. The statistical model-based method mainly builds a statistical model and uses manually annotated training corpus to train the model for recognition.
[0004] However, for medical entities, the recognition results of traditional named entity recognition methods are not accurate enough. For example, a user enters the following query information in the retrieval system: "I had an itchy abdomen yesterday. What happened?" The retrieval system can identify the entities "abdominal itching" and "pain" from the text through the named entity recognition task. However, the entities actually contained in the text should be "abdominal itching" and "abdominal pain", which affects the accuracy of subsequent search results. Summary of the invention
[0005] The embodiments of the present application provide a method and device for named entity recognition, and a device for named entity recognition, which can improve the accuracy of identifying medical entities.
[0006] In order to solve the above problems, the present application discloses a method for named entity recognition, which includes:
[0007] Identify subject words and performance words in the target text;
[0008] Concatenate and combine the subject words and the expression words in the target text to obtain a candidate text set;
[0009] Matching each candidate text in the candidate text set with a predefined entity template set to obtain a target entity template that meets the matching condition, wherein the entity template set includes at least one template group, each template group includes at least one entity template, and each template group corresponds to a standard entity;
[0010] Determine a named entity recognition result corresponding to the target text according to the standard entity corresponding to the template group to which the target entity template belongs.
[0011] On the other hand, an embodiment of the present application discloses a named entity recognition device, the device comprising:
[0012] A recognition module is used to identify subject words and expression words in the target text;
[0013] A concatenation module is used to concatenate and combine the subject words and the expression words in the target text to obtain a candidate text set;
[0014] A matching module, used for matching each candidate text in the candidate text set with a predefined entity template set to obtain a target entity template that meets the matching condition, wherein the entity template set includes at least one template group, each template group includes at least one entity template, and each template group corresponds to a standard entity;
[0015] The determination module is used to determine the named entity recognition result corresponding to the target text according to the standard entity corresponding to the template group to which the target entity template belongs.
[0016] On the other hand, an embodiment of the present application discloses a device for named entity recognition, including a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors. The one or more programs include instructions for performing the following operations:
[0017] Identify subject words and performance words in the target text;
[0018] Concatenate and combine the subject words and the expression words in the target text to obtain a candidate text set;
[0019] Matching each candidate text in the candidate text set with a predefined entity template set to obtain a target entity template that meets the matching condition, wherein the entity template set includes at least one template group, each template group includes at least one entity template, and each template group corresponds to a standard entity;
[0020] Determine a named entity recognition result corresponding to the target text according to the standard entity corresponding to the template group to which the target entity template belongs.
[0021] On the other hand, an embodiment of the present application discloses a machine-readable medium having instructions stored thereon, which, when executed by one or more processors, enables the device to perform one or more of the named entity recognition methods described above.
[0022] The embodiments of the present application include the following advantages:
[0023] The embodiment of the present application defines the concepts of subject words and expression words, and identifies the subject words and expression words in the target text, and matches them with a predefined set of entity templates based on possible combinations of subject words and expression words in the target text, so as to effectively perform entity recognition on text fragments containing at least one subject word and at least one expression word. For example, in the recognition scenario of medical entities, for the target text "abdominal itching is a bit painful", the named entity recognition results obtained by the embodiment of the present application include the standard entity "abdominal itching" and the standard entity "abdominal pain", which can improve the comprehensiveness and accuracy of entity recognition, and thus improve the accuracy and recall rate of search results. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[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 structural block diagram of an embodiment of a named entity recognition device of the present application;
[0027] Figure 3 is a block diagram of a device 800 for named entity recognition of the present application;
[0028] Figure 4 It is a schematic diagram of the structure of the server in some embodiments of the present application. DETAILED DESCRIPTION
[0029] 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 part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0030] Method Embodiment
[0031] Reference Figure 1 , shows a flowchart of a method for named entity recognition according to an embodiment of the present application, which may specifically include the following steps:
[0032] Step 101, identifying subject words and expression words in the target text;
[0033] Step 102: concatenate and combine the subject words and the expression words in the target text to obtain a candidate text set;
[0034] Step 103: Match each candidate text in the candidate text set with a predefined entity template set to obtain a target entity template that meets the matching condition, wherein the entity template set includes at least one template group, each template group includes at least one entity template, and each template group corresponds to a standard entity;
[0035] Step 104: Determine a named entity recognition result corresponding to the target text according to the standard entity corresponding to the template group to which the target entity template belongs.
[0036] The named entity recognition method provided in the embodiments of the present application can be applied to electronic devices, including but not limited to: servers, smart phones, voice recorders, 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.
[0037] The named entity recognition method of the present application can be used in information retrieval scenarios. An electronic device can receive query information input by a user in a retrieval system, and the retrieval system returns search results related to the query information according to a certain retrieval strategy. Specifically, firstly, entity fragment recognition is performed on the query information input by the user to obtain a target text, and the target text refers to a text fragment containing an entity, which is referred to as an entity text fragment in the embodiment of the present application. In an example, the query information is "What happened to my abdominal itching and pain yesterday?", and entity fragment recognition is performed on the query information, and the target text can be obtained as "The abdominal itching hurts a little". Then, the entities in the target text are identified by the named entity recognition method of the present application. For example, the entities finally identified to obtain the target text include: "abdominal itching" and "abdominal pain". Finally, based on the identified entities "abdominal itching" and "abdominal pain", more accurate web search results and / or knowledge base search results can be obtained.
[0038] It should be noted that the embodiments of the present application do not limit the specific type of the query information. The query information may be text information or voice information, etc. When the query information is text information, the text information may be semantically analyzed to identify the target text (entity text fragment) in the text information; when the query information is voice information, the voice information may be voice recognized to obtain the corresponding text information, and then the text information may be semantically analyzed to identify the target text in the text information.
[0039] In order to solve the problem that traditional named entity recognition methods are not accurate enough in identifying medical entities, the embodiments of the present application split medical entities according to the characteristics of medical entities and define the concepts of subject words and expression words. Subject words refer to words used to describe entity objects. Expression words refer to words used to describe the relevant status of entity objects, and the relevant status may include: feelings, symptoms, characteristics, etc. Optionally, the subject words may include any one or more of the following: body parts, secretory growths, excretions, etc., and the expression words may include any one or more of the following: growth, swelling, itching, pain, taste, color, shape, etc.
[0040] Among them, medical entities may include: symptom entities, disease entities, surgery entities, drug entities, etc. The embodiment of the present application mainly uses symptom entities as an example for explanation. For example, "abdominal itching" and "left arm pain" are both symptom entities. Among them, "abdomen" and "left arm" are main words, and "itching" and "pain" are expression words.
[0041] It is understandable that the named entity recognition method provided by the present application is not limited to identifying medical entities. The embodiments of the present application can be used to identify any type of entity that contains both a subject word and an expression word, such as a commodity entity. In one example, for the commodity entity "short-sleeved dress", the subject word in the entity is "dress" and the expression word is "short sleeves".
[0042] Based on the defined concepts of subject words and expression words, the embodiment of the present application takes into account the possible combinations of subject words and expression words in the target text during entity recognition of the target text, making the recognition results more comprehensive and accurate, thereby improving the accuracy and recall rate of the search results.
[0043] In an optional embodiment of the present application, before the step 101 of identifying the subject words and the expression words in the target text, the method may further include:
[0044] Constructing a feature dictionary, wherein the feature dictionary includes preset feature words, and the preset feature words include subject words of a first quantity category and expression words of a second quantity category;
[0045] The step 101 of identifying the subject words and the expression words in the target text may include:
[0046] Based on the feature dictionary, main words and expression words in the target text are identified.
[0047] Before performing the named entity recognition task, the embodiment of the present application first constructs a feature dictionary, which is used to identify the main words and expression words in the target text. The feature dictionary includes preset feature words, and the preset feature words include main words of a first quantity category and expression words of a second quantity category. The main words and expression words in the target text can be identified by matching the segmented words in the target text with the feature words in the feature dictionary.
[0048] In an optional embodiment of the present application, constructing a feature dictionary may include:
[0049] Step S11, collecting corpus data;
[0050] Step S12, extracting the subject words of the first quantity category and the expression words of the second quantity category from the corpus data;
[0051] Step S13: construct a feature dictionary based on the main words of the first quantity category and the expression words of the second quantity category.
[0052] The embodiment of the present application constructs a feature dictionary based on the collected corpus data. The collected corpus data may include medical-related web pages (such as user consultations, expert articles, encyclopedias, etc.) and structured knowledge bases (such as knowledge graphs), etc. The collected corpus data is semantically analyzed to extract the subject words of the first number (such as N) categories and the expression words of the second number (such as M) categories. Among them, the categories of the subject words may include: body parts, secretory growths, excretions, etc. The categories of the expression words may include: growth, swelling, itching, pain, taste, color, shape, etc.
[0053] In one example, the main words of the body part category may include: abdomen, head, skin, etc. The main words of the secretion growth category may include: leucorrhea, pustules, mucus, etc. The main words of the excrement category may include: urine, feces, etc. The expression words of the color category may include: reddening, turning purple, etc. The expression words of the property category may include: wet, sticky, etc.
[0054] A feature dictionary is constructed based on the mined subject words of the first quantity category and the expression words of the second quantity category. Based on the constructed feature dictionary, the subject words and the expression words in the target text can be identified.
[0055] In an optional embodiment of the present application, the feature dictionary also includes synonyms corresponding to each feature word; and identifying the subject words and the expression words in the target text based on the feature dictionary may include:
[0056] Step S21, matching the target text with the feature dictionary to obtain hit feature words and / or hit synonyms;
[0057] Step S22: determining the main words and expression words in the target text according to the hit feature words and / or feature words corresponding to the hit synonyms.
[0058] In specific implementation, based on the constructed feature dictionary, the subject words and expression words in the target text can be matched. However, in actual applications, the query information input by the user is not standardized. For example, if the target text is "My head feels like it's exploding and I feel a little dizzy", it is difficult to match the subject words and expression words in the target text.
[0059] To solve the above problems, the embodiment of the present application provides synonyms corresponding to each feature word in the feature dictionary. Specifically, each subject word in the feature dictionary can correspond to multiple synonyms, and each expression word can also correspond to multiple synonyms. According to the correspondence between the subject word and its synonyms, and the correspondence between the expression word and its synonyms, the description of the non-standard subject word and expression word in the target text can be converted into a unified standardized description.
[0060] In one example, the feature dictionary contains the main word "head" and the following synonyms corresponding to the main word "head": "head", "brain", "skull", etc. The feature dictionary also contains the expression word "pain" and the following synonyms corresponding to the expression word "pain": "explosive feeling", "like a knife cutting", etc. For the above target text "head feels like exploding and a little dizzy", firstly perform word segmentation to obtain a word segmentation set, match the word segmentation set with the feature dictionary, and you can get the hit feature word including "dizzy", and the hit synonyms including "brain" and "explosive feeling".
[0061] Among them, the hit feature word "dizzy" is a performance word; the hit synonym "head" corresponds to the feature word "head", which is the main word; the hit synonym "explosive feeling" corresponds to the feature word "pain", which is the performance word. Therefore, based on the feature dictionary, the main word in the target text "head has an explosive feeling and is a little dizzy" is identified as "head", and the performance words include "pain" and "dizzy".
[0062] For medical entities, there is usually a situation where a main word is related to multiple expression words. For example, in the above example, the main word "head" is related to the expression word "pain" and the expression word "dizziness", that is, the user's real symptoms should be "headache" and "dizziness". Therefore, in order to make the entity recognition result more comprehensive and accurate, after identifying the main words and expression words in the target text, the embodiment of the present application splices and combines the main words and expression words in the target text to obtain a candidate text set, and each candidate text in the candidate text set contains the main word and the expression word. In this example, the main word "head" is spliced and combined with the expression word "pain" and the expression word "dizziness" respectively, and the following two candidate texts can be obtained: "headache" and "head dizziness", and these two candidate texts can constitute the candidate text set of the target text "The head feels like it is exploding and a little dizzy".
[0063] In an optional embodiment of the present application, the step 102 of concatenating and combining the subject words and the expression words in the target text to obtain a candidate text set may include:
[0064] Step S31, dividing the subject words and the expression words in the target text into at least one candidate group according to the order in which the subject words and the expression words in the target text appear in the target text, each candidate group contains a subject word and at least one expression word, and the first word of each candidate group is the subject word and the last word is the expression word;
[0065] Step S32: for the current candidate group to be spliced, splice the subject words in the current candidate group with each expression word in the current candidate group to obtain a candidate text corresponding to the current candidate group;
[0066] Step S33: obtaining a candidate text set according to the candidate text corresponding to each candidate group.
[0067] For the n main words A1, A2, ..., An and m expression words B1, B2, ..., Bm identified in the target text, they are divided into at least one candidate group according to the order in which the n main words and the m expression words appear in the target text. Each candidate group contains a main word and at least one expression word, and the first word of each candidate group is the main word and the last word is the expression word. That is, each candidate group can be expressed in the following form: [main word][expression word]...[expression word].
[0068] In one example, the target text is "The left side of the abdomen is a little itchy and a white rash grows". Based on the feature dictionary, it is identified that the main words in the target text include "abdomen", the number of main words n=1, and the expression words include "itching", "growing", "white", "rash", and the number of expression words m=4. Since the number of main words is 1, it can be divided into 1 candidate group, which can be expressed as: {[abdomen][itching][growing][white][rash]}. For this candidate group, the main words in the candidate group are spliced with each expression word in the candidate group respectively, and the following candidate texts can be obtained: "abdomen itching", "abdomen rash", "grown on the abdomen", "abdomen white", "rash on the abdomen", "abdomen white rash", "white rash on the abdomen", "white rash on the abdomen", "white rash on the abdomen", "white itching on the abdomen", etc. These candidate texts constitute the candidate text set corresponding to the target text "The left side of the abdomen is a little itchy and a white rash grows".
[0069] Optionally, after obtaining the candidate text set corresponding to the target text, semantic analysis can be performed on each candidate text in the candidate text set to filter out unreasonable candidate texts. For example, in the above example, semantic analysis is performed on each candidate text in the candidate text set corresponding to the target text "The left side of the abdomen is a little itchy and a white rash has grown", and unreasonable candidate texts such as "grown on the abdomen", "white abdomen", "white abdomen", and "itchy white abdomen" can be filtered out. The candidate text set obtained after filtering includes the following candidate texts: "itchy abdomen", "abdominal rash", "rash on the abdomen", and "white rash on the abdomen".
[0070] Furthermore, considering that too many expression words will cause difficulties in matching and normalization, it is possible to consider limiting the number of expression words included in each candidate text when splicing and combining. For example, if the number of expression words included in each candidate text is set to 2, then combined with the above example, the candidate text "a white rash grew on the abdomen" can be filtered out. Of course, in actual applications, there is no specific limit on the number of expression words included in each candidate text.
[0071] In another example, the target text is "My stomach hurts a little, and my waist is sore and painful". Based on the feature dictionary and synonym replacement, it is identified that the main words in the target text include "abdomen" and "waist", the number of main words n=2, and the expression words include "pain", "sour", and "pain", and the number of expression words m=3. Since the number of main words is 2. Therefore, it can be divided into 2 candidate groups, and the first candidate group can be expressed as: {[abdomen][pain]}. The second candidate group can be expressed as: {[waist][sour][pain]}. For the first candidate group, the following candidate text can be spliced and combined: "abdomen pain". For the second candidate group, the following two candidate texts can be spliced and combined: "waist sore" and "waist pain". These three candidate texts constitute the candidate text set corresponding to the target text "My stomach hurts a little, and my waist is sore and painful".
[0072] In practical applications, different users may use different texts to describe an entity with the same meaning. For example, "itching on the left side of the abdomen" and "itching on the abdominal skin" express the same meaning, namely "itching on the abdomen". After the embodiment of the present application obtains a set of candidate texts by splicing and combining, each candidate text in the candidate text set is matched with a predefined set of entity templates to normalize the candidate texts and obtain a final unified and standardized recognition result.
[0073] The entity template set includes at least one template group, each template group includes at least one entity template, and each template group corresponds to a standard entity. The standard entity is used to normalize entity expressions with synonyms to a unified standard entity expression. For the recognition scenario of medical entities, the standard entity can be a predefined standard symptom entity, and the standard entity can be derived from authoritative medical text data (such as electronic medical records, medical literature, etc.). In addition, each candidate text in the candidate text set is matched with the predefined entity template set, and meaningless candidate texts in the candidate text set can also be filtered out. For example, in the above example, meaningless candidate texts such as "abdomen grows", "abdomen is white", "abdomen grows white", and "abdomen itches white" can be filtered out.
[0074] In an optional embodiment of the present application, each entity template in the entity template set may include the following template elements: subject words, expression words, and wildcards, and the template elements are extracted based on the mapping relationship corpus between standard entities and entity text segments.
[0075] In an embodiment of the present application, the entity template set includes at least one template group, each template group includes at least one entity template, and the entity template can be represented as an ordered sequence consisting of at least one template element, and each template group corresponds to a standard entity.
[0076] In one example, standard entity A is "abdominal itching", and the entity template set includes an entity template group corresponding to standard entity A, and the entity template group may include the following 4 entity templates: ({abdominal skin})*({itch}), ({abdomen})*({will})*({itch}), ({abdomen})*({itch}), ({abdomen})*({itch}), ({abdomen skin})*({upper side})*({itch}). In another example, standard entity B is "abdominal rash", and the entity template set includes an entity template group corresponding to standard entity B, and the entity template group may include the following 2 entity templates: ({abdomen})*({long})*({rash}), ({abdomen})*({rash}). Among them, * represents a wildcard, and the wildcard can match any word. In a specific implementation, the minimum number of words and the maximum number of words that the wildcard needs to match can be set. For example, the wildcard can be expressed as "{0,5}", indicating that the wildcard matches at least 0 words and at most 5 words. The minimum and maximum number of words for wildcards can be set according to actual conditions.
[0077] In an embodiment of the present application, the template element is extracted based on the mapping relationship corpus between the standard entity and the entity text segment. The embodiment of the present application can predefine the standard entity and collect a group of entity text segments corresponding to each standard entity. This group of entity text segments has different text description methods, but has the same entity meaning, that is, they all correspond to the same standard entity.
[0078] According to the feature dictionary, the main words and expression words in each standard entity are identified, as well as the main words, expression words, and synonyms in each entity text segment corresponding to each standard entity are identified, and then the entity template group corresponding to each standard entity can be mined. In an example, standard entity A is "abdominal itching", which includes the main word "abdomen" and the expression word "itching". One of the entity text segments corresponding to standard entity A is "belly itching", and based on the feature dictionary, "belly" is identified as a synonym of the main word "abdominal skin". Therefore, the entity text segment can be converted to "abdominal skin itching", and thus, an entity template corresponding to standard entity A can be mined as ({abdominal skin})*({itching}).
[0079] In an optional embodiment of the present application, the step 103 of matching each candidate text in the candidate text set with a predefined entity template set to obtain a target entity template that meets the matching condition may include:
[0080] Step S41, performing fuzzy matching on each candidate text in the candidate text set and each entity template in the predefined entity template set, to obtain a matching confidence between each candidate text and each entity template;
[0081] Step S42: Determine the entity template whose matching confidence is greater than a preset threshold as the target entity template.
[0082] Specifically, assuming that the candidate text set contains q candidate texts, the q candidate texts are fuzzy matched with each entity template in the predefined entity template set. For example, the word segmentation in each candidate text is matched with the template element in each entity template one by one, and the matching confidence of each candidate text and each entity template is calculated. The matching confidence can be represented by the overlap between the template element in the entity template and the word segmentation in the candidate text.
[0083] Meeting the matching condition means that the matching confidence is greater than a preset threshold, and the embodiment of the present application selects the entity template with the matching confidence greater than the preset threshold as the target entity template. For q candidate texts in the candidate text set, p target entity templates can be obtained, where p<=q.
[0084] In a specific implementation, if each candidate text in the candidate text set is matched with all entity templates in the predefined entity template set one by one, the most accurate matching result can be obtained. However, the candidate text set usually contains a large number of entity templates, and full matching will result in a large number of invalid matches, which not only has a high computational cost, but also affects the matching efficiency.
[0085] In an optional embodiment of the present application, the matching of each candidate text in the candidate text set with a predefined entity template set in step 103 may include:
[0086] Step S51: for a current candidate text to be matched in the candidate text set, determining an entity template to be matched in the predefined entity template set, wherein the entity template to be matched contains the same subject words and / or expression words as those in the current candidate text;
[0087] Step S52: Match each candidate text in the candidate text set with its corresponding entity template to be matched.
[0088] In order to balance the matching efficiency and matching accuracy, the embodiment of the present application determines an entity template to be matched in a predefined entity template set for the current candidate text to be matched in the candidate text set, and the entity template to be matched contains the same main words and / or expression words as those in the current candidate text.
[0089] In one example, the current candidate text to be matched is "abdominal skin pruritus", which includes the subject word "abdominal skin" and the expression word "itch". First, the following entity templates to be matched can be determined in the predefined entity template set: all entity templates containing the subject word "abdominal skin", all entity templates containing the expression word "itch", and all entity templates containing both the subject word "abdominal skin" and the expression word "itch". Then the current candidate text "abdominal skin pruritus" is matched with the above-mentioned entity templates to be matched one by one, and the matching confidence of the current candidate text and each entity template to be matched is calculated, and the entity template to be matched with a matching confidence greater than a preset threshold is used as the target entity template corresponding to the current candidate text that meets the matching conditions. For example, the matching confidence of the current candidate text "abdominal skin pruritus" and the entity template "({abdominal skin})*({itch})" is greater than the preset threshold, then "({abdominal skin})*({itch})" is the target entity template corresponding to the candidate text "abdominal skin pruritus" that meets the matching conditions.
[0090] After obtaining the target entity template that meets the matching conditions, the template group to which the target entity template belongs can be determined, and then the standard entity corresponding to the template group to which the target entity template belongs can be determined based on the correspondence between the standard entity and the template group. According to the standard entity corresponding to the template group to which the target entity template belongs, the named entity recognition result corresponding to the target text can be determined. For example, the target entity template corresponding to the candidate text "abdominal skin pruritus" is "({abdominal skin})*({itch})", and the target entity template "({abdominal skin})*({itch})" is an entity template in the template group corresponding to the standard entity "abdominal pruritus", then it can be determined that the named entity recognition result of the target text corresponding to the candidate text "abdominal skin pruritus" may include the standard entity "abdominal pruritus".
[0091] In an embodiment of the present application, the named entity recognition result may include at least one standard entity. In one example, for the target text "The left side of the abdomen is a little itchy and a white rash has grown", the candidate text set corresponding to the target text may include the following candidate texts: "Abdominal itching", "Abdominal rash", "Rash on the abdomen", "White rash on the abdomen". Among them, the target entity template corresponding to the candidate text "Abdominal itching" is "({abdomen})*({itching})", and the standard entity corresponding to the target entity template "({abdomen})*({itching})" is "Abdominal itching", then it can be obtained that the named entity recognition result of the target text "The left side of the abdomen is a little itchy and a white rash has grown" can include the standard entity "Abdominal itching". In addition, the target entity template corresponding to the candidate text "abdominal rash" is "({abdomen})*({rash})", the target entity templates corresponding to the candidate text "rash on the abdomen" and the candidate text "white rash on the abdomen" are both "({abdomen})*({length})*({rash})", and the standard entities corresponding to the target entity template "({abdomen})*({rash})" and the target entity template "({abdomen})*({length})*({rash})" are both "abdominal rash". Therefore, the named entity recognition result of the target text "the left side of the abdomen is a little itchy and a white rash has grown" can also include the standard entity "abdominal rash". That is, through the embodiment of the present application, it can be identified that the named entity recognition result of the target text "the left side of the abdomen is a little itchy and a white rash has grown" includes the two standard entities "abdominal itching" and "abdominal rash".
[0092] In an optional embodiment of the present application, if the number of entity templates that meet the matching conditions is greater than 1, the entity templates that meet the matching conditions are sorted according to the matching confidence, and the one with the highest matching confidence is selected as the target entity template. In one example, for the above-mentioned candidate text "abdominal skin pruritus", it is assumed that the entity templates that meet the matching conditions include ({abdominal skin})*({itch}) and ({skin})*({itch}), where the matching confidence of ({abdominal skin})*({itch}) is 1, and the matching confidence of ({skin})*({itch}) is 0.667, then ({abdominal skin})*({itch}) is selected as the target entity template.
[0093] In summary, the embodiment of the present application defines the concepts of subject words and expression words, and identifies the subject words and expression words in the target text, and matches the possible combinations of the subject words and expression words in the target text with a predefined set of entity templates, so as to effectively perform entity recognition on text fragments containing at least one subject word and at least one expression word. For example, in the recognition scenario of medical entities, for the target text "abdominal itching is a bit painful", the named entity recognition results obtained by the embodiment of the present application include the standard entity "abdominal itching" and the standard entity "abdominal pain", which can improve the comprehensiveness and accuracy of entity recognition, and thus improve the accuracy and recall rate of search results.
[0094] 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.
[0095] Device Embodiment
[0096] Reference Figure 2 , shows a structural block diagram of an embodiment of a named entity recognition device of the present application, the device may include:
[0097] Recognition module 201, used to recognize subject words and expression words in the target text;
[0098] A concatenation module 202 is used to concatenate the subject words and the expression words in the target text to obtain a candidate text set;
[0099] A matching module 203 is used to match each candidate text in the candidate text set with a predefined entity template set to obtain a target entity template that meets the matching condition, wherein the entity template set includes at least one template group, each template group includes at least one entity template, and each template group corresponds to a standard entity;
[0100] The determination module 204 is used to determine the named entity recognition result corresponding to the target text according to the standard entity corresponding to the template group to which the target entity template belongs.
[0101] Optionally, the device further comprises:
[0102] A dictionary construction module, used to construct a feature dictionary, wherein the feature dictionary includes preset feature words, and the preset feature words include subject words of a first quantity category and expression words of a second quantity category;
[0103] The recognition module is specifically used to recognize the main words and the expression words in the target text based on the feature dictionary.
[0104] Optionally, the feature dictionary also includes synonyms corresponding to each feature word; the recognition module 201 includes:
[0105] A first matching submodule is used to match the target text with the feature dictionary to obtain a hit feature word and / or a hit synonym;
[0106] The first determination submodule is used to determine the main words and the expression words in the target text according to the hit feature words and / or the feature words corresponding to the hit synonyms.
[0107] Optionally, the splicing module 202 includes:
[0108] A grouping submodule, for dividing the subject words and the expression words in the target text into at least one candidate group according to the order in which the subject words and the expression words in the target text appear in the target text, each candidate group includes a subject word and at least one expression word, and the first word of each candidate group is the subject word and the last word is the expression word;
[0109] A splicing submodule, for splicing the subject words in the current candidate group to be spliced with each expression word in the current candidate group, to obtain a candidate text corresponding to the current candidate group;
[0110] The acquisition submodule is used to obtain a candidate text set according to the candidate text corresponding to each candidate group.
[0111] Optionally, each entity template in the entity template set includes the following template elements: a main word, an expression word, and a wildcard, and the template elements are extracted based on a corpus of mapping relationships between standard entities and entity text segments.
[0112] Optionally, the matching module 203 includes:
[0113] A second matching submodule is used to perform fuzzy matching on each candidate text in the candidate text set and each entity template in the predefined entity template set, so as to obtain a matching confidence between each candidate text and each entity template;
[0114] The second determination submodule is used to determine that the entity template whose matching confidence is greater than a preset threshold is a target entity template.
[0115] Optionally, the matching module 203 includes:
[0116] A screening submodule, for determining, for a current candidate text to be matched in the candidate text set, an entity template to be matched in the predefined entity template set, wherein the entity template to be matched contains the same subject words and / or expression words as those in the current candidate text;
[0117] The third matching submodule is used to match each candidate text in the candidate text set with its corresponding entity template to be matched.
[0118] The embodiment of the present application defines the concepts of subject words and expression words, and identifies the subject words and expression words in the target text, and matches them with a predefined set of entity templates based on possible combinations of subject words and expression words in the target text, so as to effectively perform entity recognition on text fragments containing at least one subject word and at least one expression word. For example, in the recognition scenario of medical entities, for the target text "abdominal itching is a bit painful", the named entity recognition results obtained by the embodiment of the present application include the standard entity "abdominal itching" and the standard entity "abdominal pain", which can improve the comprehensiveness and accuracy of entity recognition, and thus improve the accuracy and recall rate of search results.
[0119] 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.
[0120] 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.
[0121] 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.
[0122] An embodiment of the present application provides a device for named entity recognition, including a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, wherein the one or more programs include instructions for performing the following operations: identifying subject words and expression words in a target text; concatenating and combining the subject words and expression words in the target text to obtain a candidate text set; matching each candidate text in the candidate text set with a predefined entity template set to obtain a target entity template that meets the matching conditions, wherein the entity template set includes at least one template group, each template group includes at least one entity template, and each template group corresponds to a standard entity; determining a named entity recognition result corresponding to the target text according to the standard entity corresponding to the template group to which the target entity template belongs.
[0123] Figure 3 8 is a block diagram of an apparatus 800 for named entity recognition according to an exemplary embodiment. For example, the apparatus 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0124] Reference Figure 3 , the device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .
[0125] The processing component 802 generally controls the overall operation of the device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
[0126] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0127] The power supply component 806 provides power to the various components of the device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 800.
[0128] The multimedia component 808 includes a screen that provides an output interface between the device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0129] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the device 800 is in an operating mode, such as a call mode, a recording mode, and a voice information processing mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
[0130] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0131] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the device 800. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the device 800, the sensor assembly 814 can also recognize the position change of the device 800 or a component of the device 800, the presence or absence of user contact with the device 800, the orientation or acceleration / deceleration of the device 800, and the temperature change of the device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0132] The communication component 816 is configured to facilitate wired or wireless communication between the device 800 and other devices. The device 800 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency information processing (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0133] In an exemplary embodiment, the apparatus 800 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.
[0134] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by the processor 820 of the device 800 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0135] Figure 4 1 is a schematic diagram of the structure of the server in some embodiments of the present application. The server 1900 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 1922 (for example, one or more processors) and memory 1932, and one or more storage media 1930 (for example, one or more mass storage devices) storing application programs 1942 or data 1944. Among them, the memory 1932 and the storage medium 1930 can be short-term storage or permanent storage. The program stored in the storage medium 1930 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processing unit 1922 can be configured to communicate with the storage medium 1930 and execute a series of instruction operations in the storage medium 1930 on the server 1900.
[0136] The server 1900 may also include one or more power supplies 1926, one or more wired or wireless network interfaces 1950, one or more input and output interfaces 1958, one or more keyboards 1956, and / or, one or more operating systems 1941, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0137] A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of a device (server or terminal), enables the device to perform Figure 1 The named entity recognition method shown.
[0138] A non-temporary computer-readable storage medium, when the instructions in the storage medium are executed by a processor of a device (server or terminal), the device is able to perform a named entity recognition method, the method comprising: identifying subject words and expression words in a target text; concatenating and combining the subject words and expression words in the target text to obtain a candidate text set; matching each candidate text in the candidate text set with a predefined entity template set to obtain a target entity template that meets the matching conditions, the entity template set including at least one template group, each template group including at least one entity template, and each template group corresponding to a standard entity; determining a named entity recognition result corresponding to the target text according to the standard entity corresponding to the template group to which the target entity template belongs.
[0139] The embodiment of the present application discloses A1, a method for named entity recognition, comprising:
[0140] Identify subject words and performance words in the target text;
[0141] Concatenate and combine the subject words and the expression words in the target text to obtain a candidate text set;
[0142] Matching each candidate text in the candidate text set with a predefined entity template set to obtain a target entity template that meets the matching condition, wherein the entity template set includes at least one template group, each template group includes at least one entity template, and each template group corresponds to a standard entity;
[0143] Determine a named entity recognition result corresponding to the target text according to the standard entity corresponding to the template group to which the target entity template belongs.
[0144] A2. According to the method described in A1, before identifying the subject words and the expression words in the target text, the method further includes:
[0145] Constructing a feature dictionary, wherein the feature dictionary includes preset feature words, and the preset feature words include subject words of a first quantity category and expression words of a second quantity category;
[0146] The identifying of subject words and expression words in the target text includes:
[0147] Based on the feature dictionary, main words and expression words in the target text are identified.
[0148] A3. According to the method described in A2, the feature dictionary also includes synonyms corresponding to each feature word; and identifying the subject words and the expression words in the target text based on the feature dictionary includes:
[0149] Matching the target text with the feature dictionary to obtain hit feature words and / or hit synonyms;
[0150] According to the hit feature words and / or feature words corresponding to the hit synonyms, the main words and the expression words in the target text are determined.
[0151] A4. According to the method described in A1, the subject words and the expression words in the target text are concatenated and combined to obtain a candidate text set, including:
[0152] According to the order in which the subject words and the expression words in the target text appear in the target text, the subject words and the expression words in the target text are divided into at least one candidate group, each candidate group contains a subject word and at least one expression word, and the first word of each candidate group is the subject word, and the last word is the expression word;
[0153] For the current candidate group to be spliced, the main words in the current candidate group are spliced with each expression word in the current candidate group to obtain the candidate text corresponding to the current candidate group;
[0154] A candidate text set is obtained according to the candidate text corresponding to each candidate group.
[0155] A5. According to the method described in A1, each entity template in the entity template set includes the following template elements: a main word, an expression word, and a wildcard, and the template elements are extracted based on the mapping relationship corpus between standard entities and entity text segments.
[0156] A6. The method according to A1, wherein each candidate text in the candidate text set is matched with a predefined entity template set to obtain a target entity template, including:
[0157] Performing fuzzy matching on each candidate text in the candidate text set and each entity template in the predefined entity template set, respectively, to obtain a matching confidence between each candidate text and each entity template;
[0158] The entity template whose matching confidence is greater than a preset threshold is determined as the target entity template.
[0159] A7. According to the method of A1, matching each candidate text in the candidate text set with a predefined entity template set comprises:
[0160] For a current candidate text to be matched in the candidate text set, determining an entity template to be matched in the predefined entity template set, wherein the entity template to be matched contains the same subject words and / or expression words as those in the current candidate text;
[0161] Each candidate text in the candidate text set is matched with its corresponding entity template to be matched.
[0162] The present application embodiment discloses B8, a named entity recognition device, comprising:
[0163] A recognition module is used to identify subject words and expression words in the target text;
[0164] A concatenation module is used to concatenate and combine the subject words and the expression words in the target text to obtain a candidate text set;
[0165] A matching module, used for matching each candidate text in the candidate text set with a predefined entity template set to obtain a target entity template that meets the matching condition, wherein the entity template set includes at least one template group, each template group includes at least one entity template, and each template group corresponds to a standard entity;
[0166] The determination module is used to determine the named entity recognition result corresponding to the target text according to the standard entity corresponding to the template group to which the target entity template belongs.
[0167] B9. The device according to B8, further comprising:
[0168] A dictionary construction module, used to construct a feature dictionary, wherein the feature dictionary includes preset feature words, and the preset feature words include subject words of a first quantity category and expression words of a second quantity category;
[0169] The recognition module is specifically used to recognize the main words and the expression words in the target text based on the feature dictionary.
[0170] B10. According to the device described in B9, the feature dictionary also includes synonyms corresponding to each feature word; and the recognition module includes:
[0171] A first matching submodule is used to match the target text with the feature dictionary to obtain a hit feature word and / or a hit synonym;
[0172] The first determination submodule is used to determine the main words and the expression words in the target text according to the hit feature words and / or the feature words corresponding to the hit synonyms.
[0173] B11. The device according to B8, wherein the splicing module comprises:
[0174] A grouping submodule, for dividing the subject words and the expression words in the target text into at least one candidate group according to the order in which the subject words and the expression words in the target text appear in the target text, each candidate group includes a subject word and at least one expression word, and the first word of each candidate group is the subject word and the last word is the expression word;
[0175] A splicing submodule, for splicing the subject words in the current candidate group to be spliced with each expression word in the current candidate group, to obtain a candidate text corresponding to the current candidate group;
[0176] The acquisition submodule is used to obtain a candidate text set according to the candidate text corresponding to each candidate group.
[0177] B12. According to the device described in B8, each entity template in the entity template set includes the following template elements: a main word, an expression word, and a wildcard, and the template elements are extracted based on the mapping relationship corpus between standard entities and entity text segments.
[0178] B13. According to the device described in B8, the matching module includes:
[0179] A second matching submodule is used to perform fuzzy matching on each candidate text in the candidate text set and each entity template in the predefined entity template set, so as to obtain a matching confidence between each candidate text and each entity template;
[0180] The second determination submodule is used to determine that the entity template whose matching confidence is greater than a preset threshold is a target entity template.
[0181] B14. According to the device described in B8, the matching module includes:
[0182] A screening submodule, for determining, for a current candidate text to be matched in the candidate text set, an entity template to be matched in the predefined entity template set, wherein the entity template to be matched contains the same subject words and / or expression words as those in the current candidate text;
[0183] The third matching submodule is used to match each candidate text in the candidate text set with its corresponding entity template to be matched.
[0184] The embodiment of the present application discloses C15, a device for named entity recognition, comprising a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, and the one or more programs include instructions for performing the following operations:
[0185] Identify subject words and performance words in the target text;
[0186] Concatenate and combine the subject words and the expression words in the target text to obtain a candidate text set;
[0187] Matching each candidate text in the candidate text set with a predefined entity template set to obtain a target entity template that meets the matching condition, wherein the entity template set includes at least one template group, each template group includes at least one entity template, and each template group corresponds to a standard entity;
[0188] Determine a named entity recognition result corresponding to the target text according to the standard entity corresponding to the template group to which the target entity template belongs.
[0189] C16. The device according to C15, wherein the device is further configured to execute, by one or more processors, the one or more programs including instructions for performing the following operations:
[0190] Constructing a feature dictionary, wherein the feature dictionary includes preset feature words, and the preset feature words include subject words of a first quantity category and expression words of a second quantity category;
[0191] The identifying of subject words and expression words in the target text includes:
[0192] Based on the feature dictionary, main words and expression words in the target text are identified.
[0193] C17. According to the device described in C16, the feature dictionary also includes synonyms corresponding to each feature word; and the identifying the main words and the expression words in the target text based on the feature dictionary includes:
[0194] Matching the target text with the feature dictionary to obtain hit feature words and / or hit synonyms;
[0195] According to the hit feature words and / or feature words corresponding to the hit synonyms, the main words and the expression words in the target text are determined.
[0196] C18. According to the device described in C15, the subject words and the expression words in the target text are concatenated and combined to obtain a candidate text set, including:
[0197] According to the order in which the subject words and the expression words in the target text appear in the target text, the subject words and the expression words in the target text are divided into at least one candidate group, each candidate group contains a subject word and at least one expression word, and the first word of each candidate group is the subject word, and the last word is the expression word;
[0198] For the current candidate group to be spliced, the main words in the current candidate group are spliced with each expression word in the current candidate group to obtain the candidate text corresponding to the current candidate group;
[0199] A candidate text set is obtained according to the candidate text corresponding to each candidate group.
[0200] C19. According to the device described in C15, each entity template in the entity template set includes the following template elements: a main word, an expression word, and a wildcard, and the template elements are extracted based on the mapping relationship corpus between the standard entity and the entity text segment.
[0201] C20. According to the apparatus described in C15, matching each candidate text in the candidate text set with a predefined entity template set to obtain a target entity template comprises:
[0202] Performing fuzzy matching on each candidate text in the candidate text set and each entity template in the predefined entity template set, respectively, to obtain a matching confidence between each candidate text and each entity template;
[0203] The entity template whose matching confidence is greater than a preset threshold is determined as the target entity template.
[0204] C21. According to the apparatus described in C15, matching each candidate text in the candidate text set with a predefined entity template set comprises:
[0205] For a current candidate text to be matched in the candidate text set, determining an entity template to be matched in the predefined entity template set, wherein the entity template to be matched contains the same subject words and / or expression words as those in the current candidate text;
[0206] Each candidate text in the candidate text set is matched with its corresponding entity template to be matched.
[0207] The embodiment of the present application discloses D22, a machine-readable medium having instructions stored thereon, which, when executed by one or more processors, enables the device to perform the named entity recognition method as described in one or more of A1 to A7.
[0208] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0209] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
[0210] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
[0211] The above is a detailed introduction to a named entity recognition method, a named entity recognition device and a device for named entity recognition 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: Identify subject words and performance words in the target text; Concatenate and combine the subject words and the expression words in the target text to obtain a candidate text set; Matching each candidate text in the candidate text set with a predefined entity template set to obtain a target entity template that meets the matching condition, wherein the entity template set includes at least one template group, each template group includes at least one entity template, and each template group corresponds to a standard entity; Determine a named entity recognition result corresponding to the target text according to a standard entity corresponding to the template group to which the target entity template belongs; The subject words and the expression words in the target text are concatenated and combined to obtain a candidate text set, including: According to the order in which the subject words and the expression words in the target text appear in the target text, the subject words and the expression words in the target text are divided into at least one candidate group, each candidate group contains a subject word and at least one expression word, and the first word of each candidate group is the subject word, and the last word is the expression word; For the current candidate group to be spliced, the main words in the current candidate group are spliced with each expression word in the current candidate group to obtain the candidate text corresponding to the current candidate group; A candidate text set is obtained according to the candidate text corresponding to each candidate group.
2. The method according to claim 1, characterized in that Before identifying the subject words and the expression words in the target text, the method further includes: Constructing a feature dictionary, wherein the feature dictionary includes preset feature words, and the preset feature words include subject words of a first quantity category and expression words of a second quantity category; The identifying of subject words and expression words in the target text includes: Based on the feature dictionary, main words and expression words in the target text are identified.
3. The method according to claim 2, characterized in that The feature dictionary also includes synonyms corresponding to each feature word; the identifying of the subject words and the expression words in the target text based on the feature dictionary includes: Matching the target text with the feature dictionary to obtain hit feature words and / or hit synonyms; According to the hit feature words and / or feature words corresponding to the hit synonyms, the main words and the expression words in the target text are determined.
4. The method according to claim 1, characterized in that: Each entity template in the entity template set includes the following template elements: a main word, a representation word, and a wildcard, and the template elements are extracted based on the mapping relationship corpus between the standard entity and the entity text segment.
5. The method according to claim 1, characterized in that The step of matching each candidate text in the candidate text set with a predefined entity template set to obtain a target entity template includes: Performing fuzzy matching on each candidate text in the candidate text set and each entity template in the predefined entity template set, respectively, to obtain a matching confidence between each candidate text and each entity template; The entity template whose matching confidence is greater than a preset threshold is determined as the target entity template.
6. The method according to claim 1, characterized in that The matching of each candidate text in the candidate text set with a predefined entity template set includes: For a current candidate text to be matched in the candidate text set, determining an entity template to be matched in the predefined entity template set, wherein the entity template to be matched contains the same subject words and / or expression words as those in the current candidate text; Each candidate text in the candidate text set is matched with its corresponding entity template to be matched.
7. A named entity recognition device, characterized in that: The device comprises: A recognition module is used to identify subject words and expression words in the target text; A concatenation module is used to concatenate and combine the subject words and the expression words in the target text to obtain a candidate text set; A matching module, used for matching each candidate text in the candidate text set with a predefined entity template set to obtain a target entity template that meets the matching condition, wherein the entity template set includes at least one template group, each template group includes at least one entity template, and each template group corresponds to a standard entity; A determination module, used to determine a named entity recognition result corresponding to the target text according to a standard entity corresponding to a template group to which the target entity template belongs; The splicing module comprises: A grouping submodule, for dividing the subject words and the expression words in the target text into at least one candidate group according to the order in which the subject words and the expression words in the target text appear in the target text, each candidate group includes a subject word and at least one expression word, and the first word of each candidate group is the subject word and the last word is the expression word; A splicing submodule, for splicing the subject words in the current candidate group to be spliced with each expression word in the current candidate group, to obtain a candidate text corresponding to the current candidate group; The acquisition submodule is used to obtain a candidate text set according to the candidate text corresponding to each candidate group.
8. The device according to claim 7, characterized in that The device also includes: A dictionary construction module, used to construct a feature dictionary, wherein the feature dictionary includes preset feature words, and the preset feature words include subject words of a first quantity category and expression words of a second quantity category; The recognition module is specifically used to recognize the main words and the expression words in the target text based on the feature dictionary.
9. The device according to claim 8, characterized in that The feature dictionary also includes synonyms corresponding to each feature word; the recognition module includes: A first matching submodule is used to match the target text with the feature dictionary to obtain a hit feature word and / or a hit synonym; The first determination submodule is used to determine the main words and the expression words in the target text according to the hit feature words and / or the feature words corresponding to the hit synonyms.
10. The device according to claim 7, characterized in that Each entity template in the entity template set includes the following template elements: a main word, a representation word, and a wildcard, and the template elements are extracted based on the mapping relationship corpus between the standard entity and the entity text segment.
11. The device according to claim 7, characterized in that The matching module comprises: A second matching submodule is used to perform fuzzy matching on each candidate text in the candidate text set and each entity template in the predefined entity template set, so as to obtain a matching confidence between each candidate text and each entity template; The second determination submodule is used to determine that the entity template whose matching confidence is greater than a preset threshold is a target entity template.
12. The device according to claim 7, characterized in that The matching module comprises: A screening submodule, for determining, for a current candidate text to be matched in the candidate text set, an entity template to be matched in the predefined entity template set, wherein the entity template to be matched contains the same subject words and / or expression words as those in the current candidate text; The third matching submodule is used to match each candidate text in the candidate text set with its corresponding entity template to be matched.
13. A device for named entity recognition, characterized in that: The system comprises a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, wherein the one or more programs include instructions for performing the following operations: Identify subject words and performance words in the target text; Concatenate and combine the subject words and the expression words in the target text to obtain a candidate text set; Matching each candidate text in the candidate text set with a predefined entity template set to obtain a target entity template that meets the matching condition, wherein the entity template set includes at least one template group, each template group includes at least one entity template, and each template group corresponds to a standard entity; Determine a named entity recognition result corresponding to the target text according to a standard entity corresponding to the template group to which the target entity template belongs; The subject words and the expression words in the target text are concatenated and combined to obtain a candidate text set, including: According to the order in which the subject words and the expression words in the target text appear in the target text, the subject words and the expression words in the target text are divided into at least one candidate group, each candidate group contains a subject word and at least one expression word, and the first word of each candidate group is the subject word, and the last word is the expression word; For the current candidate group to be spliced, the main words in the current candidate group are spliced with each expression word in the current candidate group to obtain the candidate text corresponding to the current candidate group; A candidate text set is obtained according to the candidate text corresponding to each candidate group.
14. The device according to claim 13, characterized in that The device is also configured to execute, by one or more processors, the one or more programs including instructions for: Constructing a feature dictionary, wherein the feature dictionary includes preset feature words, and the preset feature words include subject words of a first quantity category and expression words of a second quantity category; The identifying of subject words and expression words in the target text includes: Based on the feature dictionary, main words and expression words in the target text are identified.
15. The device according to claim 14, characterized in that The feature dictionary also includes synonyms corresponding to each feature word; the identifying of the subject words and the expression words in the target text based on the feature dictionary includes: Matching the target text with the feature dictionary to obtain hit feature words and / or hit synonyms; According to the hit feature words and / or feature words corresponding to the hit synonyms, the main words and the expression words in the target text are determined.
16. The device according to claim 13, characterized in that Each entity template in the entity template set includes the following template elements: a main word, a representation word, and a wildcard, and the template elements are extracted based on the mapping relationship corpus between the standard entity and the entity text segment.
17. The device according to claim 13, characterized in that The step of matching each candidate text in the candidate text set with a predefined entity template set to obtain a target entity template includes: Performing fuzzy matching on each candidate text in the candidate text set and each entity template in the predefined entity template set, respectively, to obtain a matching confidence between each candidate text and each entity template; The entity template whose matching confidence is greater than a preset threshold is determined as the target entity template.
18. The device according to claim 13, characterized in that The matching of each candidate text in the candidate text set with a predefined entity template set includes: For a current candidate text to be matched in the candidate text set, determining an entity template to be matched in the predefined entity template set, wherein the entity template to be matched contains the same subject words and / or expression words as those in the current candidate text; Each candidate text in the candidate text set is matched with its corresponding entity template to be matched.
19. A machine-readable medium having instructions stored thereon, which, when executed by one or more processors, causes an apparatus to perform the method for named entity recognition as claimed in one or more of claims 1 to 6.
