Dialogue path construction method, dialogue path generation method and related equipment

By obtaining and sorting dialogue elements from medical texts and combining the dialogue path generation model, the problem of insufficient dialogue data in the medical field is solved, and automatic construction and efficient generation of dialogue paths are realized.

CN113887247BActive Publication Date: 2024-12-17IFLYTEK CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111234994.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-22
Publication Date
2024-12-17
Estimated Expiration
2041-10-22

AI Technical Summary

Technical Problem

It is difficult to obtain a large amount of dialogue data in the medical field, making it difficult to determine a reasonable dialogue path in the dialogue strategy determination part.

Method used

By obtaining dialogue elements and their attributes from medical texts with diagnosis, sorting and adjusting the order, using the pre-established dialogue path generation model to generate dialogue paths, and a large number of dialogue paths are constructed to train the dialogue path generation model.

Benefits of technology

It realizes automatic construction of dialogue paths in the medical field, and trains a dialogue path generation model with better performance to generate a more reasonable dialogue path, solving the problem of insufficient data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113887247B_ABST
    Figure CN113887247B_ABST
Patent Text Reader

Abstract

The present application provides a dialogue path construction method, a dialogue path generation method and related equipment. The dialogue path construction method includes: obtaining a number of dialogue elements and attributes corresponding to the dialogue elements from a medical text, sorting the dialogue elements according to their influence on the diagnosis and the attributes corresponding to the dialogue elements, so as to obtain an initial dialogue path; adjusting the initial dialogue path to obtain a finally constructed dialogue path. The dialogue path can be automatically constructed by the dialogue path construction method provided by the present application. On this basis, the present application also provides a dialogue path generation method. The method generates a dialogue path using a dialogue path generation model. Since the dialogue path generation model is trained using a large number of dialogue paths constructed by the above method, the dialogue path generation model has better performance. Using the dialogue path generation model with better performance, a more reasonable dialogue path can be generated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of human-computer dialogue, and in particular to a dialogue path construction method, a dialogue path generation method and related equipment. Background Art

[0002] In recent years, human-computer dialogue systems have been applied in many fields, including the medical field. Dialogue systems in the medical field usually communicate with users based on a large amount of medical knowledge combined with deep learning networks.

[0003] There is a key part in the dialogue system, namely the dialogue strategy determination part. When the dialogue system communicates with the user, it needs to use the dialogue strategy determination part to determine the next dialogue strategy (i.e., dialogue elements) based on the historical dialogue, and then generate the reply content to the user according to the dialogue strategy. It should be noted that the sequence of dialogue elements determined by the dialogue strategy determination part can be called a dialogue path.

[0004] At present, the determination of dialogue strategies is achieved through models. It is understandable that the model needs to be trained using a large amount of training data (i.e., a large number of dialogue paths). However, it is difficult to obtain a large amount of dialogue data in the medical field, and thus it is difficult to obtain a large amount of dialogue paths, i.e., training data. Insufficient training data will inevitably lead to difficulty in training a model with better results. Summary of the invention

[0005] In view of this, the present application provides a dialogue path construction method, a dialogue path generation method and related devices to solve the problem that it is difficult to obtain a large number of dialogue paths in the medical field, which leads to the difficulty of determining a reasonable dialogue path in the dialogue strategy determination part. The technical solution is as follows:

[0006] A method for constructing a dialogue path, comprising:

[0007] Acquire a plurality of dialogue elements and attributes respectively corresponding to the plurality of dialogue elements from a medical text having a diagnosis, wherein the dialogue elements are medical elements in the medical text that are related to the diagnosis;

[0008] According to the influence of each dialogue element on the diagnosis and the attributes corresponding to each dialogue element, the dialogue elements are sorted, and the obtained dialogue element sequence is used as the initial dialogue path;

[0009] The order of the dialogue elements in the initial dialogue path that are not in a reasonable order is adjusted, and the adjusted dialogue path is used as the final constructed dialogue path.

[0010] Optionally, the sorting of the dialogue elements according to the influence of each dialogue element on the diagnosis and the attributes corresponding to each dialogue element includes:

[0011] The dialogue elements are sorted according to the likelihood ratio of each dialogue element to the diagnosis and the attributes corresponding to each dialogue element.

[0012] Optionally, the sorting of the dialogue elements according to the likelihood ratio of each dialogue element to the diagnosis and the attribute corresponding to each dialogue element includes:

[0013] Sorting the dialogue elements in descending order of likelihood ratios of the dialogue elements to the diagnosis to obtain a sorting result;

[0014] Determining an initial dialogue element from the dialogue elements according to the ranking result and the attributes corresponding to the dialogue elements;

[0015] The initial dialogue elements are sorted in descending order of likelihood ratio, and the other dialogue elements are arranged after the last initial dialogue element in descending order of likelihood ratio.

[0016] Optionally, adjusting the order of the dialogue elements in the initial dialogue path that are not in a reasonable order includes:

[0017] Using a pre-established dialogue path adjustment model, the order of the dialogue elements in the initial dialogue path that are not in a reasonable order is adjusted;

[0018] The dialogue path adjustment model is trained using dialogue paths obtained from real doctor-patient dialogue data as training samples.

[0019] Optionally, the using a pre-established dialogue path adjustment model to adjust the order of dialogue elements in the initial dialogue path that are in an unreasonable order includes:

[0020] Using a pre-established dialogue path adjustment model, based on the initial dialogue elements in the initial dialogue path, dialogue elements are generated one by one;

[0021] When each dialogue element is generated, the probability of each non-initial dialogue element in the initial dialogue path being generated is predicted, and the dialogue element is generated according to the predicted probability.

[0022] A method for generating a dialogue path, comprising:

[0023] Using a pre-established dialogue path generation model, the next dialogue element is generated based on the historical dialogue path and the user's response to the dialogue element in the historical dialogue path;

[0024] The dialogue path generation model is trained using training data in a training data set, and the training data is a dialogue path constructed using any of the dialogue path construction methods described above.

[0025] Optionally, the using of a pre-established dialogue path generation model to generate the next dialogue element based on the historical dialogue path and the user's response to the dialogue element in the historical dialogue path includes:

[0026] Acquire dialogue elements related to the dialogue elements in the historical dialogue path based on the medical knowledge graph, and form a related dialogue element set with the acquired dialogue elements;

[0027] The next dialogue element is generated by using a pre-established dialogue path generation model based on the historical dialogue path, the user's response to the dialogue element in the historical dialogue path, and the set of related dialogue elements.

[0028] Optionally, the acquiring of dialogue elements related to the dialogue elements in the historical dialogue path based on the medical knowledge graph, and the acquisition of dialogue elements to form a related dialogue element set include:

[0029] A target node representing the dialogue element in the historical dialogue path is found from the medical knowledge graph, and the medical elements represented by the parent node, and / or child node, and / or sibling node of the target node are taken as relevant dialogue elements to form a relevant dialogue element set.

[0030] Optionally, the generating the next dialogue element based on the historical dialogue path, the user's reply to the dialogue element in the historical dialogue path, and the set of related dialogue elements includes:

[0031] Based on the historical dialogue path, the user's response to the dialogue element in the historical dialogue path, and the related dialogue element set, predict the probability of each dialogue element in the set dialogue element set being generated and the probability of each dialogue element in the related dialogue element set being generated;

[0032] The next dialogue element is generated according to the probability of each dialogue element in the set dialogue element set being generated and the probability of each dialogue element in the related dialogue element set being generated.

[0033] Optionally, the predicting the probability of each dialogue element in the set dialogue element set being generated and the probability of each dialogue element in the related dialogue element set being generated based on the historical dialogue path, the user's reply to the dialogue element in the historical dialogue path, and the related dialogue element set includes:

[0034] Determine, according to the historical conversation path and the user's response to the conversation element in the historical conversation path, a vector for predicting the next conversation element as a conversation element prediction vector;

[0035] Predicting the probability of each dialogue element in the set dialogue element set being generated according to the dialogue element prediction vector;

[0036] The probability of each dialogue element in the relevant dialogue element set being generated is predicted based on the dialogue element prediction vector and the representation vector of each dialogue element in the relevant dialogue element set.

[0037] Optionally, the generating the next dialogue element according to the probability of each dialogue element in the set dialogue element set being generated and the probability of each dialogue element in the related dialogue element set being generated includes:

[0038] Determine a first weight according to the probability of each dialogue element in the related dialogue element set being generated, the representation vector of each dialogue element in the related dialogue element set, and the dialogue element prediction vector, and determine a second weight based on the first weight;

[0039] weighting the probability of each dialogue element in the set dialogue element set being generated by using the first weight, and weighting the probability of each dialogue element in the related dialogue element set being generated by using the second weight;

[0040] Generate the next dialogue element based on the weighted probability.

[0041] Optionally, the training process of the dialogue path generation model includes:

[0042] Using the dialogue generation model, sequentially predicting the probability of each non-initial dialogue element in the training data being generated;

[0043] Determining the prediction loss of the dialogue path generation model according to the probability of each non-initial dialogue element being generated in the training data and the dialogue path length corresponding to each non-initial dialogue element, wherein the dialogue path length corresponding to a non-initial dialogue element in the training data is the length of the dialogue path composed of the non-initial dialogue element and the dialogue element before the non-initial dialogue element;

[0044] According to the prediction loss, parameters of the dialogue path generation model are updated.

[0045] A dialogue path construction device, comprising: a dialogue element acquisition module, a dialogue element sorting module and a sequence adjustment module;

[0046] The dialogue element acquisition module is used to acquire a plurality of dialogue elements and attributes corresponding to the plurality of dialogue elements from a medical text having a diagnosis, wherein the dialogue elements are medical elements in the medical text that are related to the diagnosis;

[0047] The dialogue element sorting module is used to sort the dialogue elements according to their influence on the diagnosis and the attributes corresponding to them, and the obtained dialogue element sequence is used as the initial dialogue path;

[0048] The reordering module is used to adjust the order of the dialogue elements in the initial dialogue path that are not in a reasonable order, and the adjusted dialogue path is used as the final constructed dialogue path.

[0049] A conversation path generating device, comprising: a conversation path generating module;

[0050] The dialogue path generation module is used to generate the next dialogue element based on the historical dialogue path and the user's response to the dialogue element in the historical dialogue path by using the pre-established dialogue path generation model;

[0051] The dialogue path generation model is trained using training data in a training data set, and the training data is a dialogue path constructed using the above-mentioned dialogue path construction device.

[0052] A processing device, comprising: a memory and a processor;

[0053] The memory is used to store programs;

[0054] The processor is used to execute the program to implement each step of any of the above-mentioned methods for constructing a dialogue path, and / or to implement each step of any of the above-mentioned methods for generating a dialogue path.

[0055] A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the computer program implements each step of any of the above-mentioned methods for constructing a dialogue path and / or implements each step of any of the above-mentioned methods for generating a dialogue path.

[0056] Through the above scheme, it can be known that the dialogue path construction method provided by the present application first obtains a number of dialogue elements and the attributes corresponding to the dialogue elements from the medical text with the diagnosis, and then sorts the dialogue elements according to the influence of each dialogue element on the diagnosis and the attributes corresponding to each dialogue element. The obtained dialogue element sequence is used as the initial dialogue path, and finally the order of the dialogue elements with unreasonable order in the initial dialogue path is adjusted. The adjusted dialogue path is used as the final constructed dialogue path. The dialogue path can be automatically constructed through the dialogue path construction method provided by the present application. On this basis, the present application also provides a dialogue path generation method, which generates a dialogue path using a pre-established dialogue path generation model. Since a large number of dialogue paths, i.e., training data, can be constructed through the dialogue path construction method provided by the present application, a dialogue path generation model with better performance can be trained using a large amount of training data. During the dialogue process, a more reasonable dialogue path can be generated using the dialogue path generation model with better performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0058] Figure 1 A flowchart of a method for constructing a dialogue path provided in an embodiment of the present application;

[0059] Figure 2 A flowchart of generating the next dialogue element based on the historical dialogue path and the user's response to the dialogue element in the historical dialogue path using the pre-established dialogue path generation model provided in the embodiment of the present application;

[0060] Figure 3 A schematic diagram of the structure of a conversation path construction device provided in an embodiment of the present application;

[0061] Figure 4 A schematic diagram of the structure of a conversation path generating device provided in an embodiment of the present application;

[0062] Figure 5 A schematic diagram of the structure of a processing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0063] 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 only 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.

[0064] Taking into account the difficulty in obtaining a large amount of dialogue data in the medical field, and thus a large number of dialogue paths, the applicant thought that dialogue paths in the medical field could be constructed. Following this idea, the applicant conducted research and, through continuous research, ultimately proposed a dialogue path construction method that can use medical text to construct dialogue paths. On this basis, the applicant also proposed a dialogue path generation method with better results. The basic idea of ​​this method is to use the dialogue path construction method to construct a large number of dialogue paths, and use the large number of constructed dialogue paths to train a dialogue path generation model. When communicating with users, use the trained dialogue path generation model to generate the next dialogue element.

[0065] The dialogue path construction method and dialogue path generation method provided in the present application can be applied to an electronic device having a dialogue system and data processing capability (more specifically, can be applied to the dialogue strategy determination part in the dialogue system), and the electronic device can be a server on the network side (can be a single server, or multiple servers or server clusters), or a terminal used on the user side, such as a PC, notebook, PAD, smart phone, smart speaker, etc. Next, the dialogue path construction method and dialogue path generation method provided in the present application are introduced through the following embodiments.

[0066] First embodiment

[0067] This embodiment mainly introduces a method for constructing a dialogue path.

[0068] See also Figure 1 , shows a flow chart of a method for constructing a dialogue path provided by an embodiment of the present application, which method may include:

[0069] Step S101: obtaining a plurality of dialogue elements and attributes corresponding to the plurality of dialogue elements from a medical text having a diagnosis.

[0070] Among them, the medical text may include information such as the main statement, current medical history, examinations and tests, and diagnosis. Optionally, the medical text may be an electronic medical record. Of course, this embodiment is not limited to this. Any text containing information such as the main statement, current medical history, examinations and tests, and diagnosis may be used.

[0071] The dialogue elements are medical elements related to diagnosis in the medical text, and the attributes corresponding to the dialogue elements are positive or negative. It should be noted that the medical elements related to diagnosis in the medical text can be, but are not limited to, symptoms, inducements, examinations and tests, etc.

[0072] Next, taking electronic medical records as an example, the process of obtaining medical elements from medical texts is introduced.

[0073] Electronic medical records usually contain information such as the patient's subjective statement, current medical history, examinations and tests, and the doctor's diagnosis. The specific format is shown in the following example:

[0074] Main complaint: The patient has been dizzy, has blurred vision, and sometimes has numb hands for the past week, but has no vomiting or nausea.

[0075] Current medical history: The patient has a history of cervical spondylosis

[0076] other:…

[0077] Diagnosis: Cervical spondylosis

[0078] When obtaining medical elements (i.e., conversation elements) from electronic medical records, the electronic medical records are first structured to extract key information from the electronic medical records. After structuring the above electronic medical records, the following are obtained:

[0079]

[0080] After obtaining the above structured information,

[0081] Based on a large amount of structured data from electronic medical records with diagnoses, we can extract medical elements, such as symptoms and causes related to the diagnosis: causes (cervical spondylosis), symptoms (dizziness), negative symptoms (nausea), symptoms (numbness of the upper limbs), symptoms (blurred vision), negative symptoms (vomiting), and at the same time obtain the attributes corresponding to the medical elements, such as the attribute corresponding to the medical element "dizziness" is positive, and the attribute corresponding to the medical element "nausea" is negative.

[0082] Step S102: Sort the dialogue elements according to their influence on the diagnosis and the attributes corresponding to them, and use the obtained dialogue element sequence as the initial dialogue path.

[0083] Optionally, the dialogue elements may be sorted according to their respective likelihood ratios for diagnosis and the attributes corresponding to them.

[0084] Among them, the likelihood ratio is a concept in statistics, an indicator that reflects authenticity, and a composite indicator that reflects both sensitivity and specificity. That is, the ratio of the probability of obtaining a certain screening test result among sick people to the probability of obtaining this result among healthy people.

[0085] The likelihood ratio of a dialogue element to a diagnosis may include: a positive likelihood ratio of the dialogue element to a diagnosis and a negative likelihood ratio of the dialogue element to a diagnosis. It should be noted that the likelihood ratio of a dialogue element to a diagnosis can represent the influence of the dialogue element on the diagnosis. For example, if a dialogue element is a symptom, the greater the positive likelihood ratio of the symptom to a disease, the more likely the symptom is to confirm the disease. Conversely, the greater the negative likelihood ratio of the symptom to a disease, the more likely the symptom is to exclude the disease.

[0086] In this embodiment, a medical text set including the medical text in step S101 can be obtained in advance, and the structured information of each medical text in the medical text set can be obtained, and the positive likelihood ratio and negative likelihood ratio of each dialogue element obtained in step S101 for diagnosis can be determined based on the structured information of each medical text in the medical text set. It should be noted that the specific method for determining the positive likelihood ratio and the negative likelihood ratio is a prior art, and this embodiment will not be repeated here.

[0087] Specifically, the process of sorting the dialogue elements according to the influence of each dialogue element on the diagnosis and the attributes corresponding to each dialogue element and obtaining the dialogue element sequence as the initial dialogue path may include:

[0088] Step S1021, sorting the dialogue elements in descending order of their likelihood ratios for diagnosis to obtain a sorting result.

[0089] The above content mentioned that the likelihood ratio of a dialogue element to a diagnosis includes the positive likelihood ratio of the dialogue element to the diagnosis and the negative likelihood ratio of the dialogue element to the diagnosis. When sorting the dialogue elements, the dialogue elements are sorted in descending order of their target likelihood ratios to the diagnosis. It should be noted that the target likelihood ratio of a dialogue element to a diagnosis is the larger likelihood ratio of the positive likelihood ratio of the dialogue element to the diagnosis and the negative likelihood ratio of the dialogue element to the diagnosis.

[0090] For example, there are three dialogue elements, namely A, B, and C, among which the positive likelihood ratio of A is r 1+ , the negative likelihood ratio is r 1- , r 1+ Greater than r 1- , that is, the positive likelihood ratio r 1+ is the target likelihood ratio of A, and the positive likelihood ratio of B is r 2+ , the negative likelihood ratio is r 2- , r 2- Greater than r 2+ , that is, the negative likelihood ratio r 2- is the target likelihood ratio of B, and the positive likelihood ratio of C is r 3+ , the negative likelihood ratio is r3- , r 3+ Greater than r 3- , where r 1+ Greater than r 2- , r 2- Greater than r 3+ , the sorting result is A→B→C.

[0091] Step S1022: Determine an initial dialogue element from among the dialogue elements according to the sorting result and the attributes corresponding to each dialogue element.

[0092] Optionally, M dialogue elements may be obtained from the dialogue elements that are ranked in the top N in the sorting result and have positive attributes as the initial dialogue elements. Optionally, when obtaining M dialogue elements, the M dialogue elements that are ranked in the top M in the sorting result and have positive attributes may be determined as the initial dialogue elements. Exemplarily, N is 3 and M is 2, then 2 dialogue elements are obtained from the dialogue elements that are ranked in the top 3 in the sorting result and have positive attributes as the initial dialogue elements.

[0093] Step S1023, sort the initial dialogue elements in descending order of their likelihood ratios to diagnosis, and arrange the other dialogue elements after the last initial dialogue element in descending order of their likelihood ratios to diagnosis.

[0094] It should be noted that the likelihood ratio used as a basis for sorting in this step is similar to the likelihood ratio used as a basis for sorting in step S1021, that is, the likelihood ratio used as a basis is also the larger one between the negative likelihood ratio and the positive likelihood ratio.

[0095] Exemplarily, the initial dialogue elements are: symptoms (dizziness, numbness of upper limbs), then the initial dialogue path is: symptoms (dizziness) → symptoms (numbness of upper limbs) → cause (cervical spondylosis) → negation of symptoms (nausea) → symptoms (blurred vision) → negation of symptoms (vomiting).

[0096] Step S103: adjusting the order of the dialogue elements in the initial dialogue path that are not in a reasonable order, and using the adjusted dialogue path as the final constructed dialogue path.

[0097] Considering that the initial dialogue path is constructed based on medical text (such as electronic medical records), it may differ from the actual dialogue path. Therefore, after constructing the initial dialogue path based on the medical text, the present application further adjusts the order of dialogue elements with unreasonable order in the initial dialogue path to make the dialogue path more reasonable.

[0098] Specifically, the process of adjusting the order of the dialogue elements in the initial dialogue path that are not in a reasonable order may include: adjusting the order of the dialogue elements in the initial dialogue path that are not in a reasonable order by using a pre-established dialogue path adjustment model.

[0099] The dialogue path adjustment model is trained using the dialogue path obtained from the real doctor-patient dialogue data as a training sample. In this embodiment, multiple real doctor-patient dialogue data can be obtained, and the dialogue path is obtained as a training sample according to each real doctor-patient dialogue data to obtain multiple training samples, and the dialogue path adjustment model is trained using the multiple training samples. It should be noted that each training sample may include an initial dialogue element, and the initial dialogue element is usually derived from the user's self-described content, for example, the initial dialogue element is the user's self-described symptoms.

[0100] More specifically, when the order of the unreasonable dialogue elements in the initial dialogue path is adjusted by using the dialogue path adjustment model, the dialogue elements are generated one by one based on the initial dialogue elements in the initial dialogue path by using the pre-established dialogue path adjustment model. When generating each dialogue element, the probability of each non-initial dialogue element in the initial dialogue path being generated can be predicted based on the historical dialogue path, and the dialogue element can be generated based on the predicted probability. For example, the dialogue element corresponding to the maximum probability can be determined as the generated dialogue element. It should be noted that if the dialogue element to be generated is the first dialogue element after the initial dialogue element, the historical dialogue path is the dialogue path composed of the initial dialogue element, and if the dialogue element to be generated is the non-first dialogue element after the initial dialogue element, the historical dialogue path is the dialogue path composed of the initial dialogue element and the generated dialogue element.

[0101] For example, the initial dialogue path is A→B→C→D→E→F, where A and B are initial dialogue elements. When the dialogue path adjustment model is used to adjust the initial dialogue path, the historical dialogue path A→B is first used to predict the probability P of dialogue elements C, D, E, and F being generated. 1C , P 1D , P 1E , P 1F , and then according to the probability P of the dialogue elements C, D, E, and F being generated 1C , P 1D , P 1E , P 1F Determine the dialogue elements and output them. Assume that the probability P of dialogue elements C, D, E, and F being generated is 1C , P 1D , P 1E , P 1FDetermine D as the generated dialogue element, then take A→B→D as the historical dialogue path, and use this historical dialogue path A→B→D to predict the probability P of dialogue elements C, D, E, and F being generated 2C , P 2D , P 2E , P 2F , and then according to the probability P of the generated dialogue elements C, D, E, and F 2C , P 2D , P 2E , P 2F Determine the dialogue elements and output them. Assume that the probability P of dialogue elements C, D, E, and F being generated is 2C , P 2D , P 2E , P 2F The determined dialogue element is C, then A→B→D→C is used as the historical dialogue path, and the probability P of dialogue elements C, D, E, and F being generated is predicted using the historical dialogue path A→B→D→C. 3C , P 3D , P 3E , P 3F ,…, assuming that after generating dialogue element C, dialogue element E and dialogue element F are generated in sequence, the adjusted dialogue path is A→B→D→C→E→F.

[0102] The dialogue path construction method provided in the embodiment of the present application first obtains a number of dialogue elements and the attributes corresponding to the dialogue elements from a medical text with a diagnosis, then sorts the dialogue elements according to their impact on the diagnosis and the attributes corresponding to the dialogue elements, and uses the obtained dialogue element sequence as the initial dialogue path. Finally, the order of the dialogue elements with unreasonable order in the initial dialogue path is adjusted, and the adjusted dialogue path is used as the final constructed dialogue path. The dialogue path can be automatically constructed through the dialogue path construction method provided in the present application.

[0103] Second embodiment

[0104] Based on the dialogue element construction method provided in the above embodiment, an embodiment of the present application provides a dialogue path generation method, the implementation process of which includes: using a pre-established dialogue path generation model to generate the next dialogue element based on the historical dialogue path and the user's response to the dialogue elements in the historical dialogue path.

[0105] It should be noted that the user's response to a dialogue element is confirmation or negation, which can represent the attribute of the dialogue element. For example, if the user's response to a dialogue element is confirmation, the attribute corresponding to the dialogue element is positive; if the user's response to a dialogue element is negation, the attribute corresponding to the dialogue element is negative.

[0106] After the next dialogue element is generated, the generated dialogue element can be added to the end of the historical dialogue path to obtain a new historical dialogue path. Then, the pre-established dialogue path generation model is used to generate the next dialogue element based on the new historical dialogue path and the user's response to the dialogue element in the new historical dialogue path. This process is repeated until an element is generated to indicate the end of dialogue element generation.

[0107] Exemplarily, the historical dialogue path is: symptom (dizziness) → symptom (blurred vision). First, based on the historical dialogue path symptom (dizziness) → symptom (blurred vision), the user's response to the symptom (dizziness), and the user's response to the symptom (blurred vision), the next dialogue element is generated. Suppose the generated dialogue element is symptom (nausea). Next, take symptom (dizziness) → symptom (blurred vision) → symptom (nausea) as a new historical dialogue path. Based on the historical dialogue path symptom (dizziness) → symptom (blurred vision) → symptom (nausea), the user's response to the symptom (dizziness), the user's response to the symptom (blurred vision), and the user's response to the symptom (nausea), the next dialogue element is generated, and so on, until an element indicating the end of dialogue element generation is generated.

[0108] It should be noted that the dialogue path generation model in this embodiment is trained using training data in a pre-constructed training data set, and the training data set includes a large amount of training data. The construction process of the training data set includes: obtaining a medical text set including a large amount of medical texts, and for each medical text in the medical text set, using the dialogue path construction method provided in the first embodiment to construct a dialogue path based on each medical text, so that a large number of dialogue paths can be obtained, each dialogue path is a piece of training data, and the training data set is composed of a large number of constructed dialogue paths.

[0109] Next, the implementation process of "using the pre-established dialogue path generation model to generate the next dialogue element based on the historical dialogue path and the user's response to the dialogue elements in the historical dialogue path" is introduced.

[0110] In one possible implementation, a pre-established dialogue path generation model may be used to generate the next dialogue element based only on the historical dialogue path and the user's responses to the dialogue elements in the historical dialogue path. In order to improve the dialogue path generation effect, in another possible implementation, in addition to using the historical dialogue path and the user's responses to the dialogue elements in the historical dialogue path as a basis, medical knowledge may also be combined.

[0111] This embodiment focuses on the implementation method of combining medical knowledge, which specifically includes:

[0112] Step S201: based on the medical knowledge graph, dialogue elements related to dialogue elements in the historical dialogue path are obtained, and the obtained dialogue elements form a related dialogue element set.

[0113] Among them, the medical knowledge graph includes several connected nodes, each node represents a medical element, such as symptoms, causes, etc.

[0114] The process of obtaining dialogue elements related to dialogue elements in the historical dialogue path based on the medical knowledge graph includes: finding the target node representing the dialogue elements in the historical dialogue path from the medical knowledge graph, and taking the medical elements represented by the parent node, and / or child node, and / or sibling node of the target node as relevant dialogue elements to form a relevant dialogue element set.

[0115] Step S202: using a pre-established dialogue path generation model, the next dialogue element is generated based on the historical dialogue path, the user's response to the dialogue element in the historical dialogue path, and the related dialogue element set.

[0116] The process of generating the next dialogue element based on the historical dialogue path, the user's response to the dialogue element in the historical dialogue path, and the related dialogue element set includes:

[0117] Step S2021: Based on the historical dialogue path, the user's response to the dialogue elements in the historical dialogue path, and the related dialogue element set, predict the probability of each dialogue element in the set dialogue element set being generated and the probability of each dialogue element in the related dialogue element set being generated.

[0118] Specifically, the implementation process of step S2021 may include:

[0119] Step a1: Determine a vector for predicting the next dialogue element based on the historical dialogue path and the user's response to the dialogue element in the historical dialogue path, as the dialogue element prediction vector.

[0120] Specifically, for each dialogue element in the historical dialogue path, the representation vector of the dialogue element can be determined based on the dialogue element and the user's response to the dialogue element to obtain the representation vector of each dialogue element in the historical dialogue path. Based on the representation vector of each dialogue element in the historical dialogue path, a vector for predicting the next dialogue element, i.e., a dialogue element prediction vector, is determined.

[0121] Step a2: predict the probability of each dialogue element in the set dialogue element set being generated based on the dialogue element prediction vector.

[0122] If the dialogue element prediction vector is represented as h t , then the probability of each dialogue element in the set of dialogue elements being generated It can be determined by the following formula:

[0123]

[0124] Among them, W and b are the parameters of the dialogue path generation model, which are obtained through training.

[0125] Step a3: predict the probability of each dialogue element in the relevant dialogue element set being generated based on the dialogue element prediction vector and the representation vector of each dialogue element in the relevant dialogue element set.

[0126] If the representation vector of each dialogue element in the relevant dialogue element set is expressed as (The relevant dialogue element set includes m relevant dialogue elements), and the dialogue element prediction vector is represented as h t , then the probability of each dialogue element in the relevant dialogue element set being generated It can be determined by the following formula:

[0127]

[0128] in, Cross_Attention(h t ,H k ) indicates h t and H k The cross-attention mechanism is used for calculation.

[0129] Step S2022: Generate the next dialogue element according to the probability of each dialogue element in the set dialogue element set being generated and the probability of each dialogue element in the related dialogue element set being generated.

[0130] Specifically, based on the probability of each dialogue element being generated in the set dialogue element set and the probability of each dialogue element being generated in the related dialogue element set, the target generation probability corresponding to each dialogue element appearing in the set dialogue element set and the related dialogue element set is determined, and based on the target generation probability corresponding to each dialogue element appearing in the dialogue element set and the related dialogue element set, the next dialogue element is determined.

[0131] The dialogue elements appearing in the set dialogue element set and the related dialogue element set are explained with an example: assuming that the set dialogue element set includes dialogue elements A, B, C, D, and E, and the related dialogue element set includes dialogue elements C, D, and F, then the dialogue elements appearing in the set dialogue element set and the related dialogue element set are A, B, C, D, E, and F.

[0132] There are multiple implementation methods for determining the target generation probability corresponding to each dialogue element appearing in the set dialogue element set and the related dialogue element set according to the probability of each dialogue element being generated in the set dialogue element set and the probability of each dialogue element being generated in the related dialogue element set:

[0133] In a possible implementation: for each dialogue element e that appears in the set dialogue element set and the related dialogue element set, i , if the dialogue element e i Only appears in the set of dialogue elements, then the dialogue element e in the set of dialogue elements will be i Probability of being generated Determined as a dialogue element i The corresponding target generation probability, if the dialogue element e i Only appears in the relevant dialogue element set, then the dialogue element e in the relevant dialogue element set i Probability of being generated Determined as a dialogue element i The corresponding target generation probability, if the dialogue element e i If it appears in both the set dialogue element set and the related dialogue element set, the dialogue element e in the set dialogue element set will be i Probability of being generated The dialogue element e in the related dialogue element set i Probability of being generated Sum, and the probability after summation is used as the dialogue element e i The corresponding target generation probability.

[0134] In order to improve the generation effect, in a preferred implementation: for each dialogue element e appearing in the set dialogue element set and the related dialogue element set, i , if the dialogue element ei Only appears in the set of dialogue elements, then the dialogue element e in the set of dialogue elements is weighted according to the first weight α. i Probability of being generated Weighted, the weighted probability Determined as a dialogue element i The corresponding target generation probability, if the dialogue element e i only appears in the relevant dialogue element set, then the dialogue element e in the relevant dialogue element set is weighted according to the second weight 1-α. i Probability of being generated Weighted, the weighted probability Determined as a dialogue element i The corresponding target generation probability, if the dialogue element e i If it appears in both the set dialogue element set and the related dialogue element set, the dialogue element e in the set dialogue element set will be weighted according to the first weight α. i Probability of being generated The weighted probability and the dialogue element e in the related dialogue element set according to the second weight 1-α i Probability of being generated The weighted probability Sum, and sum the probability Determined as a dialogue element i The corresponding target generation probability.

[0135] The first weight α is based on the probability of each dialogue element in the relevant dialogue element set being generated. The representation vector of each dialogue element in the relevant dialogue element set And the dialogue element prediction vector h t Determine, specifically, determine in the manner shown below:

[0136] α=σ(W[h t ;h k ]) (3)

[0137]

[0138] As mentioned above, the dialogue path generation model is trained using training data (i.e., the constructed dialogue path). Next, the training process of the dialogue path generation model is introduced.

[0139] The training process of the dialogue path generation model may include:

[0140] Step b1: Use the dialogue path generation model to predict the probability of each non-initial dialogue element in the training data being generated.

[0141] For each non-initial dialogue element w in the prediction training data i The probability of being generated is based on the historical dialogue path (w in the training data i The previous dialogue path), the user's response to the dialogue elements in the historical dialogue path, and the related dialogue element set (the method of obtaining the related dialogue element set here is similar to the method of obtaining the related dialogue element set in the above content, that is, finding the representative historical dialogue path (that is, w in the training data) from the medical knowledge graph i The node of the dialogue element in the previous dialogue path) is used as the basis for predicting the probability of each dialogue element in the set dialogue element set being generated and the probability of each dialogue element in the related dialogue element set being generated, and then the non-initial dialogue element w in the training data is determined according to the probability of each dialogue element in the set dialogue element set being generated and the probability of each dialogue element in the related dialogue element set being generated. i The probability of being generated as a non-initial dialogue element w i The corresponding target generation probability p(w i ).

[0142] It should be noted that the non-initial dialogue element w in the training data is determined according to the probability of each dialogue element being generated in the set dialogue element set and the probability of each dialogue element being generated in the related dialogue element set. i The corresponding target generation probability p(w i ) is implemented in the same manner as the above-mentioned method of determining the dialogue element e according to the probability of each dialogue element being generated in the set dialogue element set and the probability of each dialogue element being generated in the related dialogue element set. i The corresponding target generation probability is generated in the same manner, which will not be described in detail in this embodiment.

[0143] Step b2: Determine the prediction loss of the dialogue path generation model according to the probability of each non-initial dialogue element being generated in the training data and the dialogue path length corresponding to each non-initial dialogue element.

[0144] The length of the dialogue path corresponding to a non-initial dialogue element in the training data is the length of the dialogue path consisting of the non-initial dialogue element and the dialogue element before the non-initial dialogue element.

[0145] Specifically, the prediction loss of the dialogue path generation model can be calculated by the following formula:

[0146]

[0147] Where L represents the total dialogue path length of the training data, norm(i) represents the non-initial dialogue element w i The corresponding conversation path length is normalized, norm is an increasing function (for example, it can be normalized to between 1 and 2), log(p(w i )) represents the cross entropy loss. Multiplying the cross entropy loss by norm(i) can force the model to generate dialogue paths that can make decisions faster.

[0148] It should be noted that, in addition to determining the prediction loss of the dialogue path generation model in step S202, other methods may also be used. For example, the probability p(w i ) Determine the prediction loss of the dialogue path generation model, and then calculate the prediction loss of the dialogue path generation model as follows:

[0149]

[0150] Step b3: update the parameters of the dialogue path generation model according to the prediction loss of the dialogue path generation model.

[0151] The dialogue path generation model is iteratively trained multiple times according to the above process until the training end condition is met. The model obtained after the training is the established dialogue path generation model. During the human-computer dialogue process, the established dialogue path generation model can be used to generate a dialogue path.

[0152] The dialogue path generation method provided in the embodiment of the present application can generate a dialogue path using a pre-established dialogue path generation model. Since a large number of dialogue paths, i.e., training data, can be constructed by the dialogue path construction method provided in the first embodiment of the present application, a dialogue path generation model with better performance can be trained using a large number of training data. During the dialogue process, a more reasonable dialogue path can be generated using the dialogue path generation model with better performance. In addition, the present application introduces medical knowledge in the process of generating a dialogue path, which can improve the effect of dialogue path generation.

[0153] Third embodiment

[0154] The embodiment of the present application further provides a dialogue path construction device. The dialogue path construction device provided in the embodiment of the present application is described below. The dialogue path construction device described below and the dialogue path construction method described above can be referenced to each other.

[0155] See also Figure 3 , shows a schematic diagram of the structure of a dialogue path construction device provided in an embodiment of the present application, which may include: a dialogue element acquisition module 301, a dialogue element sorting module 302 and a reordering module 303.

[0156] The dialogue element acquisition module 301 is used to acquire a number of dialogue elements and attributes corresponding to the dialogue elements from a medical text having a diagnosis, wherein the dialogue elements are medical elements in the medical text that are related to the diagnosis.

[0157] The dialogue element sorting module 302 is used to sort the dialogue elements according to their influence on the diagnosis and the attributes corresponding to them, and the obtained dialogue element sequence is used as the initial dialogue path.

[0158] The sequence adjustment module 303 is used to adjust the order of the dialogue elements in the initial dialogue path that are not in a reasonable order, and the adjusted dialogue path is used as the final constructed dialogue path.

[0159] Optionally, the dialogue element sorting module 302 is specifically used to sort the dialogue elements according to the likelihood ratio of each dialogue element to the diagnosis and the attributes corresponding to each dialogue element.

[0160] Optionally, the dialogue element sorting module 302 includes: a dialogue element sorting submodule, an initial dialogue element determining submodule and an initial dialogue path acquiring submodule.

[0161] The dialogue element sorting submodule is used to sort the dialogue elements in descending order of likelihood ratios of the dialogue elements to the diagnosis, so as to obtain a sorting result.

[0162] The initial dialogue element determination submodule is used to determine the initial dialogue element from the dialogue elements according to the sorting result and the attributes corresponding to each dialogue element.

[0163] The initial dialogue path acquisition submodule is used to sort the initial dialogue elements in descending order of likelihood ratio, and to arrange other dialogue elements after the last initial dialogue element in descending order of likelihood ratio, so as to obtain the initial dialogue path.

[0164] Optionally, the reordering module 303 is specifically used to use a pre-established dialogue path adjustment model to adjust the order of dialogue elements with unreasonable order in the initial dialogue path; wherein the dialogue path adjustment model is trained using dialogue paths obtained based on real doctor-patient dialogue data as training samples.

[0165] Optionally, when the sequence adjustment module 303 uses the pre-established dialogue path adjustment model to adjust the order of the dialogue elements of unreasonable order in the initial dialogue path, it is specifically used to use the pre-established dialogue path adjustment model to generate dialogue elements one by one based on the initial dialogue elements in the initial dialogue path;

[0166] When each dialogue element is generated, the probability of each non-initial dialogue element in the initial dialogue path being generated is predicted, and the dialogue element is generated according to the predicted probability.

[0167] The dialogue path construction device provided in the embodiment of the present application first obtains a number of dialogue elements and the attributes corresponding to the dialogue elements from a medical text with a diagnosis, then sorts the dialogue elements according to their impact on the diagnosis and the attributes corresponding to the dialogue elements, and uses the obtained dialogue element sequence as the initial dialogue path. Finally, the order of the dialogue elements with unreasonable order in the initial dialogue path is adjusted, and the adjusted dialogue path is used as the final constructed dialogue path. The dialogue path can be automatically constructed by the dialogue path construction device provided in the embodiment of the present application.

[0168] Fourth embodiment

[0169] The embodiment of the present application further provides a conversation path generation device. The conversation path generation device provided in the embodiment of the present application is described below. The conversation path generation device described below and the conversation path generation method described above can refer to each other.

[0170] See also Figure 4 , shows a schematic diagram of the structure of a dialogue path generation device provided in an embodiment of the present application, which may include: a dialogue path generation module 401.

[0171] The dialogue path generation module 401 is used to generate the next dialogue element based on the historical dialogue path and the user's response to the dialogue element in the historical dialogue path by using a pre-established dialogue path generation model; wherein the dialogue path generation model is trained using the training data in the training data set, and the training data is the dialogue path constructed using the dialogue path construction device provided by the above embodiment.

[0172] Optionally, the dialogue path generation module 401 includes: a related dialogue element set acquisition submodule and a dialogue path generation submodule.

[0173] The related dialogue element set acquisition submodule is used to acquire dialogue elements related to the dialogue elements in the historical dialogue path based on the medical knowledge graph, and the acquired dialogue elements form a related dialogue element set.

[0174] The dialogue path generation submodule is used to generate the next dialogue element based on the historical dialogue path, the user's response to the dialogue element in the historical dialogue path, and the related dialogue element set by using the pre-established dialogue path generation model.

[0175] Optionally, a related dialogue element set acquisition submodule is specifically used to find a target node representing the dialogue elements in the historical dialogue path from the medical knowledge graph, and take the medical elements represented by the parent node, and / or child node, and / or sibling node of the target node as related dialogue elements to form a related dialogue element set.

[0176] Optionally, when the dialogue path generation submodule generates the next dialogue element based on the historical dialogue path, the user's response to the dialogue element in the historical dialogue path, and the set of related dialogue elements using the pre-established dialogue path generation model, it is specifically used to:

[0177] Using a dialogue path generation model, based on historical dialogue paths, responses made by users to dialogue elements in the historical dialogue paths, and the related dialogue element set, predict the probability of each dialogue element in the set dialogue element set being generated and the probability of each dialogue element in the related dialogue element set being generated;

[0178] The next dialogue element is generated by using the dialogue path generation model based on the probability of each dialogue element in the set dialogue element set being generated and the probability of each dialogue element in the related dialogue element set being generated.

[0179] Optionally, the dialogue path generation submodule, when using the dialogue path generation model, based on the historical dialogue path, the user's response to the dialogue element in the historical dialogue path, and the relevant dialogue element set, predicts the probability of each dialogue element in the set dialogue element set being generated and the probability of each dialogue element in the relevant dialogue element set being generated, is specifically used to:

[0180] Determine a vector for predicting a next dialogue element by using a dialogue path generation model, the historical dialogue path, and a user's response to a dialogue element in the historical dialogue path as a dialogue element prediction vector;

[0181] Using the dialogue path generation model and the dialogue element prediction vector, predicting the probability of each dialogue element in the set dialogue element set being generated;

[0182] The dialogue path generation model is used to predict the probability of each dialogue element in the related dialogue element set being generated based on the dialogue element prediction vector and the representation vector of each dialogue element in the related dialogue element set.

[0183] Optionally, when the dialogue path generation submodule generates the next dialogue element by using the dialogue path generation model and taking the probability of each dialogue element in the set dialogue element set being generated and the probability of each dialogue element in the related dialogue element set being generated as a basis, the dialogue path generation submodule is specifically configured to:

[0184] Determine a first weight using a dialogue path generation model, based on the probability of each dialogue element in the relevant dialogue element set being generated, the representation vector of each dialogue element in the relevant dialogue element set, and the dialogue element prediction vector, and determine a second weight based on the first weight;

[0185] Using the dialogue path generation model, weighting the probability of each dialogue element in the set dialogue element set being generated with the first weight, and weighting the probability of each dialogue element in the related dialogue element set being generated with the second weight;

[0186] The dialogue path generation model is used to generate the next dialogue element based on the weighted probability.

[0187] Optionally, the dialogue path generation device provided in the embodiment of the present application may further include: a model training module. The model training module is used to:

[0188] Using the dialogue generation model, sequentially predicting the probability of each non-initial dialogue element in the training data being generated;

[0189] Determining the prediction loss of the dialogue path generation model according to the probability of each non-initial dialogue element being generated in the training data and the dialogue path length corresponding to each non-initial dialogue element, wherein the dialogue path length corresponding to a non-initial dialogue element in the training data is the length of the dialogue path composed of the non-initial dialogue element and the dialogue element before the non-initial dialogue element;

[0190] According to the prediction loss, parameters of the dialogue path generation model are updated.

[0191] The dialogue path generation device provided in the embodiment of the present application can generate a dialogue path using a pre-established dialogue path generation model. Since a large number of dialogue paths, i.e., training data, can be constructed by the dialogue path construction device provided in the first embodiment of the present application, a dialogue path generation model with better performance can be trained using a large number of training data. During the dialogue process, a more reasonable dialogue path can be generated using the dialogue path generation model with better performance. In addition, the dialogue path generation device provided in the embodiment of the present application introduces medical knowledge in the process of generating a dialogue path, which can improve the effect of dialogue path generation.

[0192] Fifth embodiment

[0193] The present application also provides a processing device, see Figure 5 , shows a schematic diagram of the structure of the processing device, the processing device may include: at least one processor 501, at least one communication interface 502, at least one memory 503 and at least one communication bus 504;

[0194] In the embodiment of the present application, the number of the processor 501, the communication interface 502, the memory 503, and the communication bus 504 is at least one, and the processor 501, the communication interface 502, and the memory 503 communicate with each other through the communication bus 504;

[0195] The processor 501 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention;

[0196] The memory 503 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory;

[0197] The memory stores a program, and the processor can call the program stored in the memory, wherein the program is used to:

[0198] Acquire a plurality of dialogue elements and attributes respectively corresponding to the plurality of dialogue elements from a medical text having a diagnosis, wherein the dialogue elements are medical elements in the medical text that are related to the diagnosis;

[0199] According to the influence of each dialogue element on the diagnosis and the attributes corresponding to each dialogue element, the dialogue elements are sorted, and the obtained dialogue element sequence is used as the initial dialogue path;

[0200] The order of the dialogue elements in the initial dialogue path that are not in a reasonable order is adjusted, and the adjusted dialogue path is used as the final constructed dialogue path.

[0201] Optionally, the detailed functions and extended functions of the program may refer to the above description.

[0202] Sixth embodiment

[0203] The present application also provides a processing device. The structural diagram of the processing device is as follows: Figure 5 Similarly, the processing device may include: at least one processor, at least one communication interface, at least one memory and at least one communication bus;

[0204] In the embodiment of the present application, the number of the processor, the communication interface, the memory, and the communication bus is at least one, and the processor, the communication interface, and the memory communicate with each other through the communication bus;

[0205] The processor may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention;

[0206] The memory may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory;

[0207] The memory stores a program, and the processor can call the program stored in the memory, wherein the program is used to:

[0208] Using a pre-established dialogue path generation model, the next dialogue element is generated based on the historical dialogue path and the user's response to the dialogue element in the historical dialogue path;

[0209] The dialogue path generation model is trained using training data in a training data set, and the training data is a dialogue path constructed using the dialogue path construction method provided in the above embodiment.

[0210] Optionally, the detailed functions and extended functions of the program may refer to the above description.

[0211] Seventh embodiment

[0212] The embodiment of the present application further provides a readable storage medium, which may store a program suitable for execution by a processor, wherein the program is used to:

[0213] Acquire a plurality of dialogue elements and attributes respectively corresponding to the plurality of dialogue elements from a medical text having a diagnosis, wherein the dialogue elements are medical elements in the medical text that are related to the diagnosis;

[0214] According to the influence of each dialogue element on the diagnosis and the attributes corresponding to each dialogue element, the dialogue elements are sorted, and the obtained dialogue element sequence is used as the initial dialogue path;

[0215] The order of the dialogue elements in the initial dialogue path that are not in a reasonable order is adjusted, and the adjusted dialogue path is used as the final constructed dialogue path.

[0216] Optionally, the detailed functions and extended functions of the program may refer to the above description.

[0217] Eighth embodiment

[0218] The embodiment of the present application further provides a readable storage medium, which may store a program suitable for execution by a processor, wherein the program is used to:

[0219] Using a pre-established dialogue path generation model, the next dialogue element is generated based on the historical dialogue path and the user's response to the dialogue element in the historical dialogue path;

[0220] The dialogue path generation model is trained using training data in a training data set, and the training data is a dialogue path constructed using the dialogue path construction method provided in the above embodiment.

[0221] Optionally, the detailed functions and extended functions of the program may refer to the above description.

[0222] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0223] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0224] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for constructing a dialogue path, characterized in that: include: Acquire a plurality of dialogue elements and attributes corresponding to the plurality of dialogue elements from a medical text having a diagnosis, wherein the dialogue elements are medical elements in the medical text related to the diagnosis, the attributes corresponding to any dialogue element are negative or positive, and the attributes corresponding to any dialogue element are determined by a user's response to the dialogue element, and the user's response to the dialogue element is confirmation or negation; According to the influence of each dialogue element on the diagnosis and the attributes corresponding to each dialogue element, the dialogue elements are sorted, and the obtained dialogue element sequence is used as the initial dialogue path; Adjusting the order of the dialogue elements in the initial dialogue path that are not in a reasonable order, and using the adjusted dialogue path as the final constructed dialogue path; The adjusting the order of the dialogue elements in the initial dialogue path that are not in a reasonable order includes: Based on the initial dialogue elements in the initial dialogue path, dialogue elements are generated one by one. When each dialogue element is generated, the probability of non-initial dialogue elements in the initial dialogue path being generated is predicted, and the dialogue elements generated this time are determined from the non-initial dialogue elements.

2. The method for constructing a dialogue path according to claim 1, characterized in that: The step of sorting the dialogue elements according to the influence of each dialogue element on the diagnosis and the attributes corresponding to each dialogue element comprises: The dialogue elements are sorted according to the likelihood ratio of each dialogue element to the diagnosis and the attributes corresponding to each dialogue element.

3. The method for constructing a dialogue path according to claim 1, characterized in that: The step of sorting the dialogue elements according to the likelihood ratio of each dialogue element to the diagnosis and the attributes corresponding to each dialogue element comprises: Sorting the dialogue elements in descending order of likelihood ratios of the dialogue elements to the diagnosis to obtain a sorting result; Determining an initial dialogue element from the dialogue elements according to the ranking result and the attributes corresponding to the dialogue elements; The initial dialogue elements are sorted in descending order of likelihood ratio, and the other dialogue elements are arranged after the last initial dialogue element in descending order of likelihood ratio.

4. The method for constructing a dialogue path according to claim 1, characterized in that: The adjusting the order of the dialogue elements in the initial dialogue path that are not in a reasonable order includes: Using a pre-established dialogue path adjustment model, the order of the dialogue elements in the initial dialogue path that are not in a reasonable order is adjusted; The dialogue path adjustment model is trained using dialogue paths obtained from real doctor-patient dialogue data as training samples.

5. The method for constructing a dialogue path according to claim 4, characterized in that: The using of the pre-established dialogue path adjustment model to adjust the order of the dialogue elements in the initial dialogue path that are not in a reasonable order includes: The pre-established dialogue path adjustment model is used to generate dialogue elements one by one based on the initial dialogue elements in the initial dialogue path.

6. A method for generating a dialogue path, characterized in that: include: Using a pre-established dialogue path generation model, the next dialogue element is generated based on the historical dialogue path and the user's response to the dialogue element in the historical dialogue path; After the next dialogue element is generated, the generated dialogue element is added to the end of the historical dialogue path to obtain a new historical dialogue path, and the method of using the pre-established dialogue path generation model is executed for the new historical dialogue path, and the next dialogue element is generated based on the historical dialogue path and the user's response to the dialogue element in the historical dialogue path, until an element for indicating the end of dialogue element generation is generated; The dialogue path generation model is trained using training data in a training data set, and the training data is a dialogue path constructed using the dialogue path construction method according to any one of claims 1 to 5.

7. The method for generating a dialogue path according to claim 6, characterized in that: The method of using a pre-established dialogue path generation model to generate a next dialogue element based on the historical dialogue path and the user's response to the dialogue element in the historical dialogue path includes: Acquire dialogue elements related to the dialogue elements in the historical dialogue path based on the medical knowledge graph, and form a related dialogue element set with the acquired dialogue elements; The next dialogue element is generated by using a pre-established dialogue path generation model based on the historical dialogue path, the user's response to the dialogue element in the historical dialogue path, and the set of related dialogue elements.

8. The method for generating a dialogue path according to claim 7, characterized in that: The acquiring of dialogue elements related to the dialogue elements in the historical dialogue path based on the medical knowledge graph, and the formation of a related dialogue element set by the acquired dialogue elements, include: A target node representing the dialogue element in the historical dialogue path is found from the medical knowledge graph, and the medical elements represented by the parent node, and / or child node, and / or sibling node of the target node are taken as relevant dialogue elements to form a relevant dialogue element set.

9. The method for generating a dialogue path according to claim 7, characterized in that: The step of generating the next dialogue element based on the historical dialogue path, the user's response to the dialogue element in the historical dialogue path, and the set of related dialogue elements includes: Based on the historical dialogue path, the user's response to the dialogue element in the historical dialogue path, and the related dialogue element set, predict the probability of each dialogue element in the set dialogue element set being generated and the probability of each dialogue element in the related dialogue element set being generated; The next dialogue element is generated according to the probability of each dialogue element in the set dialogue element set being generated and the probability of each dialogue element in the related dialogue element set being generated.

10. The method for generating a dialogue path according to claim 9, characterized in that: The predicting, based on the historical dialogue path, the user's response to the dialogue element in the historical dialogue path, and the related dialogue element set, the probability of each dialogue element in the set dialogue element set being generated and the probability of each dialogue element in the related dialogue element set being generated includes: Determine, according to the historical conversation path and the user's response to the conversation element in the historical conversation path, a vector for predicting the next conversation element as a conversation element prediction vector; Predicting the probability of each dialogue element in the set dialogue element set being generated according to the dialogue element prediction vector; The probability of each dialogue element in the relevant dialogue element set being generated is predicted based on the dialogue element prediction vector and the representation vector of each dialogue element in the relevant dialogue element set.

11. The method for generating a dialogue path according to claim 10, characterized in that: The generating the next dialogue element according to the probability of each dialogue element in the set dialogue element set being generated and the probability of each dialogue element in the related dialogue element set being generated comprises: Determine a first weight according to the probability of each dialogue element in the related dialogue element set being generated, the representation vector of each dialogue element in the related dialogue element set, and the dialogue element prediction vector, and determine a second weight based on the first weight; weighting the probability of each dialogue element in the set dialogue element set being generated by using the first weight, and weighting the probability of each dialogue element in the related dialogue element set being generated by using the second weight; Generate the next dialogue element based on the weighted probability.

12. The method for generating a dialogue path according to claim 6, characterized in that: The training process of the dialogue path generation model includes: Using the dialogue generation model, sequentially predicting the probability of each non-initial dialogue element in the training data being generated; Determining the prediction loss of the dialogue path generation model according to the probability of each non-initial dialogue element being generated in the training data and the dialogue path length corresponding to each non-initial dialogue element, wherein the dialogue path length corresponding to a non-initial dialogue element in the training data is the length of the dialogue path composed of the non-initial dialogue element and the dialogue element before the non-initial dialogue element; According to the prediction loss, parameters of the dialogue path generation model are updated.

13. A dialogue path construction device, characterized in that: include: A dialogue element acquisition module, a dialogue element sorting module and a sequence adjustment module; The dialogue element acquisition module is used to acquire a number of dialogue elements and the attributes corresponding to the dialogue elements from the medical text with the diagnosis, wherein the dialogue elements are medical elements related to the diagnosis in the medical text, the attributes corresponding to any dialogue element are negative or positive, and the attributes corresponding to any dialogue element are determined by the user's reply to the dialogue element, and the user's reply to the dialogue element is confirmation or negation; The dialogue element sorting module is used to sort the dialogue elements according to their influence on the diagnosis and the attributes corresponding to them, and the obtained dialogue element sequence is used as the initial dialogue path; The reordering module is used to adjust the order of the dialogue elements in the initial dialogue path that are not in a reasonable order, and the adjusted dialogue path is used as the final constructed dialogue path; Among them, when the reordering module adjusts the order of the dialogue elements with unreasonable order in the initial dialogue path, it is specifically used to generate dialogue elements one by one based on the initial dialogue elements in the initial dialogue path, and when generating each dialogue element, it predicts the probability of non-initial dialogue elements in the initial dialogue path being generated, and determines the dialogue elements generated this time from the non-initial dialogue elements.

14. A conversation path generating device, characterized in that: include: Dialogue path generation module; The dialogue path generation module is used to generate the next dialogue element based on the historical dialogue path and the user's reply to the dialogue element in the historical dialogue path by using the pre-established dialogue path generation model, and after generating the next dialogue element, add the generated dialogue element to the end of the historical dialogue path to obtain a new historical dialogue path, and execute the process of generating the next dialogue element based on the historical dialogue path and the user's reply to the dialogue element in the historical dialogue path by using the pre-established dialogue path generation model for the new historical dialogue path, until an element indicating the end of dialogue element generation is generated; The dialogue path generation model is trained using training data in a training data set, and the training data is a dialogue path constructed using the dialogue path construction device according to claim 13.

15. A processing device, characterized in that: include: Memory and processor; The memory is used to store programs; The processor is used to execute the program to implement the steps of the dialogue path construction method according to any one of claims 1 to 5, and / or to implement the steps of the dialogue path generation method according to any one of claims 6 to 12.

16. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the computer program implements the steps of the method for constructing a dialogue path according to any one of claims 1 to 5, and / or the steps of the method for generating a dialogue path according to any one of claims 6 to 12.