Method for generating high-quality data and method and device for training diagnosis and treatment auxiliary model and storage medium
By generating structured question-and-answer pairs and optimizing the training process, the semantic bias and logical mismatch issues of large-scale TCM vertical models in the Chinese language domain were resolved, improving the diagnostic accuracy and reliability of the models and meeting the needs of clinical applications.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINESE MEDICINE GUANGDONG LABORATORY
- Filing Date
- 2026-02-12
- Publication Date
- 2026-07-14
AI Technical Summary
Existing large-scale models for TCM verticals suffer from semantic bias when transferred to the Chinese language domain, making it unable to effectively handle unstructured TCM data. Furthermore, the training process is mismatched with the TCM diagnosis and treatment logic, resulting in low output accuracy and failing to meet clinical needs.
By acquiring TCM theory and clinical data, a structured question-answer pair dataset is generated. Combined with a progressive training strategy and an efficient knowledge retrieval and reordering mechanism, the training process of a large-scale TCM vertical model is optimized, thereby improving the model's professionalism and reliability.
This improves the professionalism and reliability of the diagnosis and treatment results of the large-scale TCM vertical model, meeting the needs of clinical application.
Smart Images

Figure CN122392987A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the fields of artificial intelligence and medical health technology, and in particular relates to a method for generating high-quality data and a method, device and storage medium for training a diagnostic and treatment assistance model. Background Technology
[0002] Against the backdrop of the widespread application of general-purpose large models driven by artificial intelligence in the medical field, large-scale models for traditional Chinese medicine (TCM) verticals have attracted attention because they can improve the efficiency and accessibility of TCM services through technology, thus meeting the needs of TCM modernization.
[0003] However, existing technologies have significant shortcomings. General large-scale model pre-training relies on massive amounts of English text, which is prone to semantic bias when transferred to the Chinese TCM field. Furthermore, TCM knowledge is complex, ambiguous, and mostly in unstructured form, making it difficult to understand. The training process of mainstream large-scale models, which involves "data collection - question-answer pair construction - reasoning learning - solution generation," is also incompatible with the logic of dynamic diagnosis and individualized treatment in TCM, which emphasizes the integration of the four diagnostic methods. These models cannot handle multimodal diagnostic information, are prone to solidifying knowledge, and struggle to process unstructured TCM data to uncover deep relationships. Ultimately, this results in low output accuracy for current TCM vertical large-scale models, and their performance is insufficient to meet clinical needs. Summary of the Invention
[0004] This application provides a method for generating high-quality data and a method, apparatus, and storage medium for training a diagnostic and treatment auxiliary model. It solves the problem of insufficient data quality in existing TCM models, improves the professionalism and reliability of the diagnostic and treatment results of large-scale TCM vertical models, and meets the needs of clinical applications.
[0005] In a first aspect, embodiments of this application provide a method for generating high-quality data and a method for training a diagnostic assistance model, including: Obtain first text data and second text data; wherein, the first text data is theoretical data and the second text data is clinical data; A first dataset is generated based on the first text data; wherein, the first dataset contains multiple sets of first question-and-answer pairs generated for the first text data; wherein, each set of first question-and-answer pairs contains a first question posed for the first text data and a first answer to the first question; A second dataset is generated based on the second text data; wherein the second dataset contains multiple sets of second question-and-answer pairs generated for the second text data; wherein each set of second question-and-answer pairs contains a second question posed for the second text data and a second answer to the second question; Generate a training set based on the first and second datasets; The first diagnostic model is trained using the training data set to obtain the trained second diagnostic model. The second diagnostic model is used to output the patient's diagnosis and treatment results based on the patient's input symptom information.
[0006] In this embodiment, textual data of TCM theory (books, documents, etc.) and clinical data are first acquired separately. Question-answer pairs (first question-answer pair information and second question-answer pair information) are generated for each, constructing datasets (first dataset and second dataset). Then, the first dataset and the second dataset are integrated into a data training set to train the model (first diagnostic model). Finally, a second diagnostic model capable of outputting diagnostic results is obtained. This method obtains textual data that takes into account both theory and clinical practice, covering core knowledge. Multiple question-answer pairs can also reduce information omissions and improve data accuracy, thereby allowing the model to integrate theory and experience, outputting more reliable diagnostic results. This solves the problem of insufficient data quality in existing TCM models, improves the professionalism and reliability of diagnostic results of large-scale TCM vertical models, and meets the needs of clinical applications.
[0007] In one possible implementation of the first aspect, generating a first dataset based on the first text data includes: The first text data is converted into a third text data in a preset format; wherein the third text data contains multiple text titles and a fourth text data corresponding to each text title; the fourth text data is contained within the third text data; The text titles in the third text data are corrected to obtain the corrected fourth text data; The first dataset is generated based on the fourth text data.
[0008] In this embodiment, the first text data is converted into third text data in a preset format containing "text title - corresponding fourth text data", and then the text title is corrected to obtain standardized fourth text data, thus generating the first dataset. This allows the first dataset to have structured text titles and corresponding content, ensuring that the data information is regular and the titles are accurate. This provides high-quality data support for the subsequent acquisition system of large-scale TCM vertical models and reliable basic theoretical knowledge (such as core knowledge points in TCM classics and textbooks), thereby improving the accuracy and efficiency of knowledge learning during model training.
[0009] In one possible implementation of the first aspect, generating the first dataset based on the fourth text data includes: The fourth text data is divided into blocks to obtain multiple first data blocks; For each first data block, the first data block is input into the first preset model to obtain multiple sets of third question-answer pairs corresponding to the first data block; wherein, a set of third question-answer pairs contains a third question raised for the first data block and a third answer to the third question; The first dataset is generated based on multiple sets of third question-and-answer pairs corresponding to each first data block.
[0010] In this embodiment of the application, the process divides the fourth text data into multiple first data blocks, then inputs each first data block into a first preset model to generate multiple sets of third question-and-answer pairs, and finally generates a first dataset. This process can transform the fourth text data into a structured question-and-answer pair dataset that fits the characteristics of the TCM field and covers core knowledge points. It provides systematic basic theoretical knowledge training materials for large TCM vertical models, helps the models accurately learn professional knowledge in TCM classics, textbooks and other texts, and improves the accuracy and professionalism of the models in TCM theoretical question-and-answer scenarios.
[0011] In one possible implementation of the first aspect, a first dataset is generated based on multiple sets of third question-and-answer pairs of information corresponding to each first data block, including: For each of the first data blocks, obtain the fourth question-answer pair information; wherein, the fourth question-answer pair information is any one of the multiple sets of third question-answer pair information corresponding to the first data block; Extract the first keyword corresponding to the third question from the information in the fourth question-and-answer pair; Extract the second keyword from the first data block corresponding to the information in the fourth question-and-answer pair; Calculate the semantic similarity between the first keyword and the second keyword; If the semantic similarity is lower than a preset threshold, the information in the fourth question-and-answer pair will be filtered out. After traversing multiple third question-and-answer pairs in each first data block, the fifth question-and-answer pairs after filtering out each first data block are obtained; The first dataset is generated based on the information from the fifth question-and-answer pair corresponding to each first data block.
[0012] In this embodiment, by selecting a fourth question-answer pair from multiple sets of third question-answer pairs in each first data block, extracting the first keyword of its third question and the second keyword of the corresponding first data block and calculating semantic similarity, and filtering out question-answer pairs with similarity below the threshold, the first dataset is generated based on the remaining fifth question-answer pairs. This ensures that the question-answer pairs in the first dataset are highly related to the core content of the corresponding text blocks, eliminates irrelevant or off-topic question-answer samples, improves the professionalism and accuracy of the first dataset, provides high-quality theoretical training materials for large-scale TCM vertical models that focus on the core knowledge points of TCM, and helps the model accurately learn the professional knowledge in TCM classics and textbooks.
[0013] In one possible implementation of the first aspect, generating a second dataset based on the second text data includes: The second text data is divided into multiple different second data blocks; each second data block corresponds to a treatment scenario; the treatment scenario includes at least one of the following: diagnosis scenario, treatment scenario, intermediate decision-making scenario, and medication dosage scenario. For each second data block, input the second data block into the first preset model to obtain multiple sets of sixth question-answer pairs corresponding to the second data block; The second dataset is generated based on the information from multiple sets of sixth question-and-answer pairs corresponding to each second data block.
[0014] In this embodiment, the second text data is divided into multiple second data blocks according to treatment scenarios such as diagnosis and treatment. Each second data block is then input into a first preset model to generate multiple sets of sixth question-answer pairs, and finally a second dataset is generated. This can construct a structured question-answer dataset that fits different clinical treatment scenarios in traditional Chinese medicine and focuses on the needs of scenario-based diagnosis and treatment. This injects clinically practical knowledge into the large-scale model of traditional Chinese medicine, helps the model to accurately adapt to the reasoning needs of various diagnosis and treatment scenarios, and improves the model's application capability in clinical diagnosis and treatment scenarios.
[0015] In one possible implementation of the first aspect, the second dataset is generated based on multiple sets of the sixth question-and-answer pairs corresponding to each of the second data blocks, including: For each set of sixth question-and-answer pairs corresponding to each second data block, generate multiple first thought chain data for each sixth question-and-answer pair; wherein, the first thought chain data is question-and-answer data with reasoning process; By filtering multiple first-thinking chain data, at least one second-thinking chain data is obtained; Obtain the modified third thought chain data corresponding to the second thought chain data; A training set is generated based on at least one third thought chain data corresponding to each sixth question and answer.
[0016] In this embodiment, multiple first thought chain data containing reasoning processes are generated by the sixth question-and-answer pair information corresponding to each second data block. After filtering, second thought chain data is obtained and its modified third thought chain data is acquired. Finally, a data training set (i.e., the second dataset) is generated. Its beneficial effect is that it can endow the second dataset with a complete reasoning process that fits the logic of TCM diagnosis and treatment, eliminate inferior thought chains and optimize and improve high-quality thought chains, and ensure that the second dataset has both clinical scenario relevance and professional diagnostic and treatment reasoning. It provides high-quality training materials for the large TCM vertical model to learn the dynamic clinical thinking of "syndrome differentiation and treatment", and helps to improve the logic and reliability of the model's diagnostic and treatment reasoning.
[0017] In one possible implementation of the first aspect, the method further includes: Perform a quality assessment on each first thought chain data point to obtain the first assessment result corresponding to each first thought chain data point; Optimize the mind chain data generation strategy based on multiple first assessment results; The fourth thought chain data corresponding to the sixth question-and-answer pair information is generated according to the thought chain data generation strategy; among them, the sixth question-and-answer pair information is a question-and-answer pair information generated based on new clinical data.
[0018] In this embodiment, by evaluating the quality of each first thought chain data and optimizing the thought chain data generation strategy based on the evaluation results, and then generating the fourth thought chain data based on the sixth question-and-answer pair information generated for the new clinical data according to the optimized strategy, this method can continuously iterate and optimize the thought chain generation logic, ensuring that the newly generated fourth thought chain data conforms to the clinical diagnosis and treatment logic of traditional Chinese medicine and meets the quality standards. This provides high-quality clinical reasoning material for the second dataset, helping the large-scale model of traditional Chinese medicine vertical to more accurately grasp the dynamic clinical thinking of "syndrome differentiation and treatment" and improve the professionalism and reliability of the model's diagnosis and treatment reasoning.
[0019] Secondly, embodiments of this application provide a high-quality data generation apparatus and a training apparatus for a diagnostic and treatment assistance model, including: The text data acquisition module is used to acquire first text data and second text data; wherein, the first text data is theoretical data and the second text data is clinical data; The first dataset generation module is used to generate a first dataset based on the first text data; wherein, the first dataset contains multiple sets of first question-and-answer pairs generated for the first text data; wherein, a set of first question-and-answer pairs contains a first question posed for the first text data and a first answer to the first question; The second dataset generation module is used to generate a second dataset based on the second text data; wherein, the second dataset contains multiple sets of second question-and-answer pairs generated for the second text data; wherein, each set of second question-and-answer pairs contains a second question posed for the second text data and a second answer to the second question; The data training set generation module is used to generate a data training set based on the first dataset and the second dataset. The model training module is used to train the first diagnostic model based on the data training set to obtain the trained second diagnostic model; the second diagnostic model is used to output the patient's diagnosis results based on the patient's input symptom information.
[0020] Thirdly, embodiments of this application provide a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the high-quality data generation method and the training method for the diagnostic and therapeutic assistance model as described in any of the first aspects above.
[0021] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements a method for generating high-quality data and a method for training a diagnostic and therapeutic assistance model as described in any of the first aspects above.
[0022] Fifthly, embodiments of this application provide a computer program product that, when run on a terminal device, causes the terminal device to execute the high-quality data generation method and the training method for the diagnostic assistance model described in any of the first aspects above.
[0023] It is understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description
[0024] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1 This is a flowchart illustrating the method for generating high-quality data and the method for training a diagnostic assistance model provided in the embodiments of this application; Figure 2 This is a schematic diagram of the process for obtaining the first dataset provided in an embodiment of this application. Figure 1 ; Figure 3 This is a schematic diagram of the process for obtaining the first dataset provided in an embodiment of this application. Figure 2 ; Figure 4 This is a schematic diagram of the process for obtaining the first dataset provided in an embodiment of this application. Figure 3 ; Figure 5 This is a schematic diagram of the process for obtaining the second dataset provided in an embodiment of this application. Figure 1 ; Figure 6 This is a schematic diagram of the process for generating the second dataset provided in the embodiments of this application. Figure 2 ; Figure 7 This is a schematic diagram of the overall structure of the generated data training set provided in the embodiments of this application; Figure 8 This is a schematic diagram of the overall structure for processing clinical data provided in the embodiments of this application; Figure 9This is a schematic diagram of the overall structure of the progressive training strategy provided in the embodiments of this application; Figure 10 This is a schematic diagram of the TCM diagnosis and treatment logic generation structure of the structured medical record provided in the embodiments of this application; Figure 11 This is a structural block diagram of the data generation apparatus based on high-quality data provided in the embodiments of this application; Figure 12 This is a schematic diagram of the structure of the terminal device provided in the embodiments of this application. Detailed Implementation
[0026] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0027] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0028] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0029] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0030] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0031] References to "one embodiment" or "some embodiments" in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized.
[0032] Against the backdrop of the widespread application of general-purpose large models driven by artificial intelligence in the medical field, large-scale models for traditional Chinese medicine (TCM) verticals have attracted attention because they can improve the efficiency and accessibility of TCM services through technology, thus meeting the needs of TCM modernization.
[0033] However, existing technologies have significant shortcomings. General large-scale model pre-training relies on massive amounts of English text, which is prone to semantic bias when transferred to the Chinese TCM field. Furthermore, TCM knowledge is complex, ambiguous, and mostly in unstructured form, making it difficult to understand. The training process of mainstream large-scale models, which involves "data collection - question-answer pair construction - reasoning learning - solution generation," is also incompatible with the logic of dynamic diagnosis and individualized treatment in TCM, which emphasizes the integration of the four diagnostic methods. These models cannot handle multimodal diagnostic information, are prone to solidifying knowledge, and struggle to process unstructured TCM data to uncover deep relationships. Ultimately, this results in low output accuracy for current TCM vertical large-scale models, and their performance is insufficient to meet clinical needs.
[0034] To address the aforementioned technical issues, this application first processes TCM books / literature / textbooks and clinical case data through OCR recognition, title level correction, and dual adaptive block segmentation to generate a high-quality dataset containing question-answer pairs and thought chains, thus solving the problem of insufficient data quality in existing TCM models. Next, a TCM knowledge base is constructed and quantified. The model is then fine-tuned using a progressive training strategy and an Ascend-based efficient knowledge retrieval and reordering mechanism, ultimately improving the professionalism and reliability of the diagnostic and treatment results of large-scale TCM vertical models to meet clinical application needs.
[0035] See Figure 1 This is a flowchart illustrating the method for generating high-quality data and training a diagnostic assistance model provided in the embodiments of this application. It is intended as an example and not a limitation. The method may include the following steps: S101, acquire the first text data and the second text data; wherein, the first text data is theoretical data and the second text data is clinical data.
[0036] In this embodiment of the application, the first text data belongs to the category of TCM theory data, which mainly covers three categories: TCM professional books, literature and textbooks. Specifically, it includes TCM classics (including ancient literature), modern TCM works, academic papers in the field of TCM, TCM professional textbooks, etc., and is the main carrier of TCM theoretical knowledge (such as viscera and meridians, theory, method, prescription and medicine, etc.).
[0037] The second type of text data is TCM clinical practice data. The core of it is real TCM medical records after anonymization, which includes basic patient information (after anonymization to avoid privacy risks), four diagnostic methods (inspection, auscultation and olfaction, inquiry and palpation records), diagnostic conclusions (TCM syndrome differentiation results, disease classification, etc.), treatment plans (including prescriptions, treatment methods, dosage and usage, etc.), and disease progress records (disease development and treatment adjustment process), which are a direct reflection of TCM clinical diagnosis and treatment experience and practice logic.
[0038] Specifically, the first type of text data can be obtained from scanned PDF versions of TCM books, documents, and textbooks. These materials are mostly unstructured data, containing complex layouts, handwritten annotations, archaic characters, and charts. The second type of text data collects real medical records from TCM clinical settings, prioritizing those from authoritative sources and with complete treatment processes. Sensitive information such as patient names, ID numbers, and contact information in the medical records is anonymized to ensure compliance with relevant laws and ethical requirements for medical data privacy protection. For unstructured content such as handwritten medical records and non-standardized expressions that may exist in the medical records, text recognition and semantic analysis are used to convert key information (such as symptom descriptions, diagnosis results, and medication information) into a structured format for easier subsequent scenario-based processing.
[0039] S102, Generate a first dataset based on the first text data; wherein, the first dataset contains multiple sets of first question-and-answer pairs generated for the first text data; wherein, each set of first question-and-answer pairs contains a first question posed for the first text data and a first answer to the first question.
[0040] In this embodiment of the application, a first dataset is generated based on theoretical text data such as professional books, literature, and textbooks of traditional Chinese medicine. Each first question and answer pair contains a first question raised around these theoretical data and a corresponding first answer given based on the theoretical data.
[0041] In one embodiment, see Figure 2 This is a schematic diagram of the process for obtaining the first dataset provided in an embodiment of this application. Figure 1 ,like Figure 2 As shown, step S102 includes: S201, convert the first text data into third text data in a preset format; wherein, the third text data contains multiple text titles and fourth text data corresponding to each text title; the fourth text data is contained within the third text data.
[0042] In this embodiment of the application, the third text data refers to the structured text obtained by converting the first text data into a format that is preset to markdown. It is the "structured presentation carrier" of the first text data. Its core feature is that it contains the correspondence between "text title - fourth text data" and fully retains the chart position labels and special symbols (such as special symbols for TCM terminology, dosage unit symbols, etc.) in the first text data to ensure that TCM theoretical information is not lost.
[0043] The fourth text data is a core component of the third text data, referring to the specific TCM theoretical content corresponding to each text title. For example, under the title "Basic TCM Theory - Five Zang-Fu Organs and Six Bowels", the fourth text data includes the definition of the five Zang-Fu organs and six bowels, their mutual generation and restraint relationships, and their application in syndrome differentiation and treatment. Under the title "Traditional Chinese Medicine Prescription - Ephedra Decoction", the fourth text data includes the composition, properties and meridians of Ephedra Decoction, its indications, and methods of decoction and administration.
[0044] Specifically, the open-source OCR library MinerU (based on a deep neural network model) can be used to process the first text data (scanned PDF), accurately recognizing the image-based text information in the PDF, including complex layouts (such as column text, text next to nested charts), handwriting (such as book annotations), and archaic characters (such as variant characters in ancient books), converting them into editable text content. Simultaneously, the chart location labels in the first text data (such as inserting the label "[Chart 1: Traditional Chinese Medicine Zang-Fu Meridian Diagram]" at the corresponding text location) and special symbols (such as "qian" and "liang" for Chinese medicine dosage, and "floating and tight" symbols for pulse descriptions) are preserved, initially outputting structured text containing a title level, i.e., the third text data.
[0045] S202, Correct the text title in the third text data to obtain the corrected fourth text data.
[0046] In this embodiment, since the first text data (such as traditional Chinese medicine books) has a clear chapter hierarchy (such as "article → chapter → section → sub-item"), it is necessary to clarify the "text titles" in the third text data through title hierarchy correction to obtain the corrected fourth text data. Through title correction, the hierarchical relationship and the book / chapter to which each text title belongs are clarified, invalid information (page numbers, garbled characters) is eliminated, and the title and corresponding content (i.e., the fourth text data) are accurately matched. This ensures that the fourth text data can be traced back to the original source of traditional Chinese medicine theory (such as "Huangdi Neijing - Suwen - Yingxiang Dalun"), laying a structured foundation for subsequent high-quality data processing (such as dual adaptive segmentation and question-answer pair generation). Specifically, this includes: Automatic correction: The identification agent extracts title features from the preliminary structured text (such as font size, bolding style, numbering rules, for example, "Chapter 1" is a first-level title and "1.1" is a second-level title), sorts the titles according to the original chapter order of the book, removes page numbers from the titles (such as "35" in "Chapter 2 Traditional Chinese Medicine Diagnosis 35"), and corrects disordered title levels (such as adjusting "1.2.1" which was mistakenly identified as a "third-level title" to the correct "second-level title").
[0047] Manual correction: For special formats (such as unnumbered chapter titles in ancient books or handwritten modified chapter names) that cannot be automatically corrected, the book's table of contents is extracted manually, and the title levels are manually checked and supplemented to ensure that each "text title" accurately corresponds to the "fourth text data" below it.
[0048] S203, Generate the first dataset based on the fourth text data.
[0049] In this embodiment of the application, a first dataset consisting of multiple sets of first question-answer pairs is generated based on the fourth text data (derived from theoretical data such as professional books, literature, and textbooks of traditional Chinese medicine) that has been corrected in terms of title and contains clear "text title - corresponding content". Each set of question-answer pairs designs questions around the traditional Chinese medicine theoretical content in the fourth text data and provides corresponding answers.
[0050] In the above method, the first text data is converted into third text data in a preset format containing "text title - corresponding fourth text data", and then the text title is corrected to obtain the standardized fourth text data. Finally, the first dataset is generated, which enables the first dataset to have structured text titles and corresponding content, ensuring that the data information is regular and the titles are accurate. This provides high-quality data support for the subsequent acquisition of reliable basic theoretical knowledge (such as core knowledge points in TCM classics and textbooks) for large-scale TCM vertical models, and improves the accuracy and efficiency of knowledge learning during model training.
[0051] In one embodiment, see Figure 3 This is a schematic diagram of the process for obtaining the first dataset provided in an embodiment of this application. Figure 2 ,like Figure 3 As shown, step S203 includes: S301, the fourth text data is divided into blocks to obtain multiple first data blocks.
[0052] In this embodiment, the context window length of the mainstream large model is approximately 8k tokens (characters). If the fourth text data (such as the entire chapter of "Traditional Chinese Medicine Diagnostics," with over 100,000 characters) is directly input into the model, it will exceed the window limit and become unprocessable. Therefore, dividing the fourth text data into blocks to obtain multiple first data blocks is a key step in the high-quality data processing flow of the TCM vertical large model. This requires consideration of the characteristics of the fourth text data, the core block-division strategy, the specific implementation steps, and the final output (first data blocks).
[0053] The fourth set of text data consists of structured data (sourced from TCM books, literature, textbooks, etc.) with clearly defined "text title - corresponding TCM theoretical content" after title correction. When segmenting the data, the "dual adaptive segmentation strategy" proposed in this application is employed. Firstly, the title segmentation levels are adaptively adjusted based on content density; content at the same level is integrated when content under a subheading is sparse, while dense content is segmented into more detailed headings. Secondly, the segment size is dynamically adjusted based on text complexity and semantic relevance to avoid exceeding the approximately 8k context length limit of the large model, while preserving coherent TCM knowledge (such as the connection between prescription composition and indications). After segmentation, each first data block is labeled with its corresponding book, chapter, and title, ultimately resulting in multiple semantically coherent first data blocks adapted for subsequent processing, laying the foundation for generating the first dataset.
[0054] S302, for each first data block, input the first data block into the first preset model to obtain multiple sets of third question-and-answer pairs corresponding to the first data block; wherein, each set of third question-and-answer pairs contains a third question raised for the first data block and a third answer to the third question.
[0055] In this embodiment of the application, the "first data block" is the product obtained by dividing the fourth text data (structured data containing clear "title-TCM theory content" after correction) into blocks. Each data block corresponds to a clear TCM theory topic and is marked with its source. The "first preset model" can be DeepSeek-V3.1, which is selected for the automatic generation of question-answer pairs in the field of TCM and is adapted to the semantic understanding requirements of TCM theory text.
[0056] For each first data block, the TCM theoretical content it contains (such as a specific explanation of "inspection" in the four diagnostic methods of TCM) is input into DeepSeek-V3.1 (first preset model). The model will combine the characteristics of the TCM field and generate multiple sets of third question-answer pairs around the core knowledge points of the data block. For example, if the first data block related to "Ma Huang Tang" is input, the model may generate third questions such as "What are the constituent drugs of Ma Huang Tang?" and "What diseases does Ma Huang Tang mainly treat?", as well as accurate third answers based on the first data block.
[0057] S303, Generate the first dataset based on the multiple sets of third question-and-answer pairs corresponding to each first data block.
[0058] In this embodiment of the application, each first data block (obtained by the fourth text data segmentation, containing clear TCM theoretical themes and source annotations) is integrated with multiple sets of third question-and-answer pairs (each set containing a third question and a corresponding third answer related to the TCM knowledge of the data block) generated by the first preset model (DeepSeek-V3.1). After removing question-and-answer pairs that are irrelevant to the theme and have no original text basis, the first dataset is finally formed by these high-quality TCM theoretical question-and-answer pairs.
[0059] In the above method, the process divides the fourth text data into multiple first data blocks, then inputs each first data block into a first preset model to generate multiple sets of third question-and-answer pairs, and finally generates a first dataset. This process can transform the fourth text data into a structured question-and-answer pair dataset that fits the characteristics of the TCM field and covers core knowledge points. It provides systematic basic theoretical knowledge training materials for large TCM vertical models, helps the models accurately learn professional knowledge in TCM classics, textbooks and other texts, and improves the accuracy and professionalism of the models in TCM theoretical question-and-answer scenarios.
[0060] In one embodiment, see Figure 4 This is a schematic diagram of the process for obtaining the first dataset provided in an embodiment of this application. Figure 3 ,like Figure 4 As shown, step S303 includes: S401, for each of the first data blocks, obtain the fourth question-answer pair information; wherein, the fourth question-answer pair information is any one of the multiple sets of third question-answer pair information corresponding to the first data block.
[0061] In this embodiment, each first data block generates multiple sets of third question-and-answer pairs (each set contains a third question and a corresponding third answer related to the TCM knowledge of that data block) through a first preset model (DeepSeek-V3.1). Obtaining the fourth question-and-answer pair information involves arbitrarily selecting one set from these multiple sets of third question-and-answer pairs as the fourth question-and-answer pair corresponding to that first data block. Essentially, this is to initially determine a question-and-answer sample that conforms to the TCM theoretical theme for each first data block. Subsequently, keyword matching, original text verification, and other screening steps will be combined to further ensure the accuracy and relevance of the fourth question-and-answer pair, ultimately providing a basic unit for the integration of the first dataset.
[0062] S402, extract the first keyword corresponding to the third question in the fourth question-answer pair information.
[0063] In this embodiment of the application, extracting the first keyword corresponding to the third question in each fourth question-answer pair is an operation to filter core TCM information from the third question-answer pair.
[0064] When extracting the first keyword, the algorithm focuses on terms related to core TCM knowledge in the third question corresponding to the fourth question-answer pair. For example, for the third question "What are the constituent drugs of Ma Huang Tang?", the first keyword is "Ma Huang Tang, constituent drugs"; for "What are the specific contents of the mutual generation relationship among the five viscera and six bowels?", the first keyword is "five viscera and six bowels, mutual generation relationship". These first keywords need to accurately correspond to the core of TCM theory to provide a basis for subsequent screening of irrelevant question-answer pairs and optimization of the quality of the first dataset, ensuring that the question-answer pairs finally used for model training closely align with key knowledge in the field of TCM.
[0065] S403, extract the second keyword of the first data block corresponding to the information of the fourth question and answer pair.
[0066] In this embodiment of the application, the fourth question-and-answer pair information originates from multiple sets of third question-and-answer pairs corresponding to the first data block (generated by DeepSeek-V3.1 input to the first data block), and the extraction of the second keyword of the corresponding first data block needs to be carried out around the core attributes of the data block.
[0067] The second keyword is extracted based on the core theoretical content of the first data block. For example, if the first data block is generated around "the composition, indications, and decoction method of Ma Huang Tang", the second keyword can be extracted as "Chinese herbal formula, Ma Huang Tang, indications, and decoction method". If the first data block focuses on "the key points and judgment criteria of inspection in the four diagnostic methods of traditional Chinese medicine", the second keyword would be "traditional Chinese medicine diagnosis, inspection, key points, and judgment criteria", which needs to conform to the classification logic of the traditional Chinese medicine theoretical system (such as basic theory, diagnostic methods, Chinese herbal formulas, and treatment principles). S404, calculate the semantic similarity between the first keyword and the second keyword.
[0068] In this embodiment, the first keyword is extracted from the "third question" of the fourth question-and-answer pair (any one of the multiple sets of third question-and-answer pairs corresponding to a data block), focusing on the TCM knowledge points pointed to by the core of the question. For example, when the third question is "What are the constituent drugs of Ma Huang Tang?", the first keyword is "Ma Huang Tang, constituent drugs", which directly reflects the specific knowledge requirements of the question-and-answer pair. The second keyword is extracted from the first data block of the information pair of the fourth question-and-answer pair (the source of the fourth question-and-answer pair), covering two types of information: "TCM knowledge classification" (such as "Chinese herbal formulas, Ma Huang Tang, formula composition") and "source identifier" (such as "Shang Han Lun, differentiation of Taiyang disease pulse and syndrome and treatment"), which fully represents the subject scope and knowledge attributes of the first data block.
[0069] Using common algorithms such as cosine similarity, the similarity value of the semantic vectors of two types of keywords is calculated (range 0-1, the closer the value is to 1, the more similar the semantics).
[0070] S405 If the semantic similarity is lower than the preset threshold, the information of the fourth question-and-answer pair will be filtered out.
[0071] In this embodiment of the application, the preset threshold is a quantitative standard for determining whether the fourth question-answer pair matches the topic of the first data block. Its setting needs to take into account both "retaining valid samples" and "removing invalid samples": it avoids the situation where a large number of valid question-answer pairs are mistakenly deleted due to an excessively high threshold (such as the case where "Ma Huang Tang composition" and "Ma Huang Tang formula composition" have slightly lower similarity due to slight differences in terminology, but the actual topics are the same), and it also avoids the situation where question-answer pairs with deviated topics are mixed in due to an excessively low threshold (such as the question-answer pair "Gui Zhi Tang treatment" generated from the "Ma Huang Tang" data block).
[0072] When the semantic similarity between the first and second keywords is lower than the preset threshold, it indicates that the core message of the fourth question-and-answer pair deviates from the TCM theory theme of the corresponding first data block, failing to meet the requirement that "the content of the question-and-answer pair must closely relate to the knowledge of the data block." Filtering out the fourth question-and-answer pair at this point is a crucial step in the quality control of the first dataset.
[0073] S406, after traversing multiple third question-and-answer pairs in each first data block, the fifth question-and-answer pairs after filtering out each first data block are obtained.
[0074] In this embodiment, for each third question-and-answer pair corresponding to a first data block, the process of "extracting keywords → calculating semantic similarity → determining whether to filter" needs to be executed one by one. That is, during the traversal, the corresponding first keyword (extracted from the third question) and second keyword (extracted from the first data block) are matched for each third question-and-answer pair, and the subsequent filtering determination is completed. After traversing and completing all filtering, the remaining third question-and-answer pairs in each first data block, after filtering, are the fifth question-and-answer pair information corresponding to that data block.
[0075] In this dataset, all fifth question-and-answer pairs are consistent with the TCM theoretical themes of their corresponding first data blocks, without deviating from the sample. This ensures that the question-and-answer pairs focus on the core knowledge of the data block (e.g., the fifth question-and-answer pair for the "Ma Huang Tang" data block only revolves around the composition, indications, and decoction methods of Ma Huang Tang). All answers can be clearly traced back to the first data block, with no erroneous statements or missing key information (e.g., the answer to the question-and-answer pair for "Ma Huang Tang composition," "Ma Huang, Gui Zhi, Xing Ren, Zhi Gan Cao," perfectly matches the content of the data block). Because the corresponding first data block is labeled with its source (books / documents / chapter), the fifth question-and-answer pairs are also indirectly associated with a clear knowledge source. When generating the first dataset later, the source information can be retained simultaneously, improving data credibility.
[0076] S407, Generate the first dataset based on the fifth question-and-answer pair information corresponding to each first data block.
[0077] In the embodiments of this application, each first data block (generated by the fourth text data block, containing clear TCM theoretical themes and source annotations) will obtain fifth question-answer pair information after traversing its corresponding multiple sets of third question-answer pairs and completing the screening (through semantic similarity threshold judgment and multi-dimensional standard verification) after filtering out invalid samples. These fifth question-answer pairs all meet the requirements of "the theme is consistent with the data block, the answer matches the original text, and the content is complete without missing parts" (e.g., the fifth question-answer pair of the "Ma Huang Tang" data block only retains valid samples related to the composition, indications, and decoction method of Ma Huang Tang).
[0078] The information of the fifth question-and-answer pairs corresponding to all the first data blocks is summarized and integrated. Duplicate samples (such as the same question-and-answer pairs generated from different data blocks) are removed, and the data is classified and sorted according to the categories of TCM knowledge (such as basic theories, Chinese herbal prescriptions, diagnostic methods, etc.). Finally, the first dataset is formed, which consists of high-quality TCM theory-based question-and-answer pairs. This provides accurate and structured training samples for the subsequent pre-training and fine-tuning of large TCM vertical models.
[0079] In the above method, by selecting the fourth question-answer pair from multiple sets of third question-answer pairs in each first data block, extracting the first keyword of its third question and the second keyword of the corresponding first data block and calculating semantic similarity, and filtering out question-answer pairs with similarity below the threshold, the first dataset is generated based on the remaining fifth question-answer pairs. This ensures that the question-answer pairs in the first dataset are highly related to the core content of the corresponding text blocks, eliminates irrelevant or off-topic question-answer samples, improves the professionalism and accuracy of the first dataset, provides high-quality theoretical training materials for large-scale TCM vertical models that focus on the core knowledge points of TCM, and helps the model accurately learn the professional knowledge in TCM classics and textbooks.
[0080] S103, Generate a second dataset based on the second text data; wherein the second dataset contains multiple sets of second question-and-answer pairs generated for the second text data; wherein each set of second question-and-answer pairs contains a second question posed for the second text data and a second answer to the second question.
[0081] In this embodiment of the application, a second dataset consisting of multiple sets of second question-and-answer pairs is generated based on the second text data (i.e., de-identified real medical case data, including patient basic information, four diagnostic methods, diagnostic conclusions, treatment plans, etc.). Each set of second question-and-answer pairs includes a second question raised around the case data (such as "What is the most likely diagnosis of this patient?") and a corresponding second answer given based on the case information, and the content of the questions and answers is consistent with the clinical diagnosis and treatment scenario of traditional Chinese medicine.
[0082] In one embodiment, see Figure 5 This is a schematic diagram of the process for obtaining the second dataset provided in an embodiment of this application. Figure 1 ,like Figure 5 As shown, step S103 includes: S501, the second text data is divided into multiple different second data blocks; wherein, each second data block corresponds to a treatment scenario; wherein, the treatment scenario includes at least one of the following: diagnosis scenario, treatment scenario, intermediate decision-making scenario, and medication dosage scenario.
[0083] In this embodiment of the application, the second text data refers to the de-identified medical case data (including patient basic information, four diagnostic methods, diagnostic conclusions, treatment plans, etc.). When dividing the second data block, the "treatment scenario" is used as the core dividing criterion to ensure that each second data block focuses on a single or related treatment scenario.
[0084] If the "diagnosis stage" information in a medical record is complete (such as the patient's chief complaint, data from the four diagnostic methods, the differentiation process, and the diagnostic conclusion), this part can be separately classified as a second data block, corresponding to the "diagnosis scenario." If the "details of drug use" in the medical record are clear (such as drug name, dosage, route of administration, and course of treatment), it can be separately classified as a second data block corresponding to the "drug dosage scenario." If the "diagnosis-treatment" stages in the medical record are closely related (such as developing a complete treatment plan based on the diagnostic conclusion, including treatment methods and monitoring plans), these two parts can be integrated into a second data block, corresponding to both the "diagnosis scenario" and the "treatment scenario." If the medical record contains a complete record of "condition turning point - adjustment of treatment plan" (such as identifying key diagnostic points and changing the treatment direction), it can be integrated into a second data block corresponding to both the "intermediate decision-making scenario" and the "treatment scenario."
[0085] After partitioning, each second data block is clearly labeled with its corresponding treatment scenario, providing a structured foundation for the subsequent generation of the second dataset (scenario-based question-and-answer pairs), ensuring that the generated question-and-answer pairs can meet the needs of different clinical treatment stages.
[0086] S502, for each second data block, input the second data block into the first preset model to obtain multiple sets of sixth question answer information corresponding to the second data block.
[0087] In this embodiment of the application, the second data block is the structured data of the second text data (de-sensitized real medical case data) divided according to treatment scenarios (diagnosis scenario, treatment scenario, intermediate decision-making scenario, usage and dosage scenario, etc.). Each second data block focuses on a single or related clinical scenario (e.g., a second data block only contains "patient four diagnostic information + diagnosis conclusion", corresponding to the diagnosis scenario).
[0088] The first preset model is DeepSeek-V3.1. After the second data block is input into the model, the model will combine the characteristics of TCM clinical scenarios and generate multiple sets of sixth question-answer pairs around the core information in the data block (such as patient symptoms, syndrome differentiation process, treatment plan, etc.). For example, for the second data block in the diagnosis scenario, it generates questions such as "What disease diagnosis does the patient's four diagnostic methods support?" and "What is the key basis for diagnosing this disease?" and corresponding answers. For the second data block in the usage and dosage scenario, it generates question-answer pairs such as "What is the basis for the dosage of a certain Chinese medicine used by this patient?" and "What patient factors need to be considered when adjusting the drug dosage?" All answers must be extracted from the medical record information in the second data block to ensure close matching with the actual clinical scenario and provide scenario-based training samples for the subsequent construction of the second dataset.
[0089] S503, Generate a second dataset based on the information of multiple sets of sixth question-and-answer pairs corresponding to each second data block.
[0090] In this embodiment, when generating the second dataset, the information of the sixth question-and-answer pairs corresponding to all second data blocks needs to be aggregated. This information is then preliminarily filtered using a rule engine (e.g., removing samples where the medical record information does not match the question-and-answer pairs or contains incorrect TCM terminology), and further reviewed by TCM professionals. Finally, it is integrated into a second dataset consisting of multiple high-quality sixth question-and-answer pairs. This dataset differs from the first dataset, which focuses on theoretical knowledge. Its core feature is "clinical scenario-based" application, which can be used by large-scale TCM vertical models to learn the dynamic logic and practical norms of clinical diagnosis and treatment, supplementing the model's clinical application capabilities.
[0091] In the above method, multiple first thought chain data containing reasoning processes are generated by the sixth question-and-answer pair information corresponding to each second data block. After screening, second thought chain data is obtained and its modified third thought chain data is acquired. Finally, a data training set (i.e., the second dataset) is generated. Its beneficial effect is that it can endow the second dataset with a complete reasoning process that fits the logic of TCM diagnosis and treatment, eliminate inferior thought chains and optimize and improve high-quality thought chains, and ensure that the second dataset has both clinical scenario relevance and professional diagnostic and treatment reasoning. It provides high-quality training materials for the large TCM vertical model to learn the dynamic clinical thinking of "differentiation of syndromes and treatment", and helps to improve the logic and reliability of the model's diagnostic and treatment reasoning.
[0092] In one embodiment, see Figure 6 This is a schematic diagram of the process for generating the second dataset provided in the embodiments of this application. Figure 2 ,like Figure 6 As shown, step S503 includes: S601, for each set of sixth question-and-answer pairs corresponding to each second data block, generate multiple first thought chain data for each set of sixth question-and-answer pairs; wherein, the first thought chain data is question-and-answer data with reasoning process.
[0093] In this embodiment, the sixth question-and-answer pair information is a scenario-based question-and-answer pair generated by inputting the second data block into the first preset model (such as "Why was the patient diagnosed with a cold?" "What treatment plan should be adopted for this diagnosis?"). When generating the first thought chain data, it is necessary to use each set of sixth question-and-answer pairs as a basis and guide the model to restore the TCM clinical reasoning process through prompt word engineering.
[0094] For example, for the sixth question-and-answer pair of "diagnosed as wind-cold common cold", the first thought chain data should include the complete reasoning steps of "patient's chief complaint of chills and fever, no sweating → four diagnostic methods reveal a floating and tight pulse, thin white tongue coating → combining the key points of TCM theory of 'wind-cold binding the exterior syndrome' → ruling out wind-heat common cold (no sore throat, floating and rapid pulse, etc.) → final diagnosis of wind-cold common cold". This makes the question-and-answer data not only contain "question-answer", but also have the TCM diagnostic and treatment thinking logic of "from the exterior to the interior, syndrome differentiation and treatment".
[0095] S602, filter multiple first thought chain data to obtain at least one second thought chain data.
[0096] In this embodiment, the operation of filtering multiple first thought chain data to obtain at least one second thought chain data is a key step in optimizing the quality of thought chains during the generation of large-scale TCM vertical model data. Multiple first thought chain data are generated from each group of sixth question-and-answer pairs (originating from the second data block, focusing on clinical scenarios). Each first thought chain contains a TCM diagnosis and treatment reasoning process (such as the derivation of "patient symptoms → syndrome differentiation basis → diagnosis conclusion"). However, due to differences in model parameter settings, the accuracy and logic of the reasoning vary, necessitating the filtering of multiple first thought chain data generated from each sixth question-and-answer pair.
[0097] During the screening process, the "Thinking Chain Assessment Template" is used to quantitatively evaluate the data based on three core dimensions: correctness of reasoning (whether each step conforms to TCM theory and case information), logical consistency (whether the derivation process is coherent, without jumps or contradictions), and completeness (whether it covers key diagnostic steps). A second review is conducted by professional physicians to eliminate first-line thinking chain data containing reasoning errors (such as misdiagnosing wind-heat cold as wind-cold cold), logical breaks (such as failing to explain the relationship between symptoms and pathogenesis), or missing key information (such as failing to mention the diagnostic basis). At least one thinking chain that meets the assessment criteria is ultimately retained as the second-line thinking chain data. This second-line thinking chain accurately reflects the complete logic of TCM clinical diagnosis and treatment, providing high-quality reasoning samples for subsequent model training and helping the model learn standardized diagnostic and treatment thinking.
[0098] S603, obtain the modified third thought chain data corresponding to the second thought chain data.
[0099] In this embodiment, the second thought chain data originates from the screening of the first thought chain data and already possesses basic completeness and accuracy in TCM clinical reasoning (such as the coherent derivation of "patient symptoms → syndrome differentiation → diagnosis → treatment"). To ensure the correctness of the screened second thought chain data, it needs to be refined and supplemented by TCM professionals in conjunction with clinical experience and authoritative guidelines to obtain the modified third thought chain data. For example, ambiguous TCM terminology used in the reasoning process can be corrected (e.g., clarifying "wind-cold syndrome" as "wind-cold binding the exterior syndrome"), key diagnostic evidence can be added (e.g., in the reasoning of "diagnosing wind-cold common cold," adding correlation analysis of the four diagnostic methods such as "no sweating, floating and tight pulse"), or the order of expression of the diagnostic and treatment logic can be optimized (ensuring that the derivation of "pathogenesis analysis → treatment principle → treatment method → prescription" is more in line with clinical thinking habits). S604, Generate a second dataset based on at least one third thought chain data corresponding to each sixth answer information.
[0100] In this embodiment, when generating the second dataset, it is necessary to integrate and associate each sixth question-and-answer pair with at least one corresponding third thought chain data to ensure that each set of data contains both a direct correspondence between "question and answer" and a complete reasoning logic of "diagnosis-decision-treatment". Simultaneously, samples with reasoning contradictions and terminological errors are removed using a rule engine, and then a second review is conducted by TCM professionals. The final result is a second dataset that combines clinical relevance with the completeness of diagnostic and treatment logic. This dataset can be used by large-scale TCM vertical models to learn the dynamic thinking of clinical diagnosis and treatment, improving the professionalism and interpretability of the model output.
[0101] In one embodiment, the method further includes: Each first thought chain data point is evaluated for quality to obtain a first evaluation result. The thought chain data generation strategy is optimized based on multiple first evaluation results. The fourth thought chain data corresponding to the seventh question-answer pair information is generated based on the thought chain data generation strategy. The seventh question-answer pair information is generated based on new clinical data.
[0102] In this embodiment of the application, in order to systematically evaluate and improve the performance quality of the model in medical reasoning tasks, multiple model evaluation templates were developed to evaluate the thought chain.
[0103] During the evaluation, the "Model Evaluation Template" outlined in the document was used to assess three core dimensions: First, the correctness of the reasoning, verifying whether each step of the derivation (e.g., symptoms → pathogenesis → diagnosis) conforms to traditional Chinese medicine theory and corresponding case information, and whether there are logical contradictions or incorrect terminology; second, the logical consistency of the reasoning, judging whether the derivation process is coherent (e.g., without jumpy statements such as "skipping syndrome differentiation and directly giving the treatment method"); and third, the completeness of the reasoning, confirming whether it covers key diagnostic and treatment steps (e.g., the diagnostic scenario should include "extraction of information from the four diagnostic methods → matching of key points of syndrome differentiation → exclusion of other causes"). After quantifying and scoring using the evaluation template, the first evaluation result for each first thought chain data was obtained (e.g., "meets requirements", "reasoning logic needs correction", "key steps missing", etc.), while recording specific problems (e.g., terminology errors, logical breaks).
[0104] After collecting multiple sets of initial assessment results, common problems were analyzed to optimize the generation strategy: If the assessment results showed "insufficient reasoning completeness (e.g., frequently missing 'pathogenesis analysis' steps)," the prompt word engineering was adjusted to explicitly require that "symptom-pathogenesis" correlation analysis be included in the prompt words generated for the thought chain; if there was a problem of "non-standard terminology," the constraint that "TCM terminology must conform to industry standard usage" was added to the prompt words, and a TCM terminology dictionary was supplemented for model reference; if "uneven reasoning depth in different scenarios was found (e.g., lack of 'treatment monitoring plan' derivation in the diagnosis and treatment scenario)," the prompt words were optimized for different treatment scenarios (diagnosis, treatment, usage and dosage, etc.), and the reasoning nodes that need to be covered in each scenario were refined. At the same time, the assessment results were fed back to the model parameter settings to ensure that the subsequently generated thought chains are more in line with clinical diagnosis and treatment logic.
[0105] The seventh question and answer pair information is generated based on new desensitized clinical data, focusing on the clinical scenarios of new medical cases. When generating the fourth thinking chain data, an optimized generation strategy is applied.
[0106] S104, Generate a training set based on the first and second datasets.
[0107] In this embodiment, the first dataset originates from theoretical data such as literature and books, consisting of question-and-answer pairs centered around basic TCM theories (such as the properties and meridians of Chinese herbs, and the composition of prescriptions), emphasizing the systematic nature of knowledge. The second dataset originates from desensitized clinical case records, consisting of question-and-answer pairs focusing on scenarios such as diagnosis and treatment, emphasizing clinical practicality. When generating the training set, the two datasets need to be aggregated, duplicate samples removed, and categorized and sorted according to TCM knowledge categories (such as basic theories and clinical treatment) and scenarios (such as diagnosis and medication), ultimately forming training data that combines theoretical depth and clinical applicability, providing support for the model to simultaneously incorporate TCM theoretical knowledge and clinical diagnostic and treatment capabilities.
[0108] S105, The first diagnostic model is trained based on the data training set to obtain the trained second diagnostic model; wherein, the second diagnostic model is used to output the patient's diagnosis results based on the patient's input symptom information.
[0109] In the embodiments of this application, the first diagnosis and treatment model is usually a basic large model adapted to the field of traditional Chinese medicine (such as a large model of traditional Chinese medicine vertical category), which has basic TCM text understanding and generation capabilities, but lacks specific optimization for clinical diagnosis and treatment scenarios. It needs to be further fine-tuned through data training set to improve its professionalism in order to obtain the trained second diagnosis and treatment model.
[0110] A "progressive training strategy" is adopted, combined with domain-specific data for fine-tuning, to ensure that the model retains basic knowledge while deeply adapting to the logic of traditional Chinese medicine diagnosis and treatment. 1. Basic Fine-tuning: Combination of global fine-tuning and LoRA incremental fine-tuning First, we use theoretical question-and-answer pairs from the first dataset for "global fine-tuning" to solidify the model's basic TCM theoretical framework and avoid "knowledge forgetting" caused by subsequent fine-tuning. Then, we use clinical question-and-answer pairs from the second dataset and the thought chain data for "LoRA incremental fine-tuning," adjusting only some model parameters (such as attention layer weights) to precisely optimize the model's clinical reasoning ability with a small amount of data. At the same time, we retain the learned theoretical knowledge through parameter constraints, solving the problem that "single LoRA fine-tuning cannot retain basic knowledge." 2. Enhanced Logic: Structured Medical Records Inject Diagnostic Thinking During the fine-tuning process, the "structured medical record" technology was introduced to convert the original medical record data (unstructured text) into a structured format that conforms to the logic of "four diagnostic methods information - key points of syndrome differentiation - diagnostic conclusion - theory, method, prescription and medicine". This guides the model to learn the thinking process of traditional Chinese medicine "from the exterior to the interior, syndrome differentiation and treatment". For example, for the case of "wind-cold common cold", the structured record clearly defines the relationship of "chills and fever (symptoms) → floating and tight pulse (signs) → wind-cold binding the exterior syndrome (syndrome differentiation) → pungent and warm exterior-releasing (treatment principle) → Ephedra Decoction (prescription and medicine)", so that the model understands the internal logic of "theory, method, prescription and medicine" rather than simply memorizing the "question-answer" mapping.
[0111] 3. Detail optimization: Sliding window handling context For long text information such as "disease course timeline" and "multiple rounds of treatment adjustments" in TCM medical records, a sliding window technique is used to refine the context of the corpus, ensuring that the model can capture key decision nodes in dynamic changes in the condition (such as "the patient's cough worsened after taking the medicine for 3 days, and the prescription was adjusted to Guizhi Tang combined with Zhike San"), thereby improving the adaptability to dynamic clinical treatment scenarios.
[0112] In addition, to address the issues of "outdated knowledge" and "insufficient reasoning for complex cases" during model training, an efficient retrieval enhancement mechanism based on the Ascend platform is integrated into the training process, forming a closed-loop optimization of "training-retrieval-feedback": 1. Construction and Vectorization of Traditional Chinese Medicine Knowledge Base We integrated high-quality text data (including classical texts, medical records, and question-and-answer pairs) from the first and second datasets to construct a TCM-specific knowledge base. We selected embedding models such as BCEmbedding and M3E, which are adapted to both Chinese and medical fields, to convert text blocks into high-dimensional semantic vectors (an even better approach is to fine-tune a general embedding model using TCM data on the Ascend platform to improve the semantic capture capability of TCM terminology). We stored the vectors in vector databases such as Milvus and FAISS and constructed IVF_FLAT or HNSW indexes to accelerate similarity retrieval and ensure that the model can quickly retrieve relevant knowledge during training.
[0113] 2. Multi-path recall and knowledge rearrangement during training When the model processes complex training samples (such as rare cases or cases with multiple diseases), it acquires auxiliary knowledge through a "multi-path recall" strategy: first, search engine retrieval (calling the Baidu Search API to obtain the top 100 relevant web page texts); second, local database retrieval (based on a txt database constructed from TCM professional books, extracting entity words and synonym matching); and third, vector retrieval (matching semantically similar text blocks in the knowledge base through the BCEmbedding model). Then, the recall results are re-ranked through the BCEmbedding Reranker Model, selecting the most relevant Top-N knowledge fragments to input into the model, assisting the model in generating a more accurate reasoning process (e.g., when the model has doubts about the treatment plan for "lung yin deficiency syndrome" during training, it retrieves the treatment logic of similar cases in the knowledge base to optimize the output).
[0114] 3. Evaluation and Feedback: Dynamically Optimize Training Strategies During training, the output results (question-answer pairs, thought chains) are quantitatively evaluated using model evaluation templates, and scored from three dimensions: "correctness of reasoning" (whether each step conforms to TCM theory), "logic" (whether the deduction is coherent and without jumps), and "completeness" (whether it covers key diagnostic and treatment steps). The evaluation results are fed back to the data generation stage (if the error rate of a certain type of thought chain reasoning is high, the prompt word engineering is optimized) and the fine-tuning stage (if the accuracy of question-answering in clinical scenarios is low, the corresponding case data for fine-tuning is added), forming a dynamic optimization training loop.
[0115] The entire training logic revolves around "enabling the model to not only master the basic theories of traditional Chinese medicine but also possess the ability to diagnose and treat clinical conditions": the first dataset ensures that the model understands "what it is" (e.g., Ma Huang Tang is composed of ephedra, cinnamon twig, etc.), the second dataset ensures that the model masters "how to do it" (e.g., Ma Huang Tang is used for wind-cold syndrome, and Yin Qiao San is used for wind-heat syndrome), and retrieval enhancement ensures that the model can "use it flexibly" (e.g., retrieving similar medical records when dealing with rare cases). Ultimately, the trained model can output complete diagnostic and treatment results, including "diagnostic conclusions, treatment principles, prescriptions, and monitoring suggestions," based on the patient's input symptom information. The results are traceable, the reasoning is interpretable, and they meet the needs of clinical application in traditional Chinese medicine.
[0116] In one embodiment, see Figure 7 This is a schematic diagram of the overall structure of the generated data training set provided in the embodiments of this application, as shown below. Figure 7 As shown, it includes: Step 1: Parallel Input and Preprocessing of Dual Data Sources Document data: Scanned PDF versions of TCM classics and textbooks are converted into structured markdown text using the open-source OCR library MinerU. Then, title level correction (automatic extraction of title features + manual proofreading) is performed to clarify the knowledge source. Finally, a dual adaptive segmentation strategy (dynamic segmentation based on title density and semantic relevance) is used to segment the text to ensure that it meets the context length requirements of large models. Medical record data: Desensitized clinical medical records (including information from the four diagnostic methods, diagnostic conclusions, etc.) are destructured in a structured manner and classified according to scenarios such as diagnosis and treatment, laying the foundation for subsequent scenario-based processing.
[0117] Step 2: Differentiated data processing to generate specialized training data. Literature data: Based on segmented text, DeepSeek-V3.1 is used to generate question-and-answer pairs around core knowledge points. Invalid samples are eliminated through "keyword matching + original text verification". After multi-dimensional screening (accuracy, relevance) and review by TCM professionals, theoretical question-and-answer pairs are obtained. For medical record data: First, generate question-and-answer pairs according to the scenario (e.g., generate questions and answers around "four diagnostic methods → diagnosis" in the diagnosis scenario). Then, generate multiple versions of thought chains based on the question-and-answer pairs. After model evaluation, template quantitative scoring and manual review, select thought chains containing complete reasoning processes to form clinical data consisting of "question-and-answer pairs + thought chains".
[0118] Step 3: Data fusion and fine-tuning, outputting the final training data. The processing results of the two major branches were merged, duplicate samples were removed and classified into categories such as "basic theory, Chinese medicine prescriptions, and clinical diagnosis and treatment". At the same time, the consistency of the data was verified by a rule engine (such as avoiding contradictions between theoretical questions and answers and clinical cases). Finally, a high-quality training dataset covering "theory-clinical-reasoning" was formed, providing comprehensive data support for the training of large-scale models in the TCM vertical category.
[0119] In one embodiment, see Figure 8 This is a schematic diagram of the overall structure for processing clinical data provided in the embodiments of this application, as shown below. Figure 8 As shown, it includes: Medical record preprocessing: First, the original clinical medical records are desensitized (privacy information is removed), and then broken down into structured modules such as basic patient information, four diagnostic methods, diagnostic conclusions, and treatment plans to ensure that the information is complete and meets privacy protection requirements.
[0120] Contextualized question-and-answer pair generation: Question-and-answer pairs are generated based on medical record information according to four core scenarios: diagnosis, treatment, intermediate decision-making, and usage and dosage. For example, the diagnosis scenario generates questions and answers around "four diagnostic methods data → diagnosis conclusion", and the treatment scenario focuses on "diagnosis → treatment plan" to ensure that the content of the questions and answers is consistent with clinical practice.
[0121] Thought chain generation and optimization: Based on question-answer pairs, multiple versions of thought chains (including the "symptom-differentiation-decision" reasoning process) are generated by the model through prompt word engineering. After quantitative scoring by the model evaluation template and secondary review by TCM professionals, the optimal thought chain is selected and optimized, and finally structured data of "question-answer pairs + thought chain" is formed, which provides clinical diagnosis and treatment logic support for model training.
[0122] In one embodiment, see Figure 9 This is a schematic diagram of the overall structure of the progressive training strategy provided in the embodiments of this application, as shown below. Figure 9 As shown, it includes: I. Process Initiation: High-Quality Data Input (HQ-GCM-RA-C1) Using the pre-processed “HQ-GCM-RA-C1” as the initial input, this data is a standardized training data that integrates TCM theory-based question-and-answer pairs (generated by processing literature and books) and clinical case question-and-answer pairs containing thought chains (generated by processing real medical cases). It has been cleaned, classified and quality checked, providing “theory + clinical” dual-dimensional materials for subsequent training.
[0123] II. Core Training Components: Step-by-Step Fine-Tuning and Retrieval Enhancement Collaboration 1. Data Format Transformation: The generated data segmented dialogue set transforms static question-and-answer pairs and thought chain data into multi-turn dialogue samples, simulating clinical "doctor-patient interaction" scenarios (such as "user asks about patient symptoms → model makes initial diagnosis → user asks for further diagnosis evidence → model deepens reasoning"), avoiding the model's rigid "question-answer" mapping and adapting to the dynamic diagnosis and treatment logic of traditional Chinese medicine.
[0124] 2. Phased fine-tuning: Global fine-tuning + LoRA incremental fine-tuning 1) Global fine-tuning: Use data on basic TCM theories (such as the properties and meridians of Chinese herbs, and Q&A on formula composition) to adjust the global parameters of the model, solidify the basic association between "theory, method, formula and medicine" (such as "wind-cold binding the exterior syndrome → pungent and warm relieving the exterior syndrome → Ephedra Decoction"), and prevent subsequent fine-tuning from causing "forgetting basic knowledge"; 2) LoRA Incremental Fine-tuning: Using clinical data (including case questions and answers in the thought chain), only local parameters such as the model's attention layer are optimized to accurately improve clinical reasoning ability (such as individualized prescription adjustment and dynamic monitoring of disease condition) with a small amount of data. At the same time, the theoretical knowledge learned by global fine-tuning is preserved through parameter constraints, which solves the problem of insufficient professionalism of single LoRA fine-tuning.
[0125] 3) Retrieval Enhancement Branch: Two retrieval enhancement branches are simultaneously activated during the incremental fine-tuning process of dual-dimensional knowledge supplementation to supplement the model with external knowledge: 4) Instance-based retrieval enhancement: Real-time retrieval of clinical cases (such as syndrome differentiation cases with similar symptoms) in the TCM knowledge base that are similar to the current training samples, providing instance references and optimizing dynamic disease reasoning; 5) Enhanced retrieval based on entity relationships: Relying on the TCM knowledge graph, retrieve the relationships between entities (such as diseases and Chinese medicines) in the training samples (such as "Ephedra - warm and pungent exterior-wind-cold exterior syndrome"), strengthen the understanding of the internal logic of "theory, method, prescription and medicine", and avoid reasoning breaks.
[0126] III. Logic Optimization: Adapting to Traditional Chinese Medicine Diagnostic and Treatment Thinking 1. Structured medical records improve diagnostic logic By introducing structured medical record technology, the original unstructured medical record text is converted into a structured format of "four diagnostic methods information - key points of syndrome differentiation - diagnostic conclusion - treatment principle and prescription" (such as "aversion to cold and fever, floating and tight pulse → wind-cold binding the exterior syndrome → pungent and warm exterior-releasing → ephedra decoction"). This guides the model to learn the clinical thinking of "from the exterior to the interior, syndrome differentiation and treatment" rather than simply memorizing text fragments.
[0127] 2. Sliding window for processing corpus context For long texts in medical records, such as "disease course timeline" and "multiple rounds of treatment adjustments", the sliding window technology is used to process them in segments for fine detail, ensuring that the model captures key decision nodes in dynamic disease conditions (such as "the patient's cough worsened after taking the medicine for 3 days, and the prescription was adjusted to Guizhi Tang combined with Zhike San"), thereby improving the adaptability to dynamic clinical scenarios.
[0128] IV. Process Objectives: To achieve "knowledge retention + clinical adaptation" Ultimately, through the above process, the model retains the basic theories of traditional Chinese medicine while deeply understanding the core logic of "integration of the four diagnostic methods" and "personalized diagnosis and treatment." It can accurately answer theoretical questions and output diagnosis and treatment results with complete reasoning based on the patient's symptoms, thus meeting the professional and logical requirements of clinical application in traditional Chinese medicine.
[0129] In one embodiment, see Figure 10 This is a schematic diagram of the TCM diagnosis and treatment logic generation structure of the structured medical record provided in the embodiments of this application, such as... Figure 10 As shown, it includes: Step 1: Input Information Preparation and Import. First, collect the desensitized unstructured original medical record data (single or multiple copies) to ensure that the data contains complete information on the four diagnostic methods and treatment-related records. At the same time, write system prompts according to the principle of "extraction of information on the four diagnostic methods, theory, method, prescription and medicine", clarify the format and logical requirements of the structured output, and import the original data and system prompts together into the Hengqin Big Model.
[0130] Step Two: Large Model Analysis and Structured Transformation. The Hengqin large model first performs "information extraction": identifying and classifying patient information and four diagnostic methods from the raw data (such as removing redundant descriptions of lifestyle habits and retaining chief complaints related to the symptoms, such as "chills and fever"); then it performs "logical association": based on traditional Chinese medicine theory, it establishes a mapping between the extracted four diagnostic methods and the syndrome differentiation results, treatment principles, and prescriptions (such as matching "no sweating, floating and tight pulse" with "wind-cold binding the exterior syndrome", and then corresponding to the treatment principle of "releasing the exterior with pungent and warm herbs" and the prescription of "Ephedra Decoction"), ensuring that the information logic of each module is coherent.
[0131] Step 3: Output structured medical records and validate the model. Output structured medical records according to the target data format. The records should clearly present the diagnosis and treatment chain of "patient information → four diagnostic methods → theoretical methods → prescription drugs". Subsequently, TCM professionals can verify the output results to confirm the completeness of the extraction of the four diagnostic methods (such as no omission of key signs such as "floating and tight pulse") and the matching of syndrome differentiation and prescription drugs (such as "wind-cold binding the exterior syndrome" without mismatching wind-heat type prescription drugs such as "Yinqiao Powder"). Ensure that the structured records comply with clinical diagnosis and treatment standards and can be used for subsequent model training or clinical auxiliary reference. It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0132] Corresponding to the high-quality data generation method and the training method for the diagnostic assistance model in the above embodiments, Figure 11 This is a structural block diagram of the high-quality data generation device and the diagnostic assistance model training device provided in the embodiments of this application. For ease of explanation, only the parts related to the embodiments of this application are shown.
[0133] Reference Figure 11 The device 11 includes: The text data acquisition module 111 is used to acquire first text data and second text data; wherein, the first text data is theoretical data and the second text data is clinical data. The first dataset generation module 112 is used to generate a first dataset based on the first text data; wherein, the first dataset contains multiple sets of first question-and-answer pairs generated for the first text data; wherein, a set of first question-and-answer pairs contains a first question posed for the first text data and a first answer to the first question; The second dataset generation module 113 is used to generate a second dataset based on the second text data; wherein the second dataset contains multiple sets of second question-and-answer pairs generated for the second text data; wherein each set of second question-and-answer pairs contains a second question posed for the second text data and a second answer to the second question; The data training set generation module 114 is used to generate a data training set based on the first dataset and the second dataset. The model training module 115 is used to train the first diagnosis and treatment model based on the data training set to obtain the trained second diagnosis and treatment model; wherein, the second diagnosis and treatment model is used to output the diagnosis and treatment results of the patient based on the symptom information input by the patient.
[0134] Optionally, the first dataset generation module 112 is also used for: The first text data is converted into a third text data in a preset format; wherein the third text data contains multiple text titles and a fourth text data corresponding to each text title; the fourth text data is contained within the third text data; The text titles in the third text data are corrected to obtain the corrected fourth text data; The first dataset is generated based on the fourth text data.
[0135] Optionally, the first dataset generation module 112 is also used for: The fourth text data is divided into blocks to obtain multiple first data blocks; For each first data block, the first data block is input into the first preset model to obtain multiple sets of third question-answer pairs corresponding to the first data block; wherein, a set of third question-answer pairs contains a third question raised for the first data block and a third answer to the third question; The first dataset is generated based on multiple sets of third question-and-answer pairs corresponding to each first data block.
[0136] Optionally, the first dataset generation module 112 is also used for: For each set of third question-answer pairs corresponding to each first data block, extract the first keyword corresponding to the third question in each third question-answer pair; Extract the second keyword corresponding to the first data block of the third question-and-answer pair information; Calculate the semantic similarity between the first keyword and the second keyword; If the semantic similarity is lower than the preset threshold, the third question-and-answer pair information corresponding to the first keyword will be filtered out to obtain the filtered fourth question-and-answer pair information. The first dataset is generated based on the information from the fourth question and answer pair corresponding to each first data block.
[0137] Optionally, the second dataset generation module 113 is also used for: The second text data is divided into multiple different second data blocks; each second data block corresponds to a treatment scenario; the treatment scenario includes at least one of the following: diagnosis scenario, treatment scenario, intermediate decision-making scenario, and medication dosage scenario. For each second data block, input the second data block into the first preset model to obtain multiple sets of fifth question-answer pairs corresponding to the second data block; The second dataset is generated based on the information from multiple sets of fifth question-and-answer pairs corresponding to each second data block.
[0138] Optionally, the second dataset generation module 113 is also used for: For each set of fifth question-and-answer pairs corresponding to each second data block, generate multiple first thought chain data for each fifth question-and-answer pair; wherein, the first thought chain data is question-and-answer data with reasoning process; By filtering multiple first-thinking chain data, at least one second-thinking chain data is obtained; Obtain the modified third thought chain data corresponding to the second thought chain data; A training set is generated based on the first dataset and at least one third thought chain data corresponding to each fifth question and answer.
[0139] The high-quality data generation device and the training device for the diagnostic assistance model 11 also include a quality assessment module 116, used for: Perform a quality assessment on each first thought chain data point to obtain the first assessment result corresponding to each first thought chain data point; Optimize the mind chain data generation strategy based on multiple first assessment results; The fourth thought chain data corresponding to the sixth question-and-answer pair information is generated according to the thought chain data generation strategy; among them, the sixth question-and-answer pair information is a question-and-answer pair information generated based on new clinical data.
[0140] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0141] in addition, Figure 11 The data generation device based on high-quality data shown can be a software unit, a hardware unit, or a combination of software and hardware built into existing terminal devices. It can also be integrated into terminal devices as an independent component or exist as a standalone terminal device.
[0142] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0143] Figure 12 This is a schematic diagram of the structure of the terminal device provided in the embodiments of this application. For example... Figure 12 As shown, the terminal device 12 of this embodiment includes: at least one processor 120 ( Figure 12 (Only one is shown in the image) a processor, a memory 121, and a computer program 122 stored in the memory 121 and executable on at least one processor 120. When the processor 120 executes the computer program 122, it implements the steps in the embodiments of the methods for generating any of the high-quality data and training the diagnostic and therapeutic assistance model described above.
[0144] The terminal device can be a computing device such as a desktop computer, laptop, handheld computer, or cloud server. This terminal device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that... Figure 12 This is merely an example of terminal device 12 and does not constitute a limitation on terminal device 12. It may include more or fewer components than shown, or combine certain components, or different components, such as input / output devices, network access devices, etc.
[0145] The processor 120 may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0146] In some embodiments, memory 121 may be an internal storage unit of terminal device 12, such as a hard disk or memory of terminal device 12. In other embodiments, memory 121 may be an external storage device of terminal device 12, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, etc., equipped on terminal device 12. Furthermore, memory 121 may include both internal and external storage units of terminal device 12. Memory 121 is used to store operating system, application programs, boot loader, location information, and other programs, such as program code of computer programs. Memory 121 may also be used to temporarily store location information that has been output or will be output.
[0147] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can implement the steps in the above-described method embodiments.
[0148] This application provides a computer program product that, when run on a terminal device, enables the terminal device to implement the steps described in the various method embodiments above.
[0149] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. A computer-readable medium can include at least: any entity or device capable of carrying computer program code to a device / terminal equipment, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.
[0150] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0151] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0152] In the embodiments provided in this application, it should be understood that the disclosed apparatus / terminal devices and methods can be implemented in other ways. For example, the apparatus / terminal device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0153] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0154] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A method for generating high-quality data and a method for training a diagnostic assistance model, characterized in that, The method includes: Acquire first text data and second text data; wherein, the first text data is theoretical data and the second text data is clinical data; A first dataset is generated based on the first text data; wherein the first dataset contains multiple sets of first question-and-answer pairs generated for the first text data; wherein each set of first question-and-answer pairs contains a first question posed for the first text data and a first answer to the first question; A second dataset is generated based on the second text data; wherein the second dataset contains multiple sets of second question-and-answer pairs generated for the second text data; wherein each set of the second question-and-answer pairs contains a second question posed for the second text data and a second answer to the second question; Generate a training set based on the first dataset and the second dataset; The first diagnostic model is trained using the data training set to obtain a trained second diagnostic model; wherein the second diagnostic model is used to output the diagnostic results of the patient based on the symptom information input by the patient.
2. The method for generating high-quality data and training a diagnostic assistance model as described in claim 1, characterized in that, The step of generating the first dataset based on the first text data includes: The first text data is converted into third text data in a preset format; wherein, the third text data includes multiple text titles and fourth text data corresponding to each text title; the fourth text data is contained within the third text data; The text title in the third text data is corrected to obtain the corrected fourth text data; The first dataset is generated based on the fourth text data.
3. The method for generating high-quality data and training a diagnostic assistance model as described in claim 2, characterized in that, The step of generating the first dataset based on the fourth text data includes: The fourth text data is divided into blocks to obtain multiple first data blocks; For each first data block, the first data block is input into a first preset model to obtain multiple sets of third question-answer pairs corresponding to the first data block; wherein, each set of the third question-answer pairs includes a third question raised for the first data block and a third answer to the third question; The first dataset is generated based on the multiple sets of third question-and-answer pairs corresponding to each of the first data blocks.
4. The method for generating high-quality data and training a diagnostic assistance model as described in claim 3, characterized in that, The step of generating the first dataset based on the multiple sets of third question-and-answer pairs corresponding to each first data block includes: For each of the first data blocks, obtain the fourth question-answer pair information; wherein, the fourth question-answer pair information is any one of the multiple sets of the third question-answer pair information corresponding to the first data block; Extract the first keyword corresponding to the third question from the information in the fourth question-and-answer pair; Extract the second keyword from the first data block corresponding to the fourth question-and-answer pair information; Calculate the semantic similarity between the first keyword and the second keyword; If the semantic similarity is lower than a preset threshold, the information in the fourth question-and-answer pair will be filtered out. After traversing multiple third question-and-answer pairs in each of the first data blocks, the fifth question-and-answer pairs after filtering out each first data block are obtained; The first dataset is generated based on the fifth question-and-answer pair information corresponding to each of the first data blocks.
5. The method for generating high-quality data and training a diagnostic assistance model as described in claim 1, characterized in that, The step of generating the second dataset based on the second text data includes: The second text data is divided into multiple different second data blocks; wherein, each second data block corresponds to a treatment scenario; wherein, the treatment scenario includes at least one of the following: diagnosis scenario, treatment scenario, intermediate decision-making scenario, and medication dosage scenario; For each of the second data blocks, the second data block is input into the first preset model to obtain multiple sets of sixth question-answer pairs corresponding to the second data block; The second dataset is generated based on the multiple sets of sixth question-and-answer pairs corresponding to each of the second data blocks.
6. The method for generating high-quality data and training a diagnostic assistance model as described in claim 5, characterized in that, The step of generating the second dataset based on the multiple sets of sixth question-and-answer pairs corresponding to each second data block includes: For each of the multiple sets of the sixth question-and-answer pairs corresponding to each of the second data blocks, multiple first thought chain data are generated for each of the sixth question-and-answer pairs; wherein, the first thought chain data is question-and-answer data with a reasoning process; Filter multiple first thought chain data to obtain at least one second thought chain data; Obtain the modified third thought chain data corresponding to the second thought chain data; The second dataset is generated based on at least one of the third thought chain data corresponding to each of the sixth question-and-answer information.
7. The method for generating high-quality data and training a diagnostic assistance model as described in claim 6, characterized in that, The method further includes: Perform a quality assessment on each of the first thought chain data points to obtain the first assessment result corresponding to each of the first thought chain data points; Optimize the mind chain data generation strategy based on multiple first evaluation results; The fourth thought chain data corresponding to the sixth question-and-answer pair information is generated according to the thought chain data generation strategy; wherein, the sixth question-and-answer pair information is a question-and-answer pair information generated based on new clinical data.
8. A device for generating high-quality data and a device for training a diagnostic and treatment assistance model, characterized in that, include: The text data acquisition module is used to acquire first text data and second text data; wherein, the first text data is theoretical data and the second text data is clinical data; The first dataset generation module is used to generate a first dataset based on the first text data; wherein the first dataset contains multiple sets of first question-and-answer pairs generated for the first text data; wherein each set of first question-and-answer pairs contains a first question posed for the first text data and a first answer to the first question; The second dataset generation module is used to generate a second dataset based on the second text data; wherein the second dataset contains multiple sets of second question-and-answer pairs generated for the second text data; wherein each set of second question-and-answer pairs contains a second question posed for the second text data and a second answer to the second question; A data training set generation module is used to generate a data training set based on the first dataset and the second dataset; The model training module is used to train the first diagnostic model based on the data training set to obtain the trained second diagnostic model; wherein the second diagnostic model is used to output the patient's diagnostic results based on the patient's input symptom information.
9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 7.