Special disease library production method, system and equipment and storage medium
By combining structured prompt words and glm4-9b-chat model, structured variable text data is generated, which solves the problems of high data annotation cost and complex rule maintenance in the construction of existing special disease databases, and realizes an efficient special disease database. Production.
Patent Information
- Application Number
- CN202411433637.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-15
- Publication Date
- 2024-11-12
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing specialized disease database construction method relies on a large amount of labeling data and complex rules, which leads to high data labeling costs and complex rules maintenance, making it difficult to deal with diversified medical record data.
Structured prompt words are used to label the sample medical record text physically and relationally, and structured variable text data is generated through glm4-9b-chat model training, reducing dependence on a large amount of annotated data and improving productivity.
It reduces labor and time costs, improves the production efficiency of the specialized disease database, and can quickly adapt to new tasks.
Smart Images

Figure CN118939805A_ABST
Abstract
Description
Background Art
[0002] With the rapid development of medical technology and the improvement of medical informationization, the amount of data in electronic medical records, as an important carrier of medical information, has shown explosive growth. Electronic medical records contain a large amount of patient information, diagnosis information, treatment information, and medical records, which are of great value for disease diagnosis, treatment, and subsequent research.
[0003] A disease-specific database refers to a medical database or knowledge base established for a specific disease or disease type. It usually contains professional knowledge and information on the clinical characteristics, diagnostic criteria, treatment methods, drug information, prognosis evaluation, etc. of the disease. The establishment of a disease-specific database aims to provide an authoritative and accurate source of information for medical professionals, researchers, patients and other relevant groups to better understand the relevant knowledge and information of a specific disease. It can help doctors diagnose diseases and make treatment decisions, provide researchers with disease data and research progress, and help patients understand and manage their own diseases.
[0004] The existing methods for building disease-specific databases mainly rely on a large amount of annotated data and complex rules, and have the following main problems: 1. High data annotation cost: A large amount of manual data annotation is required, which consumes manpower and time; 2. Complex rule maintenance: The writing and maintenance of rules are complex, and the rules have poor adaptability and are difficult to cope with diverse medical record data.
[0005] To this end, the present invention provides a method, system, equipment and storage medium for producing a special disease library. Summary of the invention
[0006] The object of the present invention is to provide a method, system, equipment and storage medium for producing a special disease library, so as to solve any of the technical problems mentioned above.
[0007] In order to achieve the above object, the present invention provides the following technical solutions: In a first aspect, a method for producing a disease-specific library is provided, the method comprising: Step S1: constructing structured prompt words, the structured prompt words include field names and field explanations; Step S2: annotate the sample medical record text with entities and relationships based on the structured prompt words to obtain a combined text; Step S3: concatenate the sample medical record text and the combined text corresponding to the sample medical record text to obtain training text data; Step S4: input the training text data into the glm4-9b-chat model, perform model training on the glm4-9b-chat model, and obtain a trained glm4-9b-chat model; Step S5: Input the medical record text used to generate the disease-specific library and the structured prompt words generated in step S1 into the trained glm4-9b-chat model to generate structured variable text data, and store the structured variable text data in the database to generate the disease-specific library.
[0008] Furthermore, in step S1, a structured prompt word is constructed, and the structured prompt word includes a field name and a field explanation, including the following specific steps: Extract the entities and relations of the medical record text to obtain the field names contained in the medical record text; Construct a field explanation capable of obtaining the field name; The field name and the field explanation are combined to obtain a structured prompt word.
[0009] Furthermore, the sample medical record text is annotated with entities and relationships based on the structured prompt words to obtain a combined text, including: Read sample medical record text; Based on the field names and field explanations, extracting text data corresponding to the field explanations contained in the sample medical record text; The extracted text data and the field name are combined to obtain a combined text.
[0010] Furthermore, the combined text is text data in JSON format.
[0011] Further, in step S4, the training text data is input into the glm4-9b-chat model, and the glm4-9b-chat model is trained to obtain a trained glm4-9b-chat model, which includes the following specific steps: Step S41: controlled by the parameter batch_size, several sets of training text data are input into the glm4-9b-chat model; Step S42: the glm4-9b-chat model performs forward propagation calculation on the training text data to generate pre-output data; Step S43: Calculate the difference between the pre-output data and the target text data by using a cross entropy loss function, wherein the target text data refers to the field name in the combined text in the training text data; Step S44: Based on the difference between the pre-output data and the target text data, the gradient of the parameters of the glm4-9b-chat model is calculated by the back propagation algorithm; Step S45: adjusting the parameters of the glm4-9b-chat model according to the gradient through the optimizer; Step S46: Return to execute steps S41 to S46 until the model training is completed.
[0012] Furthermore, the expression of the cross entropy loss function is:
[0013] In the formula, represents the difference between the pre-output data and the target text data, M represents the size of the vocabulary of the target text data, Represents the first one-hot encoding of the target word in the target text data elements, Indicates the first The probability that the word is the next word.
[0014] Further, in step S46, the model training ends when any of the following conditions are met: Reach the preset number of training times for the model; The difference between the pre-output data and the target text data is less than or equal to a preset threshold; The difference between the pre-output data and the target text data remains unchanged.
[0015] In a second aspect, a disease-specific library production system is provided, the system comprising: A structured prompt word construction unit is used to construct a structured prompt word. The structured prompt word includes a field name and a field explanation. A combined text generation unit is used to annotate entities and relationships of sample medical record text based on structured prompt words to obtain a combined text; A training text data generating unit is used to concatenate the sample medical record text and the combined text corresponding to the sample medical record text to obtain training text data; A model training unit is used to input the training text data into the glm4-9b-chat model, perform model training on the glm4-9b-chat model, and obtain a trained glm4-9b-chat model; The disease-specific library generation unit is used to input the medical record text used to generate the disease-specific library and the structured prompt words generated by the structured prompt word construction unit into the trained glm4-9b-chat model to generate structured variable text data, and store the structured variable text data in a database to generate a disease-specific library.
[0016] According to a third aspect, an electronic device includes: at least one processor; and a memory communicatively coupled to the at least one processor; The memory stores computer program instructions that can be executed by at least one processor, and the computer program instructions are executed by the at least one processor to enable the at least one processor to execute the method for producing a special disease library described in the above aspects.
[0017] In a fourth aspect, a non-transitory computer-readable storage medium stores computer instructions, wherein the computer instructions enable the computer to execute the method for producing a disease-specific library according to the above aspects. Beneficial effects of the present invention: The present invention trains the glm4-9b-chat model. It only needs to annotate a small amount of sample medical record texts to obtain combined texts, and then input the sample medical record texts and the combined texts corresponding to the sample medical record texts into the glm4-9b-chat model for model training. After the model is trained, the medical record texts and structured prompt words used to generate a special disease library are input into the trained glm4-9b-chat model to generate structured variable text data. The structured variable text data is stored in a database to generate a special disease library. This process reduces the dependence on a large amount of annotated data and reduces manpower and time costs.
[0018] The present invention labels sample medical record texts based on structured prompt words to obtain combined texts, and inputs the combined texts obtained based on the structured prompt words into the glm4-9b-chat model for training. The trained glm4-9b-chat model can quickly adapt to new tasks, greatly improving the production efficiency of the special disease database.
[0019] These and other objects, features and advantages of the present invention will be fully reflected in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 A schematic flow chart of the method for producing a disease-specific library of the present invention is shown. DETAILED DESCRIPTION
[0021] The following description is used to disclose the present invention so that those skilled in the art can implement the present invention. The preferred embodiments described below are only examples, and those skilled in the art can think of other obvious variations. The basic principles of the present invention defined in the following description can be applied to other embodiments, variations, improvements, equivalents, and other technical solutions that do not deviate from the spirit and scope of the present invention.
[0022] It should be understood by those skilled in the art that, in the disclosure of the specification, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device including a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices. Therefore, the above terms should not be understood as limiting the present invention.
[0023] It is to be understood that the term "one" should be understood as "at least one" or "one or more", that is, in one embodiment, the number of an element may be one, while in another embodiment, the number of the element may be multiple, and the term "one" should not be understood as a limitation on the quantity.
[0024] like Figure 1 As shown, the present invention provides a method for producing a disease-specific library, the method comprising the following steps S1 to S5; Step S1: construct structured prompt words, which include field names and field explanations.
[0025] Understandably, the structured prompt words include field names and field explanations, for example, "Field Name (Chief Symptom)": "Fever", "Field Explanation": "Abnormal sensations and states manifested by the body due to illness", "Field Name (Onset Time)": "June 2022", "Field Explanation": "The time when the patient develops the disease".
[0026] Step S2: annotating entities and relationships of the sample medical record text based on the structured prompt words to obtain a combined text. The structured prompt words are used as annotation templates, and the sample medical record text is annotated based on the structured prompt words to obtain a combined text.
[0027] As you can understand, annotation is a commonly used technology in data processing, information extraction, machine learning and other fields, which is used to add additional information or metadata to data or text for subsequent analysis, processing or display. Annotation can convert unstructured text data into structured data. Through annotation, key information in the text can be extracted in the form of field-value pairs to form a structured data set.
[0028] The following medical information is to be extracted: Field name (Chief complaint): "fever"; Field explanation: Abnormal sensations and states manifested by the body due to disease; The combined text is text data in JSON format. An example of JSON format is: {“‘Main complaint’: ‘Irregular menstrual cycle, 6-8 days, 25-35 days, dysmenorrhea’, ‘Field explanation’: ‘Abnormal sensations and states manifested by the body due to illness’; ‘Time of onset’: ‘’, ‘Field explanation’: ‘The time when the patient develops the illness’”}.
[0029] Field names are predefined names used to describe the properties of a specific part of data or text. Field names are the basis of the annotation process, and they provide clear goals and directions for annotation.
[0030] Field explanation is a further description or definition of the field name, which aims to clarify the specific content, format or requirements represented by the field.
[0031] Step S3: concatenate the sample medical record text and the combined text corresponding to the sample medical record text to obtain training text data.
[0032] Step S4: input the training text data into the glm4-9b-chat model, perform model training on the glm4-9b-chat model, and obtain a trained glm4-9b-chat model.
[0033] Step S5: Input the medical record text used to generate the disease-specific library and the structured prompt words generated in step S1 into the trained glm4-9b-chat model to generate structured variable text data, and store the structured variable text data in the database to generate the disease-specific library.
[0034] It can be understood that the medical record text used to generate the disease-specific database and the field explanation that can obtain the field name contained in the medical record text are input into the trained glm4-9b-chat model. For example, the medical record text: "The patient needs a second operation due to unclear surgical margins; the surgical incision healing grade is low, the postoperative bleeding is large, and hemostatic drugs need to be increased; severe complications occur after surgery, and the patient's condition needs to be closely observed, and nutritional support treatment is carried out at the same time." Field explanation: "Abnormal sensations and states manifested by the body due to the occurrence of the disease." Structured variable text data: "Field name (here is the main complaint): Low surgical incision healing grade, large postoperative bleeding, severe complication grade".
[0035] The present invention trains the glm4-9b-chat model. It only needs to annotate a small amount of sample medical record texts to obtain combined texts, and then input the sample medical record texts and the combined texts corresponding to the sample medical record texts into the glm4-9b-chat model for model training. After the model is trained, the medical record texts and structured prompt words used to generate a special disease library are input into the trained glm4-9b-chat model to generate structured variable text data. The structured variable text data is stored in a database to generate a special disease library. This process reduces the dependence on a large amount of annotated data and reduces manpower and time costs.
[0036] The present invention labels sample medical record texts based on structured prompt words to obtain combined texts, and inputs the combined texts obtained based on the structured prompt words into the glm4-9b-chat model for training. The trained glm4-9b-chat model can quickly adapt to new tasks, greatly improving the production efficiency of the special disease database.
[0037] For example, in step S1, a structured prompt word is constructed, and the structured prompt word includes a field name and a field explanation, including the following specific steps: Extract the entities and relations of the medical record text to obtain the field names contained in the medical record text; Construct a field explanation capable of obtaining the field name; The field name and the field explanation are combined to obtain a structured prompt word.
[0038] The medical record text contains entities and relationships. The entities and relationships in the medical record text are extracted to obtain structured prompt words. The structured prompt words are equivalent to annotation templates, which are used to guide the annotation of sample medical record texts.
[0039] In this embodiment, in step S2, entity and relationship annotations are performed on the sample medical record text based on the structured prompt words to obtain a combined text, including: Reading the sample medical record text; Based on the field names and field explanations, extracting text data corresponding to the field explanations contained in the sample medical record text; The extracted text data and the field name are combined to obtain a combined text.
[0040] It can be understood that the structured prompt words are: "'Field name (main complaint)': 'fever', 'field explanation': 'abnormal sensations and states manifested by the body due to the occurrence of the disease'; 'Field name (onset time)': 'June 2022', 'field explanation': 'the time when the patient develops the disease'"; medical record text: "The patient is 29 years old, married, with one son, irregular menstrual cycle, menstrual period of 6-8 days, cycle of 25-35 days, dysmenorrhea, 1 pregnancy, 1 live birth, menopause age of 50 years old"; then the entities and relationships of the medical record text are annotated according to the structured prompt words, and the resulting combined text is: {"'Main complaint': 'irregular menstrual cycle, menstrual period of 6-8 days, cycle of 25-35 days, dysmenorrhea', 'field explanation': 'abnormal sensations and states manifested by the body due to the occurrence of the disease'; 'onset time': '', 'field explanation': 'the time when the patient develops the disease'"}. It can be understood that the extracted text data is the text content corresponding to the main complaint symptom (onset time). In this embodiment, since the sample medical record text does not include the onset time, the obtained combined text has 'onset time':''.
[0041] In this embodiment, in step S4, the training text data is input into the glm4-9b-chat model, and the glm4-9b-chat model is trained to obtain a trained glm4-9b-chat model, including steps S41 to S46; Step S41: controlled by the parameter batch_size, several groups of training text data are input into the glm4-9b-chat model.
[0042] Step S42: The glm4-9b-chat model performs forward propagation calculation on the training text data to generate pre-output data.
[0043] Step S43: Calculate the difference between the pre-output data and the target text data by using a cross entropy loss function, where the target text data refers to the field name in the combined text in the training text data.
[0044] Step S44: Based on the difference between the pre-output data and the target text data, the gradient of the parameters of the glm4-9b-chat model is calculated by the back propagation algorithm.
[0045] It can be understood that the glm4-9b-chat model includes an input layer, a hidden layer and an output layer, and calculating the gradient of the parameters of the glm4-9b-chat model by the back propagation algorithm includes steps S441 to S443; Step S441: Starting from the output layer, calculate the gradient of each neuron; Step S442: Update the parameters of neurons in the hidden layer according to the gradient; Step S443: Repeat steps S441-S443 until the neurons in the input layer are updated.
[0046] Step S45: Adjust the parameters of the glm4-9b-chat model according to the gradient through the optimizer.
[0047] Step S46: Return to execute steps S41 to S46 until the model training is completed.
[0048] In this embodiment, the expression of the cross entropy loss function is:
[0049] In the formula, represents the difference between the pre-output data and the target text data, M represents the size of the vocabulary of the target text data, Represents the first one-hot encoding of the target word in the target text data elements, Indicates the first The probability that the word is the next word.
[0050] As you can understand, one-hot encoding is a text representation method in which each target word is represented as a vector in which only the position of the corresponding word is 1 and the rest of the positions are 0.
[0051] For example, suppose there is a vocabulary containing three words: "apple", "banana", and "cherry". If the target word is "apple", it can be represented as [1,0,0] using one-hot encoding; if the target word is "banana", it can be represented as [0,1,0]; if the target word is "cherry", it can be represented as [0,0,1].
[0052] Exemplarily, in step S46, the end of model training includes any one of the following conditions: Reach the preset number of training times for the model; The difference between the pre-output data and the target text data is less than or equal to a preset threshold; The difference between the pre-output data and the target text data remains unchanged.
[0053] It can be understood that during the model training process, the transformers library is used to load the glm4-9b-chat model, and the glm4-9b-chat model is used to serialize the medical text training data set; the serialized medical text training data set is used to train the glm4-9b-chat model, and the back propagation algorithm is used to update the parameters of the glm4-9b-chat model until the expected output is generated according to the instructions.
[0054] Exemplarily, the method for generating a disease-specific library further includes: Use the transformers library to load the fine-tuned trained model. After loading the model, select the appropriate structured prompt word template according to the specific task requirements. These templates are pre-designed (consistent with the annotated data) and can help the model better understand the task requirements and context.
[0055] Each medical record source's disease database production task may require different types of templates. By selecting a structured prompt word template designed for a specific task, the model can be guided to generate the required fields.
[0056] In the text generation stage, the beam search algorithm can be used to consider multiple possible output paths during the generation process, thereby selecting the best output sequence.
[0057] At the same time, by adjusting the generation temperature (diversity temperature adjustment), the diversity and innovation of the output text can be controlled. A lower temperature will make the model more inclined to generate common or repeated text, while a higher temperature encourages the model to generate more diverse text.
[0058] When the model generates text, by analyzing the output, the prompt word template and generation parameters (such as beam width and temperature) can be further adjusted to ensure that the generated text meets the task requirements and quality standards to the greatest extent.
[0059] The embodiment of the present invention further provides a disease-specific library production system, the system comprising: A structured prompt word construction unit is used to construct a structured prompt word. The structured prompt word includes a field name and a field explanation. A combined text generation unit is used to annotate entities and relationships of sample medical record text based on structured prompt words to obtain a combined text; A training text data generating unit is used to concatenate the sample medical record text and the combined text corresponding to the sample medical record text to obtain training text data; A model training unit is used to input the training text data into the glm4-9b-chat model, perform model training on the glm4-9b-chat model, and obtain a trained glm4-9b-chat model; The disease-specific library generation unit is used to input the medical record text used to generate the disease-specific library and the structured prompt words generated by the structured prompt word construction unit into the trained glm4-9b-chat model to generate structured variable text data, and store the structured variable text data in a database to generate a disease-specific library.
[0060] An embodiment of the present invention further provides an electronic device, comprising: a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus. The communication bus can be used for information transmission between the electronic device and the sensor. The processor can call the logic instructions in the memory to execute the following method: Step S1: Construct a structured prompt word, the structured prompt word includes a field name and a field explanation; Step S2: Based on the structured prompt word, the sample medical record text is annotated with entities and relationships to obtain a combined text; Step S3: The sample medical record text and the combined text corresponding to the sample medical record text are spliced to obtain training text data; Step S4: The training text data is input into the glm4-9b-chat model, and the glm4-9b-chat model is trained to obtain a trained glm4-9b-chat model; Step S5: The medical record text used to generate a special disease library and the structured prompt word generated in step S1 are input into the trained glm4-9b-chat model to generate structured variable text data, and the structured variable text data is stored in the database to generate a special disease library.
[0061] In addition, the logic instructions in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program code.
[0062] An embodiment of the present invention provides a non-transitory computer-readable storage medium, which stores computer instructions. The computer instructions enable a computer to execute the method provided by the above method embodiment, for example, including: Step S1: Construct structured prompt words, which include field names and field explanations; Step S2: Annotate the sample medical record text with entities and relationships based on the structured prompt words to obtain a combined text; Step S3: Concatenate the sample medical record text and the combined text corresponding to the sample medical record text to obtain training text data; Step S4: Input the training text data into the glm4-9b-chat model, train the glm4-9b-chat model, and obtain a trained glm4-9b-chat model; Step S5: Input the medical record text used to generate a special disease library and the structured prompt words generated in step S1 into the trained glm4-9b-chat model to generate structured variable text data, and store the structured variable text data in a database to generate a special disease library.
[0063] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean 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 embodiment of the present invention.
[0064] The above-mentioned embodiments provide an embodiment of a special disease path production system. This system and the special disease path production methods of the above-mentioned embodiments belong to the same inventive concept. For details not described in detail in the embodiment of the special disease path production system, reference can be made to the above-mentioned embodiments of the special disease path production method.
[0065] The disease-specific library production system is a combination of the units and algorithm steps of each example described in the embodiments disclosed herein, and can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0066] It will be appreciated by those skilled in the art that various aspects of the method for producing a disease-free circuit can be implemented as a system, method or program product. Therefore, various aspects of the present disclosure can be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, which can be collectively referred to as "circuits", "modules" or "systems" herein.
[0067] Although the present invention has been described in detail with reference to the accompanying drawings and in combination with the preferred embodiments, the present invention is not limited thereto. Without departing from the spirit and essence of the present invention, a person of ordinary skill in the art may make various equivalent modifications or substitutions to the embodiments of the present invention, and these modifications or substitutions shall be within the scope of the present invention. Any person of ordinary skill in the art may easily think of changes or substitutions within the technical scope disclosed by the present invention, and these shall be within the scope of protection of the present invention.
Claims
1. A method for producing a disease-specific library, characterized in that: The method comprises: Step S1: constructing structured prompt words, the structured prompt words include field names and field explanations; Step S2: annotate the sample medical record text with entities and relationships based on the structured prompt words to obtain a combined text; Step S3: concatenate the sample medical record text and the combined text corresponding to the sample medical record text to obtain training text data; Step S4: input the training text data into the glm4-9b-chat model, perform model training on the glm4-9b-chat model, and obtain a trained glm4-9b-chat model; Step S5: Input the medical record text used to generate the disease-specific library and the structured prompt words generated in step S1 into the trained glm4-9b-chat model to generate structured variable text data, and store the structured variable text data in the database to generate the disease-specific library.
2. The method for producing a disease-specific library according to claim 1, characterized in that: In step S1, a structured prompt word is constructed, and the structured prompt word includes a field name and a field explanation, including the following specific steps: Extract the entities and relations of the medical record text to obtain the field names contained in the medical record text; Construct a field explanation capable of obtaining the field name; The field name and the field explanation are combined to obtain a structured prompt word.
3. The method for producing a disease-specific library according to claim 2, characterized in that: In step S2, entity and relationship annotations are performed on the sample medical record text based on the structured prompt words to obtain a combined text, including: Read sample medical record text; Based on the field names and field explanations, extracting text data corresponding to the field explanations contained in the sample medical record text; The extracted text data and the field name are combined to obtain a combined text.
4. The method for producing a disease-specific library according to claim 3, characterized in that: The combined text is text data in JSON format.
5. The method for producing a disease-specific library according to claim 3, characterized in that: In step S4, the training text data is input into the glm4-9b-chat model, and the glm4-9b-chat model is trained to obtain a trained glm4-9b-chat model, including the following specific steps: Step S41: controlled by the parameter batch_size, several sets of training text data are input into the glm4-9b-chat model; Step S42: the glm4-9b-chat model performs forward propagation calculation on the training text data to generate pre-output data; Step S43: Calculate the difference between the pre-output data and the target text data by using a cross entropy loss function, wherein the target text data refers to the field name in the combined text in the training text data; Step S44: Based on the difference between the pre-output data and the target text data, the gradient of the parameters of the glm4-9b-chat model is calculated by the back propagation algorithm; Step S45: adjusting the parameters of the glm4-9b-chat model according to the gradient through the optimizer; Step S46: Return to execute steps S41 to S46 until the model training is completed.
6. The method for producing a disease-specific library according to claim 5, characterized in that: The expression of the cross entropy loss function is: In the formula, represents the difference between the pre-output data and the target text data, M represents the size of the vocabulary of the target text data, Represents the first one-hot encoding of the target word in the target text data elements, Indicates the first The probability that the word is the next word.
7. The method for producing a disease-specific library according to claim 5, characterized in that: In step S46, the model training ends when any of the following conditions are met: Reach the preset number of training times for the model; The difference between the pre-output data and the target text data is less than or equal to a preset threshold; The difference between the pre-output data and the target text data remains unchanged.
8. A disease-specific library production system, characterized in that: The system comprises: A structured prompt word construction unit is used to construct a structured prompt word. The structured prompt word includes a field name and a field explanation. A combined text generation unit is used to annotate entities and relationships of sample medical record text based on structured prompt words to obtain a combined text; A training text data generating unit is used to concatenate the sample medical record text and the combined text corresponding to the sample medical record text to obtain training text data; A model training unit is used to input the training text data into the glm4-9b-chat model, perform model training on the glm4-9b-chat model, and obtain a trained glm4-9b-chat model; The disease-specific library generation unit is used to input the medical record text used to generate the disease-specific library and the structured prompt words generated by the structured prompt word construction unit into the trained glm4-9b-chat model to generate structured variable text data, and store the structured variable text data in a database to generate a disease-specific library.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively coupled to the at least one processor; The memory stores computer program instructions that can be executed by at least one processor, and the computer program instructions are executed by the at least one processor to enable the at least one processor to execute the method for producing a special disease library as described in any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium, characterized in that: The non-transitory computer-readable storage medium stores computer instructions, and the computer instructions enable the computer to execute the method for producing a special disease library as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Entity recognition model training and electronic medical record processing method, system and device
CN113435200A
Metadata management method and device, computer equipment and storage medium
CN116541752A
Large model-based medical text information governance method and system
CN118114718A
Text information extraction method based on large language model and efficient parameter fine tuning
CN118132674A
Large model-based multi-stage electronic medical record discharge nodule generation method
CN118136196A
Cited By
Medical record semantic understanding method and device, equipment, medium and product
CN119808791A
