A health examination text management method based on deep neural network

Text information extraction and terminology standardization of health examination reports are carried out through deep neural networks and BERT+CRF models, which solves the complexity and accuracy problems in processing text in physical examination reports in the existing technology, and achieves efficient text management and terminology standardization.

CN118171653BActive Publication Date: 2024-10-01广州中康数字科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410091333.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-22
Publication Date
2024-10-01
Estimated Expiration
2044-01-22

AI Technical Summary

Technical Problem

When processing the Chinese text of health examination reports, the existing technology has problems such as writing rules and templates that are time-consuming and costly, difficult to cover diverse situations, and low in accuracy and efficiency.

Method used

Methods based on deep neural networks are used, including the BERT+CRF model for text information extraction and physical examination terminology standardization, entity and relationship extraction through active deep neural networks, and ES and Milvus combined for term search and standardization.

Benefits of technology

It reduces labor costs, improves the ability to process diverse physical examination reports, simplifies the maintenance and update of data and knowledge, and improves the accuracy and efficiency of text management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118171653B_ABST
    Figure CN118171653B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for managing health examination texts based on deep neural networks. The deep neural network model can help experts get rid of the cumbersome rule arrangement and greatly reduce labor costs. Secondly, the deep neural network model has strong expression and generalization capabilities and can handle a variety of physical examination report texts, especially image text information extraction. In addition, based on the "suggested summary" text in a large-scale training report as training corpus to learn the features and semantics therein, the maintenance and update of data and knowledge are more convenient and simple.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a health examination text management method based on a deep neural network. Background Art

[0002] With the improvement of health awareness, people pay more and more attention to health examinations and conduct comprehensive physical examinations regularly to understand their health status. Health examination reports are important documents provided by physical examination institutions to individuals, which contain detailed examination results, suggestions and diagnostic information. However, due to various differences in the generation of physical examination reports, such as individual differences among doctors, the format and content standardization of reports, etc., there are certain problems and irregularities in the text information in physical examination reports, which need to be managed.

[0003] The current method of processing text in health examination reports is mainly based on rules and specifications, such as extracting, classifying and summarizing text by writing specific rules and templates. However, there are some problems with this method. First, writing rules and templates requires professional medical knowledge and the participation of domain experts, which is time-consuming and costly. Secondly, due to the diversity of the form and content of text in physical examination reports, traditional rules and templates are difficult to cover all situations, resulting in unsatisfactory processing results. In addition, the process of manually writing rules and templates is prone to errors and omissions, which affects the accuracy and efficiency of text governance. Summary of the invention

[0004] In view of the shortcomings of the prior art, the present invention aims to provide a health examination text management method based on deep neural network.

[0005] In order to achieve the above object, the present invention adopts the following technical solution:

[0006] A method for managing health examination texts based on deep neural networks, including text information extraction and standardization of health examination terms;

[0007] 1. Text information extraction based on active deep neural network:

[0008] 1.1. Use BERT+CRF model for entity extraction:

[0009] 1.1.1. Clean the data: Use the brat format to represent text data and remove extra spaces. Then divide the dataset into training set, validation set, and test set in a ratio of 7:2:1. For each entity type, use the BIOS tagging scheme to construct 4 label forms and save them in JSON format.

[0010] 1.1.2. Input the cleaned text data in step 1.1.1 into the BERT model; the BERT model includes an input layer, an embedding layer, an encoding layer, a CRF layer, and an output layer. The encoding layer consists of 12 encoder blocks with exactly the same structure. Each encoder includes three components: a multi-head attention mechanism, a residual connection, and a feedforward neural network. The multi-head attention mechanism of each encoder consists of 12 self-attention mechanisms. The basic parameters of the BERT model are as follows: learning rate lr = 2e -5 , the number of multi-head attention mechanism heads h = 12, the number of encoding blocks k = 12, and the dropout rate = 0.4; the BERT model processes the data according to the following process:

[0011] 1) Convert text data into vector representation: Perform Token Embeddings, Segment Embeddings and Position Embeddings processing on text data respectively, and represent them as vectors X respectively. token , X segment , X position ;

[0012] 2) The three vectors X obtained in step 1) token , X segment , X position Add and normalize:

[0013] Note X token , X segment , X position The added vector is X embedding :

[0014] X embedding =X token +X segment +X position

[0015] For X embedding , each element x is normalized by layer:

[0016]

[0017] Among them, x norm is the element value after normalization, x is the element value before normalization, and E(x) represents X embedding The mean of all elements x in Var(x) represents X embedding The variance of all elements x in ; ε is 10 -5 , γ is 1, β is 0;

[0018] 3) According to the set drop rate p, randomly normalize the elements of the vector X′embedding Replace the values ​​in the middle with 0 and enlarge the remaining values ​​to

[0019] 4) Repeat the following steps 4.1)-4.4) k times to obtain the final output result X of the encoding layer bert :

[0020] 4.1) Calculate the score of each self-attention mechanism in each encoder’s multi-head attention mechanism as follows:

[0021] Q∈R n×d ,K∈R m×d ,V∈R m×d

[0022] Among them, Q represents the query matrix, K represents the key matrix, and V represents the value matrix; n represents the dimension of the query, that is, how many groups of queries there are; m represents the number of key-value pairs; d represents the dimension of the input vector;

[0023] The softmax activation function is used to normalize the self-attention mechanism:

[0024] b=softmax(a(Q,K))V

[0025] 4.2) Connect multiple self-attention pools end to end and perform linear transformation:

[0026] X multi-head =g(concat(b m )),m≤h

[0027] Among them, m represents the id of self-attention pooling;

[0028] 4.3) Connect X′ through residual connection embedding With X multi-head Combine and normalize the results:

[0029] X hidden =LayerNorm(X′ embedding +X multi-head )

[0030] 4.4) Through a two-layer feedforward neural network, X hidden Processing, followed by residual connection and normalization:

[0031] X′ hidden =LayerNorm(ReLU(X hidden *W 1 *W 2 )+X hidden )

[0032] Where W 1 , W 2 Represent the weight matrices of the first and second layers of the feedforward neural network respectively;

[0033] 5) After repeating steps 4.1)-4.4) k times, the encoding layer finally outputs the result X bert ; Let y = X bert , the real input of the CRF layer is y, Represents a combination of any sequence; Y x represents all label combinations; the loss function of the CRF layer can be expressed as:

[0034]

[0035] Calculate one by one The score of each sequence in is found, and the sequence combination that can maximize the loss function is the prediction result; the calculation formula for the score of each sequence is as follows:

[0036]

[0037] Among them, X is the original text sequence, n is the total length of the sequence, Indicates mapping to label y at time t t The probability of Indicates that from label y t Move to label y t+1 The probability of

[0038] 1.2, Relationship Extraction:

[0039] R-BERT is used as the model architecture for relation extraction. The specific steps are as follows:

[0040] 1.2.1. Mark the positions of the first and last entities in the text data to facilitate the BERT model to capture their position information; insert a special marker "¥" at the beginning and end of the first entity; insert a special marker "#" at the beginning and end of the second entity; at the same time, add "[CLS]" to the beginning of each sentence;

[0041] 1.2.2. Input the text data processed in step 1.2.1 into the BERT model to obtain the final hidden state sequence H;

[0042] 1.2.3 Assumption H i To H j It is the head entity 1 The final hidden state vector, H k To H m It is the tail entity e 2 The final hidden state vector of e1 、e 2 The hidden state vector is averaged, fully connected and activated to obtain the final representation vector H′ 1 , H′ 2 :

[0043]

[0044]

[0045] Among them, W and c are the weight and offset of the fully connected layer respectively;

[0046] 1.2.4. Calculate the final representation vector H′ of the model sentence start [CLS] 0 :

[0047] H′ 0 =W 0 [tanh(H 0 )]+c 0

[0048] Among them, W 0 With c 0 are the weight and bias of the fully connected layer respectively; W 0 It has the same dimension as W in step 1.2.3, that is, W 0 ∈R d×d , W∈R d×d ; d is the number of hidden layers of the BERT model;

[0049] 1.2.5. Connect H′ 0 , H′ 1 , H′ 2 , and then after softmax activation, the probability of belonging to each relationship label is obtained; that is:

[0050]

[0051] Among them, W′ and c′ are the weight and bias of the fully connected layer respectively;

[0052] 1.3. Active labeling of elements in health checkup reports: Integrate the cold start selection strategy with the active selection strategy to form an active labeling process, as follows:

[0053] 1.3.1、Load health check report data;

[0054] 1.3.2. Check whether there is a trained model; if not, use the cold start selection strategy to select the sample data that needs to be labeled; otherwise, use the active selection strategy to select the sample data that needs to be labeled;

[0055] 1.3.3. Label the sample data selected in step 1.3.2;

[0056] 1.3.4. Use the sample data labeled in step 1.3.3 to train and evaluate the model to evaluate the feasibility of the model; if the model is feasible, update the model and end the process; otherwise, return to step 1.3.2 to reselect samples for labeling;

[0057] 2. Standardization of medical terminology for physical examination based on two stages:

[0058] 2.1. Initialization of medical terminology database for physical examination:

[0059] Select UMLS or LOINC as the initial medical terminology system;

[0060] Then the initialized medical terminology system is translated into terms;

[0061] 2.2 Candidate set indexing and recall:

[0062] 2.2.1. Candidate set indexing and recall based on ES term search engine:

[0063] 2.2.1.1. Organize the terms into a set of five-tuple data tuples, where each tuple data format is (ID, English standard term, English synonym, Chinese standard term, Chinese synonym); ID represents the unique ID of the term;

[0064] 2.2.1.2. Clean the source data of the term base: use ES as the database, create the corresponding data model and fields, filter and process the characters, and finally generate the inverted index;

[0065] 2.2.1.3. Use BM25 to match term text according to the following formula. The BM25 formula is as follows:

[0066]

[0067] Among them, score bm25 (Q, D) represents the similarity score between the query term Q and the term text D, q i represents the element after Q segmentation, n(q i ) represents the number of all term texts including element i, N represents the number of all term texts, f(q i ,D) represents the frequency of element i in D, |D| represents the length of term text, avgdl represents the average length of term text, k 1 ,b represents the hyperparameter, and the default values ​​are 1.2 and 0.75 respectively;

[0068] 2.2.1.4. Calculation of the comprehensive score of Chinese and English terms:

[0069]

[0070] Where DS = {D zh_fsn ,D zh_sim ,D zh_fsn ,D zh_sim}, D zh_fsn ,D zh_sim ,D zh_fsn ,D zh_sim Respectively represent the field text of English standard word, English synonym, Chinese standard word, and Chinese synonym, α i is a hyperparameter, representing the weight of each term, satisfying α i ∈[0,1], and

[0071] 2.2.2. Candidate set indexing and recall based on Milvus semantic search engine:

[0072] 2.2.2.1. Collect and label training data;

[0073] 2.2.2.2, Model structure and model training;

[0074] Regarding the embedding vector model, a hybrid SimCSE model is used to calculate the comparison loss of the two after Bert calculation based on the Bert results of two dropout layers with different parameters;

[0075] During model training, the sample construction is based on a mixed Chinese and English model. In the same batch, the data of the same sample is used as a positive sample, and the data of different sample pairs is used as a negative sample. Therefore, the trained model is recorded as encoder(·);

[0076] 2.2.2.3. Define the loss function: let the batch size be B, vec 1 represents the target sample, vec 2 Represents the positive sample of the target sample, vec i,2 Represents the negative sample of the target sample; τ is a hyperparameter used to control the degree of attention paid by the model to difficult samples; the loss function of training is:

[0077]

[0078] Among them, the similarity is calculated using cosine:

[0079]

[0080] 2.2.2.4. Use the open source software Milvus to save and retrieve vector sets, and use cosine calculation to calculate the similarity of vectors. The specific process is: first encode the text to generate vectors, then calculate the cosine similarity between vectors. For query Q, take any vector from Milvus. i , calculate the query score:

[0081]

[0082] 2.2.3. Merge results:

[0083] Combine the recall results calculated in step 2.2.1 and step 2.2.2, and the Chinese term is denoted as Q zh , English terminology is Q en , then the comprehensive calculation result is:

[0084]

[0085] Among them, κ i is a hyperparameter, representing the weight of each score, satisfying κ i ∈[0,1], and

[0086] 2.3. BERT-based scoring model

[0087] The BERT-based scoring model is mainly divided into two stages: training and prediction. The training model stage mainly collects samples and modularizes the sample data into the format of "[CLS] term 1 [SEP] term [SEP]". During training, [CLS] is mainly used as the output. When the terms are related, the sample is marked as 1, otherwise it is marked as 0.

[0088] The specific process of prediction based on the BERT scoring model is as follows:

[0089] 2.3.1. Calculate η for the prediction term i Score index and sort in descending order by score;

[0090] 2.3.2. Get the top N candidate terms and encapsulate them into the format of “[CLS] term 1 [SEP] term [SEP]” as the input of the model;

[0091] 2.3.3、Get the standard concept with the largest BERT output score and return it;

[0092] 2.3.4. Convert UMLS cui to LOINC CODE to complete the standardization of terminology.

[0093] Furthermore, the specific process of the cold start selection strategy in step 1.3 is: clustering the health check reports involving the target elements using an unsupervised model, and then randomly selecting the most representative data from each cluster as the target sample.

[0094] Furthermore, when the clustering adopts partition clustering, the k-means model is used for sample selection. At this time, the specific process of the cold start selection strategy is:

[0095] (A1) Convert the sample data into vector representation, use one-hot encoding or semantic embedding to represent the health check report, and obtain a health check report vector set v_sentence_set;

[0096] (A2) Set the clustering parameter k_num and assign it to M, input the vector set v_sentence_set into the k-means model for iterative training until the training is completed; the Euclidean distance is used as the measurement indicator during the training process;

[0097]

[0098] Among them, V′, W′ represent the vector of health check report, v i ,w i is the element in the vector;

[0099] (A3) Output k_num cluster centers C i (i=1,2,...,k_num), then calculate C i As the center, all samples are to the center C i The distance between the center and the sample closest to the center is selected as the target sample;

[0100] (A4) Manually annotate the selected M samples.

[0101] Furthermore, the specific process of the active selection strategy in step 1.3 is:

[0102] (B1) Loading unlabeled health check report data and the trained model;

[0103] (B2) Make predictions on unlabeled health check report data and add pseudo labels to the data;

[0104] (B3) For each health check report sample, a scoring strategy is set. Specifically, the lowest confidence strategy is selected based on the idea of ​​confidence. The corresponding formula is as follows:

[0105]

[0106] where y i1,y i2 ,...,y in For sample s i The distribution of annotations for each word;

[0107] (B4) for LC(y i ) are sorted in descending order and the first M samples are selected.

[0108] 5. The method according to claim 1, further comprising the steps of:

[0109] 2.4. Terminology standardization of summary text based on Bert model multi-label classification:

[0110] 2.4.1. Determine the scope of diseases in the physical examination summary;

[0111] 2.4.2. Determine the labeling system: Based on the distribution of diseases in the physical examination summary, select ICD-10 and determine the labeling distribution system for diseases in the physical examination summary;

[0112] 2.4.3. Iterative labeling based on active learning:

[0113] Active learning is divided into two stages. The first stage is the cold start stage, which mainly uses the text clustering algorithm for clustering. The number of clusters is the same as the number of samples to be sampled. The second stage is when there is a multi-label classification model, the appropriate sample sampling is calculated based on the existing classification and entropy indicators, which can be formally defined as a six-tuple, that is, (model P multi_θ , sampling strategy Q multi , expert labeled sample S multi , training sample set L multi , unlabeled sample pool U multi ); Assume that the number of samples per round is N sample , the specific process is as follows:

[0114] 2.4.3.1. Initialize the unlabeled sample pool U with all sample data multi , the training sample set L multi Leave blank;

[0115] 2.4.3.2、Get U multi In the data, and preprocess the data, record x multi ;

[0116] 2.4.3.3. Determine the multi-label classification model P multi_θ Does it exist? If so, jump to step 2.4.3.4; otherwise, jump to step 2.4.3.7.

[0117] 2.4.3.4. Loading the multi-label classification model P multi_θ ;

[0118] 2.4.3.5, take x multi , using P multi_θ Predict the data, sampling strategy Q multi The definition is as follows:

[0119]

[0120] in, Represents the most likely i-th category predicted by the model;

[0121] 2.4.3.6. Traverse the samples and calculate the corresponding Value, which constitutes a policy classification list list multi And sort in descending order, take the first N sample The samples are added to the expert annotation sample set, which is specifically defined as:

[0122]

[0123] Complete S multi For sample sampling, go to step 2.4.3.9;

[0124] 2.4.3.7、U multi Perform k-mean clustering, and set the parameter k to N sample , the model that has completed the training is recorded as M k-mean ;

[0125] 2.4.3.8. Get M k-mean The center point of each type of data is calculated, and the data x closest to the center point is calculated. j And put x j Add to the expert labeled sample S multi In collection; skip to step 2.4.3.9;

[0126] 2.4.3.9 Experts on S multi The data is labeled and the labeled data is updated to the training sample set L multi Then update the multi-label classification model P multi_θ ; Return to step 2.4.3.2;

[0127] 2.4.4. Undersample the labels with a large number of samples to reduce their number, and perform data enhancement on the labels with a small number of samples to increase their number:

[0128] 2.4.4.1. Undersampling

[0129] First, under-sample the label types with sample size n>3000, and the sampling rules are as follows:

[0130] 1) Traverse the original data set;

[0131] 2) For a piece of text data, if it contains only one label and the number of times the label appears in the entire data set is greater than 3000, it is extracted according to the given probability p; for a piece of text data, if it contains multiple labels and the sample size of each label is greater than 500, the probability with the lowest extraction probability among all labels in the current text is selected as the extraction probability; the extracted text data is retained, and the unextracted text data is directly discarded; for a piece of text data, if it contains multiple labels and the sample size of any label is less than 500, the text data is directly retained;

[0132] 3) Summarize and save data;

[0133] 2.4.4.2 Data Augmentation

[0134] 1) Label merging: For labels with sample size ≤ 8, the labels and corresponding texts are randomly merged with the labels and texts of other samples;

[0135] 2) Data generation: For labels with sample size greater than 8 but less than 30, the original text is rewritten into a new sentence based on the LLM generation model without changing the semantics; for the generated text, the similarity between the original text and the generated text is compared, the text with a similarity greater than the threshold t is retained, and the label of the original text is assigned to the generated text.

[0136] Furthermore, the training process of the multi-label classification model is as follows:

[0137] C1. Training text processing

[0138] Assume that y_i represents the classification label of the sample, take ICD-10 as the annotation, and clean the summary text sample;

[0139] C2. Determine the model structure and loss function

[0140] C2.1. The model structure includes an input layer, a hidden layer and an output layer:

[0141] a. Input layer:

[0142] After the sample is preprocessed, a [CLS] symbol is inserted before the text, and the output vector corresponding to the symbol is used as the semantic representation of the entire text. The text is segmented by the word segmenter, and finally the position vector, text vector and word vector are generated as the input of the Bert model.

[0143] b. Hidden layer:

[0144] The hidden layer is constructed based on transfer. In the Transformer model, the input sequence passes through multiple encoder layers and decoder layers in sequence. Each encoder and decoder layer contains a multi-head attention mechanism and a feedforward neural network. The multi-head self-attention mechanism can learn different feature representations in different semantic spaces by applying the self-attention mechanism to different projection spaces.

[0145] c. Output layer

[0146] After [CLS] output, set the output activation function to sigmoid;

[0147] C2.2. Take the loss function as the binary cross loss function, which is specifically defined as:

[0148]

[0149] C3. Determine model evaluation indicators

[0150] First, evaluate the classification effect of the multi-label classification model on a single category label, and then calculate the final result based on the classification effect on all category labels:

[0151] First define the F1 score:

[0152]

[0153] Among them, p represents the precision and r represents the recall;

[0154] Get the F1 score for each category and then find the average:

[0155]

[0156] Where n represents the total number of classes;

[0157] micro-F1:

[0158]

[0159] Among them, F Micro Indicates micro-F1, p sum It represents the sum of the precision of n categories; r sum It represents the sum of recall rates of all categories.

[0160] Furthermore, in step 2.4.3.2, preprocessing includes: removing noise data from the data, removing redundant spaces in the text, removing special characters in the text, unifying the case of the data, deleting missing data, using undersampling or oversampling to handle unbalanced data, and randomly dividing the training set and the test set.

[0161] The beneficial effects of the present invention are as follows: In the present invention, the deep neural network model can help experts free themselves from the tedious rule arrangement and greatly reduce labor costs; secondly, the deep neural network model has strong expression and generalization capabilities and can handle a variety of physical examination report texts, especially image text information extraction. In addition, based on the "suggested summary" text in a large-scale training report as training corpus to learn the features and semantics therein, the maintenance and update of data and knowledge are more convenient and simple. BRIEF DESCRIPTION OF THE DRAWINGS

[0162] Figure 1 The figure is a schematic diagram of a method flow of an embodiment of the present invention.

[0163] Figure 2 A schematic diagram of the process of the active labeling strategy in an embodiment of the present invention;

[0164] Figure 3 Schematic diagram of the architecture of the entity extraction model in an embodiment of the present invention. DETAILED DESCRIPTION

[0165] The present invention will be further described below in conjunction with the accompanying drawings. It should be noted that this embodiment is based on the technical solution and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to this embodiment.

[0166] This embodiment provides a method for managing health examination text based on deep neural network. Figure 1 As shown, it is used to uniformly and standardize the health examination report data of various physical examination institutions, mainly including two parts: text information extraction and physical examination terminology standardization.

[0167] Text information extraction is used to structure text, including entity extraction and relationship extraction. This embodiment method takes thyroid nodule image information extraction as an example to illustrate, and in order to optimize data annotation, proposes the application of active deep neural network in text information extraction.

[0168] Physical examination terminology standardization is used to standardize the terms in health examination reports or extracted from text information, and map them to public standard terminology libraries (such as UMLS, ICD and other public medical libraries) accordingly.

[0169] 1. Text information extraction based on active deep neural network:

[0170] Text information extraction based on deep neural networks essentially processes the descriptions and conclusions of health examination reports as sequences.

[0171] Taking the imaging examination report as an example, descriptions such as "The thyroid gland is clearly displayed, with the anterior-posterior diameter of the right lobe about 1.8 cm and the anterior-posterior diameter of the left lobe about 1.7 cm. A quasi-circular anechoic area with a diameter of about 0.17 cm is seen in the lower part of the left lobe of the thyroid gland. The boundary is clear, the echo is enhanced in the back, and there are dot-like strong echoes inside, accompanied by a comet tail sign. (TI-RADS classification: Level 2) A low echo is seen in each of the bilateral submandibular areas I, with a size of about 2.7 cm × 0.9 cm on the left and about 1.7 cm × 0.6 cm on the right. The boundary is clear, the internal echo is uniform, and the blood flow signal is gate-shaped" always contains common element information, such as "anechoic" (ultrasound characteristics of nodules), "strong echoes" (ultrasound characteristics of nodules), "TI-RADS" (classification name), "Level 2" (classification), "low echoes" (ultrasound characteristics of nodules), "2.7cm × 0.9cm" (nodule diameter), "1.7cm × 0.6cm" (nodule diameter), "uniform echoes" (nodule type), etc. Since the description of the same imaging report may mention multiple thyroid nodules, additional relationship attributes are needed to record the subordinate relationship between the nodules and other attributes, such as "2.7cm×0.9cm-echo uniform" (diameter-nodule type), "2.7cm×0.9cm-hypoechoic" (diameter-ultrasound characteristics) in the example sentence. The definitions of thyroid-related entities and relationships in imaging reports are shown in Table 1.

[0172] Table 1

[0173]

[0174] 1.1 Entity Extraction

[0175] Entity extraction of elements in health check reports usually involves contextual relevance and constraints. For example, "nodule diameter" usually follows the nodule ultrasound characteristics and nodule type, and does not appear alone. Common sequence extraction models, such as RNN, LSTM, and BERT, perform well at various positions in entity extraction, but usually do not take into account the constraint relationship between the previous and next entity types. To solve this problem, the method in this embodiment adopts the BERT+CRF technical route for entity extraction.

[0176] 1.1.1. Clean the data: Use the brat format to represent text data and remove extra spaces. Then divide the dataset into training set, validation set, and test set in a ratio of 7:2:1. For each entity type, use the BIOS tagging scheme to construct 4 label forms and save them in JSON format.

[0177] 1.1.2. Input the cleaned text data in step 1.1.1 into the BERT model. The structure of the BERT model in this embodiment is as follows: Figure 3As shown in the figure, it includes input layer, embedding layer, encoding layer, CRF layer and output layer. The encoding layer is composed of 12 encoder blocks with exactly the same structure. Each encoder includes three components: multi-head attention mechanism, residual connection and feedforward neural network; the multi-head attention mechanism of each encoder is composed of 12 self-attention mechanisms. The basic parameters of the BERT model are as follows: learning rate lr = 2e -5 , the number of multi-head attention mechanism heads h = 12, the number of encoding blocks k = 12, and the dropout rate = 0.4. The following is the specific process of BERT model processing data:

[0178] 1) Convert text data into vector representation: Perform Token Embeddings, Segment Embeddings and Position Embeddings processing on text data respectively, and represent them as vectors X respectively. token , X segment , X position ;

[0179] 2) The three vectors X obtained in step 1) token , X segment , X position Add and normalize:

[0180] Note X token , X segment , X position The added vector is X embedding :

[0181] X embedding =X token +X segment +X position

[0182] For X embedding , each element x is normalized by layer:

[0183]

[0184] Among them, x norm is the element value after normalization, x is the element value before normalization, and E(x) represents X embedding The mean of all elements x in Var(x) represents X embedding The variance of all elements x in . ε is 10 -5 , γ is 1, and β is 0.

[0185] 3) According to the set drop rate p, randomly normalize the elements of the vector X′ embedding Replace the values ​​in the middle with 0 and enlarge the remaining values ​​to

[0186] 4) Repeat the following steps 4.1)-4.4) k times to obtain the final output result X of the encoding layer bert :

[0187] 4.1) Calculate the score of each self-attention mechanism in each encoder’s multi-head attention mechanism as follows:

[0188] Q∈R n×d ,K∈R m×d ,V∈R m×d

[0189] Among them, Q represents the query matrix, K represents the key matrix, and V represents the value matrix. n represents the dimension of the query, that is, how many groups of queries there are; m represents the number of key-value pairs; and d represents the dimension of the input vector.

[0190] The method of this embodiment uses the softmax activation function to normalize the self-attention mechanism:

[0191] b=softmax(a(Q,K))V

[0192] 4.2) Connect multiple self-attention pools end to end and perform linear transformation:

[0193] X multi-head =g(concat(b m )),m≤h

[0194] Among them, m represents the id of self-attention pooling.

[0195] 4.3) Connect X′ through residual connection embedding With X multi-head Combine and normalize the results:

[0196] X hidden =LayerNorm(X′ embedding +X multi-head )

[0197] 4.4) Through a two-layer feedforward neural network, X hidden Processing, followed by residual connection and normalization:

[0198] X′ hidden =LayerNorm(ReLU(X hidden *W 1 *W 2 )+X hidden )

[0199] Where W 1 , W2 Represent the weight matrices of the first and second layers of the feedforward neural network respectively.

[0200] 5) After repeating steps 4.1)-4.4) k times, the encoding layer finally outputs the result X bert ; Let y = X bert , the real input of the CRF layer is y, Represents a combination of any sequence. x represents all label combinations. The loss function of the CRF layer can be expressed as:

[0201]

[0202] Calculate one by one The score of each sequence in is calculated, and the sequence combination that can maximize the loss function is found as the prediction result. The calculation formula for the score of each sequence is as follows:

[0203]

[0204] Among them, X is the original text sequence, n is the total length of the sequence, Indicates mapping to label y at time t t The probability of Indicates that from label y t Move to label y t+1 probability.

[0205] 1.2 Relationship Extraction

[0206] The purpose of relationship extraction in health checkup reports is to mark the subordinate relationships of multiple related elements in the same health checkup report, such as marking which nodule diameter belongs to which type of nodule. Taking thyroid nodules as an example, two types of relationships can be defined: diameter-nodule type and diameter-ultrasound characteristics, both of which start from the entity node "nodule diameter" and point to the corresponding entity node.

[0207] The method of this embodiment uses R-BERT as the model architecture for relation extraction. R-BERT uses the BERT model as a pre-trained model, and obtains the relationship representation between entities by linking the final implicit state vector of [CLS] and the final implicit state vectors of the head and tail target entities and classifying them. The BERT model parameters for relation extraction are the same as the BERT model parameters for entity extraction in step 1.1. The specific steps are as follows:

[0208] 1.2.1. Mark the positions of the first and last entities in the text data to facilitate the BERT model to capture their position information. Insert a special marker "¥" at the beginning and end of the first entity; insert a special marker "#" at the beginning and end of the second entity. At the same time, add "[CLS]" to the beginning of each sentence.

[0209] 1.2.2. Input the text data processed in step 1.2.1 into the BERT model to obtain the final hidden state sequence H.

[0210] 1.2.3 Assumption H i To H j It is the head entity 1 The final hidden state vector, H k To H m It is the tail entity e 2 The final hidden state vector of e 1 、e 2 The hidden state vector is averaged, fully connected and activated to obtain the final representation vector H′ 1 , H′ 2 :

[0211]

[0212]

[0213] Among them, W and c are the weight and bias of the fully connected layer respectively.

[0214] 1.2.4. Calculate the final representation vector H′ of the model sentence start [CLS] 0 :

[0215] H′ 0 =W 0 [tanh(H 0 )]+c 0

[0216] Among them, W 0 With c 0 are the weight and bias of the fully connected layer respectively. 0 It has the same dimension as W in step 1.2.3, that is, W 0 ∈R d×d , W∈R d×d . d is the number of hidden layers of the BERT model.

[0217] 1.2.5. Connect H′ 0 , H′ 1 , H′ 2 , and then through softmax activation, we get the probability of belonging to each relationship label. That is:

[0218]

[0219] Among them, W′ and c′ are the weight and bias of the fully connected layer respectively.

[0220] 1.3. Active labeling of elements in health examination reports:

[0221] The method of this embodiment introduces a deep neural network to extract the elements of the health check report. The traditional data annotation process usually randomly selects a part of the data for annotation and training. However, although this method is convenient and fast, it lacks analysis of data characteristics and may lead to a large amount of repeated sample data. To solve this problem, the method of this embodiment introduces an active annotation strategy to annotate the data of the health check report.

[0222] In the active annotation strategy, such as Figure 2 As shown, the method of this embodiment adopts a cold start selection strategy and a model-based active selection strategy.

[0223] A. The cold start selection strategy mainly uses unsupervised models to cluster the health check reports involving target elements, such as partition clustering, hierarchical clustering, and density clustering. Then, the most representative data is randomly selected from each cluster as the target sample. Assuming that the total amount of data is N and there is no labeled data, M (M<<N) samples are selected from it for labeling.

[0224] Taking partition clustering as an example, the k-means model is used for sample selection. The specific steps are as follows:

[0225] (A1) Convert the sample data into vector representation, use one-hot encoding or semantic embedding (such as BERT) to represent the health check report, and obtain a health check report vector set v_sentence_set;

[0226] (A2) Set the clustering parameter k_num and assign it to M, input the vector set v_sentence_set into the k-means model for iterative training until the training is completed. The Euclidean distance is used as the metric during the training process;

[0227]

[0228] Among them, V′, W′ represent the vector of health check report, v i ,w i The elements in the vector.

[0229] (A3) Output k_num cluster centers C i (i=1,2,...,k_num), then calculate Ci As the center, all samples are to the center C i The sample closest to the center is selected as the target sample.

[0230] (A4) Manually annotate the selected M samples.

[0231] B. The model-based active selection strategy mainly uses the trained model to predict the target elements of the unlabeled health check report, generate the corresponding pseudo-label, and score each pseudo-label. Finally, the score is used to determine whether further labeling is needed and the unlabeled samples that need to be labeled. The specific strategy process is as follows:

[0232] (B1) Loading unlabeled health check report data and the trained model;

[0233] (B2) Make predictions on unlabeled health check report data and add pseudo labels to the data;

[0234] (B3) For each health check report sample, a scoring strategy is set. Specifically, the lowest confidence strategy is selected based on the idea of ​​confidence. The corresponding formula is as follows:

[0235]

[0236] where y i1 ,y i2 ,...,y in For sample s i The distribution of annotations for each word;

[0237] (B4) for LC(y i ) are sorted in descending order and the first M samples are selected.

[0238] The method of this embodiment integrates the cold start selection strategy with the active selection strategy to form an active labeling process, which is as follows:

[0239] 1.3.1、Load health check report data;

[0240] 1.3.2. Check whether there is a trained model. If not, use the cold start selection strategy to select the sample data that needs to be labeled; otherwise, use the active selection strategy to select the sample data that needs to be labeled;

[0241] 1.3.3. Label the sample data selected in step 1.3.2;

[0242] 1.3.4. Use the sample data labeled in step 1.3.3 to train and evaluate the model to evaluate the feasibility of the model. If the model is feasible, update the model and end the process; otherwise, return to step 1.3.2 and reselect samples for labeling.

[0243] 2. Standardization of medical terminology for physical examination based on two stages:

[0244] The method of this embodiment mainly cleans the text data of the health check-up report. After the information extraction based on the active deep neural network, the problem between the entities and their relationships in the complex long text is solved. However, the expression of the text is very flexible, so entity alignment is necessary. In addition, the alignment of the names of the physical examination items is also necessary, that is, the annotation of medical terms. For example, the "red blood cell microscopy (urine)" in the health check-up report belongs to the expression of a hospital physical examination department or a physical examination institution, and needs to be standardized to the standard medical terminology library such as UML, LOINC, ICD10 and other medical terms. The specific steps include initialization of the physical examination medical terminology library, candidate set indexing and recall, and scoring based on the BERT model.

[0245] 2.1. Initialization of medical terminology database for physical examination:

[0246] The main goal of this step is to solve the problem of alignment of Chinese medical terminology for physical examination. The method of this embodiment is based on an open source English terminology library, and collects authoritative Chinese-English translation dictionaries and standards as a bridge to achieve the construction of an initial medical terminology library for physical examination.

[0247] In the initial stage, UMLS or LOINC is selected as the initialized medical terminology system. UMLS is composed of a large number of terminology libraries, each of which has a unique code called cui code. These terminology libraries include SNOMED CTMeta, ICD system version, MeSH, LOINC, ATC, etc.

[0248] Furthermore, the initialized medical terminology system is translated into terms. Terminology translation plays a vital role in the whole process, and its main data sources are as follows:

[0249] Data source 1: Authoritatively published Chinese-English comparison tables, including the Chinese version of the 10th edition of the International Classification of Diseases, the Chinese electronic version of SNOMED 3.4 published by the Hospital Management Institute of the Ministry of Health of China, and the Chinese version of ACT;

[0250] Data source 2: medical dictionaries, including some relatively authoritative dictionaries, such as "Xiangya Medical Dictionary", "English-Chinese Medical Dictionary", "English-Chinese and Chinese-English Bidirectional Medical Dictionary", "English-Chinese and Chinese-English Bidirectional Dictionary of Traditional Chinese Medicine", etc.

[0251] 2.2 Candidate set indexing and recall:

[0252] The method of this embodiment proposes a term alignment model for physical examination medical Chinese terminology retrieval and comparative learning semantic reasoning, and adopts a hybrid recall strategy of the ES term search engine and the Milvus semantic search engine.

[0253] 2.2.1. The ES term search engine is mainly based on the index query method. The specific steps are as follows:

[0254] 2.2.1.1. Organize the terms into a set of five-tuple data tuples, where each tuple data format is (ID, English standard term, English synonym, Chinese standard term, Chinese synonym), also known as a concept. ID represents the unique ID of the term, also known as the concept ID, for example, the cui code is used as the ID, the English standard term represents the English standard expression of the standardized concept, and the Chinese standard term represents the Chinese standard expression of the standardized concept.

[0255] 2.2.1.2. Source term data cleaning. When cleaning the data in the term library, a series of processing will be performed first, such as converting to lowercase, removing special symbols, etc. This embodiment method chooses to use ES (Elasticsearch) as the database, and creates corresponding data models and fields. The characters are filtered and processed by methods such as html_strip and english_stop. Finally, the inverted index is generated.

[0256] 2.2.1.3. Use BM25 to match term text (whether Chinese or English) as follows:

[0257]

[0258] Among them, score bm25 (Q, D) represents the similarity score between the query term Q and the term text D, q i represents the element after Q segmentation, n(q i ) represents the number of all term texts including element i, N represents the number of all term texts, f(q i ,D) represents the frequency of element i in D, |D| represents the length of term text, avgdl represents the average length of term text, k 1 ,b represents the hyperparameter, and the default values ​​are 1.2 and 0.75 respectively;

[0259] 2.2.1.4. Calculation of the comprehensive score of Chinese and English terms:

[0260]

[0261] Where DS = {D zh_fsn,D zh_sim ,D zh_fsn ,D zh_sim}, D zh_fsn ,D zh_sim ,D zh_fsn ,D zh_sim Respectively represent the field text of English standard word, English synonym, Chinese standard word, and Chinese synonym, α i is a hyperparameter, representing the weight of each term, satisfying α i ∈[0,1], and

[0262] 2.2.2 Milvus semantic search engine

[0263] The semantic search engine is mainly based on the SimCSE model of contrastive learning. The terms are embedded and indexed into the Milvus vector database. When a query term is given, it can be recalled by calculating the similarity of the vectors.

[0264] The specific steps are as follows:

[0265] 2.2.2.1. Collect and label training data;

[0266] 2.2.2.2, Model structure and model training;

[0267] Regarding the embedding vector model, the method of this embodiment adopts a hybrid SimCSE model. SimCSE is an optimization of the Bert model. Based on the BERT results of two dropout layers with different parameters, the comparison loss of the two after BERT calculation is calculated.

[0268] When training the model, the sample construction is based on a mixed Chinese and English mode. There are samples such as "<headache, headache>", "<headach, headach>", and there are samples such as "<headache, headache>", "<headache, headach>". For the definition of positive and negative samples, in the same batch, the data of the same sample is used as a positive sample, and the data of different sample pairs is used as a negative sample. Therefore, the trained model is recorded as encoder(·).

[0269] 2.2.2.3. Define the loss function. Let the batch size be B, vec 1 represents the target sample, vec 2 Represents the positive sample of the target sample, vec i,2 Represents the negative sample of the target sample. τ is a hyperparameter used to control the degree of attention paid by the model to difficult samples. The loss function of training is:

[0270]

[0271] Among them, the similarity is calculated using cosine:

[0272]

[0273] 2.2.2.4. Indexing vector sets and retrieval are implemented through vector databases (such as Milvus, Vald, Qdrant, etc.) or vector retrieval components (such as Facebook's FAISS, Microsoft's SPTAG, Spotify's Annoy, etc.). This embodiment method uses the open source software Milvus to save and retrieve vector sets, and uses cosine calculation to calculate the similarity of vectors. The specific process is: first encode the text to generate vectors, then calculate the cosine similarity between vectors, for query Q, take any vector from Milvus i , calculate the query score:

[0274]

[0275] 2.2.3. Merge results:

[0276] Combine the recall results calculated in step 2.2.1 and step 2.2.2, and the Chinese term is denoted as Q zh , English terminology is Q en , then the comprehensive calculation result is:

[0277]

[0278] Among them, κ i is a hyperparameter, representing the weight of each score, satisfying κ i ∈[0,1], and

[0279] 2.3. BERT-based scoring model

[0280] The BERT-based scoring model is mainly divided into two stages: training and prediction. The training model stage mainly collects samples and modularizes the sample data into the format of "[CLS] term 1 [SEP] term [SEP]". During training, [CLS] is mainly used as the output. When the terms are related, the sample is marked as 1, otherwise it is marked as 0.

[0281] The specific steps for prediction based on the BERT scoring model are:

[0282] 2.3.1. Calculate η for the prediction term i Score index and sort in descending order by score;

[0283] 2.3.2. Get the top N candidate terms and encapsulate them into the format of "[CLS]Term 1[SEP]Term[SEP]" as the input of the model, for example, [CLS]Erythrocytes in 3hour Urine sediment by Light microscopy[SEP].

[0284] 2.3.3、Get the standard concept with the largest BERT output score and return it;

[0285] 2.3.4. Convert UMLS cui to LOINC CODE to complete the standardization of terminology.

[0286] 2.4. Terminology standardization of summary text based on Bert model multi-label classification:

[0287] The method of this embodiment is mainly for the management of health examination report text, in which the summary text is also an important part, which reflects the advice and preliminary diagnosis of various specialists on various aspects of health, and the standardization of diseases plays an important role. Therefore, the method of this embodiment proposes to realize the terminology standardization of the summary text based on Bert model multi-label classification.

[0288] The specific steps are as follows:

[0289] 2.4.1. Determine the scope of diseases in the physical examination summary.

[0290] 2.4.2. Determine the labeling system:

[0291] The method of this embodiment selects ICD-10 according to the distribution of diseases in the physical examination summary and determines the label distribution system of the diseases in the physical examination summary to solve the problem of incomplete label data.

[0292] 2.4.3. Perform iterative annotation based on active learning to improve the efficiency of text classification annotation.

[0293] Active learning is divided into two stages. The first stage is the cold start stage, which mainly uses the text clustering algorithm for clustering. The number of clusters is the same as the number of samples to be sampled. The second stage is when there is a multi-label classification model, the appropriate sample sampling is calculated based on the existing classification and entropy indicators, which can be formally defined as a six-tuple, that is, (model P multi_θ , sampling strategy Q multi , expert labeled sample S multi , training sample set L multi , unlabeled sample pool U multi ). Assume that the number of samples per round is N sample , the specific process is as follows:

[0294] 2.4.3.1. Initialize the unlabeled sample pool U with all sample data multi , the training sample set L multi Leave blank;

[0295] 2.4.3.2、Get U multi In the data, and preprocess the data, record x multi ; Data preprocessing includes: removing noise data from the data, removing extra spaces in the text, removing special characters in the text, unifying the case of the data, deleting missing data, using undersampling / oversampling methods to process unbalanced data, and randomly dividing the training set and test set;

[0296] 2.4.3.3. Determine the multi-label classification model P multi_θ Does it exist? If so, jump to step 2.4.3.4; otherwise, jump to step 2.4.3.7.

[0297] 2.4.3.4. Loading the multi-label classification model P multi_θ ;

[0298] 2.4.3.5, take x multi , using P multi_θ Predict the data, sampling strategy Q multi The definition is as follows:

[0299]

[0300] in, Represents the most likely i-th category predicted by the model;

[0301] 2.4.3.6. Traverse the samples and calculate the corresponding Value, which constitutes a policy classification list list multi And sort in descending order, take the first N sample The samples are added to the expert annotation sample set, which is specifically defined as:

[0302]

[0303] Complete S multi For sample sampling, go to step 2.4.3.9;

[0304] 2.4.3.7、U multi Perform k-mean clustering, and set the parameter k to N sample , the model that has completed the training is recorded as M k-mean ;

[0305] 2.4.3.8. Get M k-mean The center point of each type of data is calculated, and the data x closest to the center point is calculated. jAnd put x j Add to the expert labeled sample S multi In collection; skip to step 2.4.3.9;

[0306] 2.4.3.9 Experts on S multi The data is labeled and the labeled data is updated to the training sample set L multi Then update the multi-label classification model P multi_θ ; Return to step 2.4.3.2.

[0307] 2.4.4. To address the serious long-tail problem of data, the method of this embodiment performs data undersampling and enhancement through rules and LLM (such as ChatGPT).

[0308] The preprocessing of long-tail data, in order to make the label distribution in the training data more uniform, is mainly carried out through two ways: 1. Under-sampling the labels with a large number of samples to reduce their number; 2. Data enhancement of the labels with a small number of samples to increase their number.

[0309] 2.4.4.1. Undersampling

[0310] First, under-sample the label types with sample size n>3000, and the sampling rules are as follows:

[0311] 1) Traverse the original data set;

[0312] 2) For a certain piece of text data, if it contains only one label, and the number of times this label appears in the entire data set is greater than 3000, then extraction is performed according to a given probability p. This embodiment sets p=0.2, which is equivalent to retaining an average of 1 record for every 5 such data, and the remaining data is directly discarded; for a certain piece of text data, if it contains multiple labels, and the sample size of each label is greater than 500, then the probability with the lowest extraction probability among all the labels in the current text is selected as the extraction probability. The extracted text data is retained, and the unextracted text data is directly discarded; for a certain piece of text data, if it contains multiple labels, and the sample size of any label is less than 500, then this piece of text data is directly retained;

[0313] 3) Summarize and save the data.

[0314] 2.4.4.2 Data Augmentation

[0315] The purpose of data augmentation is to supplement labels with fewer samples and increase their frequency of occurrence in the data set. There are two main routes for data augmentation: 1) For labels with very few samples in the data set (label sample size ≤ 8), use label merging; 2) For labels with fewer samples in the data set (label sample size < 30), use data generation to increase the data volume.

[0316] 1) Label merging: For labels with sample size ≤ 8, the labels and corresponding texts are randomly merged with the labels and texts of other samples.

[0317] 2) Data generation: For labels with sample size greater than 8 but less than 30, the original text is rewritten into a new sentence based on the LLM generation model without changing the semantics. For the generated text, the similarity between the original text and the generated text is compared, and the text with a similarity greater than the threshold t is retained, and the label of the original text is assigned to the generated text.

[0318] Furthermore, the training process of the multi-label classification model is as follows:

[0319] C1. Training text processing

[0320] Assume that y_i represents the classification label of the sample. In the method of this embodiment, ICD-10 is used as the label. The cleaned summary text sample is shown in Table 2.

[0321] Table 2

[0322] Input Sample y1 y2 y3 y4 ... yn 1. Small nodules in the middle lobe of the right lung, follow-up. 2. Local calcification of the aorta and coronary artery walls. 3. Tiny stones in the right kidney. 0 1 1 0 0 / 1 1 Mild to severe tricuspid regurgitation. Decreased left ventricular diastolic function 1 1 1 0 0 / 1 0 1. A small nodule in the middle lobe of the right lung, follow up. 2. A few fibrous lesions in both lungs. 0 0 0 1 0 / 1 1

[0323] C2. Determine the model structure and loss function

[0324] C2.1. The model structure includes an input layer, a hidden layer and an output layer:

[0325] a. Input layer:

[0326] After the sample is preprocessed, a [CLS] symbol is inserted before the text, and the output vector corresponding to the symbol is used as the semantic representation of the entire text. The text is segmented by the word segmenter, and finally the position vector, text vector and word vector are generated as the input of the Bert model.

[0327] b. Hidden layer:

[0328] The hidden layer is constructed based on transfer. In the Transformer model, the input sequence passes through multiple encoder layers and decoder layers in sequence. Each encoder and decoder layer contains a multi-head attention mechanism and a feedforward neural network. The multi-head self-attention mechanism can learn different feature representations in different semantic spaces by applying the self-attention mechanism to different projection spaces. The method in this embodiment selects a 12-layer Bert model for training.

[0329] c. Output layer

[0330] The multi-labeling problem is a subclass of the classification problem. Similarly, it is also output through [CLS], and the output activation function is set to sigmoid;

[0331] C2.2. Take the loss function as the binary cross loss function, which is specifically defined as:

[0332]

[0333] C3. Determine model evaluation indicators

[0334] The method of this embodiment is based on a multi-label evaluation index of a category. It first evaluates the classification effect of the multi-label classification model on a single category label, and then calculates the final result based on the classification effect on all category labels.

[0335] First define the F1 score:

[0336]

[0337] Among them, p represents the precision and r represents the recall.

[0338] Get the F1 score for each category and then find the average:

[0339]

[0340] Where n represents the total number of classes;

[0341] micro-F1:

[0342]

[0343] Among them, F Micro Indicates micro-F1, p sum It represents the sum of the precision of n categories. sum It represents the sum of the recall rates of all categories.

[0344] For those skilled in the art, various corresponding changes and modifications can be made according to the above technical solutions and concepts, and all of these changes and modifications should be included in the protection scope of the claims of the present invention.

Claims

1. A method for managing health examination text based on deep neural network, characterized by including two parts: text information extraction and health examination term standardization; 1. Text information extraction based on active deep neural network: 1.

1. Use BERT+CRF model for entity extraction: 1.1.

1. Clean the data: Use the brat format to represent text data and remove extra spaces. Then divide the data set into training set, validation set and test set in a ratio of 7:2:

1. For each entity type, use the BIOS tagging scheme to construct 4 label forms and save them in JSON format. 1.1.

2. Input the cleaned text data in step 1.1.1 into the BERT model; the BERT model includes an input layer, an embedding layer, an encoding layer, a CRF layer, and an output layer. The encoding layer consists of 12 encoder blocks with exactly the same structure. Each encoder includes three components: a multi-head attention mechanism, a residual connection, and a feedforward neural network. The multi-head attention mechanism of each encoder consists of 12 self-attention mechanisms. The basic parameters of the BERT model are as follows: learning rate Ir = 2e -5 , the number of multi-head attention mechanism heads h = 12, the number of encoding blocks k = 12, and the dropout rate = 0.4; the BERT model processes the data according to the following process: 1) Convert text data into vector representation: Perform Token Embeddings, Segment Embeddings and Position Embeddings processing on text data respectively, and represent them as vectors X respectively. token , X segment , X position ; 2) The three vectors X obtained in step 1) token , X segment , X position Add and normalize: Note X token , X segment , X position The added vector is X embedding : X embedding =X token +X segment +X position For X embedding , each element x is normalized by layer: in, x norm is the element value after normalization, x is the element value before normalization, and E(x) represents X embedding The mean of all elements x in Var(x) represents X embedding The variance of all elements x in ; ε is 10 -5 , γ is 1, β is 0; 3) According to the set drop rate p, randomly normalize the elements of the vector X′ embedding Replace the values ​​in the middle with 0 and enlarge the remaining values ​​to 4) Repeat the following steps 4.1)-4.4) k times to get the final output result X of the encoding layer bert : 4.1) Calculate the score of each self-attention mechanism in each encoder’s multi-head attention mechanism as follows: Among them, Q represents the query matrix, K represents the key matrix, and V represents the value matrix; n represents the dimension of the query, that is, how many groups of queries there are; m represents the number of key-value pairs; d represents the dimension of the input vector; The softmax activation function is used to normalize the self-attention mechanism: b = softmax(a(Q, K))V 4.2) Connect multiple self-attention pools end to end and perform linear transformation: X multi-head =g(concat(b m )),m≤h Among them, m represents the id of self-attention pooling; 4.3) Connect X′ through residual connection embedding With X multi-head Combine and normalize the results: X hidden =LayerNorm(X′ embedding +X multi-head ) 4.4) Through a two-layer feedforward neural network, X hidden Processing, followed by residual connection and normalization: X′ hidden =NormLayer(ReLU(X hidden *W 1 *W 2 )+X hidden ) Where W 1 , W 2 Represent the weight matrices of the first and second layers of the feedforward neural network respectively; 5) After repeating steps 4.1)-4.4) k times, the encoding layer finally outputs the result X bert ; Let y = X bert , the real input of the CRF layer is y, Represents a combination of any sequence; Y x represents all label combinations; the loss function of the CRF layer can be expressed as: Calculate one by one The score of each sequence in is found, and the sequence combination that can maximize the loss function is the prediction result; the calculation formula for the score of each sequence is as follows: Among them, X is the original text sequence, n is the total length of the sequence, Indicates mapping to label y at time t t The probability of Indicates that from label y t Move to label y t+1 probability; 1.2 Relationship Extraction: R-BERT is used as the model architecture for relation extraction. The specific steps are as follows: 1.2.

1. Mark the positions of the first and last entities in the text data to facilitate the BERT model to capture their position information; insert a special marker "$" at the beginning and end of the first entity; insert a special marker "#" at the beginning and end of the second entity; at the same time, add "[CLS]" to the beginning of each sentence; 1.2.

2. Input the text data processed in step 1.2.1 into the BERT model to obtain the final hidden state sequence H; 1.2.3 Assumption H i To H j It is the head entity 1 The final hidden state vector, H k To H m It is the tail entity e 2 The final hidden state vector of e 1 、e 2 The hidden state vector is averaged, fully connected and activated to obtain the final representation vector H′ 1 , H′ 2 : Among them, W and c are the weight and offset of the fully connected layer respectively; 1.2.

4. Calculate the final representation vector H′ of the model sentence start [CLS] 0 : H′ 0 =W 0 [tanh(H 0 )]+c 0 Among them, W 0 With c 0 are the weight and bias of the fully connected layer respectively; W 0 It has the same dimension as W in step 1.2.3, that is, W 0 ∈R d×d , W∈R d×d ; d is the number of hidden layers of the BERT model; 1.2.

5. Connect H′ 0 , H′ 1 , H′ 2 , and then after softmax activation, the probability of belonging to each relationship label is obtained; that is: Among them, W′ and c′ are the weight and bias of the fully connected layer respectively; 1.

3. Active labeling of elements in health checkup reports: Integrate the cold start selection strategy with the active selection strategy to form an active labeling process, as follows: 1.3.1、Load health check report data; 1.3.

2. Check whether there is a trained model; if not, use the cold start selection strategy to select the sample data that needs to be labeled; otherwise, use the active selection strategy to select the sample data that needs to be labeled; 1.3.

3. Label the sample data selected in step 1.3.2; 1.3.

4. Use the sample data labeled in step 1.3.3 to train and evaluate the model to evaluate the feasibility of the model; if the model is feasible, update the model and end the process; otherwise, return to step 1.3.2 to reselect samples for labeling; 2. Standardization of medical terminology for physical examination based on two stages: 2.

1. Initialization of medical terminology database for physical examination: Select UMLS or LOINC as the initial medical terminology system; Then the initialized medical terminology system is translated into terms; 2.2 Candidate set indexing and recall: 2.2.

1. Candidate set indexing and recall based on ES term search engine: 2.2.1.

1. Organize the terms into a set of five-tuple data tuples, where each tuple data format is (ID, English standard term, English synonym, Chinese standard term, Chinese synonym); ID represents the unique ID of the term; 2.2.1.

2. Clean the source data of the term base: use ES as the database, create the corresponding data model and fields, filter and process the characters, and finally generate the inverted index; 2.2.1.

3. Use BM25 to match term text according to the following formula. The BM25 formula is as follows: Among them, score bm25 (Q, D) represents the similarity score between the query term Q and the term text D, q i represents the element after Q segmentation, n(q i ) represents the number of all term texts including element i, N represents the number of all term texts, f(q i ,D) represents the frequency of element i in D, |D| represents the length of term text, avgdl represents the average length of term text, k 1 ,b represents the hyperparameter, and the default values ​​are 1.2 and 0.75 respectively; 2.2.1.

4. Calculation of the comprehensive score of Chinese and English terms: Where DS = {D zh_fsn ,D zh_sim ,D zh_fsn ,D zh_sim }, D zh_fsn ,D zh_sim ,D zh_fsn ,D zh_sim Respectively represent the field text of English standard word, English synonym, Chinese standard word, and Chinese synonym, α i is a hyperparameter, representing the weight of each term, satisfying α i ∈[0,1], and 2.2.

2. Candidate set indexing and recall based on Milvus semantic search engine: 2.2.2.

1. Collect and label training data; 2.2.2.2, Model structure and model training; Regarding the embedding vector model, a hybrid SimCSE model is used to calculate the comparison loss of the two after Bert calculation based on the Bert results of two dropout layers with different parameters; During model training, the sample construction is based on a mixed Chinese and English model. In the same batch, the data of the same sample is used as a positive sample, and the data of different sample pairs is used as a negative sample. Therefore, the trained model is recorded as encoder(·); 2.2.2.

3. Define the loss function: let the batch size be B, vec 1 represents the target sample, vec 2 Represents the positive sample of the target sample, vec i,2 Represents the negative sample of the target sample; τ is a hyperparameter used to control the degree of attention paid by the model to difficult samples; the loss function of training is: Among them, the similarity is calculated using cosine: 2.2.2.

4. Use the open source software Milvus to save and retrieve vector sets, and use cosine calculation to calculate the similarity of vectors. The specific process is: first encode the text to generate vectors, then calculate the cosine similarity between vectors. For query Q, take any vector from Milvus. i , calculate the query score: 2.2.

3. Merge results: Combine the recall results calculated in step 2.2.1 and step 2.2.2, and the Chinese term is denoted as Q zh , English terminology is Q en , then the comprehensive calculation result is: Among them, κ i is a hyperparameter, representing the weight of each score, satisfying κ i ∈[0,1], and 2.

3. BERT-based scoring model The BERT-based scoring model is mainly divided into two stages: training and prediction. The training model stage mainly collects samples and modularizes the sample data into the format of "[CLS] term 1 [SEP] term [SEP]". During training, [CLS] is mainly used as the output. When the terms are related, the sample is marked as 1, otherwise it is marked as 0. The specific process of prediction based on the BERT scoring model is as follows: 2.3.

1. Calculate η for the prediction term i Score index and sort in descending order by score; 2.3.

2. Get the top N candidate terms and encapsulate them into the format of "[CLS] term 1 [SEP] term [SEP]" as the input of the model; 2.3.3、Get the standard concept with the largest BERT output score and return it; 2.3.

4. Convert UMLS cui to LOINC CODE to complete the standardization of terminology.

2. The method according to claim 1, It is characterized in that The specific process of the cold start selection strategy in step 1.3 is: use an unsupervised model to cluster the health check reports involving the target elements, and then randomly select the most representative data from each cluster as the target sample.

3. The method according to claim 2, It is characterized in that When the clustering adopts partition clustering, the k-means model is used for sample selection. At this time, the specific process of the cold start selection strategy is: (A1) Convert the sample data into vector representation, use one-hot encoding or semantic embedding to represent the health check report, and obtain a health check report vector set v_sentence_set; (A2) Set the clustering parameter k_num and assign it to M, input the vector set v_sentence_set into the k-means model for iterative training until the training is completed; the Euclidean distance is used as the measurement indicator during the training process; Among them, V′, W′ represent the vector of health check report, v i ,w i is the element in the vector; (A3) Output k_num cluster centers C i (i=1,2,...,k_num), then calculate C i As the center, all samples are to the center C i The distance between the center and the sample closest to the center is selected as the target sample; (A4) Manually annotate the selected M samples.

4. The method according to claim 1, It is characterized in that The specific process of the active selection strategy in step 1.3 is: (B1) Loading unlabeled health check report data and the trained model; (B2) Make predictions on unlabeled health check report data and add pseudo labels to the data; (B3) For each health check report sample, a scoring strategy is set. Specifically, the lowest confidence strategy is selected based on the idea of ​​confidence. The corresponding formula is as follows: where y i1 ,y i2 ,...,y in For sample s i The distribution of annotations for each word; (B4) for LC(y i ) are sorted in descending order and the first M samples are selected.

5. The method according to claim 1, It is characterized in that The following steps are also included: 2.

4. Terminology standardization of summary text based on Bert model multi-label classification: 2.4.

1. Determine the scope of diseases in the physical examination summary; 2.4.

2. Determine the labeling system: Based on the distribution of diseases in the physical examination summary, select ICD-10 and determine the labeling distribution system for diseases in the physical examination summary; 2.4.

3. Iterative labeling based on active learning: Active learning is divided into two stages. The first stage is the cold start stage, which mainly uses the text clustering algorithm for clustering. The number of clusters is the same as the number of samples to be sampled. The second stage is when there is a multi-label classification model, the appropriate sample sampling is calculated based on the existing classification and entropy indicators, which can be formally defined as a six-tuple, that is, (model P multi_θ , sampling strategy Q multi , expert labeled sample S multi , training sample set L multi , unlabeled sample pool U multi ); Assume that the number of samples per round is N sample , the specific process is as follows: 2.4.3.

1. Initialize the unlabeled sample pool U with all sample data multi , the training sample set L multi Leave blank; 2.4.3.2、Get U multi In the data, and preprocess the data, record x multi ; 2.4.3.

3. Determine the multi-label classification model P multi_θ Does it exist? If so, jump to step 2.4.3.4; otherwise, jump to step 2.4.3.

7. 2.4.3.

4. Loading the multi-label classification model P multi_θ ; 2.4.3.5, take x multi , using P multi_θ Predict the data, sampling strategy Q multi The definition is as follows: in, Represents the most likely i-th category predicted by the model; 2.4.3.

6. Traverse the samples and calculate the corresponding Value, which constitutes a policy classification list list multi And sort in descending order, take the first N sample The samples are added to the expert annotation sample set, which is specifically defined as: Complete S multi For sample sampling, go to step 2.4.3.9; 2.4.3.7、U multi Perform k-mean clustering, and set the parameter k to N sample , the model that has completed the training is recorded as M k-mean ; 2.4.3.

8. Get M k-mean The center point of each type of data is calculated, and the data x closest to the center point is calculated. j And put x j Add to the expert labeled sample S multi In collection; skip to step 2.4.3.9; 2.4.3.9 Experts on S multi The data is labeled and the labeled data is updated to the training sample set L multi Then update the multi-label classification model P multi_θ ; Return to step 2.4.3.2; 2.4.

4. Undersample the labels with a large number of samples to reduce their number, and perform data enhancement on the labels with a small number of samples to increase their number: 2.4.4.

1. Undersampling First, under-sample the label types with sample size n>3000, and the sampling rules are as follows: 1) Traverse the original data set; 2) For a piece of text data, if it contains only one label and the number of times the label appears in the entire data set is greater than 3000, it is extracted according to the given probability p; for a piece of text data, if it contains multiple labels and the sample size of each label is greater than 500, the probability with the lowest extraction probability among all labels in the current text is selected as the extraction probability; the extracted text data is retained, and the unextracted text data is directly discarded; for a piece of text data, if it contains multiple labels and the sample size of any label is less than 500, the text data is directly retained; 3) Summarize and save data; 2.4.4.2 Data Augmentation 1) Label merging: For labels with sample size ≤ 8, the labels and corresponding texts are randomly merged with the labels and texts of other samples; 2) Data generation: For labels with sample size greater than 8 but less than 30, the original text is rewritten into a new sentence based on the LLM generation model without changing the semantics; for the generated text, the similarity between the original text and the generated text is compared, the text with a similarity greater than the threshold t is retained, and the label of the original text is assigned to the generated text.

6. The method according to claim 5, It is characterized in that The training process of the multi-label classification model is as follows: C1. Training text processing Assume that y_i represents the classification label of the sample, take ICD-10 as the annotation, and clean the summary text sample; C2. Determine the model structure and loss function C2.

1. The model structure includes an input layer, a hidden layer and an output layer: a. Input layer: After the sample is preprocessed, a [CLS] symbol is inserted before the text, and the output vector corresponding to the symbol is used as the semantic representation of the entire text. The text is segmented by the word segmenter, and finally the position vector, text vector and word vector are generated as the input of the Bert model. b. Hidden layer: The hidden layer is constructed based on transfer. In the Transformer model, the input sequence passes through multiple encoder layers and decoder layers in sequence; each encoder and decoder layer contains a multi-head attention mechanism and a feedforward neural network; The multi-head self-attention mechanism can learn different feature representations in different semantic spaces by applying the self-attention mechanism to different projection spaces; c. Output layer After [CLS] output, set the output activation function to sigmoid; C2.

2. Take the loss function as the binary cross loss function, which is specifically defined as: C3. Determine model evaluation indicators First, evaluate the classification effect of the multi-label classification model on a single category label, and then calculate the final result based on the classification effect on all category labels: First define the F1 score: Among them, p represents the precision and r represents the recall; Get the F1 score for each category and then find the average: Where n represents the total number of classes; micro-F1: Among them, F Micro Indicates micro-F1, p sum It represents the sum of the precision of n categories; r sum It represents the sum of recall rates of all categories.

7. The method according to claim 5, It is characterized in that In step 2.4.3.2, preprocessing includes: removing noise data from the data, removing extra spaces in the text, removing special characters in the text, unifying the case of the data, deleting missing data, using undersampling or oversampling to handle unbalanced data, and randomly dividing the training set and test set.