Clinical research report automatic writing method and system, electronic equipment and storage medium
Through the combination of semantic prediction model and report generation model, the problem of difficult to understand user needs and generate high-quality reports in automatic report generation in clinical trials is solved, and the effect of dynamically adjusting the report content to meet user needs is achieved.
Patent Information
- Application Number
- CN202510019608.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-07
- Publication Date
- 2025-02-11
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the automatic report generation in the field of clinical trials, it is difficult to understand user needs and generate high-quality and personalized report content.
By obtaining user demand data sets, obtaining semantic prediction models based on semantic prediction training, training the initial report generation model in combination with clinical report data sets, and using report generation score data sets to optimize the final report generation model to ensure that the report content can be dynamically adjusted to meet user needs .
It realizes dynamic adjustment of report content according to user needs, and generates high-quality and personalized clinical research reports, which improves the efficiency and accuracy of report generation.
Smart Images

Figure CN119416746A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and specifically to a method, system, electronic device and storage medium for automatically writing clinical research reports. Background Art
[0002] In modern society, report writing is an indispensable part of every industry. Currently, the field of clinical trials faces the problem of large workload and low efficiency in report writing. Traditional clinical trial report writing relies heavily on manual work, which is time-consuming, labor-intensive and error-prone. With the development of artificial intelligence technology, automated report generation has become possible, but its specific application in the field of clinical trials is still immature. Automatic report generation technology aims to automatically generate reports that meet specific needs based on input data and preset rules through computer algorithms. However, existing automatic report generation technology still has many shortcomings in understanding user needs and generating high-quality reports.
[0003] In the current technical scenario, automatic report generation usually relies on template matching or simple rule engines. Although these methods perform well in generating reports in certain fixed formats, they often seem powerless when dealing with complex and changing user needs. The diversity and personalization of user needs make it difficult for existing technologies to provide high-quality report content that meets specific needs. In addition, traditional template matching methods make it difficult to dynamically adjust the generated content, and the generated clinical research reports are difficult to meet user needs.
[0004] Therefore, how to dynamically adjust the generated report content according to user needs has become a technical problem that needs to be solved urgently. Summary of the invention
[0005] The present application provides a method, system, electronic device and storage medium for automatically writing clinical research reports, which can dynamically adjust the content of the generated report according to user needs.
[0006] In a first aspect, the present application provides a method for automatically writing a clinical research report, the method comprising: obtaining a user demand data set; Based on the user demand data set, a preset base model is trained for semantic prediction to obtain a semantic prediction model; Obtain clinical report datasets; Training the semantic prediction model based on the clinical report dataset to obtain an initial report generation model; Get the preset report generation score data set; Training the initial report generation model based on the report generation score dataset to obtain a final report generation model; Obtain user report generation requirements; The user report generation requirement is input into the final report generation model, and the report content is output.
[0007] By adopting the above technical solution, by obtaining the user demand data set, the specific needs and preferences of the user can be accurately captured, thereby providing basic data support for the training and optimization of the subsequent model. By performing semantic prediction training on the preset base model based on the user demand data set, a semantic prediction model is obtained, so that the model can better understand and predict the semantics of user needs, so that the specific needs of the user can be accurately reflected when generating report content. By obtaining the clinical report data set, a large number of real report samples are provided to the model, so that the model can learn and master the structure, content and professional terminology of the clinical report. By training the semantic prediction model based on the clinical report data set, an initial report generation model is obtained, so that the model can learn and master the structure and content generation rules of the report, so as to initially have the ability to generate high-quality report content. By obtaining the preset report generation score data set, an evaluation standard for the quality of the generated report is provided to the model, which is convenient for the effective evaluation and optimization of the model generation quality in the subsequent training process. By training the initial report generation model based on the report generation score data set, the final report generation model is obtained, so that the model can self-evaluate and adjust according to the generation score, thereby continuously optimizing the report generation capability. By obtaining the user's report generation requirements, the user's needs and expectations in the specific report generation process are clarified to ensure that the generated report content can be dynamically adjusted according to user needs.
[0008] Optionally, the user demand data set includes multiple user demand statements; the preset base model includes a text shielding sub-model and an autoregressive training sub-model; and the semantic prediction training of the preset base model based on the user demand data set to obtain the semantic prediction model specifically includes: Based on the plurality of user demand statements, obtaining a user demand statement set; Inputting the user demand statement set into the text shielding sub-model to obtain a shielded input sequence; Training the text masking sub-model based on the masked input sequence to obtain an intermediate semantic prediction model; The output result of the intermediate semantic prediction model is used as input to train the autoregressive training sub-model to obtain the semantic prediction model.
[0009] By adopting the above technical solution, a user demand statement set is obtained based on multiple user demand statements, thereby converting the user demand data into a vector representation that can be processed by the model. By inputting the user demand statement set into the text shielding sub-model, a shielded input sequence is obtained, so that the model can learn and understand the contextual relationship and semantic structure in the sentence. By training the text shielding sub-model based on the shielded input sequence, an intermediate semantic prediction model is obtained, so that the model can grasp the relationship between the word and its context by predicting the content of the shielded words. By using the output result of the intermediate semantic prediction model as input, the autoregressive training sub-model is trained to obtain a semantic prediction model, so that the model can further optimize and refine the understanding and prediction capabilities of the sequence context.
[0010] Optionally, obtaining a user demand statement set based on the multiple user demand statements specifically includes: Performing word segmentation processing on the plurality of user demand sentences to generate a plurality of word sequences; Performing standardization processing on each of the word sequences to obtain a standardized word sequence; The standardized word sequence is converted into a vector representation to generate the user demand statement set.
[0011] Optionally, the training of the text shielding sub-model based on the shielded input sequence to obtain an intermediate semantic prediction model specifically includes: For each of the masked input sequences, the text masking sub-model predicts the content of the masked words according to the context information and generates a prediction output; Calculating the difference between the predicted output and the actual blocked word based on the loss function, and calculating the first gradient of the loss function; Based on the first gradient, the model parameters of the text shielding sub-model are updated through the back propagation algorithm, and the text shielding sub-model predicts the content of the shielded words according to the context information for each shielded input sequence, and generates a predicted output; based on the loss function, the difference between the predicted output and the actual shielded words is calculated, and the first gradient of the loss function is calculated; based on the first gradient, the model parameters of the text shielding sub-model are updated through the back propagation algorithm until the value of the loss function reaches a preset convergence condition, thereby obtaining the intermediate semantic prediction model.
[0012] Optionally, the training of the semantic prediction model based on the clinical report dataset to obtain an initial report generation model specifically includes: Preprocessing the clinical report data set to obtain a preprocessed clinical report data set; Annotating the preprocessed clinical report data set to obtain an annotated clinical report data set; Inputting the training set into the semantic prediction model for training to obtain a predicted clinical report; Calculating the difference between the predicted clinical report and the actual clinical report in the preprocessed clinical report data set to obtain a first loss value; The second gradient of the first loss value is calculated by a back-propagation algorithm, and the model parameters of the semantic prediction model are adjusted based on the second gradient to obtain the initial report generation model.
[0013] By adopting the above technical solution, the clinical report data set is preprocessed to obtain a preprocessed clinical report data set, thereby cleaning and standardizing the data and removing noise and redundant information. By annotating the preprocessed clinical report data set, an annotated clinical report data set is obtained, so that the data set is more structured and informative. By inputting the training set into the semantic prediction model for training, a predicted clinical report is obtained, so that the model learns and masters the structure and content generation rules of the clinical report. By calculating the difference between the predicted clinical report and the real clinical report in the preprocessed clinical report data set, a first loss value is obtained, thereby quantifying the accuracy of the model prediction. The second gradient of the first loss value is calculated by the back propagation algorithm, and the model parameters of the semantic prediction model are adjusted based on the second gradient to obtain the initial report generation model, thereby continuously optimizing the model parameters and reducing the prediction error.
[0014] Optionally, the report generation score dataset includes multiple clinical reports and actual quality scores corresponding to the clinical reports; and the training of the initial report generation model based on the report generation score dataset to obtain the final report generation model specifically includes: Inputting each of the clinical reports into the initial report generation model to obtain a prediction quality score corresponding to each of the clinical reports; Obtaining a second loss value based on each of the actual quality scores and each of the predicted quality scores; The third gradient of the second loss value is calculated by a back-propagation algorithm, and the model parameters of the initial report generation model are adjusted based on the third gradient to obtain the final report generation model.
[0015] By adopting the above technical solution, each clinical report is input into the initial report generation model to obtain the prediction quality score corresponding to each clinical report, thereby evaluating the generation ability of the model. Based on each actual quality score and each predicted quality score, a second loss value is obtained to quantify the difference between the model prediction and the actual result. The third gradient of the second loss value is calculated by the back propagation algorithm, and the model parameters of the initial report generation model are adjusted based on the third gradient to obtain the final report generation model, thereby continuously optimizing and improving the model.
[0016] Optionally, inputting each of the clinical reports into the initial report generation model to obtain a prediction quality score corresponding to each of the clinical reports specifically includes: The predicted quality score is calculated by the following formula: ; Among them, Q i is the prediction quality score corresponding to the ith clinical report, A i is the data completeness score corresponding to the ith clinical report, M i is the accuracy score of the method description corresponding to the ith clinical report, R i is the result consistency score corresponding to the ith clinical report, D i is the logic score corresponding to the ith clinical report, S i is the rationality score of the statistical analysis corresponding to the ith clinical report, C i is the relevance score of the reference corresponding to the ith clinical report, F i is the standardization score of the reporting format of the referenced literature corresponding to the ith clinical report, α 1 is the first weight, α 2 is the second weight, α 3 is the third weight, α 4 is the fourth weight, α 5 is the fifth weight; The obtaining a second loss value based on each of the actual quality scores and each of the predicted quality scores specifically includes: The second loss value is calculated by the following formula: ; Wherein, L is the second loss value, N is the number corresponding to the clinical report, Q i is the prediction quality score corresponding to the ith clinical report, T i is the actual quality score corresponding to the ith clinical report.
[0017] In a second aspect of the present application, a clinical research report automatic writing system is provided, the system comprising: an acquisition module, a model building module and a processing module; The acquisition module is used to acquire a user demand data set; The model building module is used to perform semantic prediction training on a preset base model based on the user demand data set to obtain a semantic prediction model; The acquisition module is also used to acquire a clinical report data set; The model building module is further used to train the semantic prediction model based on the clinical report data set to obtain an initial report generation model; The acquisition module is further used to acquire a preset report generation score data set; The model building module is further used to train the initial report generation model based on the report generation score data set to obtain a final report generation model; The acquisition module is also used to obtain user report generation requirements; The processing module is used to input the user report generation requirement into the final report generation model and output the report content.
[0018] In the third aspect of the present application, an electronic device is provided, including a processor, a memory, a user interface and a network interface, the memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device executes any method as described in the first aspect of the present application.
[0019] In a fourth aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program that can be loaded by a processor and execute the method as described in any one of the first aspects of the present application.
[0020] In summary, one or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: By obtaining the user demand data set, the specific needs and preferences of users can be accurately captured, thereby providing basic data support for the training and optimization of subsequent models. By performing semantic prediction training on the preset base model based on the user demand data set, a semantic prediction model is obtained, so that the model can better understand and predict the semantics of user needs, so that the specific needs of users can be accurately reflected when generating report content. By obtaining the clinical report data set, a large number of real report samples are provided to the model, so that the model can learn and master the structure, content and professional terminology of clinical reports. By training the semantic prediction model based on the clinical report data set, an initial report generation model is obtained, so that the model can learn and master the structure and content generation rules of the report, so as to initially have the ability to generate high-quality report content. By obtaining the preset report generation score data set, the model is provided with an evaluation standard for the quality of generated reports, which is convenient for effective evaluation and optimization of the model generation quality in the subsequent training process. By training the initial report generation model based on the report generation score data set, the final report generation model is obtained, so that the model can self-evaluate and adjust according to the generation score, so as to continuously optimize the report generation capability. By obtaining the user report generation requirements, the user's needs and expectations in the specific report generation process are clarified, ensuring that the generated report content can be dynamically adjusted according to user needs. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 This is one of the flow charts of a method for automatically writing a clinical research report provided in an embodiment of the present application; Figure 2 This is the second flow chart of a method for automatically writing a clinical research report provided in an embodiment of the present application; Figure 3 This is the third flow chart of a method for automatically writing a clinical research report provided in an embodiment of the present application; Figure 4 It is a structural schematic diagram of a clinical research report automatic writing system provided in an embodiment of the present application; Figure 5 It is a structural schematic diagram of an electronic device disclosed in an embodiment of the present application.
[0022] Explanation of the accompanying drawings: 1. Acquisition module; 2. Model building module; 3. Processing module; 500. Electronic device; 501. Processor; 502. Communication bus; 503. User interface; 504. Network interface; 505. Memory. DETAILED DESCRIPTION
[0023] In order to enable technicians in this field to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments.
[0024] In the description of the embodiments of the present application, words such as "for example" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "for example" or "for example" is intended to present related concepts in a specific way.
[0025] In the description of the embodiments of the present application, the meaning of the term "multiple" refers to two or more. For example, multiple systems refer to two or more systems, and multiple screen terminals refer to two or more screen terminals. In addition, the terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Thus, the features defined as "first" and "second" can explicitly or implicitly include one or more of the features. The terms "include", "comprise", "have" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.
[0026] This application provides a method for automatically writing a clinical research report, referring to Figure 1 , which shows one of the flow charts of a method for automatically writing a clinical research report provided in an embodiment of the present application. The method includes steps S1-S8, which are as follows: Step S1: Obtain user demand data set.
[0027] Specifically, the user requirement dataset includes multiple user requirement statements.
[0028] Understanding user needs is a crucial step in the process of automatically generating high-quality clinical trial reports. By obtaining user demand data sets, we can accurately capture users' specific needs for report content, format, details, etc., thereby providing basic data support for subsequent model training and optimization. The key to this step is to record and analyze user needs in detail to ensure that the generated reports meet user expectations and industry standards.
[0029] First, collect user demand data through various channels (such as questionnaires, interviews, user feedback, etc.). This data usually exists in the form of natural language and contains the user's specific requirements for the report, such as which key data the report should include, which statistical methods to use, the structure and format requirements of the report, etc. In order to better process and use this data, it needs to be structured.
[0030] Specifically, the collected user demand statements are first segmented. The segmentation process breaks down each user demand statement into multiple word sequences, which helps to analyze the important information in each statement more accurately. Next, these word sequences are standardized to remove irrelevant characters such as stop words and punctuation marks, and convert the words into a unified form, such as converting all words to lowercase. This step ensures the consistency and processability of the data.
[0031] Subsequently, the standardized word sequence is converted into a vector representation. Vector representation is a method of converting text data into numerical data so that it can be processed by machine learning models. In this process, word embedding technology (such as Word2Vec or GloVe) is usually used to map each word into a high-dimensional vector space to generate a set of user demand statements.
[0032] Through the above steps, the user demand dataset is converted from the original natural language form into a structured and processable vector representation. These data will be used as a basis to input into the subsequent text masking sub-model and autoregressive training sub-model for semantic prediction training.
[0033] Step S2: Perform semantic prediction training on the preset base model based on the user demand data set to obtain a semantic prediction model.
[0034] In the process of generating high-quality clinical trial reports, it is crucial to ensure that the model can accurately understand and predict the semantics of user needs. This step generates a semantic prediction model that can understand and predict user needs by training the preset base model for semantic prediction. The preset base model includes a text masking sub-model and an autoregressive training sub-model.
[0035] In one possible implementation, refer to Figure 2 , which shows the second flow chart of a method for automatically writing a clinical research report provided in an embodiment of the present application. Step S2 specifically includes steps S21-S24: Step S21: Based on multiple user demand statements, a user demand statement set is obtained.
[0036] In a possible implementation, step S21 specifically includes the following steps: Perform word segmentation on multiple user demand sentences to generate multiple word sequences; Performing standardization processing on each word sequence to obtain a standardized word sequence; The standardized word sequence is converted into a vector representation to generate a set of user demand statements.
[0037] Specifically, first, multiple user demand statements are segmented. This step breaks down the user demand statements into multiple word sequences, which helps to analyze the key information in each statement more accurately. For example, the sentence "The report should include test methods and results" is broken down into the words "report", "should", "include", "test methods", "and", and "results". Through word segmentation, complex natural language can be converted into word units that are easier to handle.
[0038] Next, each word sequence is standardized to obtain a standardized word sequence. Standardization includes removing irrelevant characters such as stop words and punctuation marks, and converting all words to a unified form (such as converting all words to lowercase). This process ensures the consistency and processability of the data. For example, "report" and "report." are unified as "report", and "test method" and "test method" are unified as "test method". Through standardization, noise and inconsistency in the text can be eliminated, and the stability of the model in processing data can be enhanced.
[0039] Then, the standardized word sequence is converted into a vector representation to generate a set of user demand statements. Vector representation is a method of converting text data into numerical data so that it can be processed by machine learning models. In this process, word embedding technology (such as Word2Vec or GloVe) is usually used to map each word into a high-dimensional vector space. For example, the word "report" may be mapped to a vector of length 100 [0.1, 0.2, ..., 0.5]. Through vector representation, text data can be converted into a numerical form that the model can understand and process.
[0040] Through the above steps, the user demand dataset is converted from the original natural language form to a structured and processable vector representation. These vector-represented user demand statement sets will serve as the basic data input for subsequent model training, helping the model to accurately capture and understand the user's specific needs during the training process.
[0041] Step S22: Input the user demand statement set into the text masking sub-model to obtain a masked input sequence.
[0042] Specifically, first, the user demand sentence set is a dataset that has been segmented, normalized, and represented by vectors. These vector-represented sentence sets provide structured numerical data that can be efficiently processed by the model. The purpose of inputting these user demand sentence sets into the text masking sub-model is to allow the model to learn the contextual information and semantic structure of the sentence by predicting the masked words during the training process.
[0043] Specifically, the text masking sub-model randomly masks some words in the input sequence, and then predicts the content of the masked words based on the context information. For example, for the input sequence "Clinical trial reports should include ___ and results", the text masking sub-model will try to predict the masked word "method" based on the context information. In this way, the model can learn the relationship between words and their context, thereby enhancing its ability to understand semantics.
[0044] In this process, the masking operation is the key. The masked input sequence not only retains the semantic structure of the original sentence, but also introduces the position of the masked words that need to be predicted. For example, the input sentence "The report should include the test methods and results" may become "The report should include ___ and results" after masking, where "test methods" is masked. Through this processing, the model needs to predict "test methods" based on contextual information, so as to learn the semantic relationship between words in the sentence.
[0045] The purpose of generating masked input sequences is to enhance the semantic prediction ability of the model during training. The masked input sequences provide a challenge that forces the model to fill in the missing information through context during training. This approach effectively simulates the need for semantic understanding and prediction in real applications and improves the performance of the model in real scenarios.
[0046] By inputting a set of user demand statements into the text masking sub-model and generating a masked input sequence, the model can continuously learn and optimize its understanding and prediction capabilities of semantic structure during the training process. Specifically, by randomly masking words and requiring the model to make predictions based on the context, the model can capture the complex relationship between words and context, thereby improving the accuracy of semantic predictions and the quality of generated reports. Ultimately, this process provides a solid foundation for generating high-quality clinical trial reports, ensuring that the model can accurately understand and meet user needs.
[0047] Step S23: training the text masking sub-model based on the masked input sequence to obtain an intermediate semantic prediction model.
[0048] In a possible implementation, step S23 specifically includes the following steps: For each masked input sequence, the text masking sub-model predicts the content of the masked words based on the context information and generates a predicted output; Calculate the difference between the predicted output and the actual masked words based on the loss function, and calculate the first gradient of the loss function; Based on the first gradient, the model parameters of the text shielding sub-model are updated through the back propagation algorithm, and the text shielding sub-model predicts the content of the shielded words according to the context information for each shielded input sequence, and generates a predicted output; based on the loss function, the difference between the predicted output and the actual shielded words is calculated, and the first gradient of the loss function is calculated; based on the first gradient, the model parameters of the text shielding sub-model are updated through the back propagation algorithm, until the value of the loss function reaches a preset convergence condition, and an intermediate semantic prediction model is obtained.
[0049] First, the masked input sequence is trained. The masked input sequence is the result of randomly masking some words in the user demand sentence set. The task of the text masking sub-model is to predict these masked words based on contextual information. For example, in the input sequence "Clinical trial reports should include ___ and results", the model needs to predict the masked word "method" based on the context.
[0050] During the training process, each masked input sequence is first processed. The text masking sub-model predicts the content of the masked words based on the context information and generates a predicted output. Next, the difference between the predicted output and the actual masked words is calculated. This step is achieved through the loss function. The loss function is used to measure the accuracy of the model's prediction. Commonly used loss functions include cross entropy loss, etc.
[0051] Based on the calculation result of the loss function, the first gradient of the loss function is further calculated. The gradient calculation is to determine the adjustment direction and amplitude of the model parameters. Then, the model parameters of the text shielding sub-model are updated through the back propagation algorithm. The back propagation algorithm is an efficient optimization method that calculates the gradient of the loss function and updates the parameters of the model layer by layer to minimize the value of the loss function.
[0052] The above process will be repeated until the value of the loss function reaches the preset convergence condition. In other words, the prediction error of the model has dropped to an acceptable range, and further training can no longer significantly reduce the value of the loss function. In this way, an optimized intermediate semantic prediction model is obtained.
[0053] Step S24: using the output result of the intermediate semantic prediction model as input, training the autoregressive training sub-model, and obtaining the semantic prediction model.
[0054] First, the intermediate semantic prediction model has acquired certain semantic prediction capabilities after previous training. Its output contains a preliminary semantic understanding of the user's demand statement. These output results will serve as the input of the autoregressive training sub-model. The goal of the autoregressive training sub-model is to gradually optimize the understanding and prediction capabilities of the sequence context in a recursive manner.
[0055] Specifically, the output of the intermediate semantic prediction model is input into the autoregressive training sub-model. The autoregressive training sub-model inputs words sequentially from the beginning of the sequence and trains the model to predict the next word in the sequence. For example, given a partial input sequence "Clinical trial reports should include", the model needs to predict that the next word may be "method". The predicted word is then used as the input for the next step to continue predicting subsequent words. In this way, the model can gradually learn and master the semantic structure and contextual relationship of the entire sequence.
[0056] During the training process, the autoregressive training sub-model processes the input sequence recursively and continuously optimizes the model parameters. First, the difference between the predicted output and the actual word at each step is calculated, and the accuracy of the prediction is measured using an appropriate loss function (such as cross entropy loss). Then, the gradient of the loss function is calculated through the back-propagation algorithm, and the model parameters are updated based on the gradient. This process is repeated until the prediction error of the model reaches the preset convergence condition.
[0057] Step S3: Obtain clinical report dataset.
[0058] Among them, the clinical report data set refers to a collection of clinical research reports that have been professionally screened and standardized. These reports contain key elements such as complete research background, research methods, statistical analysis, research results and discussions, and have been reviewed and published in medical journals with high recognition. In the embodiment of the present application, it can be understood as a structured data set consisting of multiple clinical research reports, each of which contains standardized formats and terms, and is classified and labeled according to dimensions such as research type, disease field, and research methods. Specifically, each report in the data set has been processed by format unification, terminology standardization, and measurement unit unification, and personal privacy information has been removed, while retaining the professionalism and integrity of the report.
[0059] For example, clinical report data include: Randomized controlled trial (RCT) reports, such as clinical trial reports evaluating the efficacy of a new antihypertensive drug, which record in detail the trial design, patient grouping, dosing regimen, blood pressure monitoring data, adverse reaction records, and statistical analysis results. For example, a randomized double-blind controlled trial report comparing a new angiotensin-converting enzyme inhibitor with traditional antihypertensive drugs in the treatment of essential hypertension.
[0060] Cohort study reports, such as prospective study reports on long-term follow-up of patients with type 2 diabetes, include information on patient baseline characteristics, follow-up plans, complication occurrence, quality of life assessment, and prognostic analysis. For example, a large-scale cohort study report that followed 2,000 patients with type 2 diabetes for 10 years focused on the incidence and risk factors of cardiovascular complications.
[0061] Case-control study reports, such as retrospective analysis reports on the risk factors of a certain cancer, include the selection criteria for the case and control groups, exposure factor assessment, statistical analysis methods, and research conclusions, etc. For example, a multicenter case-control study report on the relationship between smoking and lung cancer involved 1,500 lung cancer patients and 1,500 matched controls.
[0062] Cross-sectional research reports, such as a report on the epidemiological survey of chronic diseases in a certain region, record the survey methods, sample selection, questionnaire design, field survey process and statistical results, etc. For example, a cross-sectional survey report on the prevalence of hypertension, diabetes and hyperlipidemia among residents of a certain province or city.
[0063] Drug clinical trial reports, such as the phase-by-phase research reports of new drug clinical trials, describe in detail the drug safety, effectiveness evaluation indicators, adverse reaction monitoring, statistical analysis methods, etc. For example, a phase II clinical trial report of a new anti-tumor drug records the safety and preliminary efficacy data of the drug in specific cancer patients.
[0064] Specifically, first, a large amount of clinical report data is collected from different medical institutions, clinical trial databases and research literature. These data include various clinical trial reports, such as drug trials, treatment effect evaluations, case studies, etc. The collected data should cover clinical trial reports of different types, stages and fields to ensure the diversity and representativeness of the data set.
[0065] The purpose of obtaining clinical report datasets is to provide a large amount of sample data required for model training. Through these data, the model can learn and master the standard format, writing specifications, data presentation methods, and common medical terms and expressions of clinical reports. For example, clinical reports usually include abstracts, introductions, methods, results, discussions, and conclusions, each of which has its own specific writing specifications and requirements.
[0066] In the process of obtaining clinical report datasets, data preprocessing and cleaning are also required to ensure data quality and consistency. First, remove irrelevant information and noise in the report, such as repeated content, blank pages, format errors, etc. Then, perform text standardization, including converting all texts into a unified format, eliminating grammatical and spelling errors, and using medical terminology in a unified manner. This step ensures the consistency and processability of the data, making it more suitable for model training.
[0067] Step S4: Train the semantic prediction model based on the clinical report dataset to obtain an initial report generation model.
[0068] In a possible implementation, step S4 specifically includes the following steps: The clinical report data set is preprocessed to obtain a preprocessed clinical report data set.
[0069] The preprocessed clinical report dataset is labeled to obtain a labeled clinical report dataset.
[0070] The training set is input into the semantic prediction model for training to obtain a predicted clinical report.
[0071] The difference between the predicted clinical report and the actual clinical report in the preprocessed clinical report dataset is calculated to obtain a first loss value.
[0072] The second gradient of the first loss value is calculated by a back-propagation algorithm, and the model parameters of the semantic prediction model are adjusted based on the second gradient to obtain an initial report generation model.
[0073] Specifically, first, the collected clinical report datasets are preprocessed to ensure the quality and consistency of the data. Preprocessing includes removing irrelevant information and noise in the reports, such as duplicate content, blank pages, and format errors. Then, the text is standardized, including converting all texts into a unified format, eliminating grammatical and spelling errors, and using medical terminology in a unified manner. This step ensures the consistency and processability of the data, making it more suitable for model training.
[0074] Next, the preprocessed clinical report dataset is annotated to obtain the annotated clinical report dataset. The annotated content includes the various parts of the report, such as the abstract, introduction, methods, results, discussion and conclusion, as well as the key elements and structure of each part. This step enables the model to better understand and learn the writing standards and logical structure of clinical reports.
[0075] The annotated clinical report dataset is divided into a training set and a validation set. The training set is used to train the semantic prediction model, while the validation set is used to evaluate the performance of the model. During the training process, the training set is input into the semantic prediction model, and the model gradually learns the structure and content of the report and continuously optimizes the model parameters by predicting the next word, sentence or paragraph.
[0076] During the training process, the first loss value is obtained by calculating the difference between the predicted clinical report and the real clinical report in the preprocessed clinical report dataset. The loss value is used to measure the accuracy and consistency of the model prediction. Commonly used loss functions include cross entropy loss. Then, the second gradient of the first loss value is calculated by the back propagation algorithm, and the model parameters of the semantic prediction model are adjusted based on the second gradient. This process is repeated until the prediction error of the model reaches the preset convergence condition.
[0077] In this way, the model can gradually learn and master the writing standards and logical structure of clinical reports, thereby generating a high-quality initial report generation model. Through continuous adjustment and optimization during the training process, the model can accurately predict each part of the clinical report and improve the accuracy and professionalism of the generated report.
[0078] Step S5: Obtain a preset report generation score data set.
[0079] Specifically, the report generation score dataset includes multiple clinical reports and actual quality scores corresponding to the clinical reports.
[0080] First, clinical reports and their corresponding actual quality scores are obtained from multiple sources. The sources of clinical reports can include medical institutions, clinical trial databases, academic journals, and research literature. These clinical reports should cover clinical trials of different types, stages, and fields to ensure the diversity and representativeness of the data set. The actual quality scores are usually scored by professional reviewers based on multiple dimensions such as the accuracy, completeness, logic, and standardization of the reports. By collecting these scoring data, clear quality standards can be provided for the model.
[0081] The purpose of obtaining the report generation score dataset is to establish an evaluation and feedback mechanism so that the model can adjust and optimize itself based on these scoring data, thereby continuously improving the quality of report generation. In this way, the model can learn which report structures and contents can get high scores, so that these structures and contents are given priority when generating new reports. Then, the preprocessed clinical reports and actual quality scores are stored in a unified dataset to form a report generation score dataset.
[0082] Step S6: Train the initial report generation model based on the report generation score dataset to obtain the final report generation model.
[0083] In the process of generating high-quality clinical trial reports, training the initial report generation model based on the report generation score dataset to obtain the final report generation model is a key step. Through this step, the model can continuously optimize and improve its report generation capabilities, thereby ensuring that the generated reports meet the expected quality standards.
[0084] In one possible implementation, refer to Figure 3 , which shows the third flow chart of a method for automatically writing a clinical research report provided in an embodiment of the present application. Step S6 specifically includes steps S61-S63: Step S61: Input each clinical report into the initial report generation model to obtain a prediction quality score corresponding to each clinical report.
[0085] In a possible implementation, step S61 calculates the predicted quality score using the following formula: ; Among them, Q i is the prediction quality score corresponding to the ith clinical report, A i is the data integrity score corresponding to the i-th clinical report, M i is the accuracy score of the method description corresponding to the i-th clinical report, R i is the result consistency score corresponding to the ith clinical report, D i is the logic score corresponding to the ith clinical report, S i is the rationality score of the statistical analysis corresponding to the ith clinical report, C i is the relevance score of the cited literature corresponding to the ith clinical report, F i is the standardization score of the reporting format of the referenced literature corresponding to the i-th clinical report, α 1 is the first weight, α 2 is the second weight, α 3 is the third weight, α 4 is the fourth weight, α 5 The fifth weight.
[0086] Specifically, in the process of generating high-quality clinical trial reports, inputting each clinical report into the initial report generation model to obtain the corresponding prediction quality score of each clinical report is a key step in evaluating and optimizing model performance. Through this process, the model's predictive ability for clinical report generation can be quantified, thus providing a basis for further model optimization.
[0087] First, the initial report generation model is based on a previously trained and optimized semantic prediction model. By learning a large number of clinical report data sets, it has acquired certain report generation capabilities. In order to further evaluate and optimize the model, it is necessary to input actual clinical reports into the initial report generation model to generate the corresponding prediction quality score.
[0088] Specifically, each clinical report text is input into the initial report generation model. The model will gradually generate corresponding quality scores based on the input report content, including data completeness score, method description accuracy score, result consistency score, logic score, rationality score of statistical analysis, relevance score of cited literature and standardization score of report format. These scores represent the quality evaluation of the report in various dimensions.
[0089] In the formula of step S61, first, the data integrity score Ai is one of the important indicators for evaluating the quality of the report. Data integrity reflects the comprehensiveness and accuracy of the data in the report. The logarithmic function is used in the formula The purpose of processing the data integrity score is to reduce the impact of extreme values on the overall score while ensuring the importance of data integrity. The logarithmic function can compress the range of data integrity scores, making the impact of high and low scores smoother, thereby avoiding excessive impact of extreme scores in a single dimension on the overall score. The addition of a very small constant ϵ is to avoid the undefined situation of the logarithmic function and ensure the stability of the calculation.
[0090] Secondly, the method description accuracy score Mi, result consistency score Ri and logic score Di are key indicators reflecting the scientificity and rigor of the report. These scores are calculated by Sigmoid function. The Sigmoid function can map the linear combination of the input to the range of 0 to 1, providing a smooth nonlinear transformation. The purpose of this processing is to achieve a smooth transition between different scores, making the impact of high and low scores on the overall score more continuous and stable, and avoiding the instability caused by sudden changes in the score.
[0091] The rationality score Si of the statistical analysis is calculated by the square root function Statistical analysis is a crucial part of clinical trial reports, reflecting the scientificity and rigor of data analysis. The square root function can reduce the impact of larger scores and amplify the effect of smaller scores, so that the statistical analysis score has an appropriate weight in the overall score. This processing method ensures the importance of statistical analysis while avoiding excessive influence of high scores on the overall score.
[0092] The relevance score Ci of the cited literature and the standardization score Fi of the report format are also important components of the quality of clinical trial reports. The relevance of the cited literature is processed by direct linear weighting, while the standardization of the report format is processed by the hyperbolic tangent function The hyperbolic tangent function compresses the scores into the range of -1 to 1, providing a smooth nonlinear transformation. This processing method can effectively reduce the impact of extreme values and ensure that the scores in the report format play an appropriate role in the overall score.
[0093] Through the above design, the formula combines the scores of various dimensions to generate a unified quality score Qi, which is used to evaluate the overall quality of clinical trial reports. The scores of each dimension are processed by different mathematical functions to achieve reasonable evaluation and weight allocation of different quality indicators. This processing method can not only ensure the accuracy and stability of the score, but also reflect the comprehensive quality of the report in all aspects.
[0094] Step S62: Obtain a second loss value based on each actual quality score and each predicted quality score.
[0095] In a possible implementation manner, step S62 calculates the second loss value using the following formula: ; Among them, L is the second loss value, N is the number of clinical reports, Q i is the prediction quality score corresponding to the ith clinical report, T i is the actual quality score corresponding to the i-th clinical report.
[0096] Specifically, the actual quality score Ti is the result of professional reviewers scoring according to the various quality dimensions of the clinical report, which represents the true quality of the report. These actual quality scores provide an objective evaluation standard for the model. The goal of the model is to make the predicted quality score Qi as close to the actual quality score Ti as possible. Specifically, the second loss value L is calculated to quantify the difference between the model's predicted quality score and the actual quality score. The loss value L is calculated using the mean square error (MSE) formula. The purpose of this is to provide a quantitative evaluation standard. By calculating the difference between the actual quality score and the predicted quality score, the prediction accuracy of the model can be intuitively measured. As a commonly used loss function, the mean square error can effectively capture the deviation between the predicted value and the true value, and amplify the larger error by square error, ensuring that the model pays more attention to the optimization of high error samples.
[0097] By calculating the second loss value, the prediction error of the model in each dimension can be clearly identified, thus providing data support for subsequent model optimization. For example, if the loss value is large, it means that there is a large difference between the predicted quality score of the model and the actual quality score, and the model needs to be further optimized. If the loss value is small, it means that the prediction result of the model is more accurate and the model performance is better.
[0098] Step S63: Calculate the third gradient of the second loss value through the back propagation algorithm, and adjust the model parameters of the initial report generation model based on the third gradient to obtain the final report generation model.
[0099] Specifically, the back-propagation algorithm first calculates the error between each predicted quality score and the actual quality score, and then back-propagates these errors to each layer of the model to calculate the impact of each model parameter on the total loss value. This process is implemented through the chain rule, that is, the gradient of each layer is passed to the previous layer, so as to update the model parameters layer by layer. In this way, it can be determined which parameters need to be increased and which parameters need to be reduced to minimize the total loss value. After the gradient is calculated, the model parameters of the initial report generation model are adjusted based on these gradients. The specific method of parameter update can adopt the gradient descent algorithm or its variants (such as stochastic gradient descent, momentum gradient descent, or adaptive gradient descent, etc.). The gradient descent algorithm updates the model parameters through the following formula: θnew=θold−η⋅∇L; where θnew is the updated model parameter, θold is the current model parameter, η is the learning rate, which controls the step size of each update, and ∇L is the gradient of the loss value.
[0100] It should be noted that, based on the above embodiments, it also includes: in the process of model training and tuning, an unsupervised pre-training method is adopted. By training the model on a large amount of unlabeled data, such as medical textbooks, medical articles, etc., the model can learn rich language knowledge, semantic information and domain knowledge, etc., thereby improving the generalization ability and performance of the model. Unsupervised pre-training requires the algorithm to automatically learn some valuable information from large-scale unstructured data. Its essence is to learn the commonalities between various tasks from training data collected at low cost. Unsupervised pre-training adopts the training method of the language model, and generates each token in turn from left to right in a unidirectional manner. Tokens at all positions will be trained, so the training efficiency will be higher, and its pre-training tasks and downstream reasoning are completely consistent, and the text generation task effect will be better.
[0101] Supervised fine-tuning is also used. The main function of supervised fine-tuning is to use labeled data to adjust a pre-trained language model to make it more suitable for a specific task. This process usually involves using manually labeled data to fine-tune the large model using supervised learning methods in traditional machine learning. During the fine-tuning process, the weights of the model are adjusted according to the difference with the true label, so that the model can more accurately capture the patterns and characteristics of the labeled data that are specific to a certain task. In addition, the advantage of supervised fine-tuning is that it can use the parameters and structure of the pre-trained model to avoid training the model from scratch, thereby accelerating the training process of the model and improving the performance of the model on the target task. For example, through fine-tuning, the large model can better complete natural language processing tasks in specific fields, such as sentiment analysis, named entity recognition, text classification, etc. Different from unsupervised pre-training, the input data of supervised fine-tuning is instruction-response pair samples, and two types of supervised data sets are manually labeled, such as simple tasks: the annotator gives any simple task, while ensuring the diversity of the task. Few-shot learning tasks: the annotator gives an instruction and multiple queries-responses to the instruction.
[0102] It also uses LoRA-based instruction fine-tuning and LoRA-based multi-task training. Low-Rank Adaptation (LoRA) is a large model fine-tuning method that reduces the amount of model trainable parameters while minimizing the loss of model performance. The principle of LoRA is to fine-tune the weight parameters of the pre-trained LLM. Specifically, LoRA freezes the parameters of the original LLM, and then adds additional network layers to the model. During the model fine-tuning phase, only the parameters of the additional network layers are updated without updating the parameters of the original network layers. Since the LoRA default fine-tuning phase is a single task, the default LLM has a lower intrinsic dimension (that is, the minimum dimension required to solve the task) when fine-tuning on this single task, and this intrinsic dimension is often much smaller than the original dimension of the model. Therefore, LoRA can enable LLM to achieve an effect close to full parameter fine-tuning by only fine-tuning a small number of parameters.
[0103] Step S7: Obtain user report generation requirements.
[0104] Specifically, user report generation requirements can be obtained through a variety of channels. These channels can include questionnaires, user interviews, online feedback forms, and emails. The collected demand data usually exists in natural language form, covering the user's specific requirements for the content, format, details, and presentation of the report. For example, the user may want the report to include a detailed description of the test method, statistical analysis of the results, in-depth discussion of the discussion section, and the standardization of the references.
[0105] Step S8: Input the user report generation requirements into the final report generation model and output the report content.
[0106] Among them, the report content refers to the clinical research report document automatically generated by the final report generation model according to user needs, which contains complete standardized chapters such as research background, research methods, statistical analysis, research results and discussion, and is written in standardized professional terms and expressions. In the embodiment of the present application, it can be understood as a structured clinical research report text output by the final report generation model, which is organized in accordance with the requirements of the clinical research report specifications, including but not limited to core chapters such as abstract, introduction, materials and methods, results, discussion, and conclusion.
[0107] Exemplarily, the content of the report, i.e. the content of the clinical research report, can be the content of the drug clinical trial report, which mainly includes the overview of the new drug clinical trial, the screening and enrollment of subjects, the results of efficacy evaluation, safety analysis, etc. For example, the clinical trial report for a new antihypertensive drug covers the introduction of the drug's mechanism of action, the description of the experimental design plan, the analysis of the baseline characteristics of the subjects, the evaluation of the blood pressure control effect, the statistics of the occurrence of adverse reactions, the results of the drug safety evaluation, etc. The content of the medical device clinical validation report mainly includes device performance verification, safety evaluation, clinical application effect, etc. For example, the clinical validation report of a new blood glucose monitor includes the description of the equipment technical parameters, the validation test plan, the accuracy evaluation results, the use safety analysis, the user experience evaluation, etc.
[0108] Specifically, the user's report generation requirements are used as input data and input into the final report generation model. The final report generation model is an advanced model that has been optimized and trained many times and has strong semantic understanding and report generation capabilities. After receiving user requirements, the model first parses these requirements and identifies the key content and structure that the report needs to include. Then, based on the parsing results, the model combines its built-in semantic prediction and generation capabilities to gradually generate report content that meets user requirements.
[0109] In the process of generating the report content, the model will generate various parts of the report in sequence, including the abstract, introduction, methods, results, discussion and conclusions. The content of each part is adjusted and optimized according to the specific needs of the user. For example, if the user particularly emphasizes the detailed statistical analysis of the results, the model will generate more detailed statistical data and analysis charts in the results section; if the user requires the report to cite specific literature, the model will add the corresponding literature citations in the citation section.
[0110] When generating each part of the content, the model continuously optimizes the understanding and prediction capabilities of the sequence context through the recursive method of autoregressive training sub-models, thereby ensuring that the generated content is coherent and logical. At the same time, the model will also adjust the layout and format of the report according to the user's requirements for the report format to make it meet the user's expectations. For example, the report title, paragraphs, charts, and reference formats will all be customized and optimized according to user needs.
[0111] Reference Figure 4 , which shows a schematic diagram of the structure of a clinical research report automatic writing system provided in an embodiment of the present application, the system includes: an acquisition module 1, a model building module 2 and a processing module 3; Acquisition module 1, used to acquire user demand data set; Model building module 2, used for performing semantic prediction training on a preset base model based on a user demand data set to obtain a semantic prediction model; The acquisition module 1 is also used to acquire the clinical report data set; The model building module 2 is also used to train the semantic prediction model based on the clinical report dataset to obtain an initial report generation model; The acquisition module 1 is also used to obtain a preset report generation score data set; The model building module 2 is also used to train the initial report generation model based on the report generation score data set to obtain the final report generation model; The acquisition module 1 is also used to obtain the user's report generation requirements; Processing module 3 is used to input the user report generation requirements into the final report generation model and output the report content.
[0112] In a possible implementation, the model building module 2 is further used to obtain a user demand statement set based on multiple user demand statements; The model building module 2 is also used to input the user demand statement set into the text masking sub-model to obtain a masked input sequence; The model building module 2 is also used to train the text masking sub-model based on the masked input sequence to obtain an intermediate semantic prediction model; The model building module 2 is also used to take the output result of the intermediate semantic prediction model as input, train the autoregressive training sub-model, and obtain the semantic prediction model.
[0113] In a possible implementation, the model building module 2 is further used to perform word segmentation processing on multiple user demand sentences to generate multiple word sequences; The model building module 2 is also used to perform standardization processing on each word sequence to obtain a standardized word sequence; The model building module 2 is also used to convert the standardized word sequence into a vector representation to generate a set of user demand sentences.
[0114] In a possible implementation, the model building module 2 is further configured to, for each masked input sequence, predict the content of the masked words based on the context information by the text masking sub-model, and generate a prediction output; The model building module 2 is further used to calculate the difference between the predicted output and the actual blocked words based on the loss function, and calculate the first gradient of the loss function; The model building module 2 is also used to update the model parameters of the text shielding sub-model through the back propagation algorithm based on the first gradient, and repeatedly execute the steps of predicting the content of the shielded words according to the context information for each shielded input sequence, generating a predicted output; calculating the difference between the predicted output and the actual shielded words based on the loss function, and calculating the first gradient of the loss function; and updating the model parameters of the text shielding sub-model through the back propagation algorithm based on the first gradient, until the value of the loss function reaches a preset convergence condition, thereby obtaining an intermediate semantic prediction model.
[0115] In a possible implementation, the model building module 2 is further used to preprocess the clinical report data set to obtain a preprocessed clinical report data set; The model building module 2 is also used to annotate the preprocessed clinical report data set to obtain an annotated clinical report data set; The model building module 2 is also used to input the training set into the semantic prediction model for training to obtain a predicted clinical report; The model building module 2 is also used to calculate the difference between the predicted clinical report and the real clinical report in the preprocessed clinical report data set to obtain a first loss value; The model building module 2 is also used to calculate the second gradient of the first loss value through the back propagation algorithm, and adjust the model parameters of the semantic prediction model based on the second gradient to obtain the initial report generation model.
[0116] In a possible implementation, the model building module 2 is further used to input each clinical report into the initial report generation model to obtain a prediction quality score corresponding to each clinical report; The model building module 2 is further used to obtain a second loss value based on each actual quality score and each predicted quality score; The model building module 2 is also used to calculate the third gradient of the second loss value through the back propagation algorithm, and adjust the model parameters of the initial report generation model based on the third gradient to obtain the final report generation model.
[0117] In a possible implementation, the model building module 2 is further used to calculate the predicted quality score using the following formula: ; Among them, Q i is the prediction quality score corresponding to the ith clinical report, A i is the data integrity score corresponding to the i-th clinical report, M i is the accuracy score of the method description corresponding to the i-th clinical report, R i is the result consistency score corresponding to the ith clinical report, D i is the logic score corresponding to the ith clinical report, S i is the rationality score of the statistical analysis corresponding to the ith clinical report, C i is the relevance score of the cited literature corresponding to the ith clinical report, F i is the standardization score of the reporting format of the referenced literature corresponding to the i-th clinical report, α 1 is the first weight, α 2 is the second weight, α 3 is the third weight, α 4 is the fourth weight, α 5 is the fifth weight; The model building module 2 is also used to calculate the second loss value through the following formula: ; Among them, L is the second loss value, N is the number of clinical reports, Q i is the prediction quality score corresponding to the ith clinical report, T i is the actual quality score corresponding to the i-th clinical report.
[0118] It should be noted that: when the device provided in the above embodiment realizes its function, only the division of the above functional modules is used as an example. In actual application, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0119] The present application also discloses an electronic device. Figure 5 , Figure 5 The electronic device 500 may include: at least one processor 501 , at least one network interface 504 , a user interface 503 , a memory 505 , and at least one communication bus 502 .
[0120] The communication bus 502 is used to realize the connection and communication between these components.
[0121] The user interface 503 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 503 may also include a standard wired interface and a wireless interface.
[0122] The network interface 504 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0123] Among them, the processor 501 may include one or more processing cores. The processor 501 uses various interfaces and lines to connect various parts in the entire server, and executes various functions of the server and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 505, and calling data stored in the memory 505. Optionally, the processor 501 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 501 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processor (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 501, and it can be implemented separately through a chip.
[0124] Among them, the memory 505 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 505 includes a non-transitory computer-readable storage medium. The memory 505 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 505 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned method embodiments, etc.; the data storage area may store data involved in the above-mentioned method embodiments, etc. The memory 505 may optionally be at least one storage device located away from the aforementioned processor 501. Refer to Figure 5 , the memory 505 as a computer-readable storage medium may include an operating system, a network communication module, a user interface module and an application program.
[0125] exist Figure 5 In the electronic device 500 shown, the user interface 503 is mainly used to provide an input interface for the user and obtain the data input by the user; and the processor 501 can be used to call an application stored in the memory 505, and when executed by one or more processors 501, the electronic device 500 executes one or more methods in the above-mentioned embodiments. It should be noted that for the aforementioned method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required for the present application.
[0126] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0127] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0128] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0129] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0130] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: various media that can store program codes, such as USB flash drives, mobile hard drives, magnetic disks or optical disks.
[0131] The above are only exemplary embodiments of the present disclosure and cannot be used to limit the scope of the present disclosure. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the disclosure of the specification and practice, those skilled in the art will easily think of other embodiments of the present disclosure.
[0132] This application is intended to cover any variation, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the art not described in the present disclosure. The description and examples are to be regarded as exemplary only, and the scope and spirit of the present disclosure are defined by the claims.
Claims
1. A method for automatically writing a clinical research report, characterized in that: The method comprises: Obtain user demand data set; Based on the user demand data set, a preset base model is trained for semantic prediction to obtain a semantic prediction model; Obtain clinical report datasets; Training the semantic prediction model based on the clinical report dataset to obtain an initial report generation model; Get the preset report generation score data set; Training the initial report generation model based on the report generation score dataset to obtain a final report generation model; Obtain user report generation requirements; The user report generation requirement is input into the final report generation model, and the report content is output.
2. The method according to claim 1, characterized in that The user demand data set includes a plurality of user demand statements; the preset base model includes a text shielding sub-model and an autoregressive training sub-model; the semantic prediction training of the preset base model based on the user demand data set to obtain a semantic prediction model specifically includes: Based on the plurality of user demand statements, obtaining a user demand statement set; Inputting the user demand statement set into the text shielding sub-model to obtain a shielded input sequence; Training the text masking sub-model based on the masked input sequence to obtain an intermediate semantic prediction model; The output result of the intermediate semantic prediction model is used as input to train the autoregressive training sub-model to obtain the semantic prediction model.
3. The method according to claim 2, characterized in that The obtaining of a user demand statement set based on the plurality of user demand statements specifically includes: Performing word segmentation processing on the plurality of user demand sentences to generate a plurality of word sequences; Performing standardization processing on each of the word sequences to obtain a standardized word sequence; The standardized word sequence is converted into a vector representation to generate the user demand statement set.
4. The method according to claim 2, characterized in that: The training of the text shielding sub-model based on the shielded input sequence to obtain an intermediate semantic prediction model specifically includes: For each of the masked input sequences, the text masking sub-model predicts the content of the masked words according to the context information and generates a prediction output; Calculating the difference between the predicted output and the actual blocked word based on the loss function, and calculating the first gradient of the loss function; Based on the first gradient, the model parameters of the text shielding sub-model are updated through a back-propagation algorithm until the value of the loss function reaches a preset convergence condition, thereby obtaining the intermediate semantic prediction model.
5. The method according to claim 1, characterized in that The training of the semantic prediction model based on the clinical report data set to obtain an initial report generation model specifically includes: Preprocessing the clinical report data set to obtain a preprocessed clinical report data set; Annotating the preprocessed clinical report data set to obtain an annotated clinical report data set; Inputting the training set into the semantic prediction model for training to obtain a predicted clinical report; Calculating the difference between the predicted clinical report and the actual clinical report in the preprocessed clinical report data set to obtain a first loss value; The second gradient of the first loss value is calculated by a back-propagation algorithm, and the model parameters of the semantic prediction model are adjusted based on the second gradient to obtain the initial report generation model.
6. The method according to claim 1, characterized in that The report generation score dataset includes multiple clinical reports and actual quality scores corresponding to the clinical reports; the training of the initial report generation model based on the report generation score dataset to obtain the final report generation model specifically includes: Inputting each of the clinical reports into the initial report generation model to obtain a prediction quality score corresponding to each of the clinical reports; Obtaining a second loss value based on each of the actual quality scores and each of the predicted quality scores; The third gradient of the second loss value is calculated by a back-propagation algorithm, and the model parameters of the initial report generation model are adjusted based on the third gradient to obtain the final report generation model.
7. The method according to claim 6, characterized in that Inputting each of the clinical reports into the initial report generation model to obtain a prediction quality score corresponding to each of the clinical reports specifically includes: The predicted quality score is calculated by the following formula: ; Among them, Q i is the prediction quality score corresponding to the ith clinical report, A i is the data completeness score corresponding to the ith clinical report, M i is the accuracy score of the method description corresponding to the ith clinical report, R i is the result consistency score corresponding to the ith clinical report, D i is the logic score corresponding to the ith clinical report, S i is the rationality score of the statistical analysis corresponding to the ith clinical report, C i is the relevance score of the reference corresponding to the ith clinical report, F i is the standardization score of the report format of the referenced literature corresponding to the ith clinical report, α1 is the first weight, α2 is the second weight, α3 is the third weight, α4 is the fourth weight, and α5 is the fifth weight; The obtaining a second loss value based on each of the actual quality scores and each of the predicted quality scores specifically includes: The second loss value is calculated by the following formula: ; Wherein, L is the second loss value, N is the number corresponding to the clinical report, Q i is the prediction quality score corresponding to the ith clinical report, T i is the actual quality score corresponding to the ith clinical report.
8. A clinical research report automatic writing system, characterized in that: The system comprises: an acquisition module, a model building module and a processing module; The acquisition module is used to acquire a user demand data set; The model building module is used to perform semantic prediction training on a preset base model based on the user demand data set to obtain a semantic prediction model; The acquisition module is also used to acquire a clinical report data set; The model building module is further used to train the semantic prediction model based on the clinical report data set to obtain an initial report generation model; The acquisition module is further used to acquire a preset report generation score data set; The model building module is further used to train the initial report generation model based on the report generation score data set to obtain a final report generation model; The acquisition module is also used to obtain user report generation requirements; The processing module is used to input the user report generation requirement into the final report generation model and output the report content.
9. An electronic device, characterized in that: It includes a processor, a memory, a user interface and a network interface, the memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device executes the method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed, the method according to any one of claims 1 to 7 is performed.
Citation Information
Patent Citations
Language model-based image report generation method and system
CN116884559A
Automatic report generation method and device, computer equipment and storage medium
CN118211570A
Computer-implemented natural language understanding of medical reports
US20200334416A1