An Oral Medicine Guided Diagnosis Method and System for Fine-Tuning a Large Model Based on Plug-In Instructions
By building the optimal stomatological instruction data set and performing plug-in fine-tuning of general big models, a plug-in instruction fine-tuning model is formed, which solves the problems of small coverage and cumbersome steps in stomatological guidance, and achieves efficient and accurate guidance services.
Patent Information
- Application Number
- CN202410193253.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-21
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2044-02-21
AI Technical Summary
The existing intelligent guidance technology has problems such as small coverage in the field of stomatology, inaccurate user intentions and complicated guidance steps, especially the knowledge graph-based methods are difficult to distinguish the differences between subdivided disciplines and understanding the differences between medical terms and daily terms.
Build the optimal stomatological instruction dataset, train the general big model and fine-tune the plug-in, integrate knowledge of different disciplines to form the optimal plug-in instruction fine-tune big model to realize dialogue guidance.
It improves the coverage of the diagnosis guide and the accuracy of user intention understanding, simplifies the guidance steps, and improves the fit with the manual diagnosis guide.
Smart Images

Figure CN118230985B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of artificial intelligence, and particularly relates to an oral medicine guidance method and system for fine-tuning a large model based on plug-in instructions. Background Art
[0002] Intelligent oral medicine guidance refers to a technology that uses artificial intelligence technology in the field of oral medicine to assist in replacing the guidance nurses or medical staff to guide patients for medical treatment. After the patient describes the condition to the artificial intelligence, the artificial intelligence can give the patient medical treatment suggestions, such as suggesting to go to the oral surgery consultation room for treatment.
[0003] The existing intelligent guidance technologies mainly focus on the large medical field. These technologies mainly retrieve or match symptom keywords based on a knowledge graph to match the corresponding departments for patients. The main problems in the application in the field of oral medicine are as follows:
[0004] 1. The retrieval and guidance based on the knowledge graph requires the patient to answer or perform specific operations according to the system prompts, with cumbersome steps and poor patient experience. In addition, if the patient's answer exceeds the scope of the knowledge graph, the guidance system cannot understand the user input information at this time, and thus cannot recommend the department for the user to visit.
[0005] 2. There is a large difference between medical professional terms and daily language. In this case, the keyword matching method may not be able to understand the user input. For example, there is a large gap between the oral medical term "third molar" and its corresponding daily language "wisdom tooth" and "impacted tooth". When the patient inputs "impacted toothache", it may not be able to establish a matching relationship with "third molar pain", resulting in the guidance system being unable to understand the user input information and unable to recommend the department for the user to visit.
[0006] 3. Building a knowledge graph is very time-consuming and laborious, and extremely dependent on professional doctors. The number of professional doctors in the field of oral medicine is small and they are busy with consultations. Therefore, the number of knowledge graphs constructed is limited, and the covered disease range is also relatively limited, affecting the actual use effect for patients.
[0007] 4. As a major research branch in the large medical field, oral medicine has many subordinate disciplines. There are many subdivided departments in oral specialty hospitals, and the gap between departments is much smaller than that between departments in general hospitals. For example, the gap between the oral prosthetics department and the restorative department is much smaller than the gap between the otolaryngology department and the orthopedics department. It is very difficult to distinguish such departments with small differences by retrieving or matching symptom keywords based on the knowledge graph, and there is a high risk of misguidance.
[0008] In recent years, in the field of artificial intelligence, large language models have made remarkable breakthroughs, especially showing excellent performance in general dialogue. Large models possess powerful knowledge encoding and storage capabilities, text and code understanding and generation capabilities, as well as reasoning capabilities for complex tasks. The powerful knowledge encoding and storage capabilities of large models and their reasoning capabilities for complex tasks endow them with the potential for intelligent triage. However, large models in the general domain lack knowledge related to oral medicine. At the same time, the dialogue thinking of general large models aligns with that of ordinary people and does not conform to medical dialogue thinking, making them unable to be directly applied to intelligent oral medicine triage. Summary of the Invention
[0009] In view of the above deficiencies in the prior art, the present invention provides an oral medicine triage method and system based on fine-tuning a large model with plug-in instructions, which has stronger capabilities in solving actual triage problems, especially the problems of small coverage of traditional knowledge graph methods, inaccurate understanding of user intentions, and cumbersome triage steps.
[0010] To achieve the above objectives, the technical solution adopted by the present invention is as follows: An oral medicine triage method based on fine-tuning a large model with plug-in instructions, comprising the following steps:
[0011] S1. Construct an optimal oral medicine instruction dataset;
[0012] S2. Use the optimal oral medicine instruction dataset to train an existing general large model to obtain plug-ins containing different disciplinary knowledge, and fuse the plug-ins containing different oral disciplinary knowledge with the existing general large model to obtain an optimally plug-in instruction fine-tuned oral medicine large model;
[0013] S3. Use the optimally plug-in instruction fine-tuned oral medicine large model for triage.
[0014] The beneficial effects of the present invention are as follows: The present invention uses the optimal oral medicine instruction dataset to train an existing general large model, and fuses the obtained plug-ins containing different oral disciplinary knowledge with the existing general large model to obtain an optimally plug-in instruction fine-tuned large oral medicine model. Using the optimally plug-in instruction fine-tuned medical large model for intelligent triage, compared with the traditional method of intelligent triage based on a knowledge graph, it has stronger capabilities in solving actual triage problems, especially the problems of small coverage of traditional knowledge graph methods, inaccurate understanding of user intentions, and cumbersome triage steps. Benefiting from the powerful knowledge learning and reasoning capabilities of the optimally plug-in instruction fine-tuned large model, the present invention has a wide knowledge coverage, accurate understanding of user intentions, and since the present invention provides triage services for patients in a dialogue manner, the steps are simple and more in line with the patient's past experience of manual triage.
[0015] Further, the step S1 includes the following steps:
[0016] S101. Obtain oral medicine materials, form the obtained oral medicine materials into an oral medicine text dataset, and label it according to the categories of oral medicine disciplines;
[0017] S102. For the labeled oral medicine text dataset, use triple extraction to obtain triple data:
[0018] S103. Collect the public doctor-patient dialogue dataset and filter it to obtain the oral dialogue dataset;
[0019] S104. Conduct cluster analysis on the filtered oral dialogue dataset and extract the optimal oral medicine dialogue dataset;
[0020] S105. According to the triple data and the optimal oral medicine dialogue dataset, construct an instruction dataset that conforms to the oral medicine dialogue thinking;
[0021] S106. According to the existing categories of oral medicine disciplines and the labeled categories of oral medicine disciplines, classify the instruction dataset that conforms to the oral medicine dialogue thinking to obtain the optimal oral medicine instruction dataset.
[0022] The technical effects brought by the above further solution are as follows: The present invention proposes a method for constructing an oral medicine instruction dataset. The triple data obtained by triple extraction of existing medical literature, consultation guidelines, textbooks and other data, and the representative oral medicine dialogue data obtained by cluster analysis of the public doctor-patient dialogue dataset are used to construct a medical instruction dataset, and the instruction datasets of major sub-disciplines under oral medicine are obtained by classification according to sub-disciplines. The construction method of this medical instruction dataset solves the problem of scarce data for large model fine-tuning in the current medical field.
[0023] Furthermore, the expression of the optimal oral medicine instruction dataset is as follows:
[0024] Inst {s} =Classification(Inst Stomatology )
[0025] G(d,(S,R,O))→Inst Stomatology
[0026] where Inst{s} represents the optimal oral medicine instruction dataset, {s} represents different discipline categories, Classification(·) represents the classification operation, G(·) represents the existing general large model, d represents the optimal oral medicine dialogue dataset, (S, R, O) represents the triple data, S represents the extracted relationship subject Subject, O represents the extracted relationship object Object, R represents the relationship between entities obtained by predicting the relationship classification of entities, and InstStomatology Represents an instruction dataset that conforms to the thinking of oral medicine conversations.
[0027] Furthermore, the step S2 includes the following steps:
[0028] S201. Initialize the plug-ins for the optimal oral medicine datasets of different oral medicine disciplines separately, input the optimal oral medicine datasets of different oral medicine disciplines into the general large model to train the plug-ins, and obtain plug-ins containing different oral medicine knowledge;
[0029] S202. Add a routing layer to the existing general large model, and integrate the plug-ins containing different oral medicine knowledge into the existing general large model to obtain an initial plug-in instruction fine-tuned oral medicine large model;
[0030] S203. Train the initial plug-in instruction fine-tuned oral medicine large model so that the routing layer has the function of selecting different plug-ins for different oral medicine discipline data, and obtain the optimal plug-in instruction fine-tuned oral medicine large model.
[0031] The technical effects brought by the above further solution are as follows: The present invention proposes a method for fine-tuning the plug-in instructions of a medical large model. Based on the instruction datasets of major sub-disciplines under oral medicine, the datasets of each sub-discipline are used to initialize the plug-ins separately for learning. By adding a routing layer to the original general large model structure and further training, the routing layer can select different plug-ins for different discipline data, and finally obtain a large model integrating oral medicine knowledge, achieving the technical effect of precise guidance for different oral medicine departments and patient conditions.
[0032] Furthermore, the expression of the plug-in containing different oral medicine knowledge is as follows:
[0033]
[0034] Inst {s} →Initialise(Adapter)
[0035] Where Adapter 1,2,...,N represents a plug-in containing different oral medicine knowledge, N represents the number of oral medicine disciplines, Θ represents the parameters in Adapter 1,2,...,N , max represents the maximum operation, x, y represent the data and corresponding label pairs in the optimal oral medicine instruction dataset, Inst{s} represents the optimal oral medicine instruction dataset, t represents the data label in the optimal oral medicine instruction dataset, p · (·) represents probability, Φ0 represents the existing general large model, ΔΦ represents the plug-in, y t represents the label of the t-th oral medicine instruction data, x, y <tDenote the first t data pairs, Adapter represents the initialization plugin, and Initialise(·) represents the initialization function.
[0036] The technical effects brought by the above further solution are as follows: plugins containing knowledge of different oral disciplines are formed to integrate oral medicine knowledge into the base large model, solving the problem of the lack of medical knowledge in traditional base large models.
[0037] Furthermore, the expression for fine-tuning the oral medicine large model with the initial plugin instructions is as follows:
[0038] LLM Stomatology = LLM General + Router(Adapter 1,2,...,N )
[0039] Where LLM Stomatology represents the initial plugin instruction fine-tuned oral medicine large model, LLM General represents the existing general large model, Adapter 1,2,...,N represents the plugin containing knowledge of different oral disciplines, N represents the number of oral discipline categories, and Router(·) represents the routing layer.
[0040] The technical effects brought by the above further solution are as follows: the initialized routing layer is integrated with the general large model, and the oral medicine consultation large model is initially constructed, enabling the large model to have the potential to accurately use the learned knowledge to complete the consultation requirements.
[0041] Furthermore, the expression for the middle layer in the optimal plugin instruction fine-tuned oral medicine large model is as follows:
[0042] Router(Adapter 1,2,...,N ) = TopK(Adapter 1,2,...,N )
[0043] Where Adapter 1,2,...,N represents the plugin containing knowledge of different oral disciplines, N represents the number of oral discipline categories, Router(·) represents the routing layer, and TopK(·) represents selecting the K plugins with the highest probability.
[0044] The technical effects brought by the above further solution are as follows: a routing layer that can select knowledge plugins according to different consultation data to be processed is trained, enabling the large model integrated with oral medicine knowledge to accurately select the required knowledge to process consultation data and complete the daily intelligent consultation requirements for patients.
[0045] Furthermore, the expression for the loss function of the optimal plugin instruction fine-tuned oral medicine large model is as follows:
[0046]
[0047] Among them, Loss represents the loss function for fine-tuning the oral medicine large model with optimal plug-in instructions, N' represents the sequence length, and x i represents the i-th token in the sequence, and x i-1 represents the (i - 1)-th token in the sequence, log· represents the logarithmic function, and P(x i |x1, x2,..., x i-1 ) represents the probability of predicting the next token x i by the optimal plug-in instruction fine-tuned oral medicine large model under the given conditions.
[0048] The present invention provides an oral medicine consultation system based on fine-tuning a large model with plug-in instructions, including:
[0049] A first processing module for constructing an optimal oral medicine instruction dataset;
[0050] A second processing module for training an existing general large model using the optimal oral medicine instruction dataset to obtain plug-ins containing different oral discipline knowledge, and fusing the plug-ins containing different oral discipline knowledge with the existing general large model to obtain an optimal plug-in instruction fine-tuned oral medicine large model;
[0051] A third processing module for conducting consultation using the optimal plug-in instruction fine-tuned oral medicine large model.
[0052] The beneficial effects of the present invention are as follows: The present invention trains an existing general large model using the optimal oral medicine instruction dataset, and fuses the obtained plug-ins containing different discipline knowledge with the existing general large model to obtain an optimal plug-in instruction fine-tuned large model. Using the optimal plug-in instruction fine-tuned large model for intelligent consultation, compared with the traditional method of intelligent consultation based on a knowledge graph, it has stronger capabilities in solving actual consultation problems, especially when the traditional knowledge graph method has a small coverage range, inaccurate understanding of user intentions, and cumbersome consultation steps. Benefiting from the powerful knowledge learning and reasoning capabilities of the optimal plug-in instruction fine-tuned large model, the present invention has a wide knowledge coverage, accurate understanding of user intentions, and since the present invention provides consultation services for patients in a dialogue manner, the steps are simple and more in line with the patient's past experience of manual consultation. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 is a flowchart of the oral medicine consultation method of the present invention.
[0054] Figure 2 is a flowchart for constructing the oral medicine instruction dataset in this embodiment.
[0055] Figure 3 is a flowchart for fine-tuning plug-in instructions taking stomatology as an example in this embodiment.
[0056] Figure 4 This is a schematic structural diagram of the oral medicine guidance system of the present invention. Detailed implementation manners
[0057] The following describes the detailed implementation manners of the present invention to facilitate those skilled in the art of the present technology to understand the present invention. However, it should be clear that the present invention is not limited to the scope of the detailed implementation manners. For those of ordinary skill in the art of the present technology, as long as various changes are within the spirit and scope of the present invention defined and determined by the appended claims, these changes are obvious, and all inventions created using the concept of the present invention are within the scope of protection.
[0058] Embodiment 1
[0059] As Figure 1 shown, the present invention provides an oral medicine guidance method based on fine-tuning a large model with plug-in instructions, including the following steps:
[0060] S1. Construct an optimal oral medicine instruction dataset, and its implementation method is as follows:
[0061] S101. Obtain oral medicine materials, form an oral medicine text dataset from the obtained oral medicine materials, and mark them according to the categories of oral medicine disciplines;
[0062] S102. For the marked oral medicine text dataset, use triple extraction to obtain triple data:
[0063] S103. Collect a public doctor-patient dialogue dataset and screen to obtain an oral dialogue dataset;
[0064] S104. Perform clustering analysis on the screened oral dialogue dataset and extract the optimal oral medicine dialogue dataset;
[0065] S105. According to the triple data and the optimal oral medicine dialogue dataset, construct an instruction dataset that conforms to the oral medicine dialogue thinking;
[0066] S106. According to the existing categories of oral medicine disciplines and the marked categories of oral medicine disciplines, classify the instruction dataset that conforms to the oral medicine dialogue thinking to obtain the optimal oral medicine instruction dataset:
[0067] Inst {s} = Classification(Inst Stomatology )
[0068] G(d,(S,R,O)) → Inst Stomatology
[0069] Among them, Inst{s} represents the optimal oral medicine instruction dataset, {s} represents different disciplinary categories, Classification(·) represents the classification operation, G(·) represents the existing general large model, d represents the optimal oral medicine dialogue dataset, and (S, R, O) represents the triple data. S represents the extracted relationship subject Subject, O represents the extracted relationship object Object, and R represents the relationship between entities obtained by predicting the relationship classification of entities. Inst Stomatology represents the instruction dataset that conforms to the thinking of oral medicine dialogue.
[0070] In this embodiment, how does the optimal plug-in instruction fine-tuning large model proposed by the present invention complement the oral medicine knowledge and medical dialogue thinking for the large model by constructing an oral medicine instruction dataset and using plug-in instruction fine-tuning based on the constructed instruction dataset? The present invention presents an overview of the construction of the oral medicine instruction dataset and plug-in instruction fine-tuning, and then introduces their respective components.
[0071] In this embodiment, as Figure 2 shown, Figure 2 shows the general process of constructing the oral medicine instruction dataset. First, collect oral medicine literature, consultation guidelines, and textbooks, perform triple extraction on these data, and then construct instruction data based on the extracted dataset. After that, classify the obtained dataset according to the sub-disciplines to obtain multiple oral medicine sub-discipline category datasets. The specific process is as follows:
[0072] Collect oral medicine literature, consultation guidelines, and textbooks to form an oral medicine text dataset, and mark it according to the sub-discipline categories;
[0073] Perform triple extraction on the marked dataset to obtain triple data. Specifically, first perform entity extraction to extract the Subject entity S and the Object entity O, and then perform relationship classification prediction on the entities to obtain the relationship R between entities, as shown in the following formula, and finally obtain the triple data (S, R, O):
[0074] f(S, O) → R
[0075] Collect the public doctor-patient dialogue dataset and screen to obtain the oral dialogue dataset D;
[0076] Perform clustering analysis on the oral dialogue dataset D to extract representative oral medicine dialogue data d, as shown in the following formula:
[0077] d = Clustering(D)
[0078] Based on the obtained triple data (S, R, O) and the representative oral medicine dialogue data d, construct an instruction dataset Inst that conforms to the thinking of medical dialogue Stomatology , specifically, use the representative oral medicine dialogue data d as an example to guide the general large model G to reconstruct the triple data (S, R, O) into an oral medicine instruction dataset Inst Stomatology , as follows:
[0079] G(d, (S, R, O)) → Inst Stomatology
[0080] Classify the obtained oral medicine instruction dataset according to the existing sub - disciplines of oral medicine and the marked sub - disciplines to obtain a sub - discipline instruction dataset Inst{s}, where {s} represents different sub - disciplines, as shown in the following formula:
[0081] Inst {s} = Classification(Inst Stomatology )
[0082] S2. Use the optimal oral medicine instruction dataset to train the existing general large model to obtain plugins containing different oral medicine discipline knowledge, and fuse the plugins containing different oral medicine discipline knowledge with the existing general large model to obtain an optimally plugin - instruction - fine - tuned oral medicine large model. The implementation method is as follows:
[0083] S201. Initialize the plugin separately for the optimal oral medicine datasets of different oral medicine sub - disciplines, and input the optimal oral medicine datasets of different oral medicine sub - disciplines into the general large model to train the plugin to obtain plugins containing different oral medicine discipline knowledge:
[0084]
[0085] Inst {s} → Initialise(Adapter)
[0086] where Adapter 1,2,...,N represents the plugin containing different oral medicine discipline knowledge, N represents the number of oral medicine sub - disciplines, Θ represents the parameters in Adapter 1,2,...,N , max represents the maximum operation, x, y represent the data and corresponding label pairs in the optimal oral medicine instruction dataset, Inst{s} represents the optimal oral medicine instruction dataset, t represents the data label in the optimal oral medicine instruction dataset, p·(·) represents probability, Φ0 represents the existing general large model, ΔΦ represents the plugin, and y t represents the label of the t - th oral medicine instruction data, x, y <tDenote the first t data pairs, Adapter represents the initialization plugin, and Initialise(·) represents the initialization function.
[0087] S202. Add a routing layer to the existing general large model and integrate plugins containing different oral discipline knowledge into the existing general large model to obtain an initial plugin instruction fine-tuned oral medicine large model:
[0088] LLM Stomatology = LLM General + Router(Adapter 1,2,...,N )
[0089] Among them, LLM Stomatology represents the initial plugin instruction fine-tuned oral medicine large model, LLM General represents the existing general large model, Adapter 1,2,...,N represents the plugin containing different oral discipline knowledge, N represents the number of oral discipline categories, and Router(·) represents the routing layer;
[0090] S203. Train the initial plugin instruction fine-tuned oral medicine large model to enable the routing layer to have the function of selecting different plugins for different oral discipline data, and obtain the optimal plugin instruction fine-tuned oral medicine large model:
[0091] Router(Adapter 1,2,...,N ) = TopK(Adapter 1,2,...,N )
[0092] Among them, Adapter 1,2,...,N represents the plugin containing different oral discipline knowledge, N represents the number of oral discipline categories, Router(·) represents the routing layer, and TopK(·) represents selecting the K plugins with the highest probability.
[0093] In this embodiment, as Figure 3 shown, Figure 3 shows the general process of plugin instruction fine-tuning for the stomatology department. First, input the constructed oral medicine sub-discipline category dataset into the general large model for training to obtain the corresponding discipline plugins, and then fuse the obtained plugins with the general large model to obtain the plugin instruction fine-tuned oral medicine large model. The specific method steps are as follows:
[0094] Initialise the plugin Adapter separately for different oral sub-discipline category datasets, as shown in the following formula:
[0095] Inst {s} → Initialise(Adapter)
[0096] Input datasets of different sub - disciplines of stomatology into the large model to train the plugin, and obtain the plugin Adapter containing knowledge of different stomatology disciplines 1,2,...,N , as shown in the following formula:
[0097]
[0098] Add a routing layer Router to the original general large - model structure, and integrate the constructed plugin Adapter 1,2,...,N into the general large model LLM General to obtain a preliminary large model of stomatology with plugin instruction fine - tuning LLM Stomatology , as shown in the following formula:
[0099] LLM Stomatology =LLM General +Router(Adapter 1,2,...,N )
[0100] For the preliminary large model of stomatology with plugin instruction fine - tuning LLM Stomatology , further train it so that the routing layer has the ability to select different plugins for different disciplinary data. As shown in the formula, finally obtain a large model integrating stomatology knowledge:
[0101] Router(Adapter 1,2,...,N ) = TopK(Adapter 1,2,...,N )
[0102] In this embodiment, the large model of stomatology with optimal instruction plugin instruction fine - tuning can be mainly divided into the following layers: self - attention layer, routing layer, and hybrid feed - forward layer.
[0103] Among them, the self - attention layer is the same as the self - attention layer of the existing general large model, and is used to capture the long - distance interdependent features in the input text;
[0104] The routing layer is used to select the corresponding knowledge plugin for specific input text data to complete the task of guiding diagnosis;
[0105] The hybrid feed - forward layer is composed of the feed - forward layer of the existing general large model and the plugins with knowledge of different stomatology disciplines constructed, and is used to encode and store the knowledge in the stomatology field and general field related to completing the task of guiding diagnosis.
[0106] The loss function of the large model of stomatology with optimal instruction plugin instruction fine - tuning is the same as the loss function of the existing general large model training. As shown in the following formula, assume there is a sequence (x1, x2,..., x n ), where, x i represents the i - th token in the sequence. The goal is to predict according to the given previous context (x1, x2,..., xi-1 ) Predict the next token x i , where Loss in the formula represents the value of the loss function, N' represents the length of the sequence, log· represents the logarithmic function, and P(x i |x1,x2,...,x i-1 ) represents the probability that the model predicts the next token x under the given previous context i .
[0107] During training, the difference is that each time during training, the optimal plug-in instruction fine-tuning oral medicine large model only selects K knowledge plug-ins in the mixed feed-forward layers for calculation to complete the update of the overall large model, rather than updating the entire feed-forward layer as in the traditional large model training
[0108] The expression of the loss function of the optimal plug-in instruction fine-tuning oral medicine large model is as follows
[0109]
[0110] Among them, Loss represents the loss function of the optimal plug-in instruction fine-tuning oral medicine large model, N' represents the sequence length, x i represents the i-th token in the sequence, x i-1 represents the (i - 1)-th token in the sequence, log· represents the logarithmic function, and P(x i |x1,x2,...,x i-1 ) represents the probability that the optimal plug-in instruction fine-tuning oral medicine large model predicts the next token x under the given conditions i .
[0111] S3. Use the optimal plug-in instruction fine-tuning large model for medical guidance
[0112] In this embodiment, the patient initiates a consultation with the optimal plug-in instruction fine-tuning large model in the form of oral narration. The optimal plug-in instruction fine-tuning large model will process the patient's oral information and recommend a department for medical treatment based on information such as their condition, thereby completing medical guidance
[0113] In summary, the traditional knowledge graph-based retrieval and matching method is difficult to distinguish such departments with small differences. The present invention constructs plug-ins for each major subdivision discipline to introduce refined knowledge into the large model, making the medical large model constructed by the present invention have stronger discrimination ability
[0114] Embodiment 2
[0115] As Figure 4 shown, the present invention provides an oral medicine medical guidance system for implementing the oral medicine medical guidance method based on the plug-in instruction fine-tuning large model described in Embodiment 1, including
[0116] The first processing module is used to construct an optimal oral medicine instruction dataset;
[0117] The second processing module is used to utilize the optimal oral medicine instruction dataset to train an existing general large model, obtain plug-ins containing different oral discipline knowledge, and fuse the plug-ins containing different oral discipline knowledge with the existing general large model to obtain an optimally plug-in instruction fine-tuned oral medicine large model;
[0118] The third processing module is used to perform medical guidance using the optimally plug-in instruction fine-tuned oral medicine large model.
[0119] Such as Figure 4 The medical guidance system provided by the embodiment shown can execute the technical solution shown in the medical guidance method of the above method embodiment. Its implementation principle and beneficial effects are similar and will not be elaborated here.
[0120] In this embodiment, the present application can divide functional units according to the medical guidance method. For example, each function can be divided into each functional unit, or two or more functions can be integrated into one processing unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit. It should be noted that the division of units in the present invention is illustrative, only a logical division, and there may be other division methods in actual implementation.
[0121] In this embodiment, in order to implement the principle and beneficial effects of the medical guidance method, the medical guidance system includes the corresponding hardware structure and / or software module for executing each function. Those skilled in the art should easily realize that, in combination with the various schematic units and algorithm steps described in the embodiments disclosed in the present invention, the present invention can be implemented in the form of hardware and / or a combination of hardware and computer software. Whether a certain function is executed in the way of hardware or computer software drive depends on the specific application and design constraint conditions of the technical solution. Different methods can be used for each specific application to implement the described function, but such implementation should not be considered to exceed the scope of the present application.
Claims
1. An oral medicine guidance method for fine-tuning a large model based on plug-in instructions, characterized in that, It includes the following steps: S1. Construct an optimal oral medicine instruction dataset; S2. Use the optimal oral medicine instruction dataset to train an existing general large model to obtain plug-ins containing different oral discipline knowledge, and fuse the plug-ins containing different oral discipline knowledge with the existing general large model to obtain an optimally plug-in instruction fine-tuned oral medicine large model. Specifically: S201. Initialize the plug-ins separately for the optimal oral medicine datasets of different oral discipline categories, input the optimal oral medicine datasets of different oral discipline categories into the general large model to train the plug-ins, and obtain plug-ins containing different oral discipline knowledge; The expression of the plug-in containing different oral discipline knowledge is as follows: Among them, represents a plug-in containing different oral discipline knowledge, represents the number of oral disciplines, represents the parameter in represents the maximum operation, represents the data and corresponding label pairs in the optimal oral medicine instruction dataset, represents the optimal oral medicine instruction dataset, represents the data label number in the optimal oral medicine instruction dataset, represents probability, represents the existing general large model, represents a plug-in, represents the t label of the nth oral medicine instruction data, represents the first t n data pairs, represents the initialized plug-in, represents the initialization function; S202. Add a routing layer to the existing general large model, and fuse the plug-ins containing different oral discipline knowledge into the existing general large model to obtain an initial plug-in instruction fine-tuned oral medicine large model; The expression of the initial plug-in instruction fine-tuned oral medicine large model is as follows: Among them, represents the initial plug-in instruction for fine-tuning the oral medicine large model, represents the existing general large model, represents the plug-in containing different oral discipline knowledge, represents the routing layer; S203. Train the initial plug-in instruction fine-tuned oral medicine large model to enable the routing layer to have the function of selecting different plug-ins for different oral discipline data, and obtain an optimally plug-in instruction fine-tuned oral medicine large model; S3. Use the optimally plug-in instruction fine-tuned oral medicine large model for medical guidance.
2. The oral medicine guidance method for fine-tuning a large model based on plug-in instructions according to claim 1, wherein The step S1 includes the following steps: S101. Obtain oral medicine materials, form an oral medicine text dataset with the obtained oral medicine materials, and mark it according to oral discipline categories; S102. For the marked oral medicine text dataset, use triple extraction to obtain triple data: S103. Collect a public doctor-patient dialogue dataset and screen it to obtain an oral dialogue dataset; S104. Conduct cluster analysis on the screened oral dialogue dataset and extract the optimal oral medicine dialogue dataset; S105. According to the triple data and the optimal oral medicine dialogue dataset, construct an instruction dataset that conforms to the oral medicine dialogue thinking; S106. Classify the instruction dataset that conforms to the oral medicine dialogue thinking according to the existing oral medicine discipline categories and the marked oral discipline categories to obtain an optimal oral medicine instruction dataset.
3. The oral medicine guidance method for fine-tuning a large model based on plug-in instructions according to claim 2, wherein, The expression of the optimal oral medicine instruction dataset is as follows: Among them, represents the optimal oral medicine instruction dataset, represents different disciplinary categories, represents classification operation, represents the existing general large model, represents the optimal oral medicine dialogue dataset, represents triple data, represents the extracted relationship subject Subject, represents the extracted relationship object Object, represents the relationship between entities obtained by predicting the relationship classification of entities, represents the instruction dataset that conforms to the thinking of oral medicine dialogue.
4. The oral medicine guidance method for fine-tuning a large model based on plug-in instructions according to claim 1, wherein The expression of the routing layer in the optimally plug-in instruction fine-tuned oral medicine large model is as follows: Among them, represents a plug-in containing different oral discipline knowledge, represents the number of oral disciplines, represents the routing layer, represents the one with the largest selection probability K plug-ins.
5. The oral medicine guidance method for fine-tuning a large model based on plug-in instructions according to claim 1, wherein The expression of the loss function of the optimally plug-in instruction fine-tuned oral medicine large model is as follows: Among them, represents the loss function of the optimal plug-in instruction fine-tuned oral medicine large model, represents the sequence length, represents the i -th token in the sequence, represents the -th token in the sequence, represents the logarithmic function, represents the probability that the optimal plug-in instruction fine-tuned oral medicine large model predicts the next token under the given conditions.
6. An oral medicine guidance system for performing the oral medicine guidance method for fine-tuning a large model based on plug-in instructions according to any one of claims 1-5, characterized in that, It includes: A first processing module for constructing an optimal oral medicine instruction dataset; A second processing module for using the optimal oral medicine instruction dataset to train an existing general large model to obtain plug-ins containing different oral discipline knowledge, and fusing the plug-ins containing different oral discipline knowledge with the existing general large model to obtain an optimally plug-in instruction fine-tuned oral medicine large model. Specifically: Initialize the plug-ins separately for the optimal oral medicine datasets of different oral discipline categories, input the optimal oral medicine datasets of different oral discipline categories into the general large model to train the plug-ins, and obtain plug-ins containing different oral discipline knowledge; The expression of the plug-in containing different oral discipline knowledge is as follows: Among them, represents a plug-in containing different oral discipline knowledge, represents the number of oral disciplines, represents the parameter in represents the maximum operation, represents the data and corresponding label pairs in the optimal oral medicine instruction dataset, represents the optimal oral medicine instruction dataset, represents the data label number in the optimal oral medicine instruction dataset, represents probability, represents the existing general large model, represents a plug-in, represents the t label of the nth oral medicine instruction data, represents the first t n data pairs, represents the initialized plug-in, represents the initialization function; Add a routing layer to the existing general large model, and integrate plugins containing different oral discipline knowledge into the existing general large model to obtain an initial plugin instruction fine-tuned oral medicine large model; The expression of the initial plugin instruction fine-tuned oral medicine large model is as follows: Among them, represents the initial plug-in instruction for fine-tuning the oral medicine large model, represents the existing general large model, represents the plug-in containing different oral discipline knowledge, represents the routing layer; Train the initial plugin instruction fine-tuned oral medicine large model so that the routing layer has the function of selecting different plugins for different oral discipline data, and obtain the optimal plugin instruction fine-tuned oral medicine large model; A third processing module is used to perform medical guidance using the optimal plugin instruction fine-tuned oral medicine large model.
Citation Information
Patent Citations
Chinese academic knowledge graph construction method based on multidisciplinary classification
CN115905554A
Aided disease differential diagnosis system based on causality-containing medical knowledge graph
WO2023098288A1