TNM (Tumor Necrosis Model) staging prediction method and system in clinical text of large language model

Through a clinical text processing system with a large language model combined with the RAG technology framework, the problems of insufficient accuracy of clinical text information extraction and poor domain adaptability in the existing technology are solved, efficient and accurate TNM staging prediction are achieved, and the results are output in standardized JSON format, supporting data sharing and integration.

CN119830907APending Publication Date: 2025-04-15HEREN HEALTH CO LTD
View PDF 0 Cites 7 Cited by

Patent Information

Application Number
CN202510002930.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-02
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

When used in clinical scenarios, it is difficult to accurately understand and process complex medical texts, especially in the TNM staging standards, there are problems such as insufficient accuracy of information extraction, poor domain adaptability and lack of standardization of output results.

Method used

A method and system for predicting TNM staging in clinical texts with a large language model is proposed. Through the coordinated work of multiple modules such as data collection and preprocessing, instruction data collection and model fine-tuning, clinical text preprocessing and medical event extraction, preliminary event processing and screening, prompt word engineering optimization, RAG technology framework combination and TNM staging result generation, the automated processing of complex clinical texts and the generation of TNM staging results are realized.

Benefits of technology

It realizes fully automatic processing of complex clinical texts, improves the accuracy and efficiency of TNM staging prediction, has good cross-domain adaptability, and outputs the results in standardized JSON format, supporting data sharing and integration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119830907A_ABST
    Figure CN119830907A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of large models, in particular to a TNM (Tumor Necrosis Model) staging prediction method and system in a clinical text of a large language model. Comprising the steps of data acquisition and preprocessing, instruction data acquisition, large language model instruction fine tuning, clinical text preprocessing, medical event extraction, preliminary event processing and screening, cue word engineering optimization, RAG technical framework combination, TNM staging result generation and JSON formatting output. By combining the natural language processing capacity of the large language model and the external knowledge retrieval function of the RAG technical framework, the efficient, accurate and wide-adaptability TNM staging prediction method and system are provided, the automation degree of clinical tumor staging can be effectively improved, a reliable staging basis can be provided for doctors, and the clinical tumor staging prediction efficiency is improved. With the continuous development of medical big data and artificial intelligence technology, the method has a wide application prospect and potential market value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of large models, and in particular to a method and system for predicting TNM staging in clinical texts of a large language model. Background Art

[0002] The TNM staging system is a tumor staging system jointly developed and promoted by the International Center for Cancer Research (UICC) and the American Joint Committee on Cancer (AJCC). The TNM staging system helps clinicians to describe and classify the degree of tumor progression in a standardized manner by evaluating the status of the primary site (T), regional lymph nodes (N), and distant metastasis (M) of the tumor, thereby providing a reference for the formulation of treatment plans. However, despite the wide range of applications of the TNM staging system and its high degree of standardization, there are still many challenges and limitations in actual clinical applications.

[0003] In recent years, with the in-depth advancement of medical informatization, a large amount of clinical data is stored in the form of electronic medical records (EMRs), which include patients' diagnostic information, treatment records, imaging reports, etc. However, since most of these data are in the form of unstructured text, such as doctors' handwritten notes, radiology reports, pathology reports, etc., the traditional TNM staging method is difficult to make full use of these valuable clinical data. How to efficiently and accurately extract useful information from these unstructured text data has become an important challenge in the development of current TNM staging technology.

[0004] The emergence of natural language processing (NLP) technology provides a new approach to solving the above problems. NLP is an interdisciplinary field of computer science, artificial intelligence, and linguistics, which aims to process and understand natural language through computer technology. With the advancement of deep learning technology, the application of NLP technology in the medical field has been greatly expanded. In particular, the large language models that have emerged in recent years (such as BERT, GPT series, Qwen series, etc.) have shown strong capabilities in processing complex medical text data. These large language models can understand and generate text similar to human language by learning from massive text data, and have certain contextual understanding and reasoning capabilities.

[0005] Despite this, existing large language models still face many challenges when applied to actual clinical scenarios. First, medical texts are highly professional and contain a large number of medical terms, abbreviations, and proper nouns. It is difficult for ordinary large language models to accurately understand and process this information. Secondly, the contextual relationships of medical texts are complex. Especially when describing conditions and diagnoses, doctors often use metaphors and ambiguous expressions, which increases the difficulty of information extraction. In addition, different types of tumors have different TNM staging standards. When processing texts of various types of cancer, the model needs to have flexible adaptability and a wide range of medical knowledge reserves.

[0006] To solve these problems, researchers have proposed a variety of improvement methods. For example, by performing domain fine-tuning on the basis of a large language model, the model can better understand and process text in a specific field. Domain fine-tuning usually enhances its ability to understand medical terminology and context by retraining a pre-trained large language model on a dataset in the medical field. However, the effect of domain fine-tuning depends on high-quality annotated datasets, and in the medical field, the acquisition of annotated data is costly and difficult. In addition, although the model after domain fine-tuning performs well on specific tasks, its generalization ability across domains still needs to be improved.

[0007] Although existing TNM staging technology methods can automate the processing of clinical data to a certain extent, there are still several major problems: Insufficient accuracy of information extraction: Traditional information extraction methods have difficulty dealing with complex medical texts, especially in scenarios involving multiple diseases or multiple diagnoses. The model is prone to confuse or miss key information. Poor domain adaptability: The TNM staging standards for different cancer types are different. Existing models often show poor adaptability when dealing with cross-domain tasks, and are difficult to switch and apply between multiple cancer types. Lack of standardization of output results: Even if accurate medical event information is extracted, existing systems often find it difficult to achieve standardized data processing when outputting TNM staging results, resulting in difficulties in subsequent automated analysis and system integration. Summary of the invention

[0008] In order to overcome the problems raised in the above background technology, the present invention proposes a TNM staging prediction method and system in clinical texts based on a large language model.

[0009] The technical solution of the present invention is: a method for predicting TNM staging in clinical texts using a large language model, comprising the following steps:

[0010] S11: Data collection and preprocessing: collect and preprocess clinical text data, including removing irrelevant information, segmenting data, removing stop words, and standardizing medical terms to obtain text data suitable for model processing. Specifically, it includes:

[0011] Joint processing of structured and unstructured data;

[0012] Standardize medical terms and diagnostic names, including annotating and mapping text using standard medical coding systems such as SNOMEDCT and ICD-10;

[0013] S12: Command data collection, collecting specific command data for fine-tuning the model commands, including case information, diagnostic records, and imaging reports related to TNM staging, to ensure that the model can accurately understand and handle specific tasks in the medical field;

[0014] S13: fine-tuning the instructions of the large language model, based on the collected instruction data, fine-tuning the instructions of the large language model and adjusting the model parameters;

[0015] S14: Clinical text preprocessing: input the preprocessed text data into the large language model for further text parsing and feature extraction, including entity recognition and semantic relationship analysis, to extract the core medical event information related to TNM staging. Specifically, the following steps are included:

[0016] Standardize the time expressions in the text to unify the time nodes of event occurrence and support time series analysis;

[0017] Extract quantitative information from the text and standardize the units;

[0018] S15: Medical event extraction, using the fine-tuned large language model to automatically extract medical event information related to TNM staging from clinical texts. The medical event information related to TNM staging includes the location of the primary tumor, lymph node metastasis, and distant metastasis.

[0019] S16: Preliminary event processing and screening, preliminary processing and screening of the extracted medical event information, wherein the preliminary processing and screening includes removing redundant information, integrating duplicate events and correcting extraction errors;

[0020] S17: prompt word engineering optimization, optimizing the input prompt words through the prompt word engineering module;

[0021] S18: Combination with RAG technical framework, combined with RAG technical framework, input clinical guidelines for different cancer types, including searching the latest medical literature and guidelines and matching and verifying the extracted event information;

[0022] S19: TNM staging result generation: Generate TNM staging results based on the processed and verified medical event information, where the TNM staging results include the size and extent of the primary tumor, regional lymph node metastasis, and classification and staging of distant metastasis;

[0023] S101: JSON format output, formatting the generated TNM staging results into a standardized JSON format for output.

[0024] Preferably, when fine-tuning the instructions of the large language model and adjusting the model parameters based on the collected instruction data, the following steps are included:

[0025] S21: Optimize the large language model through supervised learning methods to enable the model to accurately recognize and process specific medical terms and clinical scenarios related to TNM staging;

[0026] S22: Fine-tune the model using a dataset containing annotations from medical domain experts.

[0027] Preferably, when using the fine-tuned large language model to automatically extract medical event information related to TNM staging from clinical text, the following steps are included:

[0028] S31: Entity recognition and relationship extraction techniques are used to extract key information, including tumor location, lymph node status, and metastasis sites;

[0029] S32: Use a multi-task learning framework to combine other diagnostic information for comprehensive event extraction and analysis.

[0030] Preferably, the extracted medical event information is preliminarily processed and screened, including the following steps:

[0031] S41: Logically check and verify the extracted events based on predefined medical rules and knowledge graphs;

[0032] S42: Provide an interactive manual correction mechanism for suspected errors and conflicting information to correct the data.

[0033] Preferably, when optimizing the input prompt words through the prompt word engineering module, the following steps are included:

[0034] S51: Iteratively adjust and optimize the input prompt words, combine context information, and automatically generate more accurate prompt words for different types of clinical text scenarios;

[0035] S52: Use natural language processing technology to analyze successful cases in historical data and automatically generate and recommend the most appropriate prompt words.

[0036] Preferably, when combining the RAG technical framework and inputting clinical guidelines for different cancer types, the following steps are included:

[0037] S61: Use search enhancement generation technology to search the database for clinical guidelines and the latest literature that best matches the current patient's condition;

[0038] S62: During the search process, the search scope and weight are dynamically adjusted to generate the optimal TNM staging recommendation based on the patient's specific condition and search results;

[0039] S63: Compare the generated TNM staging results with the standard answers in the expert knowledge base to verify the accuracy and rationality of the TNM staging results.

[0040] Preferably, when generating the TNM staging result according to the processed and verified medical event information, the following steps are included:

[0041] S71: Through comprehensive analysis of the extracted medical event information, the specific stages of the primary tumor, lymph nodes and distant metastasis are determined item by item according to the TNM staging standard;

[0042] S72: In the process of generating TNM staging results, consider the individual differences of patients and make personalized staging adjustments;

[0043] S73: Provide an interpretable description for the generated TNM staging results, where the provided interpretable description includes a detailed description of the basis for each staging judgment and the corresponding clinical evidence.

[0044] Preferably, when the generated TNM staging results are formatted into a standardized JSON format and the TNM staging results and their explanatory notes are output in a JSON format, the following steps are included:

[0045] S81: Supports custom JSON formatting rules to meet the integration requirements of different data systems;

[0046] S82: Add validation mechanism in JSON output.

[0047] A large language model-based TNM staging prediction system in clinical texts, including:

[0048] Data collection and preprocessing module, used to collect clinical text data and perform preprocessing;

[0049] The instruction data collection module is used to collect and manage model instruction data and guide the application of the model in specific medical scenarios;

[0050] Large language model instruction fine-tuning module, used to fine-tune the large language model;

[0051] A clinical text preprocessing module, used to further process the input clinical text data, including performing text parsing and feature extraction;

[0052] The medical event extraction module uses a fine-tuned large language model to extract medical events related to TNM staging from text;

[0053] A preliminary event processing and screening module is used to screen and process the extracted event information;

[0054] The prompt word engineering optimization module is used to optimize the input prompt words and improve the extraction ability and accuracy of the model;

[0055] RAG technical framework module, used to combine retrieval enhancement generation technology to optimize literature retrieval and staging results;

[0056] TNM staging result generation module, used to generate TNM staging results based on the extracted information and make personalized adjustments;

[0057] The JSON formatted output module is used to format the installment results into JSON output.

[0058] Preferably, the data acquisition and preprocessing module includes:

[0059] Data standardization unit, used to standardize clinical texts in different formats into a unified format;

[0060] Data cleaning unit, used to detect and clean noise, redundant information and missing values ​​in the data;

[0061] The instruction data acquisition module further includes:

[0062] The instruction generation unit can automatically generate or recommend instruction data according to different medical scenarios to optimize the training effect of the model;

[0063] An instruction management unit, used for managing and updating instruction data;

[0064] The large language model instruction fine-tuning module further includes:

[0065] Fine-tuning parameter optimization unit, used to adjust the hyperparameters of the model;

[0066] Task adaptability enhancement unit, used to detect and adjust the adaptability of the model in different tasks;

[0067] The clinical text preprocessing module further includes:

[0068] Semantic analysis unit, used to analyze the semantic structure of the input text, identify and extract key medical terms and expressions;

[0069] A text correction unit, which is used to detect and correct grammatical errors, typos, and other errors in the text that may affect the accuracy of extraction;

[0070] Entity recognition unit, which is used to identify medical entities in text, including tumor type, location, and metastasis;

[0071] A relation extraction unit is used to extract the relations between medical entities from the text and construct a medical event model based on the relations between medical entities;

[0072] The preliminary event processing and screening module further includes:

[0073] A data verification unit, used to perform logic verification on the extracted event information according to medical rules and standards;

[0074] A data screening unit, used to screen the extracted events according to preset standards and exclude irrelevant and redundant information;

[0075] The prompt word engineering optimization module further includes:

[0076] A historical prompt word analysis unit is used to analyze historical usage data and optimize and generate new prompt words for different scenarios;

[0077] A prompt word recommendation unit, used to automatically recommend the most appropriate prompt word based on the input text content and context information;

[0078] The RAG technology framework module further includes:

[0079] Literature search unit, used to search for the latest clinical guidelines and literature related to the current patient's condition;

[0080] A search result optimization unit, used to analyze and optimize search results;

[0081] The TNM staging result generation module further includes:

[0082] A staging determination unit, used for making TNM staging determination based on the extracted event information;

[0083] Personalized adjustment unit, used to personalize the TNM staging results according to the individual characteristics of the patient;

[0084] The JSON formatting output module further includes:

[0085] JSON building block, used to generate TNM staging results that conform to the specified JSON Schema;

[0086] The data verification unit is used to verify the generated JSON data.

[0087] Beneficial effects of the present invention:

[0088] 1. Automated processing and high efficiency: Through the collaborative work of multiple modules, the present invention can realize fully automatic processing of complex clinical texts, without the need for human intervention from data collection to TNM staging prediction, greatly improving the efficiency of tumor diagnosis.

[0089] 2. Medical accuracy: The present invention combines instruction fine-tuning and RAG technology to ensure the scientificity and accuracy of TNM staging results by introducing the latest medical knowledge and standards.

[0090] 3. Wide adaptability: The present invention is applicable to the TNM staging prediction of various cancer types and has good cross-domain adaptability. Whether it is common cancer or rare cancer, the system can provide reliable staging results.

[0091] 4. Standardized output: TNM staging results are output in JSON format to facilitate data sharing and integration, meeting the needs of modern medical systems for data standardization and scalability.

[0092] 5. Personalized support: When generating TNM staging results, the present invention can take into account individual differences of patients (such as age, gender, medical history, etc.), provide more personalized staging suggestions, and help doctors develop more accurate treatment plans;

[0093] 6. The present invention provides an efficient, accurate and widely adaptable TNM staging prediction method and system by combining the natural language processing capabilities of a large language model with the external knowledge retrieval function of the RAG technical framework. This method can not only effectively improve the automation level of clinical tumor staging, but also provide doctors with a reliable staging basis, thereby optimizing the clinical decision-making process. With the continuous development of medical big data and artificial intelligence technology, the present invention has broad application prospects and potential market value. BRIEF DESCRIPTION OF THE DRAWINGS

[0094] Figure 1 What is shown is a flow chart of the method for predicting TNM staging in clinical texts of the large language model of the present invention;

[0095] Figure 2 Shown is a schematic diagram of the construction of the TNM staging prediction system in clinical text of the large language model of the present invention. DETAILED DESCRIPTION

[0096] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0097] Embodiment 1

[0098] See also Figure 1-Figure 2The present invention proposes a TNM staging prediction method and system based on a large language model. The following describes the implementation methods and technical details of the present invention in detail in combination with various modules:

[0099] First, the present invention proposes a data collection and preprocessing module. This module is responsible for collecting and preprocessing clinical text data from various sources such as electronic medical records (EMR), tumor follow-up systems, medical imaging reports, etc. Since most of these data are in the form of unstructured text, the preprocessing process is crucial. Specifically, this module performs word segmentation, stop word removal, entity recognition, and terminology standardization on text data to ensure high quality and consistency after data cleaning, laying the foundation for subsequent large language model processing.

[0100] Secondly, the present invention introduces a command data collection module. The core task of this module is to collect and organize command data related to TNM staging. Since TNM staging is highly professional, it is necessary to fine-tune the large language model through a specially designed command data set so that it can accurately understand and process medical terms and complex texts. These command data mainly include tumor-related case descriptions, diagnostic records, imaging reports, etc., which are used to guide the application of the model in practical tasks.

[0101] Next is the large language model instruction fine-tuning module. In this module, the instruction dataset is used to fine-tune the instructions of a large language model (such as the Qwen2-7B model). Instruction fine-tuning further trains the model to enable it to more accurately understand and handle specific tasks in the medical field, thereby improving its performance in practical applications. The fine-tuned model not only has a higher language understanding ability, but also can show better performance and robustness when processing complex medical texts.

[0102] The clinical text preprocessing module further analyzes and processes the clinical text based on data preprocessing. This module analyzes the semantic structure of the text data to identify key information related to TNM staging, such as the primary tumor site, size, lymph node status, and distant metastasis. The preprocessing module ensures that the data input into the large language model is highly relevant and formatted, providing support for subsequent medical event extraction.

[0103] Then, we enter the medical event extraction module. This module uses the large language model fine-tuned in the previous step to automatically extract medical event information related to TNM staging from the preprocessed clinical text. This event information is the key data for generating TNM staging results. The extraction process includes the identification and classification of key clinical data such as tumor size, lymph node metastasis, and distant metastasis.

[0104] In order to further optimize the extraction results, the present invention also designs a preliminary event processing and screening module. This module is responsible for processing and screening the extracted preliminary medical event information. Specifically, the system will perform redundant data removal, error correction, data consistency verification and other operations on the extracted information to ensure that the data finally retained is high-quality core information closely related to TNM staging. Through this module, the system can significantly improve the accuracy of TNM staging prediction.

[0105] Next is the prompt word engineering module. Based on the preliminary event processing, this module improves the extraction ability of the large language model by optimizing the input prompt words. The prompt word engineering module aims to improve the model's ability to understand long texts or multiple diagnosis records, ensuring that information directly related to TNM staging can be accurately extracted from complex medical texts. The optimized prompt words help further improve the accuracy and efficiency of the model.

[0106] The RAG technical framework module is an important component of the present invention. This module not only combines the generation capability of the large language model, but also introduces the retrieval function of the external knowledge base, especially the latest medical literature and clinical guidelines related to the TNM staging standards. The special feature of this module is that it can automatically identify the type of cancer of the patient based on the input patient medical record information. By using the large language model to perform semantic analysis on the medical record data and identify specific information related to the cancer, such as tumor location, pathological results, specific markers, etc., the system can accurately determine the type of cancer the patient suffers from. After determining the type of cancer, the RAG technical framework will retrieve the TNM staging standards related to the cancer, and combine these standards with the extracted medical event information to ensure that the generated TNM staging results meet the staging requirements of the specific cancer. This TNM staging matching method based on cancer type greatly improves the accuracy and medical rationality of the staging results.

[0107] After completing the above steps, the system enters the TNM staging result generation module. This module generates the final TNM staging results by comprehensively analyzing the extracted and processed medical event information and the TNM staging standards of the specific cancer types matched. TNM staging includes the classification and staging of the primary tumor size (T), regional lymph node metastasis (N) and distant metastasis (M). This module not only provides TNM staging results, but also describes in detail the basis for each staging judgment to improve the interpretability of the staging results.

[0108] The JSON formatted output module is another important component of the present invention. This module is responsible for outputting the generated TNM staging results in a standardized JSON format. The advantage of the JSON format is its good compatibility and scalability, which facilitates data docking and system integration with other medical systems (such as electronic medical record systems, tumor follow-up systems, etc.). At the same time, the JSON format also supports the automated processing and analysis of staging results, providing data support for subsequent clinical decision-making.

[0109] Finally, there is the result verification and feedback module. This module provides a complete set of verification and feedback mechanisms after the system outputs the TNM staging results. By re-verifying the output results, the system can find potential errors or deviations and further optimize the performance of the model based on the feedback results. This module ensures the stability and accuracy of the system in long-term operation and provides support for the continuous improvement of the model.

[0110] Embodiment 2

[0111] Based on a TNM staging prediction system based on a large language model in Example 1, through the collaborative work of multiple modules, it is possible to automatically extract medical event information related to tumor staging from massive clinical text data and generate standardized TNM staging results. The implementation methods and technical details of each module are described in detail below.

[0112] Data acquisition and preprocessing module:

[0113] The data collection and preprocessing module is the foundation of the system. It is responsible for collecting clinical text data from multiple sources such as electronic medical records (EMR), tumor follow-up systems, and medical imaging reports. Since these data are usually in the form of unstructured text, the main task of preprocessing is to convert them into structured data for subsequent model processing. The specific steps of this module include:

[0114] Text segmentation: Natural language processing tools are used to segment the collected clinical text data. This step ensures that each sentence is correctly divided into words or phrases, laying the foundation for subsequent large language model processing.

[0115] Stop word removal: Use predefined stop word lists to remove meaningless words, such as conjunctions and auxiliary words, to reduce noise in the data. Stop word lists can be customized according to the characteristics of medical texts to retain medical terms that have an impact on staging judgment.

[0116] Entity recognition: Use named entity recognition (NER) technology to identify key medical entities in the text. These entities include but are not limited to the type, location, and metastasis of the tumor. In order to improve recognition accuracy, the entity recognition model may need to be fine-tuned on terms specific to the medical field.

[0117] Terminology standardization: Use standard medical terminology libraries (such as SNOMEDCT, ICD-10) to standardize medical terminology in the text to ensure consistency between different data sources and reduce data processing problems caused by inconsistent terminology.

[0118] Through the above preprocessing steps, the data is normalized and structured, laying a solid foundation for subsequent large language model processing.

[0119] Instruction data collection and large language model instruction fine-tuning:

[0120] The instruction data collection and large language model instruction fine-tuning module is one of the core parts of the system. By fine-tuning the instructions of the large language model, it can better understand and process complex texts in the medical field. The specific implementation steps are as follows:

[0121] Instruction data collection: collect instruction data such as case descriptions, diagnostic records, and imaging reports related to TNM staging. Data collection uses a combination of manual annotation and automatic extraction to ensure data quality and diversity. During the data annotation process, special attention should be paid to the accurate annotation of tumor location, size, lymph node status, and distant metastasis.

[0122] Fine-tuning data preparation: Organize the collected instruction data into a format suitable for model training, such as JSON or CSV format, and divide the data into training set, validation set, and test set. Each data sample includes text content, corresponding medical entity annotations, and their associated TNM staging labels.

[0123] Fine-tuning of large language models: This paper uses Qlora (Quantized Low-Rank Adaptation) technology to fine-tune large language models. Qlora technology quantizes the model weights to reduce the model's computing resource requirements, and uses low-rank adaptation layers for fine-tuning. The specific implementation steps include:

[0124] a. Model weight quantization: In the Qlora implementation process, the weights of large language models are first quantized from floating point numbers (such as 32-bit floating point numbers) to low-bit numbers (such as 8-bit integers). This step significantly reduces the storage and computing resources required for the model, allowing large models to run in resource-constrained environments.

[0125] b. Low-rank adaptation layer training: Based on the quantized model, low-rank adaptation layers are inserted. These adaptation layers fine-tune the model with a smaller number of parameters, thereby retaining the performance of the model on specific tasks (such as TNM staging tasks). These adaptation layers can significantly improve the adaptability of the model with only a small amount of computing resources.

[0126] c. Optimization and training: During the fine-tuning process, the adaptive moment estimation (AdamW) optimization algorithm is used, and the appropriate learning rate (e.g., 2e-5) and training batch size (e.g., 16) are set to optimize the model parameters through multiple training rounds (usually 3 to 5 rounds). The fine-tuned model can more accurately understand and process complex medical texts related to TNM staging.

[0127] Verification of fine-tuning effect: After the model is fine-tuned, the performance of the model is evaluated through the validation set. The specific calculation method is as follows:

[0128] a. Accuracy: Accuracy is the ratio of correctly classified samples to the total number of samples. The calculation formula is:

[0129]

[0130] b. Precision: Precision measures the proportion of samples that are actually positive among those predicted by the model. The calculation formula is:

[0131]

[0132] c. Recall: Recall measures the proportion of samples predicted as positive by the model among samples that are actually positive. The calculation formula is:

[0133]

[0134] d.F1-Score: F1-Score is the harmonic mean of precision and recall, which is used to comprehensively evaluate the performance of the model. The calculation formula is:

[0135]

[0136] These indicators are used to evaluate the model and determine its performance in the TNM staging task. If the results do not meet the expected requirements, it may be necessary to adjust the model parameters or further optimize the fine-tuning process.

[0137] After fine-tuning, the large language model has the ability to process complex medical texts, accurately extract information related to TNM staging, and generate reliable staging results.

[0138] Clinical text preprocessing and medical event extraction:

[0139] The main task of the clinical text preprocessing and medical event extraction module is to further analyze the preprocessed clinical text and identify key data related to TNM staging. The implementation steps of this module include:

[0140] Semantic parsing: Use a fine-tuned large language model to perform semantic parsing on the input clinical text. The semantic parsing task deeply analyzes the text content to identify medical event information directly related to TNM staging, such as the location, size, lymph node metastasis, and distant metastasis of the tumor. The model accurately locates and extracts this key information by parsing the complex syntactic structure in the text.

[0141] Medical event extraction: Based on semantic analysis, the model automatically extracts the three core factors of TNM staging: T (size and range of the primary tumor), N (metastasis of regional lymph nodes), and M (presence of distant metastasis). This extracted information constitutes the basic data for subsequent TNM staging prediction.

[0142] Preliminary processing and screening: To ensure the accuracy and relevance of the data, the extracted medical event information is preliminarily processed. The processing steps include cleaning redundant data, correcting recognition errors, and performing data consistency verification. This process ensures that the retained medical event information is of high quality and closely related to the TNM staging, providing reliable data support for the subsequent generation of staging results.

[0143] Combining the prompt word engineering with the RAG technical framework:

[0144] The combination of prompt word engineering and RAG technology framework further improves the extraction capability and accuracy of the system. The specific implementation steps include:

[0145] Prompt word optimization: Based on the preliminary event processing, the input prompt words are optimized using prompt word engineering technology. The optimization of prompt words aims to enhance the large language model's ability to understand complex contexts and ensure that information related to TNM staging can be accurately extracted when processing long texts or containing multiple diagnosis records. The generation and optimization of prompt words are based on the model's understanding of previous input data, and the accuracy of extraction is improved through multiple rounds of iterative adjustments.

[0146] RAG technical framework combination: When generating TNM staging results, the RAG (Retrieval-Augmented Generation) technical framework combines model generation with external knowledge base retrieval functions, enabling the system to retrieve the latest medical literature and guidelines, especially standards related to TNM staging, from external knowledge bases based on endogenous predictions. This module first parses the input patient medical record information and automatically determines the patient's cancer type by analyzing specific information in the text, such as tumor location, pathological results, etc. Next, the system retrieves the latest TNM staging standards related to the cancer type and integrates these standards with the extracted medical event information to ensure that the generated TNM staging results meet the staging requirements of specific cancer types. This cancer-based TNM staging matching method greatly improves the accuracy and medical rationality of the staging results.

[0147] TNM staging result generation module:

[0148] After completing the above steps, the system enters the TNM staging result generation module. The main task of this module is to generate the final TNM staging result based on the extracted medical event information and the matched cancer-specific TNM staging criteria. The specific implementation steps are as follows:

[0149] Application of staging rules: According to the TNM staging standards for different cancer types, the system parses the extracted T, N, and M information and applies the corresponding staging rules. These staging standards are usually provided by the latest clinical guidelines and cover the different staging requirements for various types of cancer. The system automatically matches the corresponding standards and generates staging results through a pre-configured rule base.

[0150] Staging result generation: After applying the staging rules, the system integrates the generated TNM staging results to form the final staging report. The report includes the staging results of three aspects: T (primary tumor size and range), N (regional lymph node metastasis), and M (presence of distant metastasis), as well as the specific basis for each staging determination.

[0151] Result Verification: To ensure the accuracy of the staging results, the system has a built-in automatic verification mechanism. This mechanism cross-checks the generated staging results with the input data to ensure that the results are consistent with the extracted information and meet the corresponding staging standards. If any inconsistency or anomaly is found during the verification process, the system will automatically issue a warning and require further manual inspection.

[0152] JSON format output module:

[0153] After the TNM staging results are generated, the system enters the JSON formatting output module. This module is responsible for converting the generated TNM staging results into a standardized JSON format and outputting them to the specified system or database. The specific implementation steps are as follows:

[0154] Data structuring: The TNM staging results are presented in a structured data format, including the specific values ​​of the three staging results of T, N, and M, the corresponding descriptive information, the basis for judgment, and any relevant additional information.

[0155] JSON architecture design: Design the JSON architecture based on international standards or industry practices to ensure that the output data format is compatible with other systems. This step includes defining the various fields, hierarchical relationships, and data types of JSON. The system will convert the installment results into JSON format according to the requirements of the architecture.

[0156] Output and storage: After formatting, the system outputs the JSON data to a specified target location, such as the hospital's electronic medical record system (EMR), tumor follow-up database, or other clinical information system. The system can also store the JSON data in a local or cloud database for subsequent data analysis and processing.

[0157] Data verification: Before outputting JSON data, the system will perform a series of data verification operations to ensure that the data conforms to the pre-set JSON architecture specifications and has no errors or omissions. These verifications include format verification, data integrity check, and consistency check to ensure the reliability of JSON data.

[0158] Result verification and feedback module:

[0159] The result verification and feedback module is the last link of the system, which is responsible for verifying the TNM staging results and providing feedback based on the verification results for continuous optimization of the system. The specific implementation steps are as follows:

[0160] Verification mechanism: The system has designed an automated verification mechanism to conduct a comprehensive check on the generated TNM staging results. These checks include logic verification, data integrity verification, and comparison verification with real-world clinical data. The verification mechanism uses a preset rule base to ensure that all staging results meet medical standards and are consistent with the input data.

[0161] Feedback collection: The system supports feedback to the development team or clinicians on issues found during validation. Feedback includes potential error information, insufficient identification of the model, and any areas that need improvement. The feedback mechanism allows users to directly mark issues in the system and provide detailed descriptions and suggestions.

[0162] Model adjustment and optimization: Based on the collected feedback, the system can automatically adjust and optimize the parameters and algorithms of the model. For example, if a certain type of tumor staging judgment is found to have systematic errors in multiple cases, the system will be retrained or fine-tuned based on the feedback to correct these errors. This step ensures that the system can continue to evolve and improve its accuracy and robustness.

[0163] Continuous monitoring and updating: The system will continuously monitor the performance of TNM staging results, track verification and feedback. By regularly updating algorithms, models and data sets, the system can adapt to the latest changes and standards in clinical practice and maintain its efficiency and reliability in tumor staging tasks.

[0164] Embodiment 3

[0165] Based on the second embodiment, the system architecture includes:

[0166] System Integration and Deployment:

[0167] The TNM staging prediction system of the present invention can be flexibly integrated into existing medical information systems, including but not limited to electronic medical record systems (EMR), tumor follow-up platforms, and clinical decision support systems (CDSS). The integration process includes data interface design, API development, and system compatibility testing with existing systems. Through the API interface, the system can receive clinical data in real time and return TNM staging results, thereby supporting doctors' clinical decisions.

[0168] System performance evaluation:

[0169] To ensure the performance of the system in practical applications, the present invention conducts a comprehensive performance evaluation of each module of the system. The performance evaluation indicators include but are not limited to processing speed, memory usage efficiency, accuracy and consistency of phased results, system response time, etc. Through these evaluations, the bottlenecks and optimization points of the system can be identified and continuously improved during the deployment and maintenance of the system.

[0170] Security and Privacy Protection:

[0171] Since the system processes sensitive medical data, the present invention pays special attention to the security and privacy protection of data. The system is designed with multi-level security measures, including data encryption, access control, log monitoring, etc., to ensure the security of data during transmission and storage. The above is a detailed description of the implementation of the present invention in conjunction with the accompanying drawings, but the present invention is not limited to the above implementation. Various changes can be made within the knowledge of those skilled in the art without departing from the purpose of the present invention.

Claims

1. A method for predicting TNM staging in clinical texts using a large language model, characterized in that: The following steps are involved: Data acquisition and preprocessing: collecting and preprocessing clinical text data; Fine-tuning of large language model instructions, collecting specific instruction data for fine-tuning model instructions, and adjusting model parameters of the large language model based on the collected instruction data; Clinical text preprocessing: input the preprocessed text data into the large language model for text parsing and feature extraction, extracting the core medical event information related to TNM staging, including standardizing the time expression in the text to unify the time nodes of the event, supporting time series analysis, extracting quantitative information in the text and standardizing the units; Medical event extraction, using a fine-tuned large language model to automatically extract medical event information related to TNM staging from clinical texts; TNM staging results are generated based on the processed and verified medical event information, including the medical event information extracted through comprehensive analysis, and the specific stages of primary tumors, lymph nodes and distant metastases are determined item by item according to the TNM staging standards; in the process of generating TNM staging results, the individual differences of patients are taken into consideration and personalized staging adjustments are made; an explainable description is provided for the generated TNM staging results, in which the explainable description provided includes a detailed description of the basis for each stage judgment and the corresponding clinical evidence; JSON formatted output: the generated TNM staging results are formatted into standardized JSON format for output.

2. The method for predicting TNM staging in clinical texts using a large language model according to claim 1, characterized in that: When collecting and preprocessing clinical text data, including removing irrelevant information, segmenting the data, removing stop words, and standardizing medical terms, we obtain text data suitable for model processing, including: Joint processing of structured and unstructured data; Standardize medical terms and diagnosis names, including annotating and mapping text using standard medical coding systems such as SNOMEDCT and ICD-10.

3. The method for predicting TNM staging in clinical texts using a large language model according to claim 2, characterized in that: When fine-tuning the instructions of the large language model and adjusting the model parameters based on the collected instruction data, the following steps are included: The large language model is optimized through supervised learning methods, enabling the model to accurately recognize and process specific medical terms and clinical scenarios related to TNM staging; Fine-tune the model using a dataset containing annotations from medical domain experts.

4. The method for predicting TNM staging in clinical texts using a large language model according to claim 3, characterized in that: When using the fine-tuned large language model to automatically extract medical event information related to TNM staging from clinical text, the following steps are included: Entity recognition and relationship extraction techniques are used to extract key information, including tumor location, lymph node status, and metastasis sites; A multi-task learning framework is used to combine other diagnostic information for comprehensive event extraction and analysis.

5. The method for predicting TNM staging in clinical texts using a large language model according to claim 4, characterized in that: The initial processing and screening of the extracted medical event information includes the following steps: Based on pre-defined medical rules and knowledge graphs, the extracted events are logically checked and verified; Provide an interactive manual correction mechanism to correct suspected errors and conflicting information; Preliminary event processing and screening: preliminary processing and screening of extracted medical event information; Prompt word engineering optimization: optimize the input prompt words through the prompt word engineering module; Combined with the RAG technical framework, clinical guidelines for different types of cancer are input.

6. The method for predicting TNM staging in clinical texts using a large language model according to claim 5, characterized in that: When the input prompt word is optimized by the prompt word engineering module, the following steps are included: Iteratively adjust and optimize the input prompt words, combine context information, and automatically generate more accurate prompt words for different types of clinical text scenarios; Use natural language processing technology to analyze successful cases in historical data and automatically generate and recommend the most appropriate prompt words.

7. The method for predicting TNM staging in clinical texts using a large language model according to claim 6, characterized in that: When combining the RAG technical framework to input clinical guidelines for different cancer types, the following steps are included: Use search enhancement generation technology to search the database for clinical guidelines and the latest literature that best matches the current patient's condition; During the search process, the search scope and weight are adjusted dynamically to generate the optimal TNM staging recommendation based on the patient's specific condition and search results; The generated TNM staging results were compared with the standard answers in the expert knowledge base to verify the accuracy and rationality of the TNM staging results.

8. The method for predicting TNM staging in clinical texts using a large language model according to claim 7, characterized in that: When the generated TNM staging results are formatted into a standardized JSON format and the TNM staging results and their explanatory notes are output in a JSON format, the following steps are included; Supports custom JSON formatting rules to meet the integration requirements of different data systems; Add validation mechanism to JSON output.

9. A system for predicting TNM staging in clinical texts using a large language model that implements the method for predicting TNM staging in clinical texts using a large language model according to any one of claims 1 to 8, characterized in that: include: Data collection and preprocessing module, used to collect clinical text data and perform preprocessing; The instruction data collection module is used to collect and manage model instruction data and guide the application of the model in specific medical scenarios; Large language model instruction fine-tuning module, used to fine-tune the large language model; A clinical text preprocessing module, used to further process the input clinical text data, including performing text parsing and feature extraction; The medical event extraction module uses a fine-tuned large language model to extract medical events related to TNM staging from text; A preliminary event processing and screening module is used to screen and process the extracted event information; The prompt word engineering optimization module is used to optimize the input prompt words and improve the extraction ability and accuracy of the model; RAG technical framework module, used to optimize literature retrieval and staging results by combining retrieval enhancement generation technology; TNM staging result generation module, used to generate TNM staging results based on the extracted information and make personalized adjustments; The JSON formatted output module is used to format the installment results into JSON output.

10. The TNM staging prediction system in clinical texts based on a large language model according to claim 9, characterized in that: The data acquisition and preprocessing modules include: Data standardization unit, used to standardize clinical texts in different formats into a unified format; Data cleaning unit, used to detect and clean noise, redundant information and missing values ​​in the data; The instruction data acquisition module further includes: The instruction generation unit can automatically generate or recommend instruction data according to different medical scenarios to optimize the training effect of the model; An instruction management unit, used for managing and updating instruction data; The large language model instruction fine-tuning module further includes: Fine-tuning parameter optimization unit, used to adjust the hyperparameters of the model; Task adaptability enhancement unit, used to detect and adjust the adaptability of the model in different tasks; The clinical text preprocessing module further includes: Semantic analysis unit, used to analyze the semantic structure of the input text, identify and extract key medical terms and expressions; A text correction unit, which is used to detect and correct grammatical errors, typos, and other errors in the text that may affect the accuracy of extraction; Entity recognition unit, which is used to identify medical entities in text, including tumor type, location, and metastasis; A relation extraction unit is used to extract the relations between medical entities from the text and construct a medical event model based on the relations between medical entities; The preliminary event processing and screening module further includes: A data verification unit, used to perform logic verification on the extracted event information according to medical rules and standards; A data screening unit, used to screen the extracted events according to preset standards and exclude irrelevant and redundant information; The prompt word engineering optimization module further includes: A historical prompt word analysis unit is used to analyze historical usage data and optimize and generate new prompt words for different scenarios; A prompt word recommendation unit, used to automatically recommend the most appropriate prompt word based on the input text content and context information; The RAG technology framework module further includes: Literature search unit, used to search for the latest clinical guidelines and literature related to the current patient's condition; A search result optimization unit, used to analyze and optimize search results; The TNM staging result generation module further includes: A staging determination unit, used for making TNM staging determination based on the extracted event information; Personalized adjustment unit, used to personalize the TNM staging results according to the individual characteristics of the patient; The JSON formatting output module further includes: JSON building block, used to generate TNM staging results that conform to the specified JSON Schema; The data verification unit is used to verify the generated JSON data.

Citation Information

Cited By

  • LLM adaptive staging system based on dynamic staging module

    CN120356601A

  • Free text report processing method and system for nasopharynx cancer case information

    CN120874762A

  • Tumor patient clinical test matching system and method based on large language model and OCR technology

    CN120913728A

  • Personalized medical document oriented large language model agent construction method and system

    CN121096508A

  • Life cycle evaluation automatic modeling method based on large language model

    CN121351945A