Nursing teaching task-oriented nursing field text annotation corpus construction method
By constructing a dynamic dictionary and entity co-occurrence graph for the nursing domain, and combining fuzzy matching and annotation correction functions, the problems of ambiguity in professional abbreviations and spelling errors in nursing texts were solved, improving the accuracy and robustness of entity recognition and enhancing the model's generalization ability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TIANJIN TELLYES SCI INC
- Filing Date
- 2026-04-14
- Publication Date
- 2026-05-12
AI Technical Summary
Existing technologies cannot effectively handle ambiguous professional abbreviations, spelling errors, and semantically equivalent variations when processing nursing texts, resulting in poor entity recognition accuracy and robustness. Furthermore, they lack automatic correction mechanisms, making it difficult to ensure consistent annotations, neglecting global semantic relationships between entities, and resulting in insufficient model generalization ability.
We construct a dynamic dictionary for the nursing domain, use fuzzy matching and graph structure for text normalization and cleaning, combine entity co-occurrence graph and annotation correction function for consistency correction, construct a deep neural network model, integrate local context and global co-occurrence knowledge, and use the total loss function for training.
This method achieves deep standardization and cleaning of nursing texts, improves annotation quality and model generalization ability, and significantly enhances the accuracy and robustness of entity recognition.
Smart Images

Figure CN122020186A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence technology and medical information processing, specifically to a method for constructing a text annotation corpus for nursing education tasks. Background Technology
[0002] Against the backdrop of rapid development in medical informatization and intelligentization, the textual data generated by the nursing field, as a crucial component of clinical medicine, holds immense application value. Hospital electronic medical record systems, nursing record documents, clinical nursing pathways, nurse handover reports, and relevant nursing research literature have accumulated a vast amount of unstructured or semi-structured nursing text. These texts meticulously record key information such as changes in patient symptoms, vital sign monitoring data, execution of nursing procedures, medication use feedback, and nursing assessment results, serving as core carriers reflecting real clinical nursing scenarios. Fully mining and analyzing this nursing textual data is of great significance for supporting clinical nursing decision-making, improving the quality of nursing education, monitoring the quality of nursing services, and promoting the development of nursing research.
[0003] However, existing technologies typically have the following problems: 1. Existing technologies typically use general character replacement or regular expression matching methods to clean nursing texts, which cannot effectively handle the ambiguity of professional abbreviations, spelling errors, and rich semantic equivalence variations unique to the nursing field. This results in the same entity often being segmented into different words, which seriously affects the accuracy and robustness of subsequent entity recognition.
[0004] 2. Existing technologies lack effective automatic correction mechanisms when facing inconsistencies in entity boundaries caused by manual annotation or model prediction. They usually have to rely on manual review, which is inefficient and makes it difficult to guarantee the annotation consistency of large-scale corpora.
[0005] 3. Most existing entity recognition models rely solely on local contextual information for judgment, neglecting the strong co-occurrence relationships and semantic associations between entities in nursing texts at the global corpus level. Therefore, the model's discrimination ability is significantly limited when dealing with entities with ambiguous boundaries, semantic ambiguity, and rare entities.
[0006] 4. Existing model training processes typically focus solely on fitting labeled data, failing to effectively utilize prior knowledge in the nursing field to guide model learning. This results in discrepancies between the model's representation in the feature space and domain expertise, leading to room for improvement in generalization ability and robustness. Summary of the Invention
[0007] To address the shortcomings of existing technologies, this invention provides a method for constructing a text annotation corpus in the nursing field for nursing teaching tasks, thereby resolving the problems existing in the prior art.
[0008] To achieve the above objectives, the present invention employs the following technical solution: A method for constructing a text-annotated corpus in the nursing field for nursing teaching tasks includes the following methods: S1. Collect raw nursing text data, manually annotate the collected data, and construct a training dataset; S2. Based on the nursing dictionary, fuzzy matching is used to achieve text standardization and cleaning, and graph structure is used to perform consistency correction on entity annotations to complete the data standardization process. S3. Construct an entity recognition model for the nursing field. The entity recognition model takes normalized text sequences and corrected label sequences as inputs, and uses fuzzy matching features, entity co-occurrence graphs and annotation correction functions to construct a deep neural network that integrates local context, global co-occurrence knowledge and annotation priors. S4. Construct the total loss function, which includes the main loss to ensure the accuracy of entity boundary and type recognition, and the auxiliary loss to force the model's representation in the feature space to be consistent with the semantic relationship provided by the correction function. S5. Train the entity recognition model using the cleaned and standardized training dataset; S6. Automatically annotate the original nursing text using an entity recognition model.
[0009] Furthermore, the annotation adopts a BIO-based entity annotation system, where B represents the beginning of an entity, I represents the interior of an entity, and O represents a non-entity.
[0010] Furthermore, in S2, fuzzy matching is used based on the nursing dictionary to achieve text standardization and cleaning, specifically as follows: A dynamic dictionary for the nursing domain is constructed, and a fuzzy matching function based on edit distance and contextual semantics is introduced to map variant forms to standard entities; After segmenting the original text into words, a normalized text sequence is obtained by applying a fuzzy matching function to each word. If the fuzzy matching function matches the standard word And the similarity is not lower than the threshold. ,but ;otherwise ,in Indicates the first normalized text sequence The text content of each word element This represents the segment in the original nursing text that needs to be standardized. It is a list of strings with a length of , Indicates the sequence length, corresponding to the number of tokens after word segmentation. This represents the text content of the nth term in a normalized text sequence.
[0011] Furthermore, S2 utilizes graph structures to perform consistency correction on entity annotations, completing the data standardization process, specifically as follows: Extract all entity fragments from the original labeled sequence to obtain a list of entity fragments. Each segment It includes entity words and their start and end positions in the text; among them, Indicates the first Each entity fragment contains the entity word text and its start and end positions in the text; Indicates the first A single entity fragment; Indicates the index of an entity fragment, with a range of values. ; This indicates the total number of entity fragments in the current document; Constructing an entity co-occurrence graph V is the set of vertices in the graph, C is the set of edge weights in the graph, where nodes are defined. Represent entity words and define edge weights entity words and The number of documents that co-occur in the corpus; Define a labeling correction function for any two adjacent or overlapping entity fragments in the current document.
[0012] Furthermore, the annotation correction function adjusts inconsistent annotations at the boundaries through consensus among neighboring entities. For each pair that satisfies... Adjacent or overlapping entity fragments are merged or split based on the sign of the annotation correction function: if the output Then and Merge into a single entity fragment and update the label sequence; if the output... If so, keep it as is or split it; among them Represents two entity fragments and The intersection-union ratio (IoU) on a text sequence is calculated if two segments do not overlap. ; The boundary overlap threshold is a preset constant used to determine whether two segments point to the same text region. It was determined that there was a labeling conflict between the two and that correction was necessary.
[0013] Furthermore, S3 specifically includes the following steps: S31. Contextual encoding based on fuzzy matching feature enhancement: Construct a feature fusion module to weight and fuse the feature vectors extracted based on fuzzy matching with the output vectors of the pre-trained language model to obtain enhanced lexical representations; S32. Global Context Fusion Based on Entity Co-occurrence Graph: Construct an entity co-occurrence graph, use a graph neural network to learn a global embedding vector for each entity node in the graph, and dynamically map and fuse the global embedding vector into the enhanced lexical representation; S33. Boundary-aware segment decoding and correction fusion: A span-based decoding strategy is adopted to calculate the confidence that all possible continuous segments are identified as entities; at the same time, correction labels and correction functions generated based on the annotation correction process are introduced as prior constraints to adjust the model's attention to specific merged or split regions. S34. Entity Type Classification and Graph Embedding Enhancement: For a target fragment identified as an entity, obtain its fragment representation and retrieve the neighbor node information corresponding to the target fragment based on the entity co-occurrence graph; perform feature concatenation or interaction between the fragment representation and the neighbor node information to predict the specific entity type of the target fragment.
[0014] Furthermore, S4 specifically refers to: Construct the main loss function: Construct positive samples based on entity fragments labeled in the calibration labels, and construct negative samples based on random sampling of non-entity fragments. Calculate the classification main loss using the positive and negative samples. Constructing the consistency loss function: For all fragment pairs that satisfy the positional overlap condition, the merging or splitting relationship between fragment pairs is determined based on the semantic indication information provided by the correction function; a consistency regularization term is constructed, which minimizes the vector distance of fragment pairs with merging relationship and maximizes the vector distance of fragment pairs with splitting relationship by constraining the distance between fragment pairs in the feature space, thereby calculating the consistency loss function; Constructing the total loss function: The main loss function and the consistency loss function are weighted and summed to obtain the total loss function, and the model parameters are updated using the total loss function.
[0015] Furthermore, S5 employs an end-to-end approach to model training, optimizing all trainable parameters through backpropagation, specifically: Data loading and batch processing: The cleaned and standardized training dataset is divided into a training set and a validation set, and the training set is further divided into several training batches. The training dataset contains normalized text sequences and their corresponding correction label sequences. Each batch of normalized text sequences is input into the entity recognition model. Initial context representations are obtained sequentially through a pre-trained language model. Enhanced lexical representations are obtained by fusing fuzzy matching features through a gated linear fusion unit. Finally, the final lexical representations are obtained by fusing global context information through a graph attention network. Entity scores and type probabilities for all possible segments are calculated based on a span-based decoding strategy. Backward parameter update: Calculate the loss value of the current batch based on the total loss function, and update all trainable parameters in the entity recognition model based on the backpropagation algorithm. Trainable parameters include pre-trained language model parameters, graph attention network parameters, multilayer perceptron parameters, and embedding vectors. Model validation and convergence judgment: After each training cycle, the performance of the current model is evaluated using the validation set to obtain the precision, recall and F1 score of entity recognition; if the F1 score of the validation set does not improve within a preset number of consecutive cycles, an early stopping mechanism is triggered, and the model parameters corresponding to the highest F1 score on the validation set are saved as the final training result.
[0016] Furthermore, the feature vector includes: edit similarity, semantic similarity, and matching confidence with the best matching standard word.
[0017] Furthermore, S321, for each word in the current document, determine the set of entity types that it may correspond to based on the nursing dictionary, and aggregate the graph embeddings of all entity types in the set through an attention mechanism to obtain the global context vector of the word; S322. Concatenate the global context vector of the lexical unit and the enhanced lexical unit representation to form the final lexical unit representation.
[0018] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. This invention constructs a dynamic dictionary for the nursing field and introduces a fuzzy matching function that integrates edit distance similarity and semantic similarity. This function can intelligently map spelling errors, term variations, etc. in the original text to standard words, thereby achieving deep standardization and cleaning of nursing texts and effectively solving the problem of data noise.
[0019] 2. This invention proposes an annotation consistency correction method based on entity co-occurrence graph and annotation correction function. By mining the global co-occurrence relationship between entities in the corpus, it intelligently merges or splits adjacent or overlapping entity segments, thereby automatically optimizing the annotation boundary and significantly improving the annotation quality of the corpus.
[0020] 3. This invention constructs a deep entity recognition model that integrates multi-source knowledge. This model not only injects fuzzy matching features into word representations through a gating mechanism, but also uses a graph attention network to dynamically integrate global semantic information in the entity co-occurrence graph into the encoding of each word, enabling the model to simultaneously possess local context awareness and global knowledge association capabilities.
[0021] 4. This invention employs a loss function guided by prior knowledge. Based on the conventional entity classification loss, it introduces a consistency regularization term based on the annotation correction function, which forces the model's representation in the feature space to be consistent with the semantic relationship of "should be merged or split" in the domain knowledge. This guides the model to learn entity boundaries that are more in line with nursing professional cognition, thereby enhancing the model's generalization ability and robustness. Attached Figure Description
[0022] Appendix Figure 1 This is a flowchart of the present invention; Appendix Figure 2 It is the decision threshold in the analysis and annotation correction function. A diagram illustrating the impact on model performance; Appendix Figure 3 This is a performance comparison chart analyzing the proposed method and three baseline models on the task of entity recognition in nursing text. Appendix Figure 4 It is a kernel density map that shows the distribution pattern of the three core features in the fuzzy matching process. Detailed Implementation
[0023] The present invention will be further illustrated below with reference to specific embodiments. It should be understood that these embodiments are for illustrative purposes only and are not intended to limit the scope of the invention. Furthermore, it should be understood that after reading the teachings of this invention, those skilled in the art can make various alterations or modifications to the invention, and these equivalent forms also fall within the scope defined in this application.
[0024] like Figure 1 As shown, this invention proposes a method for constructing a text annotation corpus in the nursing field for nursing teaching tasks. The main contents are as follows: S1. Collection of Original Nursing Text Data and Construction of Training Dataset A large amount of raw nursing text data was collected as the foundation for constructing the corpus. This raw nursing text data mainly came from the hospital's electronic medical record system, nursing record documents, clinical nursing pathways, nurse handover reports, and relevant nursing research literature. During the collection process, it was necessary to ensure the diversity and representativeness of the data, covering text records from different departments, different disease types, and different nursing stages to reflect real clinical nursing scenarios. At the same time, it was essential to strictly adhere to medical data privacy protection regulations, de-identifying the data, removing sensitive information such as patient names and ID numbers, and retaining only the text content related to nursing care.
[0025] After data collection is completed, a training dataset needs to be constructed for subsequent model training and optimization. To this end, this invention organized a team of nursing experts to develop detailed annotation specifications and manually annotate the original nursing texts. The annotation adopts a BIO-based entity annotation system, where B represents the beginning of an entity, I represents the interior of an entity, and O represents a non-entity.
[0026] The entity categories for labeling are predefined based on the actual needs of the nursing field, and mainly include the following categories: symptoms (such as "fever" and "pain"), signs (such as "body temperature" and "blood pressure"), nursing procedures (such as "turning over" and "sputum suction"), medications (such as "antibiotics" and "analgesics"), nursing assessments (such as "pressure ulcer risk" and "nutritional status"), medical equipment (such as "ventilator" and "monitor"), and nursing diagnoses. Each entity category has a clear definition and labeling rules to ensure consistency and accuracy in labeling.
[0027] During the annotation process, each original text document is independently annotated by at least two annotators, and cross-checked by reviewers. Any inconsistencies in the annotations are discussed to reach a consensus, thus forming a preliminary annotated corpus. This corpus contains the original text sequences and their corresponding BIO tag sequences, which are the original annotated sequences mentioned in subsequent steps.
[0028] Meanwhile, to support fuzzy matching and the construction of entity co-occurrence graphs, the annotation team also compiled a dynamic dictionary for the nursing field. This dictionary includes standard entity words and their common variant forms, such as the standard word for "body temperature" and its variants "body temperature measurement" and "body temperature value". The dictionary content is continuously expanded and improved as the annotation process progresses.
[0029] The collected original nursing texts and corresponding annotation results are divided into training, validation, and test sets for subsequent model training, optimization, and evaluation.
[0030] S2, Nursing Text Data Cleaning and Entity Labeling Standardization The original nursing texts have problems such as inconsistent formatting, ambiguous professional abbreviations, and inconsistent annotations. Conventional cleaning methods only perform simple character replacement or regular expression matching, which cannot handle semantically equivalent variants in the domain. This results in the same entity being segmented into different words, affecting recognition performance.
[0031] This invention achieves text normalization through fuzzy matching based on a nursing dictionary, and uses graph structures to perform consistency correction on entity annotations, outputting aligned text sequences and corrected label sequences, represented as follows: 1) Fuzzy matching and text normalization based on nursing dictionary Nursing text data often contains various writing styles, special symbols, and spelling errors (e.g., body temperature "37.5℃" is misspelled as "37.5C"). By constructing a dynamic dictionary for the nursing domain and introducing a fuzzy matching function based on edit distance and contextual semantics, the variant forms are mapped to standard entity representations, as follows: ; In the formula, This represents a fuzzy matching function that outputs a normalized result (i.e., the result of a normalized matching function). The most matching standard words By combining character-level edit distance similarity and semantic-level word vector similarity, the original text fragments are... Mapping to dictionary The most matching standard word To handle issues such as spelling errors and variations, if the weighted similarity of all candidate words is below a preset threshold... (For example If the word is missing, then the original word is retained. As output; This represents the segment to be normalized in the original nursing text; it is a word or phrase, and is the input string that needs to be mapped. Dictionary A specific standard word in the text is used as a candidate match. This represents a dynamic dictionary for the nursing field, containing standard entity words and their common variant forms. It provides a set of candidate standard words for the matching process. The dictionary content is compiled by nursing experts and can be dynamically expanded based on the corpus. For example, a dynamic dictionary for the nursing field. It contains the standard entity word "body temperature", and its common variations include "body temperature measurement", "body temperature value", "body temperature" (full-width), "body-temperature", etc. The variations of the standard entity word "37.5℃" include "37.5C" and "37.5 degrees Celsius", etc. This represents the balance coefficient, and its range of values is... This is used to adjust the weights of character similarity and semantic similarity in the matching process; an example value is 0.6. This represents a character-level similarity function based on edit distance, used to measure the similarity of strings. and The degree of similarity in character composition is calculated as follows: The similarity range is A larger value indicates greater similarity at the character level; Let the string represent the Levenstein distance function. Length is , string The length is By calculating the Levenstein distance, the representation from Transform to The minimum number of edit operations required, calculated using the Levenstein distance, is determined through dynamic programming. Represents a string Length, For string Length; This represents the cosine similarity function based on pre-trained word vectors, used to measure the similarity between strings. and The degree of proximity in semantic space, this similarity is calculated by... word vectors and The cosine of the angle between the word vectors is obtained, and the range is [value missing]. Positive values are usually taken to indicate semantic similarity, and word vectors are generated by domain pre-trained models (such as ClinicalBERT). In the dictionary Search for the standard word with the largest weighted sum within square brackets. That is, to find the matching The best matching candidate word.
[0032] After segmenting the original text into words, a normalized text sequence is obtained by applying a fuzzy matching function to each word. ,like Matched standard words And the similarity is not lower than the threshold. ,but ;otherwise (Retain original words), each It is a string, therefore It is a list of strings with a length of , Indicates the sequence length, corresponding to the number of tokens after word segmentation. Indicates the first normalized text sequence The text content of each word unit.
[0033] 2) Entity annotation consistency correction Nursing text corpora may suffer from inconsistent annotation boundaries (e.g., "lung infection" is sometimes labeled as a single entity, and sometimes split into "lung" and "infection") and label noise. This invention employs a graph-based annotation correction function, utilizing entity co-occurrence relationships and contextual consistency to optimize the original annotations. Specifically: a) First, extract all entity fragments from the original labeled sequence (based on the BIO labeling system, where consecutive B and I characters constitute an entity), to obtain a list of entity fragments. Each segment Includes entity words and their start and end positions in the text; in, Indicates the first Each entity fragment contains the entity word text and its start and end positions in the text, for example, in the form of triples. ; This represents the collection of all entity fragments extracted from the original annotations of the current document; Indicates the first The last entity fragment; Indicates the index of an entity fragment, with a range of values. ; This indicates the total number of entity fragments in the current document.
[0034] b) Then, construct the entity co-occurrence graph. V is the set of vertices in the graph, C is the set of edge weights in the graph, where nodes are defined. Represent entity words (i.e., the standardized form of entity fragments), and define edge weights. entity words and The number of documents that co-occur in the corpus; c) Then, for any two adjacent or overlapping entity fragments in the current document, define the annotation correction function. ; in, This represents the annotation correction function, used to determine whether two adjacent or overlapping entity fragments are connected. and Whether to merge or split, the output is: This indicates that they should be merged. This indicates that the segments should be split when the intersection-union ratio (IUU) of the two segments is greater than a threshold. At that time, based on the weighted similarity of neighboring entities and the decision threshold... The comparison results determine; This indicates the first candidate entity fragment in the current document, usually the previous fragment, which contains the entity word and its start and end positions in the text; This indicates the second candidate entity fragment in the current document, usually the next fragment, and... Adjacent or overlapping; This represents an entity co-occurrence graph, where nodes are defined as entity words and edge weights are defined as the number of co-occurring documents of the entity word in the corpus, used to reflect the semantic relationships between entities; Represents two entity fragments and The intersection-union ratio (IUGR) of a text sequence, calculated by dividing the length of the overlapping portion of two segments by the length of their union, quantifies their degree of spatial overlap. If two segments do not overlap, then... ; The boundary overlap threshold is a preset constant (e.g.) ), used to determine whether two fragments point to the same text region, when It was determined that there was a labeling conflict between the two and that correction was necessary. This indicates an indicator function that takes the value 1 when the condition within the parentheses is true, and 0 otherwise. It is used to filter out boundary conflict pairs that need to be corrected. In the entity co-occurrence graph In and entity words The set of all connected neighboring entity nodes, here Representing entity words, that is, through entity fragments The entity words are mapped to the graph nodes; Represents edge weight The normalized weights, when calculating neighbor consensus, assign each neighbor a weight proportional to its co-occurrence strength, so that neighbors that co-occur more frequently with the current entity have a greater influence on the decision, representing the neighbor nodes. exist The relative importance in the neighbor set is calculated as follows: ; entity words with neighboring nodes The number of times they co-occur, that is, the number of documents in which they appear together in the corpus; entity words and The similarity between entities measures the tendency of two entities to co-occur in a corpus. It is calculated using cosine similarity based on a co-occurrence graph and is expressed as follows: ; Indicates the index of the first candidate entity fragment; Indicates the index of the second candidate entity fragment; Represents entity co-occurrence graph Zhongyu The index of a connected neighboring entity node; entity words The embedding vectors in the graph can be learned from the entity co-occurrence graph through graph embedding methods (such as Node2Vec) and used to calculate cosine similarity; entity words Embedding vectors in the graph; express L2 norm, express The L2 norm; The decision threshold represents an adjustable parameter (e.g.) ), used to control the tendency to merge or split, when the weighted sum is greater than When the time is right, the tendency is to merge two segments; otherwise, the tendency is to split them. Indicates a symbolic function, returns This indicates that the two labels should be merged. Return. This indicates that it should be split.
[0035] In its implementation, the annotation correction function adjusts inconsistent annotations at the boundaries based on the consensus of neighboring entities. For each pair that satisfies... Adjacent or overlapping entity fragments are merged or split based on the sign of the annotation correction function: if the output Then and Merge them into a single entity fragment (covering the text range of their union) and update the label sequence; if the output If so, keep it as is or split it (the splitting operation needs to be handled according to the overlap situation, such as assigning the overlapping part to one of the entities).
[0036] After processing all conflict pairs, the corrected label sequence is obtained. ,in, Indicates the corrected number of BIO tags of each word element, Indicates the corrected number of BIO tags for each word element.
[0037] In one embodiment, the decision threshold in the analysis annotation correction function is... Impact on model performance, such as Figure 2 As shown, a line chart is used to display the data. The F1 score fluctuates as the value changes. The horizontal axis represents the decision threshold. Dimensionless; the ordinate represents the F1 value, in percentage. Other hyperparameters were kept constant during the experiment; only the following parameters were adjusted. Take values and evaluate each on the validation set. The corresponding F1 value. The line chart shows the change as... As the value increases, the F1 value first rises rapidly, then... It reaches its peak value around 0.6 and then gradually decreases, providing a basis for parameter selection in practical applications.
[0038] S3. Construct an entity recognition model based on a text-annotated corpus in the nursing field. Nursing texts often contain spelling errors, terminology variations, inconsistent entity boundaries, and complex semantic relationships between entities. This invention constructs an entity recognition model for the nursing field. This model takes a normalized text sequence and a corrected label sequence as input, and utilizes fuzzy matching features, entity co-occurrence graphs, and annotation correction functions to construct a deep neural network that integrates local context, global co-occurrence knowledge, and annotation priors. The specific steps are as follows: S31. Context Coding Based on Fuzzy Matching Feature Enhancement Input the normalized text sequence into the pre-trained language model to obtain the initial context representation of each word; Meanwhile, for each lexical unit, three key features are extracted from the fuzzy matching process: edit similarity with the best matching standard word, semantic similarity, and matching confidence. These three features reflect the reliability of the original lexical unit in the normalization process and can be used to dynamically adjust the semantic representation of the lexical unit. To this end, a gated linear fusion unit is constructed to combine the feature vector with the output of the pre-trained language model to obtain the enhanced lexical representation, expressed as: ; In the formula, Indicates the first The enhanced lemma representation is the first... The hidden representation of each word after feature enhancement has a dimension of . Enhanced lexical representations, by fusing the original context and fuzzy matching features through a gating mechanism, can more accurately reflect the semantic information of lexical units. This represents the dimension of the hidden layer, which is a preset hyperparameter, with an example value of 768. This indicates that the pre-trained language model is effective for normalized text sequences. The first output after encoding The original context representation of each word element, with dimensions of In one embodiment, the pre-trained language model may be the ClinicalBERT model, which is a model obtained by pre-training on a large-scale biomedical corpus and is able to capture the contextual semantics of lexical units. This represents the element-wise multiplication operator, also known as the Hadamard product, which is used to multiply gated weights with the original context representation to achieve selective feature enhancement. This represents the Sigmoid activation function, which maps the input to a range. This is used to generate gating weights, which control the degree to which fuzzy matching features adjust the original representation; The weight matrix of the gated linear layer is a trainable parameter with dimension O(n). Used to map 3D feature vectors to In 3D space, gating signals are generated; The bias vector of the gated linear layer is a trainable parameter with dimension O(n). ; Indicates the first The feature vector of the nth word is composed of three fuzzy matching features, with a dimension of 3. The three features are respectively the nth word and the fuzzy matching feature vector. Edit similarity of individual words , No. Semantic similarity of individual words and the Matching confidence of each word This is used to quantify the reliability of the lexical normalization process; This represents the hyperbolic tangent activation function, which maps the input to the interval [0, 1]. This is used to generate feature transformation terms, providing nonlinear enhancements to the hidden representation; The weight matrix of the transformation layer is a trainable parameter with dimension O(n). This matrix linearly transforms the eigenvectors to the same space as the hidden representation; The bias vector of the transform layer is a trainable parameter with dimension O(n). .
[0039] In practical implementation, Indicates the first Edit similarity of individual lexical units, i.e., original lexical units Best matching standard words The character-level edit similarity between them is calculated by a character-level similarity function based on edit distance (i.e., This similarity measure measures the closeness at the string level, with values ranging from [value range missing]. A larger value indicates that the characters are more similar. Indicates the first The semantic similarity of each word element, i.e., the original word elements Best matching standard words The semantic-level cosine similarity between them is calculated by a cosine similarity function based on pre-trained word vectors (i.e., This similarity reflects the degree of proximity in semantic space, and its value ranges from [value range missing]. Positive values are usually used to indicate semantic similarity; Indicates the first The matching confidence score of each word element, i.e., the maximum value of the weighted similarity score in the fuzzy matching process, is determined by... The calculated result reflects the determinism of the matching, and the range of values is [not specified]. If no standard word is matched, the confidence level is 0; where, The best matching criterion is the first one. Each word element is matched by a fuzzy matching function (i.e.) The best matching standard word is obtained; if the match fails, then... .
[0040] S32, Global Context Fusion Based on Entity Co-occurrence Graph In nursing texts, entities exhibit strong correlations; for example, "body temperature" and "fever" often co-occur. Entity co-occurrence graphs contain these global semantic relationships. This invention utilizes a graph attention network to learn an embedding vector rich in global information for each entity node, and then dynamically integrates these embeddings into the lexical representation. The specific steps are as follows: S321. Apply a multi-head graph attention layer to the entity co-occurrence graph to obtain the graph embedding of each entity node. Specifically, for each word in the current document, determine its possible corresponding entity type set based on the nursing dictionary, and aggregate the graph embeddings of all entity types in this set through an attention mechanism to obtain the global context vector of the word, represented as: ; In the formula, Indicates the first The nth global context vector is the nth global context vector. The global context vector corresponding to each word element has a dimension of . It is obtained by graph embedding of the possible entity types of aggregated words, reflecting global co-occurrence information. If a word has no corresponding entity type, the zero vector is taken. Indicates the first The set of entity types that each lexical element may correspond to, according to the nursing dictionary. If a word element matches multiple standard words, then the entity types corresponding to these standard words are taken; if no match can be found, the set is empty. Indicates entity type index; This represents the natural exponential function, used to calculate attention weights; The parameter matrix that maps lexical representations to query vectors is a trainable parameter matrix with dimension 1. It is obtained through training and optimization, and is used to transform the lexical representation to the same space as the graph embedding. Indicates the transpose operation; Indicate entity type The graph embeddings are learned from a graph attention network and have a dimension of [missing information]. Specifically, through aggregated entity types The neighbor information obtained in the entity co-occurrence graph reflects the global co-occurrence relationship.
[0041] In practical implementation, The information is learned from the entity co-occurrence graph using a graph attention network. The specific process is as follows: First, each entity type is treated as a node in the graph. The initial features of the nodes can be randomly initialized or pre-trained word vectors can be used. Then, for each node... Calculate its relationship with all neighboring nodes. Attention coefficient, which is based on node and neighbors The similarity of the feature vectors is obtained (usually calculated through a trainable feedforward network). Then, the attention coefficients are normalized using Softmax, and the features of neighboring nodes are weighted and summed to obtain the node's similarity. The update indicates that, after multiple iterations of such graph attention layers, each node eventually... The representation of It integrates global neighbor information to reflect the co-occurrence semantics between entities.
[0042] S322, will and splicing together to form the first Each final lexical representation That is, the first The final representation of each word element has a dimension of . This representation simultaneously encodes local contextual information (from BERT) and global co-occurrence knowledge (from entity co-occurrence graphs) of lexical units. Local context helps to understand the semantics of lexical units in sentences, while global co-occurrence knowledge introduces corpus-level entity associations (such as "body temperature" often co-occurring with "fever"), thereby enhancing the ability to distinguish between ambiguous entity boundaries and semantic ambiguities, making the representation more robust.
[0043] S33, Boundary-Aware Fragment Decoding and Correction Fusion To identify entity fragments in text, a span-based approach is used to calculate the confidence score (represented by entity score) of all possible continuous fragments as entities. Simultaneously, prior knowledge provided by correction labels and correction functions guides the model to focus on regions judged as merged or split during the annotation and correction process, as follows: ; In the formula, Indicates from position Arrive at the location fragments The entity score is determined by a combination of neural network prediction and corrective prior. A higher value indicates that the segment is more likely to be an entity. This refers to a multilayer perceptron (MLP), which takes the concatenation of three vectors as input and outputs a scalar. It contains several fully connected layers and a non-linear activation function, the parameters of which are obtained through training and optimization. The LPP is used to learn whether a segment is an entity. In one embodiment, the LPP employs a two-layer fully connected network; the first layer uses a linear transformation to reduce the dimensionality to... This is followed by the ReLU activation function, and the second linear transformation outputs a scalar, which is the segment score; The pooling result representing all tokens within a segment is, in one implementation, achieved using average pooling; that is, average pooling is applied to the segment. The final representation of all lexical units is averaged to capture the overall semantics of the segment, with a dimension of [missing value]. Capture the overall semantics of the fragment; This represents an adjustable hyperparameter used to balance the influence of prior correction terms. An example value of 0.5 controls the weight of the corrected prior in the total score. Indicates the current segment With a certain existing labeled fragment The intersection-union ratio (IU), calculated by dividing the length of the overlapping portion of two segments by the length of their union, quantifies the degree of overlap between them in a text sequence. Its value ranges from [value range missing]. ; Indicates from position Arrive at the location The text fragment contains consecutive words; Indicates from the correction label sequence Selected from The entity fragment with the highest degree of overlap includes the entity words and their start and end positions; This represents the annotation correction function, used to determine whether two adjacent or overlapping entity fragments are connected. and Whether to merge or split, the output is: This indicates that they should be merged. This indicates that the score should be split, and it is used as a priori signal to adjust the score according to the indication of the correction function.
[0044] In one implementation, Its function is to specify a candidate entity region for entity score calculation and type prediction. It is an index concept, using the representation of segment boundary words. , And the pooling results of all word representations within the segment. The characteristics that make up the segments can be obtained through Features such as these are used to characterize the segment.
[0045] S34. Entity Type Classification and Graph Embedding Enhancement For fragments identified as entities, their specific type needs to be further predicted. In addition to utilizing the fragment's own representation, this invention also introduces neighbor information from the entity co-occurrence graph to enhance type prediction. Specifically, let the entity text corresponding to the fragment be... If we obtain the set of its neighbor nodes from the entity co-occurrence graph, then the type The prediction probability is defined as: ; In the formula, Indicates a given fragment Its type is The conditional probability, which combines the fragment's own representation and the weighted sum of the neighbor entity graph embeddings, makes type prediction not only dependent on the local fragment content, but also incorporates the semantic information of related entities in the global co-occurrence relationship, thus improving the classification accuracy of rare or ambiguous entities. Neighboring nodes Attention weights, which measure the semantic relevance between the current segment and its neighboring entities, are calculated using the softmax function and have a range of values. This reflects the semantic relevance between the current fragment and its neighboring nodes, making more relevant neighbors contribute more to type prediction. The calculation method is expressed as follows: ; This indicates an entity type label that belongs to a predefined set of types, such as "symptoms", "signs", "medications", etc. Representation type The embedding vector is a trainable parameter with dimension . It is used to calculate the dot product with the fragment representation, and measures whether the fragment belongs to a certain type. The score; entity words In entity co-occurrence graph The neighbor node index in the data; entity words In entity co-occurrence graph The set of all neighboring nodes; Representing neighboring nodes The graph embedding, learned by a graph attention network, has a dimension of [missing information]. The embedding encodes the semantic information of neighboring nodes in the global co-occurrence network, learned from the graph attention network (and...). (The generation method is consistent) express The transpose of .
[0046] S4. Calculate the total loss function based on the main loss and auxiliary loss; The total loss function includes the main loss and the auxiliary loss. The main loss ensures that the model accurately identifies entity boundaries and types, while the auxiliary loss forces the model's representation in the feature space to remain consistent with the semantic relationship given by the correction function. Together, they improve the model's generalization ability and robustness. The specific steps are as follows: 1) Main loss (span-level cross-entropy with correction labels) The model needs to classify all possible segments, but directly calculating the loss of all segments would lead to excessive computation and an imbalance between positive and negative samples. This invention constructs the main loss using positive samples and randomly sampled negative samples. Positive samples are entity fragments labeled in the calibration tags, and negative samples are non-entity fragments, represented as follows: ; In the formula, The main loss consists of the type prediction loss for positive samples and the entity existence loss for negative samples, which guides the model to learn the correct entity boundaries and types. Indicates a given fragment Its type is The conditional probability; Represents the set of positive sample fragments, consisting of the correction label sequence. All entity fragments constitute, Indicates the number of positive samples; Representing fragments The start and end position indices; Represents positive sample fragments The corresponding real entity type, from the correction label sequence Obtained in; This represents a set of negative sample fragments. In one implementation, it is obtained by randomly sampling non-physical regions, ensuring no overlap with positive samples. During sampling, the number of negative samples is balanced with or proportional to the number of positive samples. Indicates the number of negative samples; Representing fragments The probability of an entity is determined by its position. Arrive at the location fragments Entity score It is calculated using the Sigmoid activation function, i.e. ,and, The probability that a fragment is a non-entity is represented by negative sample loss, which encourages the model to output a high value for that probability. This represents a logarithmic function, with the default base being the natural constant.
[0047] 2) Auxiliary loss (consistency regularization based on correction function) The correction function provides semantic indications about whether entity fragments should be merged or split. A consistency regularization term injects this prior knowledge into the model, encouraging it to represent fragments that should be merged as similar and fragments that should be split as far apart in the feature space. For all fragment pairs that satisfy the condition of high positional overlap, the consistency loss is defined as follows: ; In the formula, The consistency loss is used to force the model to make the fragments that the correction function judges to "should be merged" closer to each other (large inner product) and the fragments that "should be split" farther apart (small inner product) in the feature space. This implicitly injects the semantic prior (entity boundary relationship) in the correction function into the model representation, so that the model learns a representation structure consistent with the domain knowledge, thereby improving generalization ability and robustness. Indicates all that satisfy A set of fragment pairs that are highly overlapping in position and may belong to the same entity or adjacent entities; Indicates difference from The start and end position indices; Indicates from position Arrive at the location Text fragments, Conceptual representation fragment and fragments The inner product of two segments measures their cosine similarity (this needs to be calculated before calculating the inner product). (After L2 normalization), the inner product is close to 1, indicating similarity, and close to -1, indicating dissimilarity. This represents the hinge loss function. The loss is zero when the inner product has the same sign as the correction function and is sufficiently large; otherwise, it produces a positive value, ensuring that only fragment pairs that violate the consistency constraint produce a loss. This represents the annotation correction function, used to determine whether two entity fragments are adjacent or overlapping. and Whether to merge or split, the output is: This indicates that they should be merged. This indicates that it should be split; Representing fragments The corresponding entity, Representing fragments The corresponding entity.
[0048] It should be noted that when the correction function indicates that merging should be performed ( The expected inner product is as large as possible, therefore the loss is... When the instruction should be split ( The expected inner product is as small as possible, therefore the loss is... This is equivalent to encouraging inner products to be less than -1, and the model automatically achieves clustering and separation in the representation space consistent with the correction function.
[0049] 3) Calculation of total loss function The total loss function is obtained by weighted summation of the main loss and auxiliary loss. Through joint optimization, the model not only learns to fit the correction labels but also implicitly absorbs semantic knowledge from the correction function, thereby achieving better performance on nursing text entity recognition tasks, as expressed below: ; In the formula, This represents the total loss function, used to jointly optimize the model parameters; This represents the balance coefficient, used to adjust the contribution of auxiliary losses; an example value is 0.1.
[0050] S5. Train the entity recognition model using the cleaned and standardized training dataset. After completing model construction and loss function definition, the model is trained and optimized. This invention uses a cleaned and standardized training dataset to train the entity recognition model. The training dataset contains normalized text sequences and corresponding corrected label sequences. Before training begins, the training data is divided into several batches, each containing multiple text samples and their labels.
[0051] Model training is conducted end-to-end, using the backpropagation algorithm to optimize all trainable parameters, including the parameters of the pre-trained language model, the graph attention network, the multilayer perceptron, and various embedding vectors.
[0052] During training, the normalized text sequence of each batch is first input into the pre-trained language model to obtain the initial context representation; then, the fuzzy matching features are combined to generate the enhanced lexical representation through the gated linear fusion unit; next, the entity co-occurrence graph and multi-head graph attention network are used to generate the global context vector for each lexical, and concatenate it with the enhanced lexical representation to form the final lexical representation; then, the entity score and type probability of all possible segments are calculated based on the span method.
[0053] For each batch, the loss value is calculated based on the total loss function, where the main loss is calculated based on positive and negative sample segments, and the auxiliary loss is calculated based on segment pairs that satisfy the overlap condition. The loss value updates the model parameters through backpropagation. The optimizer uses the AdamW adaptive optimization algorithm and sets appropriate hyperparameters such as learning rate and weight decay.
[0054] Model training requires multiple iterations, each iteration being called a cycle, which involves traversing the entire training set once. After each cycle, the model's performance is evaluated using a validation set, with metrics including entity recognition precision, recall, and F1 score. The model's convergence or overfitting is determined by monitoring changes in the F1 score on the validation set. When the F1 score on the validation set stops improving for several consecutive cycles (e.g., 10 cycles), training is stopped, and the best-performing model parameters on the validation set are saved as the final model.
[0055] In addition, early stopping and learning rate decay strategies can be used. When the performance of the validation set no longer improves, the learning rate is reduced and training continues. If there is still no improvement after reducing the learning rate multiple times, training is stopped.
[0056] After training, a well-trained entity recognition model for the nursing domain is obtained. This model can accurately identify entity boundaries and types in nursing texts, providing an automated annotation tool for subsequent corpus construction.
[0057] In one embodiment, such as Figure 3 As shown, the performance comparison of our proposed method with three baseline models on the nursing text entity recognition task is analyzed, and the precision, recall, and F1 score are presented using grouped bar charts. The baseline models compared in the experiment include: a traditional sequence labeling model based on bidirectional long short-term memory networks and conditional random fields (referred to as the long short-term memory network plus conditional random field model), which does not use a pre-trained language model and relies only on word embeddings and context encoding; a bidirectional encoder representation plus conditional random field model based on a biomedical domain pre-trained language model (referred to as the transformer-based bidirectional encoder representation plus conditional random field model), which uses a clinical domain pre-trained model as the encoder; and an improved model combining graph networks (referred to as the bidirectional encoder representation plus graph network model), which introduces global graph information on top of the pre-trained language model but does not use the fuzzy matching and correction mechanism proposed in this invention. Our method uses the same training, validation, and test set partitioning in all the above comparison techniques, and maintains consistent hyperparameter settings (such as learning rate, batch size, sequence length, etc.) to ensure the fairness of the comparison. The bar chart clearly shows that the precision, recall, and F1 score of this method are all higher than the other three comparison methods. This indicates that the deep neural network proposed in this invention, which integrates fuzzy matching features, entity co-occurrence graph attention, and annotation correction prior, can more accurately capture entity boundaries and semantic information in nursing texts, thereby achieving optimal recognition performance.
[0058] S6. Automatically annotate the original nursing text using an entity recognition model. Once the entity recognition model is trained, it can be used to automatically annotate a larger scale of raw nursing text, thereby building a high-quality nursing domain text annotation corpus.
[0059] First, all raw nursing text data to be labeled is collected. This data may include newly added clinical records and nursing literature that were not previously used in the training. The raw text is then subjected to the cleaning and normalization process described in step S2, namely, text normalization is performed using fuzzy matching based on a nursing dictionary to obtain a normalized text sequence.
[0060] Then, the normalized text sequence is input into the trained entity recognition model. The model outputs the entity type probability of each possible segment after forward propagation, and the final entity boundary and type label are determined by Viterbi decoding or a greedy strategy.
[0061] The automatically labeled results output by the model need to be post-processed by combining the corrected label sequence and the entity co-occurrence graph to ensure the consistency and accuracy of the labeling.
[0062] Specifically, the annotation correction function in step S2 is used to correct boundary conflicts that occur in the automatic annotation, such as merging overlapping entities or splitting unreasonable entities, thereby obtaining a more standardized label sequence. The corrected annotation results, together with the original text and the standardized text, constitute the annotation data of the corpus.
[0063] The final constructed nursing domain text annotation corpus contains multiple documents, each consisting of the original text, a normalized text sequence, and a corresponding BIO tag sequence. The corpus can be stored in common JSON or XML formats for easy sharing and use.
[0064] The corpus not only contains entity annotation information but also includes a dynamic nursing domain dictionary and entity co-occurrence graph to support other related research. This corpus can be used to train and evaluate various nursing text mining models, promoting the informatization and intelligentization of nursing care.
[0065] In one embodiment, such as Figure 4 As shown, a kernel density plot illustrates the distribution of three core features in the fuzzy matching process: edit similarity, semantic similarity, and matching confidence. The horizontal axis represents similarity / confidence (dimensionless), and the vertical axis represents probability density. The plot shows that the peak of edit similarity is concentrated around 0.85, semantic similarity is relatively dispersed, while matching confidence, combining both, exhibits a unimodal right-skewed pattern, with most samples having a confidence level above 0.7. Experimental results demonstrate that fuzzy matching can reliably map original lexical units to standard words, and the three features are complementary, providing rich and differentiated information for the gating fusion unit. This allows the model to dynamically adjust lexical representations based on matching reliability, improving the robustness of entity recognition.
[0066] The above are merely preferred embodiments of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the inventive concept of the present invention, and these modifications and improvements all fall within the protection scope of the present invention.
Claims
1. A method for constructing a text-annotated corpus in the nursing field for nursing teaching tasks, characterized in that, Including the following methods: S1. Collect raw nursing text data, manually annotate the collected data, and construct a training dataset; S2. Based on the nursing dictionary, fuzzy matching is used to achieve text standardization and cleaning, and graph structure is used to perform consistency correction on entity annotations to complete the data standardization process. S3. Construct an entity recognition model for the nursing field. The entity recognition model takes a normalized text sequence and a corrected label sequence as input, and uses fuzzy matching features, entity co-occurrence graphs and annotation correction functions to construct a deep neural network that integrates local context, global co-occurrence knowledge and annotation priors. S4. Construct the total loss function, which includes the main loss to ensure the accuracy of entity boundary and type recognition, and the auxiliary loss to force the model's representation in the feature space to be consistent with the semantic relationship provided by the correction function. S5. Train the entity recognition model using the cleaned and standardized training dataset; S6. Automatically annotate the original nursing text using an entity recognition model.
2. The method for constructing a text-annotated corpus in the nursing field for nursing teaching tasks according to claim 1, characterized in that, The annotation adopts a BIO-based entity annotation system, where B represents the beginning of an entity, I represents the interior of an entity, and O represents a non-entity.
3. The method for constructing a text-annotated corpus in the nursing field for nursing teaching tasks according to claim 1, characterized in that, In S2, text normalization and cleaning are achieved using fuzzy matching based on a nursing dictionary, specifically as follows: A dynamic dictionary for the nursing domain is constructed, and a fuzzy matching function based on edit distance and contextual semantics is introduced to map variant forms to standard entities; After segmenting the original text into words, a normalized text sequence is obtained by applying a fuzzy matching function to each word. If the fuzzy matching function matches the standard word And the similarity is not lower than the threshold. ,but ;otherwise ,in Indicates the first normalized text sequence The text content of each word element This represents the segment in the original nursing text that needs to be standardized. It is a list of strings with a length of , Indicates the sequence length, corresponding to the number of tokens after word segmentation. This represents the text content of the nth term in a normalized text sequence.
4. A method for constructing a text-annotated corpus for nursing teaching tasks according to claim 1 or 3, characterized in that, S2 utilizes graph structures to perform consistency correction on entity annotations, completing the data standardization process, specifically: Extract all entity fragments from the original labeled sequence to obtain a list of entity fragments. Each segment It includes entity words and their start and end positions in the text; among them, Indicates the first Each entity fragment contains the entity word text and its start and end positions in the text; Indicates the first A single entity fragment; Indicates the index of an entity fragment, with a range of values. ; This indicates the total number of entity fragments in the current document; Constructing an entity co-occurrence graph V is the set of vertices in the graph, C is the set of edge weights in the graph, where nodes are defined. Represent entity words and define edge weights entity words and The number of documents that co-occur in the corpus; Define a labeling correction function for any two adjacent or overlapping entity fragments in the current document.
5. The method for constructing a text-annotated corpus in the nursing field for nursing teaching tasks according to claim 1, characterized in that, The annotation correction function adjusts inconsistent annotations at boundaries based on the consensus of neighboring entities. For each pair that satisfies... Adjacent or overlapping entity fragments are merged or split based on the sign of the annotation correction function: if the output Then and Merge into a single entity fragment and update the label sequence; if the output... If so, keep it as is or split it; among them Represents two entity fragments and The intersection-union ratio (IoU) on a text sequence is calculated if two segments do not overlap. ; The boundary overlap threshold is a preset constant used to determine whether two segments point to the same text region. It was determined that there was a labeling conflict between the two and that correction was necessary.
6. The method for constructing a text-annotated corpus in the nursing field for nursing teaching tasks according to claim 1, characterized in that, S3 specifically includes the following steps: S31. Contextual encoding based on fuzzy matching feature enhancement: Construct a feature fusion module to weight and fuse the feature vectors extracted based on fuzzy matching with the output vectors of the pre-trained language model to obtain enhanced lexical representations; S32. Global Context Fusion Based on Entity Co-occurrence Graph: Construct an entity co-occurrence graph, use a graph neural network to learn a global embedding vector for each entity node in the graph, and dynamically map and fuse the global embedding vector into the enhanced lexical representation; S33. Boundary-aware segment decoding and correction fusion: A span-based decoding strategy is adopted to calculate the confidence that all possible continuous segments are identified as entities; at the same time, correction labels and correction functions generated based on the annotation correction process are introduced as prior constraints to adjust the model's attention to specific merged or split regions. S34. Entity Type Classification and Graph Embedding Enhancement: For a target fragment identified as an entity, obtain its fragment representation and retrieve the neighbor node information corresponding to the target fragment based on the entity co-occurrence graph; perform feature concatenation or interaction between the fragment representation and the neighbor node information to predict the specific entity type of the target fragment.
7. The method for constructing a text-annotated corpus in the nursing field for nursing teaching tasks according to claim 1, characterized in that, S4 specifically refers to: Construct the main loss function: Construct positive samples based on entity fragments labeled in the correction labels, and construct negative samples based on random sampling of non-entity fragments. Calculate the classification main loss using the positive and negative samples. Constructing a consistency loss function: For all fragment pairs that satisfy the positional overlap condition, the merging or splitting relationship between fragment pairs is determined based on the semantic indication information provided by the correction function; a consistency regularization term is constructed, which minimizes the vector distance of fragment pairs with merging relationship and maximizes the vector distance of fragment pairs with splitting relationship by constraining the distance between the fragment pairs in the feature space, thereby calculating the consistency loss function; Constructing the total loss function: The main loss function and the consistency loss function are weighted and summed to obtain the total loss function, and the model parameters are updated using the total loss function.
8. The method for constructing a text-annotated corpus in the nursing field for nursing teaching tasks according to claim 6, characterized in that, S5 uses an end-to-end approach to train the model, optimizing all trainable parameters through backpropagation, specifically: Data loading and batch processing: The cleaned and standardized training dataset is divided into a training set and a validation set, and the training set is further divided into several training batches, wherein the training dataset contains normalized text sequences and their corresponding correction label sequences; Each batch of normalized text sequences is input into the entity recognition model. Initial context representations are obtained sequentially through a pre-trained language model. Enhanced lexical representations are obtained by fusing fuzzy matching features through a gated linear fusion unit. Finally, the final lexical representations are obtained by fusing global context information through a graph attention network. Entity scores and type probabilities for all possible segments are calculated based on a span-based decoding strategy. Parameter back-propagation update: Calculate the loss value of the current batch based on the total loss function, and update all trainable parameters in the entity recognition model based on the backpropagation algorithm. The trainable parameters include pre-trained language model parameters, graph attention network parameters, multilayer perceptron parameters, and embedding vectors. Model validation and convergence assessment: After each training cycle, the performance of the current model is evaluated using the validation set to obtain the precision, recall, and F1 score for entity recognition. If the F1 score on the validation set does not improve within a preset number of consecutive periods, an early stopping mechanism is triggered, and the model parameters corresponding to the highest F1 score on the validation set are saved as the final training result.
9. A method for constructing a text-annotated corpus for nursing teaching tasks according to claim 6, characterized in that, The feature vector includes: edit similarity, semantic similarity, and match confidence with the best matching standard word.
10. A method for constructing a text-annotated corpus for nursing teaching tasks according to claim 6, characterized in that, S32 specifically refers to: S321. For each word in the current document, determine the set of entity types that it may correspond to based on the nursing dictionary, and aggregate the graph embeddings of all entity types in the set through an attention mechanism to obtain the global context vector of the word. S322. Concatenate the global context vector of the lexical unit and the enhanced lexical unit representation to form the final lexical unit representation.