Structured information extraction method based on multi-type medical record texts

By constructing an abnormality detection model and performing high-dimensional vector processing, the problem of insufficient universality and complexity management of structured information extraction in multiple types of medical records is solved, efficient information extraction and text simplification are achieved, and the degree of automation and information quality are improved.

CN119724459APending Publication Date: 2025-03-28SHANDONG LIANSI INFORMATION TECHNOLOGY CO LTD
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
CN202411854807.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

When processing multi-type medical record text, the prior art has poor generality, insufficient complexity management, and low degree of automation, making it difficult to efficiently extract structured information.

Method used

A structured information extraction method based on multi-type medical record text is adopted, and a high-dimensional vector is constructed by collecting and preprocessing the original medical record text data, and anomaly detection model is constructed to evaluate the text complexity, generate complexity status signals, and perform error correction and conversion into simplified text.

Benefits of technology

Effectively identify and process excessively complex medical record text, generate simplified text, improve the efficiency and accuracy of information extraction, reduce the need for manual intervention, reduce costs, and enhance the readability and usability of information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119724459A_ABST
    Figure CN119724459A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of information extraction, discloses a structured information extraction method based on multi-type medical record texts, mainly aims at a preparation stage before structured information extraction, and aims at converting the medical record texts with over-high complexity into simplified texts so as to facilitate subsequent information extraction work. The method comprises the following steps: firstly, preprocessing collected various types of medical record text data to form a high-dimensional vector, then, constructing an anomaly detection model by utilizing a Gaussian mixture model, optimizing the accuracy and robustness of the model, and finally, according to a complexity state signal output by the model, calculating the complexity of the model. The most similar reference text is searched for the medical record text which does not meet the standard through the cosine similarity to generate the simplified text, spelling and grammar verification are carried out to improve the text quality, and therefore the efficiency and accuracy of medical data analysis are comprehensively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of information extraction, and more particularly, to a structured information extraction method based on multi-type medical record texts. Background Art

[0002] With the development of medical informatization, the digitization of medical records has become a trend. However, due to the complexity and diversity of medical record texts, efficiently extracting structured information from these diverse types of texts has become a major challenge. Traditional methods often rely on manual review, which is not only time-consuming and labor-intensive, but also prone to errors. In recent years, with the advancement of natural language processing (NLP) technology, automated medical record text processing methods have gradually become a research hotspot.

[0003] Existing medical record text processing technologies primarily include text classification, information extraction, and sentiment analysis. Most of these technologies are based on machine learning or deep learning algorithms, such as support vector machines (SVMs), convolutional neural networks (CNNs), and long short-term memory networks (LSTMs). Although these methods have improved the efficiency and accuracy of medical record text processing to some extent, they primarily focus on processing a single type of medical record text and still have some shortcomings in extracting structured information from multiple types of medical record text. For example, they suffer from poor versatility: most methods are optimized for specific types of medical record text and are difficult to directly apply to other types of medical record text. Complexity management is inadequate: existing technologies often lack mechanisms specifically designed to assess the complexity of medical record text, making them unable to effectively identify and process text with excessive complexity. Furthermore, the level of automation is low: while some automated tools exist, text correction and streamlining still require significant manual intervention. Summary of the Invention

[0004] In order to overcome the above-mentioned defects of the prior art and to achieve the above-mentioned objectives, the present invention provides the following technical solution: a method for extracting structured information based on multi-type medical record texts, comprising:

[0005] S1. Collect original medical record text data, preprocess it, and construct a high-dimensional vector;

[0006] S2. Build an anomaly detection model, use high-dimensional vectors as input variables, perform predictive analysis on the text complexity of medical records, obtain the complexity anomaly coefficient, and generate a complexity status signal;

[0007] S3. Based on the complexity status signal, the medical record text that does not meet the complexity requirements is processed and corrected, and converted into simplified text.

[0008] Furthermore, the preprocessing method is text cleaning and standardization;

[0009] The method of constructing the high-dimensional vector includes:

[0010] Extract relevant features of medical record text, combine vocabulary diversity and syntactic structure complexity, and construct high-dimensional vectors;

[0011] Among them, the relevant features of medical record text include text length, number of sentences, average sentence length, number of named entities and sentiment score;

[0012] Text length includes the total number of words and characters in the medical record text;

[0013] Average sentence length is defined as the ratio of the total number of words to the number of sentences;

[0014] The method for extracting the number of named entities is:

[0015] Use NER technology to identify named entities in medical record text and count their number;

[0016] The emotion score includes positive emotion score, negative emotion score and neutral emotion score;

[0017] Among them, the method for extracting sentiment scores is:

[0018] Use sentiment analysis technology to analyze the emotional tendencies of medical record texts and obtain corresponding sentiment scores.

[0019] Furthermore, the calculation method of the vocabulary diversity value and syntactic structure complexity includes:

[0020] Use Jieba technology to segment medical record text and create a vocabulary list;

[0021] Remove duplicates from the vocabulary list to form a classified vocabulary set, and count the number of vocabulary sets and the total number of vocabulary;

[0022] The ratio of the number of vocabulary sets to the total number of vocabulary is calculated to obtain the vocabulary diversity value;

[0023] Use Spacy technology to perform sentence segmentation and syntactic analysis on medical record text, extract clauses and phrases, and count their number;

[0024] The syntactic complexity is calculated by ratioing the total number of clauses and phrases to the number of sentences.

[0025] Furthermore, the method of constructing the anomaly detection model includes:

[0026] Collect and transform historical medical records into high-dimensional vectors and integrate them into text datasets;

[0027] The text dataset is divided into S_U groups of training data, and then divided into training set and test set according to the preset ratio;

[0028] Use the Gaussian mixture model to build an anomaly detection model, take the training set as input, and output the complexity anomaly coefficient;

[0029] Set the convergence tolerance and k value of the model, use the expectation maximization algorithm to iteratively update the model parameters, and calculate the difference between the current log-likelihood value and the log-likelihood value of the previous iteration after each iteration. If the difference is less than the convergence tolerance, it is determined that the model has converged and the iteration is stopped.

[0030] Furthermore, the k value is the number of Gaussian distributions;

[0031] The k value is set by using the BIC criterion to select the optimal Gaussian distribution number k;

[0032] The calculation formula of the log-likelihood value logP(X|θ) is defined as:

[0033]

[0034] Where X is the training set, which contains a high-dimensional vector x of N medical records, i is the index of the medical record text, i = 1, 2, ..., N, and θ is the parameter set of the model, including the number of Gaussian distributions k, the weight of each Gaussian distribution π j , mean μ j and the covariance matrix Σ j , j is the index of the Gaussian distribution, j = 1, 2, ..., k, P (X | θ) is x i The likelihood value under the model parameters θ, N(x i ∣μ j ,Σ j ) is the probability density function of the multidimensional Gaussian distribution;

[0035] Probability density function

[0036] Among them, |∑ j | is the covariance matrix Σ j The determinant of (x i -μ j ) is a high-dimensional vector x i and Gaussian distribution mean μ j The difference vector between (x i -μ j ) T is the transpose of the difference vector, is the covariance matrix Σ j The inverse matrix of .

[0037] Furthermore, the method of generating the complexity status signal includes:

[0038] Input the high-dimensional vector of medical record text data into the anomaly detection model to obtain the complexity anomaly coefficient of the medical record text;

[0039] Set an abnormal coefficient threshold. If the complexity abnormal coefficient is greater than the abnormal coefficient threshold, the medical record text is judged to be highly complex and a complexity failure signal is generated.

[0040] Otherwise, a complexity qualified signal is generated;

[0041] Based on the complexity qualification signal, a reference threshold is set, and medical record texts with complexity abnormality coefficients lower than the reference threshold are selected as reference texts, and integrated to form a reference text library.

[0042] Furthermore, the method of processing and correcting the medical record text with unqualified complexity based on the complexity status signal and converting it into a simplified text includes:

[0043] Based on the complexity failure signal and the reference text library, the texts with unsatisfactory complexity are defined as abnormal texts;

[0044] Calculate the cosine similarity between the high-dimensional vector of the abnormal text and the high-dimensional vector of each reference text;

[0045] Cosine similarity

[0046] Where AC is the high-dimensional vector of the abnormal text, BC is the high-dimensional vector of the reference text, AC×BC is the dot product of the high-dimensional vectors AC and BC, ||AC|| and ||BC|| are the moduli of the high-dimensional vectors AC and BC respectively;

[0047] The reference text with the highest cosine similarity is selected as the reference text most similar to the abnormal text, and compared with the abnormal text for analysis to obtain the errors or complex parts in the abnormal text and generate a simplified text.

[0048] Furthermore, the method of generating simplified text includes:

[0049] Use the BERT model's tokenizer to tokenize historical medical record text data, which contains both qualified and unqualified complexity text, and convert it into the input format required by the BERT model.

[0050] The converted historical medical record text data is divided into a training set and a validation set according to a preset ratio. The training set is used to fine-tune the pre-trained BERT model to adapt the model to the task of generating and rewriting medical record text.

[0051] Mark errors or complex parts in abnormal text, use the marked abnormal text as input data, use the most similar reference text as a template, generate simplified text through the BERT model, and perform spelling and grammar verification.

[0052] Furthermore, the method of performing spelling and grammar checking includes performing spelling checking on the simplified text and performing grammar checking on the simplified text;

[0053] The method of performing spell checking on simplified text includes:

[0054] Construct a dictionary of medical terminology and perform dictionary matching on each word in the simplified text. If a word does not appear in the dictionary, it is considered an abnormal word.

[0055] Calculate the edit distance between the abnormal word and the words in the dictionary, select the dictionary word with the minimum edit distance, and if the edit distance between the abnormal word and the dictionary word is less than or equal to 1, it is considered a spelling error and replaced with the dictionary word;

[0056] The method of calculating the edit distance between abnormal words and dictionary words includes:

[0057] Create a (P+1)×(Q+1) matrix D, where P is the number of words in the abnormal word w_1 and Q is the number of words in the dictionary word w_2;

[0058] Use dynamic programming to calculate the edit distance between w_1 and w_2 and fill in the matrix. The D[P][Q] value of the matrix is ​​the edit distance between the two words.

[0059] For each element position D[P_p][Q_q] in the matrix, the calculation rule is defined as:

[0060] If w_1[P_p-1]=w_2[Q_q-1], then D[P_p][Q_q]=D[P_p-1][Q_q-1], otherwise, D[P_p][Q_q]=min(D[P_p-1][Q_q],D[P_p][Q_q-1],D[P_p-1][Q_q-1])+1.

[0061] Furthermore, the method of performing grammar checking on the simplified text includes:

[0062] Use dependency analysis technology to parse sentences in simplified text and generate syntax trees and dependency graphs;

[0063] Parse the syntax tree to identify the subject-verb agreement and word order correctness of the sentence;

[0064] Parse dependency graphs and identify the rationality of subject-predicate and verb-object relationships in sentences;

[0065] If a subject-verb inconsistency is identified, adjust the person and number of the predicate to match the subject;

[0066] If the word order or dependency relationship is incorrect, the sentence components are rearranged to conform to the word order of the "subject-verb-object" structure.

[0067] The technical effects and advantages of the present invention's method for extracting structured information based on multi-type medical record texts are as follows:

[0068] The present invention mainly targets the preparation stage before structured information extraction, aiming to convert medical record texts with high complexity into simplified texts to facilitate subsequent information extraction work; by constructing an anomaly detection model to evaluate the complexity of medical record texts, the present invention can effectively identify medical record texts with high complexity and generate complexity status signals, helping to discover potential problems in advance and reduce error handling costs. Secondly, by adopting natural language processing technologies such as Jieba word segmentation, Spacy sentence segmentation technology and BERT model, the whole process from medical record text preprocessing to simplified text generation is automated, reducing the need for manual intervention and reducing labor costs. The present invention can also accurately identify and process medical record texts with unqualified complexity by calculating the cosine similarity with the reference text, generating more concise and accurate text content, and further ensuring the text quality through spelling and grammar verification, enhancing the readability and usability of the information. By continuously training and optimizing the BERT model using historical medical record text data, the present invention has continuous learning and optimization capabilities, ensuring the long-term effectiveness of the technology, and providing strong technical support for new needs that may arise in the future. In summary, the present invention not only solves multiple problems in existing medical record text processing technology, but also provides support for the information construction of the medical industry. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] Figure 1 Schematic diagram of a structured information extraction method based on multi-type medical record texts according to the present invention;

[0070] Figure 2 This is a system diagram of a structured information extraction method based on multi-type medical record texts of the present invention. DETAILED DESCRIPTION

[0071] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0072] Example 1

[0073] See also Figure 1 As shown, the structured information extraction method based on multi-type medical record text described in this embodiment includes:

[0074] S1. Collect the data of the original medical record text, preprocess it, and construct a high-dimensional vector;

[0075] S2. Construct an anomaly detection model, use the high-dimensional vector as an input variable, predict and analyze the text complexity of the medical record text, obtain a complexity anomaly coefficient, and generate a complexity status signal;

[0076] S3. Based on the complexity status signal, process and correct the medical record text with high complexity, and convert it into a simplified text;

[0077] Further, the preprocessing method is text cleaning and standardization;

[0078] Text cleaning includes removing irrelevant characters, formats, and stop words. Removing irrelevant characters means removing punctuation marks (such as commas, periods, exclamation marks) and special characters (such as @, #, $) in the text; removing irrelevant formats means deleting redundant line breaks and spaces to ensure consistent text formats; removing stop words means using a stop word list to remove common meaningless words (such as "of", "is", "in");

[0079] Standardization means using an abbreviation dictionary to include common medical abbreviations and their full forms in the dictionary (for example, corresponding "MRI" to "Magnetic Resonance Imaging"), traversing the text, and performing abbreviation replacement according to the abbreviation dictionary;

[0080] The method for constructing the high-dimensional vector is as follows:

[0081] For the preprocessed case text, extract the relevant features of the medical record text, combine them with the lexical diversity value and syntactic structure complexity, and construct a high-dimensional vector;

[0082] Among them, the relevant features of the medical record text include text length, number of sentences, average sentence length, number of named entities, and sentiment score;

[0083] The text length includes the total number of words and total number of terms in the medical record text;

[0084] Among them, the method for extracting the total number of terms is:

[0085] Use Jieba technology to segment the medical record text, create a vocabulary list, and count the total number of vocabulary;

[0086] The method for extracting the number of sentences is:

[0087] Use Spacy technology to split the medical record text into sentences, create a sentence list, and count the total number of sentences;

[0088] The average sentence length is defined as the ratio of the total number of terms to the number of sentences;

[0089] The method for extracting the number of named entities is to use NER tools (such as Spacy, Stanford NLP, etc.) to identify the named entities in the medical record text and count their number;

[0090] The calculation method of sentiment score includes:

[0091] By using sentiment analysis technology (such as TextBlob, VADER, etc.) to analyze the sentiment tendency of medical record text, positive, negative and neutral sentiment scores are calculated;

[0092] Furthermore, the method for calculating the vocabulary diversity value is:

[0093] Remove duplicates from the vocabulary list, obtain vocabulary categories for different words, and count the number of vocabulary categories;

[0094] The ratio of the number of lexical categories to the total number of words is calculated to obtain the lexical diversity value (which can be used to measure the richness of the vocabulary);

[0095] The calculation method of the syntactic structure complexity is:

[0096] Use Spacy technology to perform dependency syntax analysis on each sentence, extract clauses (for example, in the sentence "After preliminary examination, it was found that the patient had dizziness symptoms", "after preliminary examination" is a clause) and phrases (for example, in the sentence "The patient complained of high blood pressure, accompanied by headaches", "accompanied by headaches" is a phrase), and count the number;

[0097] The ratio of the total number of clauses and phrases to the number of sentences is calculated to obtain the syntactic complexity (which can be used to measure the complexity of sentence structure);

[0098] Furthermore, the method of constructing the anomaly detection model includes:

[0099] Collect historical medical records, convert all historical medical records into high-dimensional vectors, and integrate them into a text dataset;

[0100] The text dataset is divided equally into S_U group training data, and the S_U group training data is divided into training set and test set according to the preset ratio;

[0101] Use the Gaussian mixture model to build an anomaly detection model, take the training set as input, and output the complexity anomaly coefficient of the medical record text;

[0102] Set the convergence tolerance and k value of the model, use the expectation maximization algorithm to iteratively update the model parameters, and calculate the difference between the current log-likelihood value and the log-likelihood value of the previous iteration after each iteration. If the difference is less than the convergence tolerance, the model is determined to have converged and the iteration is stopped;

[0103] Furthermore, the k value is the number of Gaussian distributions;

[0104] The k value is set by using the BIC criterion to select the optimal number of Gaussian distributions;

[0105] The BIC criteria are defined as:

[0106] BIC = -2 × ln(L) + q × ln(N);

[0107] Where L is the maximum log-likelihood value of the model, which indicates how well the model fits the high-dimensional vector. The higher the log-likelihood value, the better the model fits the data. N is the number of medical records, and q is the number of free parameters of the model, that is, the total number of parameters that can be freely adjusted.

[0108]

[0109] Where d is the dimension of the high-dimensional vector, that is, the number of features in the high-dimensional vector;

[0110] It should be noted that in the Gaussian mixture model, the free parameters include the weight, mean vector and covariance matrix of each Gaussian component, and the number of free parameters q is used to measure the complexity of the model;

[0111] Ways to use the BIC criterion to select the optimal k value include:

[0112] Preset a series of k values ​​(e.g., k = 1, 2, ..., K). For each k value, use the training set data to train the Gaussian mixture model and calculate the maximum likelihood estimate L of the model. Calculate the BIC value based on L. Compare the BIC values ​​corresponding to different k values ​​and select the k value with the smallest BIC value as the optimal number of Gaussian distributions. The smaller the BIC value, the better the model performs in balancing fitting effect and complexity.

[0113] The calculation formula of the log-likelihood value logP(X|θ) is defined as:

[0114]

[0115] Where X is the training set, which contains a high-dimensional vector x of N medical records, i is the index of the medical record text, i = 1, 2, ..., N, and θ is the parameter set of the model, including the number of Gaussian distributions k, the weight of each Gaussian distribution π j , mean μ j and the covariance matrix Σ j ,π j is the weight of the j-th Gaussian distribution, satisfying μ j is the mean of the jth Gaussian distribution, Σ jis the covariance matrix of the jth Gaussian distribution, which is a d×d symmetric positive definite matrix, j is the index of the Gaussian distribution, j=1,2,...,k, P(X|θ) is x i The likelihood value under the model parameters θ, is x i Belong to the weighted sum of each Gaussian distribution, N(x i ∣μ j ,Σ j ) is the probability density function of the multidimensional Gaussian distribution;

[0116]

[0117] Among them, N(x i ∣μ j ,Σ j ) is the jth Gaussian distribution in x i The probability density value at |∑ j | is the covariance matrix Σ j The determinant of is the exponential term, indicating x i and mean μ j The negative exponential of half the square of the Mahalanobis distance between i -μ j ) is a high-dimensional vector x i and mean μ j The difference vector between (x i -μ j ) T is the transpose of the difference vector, is the covariance matrix ∑ j The inverse matrix of

[0118] Furthermore, the method of generating the complexity status signal includes:

[0119] Input the high-dimensional vector of the medical record text to be detected into the anomaly detection model to obtain the complexity anomaly coefficient of the medical record text;

[0120] A threshold value of abnormal coefficient is preset. If the abnormal coefficient of complexity is greater than the threshold value, the complexity of the medical record text is judged to be high, and a complexity failure signal is generated;

[0121] Otherwise, a complexity qualified signal is generated;

[0122] Based on the complexity qualification signal, a reference threshold is preset, and the medical records with complexity abnormality coefficients lower than the reference threshold are used as reference texts to form a reference text library;

[0123] Furthermore, the method of processing and correcting the highly complex medical record text based on the complexity status signal and converting it into a simplified text includes:

[0124] Based on the complexity failure signal and the reference text library, the text with high complexity is regarded as abnormal text. The cosine similarity between the high-dimensional vector of the abnormal text and the high-dimensional vector of each reference text is calculated, and the reference text with the highest similarity is selected as the most similar reference text.

[0125] Select the reference text with the highest cosine similarity as the reference text most similar to the abnormal text, perform comparative analysis with the abnormal text, identify errors or complex parts in the abnormal text, and generate a simplified text;

[0126] Furthermore, the cosine similarity is calculated as follows:

[0127] Among them, AC is the high-dimensional vector of the abnormal text, and BC is the high-dimensional vector of the reference text;

[0128] AC×BC is the dot product (inner product) of the high-dimensional vectors AC and BC:

[0129] ||AC|| is the modulus of the high-dimensional vector AC:

[0130] ||BC|| is the modulus of the high-dimensional vector BC:

[0131] n is the number of vectors in the high-dimensional vector, u is the index of the vector in the high-dimensional vector, u = 1, 2, ..., n;

[0132] It should be noted that the value range of cosine similarity is between -1 and 1. The closer the value is to 1, the more similar the two vectors are. The closer the value is to -1, the less similar the two vectors are. The value of 0 means that the two vectors are orthogonal (completely unrelated).

[0133] Furthermore, the method of performing comparative analysis with the abnormal text, identifying errors or complex parts in the abnormal text, and generating simplified text includes:

[0134] Use part-of-speech tagging technology to tag the abnormal text and the most similar reference text, and compare the part-of-speech differences to identify errors or complex parts in the abnormal text;

[0135] Segment the historical medical record text data and convert it into the input format required by the BERT model;

[0136] Use the BERT model, define the task as rewriting the case text, use the training set as input, train the BERT model, and output the simplified text of the rewritten case text;

[0137] Mark the errors or complex parts in the abnormal text. Use the marked abnormal text as input data, take the most similar reference text as a template, generate a simplified text through the BERT model, and perform spelling and grammar checks;

[0138] The method for performing a spelling check on the simplified text includes:

[0139] Construct a dictionary of medical terminology vocabulary, perform dictionary matching on each word in the simplified text. If a word does not appear in the dictionary, it is determined as an abnormal word;

[0140] By calculating the edit distance between the abnormal word and each word in the dictionary, find the dictionary word with the smallest edit distance. If the edit distance between the abnormal word and this dictionary word does not exceed 1, it is determined that the abnormal word is a spelling error and replace it with the dictionary word;

[0141] Among them, the method for calculating the edit distance between the abnormal word and the dictionary word includes:

[0142] Create a matrix D of size (P + 1)×(Q + 1), where P is the number of characters of the abnormal word w_1 and Q is the number of characters of the dictionary word w_2;

[0143] Use the dynamic programming algorithm to calculate the edit distance between w_1 and w_2 and fill each element in the matrix one by one. The last element D[P][Q] of the matrix is the edit distance between the two words;

[0144] Among them, for each element position D[P_p][Q_q] in the matrix, the calculation rule is defined as:

[0145] If w_1[P_p - 1] = w_2[Q_q - 1], then D[P_p][Q_q] = D[P_p - 1][Q_q - 1]; otherwise, D[P_p][Q_q] = min(D[P_p - 1][Q_q], D[P_p][Q_q - 1], D[P_p - 1][Q_q - 1]) + 1.

[0146] Example:

[0147] Suppose there is "vertigo" in the generated simplified text and "vertigo" is not in the dictionary, calculate the edit distance between "vertigo" and each word in the dictionary;

[0148] Suppose to calculate the edit distance between "vertigo" and "headache";

[0149] Then, w_1 = "vertigo", p = 2; w_2 = "headache", q = 2;

[0150] Create a 3×3 matrix D and fill the matrix:

[0151] Calculate D[1][1]: w_1[0] = "head", w_2[0] = "head", because w_1[0] = w_2[0], so D[1][1] = D[0][0] = 0;

[0152] Calculate D[1][2]: w_1[0] = "head", w_2[1] = "dizzy", because w_1[0]≠w_2[1], so D[1][2] = min(D[0][2], D[1][1], D[0][1])+1 = min(2,0,1)+1 = 1;

[0153] Calculate D[2][1]: w_1[1] = "pain", w_2[0] = "head", because w_1[1] ≠ w_2[0], so D[2][1] = min(D[1][1], D[2][0], D[1][0])+1 = min(0,2,1)+1 = 1;

[0154] Calculate D[2][2]: w_1[1] = "pain", w_2[0] = "faint", because w_1[1] ≠ w_2[1], so D[2][2] = min(D[1][2], D[2][1], D[1][1])+1 = min(1,1,0)+1 = 1;

[0155] Then the edit distance ED("dizziness", "headache") = D[2][2] = 1;

[0156] Furthermore, the method of performing grammar checking on the simplified text includes:

[0157] Use dependency analysis technology (such as Stanford CoreNLP) to parse the sentences in the simplified text and generate a syntax tree and dependency graph;

[0158] Parse the syntax tree to identify the sentence's subject-verb agreement and word order. Parsing the syntax tree involves extracting the sentence's components (such as the subject, predicate, and object) from the syntax tree. Identifying subject-verb agreement involves confirming that the subject and predicate agree in person and number (for example, the subject "patient" is singular, and the predicate "chief complaint" is also singular). Identifying word order correctness involves confirming whether the sentence's word order is correct (for example, Chinese sentences generally follow a "subject-verb-object" structure).

[0159] Parse the dependency graph to identify the rationality of the subject-predicate relationship and the verb-object relationship in the sentence. Parsing the dependency graph involves extracting the dependency relationships between the various words in the sentence (such as extracting the subject-predicate relationship and the verb-object relationship). Identifying the subject-predicate relationship involves confirming whether the relationship between the subject and the predicate is reasonable (for example, there should be a direct dependency relationship between the subject "patient" and the predicate "chief complaint"). Identifying the verb-object relationship involves confirming whether the relationship between the predicate and the object is reasonable (for example, there should be a direct dependency relationship between the predicate "chief complaint" and the objects "headache, nausea and vomiting, chest tightness, palpitations").

[0160] If the subject and predicate of a sentence are inconsistent, adjust the person and number of the predicate to match the subject. If the word order or dependency relationship is incorrect, rearrange the components in the sentence to make them conform to the word order of the "subject, predicate, and object" structure, ensuring that the word order and dependency relationship are reasonable.

[0161] This embodiment can process medical records of different departments and types of diseases, enhance the versatility and flexibility of the system, and can also evaluate the complexity of medical record texts by building an anomaly detection model to achieve effective control of complexity; the proposed medical record text structured information extraction method is mainly aimed at the preparation stage before structured information extraction, aiming to convert medical record texts with high complexity into simplified texts to facilitate subsequent information extraction work. The generated simplified text can not only effectively reduce the complexity of the original medical record text, but also retain key information, ensure the integrity and accuracy of the information, and make the process of information extraction and construction of electronic medical records more concise, with significant advantages such as wide applicability, efficient complexity management and high degree of automation; Specifically, this embodiment first preprocesses the collected various types of medical record text data, including text cleaning, standardization, and feature analysis, to form high-dimensional vectors. Then, it uses the Gaussian mixture model and the BIC criterion to construct an anomaly detection model to optimize the accuracy and robustness of the model. Subsequently, based on the complexity state signal output by the model, it performs targeted processing on medical record texts that do not meet the standards, including finding the most similar reference text through cosine similarity to generate simplified text, and performing spelling and grammar verification to improve text quality. Finally, through continuous training and optimization of the BERT model, its efficiency and stability in generating and rewriting medical record texts are ensured, thereby comprehensively improving the efficiency and accuracy of medical data analysis.

[0162] Example 2

[0163] See also Figure 2 As shown, for the parts not described in detail in this embodiment, please refer to the description of Example 1. A structured information extraction system based on multi-type medical record text is provided, including:

[0164] Data acquisition module: used to collect original medical record text data, perform preprocessing, and construct high-dimensional vectors;

[0165] Model prediction module: used to build an anomaly detection model, taking high-dimensional vectors as input variables, predicting and analyzing the text complexity of medical records, obtaining the complexity anomaly coefficient, and generating a complexity status signal;

[0166] Text processing module: used to process and correct highly complex medical record texts based on complexity status signals and convert them into simplified texts.

[0167] Example 3

[0168] This embodiment discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the operation mode of the structured information extraction method based on multi-type medical record text provided above is implemented.

[0169] Since the electronic device introduced in this embodiment is an electronic device used to implement a structured information extraction method based on multiple types of medical record texts in the embodiment of this application, based on the structured information extraction method based on multiple types of medical record texts introduced in the embodiment of this application, those skilled in the art can understand the specific implementation of the electronic device of this embodiment and its various variations, so how the electronic device implements the method in the embodiment of this application will not be described in detail here. As long as those skilled in the art implement the electronic device used in the structured information extraction method based on multiple types of medical record texts in the embodiment of this application, it falls within the scope of protection to be provided by this application.

[0170] The above formulas are all dimensionless and numerical calculations. The formulas are obtained by collecting a large amount of data and performing software simulation to obtain the most recent real situation. The preset parameters and thresholds in the formulas are set by technicians in this field according to actual conditions.

[0171] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiment. All technical solutions based on the principles of the present invention are within the scope of protection of the present invention. It should be noted that for users of ordinary skill in the art, various improvements and modifications that do not depart from the principles of the present invention should also be considered within the scope of protection of the present invention.

Claims

1. A structured information extraction method based on multi-type medical record text, characterized in that: include: S1, collect medical record text data, preprocess it, and construct a high-dimensional vector; S2. Construct an anomaly detection model, use the high-dimensional vector as the input variable, perform predictive analysis on the text complexity of the medical record text, obtain the complexity anomaly coefficient, and generate a complexity status signal; S3. Based on the complexity status signal, the highly complex medical record text is processed and corrected, and converted into simplified text.

2. A method for extracting structured information based on multi-type medical record text according to claim 1, characterized in that: The preprocessing method is text cleaning and standardization; The method of constructing a high-dimensional vector is: For the preprocessed case text, extract the relevant features of the medical record text, combine it with the vocabulary diversity value and syntactic structure complexity, and construct a high-dimensional vector; Among them, the relevant features of medical record text include text length, number of sentences, average sentence length, number of named entities, and sentiment score; Text length includes the total number of characters and words in the medical record text; Among them, the method for extracting the total number of words is: Use Jieba technology to segment medical record text, create a vocabulary list, and count the total number of words; The method for extracting the number of sentences is: Use Spacy technology to segment medical record text, create sentence lists, and count the total number of sentences; Average sentence length was defined as the ratio of total number of words to number of sentences; The method for extracting the number of named entities is: Use NER technology to identify named entities in medical record text and count their number; The sentiment scores include positive sentiment scores, negative sentiment scores, and neutral sentiment scores; Among them, the method for extracting sentiment scores is: Use sentiment analysis technology to analyze the sentiment tendency of the medical record text and obtain the corresponding sentiment score.

3. A method for extracting structured information based on multi-type medical record text according to claim 2, characterized in that: The method for calculating the vocabulary diversity value is: Remove duplicates from the vocabulary list, obtain vocabulary categories, and count the number of vocabulary categories; The ratio of the number of vocabulary categories to the total number of words is calculated to obtain the vocabulary diversity value; The calculation method of the syntactic structure complexity is: Use Spacy technology to perform syntactic analysis on the sentence list, extract clauses and phrases, and count the number; The syntactic complexity was calculated by ratioing the total number of clauses and phrases to the number of sentences.

4. The method for extracting structured information based on multi-type medical record text according to claim 1, characterized in that: The method of constructing the anomaly detection model includes: Collect and transform historical medical record text data into high-dimensional vectors and integrate them into text datasets; The text dataset is equally divided into S_U groups of training data, and then divided into training sets and test sets in a preset ratio; Use Gaussian mixture model to build an anomaly detection model, take the training set as input, and output the complexity anomaly coefficient; The convergence tolerance and k value of the model are set, and the expectation maximization algorithm is used to iteratively update the model parameters. After each iteration, the difference between the current log-likelihood value and the log-likelihood value of the previous iteration is calculated. If the difference is less than the convergence tolerance, the model is judged to have converged and the iteration is stopped.

5. A method for extracting structured information based on multi-type medical record text according to claim 4, characterized in that: The k value is the number of Gaussian distributions; The method for setting the k value is to select the optimal Gaussian distribution number k by using the BIC criterion; The calculation formula of the log-likelihood value logP(X|θ) is defined as: Where X is the training set, which contains a high-dimensional vector x of N medical record texts, i is the index of the medical record text, i = 1, 2, ..., N, and θ is the parameter set of the model, including the number of Gaussian distributions k and the weight of each Gaussian distribution π j , mean vector μ j and the covariance matrix Σ j , j is the index of the Gaussian distribution, j = 1, 2, ..., k, N (x i ∣μ j ,Σ j ) is the probability density function of the multidimensional Gaussian distribution; Among them, |Σ j | is the covariance matrix Σ j The determinant of , exp represents the exponential function of the base of the natural logarithm e, (x i -μ j ) is a high-dimensional vector x i and the Gaussian distribution mean vector μ j The difference vector between i -μ j ) T is the transpose of the difference vector.

6. The method for extracting structured information based on multi-type medical record text according to claim 1, characterized in that: The method of generating the complexity status signal includes: The high-dimensional vector of the medical record text is input into the anomaly detection model to obtain the complexity anomaly coefficient of the medical record text; Set an abnormal coefficient threshold. If the complexity abnormal coefficient is greater than the abnormal coefficient threshold, the complexity of the medical record text is determined to be high, and a complexity failure signal is generated; Otherwise, a complexity qualified signal is generated; Based on the complexity qualification signal, a reference threshold is set, and medical record texts with complexity abnormality coefficients lower than the reference threshold are selected as reference texts, and integrated to form a reference text library.

7. The method for extracting structured information based on multi-type medical record text according to claim 1, characterized in that: The method of processing and correcting the highly complex medical record text based on the complexity status signal and converting it into a simplified text includes: Based on the complexity failure signal and the reference text library, the medical record text with high complexity is defined as abnormal text; Calculate the cosine similarity between the high-dimensional vector of the abnormal text and the high-dimensional vector of each reference text in the reference text library; The reference text with the highest cosine similarity is selected as the reference text most similar to the abnormal text, and compared with the abnormal text for analysis to identify errors or complex parts in the abnormal text and generate simplified text.

8. The method for extracting structured information based on multi-type medical record text according to claim 7, characterized in that: The cosine similarity is calculated as follows: Wherein, AC is the high-dimensional vector of the abnormal text, BC is the high-dimensional vector of the reference text, AC×BC is the dot product of AC and BC, ||AC|| and ||BC|| are the moduli of AC and BC respectively; The method of performing comparative analysis with the abnormal text, identifying errors or complex parts in the abnormal text, and generating simplified text includes: Use part-of-speech tagging technology to tag the abnormal text and the most similar reference text, and compare the differences in part of speech to identify errors or complex parts in the abnormal text; Segment the historical medical record text data and convert it into the input format required by the BERT model; Use the BERT model, define the task as rewriting the case text, take the training set as input, train the BERT model, and output the simplified text after rewriting the case text; Mark the errors or complex parts in the abnormal text, use the marked abnormal text as input data, take the most similar reference text as a template, generate simplified text through the BERT model, and perform spelling and grammar checking.

9. The method for extracting structured information based on multi-type medical record text according to claim 8, characterized in that: The method of performing spelling and grammar checking includes performing spelling checking on simplified text and performing grammar checking on simplified text; The method of performing spell checking on the simplified text includes: Construct a dictionary of medical terminology vocabulary, and perform dictionary matching on each word in the simplified text. If a word does not appear in the dictionary, it is considered an abnormal word. Calculate the edit distance between the abnormal word and the dictionary word, select the dictionary word with the minimum edit distance, and if the edit distance between the abnormal word and the dictionary word is less than or equal to 1, it is considered a spelling error and replaced with the dictionary word; The methods for calculating the edit distance between abnormal words and dictionary words include: Create a (P+1)×(Q+1) matrix D, where P is the number of words in the abnormal word w_1 and Q is the number of words in the dictionary word w_2; Use the dynamic programming algorithm to calculate the edit distance between w_1 and w_2 and fill the matrix. The D[P][Q] value of the matrix is ​​the edit distance between the two words. Among them, for each element position D[P_p][Q_q] in the matrix, the calculation rule is defined as: If w_1[P_p-1]=w_2[Q_q-1], then D[P_p][Q_q]=D[P_p-1][Q_q-1], otherwise, D[P_p][Q_q]=min(D[P_p-1][Q_q],D[P_p][Q_q-1],D[P_p-1][Q_q-1])+1.

10. The method for extracting structured information based on multi-type medical record text according to claim 8, characterized in that: The method of performing grammar checking on the simplified text includes: Use dependency analysis technology to parse the sentences in the simplified text and generate syntax trees and dependency graphs; Parse the syntax tree to identify the subject-verb agreement and word order correctness of the sentence; Parse dependency graphs and identify the rationality of subject-predicate relationships and verb-object relationships in sentences; If a subject-verb inconsistency is identified, adjust the person and number of the predicate to match the subject; If the word order or dependency error is found, the sentence components are rearranged to conform to the word order of the "subject-predicate-object" structure.

Citation Information

Patent Citations

  • Unsupervised English sentence automatic simplification algorithm

    CN110096705A

  • User online questioning processing method and system based on complexity analysis

    CN111931498A

  • Text detection and correction method based on Pinyin similarity and language model

    CN112232055A

  • Structured information extraction method based on multi-type medical record texts

    CN113343680A

  • Text detection method and device

    CN114860925A