Interrogation question generation method and device, equipment and storage medium
By using a large language model to process consultation dialogues and generate consultation questions, the cumbersome problems in the existing technology are solved, and the effect of improving the efficiency and reliability of the generation of consultation questions is achieved.
Patent Information
- Application Number
- CN202411692924.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-03-07
AI Technical Summary
The current process of generating consultation questions is complicated, which is not conducive to improving the generation efficiency of consultation questions. It is mainly because the existing technology relies on manual input, consumes a lot of manpower and time, and is easily disturbed by manual operations.
The preset large language model is used to process the preset consultation conversation, generate predictive consultation questions, and train model parameters through loss values to obtain the trained consultation model. This model does not require manual input and can automatically handle the current consultation conversation and generate consultation questions.
It reduces the generation time of consultation questions, improves the generation efficiency of consultation questions, and improves the reliability of the questions, avoids interference from manual operations.
Smart Images

Figure CN119581066A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology and can be applied to the field of medical technology. In particular, the present invention relates to a method, device, equipment and storage medium for generating medical questions. Background Art
[0002] With the growing demand for online consultation services, a clear question becomes particularly important in the process of information transmission and understanding. This is because a clear question provides a clear direction and framework for both doctors and patients, ensuring the focus of communication content and the depth of discussion. This can effectively guide patients to focus on the medical consultation questions, thereby avoiding redundancy and dispersion of communication content and improving communication efficiency.
[0003] However, the current process of generating medical questions is cumbersome and not conducive to improving the efficiency of generating medical questions. The reason is that the existing technology mainly uses manual input to generate medical questions, which consumes a lot of human resources and time resources, increases the generation time of medical questions, and is easily interfered by manual operation, so it is not conducive to improving the efficiency of generating medical questions. Summary of the invention
[0004] The present invention provides a method, device, computer equipment and storage medium for generating medical questions, so as to solve the technical problem that the current generation process of medical questions is complicated and is not conducive to improving the generation efficiency of the current medical questions.
[0005] In a first aspect, a method for generating a medical question is provided, comprising:
[0006] Selecting a consultation dialogue in the preset consultation data, a consultation dialogue in the consultation template, or a consultation dialogue constructed by a doctor as the preset consultation dialogue;
[0007] The preset large language model is used to process the preset medical consultation dialogue to generate a predicted medical consultation question;
[0008] Obtaining a loss value between the predicted medical question and the actual medical question;
[0009] Using the loss value, training the model parameters of the large language model to obtain the trained model parameters;
[0010] Selecting the large language model using the trained model parameters as a consultation model;
[0011] The current medical consultation dialogue is obtained, and the current medical consultation dialogue is processed through the medical consultation model to generate the current medical consultation question.
[0012] Furthermore, the selecting of the consultation dialogue in the preset consultation data, the consultation dialogue in the consultation template, or the consultation dialogue constructed by the doctor as the preset consultation dialogue includes:
[0013] Select the consultation dialogue in the preset consultation data as the first dialogue, select the consultation dialogue in the consultation template as the second dialogue, and select the consultation dialogue constructed by the doctor as the third dialogue;
[0014] collecting a first number of the first conversations, collecting a second number of the second conversations, and collecting a third number of the third conversations;
[0015] A first number of the first conversations collected, a second number of the second conversations collected, and a third number of the third conversations collected are aggregated to obtain a conversation data set, and the first conversation, the second conversation, or the third conversation in the conversation data set is selected as a preset medical consultation conversation.
[0016] Furthermore, the obtaining of the loss value between the predicted medical question and the actual medical question includes:
[0017] Obtaining the actual medical consultation question corresponding to the preset medical consultation dialogue;
[0018] The loss value between the predicted medical question and the actual medical question is calculated by using a preset cross entropy loss function.
[0019] Furthermore, the step of training the model parameters of the large language model by using the loss value to obtain the trained model parameters includes:
[0020] Obtaining the gradient corresponding to the loss value through a preset back-propagation algorithm;
[0021] The model parameters are trained according to the reverse direction of the gradient to obtain the trained model parameters.
[0022] Furthermore, the selecting the large language model using the trained model parameters as the consultation model includes:
[0023] Obtain a preset value, and determine whether the loss value is less than the preset value;
[0024] When the loss value is less than the preset value, the large language model using the trained model parameters is selected as the consultation model.
[0025] Furthermore, the obtaining of the current medical consultation dialogue and processing the current medical consultation dialogue through the medical consultation model to generate the current medical consultation question include:
[0026] Acquire a current medical consultation dialogue, decompose the current medical consultation dialogue into a plurality of semantic units, input the semantic units into a preset encoder, and generate a first feature vector corresponding to the semantic unit through the encoder;
[0027] The first feature vectors corresponding to the plurality of semantic units are merged to generate a second feature vector corresponding to the current medical consultation dialogue, and the second feature vector is input into the medical consultation model to obtain the current medical consultation question generated by the medical consultation model based on the second feature vector.
[0028] Furthermore, after obtaining the current medical consultation dialogue, processing the current medical consultation dialogue through the medical consultation model, and generating the current medical consultation question, the medical consultation question generating method includes:
[0029] Obtain a display interface of the current medical consultation dialogue, and display the medical consultation question and the answer text corresponding to the current medical consultation question through the display interface.
[0030] In a second aspect, a device for generating a medical question is provided, comprising:
[0031] A first selection module is used to select a consultation dialogue in the preset consultation data, a consultation dialogue in the consultation template, or a consultation dialogue constructed by the doctor as the preset consultation dialogue;
[0032] A first generating module is used to process the preset medical consultation dialogue through a preset large language model to generate a predicted medical consultation question;
[0033] An acquisition module, used for acquiring a loss value between the predicted medical question and the actual medical question;
[0034] A training module, used for training the model parameters of the large language model by using the loss value to obtain the trained model parameters;
[0035] A second selection module is used to select the large language model using the trained model parameters as a consultation model;
[0036] The second generating module is used to obtain the current medical consultation dialogue, process the current medical consultation dialogue through the medical consultation model, and generate the current medical consultation question.
[0037] In a third aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned method for generating diagnostic questions when executing the computer program.
[0038] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned method for generating medical questions are implemented.
[0039] The present application provides a method, device, computer equipment and storage medium for generating medical questions, which select a medical conversation in preset medical data, a medical conversation in a medical template or a medical conversation constructed by a doctor as a preset medical conversation; process the preset medical conversation through a preset large language model to generate a predicted medical question; obtain a loss value between the predicted medical question and the actual medical question; train the model parameters of the large language model through the loss value to obtain the trained model parameters; select the large language model using the trained model parameters as a medical question model; obtain a current medical conversation, process the current medical conversation through the medical question model, and generate a current medical question. The beneficial effects are in two aspects. On the one hand, the current medical conversation is obtained, and the current medical conversation is processed through the medical question model to generate the current medical question. Since no manual input is required, the generation time of the current medical question is reduced, which is conducive to improving the generation efficiency of the current medical question; on the other hand, since the medical question model will not be interfered by manual operation, it is conducive to improving the reliability of the obtained current medical question. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0041] Figure 1 is a schematic diagram of an application environment of a method for generating a diagnosis question in one embodiment of the present invention;
[0042] Figure 2 A schematic diagram of a flow chart of a method for generating medical questions provided by an embodiment of the present invention;
[0043] Figure 3 yes Figure 1 A schematic flow chart of a specific implementation of step S23;
[0044] Figure 4 yes Figure 1 A schematic flow chart of a specific implementation of step S25;
[0045] Figure 5 yes Figure 1 A schematic flow chart of a specific implementation of step S26;
[0046] Figure 6 is a structural schematic diagram of a diagnostic question generating device in one embodiment of the present invention;
[0047] Figure 7 is a schematic diagram of a structure of a computer device in one embodiment of the present invention;
[0048] Figure 8 It is another structural schematic diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION
[0049] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0050] See also Figure 1 , Figure 1 FIG. 1 is a schematic diagram of an application environment of a method for generating a medical question in an embodiment of the present invention. The method for generating a medical question provided in an embodiment of the present invention can be applied in the following embodiments: Figure 1 In an application environment, a client communicates with a server through a network.
[0051] The server selects, through the client, a consultation dialogue in the preset consultation data, a consultation dialogue in the consultation template, or a consultation dialogue constructed by the doctor as the preset consultation dialogue;
[0052] The preset large language model is used to process the preset medical consultation dialogue to generate a predicted medical consultation question;
[0053] Obtaining a loss value between the predicted medical question and the actual medical question;
[0054] Using the loss value, training the model parameters of the large language model to obtain the trained model parameters;
[0055] Selecting the large language model using the trained model parameters as a consultation model;
[0056] The current medical consultation dialogue is obtained, and the current medical consultation dialogue is processed through the medical consultation model to generate the current medical consultation question.
[0057] In the scheme implemented by the above-mentioned medical question generation method, device, equipment and medium, the beneficial effects are in two aspects. On the one hand, the current medical question dialogue is obtained, and the current medical question dialogue is processed through the medical question model to generate the current medical question. Since no manual input is required, the generation time of the current medical question is reduced, which is conducive to improving the generation efficiency of the current medical question. On the other hand, since the medical question model will not be interfered by manual operation, it is conducive to improving the reliability of the obtained current medical question.
[0058] The device running the client is referred to as a client device.
[0059] The device running the server is referred to as the server device.
[0060] The client devices may include but are not limited to various personal computers, laptops, smart phones, tablet computers, and portable wearable devices.
[0061] The server device can be implemented with an independent task database or a task database cluster composed of multiple task databases. The present invention is described in detail below through specific embodiments.
[0062] See also Figure 2 , Figure 2 A flowchart of a method for generating a medical question provided by an embodiment of the present invention includes the following steps:
[0063] S21, selecting a medical consultation dialogue in the preset medical consultation data, a medical consultation dialogue in the medical consultation template, or a medical consultation dialogue constructed by the doctor as the preset medical consultation dialogue;
[0064] The consultation dialogue in the preset consultation data, the consultation dialogue in the consultation template, or the consultation dialogue constructed by the doctor is selected as the preset consultation dialogue, including:
[0065] Select a medical consultation dialogue in the preset medical consultation data as the first dialogue, select a medical consultation dialogue in the medical consultation template as the second dialogue, and select a medical consultation dialogue constructed by the doctor as the third dialogue; collect a first number of the first dialogues, collect a second number of the second dialogues, and collect a third number of the third dialogues; aggregate the first number of the first dialogues collected, the second number of the second dialogues collected, and the third number of the third dialogues collected to obtain a dialogue data set, and select the first dialogue, the second dialogue, or the third dialogue in the dialogue data set as the preset medical consultation dialogue.
[0066] The second number is greater than the first number. The third number is greater than the second number.
[0067] The ratio of the second quantity to the first quantity includes but is not limited to 2 times, 3 times, and 4 times.
[0068] The ratio of the third quantity to the first quantity includes but is not limited to 5 times, 6 times, and 7 times.
[0069] Preferably, the second number is twice the first number. The third number is five times the first number.
[0070] For the sake of illustration, an example is given below:
[0071] For example, the first quantity is 10,000, the second quantity is 20,000, and the third quantity is 50,000;
[0072] Collect 10,000 consultation dialogues from the preset consultation data, collect 20,000 consultation dialogues from the consultation templates, and based on the third quantity, collect 50,000 consultation dialogues constructed by doctors;
[0073] Collect 20,000 consultation dialogues from the preset consultation data, collect 40,000 consultation dialogues from the consultation templates, and based on the third quantity, collect 100,000 consultation dialogues constructed by doctors;
[0074] Collect 30,000 consultation dialogues from the preset consultation data, collect 60,000 consultation dialogues from the consultation templates, and based on the third quantity, collect 150,000 consultation dialogues constructed by doctors.
[0075] S22, processing the preset medical consultation dialogue through a preset large language model to generate a predicted medical consultation question;
[0076] Exemplarily, the preset large language model is used to process the preset medical consultation dialogue to generate a predicted medical consultation question, including:
[0077] Obtain a preset model file, and load the large language model in the model file through a loading instruction;
[0078] The preset medical consultation dialogue is input into the large language model, and the preset medical consultation dialogue is processed by the large language model to generate a predicted medical consultation question.
[0079] Among them, since the large language model can capture the complex patterns and nuances in the language, directly loading the large language model without training from scratch can greatly shorten the project development and deployment time.
[0080] S23, obtaining a loss value between the predicted medical question and the actual medical question;
[0081] Among them, the predicted medical questions are predicted medical questions.
[0082] Among them, the actual medical questions are actual medical questions.
[0083] The loss value is a key indicator for measuring the difference between the predicted medical questions and the actual medical questions, and represents the degree of deviation between the predicted medical questions and the actual medical questions.
[0084] S24, training the model parameters of the large language model according to the loss value to obtain the trained model parameters;
[0085] Among them, when the loss value is low, it means that the predicted medical question and the actual medical question are consistent and the difference is small, which reflects that the large language model has high prediction accuracy and generalization ability. When the loss value is high, it means that the predicted medical question and the actual medical question are inconsistent and need further adjustment to reduce the difference with the actual observation value. Therefore, through the loss value, the performance of the large language model can be effectively evaluated, and the training of the large language model can be guided, so as to continuously optimize the decision-making process and improve the overall effect.
[0086] The step of training the model parameters of the large language model by using the loss value to obtain the trained model parameters includes:
[0087] Obtaining the gradient corresponding to the loss value through a preset back-propagation algorithm;
[0088] The model parameters are trained according to the reverse direction of the gradient to obtain the trained model parameters.
[0089] The gradient is the direction in which the loss value changes the fastest, and its opposite direction points to the fastest path to reduce the loss value. Therefore, when training a large language model, the gradient of the loss function with respect to the model parameters is calculated, and the model parameters are gradually adjusted in the opposite direction of the gradient to minimize the loss value. This process is carried out iteratively, and each update gradually reduces the prediction error of the model on the training data until it converges to a relatively stable state. This optimization strategy based on the opposite direction of the gradient greatly shortens the training time of the large language model.
[0090] S25, selecting the large language model using the trained model parameters as a medical inquiry model;
[0091] When the loss value converges, the large language model using the trained model parameters is selected as the consultation model.
[0092] When the loss value converges, it means that the prediction error of the large language model using the trained model parameters in the preset medical consultation dialogue has reached a relatively stable low level, which reflects that the large language model using the trained model parameters has fully learned the inherent laws and characteristics of the data. Therefore, selecting the large language model using the trained model parameters as the medical consultation model can ensure that the medical consultation model has good generalization ability.
[0093] S26, obtaining the current medical consultation dialogue, and processing the current medical consultation dialogue through the medical consultation model to generate the current medical consultation question.
[0094] Exemplarily, the current consultation dialogue is obtained, and the current consultation dialogue is processed by the consultation model to generate the current consultation question, including:
[0095] Connect to the consultation platform, obtain the current consultation data sent by the consultation platform, and select the consultation dialogue in the current consultation data as the current consultation dialogue;
[0096] The current consultation dialogue is processed through the consultation model to generate a current consultation question.
[0097] Among them, the consultation platform is a medical service model based on Internet technology. It connects patients and doctors through an online platform and provides patients with online consultation, health advice and other services.
[0098] Wherein, after obtaining the current medical consultation dialogue, processing the current medical consultation dialogue through the medical consultation model, and generating the current medical consultation question, the medical consultation question generating method includes:
[0099] Obtain a display interface of the current medical consultation dialogue, and display the medical consultation question and the answer text corresponding to the current medical consultation question through the display interface.
[0100] In the embodiment of the present invention, the beneficial effects are in two aspects. On the one hand, the current medical consultation dialogue is obtained, and the current medical consultation dialogue is processed through the medical consultation model to generate the current medical consultation question. Since no manual input is required, the generation time of the current medical consultation question is reduced, which is conducive to improving the generation efficiency of the current medical consultation question. On the other hand, since the medical consultation model will not be interfered by manual operation, it is conducive to improving the reliability of the obtained current medical consultation question.
[0101] See also Figure 3 , Figure 3 yes Figure 1 A specific implementation flow diagram of step S23 is described in detail as follows:
[0102] S31, obtaining the actual medical question corresponding to the preset medical consultation dialogue;
[0103] S32, calculating the loss value between the predicted medical question and the actual medical question through a preset cross entropy loss function.
[0104] In an embodiment of the present invention, the loss value between the predicted medical question and the actual medical question is calculated by a preset cross-entropy loss function. By minimizing the loss value between the predicted medical question and the actual medical question, the difference between the predicted medical question and the actual medical question can be reduced.
[0105] See also Figure 4 , Figure 4 yes Figure 1 A specific implementation flow diagram of step S25 is described in detail as follows:
[0106] S41, obtaining a preset value, and determining whether the loss value is less than the preset value;
[0107] S42, when the loss value is less than the preset value, selecting the large language model using the trained model parameters as the consultation model.
[0108] In an embodiment of the present invention, when the loss value is less than the preset value, the large language model using the trained model parameters is selected as the consultation model. This ensures that the difference between the predicted consultation questions and the actual consultation questions of the consultation model is controlled within a preset acceptable range. This measure significantly improves the accuracy of the consultation model.
[0109] See also Figure 5 , Figure 5 yes Figure 1 A specific implementation flow diagram of step S26 is described in detail as follows:
[0110] S51, obtaining a current medical consultation dialogue, decomposing the current medical consultation dialogue into a plurality of semantic units, inputting the semantic units into a preset encoder, and generating a first feature vector corresponding to the semantic unit through the encoder;
[0111] The process of obtaining a current medical consultation dialogue, decomposing the current medical consultation dialogue into a plurality of semantic units, inputting the semantic units into a preset encoder, and generating a first feature vector corresponding to the semantic units through the encoder includes:
[0112] Connect to the consultation platform, obtain the current consultation data sent by the consultation platform, and select the consultation dialogue in the current consultation data as the current consultation dialogue;
[0113] The current medical consultation dialogue is decomposed into a plurality of semantic units, the semantic units are input into a preset encoder, and a first feature vector corresponding to the semantic unit is generated by the encoder.
[0114] S52, merging the first feature vectors corresponding to the plurality of semantic units to generate a second feature vector corresponding to the current medical consultation dialogue, inputting the second feature vector into the medical consultation model, and obtaining the current medical consultation question generated by the medical consultation model based on the second feature vector.
[0115] In an embodiment of the present invention, the first feature vectors corresponding to the plurality of semantic units are merged to generate a second feature vector corresponding to the current medical consultation dialogue, and the second feature vector is input into the medical consultation model to obtain the current medical consultation question generated by the medical consultation model based on the second feature vector. Since manual input is replaced, the generation time of the current medical consultation question is reduced, which is conducive to improving the generation efficiency of the current medical consultation question.
[0116] See also Figure 6 , Figure 6 FIG. 1 is a schematic diagram of a structure of a diagnostic question generating device according to an embodiment of the present invention. Figure 6 As shown, the medical question generation device includes a first selection module 101, a first generation module 102, an acquisition module 103, a training module 104, a second selection module 105, and a second generation module 106. The functional modules are described in detail as follows:
[0117] A first selection module 101 is used to select a consultation dialogue in the preset consultation data, a consultation dialogue in the consultation template, or a consultation dialogue constructed by the doctor as the preset consultation dialogue;
[0118] A first generating module 102 is used to process the preset medical consultation dialogue through a preset large language model to generate a predicted medical consultation question;
[0119] An acquisition module 103 is used to acquire a loss value between the predicted medical question and the actual medical question;
[0120] A training module 104 is used to train the model parameters of the large language model using the loss value to obtain the trained model parameters;
[0121] A second selection module 105 is used to select the large language model using the trained model parameters as a consultation model;
[0122] The second generating module 106 is used to obtain the current medical consultation dialogue, process the current medical consultation dialogue through the medical consultation model, and generate the current medical consultation question.
[0123] In one embodiment, the first selection module 101 includes:
[0124] A first selection subunit is used to select a medical consultation dialogue in the preset medical consultation data as a first dialogue, select a medical consultation dialogue in the medical consultation template as a second dialogue, and select a medical consultation dialogue constructed by a doctor as a third dialogue;
[0125] A collection subunit, configured to collect a first number of the first conversations, a second number of the second conversations, and a third number of the third conversations;
[0126] an aggregation subunit, for aggregating a first number of collected first conversations, a second number of collected second conversations, and a third number of collected third conversations to obtain a conversation data set, and selecting the first conversation, the second conversation, or the third conversation in the conversation data set as a preset medical consultation conversation.
[0127] In one embodiment, the acquisition module 103 includes:
[0128] A first acquisition subunit is used to acquire the actual medical consultation question corresponding to the preset medical consultation dialogue;
[0129] The calculation subunit is used to calculate the loss value between the predicted medical question and the actual medical question through a preset cross entropy loss function.
[0130] In one embodiment, the training module 104 includes:
[0131] A second acquisition subunit, used to obtain the gradient corresponding to the loss value through a preset back propagation algorithm;
[0132] The training subunit is used to train the model parameters according to the reverse direction of the gradient to obtain the trained model parameters.
[0133] In one embodiment, the second selection module 105 includes:
[0134] A judging subunit, used to obtain a preset value and judge whether the loss value is less than the preset value;
[0135] The second selection subunit is used to select the large language model using the trained model parameters as the consultation model when the loss value is less than the preset value.
[0136] In one embodiment, the second generating module 106 includes:
[0137] An input subunit, used for acquiring a current medical consultation dialogue, decomposing the current medical consultation dialogue into a plurality of semantic units, inputting the semantic units into a preset encoder, and generating a first feature vector corresponding to the semantic unit through the encoder;
[0138] The second generating subunit is used to merge the first feature vectors corresponding to the multiple semantic units to generate a second feature vector corresponding to the current medical consultation dialogue, input the second feature vector into the medical consultation model, and obtain the current medical consultation question generated by the medical consultation model based on the second feature vector.
[0139] In one embodiment, the diagnostic question generating device further includes:
[0140] The display module is used to obtain the display interface of the current medical consultation dialogue, and display the medical consultation question and the answer text corresponding to the current medical consultation question through the display interface.
[0141] In the embodiment of the present invention, the beneficial effects are in two aspects. On the one hand, the current medical consultation dialogue is obtained, and the current medical consultation dialogue is processed through the medical consultation model to generate the current medical consultation question. Since no manual input is required, the generation time of the current medical consultation question is reduced, which is conducive to improving the generation efficiency of the current medical consultation question. On the other hand, since the medical consultation model will not be interfered by manual operation, it is conducive to improving the reliability of the obtained current medical consultation question.
[0142] The specific limitations of the medical question generating device can be found in the above limitations of the medical question generating method, which will not be repeated here.
[0143] Each module in the above-mentioned diagnostic question generating device can be implemented in whole or in part by software, hardware or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0144] See also Figure 7 , Figure 7 is a schematic diagram of a computer device in one embodiment of the present invention. In one embodiment, a computer device is provided. The computer device may be a server device, and its internal structure diagram may be as shown in FIG. Figure 7 The computer device includes a processor, a memory, a network interface and a database connected through a system bus.
[0145] The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external client through a network connection. When the computer program is executed by the processor, the functions or steps of a method for generating a diagnostic question can be implemented on the server device.
[0146] See also Figure 8 , Figure 8 is another structural diagram of a computer device in one embodiment of the present invention. In one embodiment, a computer device is provided. The computer device may be a client device, and its internal structure diagram may be as shown in FIG. Figure 8 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external task database via a network connection. When the computer program is executed by the processor, the functions or steps of a method for generating a diagnostic question can be implemented on a client device.
[0147] In one embodiment, a computer device is provided, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor.
[0148] It should be noted that the above functions or steps that can be implemented by the computer-readable storage medium or computer device can refer to the relevant description in the aforementioned method embodiment. In order to avoid repetition, they will not be described one by one here.
[0149] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a graphics processing unit (GPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0150] The above description and accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent possible changes only. Unless explicitly required, separate components and functions are optional, and the order of operation may vary. Parts and subsamples of some embodiments may be included in or replace parts and subsamples of other embodiments. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and claims, unless the context clearly indicates, the singular forms of "a", "an" and "the" are intended to include plural forms as well. Similarly, the term "and / or" as used in this application refers to any and all possible combinations of listings containing one or more associated ones. In addition, when used in the present application, the term "comprise" and its variants "comprises" and / or comprising refer to the presence of a stated sub-sample, whole, step, operation, element, and / or component, but do not exclude the presence or addition of one or more other sub-samples, wholes, steps, operations, elements, components and / or groups of these. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the presence of other identical elements in the process, method or device comprising the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the various embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.
[0151] Those skilled in the art will appreciate that the units and algorithm steps of each example 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 performed in hardware or software may depend on the specific application and design constraints of the technical solution. Technicians 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 embodiments of the present disclosure. Technicians can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0152] In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units can be only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some sub-samples can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to implement this embodiment. In addition, each functional unit in the embodiment of the present disclosure may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit.
[0153] The flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to the embodiment of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. In the description corresponding to the flowchart and the block diagram in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order from the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.
Claims
1. A method for generating medical questions, characterized in that: include: Selecting a consultation dialogue in the preset consultation data, a consultation dialogue in the consultation template, or a consultation dialogue constructed by a doctor as the preset consultation dialogue; The preset large language model is used to process the preset medical consultation dialogue to generate a predicted medical consultation question; Obtaining a loss value between the predicted medical question and the actual medical question; Using the loss value, training the model parameters of the large language model to obtain the trained model parameters; Selecting the large language model using the trained model parameters as a consultation model; The current medical consultation dialogue is obtained, and the current medical consultation dialogue is processed through the medical consultation model to generate the current medical consultation question.
2. The method for generating medical questions according to claim 1, characterized in that: The selecting of the consultation dialogue in the preset consultation data, the consultation dialogue in the consultation template, or the consultation dialogue constructed by the doctor as the preset consultation dialogue includes: Select the consultation dialogue in the preset consultation data as the first dialogue, select the consultation dialogue in the consultation template as the second dialogue, and select the consultation dialogue constructed by the doctor as the third dialogue; collecting a first number of the first conversations, collecting a second number of the second conversations, and collecting a third number of the third conversations; A first number of the first conversations collected, a second number of the second conversations collected, and a third number of the third conversations collected are aggregated to obtain a conversation data set, and the first conversation, the second conversation, or the third conversation in the conversation data set is selected as a preset medical consultation conversation.
3. The method for generating medical questions according to claim 1, characterized in that: The obtaining of the loss value between the predicted medical question and the actual medical question includes: Obtaining the actual medical consultation question corresponding to the preset medical consultation dialogue; The loss value between the predicted medical question and the actual medical question is calculated by using a preset cross entropy loss function.
4. The method for generating medical questions according to claim 1, characterized in that: The step of training the model parameters of the large language model by using the loss value to obtain the trained model parameters includes: Obtaining the gradient corresponding to the loss value through a preset back-propagation algorithm; The model parameters are trained according to the reverse direction of the gradient to obtain the trained model parameters.
5. The method for generating medical questions according to claim 1, characterized in that: The selecting the large language model using the trained model parameters as the consultation model includes: Obtain a preset value, and determine whether the loss value is less than the preset value; When the loss value is less than the preset value, the large language model using the trained model parameters is selected as the consultation model.
6. The method for generating medical questions according to claim 1, characterized in that: The step of obtaining the current medical consultation dialogue and processing the current medical consultation dialogue through the medical consultation model to generate the current medical consultation question includes: Acquire a current medical consultation dialogue, decompose the current medical consultation dialogue into a plurality of semantic units, input the semantic units into a preset encoder, and generate a first feature vector corresponding to the semantic unit through the encoder; The first feature vectors corresponding to the plurality of semantic units are merged to generate a second feature vector corresponding to the current medical consultation dialogue, and the second feature vector is input into the medical consultation model to obtain the current medical consultation question generated by the medical consultation model based on the second feature vector.
7. The method for generating medical questions according to any one of claims 1 to 6, characterized in that: After obtaining the current medical consultation dialogue, processing the current medical consultation dialogue through the medical consultation model, and generating the current medical consultation question, the medical consultation question generating method includes: Obtain a display interface of the current medical consultation dialogue, and display the medical consultation question and the answer text corresponding to the current medical consultation question through the display interface.
8. A device for generating medical questions, characterized in that: include: A first selection module is used to select a consultation dialogue in the preset consultation data, a consultation dialogue in the consultation template, or a consultation dialogue constructed by the doctor as the preset consultation dialogue; A first generating module is used to process the preset medical consultation dialogue through a preset large language model to generate a predicted medical consultation question; An acquisition module, used for acquiring a loss value between the predicted medical question and the actual medical question; A training module, used for training the model parameters of the large language model by using the loss value to obtain the trained model parameters; A second selection module is used to select the large language model using the trained model parameters as a consultation model; The second generating module is used to obtain the current medical consultation dialogue, process the current medical consultation dialogue through the medical consultation model, and generate the current medical consultation question.
9. A computer 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, the steps of the method for generating a medical question according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method for generating a medical question as claimed in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Interrogation intention recognition model construction method and device, inquiry intention recognition method and device, equipment and medium
CN117633171A
Training method of inquiry big model, inquiry method and device based on big model
CN117747087A
Training method, inquiry method and device of inquiry large model
CN118656642A