Medical intention recognition method and device, storage medium and computer device

By constructing an intent recognition model based on loss functions of positive and negative sample pairs, and combining it with a medical knowledge graph, the problems of resource waste and overfitting caused by manual annotation are solved, and efficient and accurate recognition of medical intent is achieved.

CN116821289BActive Publication Date: 2026-07-24PING AN TECH (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
PING AN TECH (SHENZHEN) CO LTD
Filing Date
2023-04-18
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

Existing medical intent recognition methods rely on manually labeled training samples, which leads to wasted resources and model overfitting, affecting recognition accuracy and effectiveness.

Method used

An intent recognition model based on a loss function constructed from positive and negative sample pairs is adopted. Combined with a medical knowledge graph, the model is trained through a fixed-parameter encoder and a fine-tuning encoder of a text semantic network to generate medical intent recognition results.

Benefits of technology

It reduces overfitting in classification models, lowers errors introduced by human labeling, and improves the accuracy and effectiveness of medical intent recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116821289B_ABST
    Figure CN116821289B_ABST
Patent Text Reader

Abstract

The application discloses a medical intention recognition method and device, a storage medium and computer equipment, relates to the technical field of digital medicine, and mainly aims to solve the problems of poor recognition accuracy and effectiveness of the existing medical intention. The method comprises the following steps: obtaining dialogue text to be recognized; performing recognition on the dialogue text based on an intention recognition model that has completed model training, to obtain a first medical intention, wherein the intention recognition model is trained based on a loss function constructed based on a positive sample pair and a negative sample pair, and text training samples; the positive sample pair and the negative sample pair are determined based on opposite statements in the text training samples; determining a second medical intention matched with the first medical intention based on a generated medical knowledge graph, and generating a medical intention recognition result based on the first medical intention and the second medical intention.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of digital medical technology, and in particular to a method and apparatus for identifying medical intentions, a storage medium, and a computer device. Background Technology

[0002] With the rapid development of digital healthcare technology, digital healthcare systems receive patient conversations through dialogue systems and identify the patient's medical intent within the conversations to meet online medical consultation needs.

[0003] Currently, when performing medical intent recognition on dialogue content, supervised classification models are typically trained using manually labeled training samples to classify and label the dialogue text for intent classification. However, manual labeling wastes significant human resources, and when the number of training samples for new intents is limited, it can lead to overfitting of the classification model, failing to meet the accuracy requirements for medical intent recognition. Furthermore, different labeling by different individuals can introduce excessive classification errors into the training samples, significantly impacting the accuracy and effectiveness of medical intent recognition. Summary of the Invention

[0004] In view of this, the present invention provides a method and apparatus for identifying medical intentions, a storage medium, and a computer device, the main purpose of which is to solve the problems of poor accuracy and effectiveness in identifying existing medical intentions.

[0005] According to one aspect of the present invention, a method for identifying medical intent is provided, comprising:

[0006] Obtain the dialogue text to be recognized:

[0007] The intent recognition model, which has been trained, is used to identify the dialogue text to obtain the first-level medical intent. The intent recognition model is trained based on a loss function constructed from positive and negative sample pairs and text training samples. The positive and negative sample pairs are determined based on opposing statements in the text training samples.

[0008] Based on the generated medical knowledge graph, a secondary medical intent matching the primary medical intent is determined, and a medical intent recognition result is generated based on the primary medical intent and the secondary medical intent.

[0009] Furthermore, before the intent recognition model, which has already been trained, identifies the dialogue text to obtain the primary medical intent, the method further includes:

[0010] Obtain initial text training samples and construct a text semantic network, which includes a fixed-parameter encoder and a fine-tuning encoder;

[0011] The initial text training sample is encoded based on the fixed-parameter encoder to obtain a first text sample, and the initial text training sample is encoded based on the fine-tuning encoder to obtain a second text sample, wherein the second text sample contains a preset task string;

[0012] Based on the opposing statements in the first text sample and the second text sample, generate text training samples containing positive sample pairs and negative sample pairs;

[0013] The text semantic network is trained based on the text training samples to obtain an intent recognition model.

[0014] Furthermore, the fixed-parameter encoder is placed in the input layer, and the encoding process of the initial text training samples based on the fixed-parameter encoder to obtain the first text sample includes:

[0015] The task level of each network layer in the text semantic network is determined, and the initial text training samples are pooled according to the task level by the fixed-parameter encoder to obtain the pooled sentence vectors of each layer.

[0016] The average value of the sentence vectors at each level is determined as the first text sample;

[0017] The fine-tuning encoder is placed in the output layer and connected to a linear layer. The process of encoding the initial text training samples based on the fine-tuning encoder to obtain the second text sample includes:

[0018] Determine the task string, add the task string to the task position of the initial text training sample, and encode the initial text training sample based on the fine-tuning encoder;

[0019] The encoded text sample is projected into a sentence vector through the linear layer to obtain the second text sample.

[0020] Furthermore, the step of generating text training samples containing positive and negative sample pairs based on opposing statements in the first and second text samples includes:

[0021] The number of positive samples and the number of negative samples are determined from the initial text training samples, wherein the first statement corresponding to the number of positive samples and the second statement corresponding to the number of negative samples are in opposition to each other;

[0022] The first text sample is combined with the number of positive samples of the second text sample to obtain a positive sample pair, and the first text sample is combined with the number of negative samples of the second text sample to obtain a negative sample pair;

[0023] The text training samples are generated based on the positive sample pairs and the negative sample pairs.

[0024] Furthermore, the method also includes:

[0025] The loss values ​​of the positive sample pairs and the negative sample pairs are determined based on the linear layer, and the loss function of the positive sample pairs is determined based on the loss values ​​and preset hyperparameters.

[0026] Calculate the parameter distance between the fixed-parameter encoder and the fine-tuning encoder, and determine the sample deviation between the fixed-parameter encoder and the fine-tuning encoder based on the positive sample pairs and the negative sample pairs;

[0027] The loss function is constructed based on the positive sample pair loss function, the parameter distance, and the sample bias.

[0028] Furthermore, before determining the secondary medical intent matching the primary medical intent based on the generated medical knowledge graph, the method further includes:

[0029] Obtain a medical terminology database, which includes all terms at different intent levels;

[0030] A medical intent pointer is constructed based on the word similarity corresponding to the same intent level, and the medical knowledge graph is generated according to the medical intent pointer. The text training sample corresponds to the initial medical intent pointer of the medical knowledge graph.

[0031] Furthermore, after generating the medical intent recognition result based on the primary medical intent and the secondary medical intent, the method further includes:

[0032] Determine the medical processing interface that matches the medical intent recognition result, and obtain the historical medical data corresponding to the medical processing interface;

[0033] Matching the secondary medical intent with medical keywords in the historical medical data;

[0034] If the secondary medical intent matches the medical keyword, then medical operation access is performed based on the medical processing interface.

[0035] According to another aspect of the present invention, a medical intent recognition device is provided, comprising:

[0036] The acquisition module is used to acquire the dialogue text to be recognized.

[0037] The recognition module is used to recognize the dialogue text based on the intent recognition model that has been trained to obtain the first-level medical intent. The intent recognition model is trained based on a loss function constructed based on positive sample pairs and negative sample pairs and text training samples. The positive sample pairs and the negative sample pairs are determined based on the opposing statements in the text training samples.

[0038] The generation module is used to determine the secondary medical intent that matches the primary medical intent based on the generated medical knowledge graph, and to generate a medical intent recognition result based on the primary medical intent and the secondary medical intent.

[0039] Furthermore, the device also includes: a construction module, a processing module, and a training module.

[0040] The construction module is used to obtain initial text training samples and construct a text semantic network, which includes a fixed-parameter encoder and a fine-tuning encoder.

[0041] The processing module is used to encode the initial text training sample based on the fixed-parameter encoder to obtain a first text sample, and to encode the initial text training sample based on the fine-tuning encoder to obtain a second text sample, wherein the second text sample contains a preset task string.

[0042] The generation module is used to generate text training samples containing positive sample pairs and negative sample pairs based on the opposing statements in the first text sample and the second text sample.

[0043] The training module is used to train the text semantic network based on the text training samples to obtain an intent recognition model.

[0044] Furthermore, the fixed-parameter encoder is placed in the input layer. The processing module is specifically used to determine the task level of each network layer in the text semantic network, and to perform pooling processing on the initial text training samples according to the task level through the fixed-parameter encoder to obtain the pooled sentence vectors of each layer; the average value of the sentence vectors of each layer is determined as the first text sample.

[0045] The fine-tuning encoder is placed in the output layer and connected to a linear layer. The processing module is further used to determine the task string, add the task string to the task position of the initial text training sample, and encode the initial text training sample based on the fine-tuning encoder; the encoded text sample is projected into a sentence vector through the linear layer to obtain the second text sample.

[0046] Furthermore, the generation module is specifically used to determine the number of positive samples and the number of negative samples from the initial text training samples, wherein the first statement corresponding to the number of positive samples and the second statement corresponding to the number of negative samples have an opposing relationship; to combine the first text sample with the second text sample of the number of positive samples to obtain a positive sample pair, and to combine the first text sample with the second text sample of the number of negative samples to obtain a negative sample pair; and to generate the text training samples based on the positive sample pairs and the negative sample pairs.

[0047] Furthermore, the construction module is also used to determine the loss values ​​of the positive sample pairs and the negative sample pairs based on the linear layer, and to determine the loss function of the positive sample pairs based on the loss values ​​and preset hyperparameters; to calculate the parameter distance between the fixed-parameter encoder and the fine-tuning encoder, and to determine the sample bias between the fixed-parameter encoder and the fine-tuning encoder based on the positive sample pairs and the negative sample pairs; and to construct the loss function according to the loss function of the positive sample pairs, the parameter distance, and the sample bias.

[0048] Furthermore,

[0049] The acquisition module is also used to acquire a medical terminology database, which includes all terms at different intent levels;

[0050] The generation module is further configured to construct medical intent pointers based on the word similarity corresponding to the same intent level, and generate the medical knowledge graph according to the medical intent pointers, wherein the text training samples correspond to the initial medical intent pointers of the medical knowledge graph.

[0051] Furthermore, the device also includes:

[0052] The determination module is used to determine the medical processing interface that matches the medical intent recognition result and to obtain the historical medical data corresponding to the medical processing interface.

[0053] The matching module is used to match the secondary medical intent with medical keywords in the historical medical data;

[0054] The access module is used to perform medical operation access based on the medical processing interface if the secondary medical intent matches the medical keyword.

[0055] According to another aspect of the present invention, a storage medium is provided, wherein at least one executable instruction is stored therein, the executable instruction causing a processor to perform an operation corresponding to the above-described medical intent recognition method.

[0056] According to another aspect of the present invention, a computer device is provided, comprising: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other via the communication bus;

[0057] The memory is used to store at least one executable instruction, which causes the processor to perform the operation corresponding to the above-described medical intent recognition method.

[0058] By employing the above-described technical solutions, the technical solutions provided by the embodiments of the present invention have at least the following advantages:

[0059] This invention provides a method, apparatus, storage medium, and computer device for identifying medical intent. Compared with existing technologies, this invention obtains dialogue text to be identified; identifies the dialogue text based on an intent recognition model that has been trained to obtain a primary medical intent; the intent recognition model is trained based on a loss function constructed from positive and negative sample pairs and text training samples, wherein the positive and negative sample pairs are determined based on opposing statements in the text training samples; a secondary medical intent matching the primary medical intent is determined based on a generated medical knowledge graph; and a medical intent recognition result is generated based on the primary and secondary medical intents. This reduces the overfitting of the classification model by comparing positive and negative sample objects, meets the accuracy requirements for medical intent recognition, and greatly reduces the classification error introduced by manual labeling, thereby improving the accuracy and effectiveness of medical intent recognition.

[0060] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description

[0061] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:

[0062] Figure 1 A flowchart of a method for recognizing medical intent provided by an embodiment of the present invention is shown;

[0063] Figure 2 A block diagram of a medical intent recognition device provided by an embodiment of the present invention is shown;

[0064] Figure 3 A schematic diagram of the structure of a computer device provided in an embodiment of the present invention is shown. Detailed Implementation

[0065] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0066] When identifying medical intent in dialogue content, a supervised classification model is typically trained using manually labeled training samples to classify and label the dialogue text. However, manual labeling is wasteful of manpower, and when the number of training samples for new intents is limited, it can lead to overfitting of the classification model, failing to meet the accuracy requirements for medical intent identification. Furthermore, different labeling by different people can introduce excessive classification errors into the training samples, significantly impacting the accuracy and effectiveness of medical intent identification. This invention provides a method for identifying medical intent, such as... Figure 1 As shown, the method includes:

[0067] 101. Obtain the dialogue text to be recognized.

[0068] In this embodiment of the invention, the current execution end is a processing server or dialogue subsystem that implements digital medical functions, so that after receiving the dialogue content accessed by the user, it is converted into dialogue text for intent recognition. Furthermore, the dialogue text to be recognized can be entered by the user in real time, or it can be extracted from a database at preset time intervals; this embodiment of the invention does not impose specific limitations.

[0069] It should be noted that, in order to accurately identify medical intentions, the content of the dialogue text in the embodiments of the present invention includes, but is not limited to, statements containing any medical terms entered by the user through a voice device, such as, "I want to consult about the disease causing leg pain." The embodiments of the present invention do not impose specific limitations.

[0070] 102. Based on the intent recognition model that has completed model training, the dialogue text is recognized to obtain the first-level medical intent.

[0071] In this embodiment of the invention, after acquiring the dialogue text to be identified, the current execution terminal calls the intent recognition model that has been trained, and identifies the dialogue text based on this intent recognition model to obtain the medical intent identified by the machine learning model. The intent recognition model is trained using a loss function constructed from positive and negative sample pairs and text training samples. The training text data contained in the text training samples is small sample data, and the text training samples are divided into positive and negative sample pairs according to the rise and fall of opposing statements, thereby constructing a loss function suitable for medical intent recognition based on the positive and negative sample pairs. Furthermore, in this embodiment of the invention, the medical intent is used to characterize the user's intention to further medical diagnosis, thereby causing the current execution terminal to call the corresponding processing interface for processing. The first-level medical intent at this time is the intent recognition result obtained by the current machine learning model, including but not limited to medical project detection intent, doctor's visit intent, medical department access intent, prescription intent, etc., which are not specifically limited in this embodiment of the invention.

[0072] It should be noted that the intent recognition model in this embodiment of the invention is constructed based on the text semantic network in the machine learning model. The text semantic network can be the BERT network model. In this embodiment of the invention, in order to improve the recognition transformation of dialogue text intent, the constructed text semantic network includes an editor in the input layer and an editor in the output layer, that is, it includes a fixed parameter encoder layer and a fine-tuning encoder layer. The fixed parameter encoder is placed in the input layer, and the fine-tuning encoder is placed in the output layer and connected to a linear layer. This embodiment of the invention does not make specific limitations.

[0073] 103. Based on the generated medical knowledge graph, determine the secondary medical intent that matches the primary medical intent, and generate a medical intent recognition result based on the primary medical intent and the secondary medical intent.

[0074] In this embodiment of the invention, after identifying the dialogue text based on the intent recognition model and obtaining the primary medical intent, the current execution end retrieves the generated medical knowledge graph and matches it with the primary medical intent to determine the secondary medical intent, thereby generating a medical intent recognition result. The medical knowledge graph is pre-constructed based on a complete medical terminology database including different intent levels, enabling the retrieval of medical intents for all items based on the primary medical intent, generating the final medical intent recognition result, and greatly improving the accuracy of medical intent recognition.

[0075] For example, if the primary medical intent is chest tightness, shortness of breath, and vomiting, and the secondary medical intent matched based on the medical knowledge graph is myocardial infarction, then the generated medical intent recognition result is chest tightness, shortness of breath, vomiting - myocardial infarction.

[0076] In another embodiment of the invention, for further explanation and limitation, before the step of recognizing the dialogue text based on the intent recognition model that has completed model training to obtain the primary medical intent, the method further includes:

[0077] Obtain initial text training samples and construct a text semantic network;

[0078] The initial text training sample is encoded based on the fixed-parameter encoder to obtain a first text sample, and the initial text training sample is encoded based on the fine-tuning encoder to obtain a second text sample.

[0079] Based on the opposing statements in the first text sample and the second text sample, generate text training samples containing positive sample pairs and negative sample pairs;

[0080] The text semantic network is trained based on the text training samples to obtain an intent recognition model.

[0081] To achieve efficient and accurate medical intent recognition based on machine learning models, this embodiment of the invention pre-acquires initial text training samples and constructs a text semantic network for model training. The initial text training samples are unclassified positive and negative sample pairs and are used as training samples for model training. The text semantic network is preferentially selected as a BERT network model, configured with a fixed-parameter encoder and a fine-tuning encoder. The fixed-parameter encoder is placed in the input layer, and the fine-tuning encoder is placed in the output layer and connected to a linear layer. In this embodiment, the initial text training samples are first encoded using the fixed-parameter encoder of the BERT network model to obtain a first text sample. Then, the first text sample is encoded using the fine-tuning encoder of the BERT network model to obtain a second text sample. Positive and negative sample pairs are then selected based on the contrasting statements in the first and second text samples to obtain text training samples. The text semantic network is then trained using these text training samples to obtain the intent recognition model.

[0082] It should be noted that when encoding the first text sample based on the fine-tuning encoder, in order to achieve fine-tuning of the semantic recognition task, the second text sample contains a preset task string when it is encoded. The preset task string can be [cls] or a string corresponding to other recognition intent tasks. This embodiment of the invention does not make specific limitations. In addition, in this embodiment of the invention, since the text training samples include positive sample pairs and negative sample pairs, when training the text semantic network model based on the text training samples, training is performed based on positive sample pairs and negative sample pairs respectively, and the loss is determined according to the loss function corresponding to the comparative training. The model training is completed when the loss meets the preset conditions, thereby avoiding training the intent recognition model under overfitting conditions and improving the model training accuracy.

[0083] In another embodiment of the invention, for further explanation and limitation, the step of encoding the initial text training sample based on the fixed-parameter encoder to obtain the first text sample includes:

[0084] The task level of each network layer in the text semantic network is determined, and the initial text training samples are pooled according to the task level by the fixed-parameter encoder to obtain the pooled sentence vectors of each layer.

[0085] The average value of the sentence vectors at each level is used as the first text sample.

[0086] To accurately and effectively obtain the first text sample and combine it with the second text sample, when encoding the initial text training sample based on the fixed-parameter encoder, since the text semantic network is a BERT network, the task level of each network layer in the text semantic network is determined. The initial text training sample is then pooled according to the task level by the fixed-parameter encoder to obtain the pooled sentence vectors for each layer. Specifically, the parameters and structure of the fixed-parameter encoder BERT1 are pre-configured according to the parameters and structure obtained from pre-training. Each mini-batch of n sentences from the initial text training sample is used as input data and transmitted to the BERT1 encoder. At this time, the task level token-level of each layer of the BERT1 encoder can be determined based on the pre-trained model. The task level token-level is represented as t. lk , for {t lk The sentence vector t is obtained by max polling. l Then take the {t} of each task level token-level. l Take the average value to get x. i Sentence representation h i , as the first text sample.

[0087] Correspondingly, the step of encoding the initial text training sample based on the fine-tuned encoder to obtain the second text sample includes:

[0088] Determine the task string, add the task string to the task position of the initial text training sample, and encode the initial text training sample based on the fine-tuning encoder;

[0089] The encoded text sample is projected into a sentence vector through the linear layer to obtain the second text sample.

[0090] In this embodiment of the invention, after determining the first text sample, in order to effectively obtain the second text sample, specifically, the task string for task fine-tuning and the task position where this task string needs to be added are first determined so that the task string can be added to the task position. Specifically, based on task requirements, technicians can mark the task position to insert the task string, or the task string can be configured at the beginning of sentences in the initial text training sample using random or fixed position configuration; this embodiment of the invention does not impose specific limitations. Simultaneously, the initial text training sample is encoded using a fine-tuning encoder, and the encoded text sample is projected into a sentence vector through a linear layer to obtain the second text sample, i.e., sample x. i The input is fed into a fine-tuned BERT2 encoder, and the sentence is mapped to a sentence vector with the task string [cls] through the encoding layer, represented as c. i , as the second text sample.

[0091] In another embodiment of the invention, for further explanation and limitation, the step of generating text training samples containing positive and negative sample pairs based on opposing statements in the first and second text samples includes:

[0092] Determine the number of positive samples and the number of negative samples from the initial text training samples;

[0093] The first text sample is combined with the number of positive samples of the second text sample to obtain a positive sample pair, and the first text sample is combined with the number of negative samples of the second text sample to obtain a negative sample pair;

[0094] The text training samples are generated based on the positive sample pairs and the negative sample pairs.

[0095] To accurately classify text training samples into positive and negative pairs and reduce overfitting, in this embodiment of the invention, the number of positive and negative samples is first determined from the initial text training samples. Then, the first and second text samples are combined according to the number of positive and negative samples to obtain positive and negative pairs. The first statement corresponding to the number of positive samples and the second statement corresponding to the number of negative samples are in opposition; this opposition means the statements have no similar meaning. This can be based on manual labeling or on the maximum similarity difference; this embodiment does not impose a specific limitation. Simultaneously, the number of positive and negative samples can be determined statistically based on the number of the first and second statements; this embodiment does not impose a specific limitation. During combination, the first text sample h... i The second text sample c corresponding to the number of positive samples i (i < n) i By combining them, we obtain positive sample pairs {(h)} i c i )};The first text sample h j The second text sample c corresponding to the number of positive samples j (i≠j) j By combining them, we obtain negative sample pairs {(h)} j c j This is to bring positive samples closer together and widen the distance between negative samples when performing training based on positive and negative sample pairs.

[0096] In another embodiment of the invention, for further explanation and limitation, the steps further include:

[0097] The loss values ​​of the positive sample pairs and the negative sample pairs are determined based on the linear layer, and the loss function of the positive sample pairs is determined based on the loss values ​​and preset hyperparameters.

[0098] Calculate the parameter distance between the fixed-parameter encoder and the fine-tuning encoder, and determine the sample deviation between the fixed-parameter encoder and the fine-tuning encoder based on the positive sample pairs and the negative sample pairs;

[0099] The loss function is constructed based on the positive sample pair loss function, the parameter distance, and the sample bias.

[0100] To improve the accuracy of model training based on a loss function, specifically, the loss values ​​for positive and negative sample pairs are determined based on the linear layer, denoted by f(). For example, the loss value for a positive sample pair (h) is... i c i ), negative sample pairs (h) j c j ) are combined into {z i}、{z j}, corresponding to the loss value f(z) i f(z) j Meanwhile, when determining the loss function for positive sample pairs based on the loss value and preset hyperparameters, the loss function for positive sample pairs is expressed as follows: Where sim is the vector distance calculation function, i.e., cosine similarity, and τ and λ are preset hyperparameters. Additionally, the parametric distance between the fixed-parameter encoder and the fine-tuning encoder is calculated through... Furthermore, based on positive and negative sample pairs, the sample deviation m(i,j) between the fixed-parameter encoder and the fine-tuning encoder is determined. Specifically, The fixed-parameter encoder and the fine-tuned encoder are represented by the same x, and the loss function is constructed based on the positive sample pair loss function, parameter distance, and sample bias, expressed as follows:

[0101] In another embodiment of the invention, for further explanation and limitation, before determining the secondary medical intent matching the primary medical intent based on the generated medical knowledge graph, the method further includes:

[0102] Access the medical terminology database;

[0103] Medical intent pointers are constructed based on the word similarity corresponding to the same intent level, and the medical knowledge graph is generated according to the medical intent pointers.

[0104] To improve the accuracy of medical intent recognition by performing a second medical intent matching based on the generated medical knowledge graph, a medical terminology database is first acquired to generate the medical knowledge graph. This database includes all words at different intent levels, which represent the hierarchical levels between intents. Multiple intent levels can be included, with lower-level intent levels corresponding to higher-level intent levels. This embodiment of the invention does not impose specific limitations. For example, brain diseases are the first intent level, while the second intent level could include brain tumors, encephalitis, and cerebral hemorrhage. Similarly, the first intent level could be prescription medication, while the second intent level could include digestive medications, neuromodulatory medications, and health maintenance medications. This embodiment of the invention does not impose specific limitations.

[0105] It should be noted that when generating a medical knowledge graph, since the same intent level contains multiple intents, medical intent pointers are constructed based on the word similarity corresponding to the same intent level. This allows the generation of the medical knowledge graph according to these medical intent pointers; that is, the text training samples correspond to the initial medical intent pointers of the medical knowledge graph. For example, if the first intent level is brain disease, the second intent level may include brain tumor, encephalitis, cerebral hemorrhage, etc. In this case, the similarity between the words "brain tumor," "encephalitis," and "cerebral hemorrhage" is calculated, and the words are sorted according to their similarity. The medical intent pointers are then determined based on this sorting, meaning one intent points to another, thus constructing a network to generate the medical knowledge graph according to these medical intent pointers. In other words, the network between various intents in the medical knowledge graph searches layer by layer through these medical intent pointers, thereby determining the second-level medical intents that match the first-level medical intents based on the medical knowledge graph. This means that there can be multiple second-level medical intents, and this embodiment of the invention does not impose specific limitations.

[0106] In another embodiment of the invention, for further explanation and limitation, after generating a medical intent recognition result based on the primary medical intent and the secondary medical intent, the method further includes:

[0107] Determine the medical processing interface that matches the medical intent recognition result, and obtain the historical medical data corresponding to the medical processing interface;

[0108] Matching the secondary medical intent with medical keywords in the historical medical data;

[0109] If the secondary medical intent matches the medical keyword, then medical operation access is performed based on the medical processing interface.

[0110] In this embodiment of the invention, to achieve efficient digital medical processing based on medical intent, after obtaining the medical intent recognition result, the current execution end determines the medical processing interface matched by the medical intent recognition result. This medical processing interface represents interfaces such as data transmission, link redirection, and session access, in order to process the next medical service. Simultaneously, to further verify whether this medical processing interface can realize medical operation access, all historical medical data corresponding to the medical processing interface is obtained. This historical medical data includes, but is not limited to, data generated by all medical operations performed based on this medical processing interface, such as statements in all dialogue content based on the medical session interface. This embodiment of the invention does not impose specific limitations. Furthermore, the current execution end matches the secondary medical intent with medical keywords in the historical medical data. Before matching, the historical medical data is updated in real time, and medical keywords are extracted simultaneously, including but not limited to any medical-related words. These can be determined through a medical database or manually. This embodiment of the invention does not impose specific limitations. If the secondary medical intent matches the medical keywords, it indicates that this medical processing interface has processed a medical operation corresponding to the secondary medical intent. Therefore, medical operation access is performed based on the medical processing interface. In addition, the matching of secondary medical intent and medical keywords can be judged based on word similarity. For example, the secondary medical intent and medical keywords can be converted into word vectors, and the similarity between word vectors can be calculated to determine whether they match within a preset similarity range. This embodiment of the invention does not make specific limitations.

[0111] This invention provides a method for identifying medical intent. Compared with existing technologies, this invention obtains the dialogue text to be identified and identifies the dialogue text based on an intent recognition model that has been trained to obtain a primary medical intent. The intent recognition model is trained using a loss function constructed based on positive and negative sample pairs and text training samples. The positive and negative sample pairs are determined based on opposing statements in the text training samples. A secondary medical intent matching the primary medical intent is determined based on a generated medical knowledge graph. A medical intent recognition result is generated based on the primary and secondary medical intents. This method reduces overfitting of the classification model by comparing positive and negative sample objects during training, meets the accuracy requirements for medical intent recognition, and greatly reduces the classification error introduced by manual labeling, thereby improving the accuracy and effectiveness of medical intent recognition.

[0112] Furthermore, as a response to the above Figure 1 The implementation of the method shown in this invention provides a medical intent recognition device, such as... Figure 2 As shown, the device includes:

[0113] Module 21 is used to acquire the dialogue text to be recognized.

[0114] The recognition module 22 is used to recognize the dialogue text based on the intent recognition model that has been trained to obtain the first-level medical intent. The intent recognition model is trained based on a loss function constructed based on positive sample pairs and negative sample pairs and text training samples. The positive sample pairs and the negative sample pairs are determined based on the opposing statements in the text training samples.

[0115] The generation module 23 is used to determine the secondary medical intent that matches the primary medical intent based on the generated medical knowledge graph, and to generate a medical intent recognition result based on the primary medical intent and the secondary medical intent.

[0116] Furthermore, the device also includes: a construction module, a processing module, and a training module.

[0117] The construction module is used to obtain initial text training samples and construct a text semantic network, which includes a fixed-parameter encoder and a fine-tuning encoder.

[0118] The processing module is used to encode the initial text training sample based on the fixed-parameter encoder to obtain a first text sample, and to encode the initial text training sample based on the fine-tuning encoder to obtain a second text sample, wherein the second text sample contains a preset task string.

[0119] The generation module is used to generate text training samples containing positive sample pairs and negative sample pairs based on the opposing statements in the first text sample and the second text sample.

[0120] The training module is used to train the text semantic network based on the text training samples to obtain an intent recognition model.

[0121] Furthermore, the fixed-parameter encoder is placed in the input layer. The processing module is specifically used to determine the task level of each network layer in the text semantic network, and to perform pooling processing on the initial text training samples according to the task level through the fixed-parameter encoder to obtain the pooled sentence vectors of each layer; the average value of the sentence vectors of each layer is determined as the first text sample.

[0122] The fine-tuning encoder is placed in the output layer and connected to a linear layer. The processing module is further used to determine the task string, add the task string to the task position of the initial text training sample, and encode the initial text training sample based on the fine-tuning encoder; the encoded text sample is projected into a sentence vector through the linear layer to obtain the second text sample.

[0123] Furthermore, the generation module is specifically used to determine the number of positive samples and the number of negative samples from the initial text training samples, wherein the first statement corresponding to the number of positive samples and the second statement corresponding to the number of negative samples have an opposing relationship; to combine the first text sample with the second text sample of the number of positive samples to obtain a positive sample pair, and to combine the first text sample with the second text sample of the number of negative samples to obtain a negative sample pair; and to generate the text training samples based on the positive sample pairs and the negative sample pairs.

[0124] Furthermore, the construction module is also used to determine the loss values ​​of the positive sample pairs and the negative sample pairs based on the linear layer, and to determine the loss function of the positive sample pairs based on the loss values ​​and preset hyperparameters; to calculate the parameter distance between the fixed-parameter encoder and the fine-tuning encoder, and to determine the sample bias between the fixed-parameter encoder and the fine-tuning encoder based on the positive sample pairs and the negative sample pairs; and to construct the loss function according to the loss function of the positive sample pairs, the parameter distance, and the sample bias.

[0125] Furthermore,

[0126] The acquisition module is also used to acquire a medical terminology database, which includes all terms at different intent levels;

[0127] The generation module is further configured to construct medical intent pointers based on the word similarity corresponding to the same intent level, and generate the medical knowledge graph according to the medical intent pointers, wherein the text training samples correspond to the initial medical intent pointers of the medical knowledge graph.

[0128] Furthermore, the device also includes:

[0129] The determination module is used to determine the medical processing interface that matches the medical intent recognition result and to obtain the historical medical data corresponding to the medical processing interface.

[0130] The matching module is used to match the secondary medical intent with medical keywords in the historical medical data;

[0131] The access module is used to perform medical operation access based on the medical processing interface if the secondary medical intent matches the medical keyword.

[0132] This invention provides a medical intent recognition device. Compared with the prior art, this invention acquires the dialogue text to be recognized; identifies the dialogue text based on a pre-trained intent recognition model to obtain a primary medical intent; the intent recognition model is trained using a loss function constructed based on positive and negative sample pairs and text training samples, where the positive and negative sample pairs are determined based on opposing statements in the text training samples; a secondary medical intent matching the primary medical intent is determined based on a generated medical knowledge graph; and a medical intent recognition result is generated based on the primary and secondary medical intents. This reduces overfitting of the classification model by comparing positive and negative sample objects during training, meeting the accuracy requirements for medical intent recognition and significantly reducing classification errors introduced by manual labeling, thereby improving the accuracy and effectiveness of medical intent recognition.

[0133] According to one embodiment of the present invention, a storage medium is provided, the storage medium storing at least one executable instruction, the computer-executable instruction being capable of executing the medical intent recognition method in any of the above method embodiments.

[0134] Figure 3 The diagram illustrates a structural schematic of a computer device according to an embodiment of the present invention. The specific embodiments of the present invention do not limit the specific implementation of the computer device.

[0135] like Figure 3 As shown, the computer device may include: a processor 302, a communications interface 304, a memory 306, and a communications bus 308.

[0136] The processor 302, communication interface 304, and memory 306 communicate with each other via communication bus 308.

[0137] Communication interface 304 is used to communicate with other network elements such as clients or other servers.

[0138] The processor 302 is used to execute program 310, specifically to perform the relevant steps in the above-described embodiment of the medical intent recognition method.

[0139] Specifically, program 310 may include program code that includes computer operation instructions.

[0140] Processor 302 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention. The computer device includes one or more processors, which may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.

[0141] Memory 306 is used to store program 310. Memory 306 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.

[0142] Specifically, program 310 can be used to cause processor 302 to perform the following operations:

[0143] Obtain the dialogue text to be recognized:

[0144] The intent recognition model, which has been trained, is used to identify the dialogue text to obtain the first-level medical intent. The intent recognition model is trained based on a loss function constructed from positive and negative sample pairs and text training samples. The positive and negative sample pairs are determined based on opposing statements in the text training samples.

[0145] Based on the generated medical knowledge graph, a secondary medical intent matching the primary medical intent is determined, and a medical intent recognition result is generated based on the primary medical intent and the secondary medical intent.

[0146] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.

[0147] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for identifying medical intent, characterized in that, include: Obtain the dialogue text to be recognized: The intent recognition model, which has been trained, is used to identify the dialogue text to obtain the first-level medical intent. The intent recognition model is trained based on a loss function constructed from positive and negative sample pairs and text training samples. The positive and negative sample pairs are determined based on opposing statements in the text training samples. Based on the generated medical knowledge graph, determine the secondary medical intent that matches the primary medical intent, and generate a medical intent recognition result based on the primary medical intent and the secondary medical intent; Before the intent recognition model, which has already been trained, identifies the dialogue text to obtain the primary medical intent, the method further includes: Obtain initial text training samples and construct a text semantic network, which includes a fixed-parameter encoder and a fine-tuning encoder; The initial text training sample is encoded based on the fixed-parameter encoder to obtain a first text sample, and the initial text training sample is encoded based on the fine-tuning encoder to obtain a second text sample, wherein the second text sample contains a preset task string; Based on the opposing statements in the first text sample and the second text sample, a text training sample containing positive sample pairs and negative sample pairs is generated. The positive sample pair is obtained by combining the first text sample with the second text sample with the number of positive samples, and the negative sample pair is obtained by combining the first text sample with the second text sample with the number of negative samples. The text semantic network is trained based on the text training samples to obtain an intent recognition model. Wherein, the fixed-parameter encoder is placed in the input layer, and the encoding process of the initial text training samples based on the fixed-parameter encoder to obtain the first text sample includes: The task level of each network layer in the text semantic network is determined, and the initial text training samples are pooled according to the task level by the fixed-parameter encoder to obtain the pooled sentence vectors of each layer. The average value of the sentence vectors at each level is determined as the first text sample; The fine-tuning encoder is placed in the output layer and connected to a linear layer. The process of encoding the initial text training samples based on the fine-tuning encoder to obtain the second text sample includes: Determine the task string, add the task string to the task position of the initial text training sample, and encode the initial text training sample based on the fine-tuning encoder; The encoded text sample is projected into a sentence vector through the linear layer to obtain the second text sample.

2. The method according to claim 1, characterized in that, The process of generating text training samples containing positive and negative sample pairs based on opposing statements in the first and second text samples includes: The number of positive samples and the number of negative samples are determined from the initial text training samples, wherein the first statement corresponding to the number of positive samples and the second statement corresponding to the number of negative samples are in opposition to each other; The text training samples are generated based on the positive sample pairs and the negative sample pairs.

3. The method according to claim 1, characterized in that, The method further includes: The loss values ​​of the positive sample pairs and the negative sample pairs are determined based on the linear layer, and the loss function of the positive sample pairs is determined based on the loss values ​​and preset hyperparameters. Calculate the parameter distance between the fixed-parameter encoder and the fine-tuning encoder, and determine the sample deviation between the fixed-parameter encoder and the fine-tuning encoder based on the positive sample pairs and the negative sample pairs; The loss function is constructed based on the positive sample pair loss function, the parameter distance, and the sample bias.

4. The method according to claim 1, characterized in that, Before determining the secondary medical intent matching the primary medical intent based on the generated medical knowledge graph, the method further includes: Obtain a medical terminology database, which includes all terms at different intent levels; A medical intent pointer is constructed based on the word similarity corresponding to the same intent level, and the medical knowledge graph is generated according to the medical intent pointer. The text training sample corresponds to the initial medical intent pointer of the medical knowledge graph.

5. The method according to any one of claims 1-4, characterized in that, After generating the medical intent recognition result based on the primary medical intent and the secondary medical intent, the method further includes: Determine the medical processing interface that matches the medical intent recognition result, and obtain the historical medical data corresponding to the medical processing interface; Matching the secondary medical intent with medical keywords in the historical medical data; If the secondary medical intent matches the medical keyword, then medical operation access is performed based on the medical processing interface.

6. A medical intent recognition device, characterized in that, include: The acquisition module is used to acquire the dialogue text to be recognized. The recognition module is used to recognize the dialogue text based on the intent recognition model that has been trained to obtain the first-level medical intent. The intent recognition model is trained based on a loss function constructed based on positive sample pairs and negative sample pairs and text training samples. The positive sample pairs and the negative sample pairs are determined based on the opposing statements in the text training samples. The generation module is used to determine the secondary medical intent that matches the primary medical intent based on the generated medical knowledge graph, and to generate a medical intent recognition result based on the primary medical intent and the secondary medical intent. The device further includes: a construction module, a processing module, and a training module. The construction module is used to obtain initial text training samples and construct a text semantic network, which includes a fixed-parameter encoder and a fine-tuning encoder. The processing module is used to encode the initial text training sample based on the fixed-parameter encoder to obtain a first text sample, and to encode the initial text training sample based on the fine-tuning encoder to obtain a second text sample, wherein the second text sample contains a preset task string. The generation module is used to generate text training samples containing positive sample pairs and negative sample pairs based on the opposing statements in the first text sample and the second text sample. The positive sample pair is obtained by combining the first text sample with the second text sample with the number of positive samples, and the negative sample pair is obtained by combining the first text sample with the second text sample with the number of negative samples. The training module is used to train the text semantic network based on the text training samples to obtain an intent recognition model; The fixed-parameter encoder is located in the input layer. The processing module is specifically used to determine the task level of each network layer in the text semantic network, and to perform pooling processing on the initial text training samples according to the task level through the fixed-parameter encoder to obtain the pooled sentence vectors of each layer; the average value of the sentence vectors of each layer is determined as the first text sample; The fine-tuning encoder is placed in the output layer and connected to a linear layer. The processing module is further used to determine the task string, add the task string to the task position of the initial text training sample, and encode the initial text training sample based on the fine-tuning encoder; the encoded text sample is projected into a sentence vector through the linear layer to obtain the second text sample.

7. A storage medium storing at least one executable instruction that causes a processor to perform an operation corresponding to the medical intent recognition method as described in any one of claims 1-5.

8. A computer device, comprising: The processor, memory, communication interface, and communication bus are provided, wherein the processor, memory, and communication interface communicate with each other via the communication bus. The memory is used to store at least one executable instruction that causes the processor to perform an operation corresponding to the medical intent recognition method as described in any one of claims 1-5.