Auxiliary medical field named entity labeling method based on rule configuration
By adopting the auxiliary naming entity labeling method based on rule configuration in the medical field, defining and optimizing the labeling rules, the problem of low efficiency and accuracy of medical naming entity recognition is solved, and an efficient and automated annotation process is realized, suitable for complex medical texts .
Patent Information
- Application Number
- CN202411246643.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-06
- Publication Date
- 2024-12-13
AI Technical Summary
The recognition of naming entities in the medical field is difficult, and the existing methods are inefficient and accurate, especially due to the rich proprietary terms, abbreviations, missing values and spelling errors, the efficiency of reliance on a large number of manual annotations is low.
Use the auxiliary named entity labeling method based on rule configuration to define entity types and configure entity labeling rules, including extraction rules, front-end and post-co-occurrence rules, and maximum intervals, etc., to improve the labeling accuracy through automated labeling and iterative optimization rules.
It has improved the efficiency and accuracy of naming entity annotation in the medical field, designed clear entity annotation rules and iterative processes, saved manpower, and was suitable for different named entity identification projects.
Smart Images

Figure CN119129545A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a named entity tagging method in the auxiliary medical field based on rule configuration, and belongs to the technical field of medical natural language data processing. Background Art
[0002] Named Entity Recognition (NER) is a basic task in natural language processing. Specifically, it refers to identifying words or phrases related to one or more specific entities given a piece of text and classifying them into predefined entity categories. These specific entity categories can include names of people, things, places, dates, etc. The significance and importance of NER lies in its ability to improve the ability to automatically process and utilize text information. In daily information processing, it is often necessary to quickly and accurately extract key information from a large amount of text, such as searching for relevant news reports in search engines, analyzing public opinion in the financial field, and identifying patient information in medical records in the medical field. Named entity recognition can help people complete these complex and time-consuming tasks quickly and automatically, thereby greatly improving the efficiency of information retrieval, understanding, and utilization.
[0003] In the named entity recognition task, commonly used methods include: (1) rule-based methods: that is, by writing a series of rules and matching them one by one in sentences to perform annotation; (2) supervised learning-based methods: through statistical methods or deep learning methods, a large amount of annotated text data is trained and learned to build a supervised classification model that can annotate new text. The advantage of the former is that the annotation process is intuitive and controllable, suitable for dealing with some specific fields and tasks, and can handle complex and diverse entity types; the disadvantage is that the degree of intelligence is not high, so it cannot handle words outside the processing rules, and the effect is not good for texts with complex contexts and cumbersome rules. The advantage of the latter is that it has better adaptability to complex language phenomena and fields, has a higher accuracy rate under large-scale annotated data, and can handle text levels and contexts in common language phenomena; the disadvantage is that it requires a large-scale annotated corpus, and when data is scarce, it is prone to overfitting.
[0004] Medical treatment is a field where named entity recognition methods are difficult to apply. First, the medical field has a very rich variety of proprietary terms and abbreviations, involving symptoms, drugs, surgeries, examinations, and many other aspects. Many of these terms are not universal terms and may have different interpretations and meanings in different contexts; second, there are many entity types in the medical field, such as diseases, symptoms, surgeries, examinations, drugs, etc. These entity types may overlap and be associated; third, the data quality in the medical field is not as good as in other fields, and may contain missing values, spelling errors, missing punctuation, and other problems. There may also be many abbreviations and variant characters, which make named entity recognition more difficult. Therefore, the annotation of medical named entity recognition systems is usually a difficult process. The current mainstream approach is to rely on a large number of professional physicians for manual annotation, which is inefficient. Summary of the invention
[0005] The purpose of the present invention is to improve the annotation efficiency of named entities in the medical field, to perform named entity annotation more flexibly and reasonably, thereby improving annotation efficiency and accuracy.
[0006] In order to solve the above technical problems, the technical solution of the present invention provides a method for labeling named entities in the auxiliary medical field based on rule configuration, which is characterized by comprising the following steps:
[0007] Step 1: Define entity type:
[0008] For a named entity recognition task, define the n entity names required;
[0009] Step 2: Select the annotation data:
[0010] Collecting annotated data for a current named entity task, wherein the annotated data includes m pieces of text data;
[0011] Step 3: Set the labeling target:
[0012] Set the entity name labeling method; set the labeling error rate threshold α for subsequent use; set the text random sampling ratio β for subsequent use;
[0013] Step 4: Configure entity annotation rules:
[0014] For n entity names, the corresponding entity annotation rules are configured respectively. The design goal of the entity annotation rule is: the annotation rule for a single entity is used to define the rules for annotating specific content from the text, including six filling items, which are as follows:
[0015] Fill in item 1) Extraction rule: Fill in a string, which is a required item; you need to fill in keywords or regular expressions to match the text data, and the matched content will be marked as the corresponding entity name;
[0016] Fill in item 2) Preceding co-occurrence: Fill in a string, optional; you need to fill in a keyword or regular expression to match the content that appears before the extraction rule;
[0017] Fill in item 3) after co-occurrence: fill in a string, optional; you need to fill in a keyword or regular expression to match the content that appears after the extraction rule;
[0018] Fill in item 4) Maximum number of intervals: fill in a positive integer, optional; represents the character distance between the extraction rule matching content and the previous co-occurrence / after co-occurrence matching content: if the character distance is within the maximum number of intervals, the previous co-occurrence rule / after co-occurrence rule will take effect; if it exceeds the character distance, the previous co-occurrence rule and the after co-occurrence rule will not take effect; if this item is not filled in, the default is 0, that is, the extraction rule is adjacent to the previous co-occurrence / after co-occurrence matching content;
[0019] Fill in item 5) Pre-co-occurrence rule: The options include "accompany" and "not accompany", which is optional. If "accompany" is checked, it means that the content in the pre-co-occurrence must appear within the maximum number of intervals before the content matching the extraction rule. If it does not appear, the extraction rule will not be marked. If "not accompany" is checked, it means that the content in the pre-co-occurrence cannot appear within the maximum number of intervals before the content matching the extraction rule. If it appears, the extraction rule will not be marked. This option is used together with the pre-co-occurrence fill-in item to constrain the content that must appear before the extraction rule.
[0020] Fill in item 6) Post-co-occurrence rule: The options include "accompany" and "not accompany", which is optional. If "accompany" is checked, it means that the content in the post-co-occurrence must appear within the maximum number of intervals after the content matched by the extraction rule. If it does not appear, the extraction rule will not be marked. If "not accompany" is checked, it means that the content in the post-co-occurrence cannot appear within the maximum number of intervals after the content matched by the extraction rule. If it does appear, the extraction rule will not be marked. This option is used together with the post-co-occurrence fill-in item to constrain the content that must appear after the extraction rule.
[0021] Among the above six filling items, the three filling items of front co-occurrence, extraction rules, and back co-occurrence support not only the matching of static characters, but also the matching of specific entities by regular expressions; among the above six filling items, if the required items are not filled in, no annotation will be made; if the optional items are not filled in, they will not be processed by default, that is, the rules corresponding to the items will not have any effect on entity annotation; in addition, for a named entity, multiple entity annotation rules can be configured, and multiple entity annotation rules are executed in sequence according to the filling order, and the text is annotated in sequence;
[0022] Step 5: Save entity annotation rules:
[0023] For n entity names, after completing the corresponding entity annotation rule configuration, save these rules as rule R1;
[0024] Step 6: Batch labeling:
[0025] Use the saved rule R1 to automatically annotate m pieces of text data and return m annotation results;
[0026] Step 7: Label verification and rule correction:
[0027] Randomly extract the annotation results of the random sampling ratio β of text from the annotation results, conduct manual verification, and count the proportion P1 of missed and mislabeled entities in all entities; then, modify the rule R1 to achieve correct annotation for the missed and mislabeled entities, and re-annotate in batches;
[0028] Step 8: Rule iteration:
[0029] Repeat the above step 7 and continuously modify rule R1 until the iteration termination condition is met, then stop the iteration and proceed to the next step, where the iteration termination condition is: the proportion P1 is less than the labeling error rate threshold α;
[0030] Step 9: Return the annotation results:
[0031] The final m annotation results and the corresponding m text data are returned as input data for the supervised named entity recognition model for model training, verification and testing.
[0032] Preferably, in step 1, the n entity names are represented as [E1, E2, E3, ..., E n ], where E n The name of the nth entity.
[0033] Preferably, in step 2, the m pieces of text data are represented as [T1, T2, T3, ..., T m ], where T m is the mth piece of text data.
[0034] Preferably, in step 3, the entity name tag method includes a "BIO" method and a "BIOES" method, wherein:
[0035] In the "BIO" square: characters at the beginning of an entity are marked with "B", characters in the middle or at the end of an entity are marked with "I", and characters that are not entity names are marked with "O";
[0036] In the "BIOES" method: characters at the beginning of an entity are marked as "B", characters at the end of an entity are marked as "E", characters in the middle of an entity are marked as "I", characters that are not entity names are marked as "O", and entities consisting of a single character are marked as "S".
[0037] Preferably, in step 3, the value ranges of the annotation error rate threshold α and the text random sampling ratio β are both 0-1.
[0038] Preferably, in step 6, the m annotation results are represented as [S1, S2, S3, ..., S m ], where S m is the mth labeling result.
[0039] Compared with the prior art solutions, the present invention has the following beneficial effects:
[0040] First, the present invention designs a clear and universal entity labeling rule, supports regular expression matching labeling, and has a wide range of applications; second, the present invention designs a clear entity labeling iterative process, which can continuously improve the labeling rules and improve the accuracy of labeling until the preset goal is achieved; third, compared with the traditional manual labeling method, the present invention performs automatic labeling based on rule configuration, and can save the labeling rules as a knowledge base, which can be directly called for secondary labeling in the later stage, which is more convenient.
[0041] Therefore, as an improvement on traditional manual labeling, the method disclosed in the present invention can improve the efficiency of labeling, save labeling manpower, and facilitate its promotion and use in different named entity recognition projects. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 is a flow chart of the present invention;
[0043] Figure 2 The returned annotation result in the embodiment of the present invention is illustrated. DETAILED DESCRIPTION
[0044] The present invention will be further described below in conjunction with specific embodiments. It should be understood that these embodiments are only used to illustrate the present invention and are not intended to limit the scope of the present invention. In addition, it should be understood that after reading the content taught by the present invention, those skilled in the art can make various changes or modifications to the present invention, and these equivalent forms fall within the scope limited by the appended claims of the application equally.
[0045] The embodiment of the present invention takes a named entity recognition task of the electronic medical record of the cardiology department of a medical institution as an example to illustrate the specific implementation method of the method for an auxiliary medical field named entity labeling based on rule configuration disclosed by the present invention. Figure 1 , including the following steps.
[0046] 1. Define entity types: For this named entity recognition task, define the required 5 entity names [E1, E2, E3, ..., E5], corresponding to the names: pericardial effusion_yes, left atrial area, right atrial area, left ventricular myocardial thickness_normal, valvular regurgitation_no.
[0047] 2. Select annotated data: Collect annotated data for the named entity task, including 1000 text data [T1, T2, T3, ..., T 1000 ], where T1 is the first text data, and so on. 1000 This is the 1000th piece of text data.
[0048] 3. Set the annotation target: Set the entity name labeling method, including "BIO" and "BIOES", and select the "BIO" method; set the annotation error rate threshold α to 5% for subsequent use; set the text random sampling ratio β to 5% for subsequent use.
[0049] 4. Configure entity annotation rules: For the five entity names, configure the corresponding entity annotation rules. The design goal of the entity annotation rules is: annotation rules for a single entity, used to define rules for annotating specific content from the text, mainly including six filling items, as follows:
[0050] (1) Extraction rule: Enter a string, which is required. You need to enter a keyword or regular expression to match the text data. The matched content is marked as the corresponding entity name.
[0051] (2) Preceding co-occurrence: Enter a string, optional. You need to enter a keyword or regular expression to match the content that appears before the extraction rule.
[0052] (3) Post-co-occurrence: Enter a string, optional. You need to enter a keyword or regular expression to match the content that appears after the extraction rule.
[0053] (4) Maximum interval number: Enter a positive integer, optional. Indicates the character distance between the extraction rule matching content and the previous co-occurrence / next co-occurrence matching content. If the distance is within the maximum interval number of characters, the previous co-occurrence rule / next co-occurrence rule will take effect; if it exceeds this distance, these two constraint rules will not take effect. If this item is not filled in, the default is 0, that is, the extraction rule is adjacent to the previous co-occurrence / next co-occurrence matching content.
[0054] (5) Pre-co-occurrence rule: Option (accompanying, not accompanying), optional. If you check Accompany, it means that the content in the pre-co-occurrence must appear within the maximum number of intervals before the content matching the extraction rule. If it does not appear, the extraction rule will not be marked; if you check Not accompanying, it means that the content in the pre-co-occurrence cannot appear within the maximum number of intervals before the content matching the extraction rule. If it does appear, the extraction rule will not be marked. This option is used together with the pre-co-occurrence entry to constrain the content that must appear before the extraction rule.
[0055] (6) Post-co-occurrence rule: Option (accompanying, not accompanying), optional. If you check Accompany, it means that the content in the post-co-occurrence must appear within the maximum number of intervals after the content matched by the extraction rule. If it does not appear, the extraction rule will not be marked; if you check Not accompanying, it means that the content in the post-co-occurrence cannot appear within the maximum number of intervals after the content matched by the extraction rule. If it does appear, the extraction rule will not be marked. This option is used together with the post-co-occurrence entry to constrain the content that must appear after the extraction rule.
[0056] For the five entities, the following entity annotation rules are configured respectively, see Table 1.
[0057]
[0058] Table 1 Labeling rules for the five entities
[0059] 5. Save entity labeling rules: For the five entity names, after completing the corresponding entity labeling rule configuration, save these rules as rule R1.
[0060] 6. Batch annotation: Use the saved rule R1 to annotate 1000 text data [T1, T2, T3, ..., T 1000 ] respectively perform automatic annotation and return the annotation results [S1, S2, S3, ..., S 1000 ] Taking the text data T1 as an example, the automatic annotation of a single text is demonstrated.
[0061] Text data T1 is: The right atrium is blocked by the liver, and the right atrium is not clearly displayed. 1. The inner diameter of the left atrium is normal, the inner diameter of the left ventricle is normal, the inner diameter of the right atrium is normal, and the inner diameter of the right ventricle is normal. The area of the left atrium is 1437.5mm2, the area of the right atrium is 1513.7mm2, and the inner diameter of the aortic root is not wide. The echo of the atrioventricular septum is continuous, and no obvious blood flow signal across the septum is observed. The thickness of the left ventricular myocardium is normal. 2. The aortic valve is not thickened, and no valvular regurgitation is observed. 3. The size and shape of the heart shadow are normal, and pericardial effusion is present.
[0062] After being processed by rule R1, the returned annotation result is as follows Figure 2 shown.
[0063] 7. Labeling verification and rule correction: Randomly select 5% of the labeling results, that is, 50 texts and labeling results, and conduct manual verification to count the missing and mislabeled entities, and obtain a proportion of P1 of 3% in all entities. Then, for the missing and mislabeled entities, modify the rule R1 to achieve correct labeling and re-label in batches.
[0064] 8. Rule iteration: Since the proportion P1 is 3%, which is less than the specified threshold α (5%), the above step 7 is not repeated.
[0065] 9. Return the annotation result: Return the final annotation result [S1, S2, S3, ..., S 1000 ] and text data [T1,T2,T3,...,T 1000 ] as the input data of the supervised named entity recognition model for model training, verification and testing.
Claims
1. A method for labeling named entities in the auxiliary medical field based on rule configuration, characterized in that: The following steps are involved: Step 1: Define entity type: For a named entity recognition task, define the n entity names required; Step 2: Select the annotation data: Collecting annotated data for a current named entity task, wherein the annotated data includes m pieces of text data; Step 3: Set the labeling target: Set the entity name labeling method; set the labeling error rate threshold α for subsequent use; set the text random sampling ratio β for subsequent use; Step 4: Configure entity annotation rules: For n entity names, the corresponding entity annotation rules are configured respectively. The design goal of the entity annotation rule is: the annotation rule for a single entity is used to define the rules for annotating specific content from the text, including six filling items, which are as follows: Fill in item 1) Extraction rule: Fill in a string, which is a required item; you need to fill in keywords or regular expressions to match the text data, and the matched content will be marked as the corresponding entity name; Fill in item 2) Preceding co-occurrence: Fill in a string, optional; you need to fill in a keyword or regular expression to match the content that appears before the extraction rule; Fill in item 3) after co-occurrence: fill in a string, optional; you need to fill in a keyword or regular expression to match the content that appears after the extraction rule; Fill in item 4) Maximum number of intervals: fill in a positive integer, optional; represents the character distance between the extraction rule matching content and the previous co-occurrence / after co-occurrence matching content: if the character distance is within the maximum number of intervals, the previous co-occurrence rule / after co-occurrence rule will take effect; if it exceeds the character distance, the previous co-occurrence rule and the after co-occurrence rule will not take effect; if this item is not filled in, the default is 0, that is, the extraction rule is adjacent to the previous co-occurrence / after co-occurrence matching content; Fill in item 5) Pre-co-occurrence rule: The options include "accompany" and "not accompany", which is optional. If "accompany" is checked, it means that the content in the pre-co-occurrence must appear within the maximum number of intervals before the content matching the extraction rule. If it does not appear, the extraction rule will not be marked. If "not accompany" is checked, it means that the content in the pre-co-occurrence cannot appear within the maximum number of intervals before the content matching the extraction rule. If it appears, the extraction rule will not be marked. This option is used together with the pre-co-occurrence fill-in item to constrain the content that must appear before the extraction rule. Fill in item 6) Post-co-occurrence rule: The options include "accompany" and "not accompany", which is optional. If "accompany" is checked, it means that the content in the post-co-occurrence must appear within the maximum number of intervals after the content matched by the extraction rule. If it does not appear, the extraction rule will not be marked. If "not accompany" is checked, it means that the content in the post-co-occurrence cannot appear within the maximum number of intervals after the content matched by the extraction rule. If it does appear, the extraction rule will not be marked. This option is used together with the post-co-occurrence fill-in item to constrain the content that must appear after the extraction rule. Among the above six filling items, the three filling items of front co-occurrence, extraction rules, and back co-occurrence support not only the matching of static characters, but also the matching of specific entities by regular expressions; among the above six filling items, if the required items are not filled in, no annotation will be made; if the optional items are not filled in, they will not be processed by default, that is, the rules corresponding to the items will not have any effect on entity annotation; in addition, for a named entity, multiple entity annotation rules can be configured, and multiple entity annotation rules are executed in sequence according to the filling order, and the text is annotated in sequence; Step 5: Save entity annotation rules: For n entity names, after completing the corresponding entity annotation rule configuration, save these rules as rule R1; Step 6: Batch labeling: Use the saved rule R1 to automatically annotate m pieces of text data and return m annotation results; Step 7: Label verification and rule correction: Randomly extract the annotation results of the random sampling ratio β of text from the annotation results, conduct manual verification, and count the proportion P1 of missed and mislabeled entities in all entities; then, modify the rule R1 to achieve correct annotation for the missed and mislabeled entities, and re-annotate in batches; Step 8: Rule iteration: Repeat the above step 7 and continuously modify rule R1 until the iteration termination condition is met, then stop the iteration and proceed to the next step, where the iteration termination condition is: the proportion P1 is less than the labeling error rate threshold α; Step 9: Return the annotation results: The final m annotation results and the corresponding m text data are returned as input data for the supervised named entity recognition model for model training, verification and testing.
2. A method for labeling named entities in the auxiliary medical field based on rule configuration as claimed in claim 1, characterized in that: In step 1, the n entity names are represented as [E1, E2, E3, ..., E n ], where E n The name of the nth entity.
3. The method for named entity labeling in the auxiliary medical field based on rule configuration as claimed in claim 1, characterized in that: In step 2, the m pieces of text data are represented as [T1, T2, T3, ..., T m ], where T m is the mth piece of text data.
4. The method for labeling named entities in the auxiliary medical field based on rule configuration as claimed in claim 1, characterized in that: In step 3, the entity name tag method includes a "BIO" method and a "BIOES" method, wherein: In the "BIO" square: characters at the beginning of an entity are marked with "B", characters in the middle or at the end of an entity are marked with "I", and characters that are not entity names are marked with "O"; In the "BIOES" method: characters at the beginning of an entity are marked as "B", characters at the end of an entity are marked as "E", characters in the middle of an entity are marked as "I", characters that are not entity names are marked as "O", and entities consisting of a single character are marked as "S".
5. The method for labeling named entities in the auxiliary medical field based on rule configuration as claimed in claim 1, characterized in that: In step 3, the value ranges of the annotation error rate threshold α and the text random sampling ratio β are both 0-1.
6. The method for named entity labeling in the auxiliary medical field based on rule configuration as claimed in claim 1, characterized in that: In step 6, the m annotation results are represented as [S1, S2, S3, ..., S m ], where S m is the mth labeling result.
