WO2022227203A1 - Triage method, apparatus and device based on dialogue representation, and storage medium - Google Patents

Triage method, apparatus and device based on dialogue representation, and storage medium Download PDF

Info

Publication number
WO2022227203A1
WO2022227203A1 PCT/CN2021/097183 CN2021097183W WO2022227203A1 WO 2022227203 A1 WO2022227203 A1 WO 2022227203A1 CN 2021097183 W CN2021097183 W CN 2021097183W WO 2022227203 A1 WO2022227203 A1 WO 2022227203A1
Authority
WO
WIPO (PCT)
Prior art keywords
dialogue
vector
target
triage
data
Prior art date
Application number
PCT/CN2021/097183
Other languages
French (fr)
Chinese (zh)
Inventor
孙行智
胡岗
朱昭苇
刘卓
唐蕊
姚海申
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2022227203A1 publication Critical patent/WO2022227203A1/en

Links

Images

Classifications

    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16HHEALTHCARE INFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR THE HANDLING OR PROCESSING OF MEDICAL OR HEALTHCARE DATA
    • G16H80/00ICT specially adapted for facilitating communication between medical practitioners or patients, e.g. for collaborative diagnosis, therapy or health monitoring
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/215Improving data quality; Data cleansing, e.g. de-duplication, removing invalid entries or correcting typographical errors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • G06F40/211Syntactic parsing, e.g. based on context-free grammar [CFG] or unification grammars
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks

Definitions

  • the present application relates to the field of big data, and in particular, to a method, device, device and storage medium for triage based on dialogue representation.
  • Triage is to assign patients to different departments for medical treatment according to their condition, which is of great significance for improving the efficiency of medical treatment.
  • Triage is the initial link for patients to seek medical treatment, and the selection of appropriate departments is directly related to the treatment effect or whether effective treatment can be obtained.
  • the inventors realized that the division of labor in medicine was gradually refined, and different departments specialized in the diagnosis and treatment of certain diseases. Most patients do not have profound medical knowledge, so it is difficult to identify their own conditions and choose the most appropriate department according to their own conditions.
  • the number of triage desk staff in hospitals is limited, and the volume of hospital admissions is huge, resulting in a heavy workload for triage desk staff.
  • the triage desk faces the general practice environment, which further increases the possibility of misdiagnosis, which will lead to more secondary referrals and affect the efficiency of medical treatment. Therefore, how to improve the accuracy of triage has become a technical problem that those skilled in the art need to face.
  • the main purpose of this application is to improve the accuracy of triage based on dialogue representation, and to solve the technical problem of low accuracy of triage based on dialogue representation.
  • the present application provides a method for triage based on dialogue representation, and the method for triage based on dialogue representation comprises the following steps:
  • Data cleaning is performed on the consultation data to obtain target consultation data, wherein the target consultation data includes the main complaint information of the user;
  • the present application also provides a triage device based on dialogue representation, and the triage device based on dialogue representation includes the following modules:
  • a data cleaning module configured to perform data cleaning on the consultation data to obtain target consultation data, wherein the target consultation data includes the main complaint information of the user;
  • an intention recognition module configured to perform intention recognition on the target consultation data to obtain sentence pairs included in the target consultation data, wherein the target consultation data includes at least one sentence pair;
  • the feature extraction module is used to call the preset target BERT network model to perform feature extraction on the sentence pair and the main complaint information, and obtain the sentence pair vector of the sentence pair and the main complaint vector of the main complaint information;
  • a first calculation module used for calculating the Euclidean distance between the main complaint vector and the sentence pair vector, and determining the dialogue representation vector corresponding to each round of dialogue in multiple rounds of dialogues based on the Euclidean distance;
  • the identification module is used to input the dialogue representation vector of each round of dialogue into the preset triage model for identification, and obtain triage information.
  • the present application also provides a triage device based on dialogue representation
  • the triage device based on dialogue representation includes: a memory and at least one processor, wherein instructions are stored in the memory, and the a memory and the at least one processor are interconnected by wires;
  • the at least one processor invokes the instructions in the memory, so that when the dialogue-characterization-based triage device is executed, the steps of the above-mentioned dialogue-characterization-based triage method include:
  • Data cleaning is performed on the consultation data to obtain target consultation data, wherein the target consultation data includes the main complaint information of the user;
  • the triage model is used to identify and obtain triage information.
  • the present application also provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when it is run on a computer, the above-mentioned dialogue-based dialogue is realized when the computer is executed.
  • the steps of the triage method of characterization include:
  • Data cleaning is performed on the consultation data to obtain target consultation data, wherein the target consultation data includes the main complaint information of the user;
  • the triage model is used to identify and obtain triage information.
  • the target consultation data is obtained by acquiring the consultation data entered by the object to be triaged in each round of dialogues and cleaning the data; Sentence pairs contained in the interrogation data; call the preset target BERT network model to perform feature extraction on the sentence pairs and main complaint information to obtain sentence pair vectors and main complaint vectors; calculate the Euclidean distance between the main complaint vectors and the sentence pair vectors respectively, and The dialogue representation vector corresponding to each round of dialogue is determined based on the Euclidean distance; the dialogue representation vector of each round of dialogue is input into the preset triage model for identification, and triage information is obtained.
  • This solution solves the technical problem of low triage accuracy by characterizing the chief complaint information and multiple rounds of dialogue.
  • 1 is a schematic diagram of the first embodiment of the triage method based on dialogue representation of the present application
  • FIG. 2 is a schematic diagram of a second embodiment of the triage method based on dialogue representation of the present application
  • FIG. 3 is a schematic diagram of a third embodiment of the triage method based on dialogue representation of the present application.
  • FIG. 4 is a schematic diagram of the fourth embodiment of the triage method based on dialogue representation of the present application.
  • FIG. 5 is a schematic diagram of the fifth embodiment of the triage method based on dialogue representation of the present application.
  • FIG. 6 is a schematic diagram of the first embodiment of the triage device based on dialogue representation of the present application.
  • FIG. 7 is a schematic diagram of a second embodiment of the triage device based on dialogue representation of the present application.
  • FIG. 8 is a schematic diagram of an embodiment of the triage device based on dialogue representation in the present application.
  • the embodiments of the present application provide a method, device, device, and storage medium for triage based on dialogue representation.
  • the consultation data entered by the object to be triaged in each round of dialogue is obtained and the consultation is performed.
  • the data is cleaned to obtain the target consultation data;
  • the intent recognition is performed on the target consultation data to obtain the sentence pairs contained in the target consultation data;
  • the preset target BERT network model is called to perform feature extraction on the sentence pairs and the main complaint information, and the sentence pairs are obtained.
  • the first embodiment of the triage method based on the dialogue representation in the embodiment of the present application includes:
  • the multiple rounds of dialogues generated by the object to be triaged when visiting a doctor are acquired, and the consultation data in the multiple rounds of dialogues are extracted.
  • the object to be triaged may issue a triage request instruction to the dialogue robot (doctor) in the form of voice.
  • the dialogue robot receives the voice of the object to be triaged, it can determine whether it includes preset keywords, and the keywords include but are not limited to words such as "triage", "diagnosis guide", "department” and so on. , if the voice of the subject to be triaged includes the keyword, it can be determined that the voice is a triage request instruction issued by the subject to be triaged.
  • the object to be triaged can also issue a triage request instruction to the dialogue robot through the physical button or virtual button in the designated human-computer interaction interface.
  • the specific button displayed therein can be clicked.
  • the dialogue robot can carry out N rounds of dialogue with the object to be triaged according to the preset dialogue flow, and obtains information about the number of rounds of the object to be triaged in each round. Conversational statements within a conversation.
  • N is a positive integer, and its specific value can be set according to the actual situation, for example, it can be set to 2, 3, 5 or other values.
  • the dialogue robot can conduct N rounds of dialogue with the object to be triaged. For example, in the first round of dialogue, the dialogue robot can ask: “Where are you uncomfortable?", and then obtain the dialogue sentence answered by the subject to be triaged in response to the question. In the second round of dialogue, the dialogue The robot can ask: "What main symptoms do you have", and then obtain the dialogue sentence answered by the subject to be triaged for this question, and in the Nth round of dialogue, the dialogue robot can ask: "What accompanying symptoms do you have?" , and then obtain the dialogue sentence answered by the subject to be triaged for the question.
  • the user's consultation data is obtained through multiple rounds of interactions between the object to be triaged and the robot (doctor), wherein the consultation data includes the user's basic information and main complaint content.
  • the execution body of the embodiment of the present application is a server end with a remote diagnosis function.
  • the user terminal may be a smart terminal such as a PC terminal, a mobile phone, a tablet computer, a smart watch, a smart bracelet, etc. used by the patient, and the user enters the consultation data through the user terminal, wherein the consultation data
  • the information can include: the patient's basic information and main complaints.
  • the content of the main complaint may include: time of illness (onset time, duration or duration of each attack), patient symptoms, patient identity information, patient underlying conditions (for example: what chronic disease the patient has suffered in addition to the current symptoms) )Wait.
  • Data cleaning is the process of re-examining and verifying data with the purpose of removing duplicate information, correcting existing errors, and providing data consistency.
  • data cleaning includes data desensitization, data verification, and data conversion.
  • data desensitization is used to encrypt sensitive data in source business data.
  • the data includes an individual's ID card number, etc., and the ID card number can be encrypted.
  • Data verification is used to query whether there is dirty data in the source business data, and delete the dirty data to eliminate the impact of dirty data on actuarial results.
  • the server sets a dirty data determination method for each type of data, and detects whether it is dirty data according to a preset determination method. For example, you can set the character length range or numerical size range of each type of data, etc.
  • Data verification is the process of uniformly converting data with multiple different representations into the same preset representation.
  • Data cleaning is to "wash out” the "dirty”, which refers to the last process of finding and correcting identifiable errors in data files, including checking data consistency, dealing with invalid and missing values, etc.
  • the data in the data warehouse is a collection of data oriented to a certain topic, these data are extracted from multiple business systems and contain historical data, so it is inevitable that some data are wrong data, and some data are interrelated with each other. Conflicts, these erroneous or conflicting data that we obviously don't want, are called “dirty data”.
  • the task of data cleaning is to filter those data that do not meet the requirements, and hand over the filtered results to the business department to confirm whether it is filtered out or corrected by the business unit before extracting.
  • the data that does not meet the requirements are mainly divided into three categories: incomplete data, wrong data, and duplicate data.
  • intent recognition is performed on the target consultation data to obtain sentence pairs included in the target consultation data.
  • Train and classify the target consultation data construct a convolutional neural network, take the target consultation data after replacing the entity as input, map the question after word segmentation, each word to word embedding, and the spliced entity embedding and entity location Embedding together, as the input of the neural network, the annotated intent is used as the classification label to train the classification problem.
  • the subsequent multi-round dialogue process is configured. After identifying the intent and entity, the subsequent process configuration is performed according to the obtained value.
  • the processing method of functionalizing the intent and parameterizing the entity is adopted, that is, the subsequent operation for a certain intent is regarded as a function, and the entity to be extracted is regarded as the parameter of this function, which is adjusted according to different parameters. The return result of the function.
  • the preset target BERT network model is invoked to perform feature extraction on the sentence pair and the main complaint information, and the sentence pair vector of the sentence pair and the main complaint vector of the main complaint information are obtained.
  • the full name of the BERT network model in this embodiment is Pre-training of DeepBidirectional Transformers for Language Understanding.
  • Pre-training means that BERT is a pre-training model that learns a large amount of prior language, syntax, word meaning and other information for downstream tasks through unsupervised training of a large number of corpora in the early stage.
  • Bidirectional shows that BERT adopts a two-way language model, which can better integrate the knowledge of the context.
  • BERT is a deep bidirectional pretrained language understanding model using Transformers as feature extractors.
  • Symptom recognition is named entity recognition, and its essence is a serialized labeling task.
  • the above process of semantic encoding is the process of vectorizing disease information, specifically: the pre-training model BERT vectorizes each character in the disease information, obtains the character vector of each character, and gives each character Mark the position vector to obtain a character position vector, combine each character vector and its corresponding character mark position vector to obtain the encoding vector of each character, and combine the encoding vectors of each character to obtain the disease code.
  • a graph neural network is used to perform representation learning on the target consultation data, so as to obtain sentence pair vectors for obtaining all sentence pairs and a main complaint vector for main complaint information contained in the consultation data.
  • representation learning is a collection of techniques that use computers to learn a feature, and is to convert data into a form of learning that can be learned and developed by machines.
  • the Euclidean distance between the main complaint vector and the sentence pair vector is calculated, and based on the Euclidean distance, a dialogue representation vector corresponding to each round of dialogue in multiple rounds of dialogue is determined.
  • a sentence pair is also called a question-and-answer pair, which means that the dialogue between the doctor and the patient is organized into several sentence pairs, that is, a question-and-answer format. If a character speaks several times in a row, the consecutive speeches are spliced together as a whole speech. For example, in each sentence pair, the doctor's speech is the first sentence, and the patient's speech is the next sentence, such as: ⁇ CLS>: [How long has the headache been accompanied by dizziness?
  • ⁇ SEP> It has been more than a month without dizziness.
  • the former means the doctor's speech, and the latter means the patient's speech.
  • This sentence takes the vector representation of ⁇ CLS> for the final representation. Measure the Euclidean distance between the main complaint vector and each sentence pair vector.
  • Similarity Measurement the similarity measurement between different samples during classification
  • the method usually adopted in this case is to calculate the "distance" (Distance) between the samples.
  • the dialogue representation vector of each round of dialogue is input into a preset triage model for identification, and triage information is obtained.
  • the triage model is a model for automatically determining the corresponding department for the user according to the user's symptoms.
  • Different softmax classifiers are used in the fully connected layer of the prediction model, and the output result of the fully connected layer is input into the softmax classifier to obtain the prediction result of the claim settlement data set.
  • the target consultation data is obtained by acquiring the consultation data entered by the object to be triaged in each round of dialogues and cleaning the consultation data; Sentence pairs contained in the data; call the preset target BERT network model to perform feature extraction on sentence pairs and main complaint information, and obtain sentence pair vectors and main complaint vectors; The distance is used to determine the dialogue representation vector corresponding to each round of dialogue in multiple rounds of dialogue; the dialogue representation vector of each round of dialogue is input into the preset triage model for identification, and the triage information is obtained.
  • This solution solves the technical problem of low triage accuracy by characterizing the chief complaint information and multiple rounds of dialogue.
  • the second embodiment of the triage method based on dialogue representation in the embodiment of the present application includes:
  • the cleaning requirements of the consultation data are obtained. Understandably, real-world data is often multi-dimensional, incomplete, noisy, and inconsistent.
  • the purpose of data cleaning is to fill in missing values, smooth noise and identify outliers, and correct inconsistencies in the data. Wait.
  • the electronic device after acquiring the data to be cleaned that needs to be cleaned, the electronic device further acquires the cleaning requirement of the data to be cleaned.
  • the cleaning requirement describes the cleaning effect that the data to be cleaned needs to be cleaned.
  • the original data to be cleaned contains data of multiple dimensions, and these dimensions are often not independent, that is to say, maybe one of them
  • the cleaning requirement of the data to be executed may be to reduce the dimension of the data to be cleaned to a specified dimension.
  • a target cleaning rule for performing data cleaning on the consultation data is determined according to the consultation data and cleaning requirements. All possible cleaning rules can be integrated in advance, and the sample data to be cleaned corresponding to each cleaning rule and its cleaning effect can be collected at the same time; then, the cleaning rule features that can characterize the cleaning rule, and the sample data that can characterize the cleaning effect and its cleaning effect are obtained. Then, take each joint feature as training input, take the cleaning rule feature corresponding to each joint feature as target output, and carry out model training according to the preset training algorithm, so as to obtain which cleaning rule to be used for training. Cleaning rule classification model for cleaning data.
  • the electronic device can input the data to be cleaned and the cleaning requirement into the cleaning rule classification model, so that the cleaning rule classification model outputs A cleaning rule that can perform data cleaning on the data to be cleaned and the cleaning effect meets the cleaning requirements, and the cleaning rule is used as the target cleaning rule for data cleaning of the data to be cleaned.
  • data cleaning is performed on the consultation data according to the target cleaning rule to obtain the target consultation data.
  • the data to be cleaned can be cleaned according to the target cleaning rule, so that the cleaning effect of the data to be cleaned meets the aforementioned cleaning requirements, and finally the required data is obtained.
  • the data to be cleaned that needs to be cleaned, and the cleaning requirements of the data to be cleaned are obtained first, and then according to the obtained data to be cleaned, the cleaning requirements and the pre-trained cleaning rule classification model, a classification model for the data to be cleaned is determined.
  • the target cleaning rules for data cleaning are performed on the cleaned data, and finally the data to be cleaned is cleaned according to the determined target cleaning rules, and the target consultation data that meets the requirements are obtained.
  • all question and answer sentences in the target consultation data and object identifiers of objects corresponding to the question and answer sentences are acquired according to preset characterization rules.
  • the target consultation data refers to the online consultation record between the robot (doctor) and the patient, which may include multiple question and answer sentences between the doctor and the patient, that is, may include the question or answer sentences corresponding to the doctor or the patient.
  • a question and answer sentence is a sentence corresponding to each conversation between the doctor or the patient in the dialogue between the doctor and the patient.
  • the object identifier is an identifier used to distinguish a doctor and a patient in the target consultation data, and may include a doctor identifier and a patient identifier.
  • the doctor identification may refer to the unified doctor identification indication applicable to all target consultation data, for example, the patient identification refers to the unified patient identification indication applicable to all target consultation data.
  • intention identification is performed on each question and answer sentence in the target consultation data, respectively, to obtain an intention identification sequence corresponding to the consultation data.
  • the intent identifier refers to an identifier that identifies the intent of each question and answer sentence, for example, a medication inquiry, a registered inquiry, a medication response, a registered response, and the like.
  • the intent identifiers of the patient's question may be represented by P 1 -P n
  • the intent identifier of the patient's answer is represented by P A
  • the intent identifier of the doctor's question is denoted as D 1 -D n
  • the intent identifier of the doctor's answer is denoted by P 1 -P n .
  • D A1 ⁇ D An Denoted as D A1 ⁇ D An .
  • the intent identifier sequence refers to a sequence composed of multiple intent identifiers, for example, P 1 , D A1 , D A1 , P 2 , P 2 , D A2 and so on.
  • the server may perform intention identification on each question and answer sentence according to the object identifier corresponding to each question and answer sentence, and generate each corresponding intent identifier, and may obtain the corresponding target consultation data according to a plurality of target consultation data of each intent identifier sequence.
  • the intent identifier of the target answer sentence corresponding to the question is determined according to the intent identifier sequence.
  • Each question sentence intent identifier corresponds to the number of answer sentence intent identifiers of each initial answer sentence, and based on each quantity, a target answer sentence intent identifier corresponding to each question sentence intent identifier is determined.
  • the server may generate a corresponding target sentence pair according to the question sentence intent identifier and the corresponding target answer sentence intent identifier. For example, if the server determines that the intent identifier of the corresponding question sentence P 1 corresponds to the intent identifier of the target answer sentence as D A1 , the server may generate a pair of target sentences as P 1 -D A1 .
  • the target sentence pair is not limited to a binary combination relationship composed of a question sentence intent identifier and a target answer sentence intent identifier, but may also be a ternary combination relationship.
  • the target consultation data includes a plurality of question and answer sentences and object identifiers corresponding to the question and answer sentences, and based on the object identifiers, intention recognition is performed on each question and answer sentence in the target consultation data.
  • the target sentence pair can be determined after the intention recognition processing of the question and answer sentences of multiple target medical consultation data, so that the generation of the target sentence pair can cover a plurality of different forms of question and answer sentences, and the target sentence pair can be improved. coverage and accuracy.
  • the intent recognition is performed on each question and answer sentence in the target consultation data, respectively, to obtain a sequence of intent identifiers corresponding to the target consultation data, which may include: determining the target consultation according to the object identifiers Each question and answer sentence corresponding to each object in the data; each question and answer sentence of each object is identified separately, and each question and answer sentence is determined to be a question sentence of the corresponding object or the answer sentence of the corresponding object; the question sentence of each object or the answer sentence of each object Perform intention identification respectively to obtain the corresponding intention identification; according to the obtained intention identification, obtain the intention identification sequence corresponding to the target consultation data.
  • the target consultation data may include multiple question and answer sentences between doctors and patients, and each question and answer sentence includes a corresponding object identifier, such as a doctor identifier or a patient identifier.
  • Steps 201, 209-211 in this embodiment are similar to steps 101, 104-106 in the first embodiment, and are not repeated here.
  • the target consultation data is obtained by acquiring the consultation data entered by the object to be triaged in each round of dialogues and cleaning the consultation data; Sentence pairs contained in the data; call the preset target BERT network model to perform feature extraction on sentence pairs and main complaint information, and obtain sentence pair vectors and main complaint vectors; The distance is used to determine the dialogue representation vector corresponding to each round of dialogue in multiple rounds of dialogue; the dialogue representation vector of each round of dialogue is input into the preset triage model for identification, and the triage information is obtained.
  • This solution solves the technical problem of low triage accuracy by characterizing the chief complaint information and multiple rounds of dialogue.
  • the third embodiment of the triage method based on dialogue representation in the embodiment of the present application includes:
  • a pre-training task is established, and a preset vectorization model is invoked to process historical user consultation data into several word vectors.
  • the pre-training task is mainly used to perform the loop iterative calculation of steps S305-S306.
  • the word2vec model is a model for generating word vectors.
  • the symptom data is ⁇ cough: three days; bloodshot ⁇ , and word vectors emb1 (cough), emb2 (three days), and emb3 (bloodshot) can be obtained after transformation by the word2vec model.
  • emb1 is the first word vector
  • emb2 and emb3 are the second word vectors.
  • Symptom samples refer to the training data used to train the initial BERT network model, generally historical symptom data in a certain area.
  • each word vector can be input into the initial BERT network model as input data, and the training representation vector can be generated, and the corresponding loss value can be calculated.
  • the loss value can be obtained by calculating the loss function.
  • the loss function is defined as:
  • L(Vs, sym (n) ) is the loss value of the nth symptom; sym (n) represents the nth symptom in the symptom list; Vs represents the overall characterization vector; it is the nth symptom in the characterization vector.
  • the loss term of is the loss term of other symptoms in the representation vector.
  • the loss value of the initial BERT network model is calculated according to the training characterization vector, and the loss value of the initial BERT network model is calculated according to the training characterization vector, and the obtained loss value can be used to adjust model parameters and determine whether the model is convergence. If the loss value is outside the preset range, the model parameters of the initial BERT network model are adjusted, and the training representation vector of the symptom sample is recalculated, so as to perform iterative calculation when the model does not converge.
  • the several word vectors are input into the initial BERT network model, and the training representation vector output by the initial BERT network model is obtained, so as to perform the training step of the initial BERT network model.
  • the loss value of the initial BERT network model is calculated according to the training characterization vector, and the obtained loss value can be used to adjust model parameters and judge whether the model converges. If the loss value is outside the preset range, the model parameters of the initial BERT network model are adjusted, and the training representation vector of the symptom sample is recalculated, so as to perform iterative calculation when the model does not converge. If the loss value is within the preset range, the pre-training task is trained, and the initial BERT network model after the training is completed is the target BERT network model.
  • Steps 301 - 304 and 309 - 310 in this embodiment are similar to steps 101 - 104 and 105 - 106 in the first embodiment, and are not repeated here.
  • the target consultation data is obtained by acquiring the consultation data entered by the object to be triaged in each round of dialogues and cleaning the consultation data; Sentence pairs contained in the data; call the preset target BERT network model to perform feature extraction on sentence pairs and main complaint information, and obtain sentence pair vectors and main complaint vectors; The distance is used to determine the dialogue representation vector corresponding to each round of dialogue in multiple rounds of dialogue; the dialogue representation vector of each round of dialogue is input into the preset triage model for identification, and the triage information is obtained.
  • This solution solves the technical problem of low triage accuracy by characterizing the chief complaint information and multiple rounds of dialogue.
  • the fourth embodiment of the triage method based on dialogue representation in the embodiment of the present application includes:
  • the Euclidean distance between the main complaint vector and each sentence pair vector in each round of dialogue is calculated.
  • the Euclidean distances between all sentence pairs in the consultation data and the main complaint vector are calculated respectively.
  • the Euclidean distance means that the Euclidean distance is an effective method for calculating the closest distance between a sample and a "centre of gravity" of a sample set, or for effectively calculating the similarity between two unknown sample sets. It takes into account the connection between various properties, can exclude the interference of the correlation between variables, and the Euclidean distance is scale-independent, that is, independent of the measurement scale. When ⁇ is the identity matrix, the Euclidean distance is the Euclidean distance. To sum up, the Euclidean distance can easily measure the distance between the observed sample and the known sample set, so it is very suitable for fault diagnosis.
  • the weight of each sentence pair in a corresponding round of dialogue is determined based on the Euclidean distance.
  • the representation of the main complaint is completed based on the pre-trained word vector (vector representation), and the correlation between the vector of each sentence pair and the main complaint vector is calculated as the basis for evaluating the importance of the sentence pair.
  • the specific calculation method is:
  • the weights corresponding to each sentence pair vector are weighted and averaged to obtain a dialogue representation vector corresponding to each round of dialogues in multiple rounds of dialogues. For example, in a round of dialogue, if the answer sentence in the sentence pair (question and answer sentence and answer sentence) is the answer to the question sentence, the answer sentence usually contains the keywords in the question sentence; the common key between the question sentence and the answer sentence The more and longer the number of words, the more effective information it contains, and the more important the corresponding round of dialogue is.
  • the answer sentence in the sentence pair is more likely to be the answer to the question sentence; since the target question-answer pair expected to be obtained is a complete question and answer, the longer the question sentence can better describe a complete question , and the longer the answer sentence can better describe a complete answer; if the answer sentence in the sentence pair is the answer to the question sentence, the themes between the answer sentence and the question sentence are usually consistent; if the answer sentence in the sentence pair is the answer to the question sentence is the answer to the question sentence, then there is usually a certain syntactic connection between the answer sentence and the question sentence.
  • a weighted importance measurement module (hereinafter referred to as the weighting module) is introduced to evaluate the importance of each round of dialogue, and weighted representation of all dialogues Then make a judgment.
  • the target disease information in the target consultation data is determined based on the dialogue representation vector corresponding to each round of dialogue.
  • the target disease information refers to text information or voice information input by the person to be triaged. If the person to be triaged inputs voice information, the system will now convert the voice information into text information.
  • the target disease information and the main complaint information corresponding to each round of dialogue are encoded to obtain the disease entity vector of the target consultation data.
  • coding is the process of converting information from one form or format to another, also known as coding in computer programming languages for short. Digitize characters, numbers or other objects with a predetermined method, or convert information and data into specified electrical pulse signals. Coding is widely used in electronic computers, television, remote control and communication. Encoding is the process of converting information from one form or format to another. Decoding is the reverse process of encoding.
  • the disease entity vector is input into the preset triage model for prediction, and the triage probability of different departments is obtained.
  • the convolution operation is performed on the splicing vector at the convolution layer to obtain the convolution correlation vector, and the convolution correlation vector is input to the output layer to obtain the prediction output result.
  • the prediction error loss is calculated, and the parameters of the neural network model are updated according to the prediction error loss.
  • the triage model is obtained.
  • the disease entity vector is input into the preset triage model for prediction, and the triage probability of different departments is obtained.
  • the triage probability is sorted to obtain triage information.
  • the triage probability of each department is sorted, and the recommended department with the highest set number and the corresponding triage probability are returned to the patient.
  • the triage model includes: multiple convolution layers, multiple pooling layers, fully connected layers and Softmax layers.
  • Steps 401-404 in this embodiment are similar to steps 101-104 in the first embodiment, and are not repeated here.
  • the target consultation data is obtained by acquiring the consultation data entered by the object to be triaged in each round of dialogues and cleaning the consultation data; Sentence pairs contained in the data; call the preset target BERT network model to perform feature extraction on sentence pairs and main complaint information, and obtain sentence pair vectors and main complaint vectors; The distance is used to determine the dialogue representation vector corresponding to each round of dialogue in multiple rounds of dialogue; the dialogue representation vector of each round of dialogue is input into the preset triage model for identification, and the triage information is obtained.
  • This solution solves the technical problem of low triage accuracy by characterizing the chief complaint information and multiple rounds of dialogue.
  • the fifth embodiment of the triage method based on dialogue representation in the embodiment of the present application includes:
  • historical consultation data is obtained from a preset database.
  • the N rounds of dialogue with the historical patient according to the preset dialogue flow can be acquired from a preset database, and the dialogue sentences of the historical patient in each round of dialogue can be acquired.
  • N is a positive integer, and its specific value can be set according to the actual situation, for example, it can be set to 2, 3, 5 or other values. That is, the dialogue robot can conduct N rounds of dialogue with the historical patient.
  • the dialogue robot can ask: “Where are you uncomfortable”, and then obtain the dialogue sentences answered by the historical patient for this question, and in the second round of dialogue, the dialogue robot can Ask: “What main symptoms do you have”, and then obtain the dialogue sentences answered by the historical patient for this question, in the Nth round of dialogue, the dialogue robot can ask: “What accompanying symptoms do you have”, and then obtain all the Dialogue sentences answered by the patient in response to the question.
  • the target BERT network model is used to perform representation learning on the historical consultation data to obtain the second dialogue representation vector of the historical consultation data.
  • the target BERT network model is obtained after being trained on the pre-training task.
  • the pre-training task is a custom task, and the pre-training task is defined as inferring the symptom name and symptom attribute contained in the representation vector according to the current representation vector.
  • the pre-training task can ensure that the target BERT network model can learn the information contained in the output representation vector, that is, the relationship between the representation vector and the symptom feature data is determined through the pre-training task. It should be noted that here, the relationship is embodied in the model parameters of the target BERT network model.
  • symptom names and symptom attributes can be accurately converted into an overall vector, that is, a representation vector.
  • the number of generated representation vectors is equal to the number of symptoms in the symptom data. That is, how many symptoms there are in the historical consultation data, the same number and corresponding representation vectors are generated.
  • a preset training symptom and a department label corresponding to the training symptom are obtained, and the preset node set association vector is screened based on the training symptom, and a target vector corresponding to the training symptom is obtained.
  • the training symptom refers to the symptom used to train the BERT network model.
  • the department label is the department corresponding to the training symptom, and the department label is the training label. For example, if the training symptom is a skin problem, the corresponding department label is dermatology.
  • the target vector refers to the vector corresponding to the training symptom.
  • the target vector is filtered from the association vector of the node set according to the symptom.
  • the node set association vectors are screened according to the training symptoms to match the target vectors corresponding to the training symptoms, so as to ensure that the model training samples have a corresponding relationship and ensure the feasibility of model training.
  • a mapping operation is performed on the second dialogue representation vector and the target vector to obtain the dialogue embedding vector and the target embedding vector.
  • a mapping operation is performed on the graph symptom vector in the second dialogue representation vector to obtain the dialogue embedding vector.
  • the first embedding layer is a layer for performing dimension reduction processing on the second dialogue representation vector, so that the second dialogue representation vector is mapped to a dialogue embedding vector with a lower dimension.
  • a mapping operation is performed on the target vector in the second embedding layer to obtain the target embedding vector.
  • the second embedding layer is a layer used to reduce the dimension of the target vector, so that the target vector is mapped to a target embedding vector with a lower dimension.
  • a preset mapping table is used to process the target vector to obtain the target embedding vector, thereby reducing the dimension of the target embedding vector and reducing the difficulty of subsequent operations.
  • the dialogue embedding vector and the target embedding vector are spliced based on the training symptom to obtain the splicing vector.
  • the splicing vector is a vector obtained from the dialogue embedding vector and the target embedding vector to form a vector with deep meaning.
  • the splicing vector with more comprehensive information is fully utilized in the process of triage model training, so that the acquired triage model has strong generalization ability and high robustness.
  • the tf.concat() function of TensorFlow is used to splicing the dialogue embedding vector and the target embedding vector to quickly obtain the splicing vector.
  • the convolution operation is performed on the splicing vector at the convolution layer to obtain the convolution correlation vector, and the convolution correlation vector is input to the output layer to obtain the prediction output result.
  • the predicted output result is the predicted department result corresponding to the training symptom.
  • the output layer is used to calculate the probability of possible departments corresponding to the training symptoms, and the department with the highest probability is used as the prediction output result, so as to obtain the corresponding prediction output result according to the model training samples.
  • the prediction error loss is calculated based on the prediction output result and the department label, and the parameters of the target BERT network model are updated according to the prediction error loss until the target BERT network model converges to obtain a triage model based on dialogue representation. Specifically, the partial derivative of the prediction error loss is obtained to obtain the gradient value, and the parameters of the target BERT network model are updated according to the gradient value to realize the optimization of the target BERT network model.
  • the prediction error loss is less than the preset threshold, the target BERT network model Convergence, the target BERT network model is determined as the triage model.
  • Steps 501 - 505 and 513 in this embodiment are similar to steps 101 - 105 and 106 in the first embodiment, and are not repeated here.
  • the target consultation data is obtained by acquiring the consultation data entered by the object to be triaged in each round of dialogues and cleaning the consultation data to obtain the target consultation data;
  • the sentence pairs contained in the diagnosis data call the preset target BERT network model to extract the features of the sentence pairs and the main complaint information, and obtain the sentence pair vector and the main complaint vector; respectively calculate the Euclidean distance between the main complaint vector and the sentence pair vector, and based on the The Euclidean distance determines the dialogue representation vector corresponding to each round of dialogue in multiple rounds of dialogue; the dialogue representation vector of each round of dialogue is input into the preset triage model for identification, and triage information is obtained.
  • This solution solves the technical problem of low triage accuracy by characterizing the chief complaint information and multiple rounds of dialogue.
  • the triage method based on the dialogue representation in the embodiment of the present application is described above, and the triage device based on the dialogue representation in the embodiment of the present application is described below. Please refer to FIG. 6 , the triage device based on the dialogue representation in the embodiment of the present application is described
  • the first embodiment includes:
  • the data extraction module 601 is used for acquiring multiple rounds of dialogues generated by the subject to be triaged when visiting a doctor, and extracting the consultation data in the multiple rounds of dialogues;
  • a data cleaning module 602, configured to perform data cleaning on the consultation data to obtain target consultation data, wherein the target consultation data includes the main complaint information of the user;
  • Intention recognition module 603, configured to perform intention recognition on the target consultation data to obtain sentence pairs included in the target consultation data, wherein the target consultation data includes at least one sentence pair;
  • the feature extraction module 604 is used to call the preset target BERT network model to perform feature extraction on the sentence pair and the main complaint information, and obtain the sentence pair vector of the sentence pair and the main complaint vector of the main complaint information;
  • the first calculation module 605 is used to calculate the Euclidean distance between the main complaint vector and the sentence pair vector, and determine the dialogue representation vector corresponding to each round of dialogue based on the Euclidean distance;
  • the identification module 606 is configured to input the dialogue representation vector of each round of dialogue into a preset triage model for identification, and obtain triage information.
  • the target consultation data is obtained by acquiring the consultation data entered by the object to be triaged in each round of dialogues and cleaning the consultation data; Sentence pairs contained in the data; call the preset target BERT network model to perform feature extraction on sentence pairs and main complaint information, and obtain sentence pair vectors and main complaint vectors; The distance is used to determine the dialogue representation vector corresponding to each round of dialogue in multiple rounds of dialogue; the dialogue representation vector of each round of dialogue is input into the preset triage model for identification, and the triage information is obtained.
  • This solution solves the technical problem of low triage accuracy by characterizing the chief complaint information and multiple rounds of dialogue.
  • the second embodiment of the triage device based on dialogue representation specifically includes:
  • the data extraction module 601 is used for acquiring multiple rounds of dialogues generated by the subject to be triaged when visiting a doctor, and extracting the consultation data in the multiple rounds of dialogues;
  • a data cleaning module 602, configured to perform data cleaning on the consultation data to obtain target consultation data, wherein the target consultation data includes the main complaint information of the user;
  • Intention recognition module 603, configured to perform intention recognition on the target consultation data to obtain sentence pairs included in the target consultation data, wherein the target consultation data includes at least one sentence pair;
  • the feature extraction module 604 is used to call the preset target BERT network model to perform feature extraction on the sentence pair and the main complaint information, and obtain the sentence pair vector of the sentence pair and the main complaint vector of the main complaint information;
  • the first calculation module 605 is used to calculate the Euclidean distance between the main complaint vector and the sentence pair vector, and determine the dialogue representation vector corresponding to each round of dialogue based on the Euclidean distance;
  • the identification module 606 is configured to input the dialogue representation vector of each round of dialogue into a preset triage model for identification, and obtain triage information.
  • the intent recognition module 603 includes:
  • Obtaining unit 6031 configured to obtain all question and answer sentences in the target consultation data and object identifiers of objects corresponding to the question and answer sentences according to preset characterization rules;
  • an intent identification unit 6032 configured to perform intent identification on each question and answer sentence in the target medical consultation data based on each of the object identifiers, to obtain an intent identification sequence corresponding to the medical consultation data;
  • the determining unit 6033 is configured to determine, according to the intent identifier sequence, a target answer sentence intent identifier corresponding to the question; and based on the target answer sentence intent identifier, obtain sentence pairs included in the target questioning data.
  • the triage device based on dialogue representation further includes:
  • the vectorization module 607 is used for establishing a pre-training task, calling a preset vectorization model to process historical user consultation data into several word vectors, wherein the word vectors include word vectors based on the historical user consultation data;
  • the first acquisition module 608 is used to input the several word vectors into the initial BERT network model, and obtain the training representation vector output by the initial BERT network model;
  • the second calculation module 609 is configured to calculate the loss value of the initial BERT network model according to the training characterization vector; according to the loss value of the initial BERT network model, adjust the model parameters of the initial BERT network model to obtain the target BERT network model.
  • the first calculation module 605 is specifically used for:
  • the weights corresponding to each sentence pair vector are weighted and averaged to obtain a dialogue representation vector corresponding to each round of dialogues in multiple rounds of dialogues.
  • the identifying module 606 is specifically used for:
  • Sorting the triage probabilities to obtain triage information wherein the triage information includes a preset number of recommended departments with the highest ranking and triage probabilities corresponding to the recommended departments.
  • the triage device based on dialogue representation further includes:
  • the second obtaining module 610 is configured to obtain historical consultation data from a preset database
  • a representation learning module 611 configured to perform representation learning on the historical consultation data through the target BERT network model, and obtain a second dialogue representation vector of the historical consultation data;
  • a screening module 612 configured to obtain a preset training symptom and a department label corresponding to the training symptom, screen a preset node set association vector based on the training symptom, and obtain a target vector corresponding to the training symptom;
  • a mapping module 613 configured to perform a mapping operation on the second dialogue representation vector and the target vector to obtain a dialogue embedding vector and a target embedding vector;
  • a splicing module 614 configured to splicing the dialogue embedding vector and the target embedding vector based on the training symptom to obtain a splicing vector
  • the convolution processing module 615 is configured to perform a convolution operation on the splicing vector at the convolution layer, obtain a convolution association vector, input the convolution association vector into the output layer, and obtain a prediction output result;
  • the updating module 616 is configured to calculate the prediction error loss based on the prediction output result and the department label, and update the parameters of the target BERT network model according to the prediction error loss, until the target BERT network model converges, obtain Diagnosis model based on dialogue representation.
  • the data cleaning module 602 is specifically used for:
  • Data cleaning is performed on the consultation data according to the target cleaning rule to obtain target consultation data.
  • the target consultation data is obtained by acquiring the consultation data entered by the object to be triaged in each round of dialogues and cleaning the consultation data; Sentence pairs contained in the data; call the preset target BERT network model to perform feature extraction on sentence pairs and main complaint information, and obtain sentence pair vectors and main complaint vectors; The distance is used to determine the dialogue representation vector corresponding to each round of dialogue in multiple rounds of dialogue; the dialogue representation vector of each round of dialogue is input into the preset triage model for identification, and the triage information is obtained.
  • This solution solves the technical problem of low triage accuracy by characterizing the chief complaint information and multiple rounds of dialogue.
  • FIG. 8 is a schematic structural diagram of a dialogue representation-based triage device provided by an embodiment of the present application.
  • the dialogue representation-based triage device 800 may vary greatly due to different configurations or performances, and may include one or more than one Central processing units (CPU) 810 (eg, one or more processors) and memory 820, one or more storage media 830 (eg, one or more mass storage devices) that store application programs 833 or data 832.
  • the memory 820 and the storage medium 830 may be short-term storage or persistent storage.
  • the program stored in the storage medium 830 may include one or more modules (not shown), and each module may include a series of instructions to operate on the dialogue characterization-based triage device 800 .
  • the processor 810 may be configured to communicate with the storage medium 830, and execute a series of instruction operations in the storage medium 830 on the dialogue-characterization-based triage device 800, so as to realize the dialogue-characterization-based diagnosis provided by the above method embodiments. Steps of the triage method.
  • Dialog-based triage device 800 may also include one or more power supplies 840, one or more wired or wireless network interfaces 850, one or more input-output interfaces 860, and/or, one or more operating systems 831, For example Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc.
  • operating systems 831 For example Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc.
  • FIG. 8 does not constitute a limitation on the triage device based on dialogue representation provided by the present application, and may include more or less components than those shown in the figure. Either some components are combined, or different component arrangements.
  • the present application also provides a computer-readable storage medium.
  • the computer-readable storage medium may be a non-volatile computer-readable storage medium.
  • the computer-readable storage medium may also be a volatile computer-readable storage medium.
  • the computer-readable storage medium stores instructions that, when executed on a computer, cause the computer to perform the steps of the above-mentioned method for triage based on dialogue representation.
  • the blockchain referred to in this application is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.
  • Blockchain essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information to verify its Validity of information (anti-counterfeiting) and generation of the next block.
  • the blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as an independent product, may be stored in a computer-readable storage medium.
  • the technical solutions of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, and the computer software products are stored in a storage medium , including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store program codes .

Abstract

A triage method, apparatus and device based on dialogue representation, and a storage medium, which relate to the field of big data. The method comprises: acquiring a plurality of rounds of dialogue generated when an object to be subjected to triage is subjected to medical treatment, and extracting diagnostic inquiry data in the plurality of rounds of dialogue (101); performing data cleaning on the diagnostic inquiry data, so as to obtain target diagnostic inquiry data (102); performing intention recognition on the target diagnostic inquiry data, so as to obtain a sentence pair included in the target diagnostic inquiry data (103); calling a preset target BERT network model to perform feature extraction on the sentence pair and chief complaint information, so as to obtain a sentence pair vector of the sentence pair and a chief complaint vector of the chief complaint information (104); calculating a Euclidean distance between the chief complaint vector and the sentence pair vector, and on the basis of the Euclidean distance, determining a dialogue representation vector corresponding to each round of dialogue from among the plurality of rounds of dialogue (105); and inputting the dialogue representation vector of each round of dialogue into a preset triage model for recognition, so as to obtain triage information (106). By means of representing chief complaint information and a plurality of rounds of dialogue, the technical problem of low triage accuracy is solved.

Description

基于对话表征的分诊方法、装置、设备及存储介质Diagnosis method, device, device and storage medium based on dialogue representation
本申请要求于2021年04月30日提交中国专利局、申请号为202110489044.5、发明名称为“基于对话表征的分诊方法、装置、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在申请中。This application claims the priority of the Chinese patent application filed on April 30, 2021 with the application number 202110489044.5 and the invention titled "diagnosis method, device, equipment and storage medium based on dialogue representation", the entire content of which is Incorporated in the application by reference.
技术领域technical field
本申请涉及大数据领域,尤其涉及一种基于对话表征的分诊方法、装置、设备及存储介质。The present application relates to the field of big data, and in particular, to a method, device, device and storage medium for triage based on dialogue representation.
背景技术Background technique
我国人口基数巨大,就医人数因此也位居世界前列,但受限于有限的医疗资源,目前国民就医流程中还存在较多问题,其中之一发生在就诊初期分诊时。分诊是根据病情将患者分至不同科室进行就诊,对于提升就诊效率有重要意义。Due to the huge population base in my country, the number of people seeking medical treatment ranks among the top in the world. However, due to limited medical resources, there are still many problems in the national medical treatment process, one of which occurs during the initial triage of medical treatment. Triage is to assign patients to different departments for medical treatment according to their condition, which is of great significance for improving the efficiency of medical treatment.
分诊是患者就医治疗的起始环节,选择恰当的科室,直接关系到治疗效果或能否得到有效治疗。然而随着医学研究的深入发明人意识到,医学分工也逐步细化,不同科室专精于某类疾病的诊治。而患者大都不具备深厚的医学知识,很难识别自己的病况并根据自己的状况选择最恰当的科室。医院分诊台工作人员数量有限,而医院接诊量又巨大,导致分诊台工作人员工作负荷大。此外分诊台面对的是全科就诊环境,进一步增大了误分诊的可能性,会产生较多二次转诊情况,影响就医效率。因此,如何提高分诊准确率成为了本领域技术人员需要面临的技术问题。Triage is the initial link for patients to seek medical treatment, and the selection of appropriate departments is directly related to the treatment effect or whether effective treatment can be obtained. However, with the deepening of medical research, the inventors realized that the division of labor in medicine was gradually refined, and different departments specialized in the diagnosis and treatment of certain diseases. Most patients do not have profound medical knowledge, so it is difficult to identify their own conditions and choose the most appropriate department according to their own conditions. The number of triage desk staff in hospitals is limited, and the volume of hospital admissions is huge, resulting in a heavy workload for triage desk staff. In addition, the triage desk faces the general practice environment, which further increases the possibility of misdiagnosis, which will lead to more secondary referrals and affect the efficiency of medical treatment. Therefore, how to improve the accuracy of triage has become a technical problem that those skilled in the art need to face.
发明内容SUMMARY OF THE INVENTION
本申请的主要目的是提高基于对话表征进行分诊的准确率,解决基于对话表征的分诊精准率低下的技术问题。The main purpose of this application is to improve the accuracy of triage based on dialogue representation, and to solve the technical problem of low accuracy of triage based on dialogue representation.
为实现上述目的,本申请提供一种基于对话表征的分诊方法,所述基于对话表征的分诊方法包括以下步骤:In order to achieve the above object, the present application provides a method for triage based on dialogue representation, and the method for triage based on dialogue representation comprises the following steps:
获取待分诊对象在就诊时产生的多轮对话,并提取多轮对话中的问诊数据;Acquire multiple rounds of dialogues generated by the subject to be triaged when they visit a doctor, and extract the consultation data in the multiple rounds of dialogues;
对所述问诊数据进行数据清洗,得到目标问诊数据,其中,所述目标问诊数据包括所述用户的主诉信息;Data cleaning is performed on the consultation data to obtain target consultation data, wherein the target consultation data includes the main complaint information of the user;
对所述目标问诊数据进行意图识别,得到所述目标问诊数据中包含的句对,其中,所述目标问诊数据中包含至少一个句对;performing intention identification on the target medical consultation data to obtain sentence pairs included in the target medical consultation data, wherein the target medical consultation data includes at least one sentence pair;
调用预置目标BERT网络模型对所述句对和所述主诉信息进行特征提取,得到所述句对的句对向量和所述主诉信息的主诉向量;Call the preset target BERT network model to perform feature extraction on the sentence pair and the main complaint information, and obtain the sentence pair vector of the sentence pair and the main complaint vector of the main complaint information;
计算所述主诉向量和所述句对向量之间的欧氏距离,并基于所述欧氏距离确定多轮对话中每轮对话对应的对话表征向量;将每轮对话的对话表征向量输入预置分诊模型进行识Calculate the Euclidean distance between the main complaint vector and the sentence pair vector, and determine the dialogue representation vector corresponding to each round of dialogue in the multi-round dialogue based on the Euclidean distance; input the dialogue representation vector of each round of dialogue into a preset triage model
别,得到分诊信息。No, get triage information.
进一步地,为实现上述目的,本申请还提供一种基于对话表征的分诊装置,所述基于对话表征的分诊装置包括以下模块:Further, in order to achieve the above object, the present application also provides a triage device based on dialogue representation, and the triage device based on dialogue representation includes the following modules:
获取待分诊对象在就诊时产生的多轮对话,并提取多轮对话中的问诊数据;Acquire multiple rounds of dialogues generated by the subject to be triaged when they visit a doctor, and extract the consultation data in the multiple rounds of dialogues;
数据清洗模块,用于对所述问诊数据进行数据清洗,得到目标问诊数据,其中,所述目标问诊数据包括所述用户的主诉信息;a data cleaning module, configured to perform data cleaning on the consultation data to obtain target consultation data, wherein the target consultation data includes the main complaint information of the user;
意图识别模块,用于对所述目标问诊数据进行意图识别,得到所述目标问诊数据中包含的句对,其中,所述目标问诊数据中包含至少一个句对;an intention recognition module, configured to perform intention recognition on the target consultation data to obtain sentence pairs included in the target consultation data, wherein the target consultation data includes at least one sentence pair;
特征提取模块,用于调用预置目标BERT网络模型对所述句对和所述主诉信息进行特征提取,得到所述句对的句对向量和所述主诉信息的主诉向量;The feature extraction module is used to call the preset target BERT network model to perform feature extraction on the sentence pair and the main complaint information, and obtain the sentence pair vector of the sentence pair and the main complaint vector of the main complaint information;
第一计算模块,用于计算所述主诉向量和所述句对向量之间的欧氏距离,并基于所述欧氏距离确定多轮对话中每轮对话对应的对话表征向量;a first calculation module, used for calculating the Euclidean distance between the main complaint vector and the sentence pair vector, and determining the dialogue representation vector corresponding to each round of dialogue in multiple rounds of dialogues based on the Euclidean distance;
识别模块,用于将每轮对话的对话表征向量输入预置分诊模型进行识别,得到分诊信息。The identification module is used to input the dialogue representation vector of each round of dialogue into the preset triage model for identification, and obtain triage information.
进一步地,为实现上述目的,本申请还提供一种基于对话表征的分诊设备,所述基于对话表征的分诊设备包括:存储器和至少一个处理器,所述存储器中存储有指令,所述存储器和所述至少一个处理器通过线路互连;Further, in order to achieve the above object, the present application also provides a triage device based on dialogue representation, the triage device based on dialogue representation includes: a memory and at least one processor, wherein instructions are stored in the memory, and the a memory and the at least one processor are interconnected by wires;
所述至少一个处理器调用所述存储器中的所述指令,以使得所述基于对话表征的分诊设备执行时实现如上述的基于对话表征的分诊方法的步骤,包括:The at least one processor invokes the instructions in the memory, so that when the dialogue-characterization-based triage device is executed, the steps of the above-mentioned dialogue-characterization-based triage method include:
获取待分诊对象在就诊时产生的多轮对话,并提取多轮对话中的问诊数据;Acquire multiple rounds of dialogues generated by the subject to be triaged when they visit a doctor, and extract the consultation data in the multiple rounds of dialogues;
对所述问诊数据进行数据清洗,得到目标问诊数据,其中,所述目标问诊数据包括所述用户的主诉信息;Data cleaning is performed on the consultation data to obtain target consultation data, wherein the target consultation data includes the main complaint information of the user;
对所述目标问诊数据进行意图识别,得到所述目标问诊数据中包含的句对,其中,所述目标问诊数据中包含至少一个句对;performing intention identification on the target medical consultation data to obtain sentence pairs included in the target medical consultation data, wherein the target medical consultation data includes at least one sentence pair;
调用预置目标BERT网络模型对所述句对和所述主诉信息进行特征提取,得到所述句对的句对向量和所述主诉信息的主诉向量;Call the preset target BERT network model to perform feature extraction on the sentence pair and the main complaint information, and obtain the sentence pair vector of the sentence pair and the main complaint vector of the main complaint information;
计算所述主诉向量和所述句对向量之间的欧氏距离,并基于所述欧氏距离确定多轮对话中每轮对话对应的对话表征向量;将每轮对话的对话表征向量输入预置分诊模型进行识别,得到分诊信息。Calculate the Euclidean distance between the main complaint vector and the sentence pair vector, and determine the dialogue representation vector corresponding to each round of dialogue in the multi-round dialogue based on the Euclidean distance; input the dialogue representation vector of each round of dialogue into a preset The triage model is used to identify and obtain triage information.
进一步地,为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行时实现如上述的基于对话表征的分诊方法的步骤,包括:Further, in order to achieve the above-mentioned purpose, the present application also provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when it is run on a computer, the above-mentioned dialogue-based dialogue is realized when the computer is executed. The steps of the triage method of characterization include:
获取待分诊对象在就诊时产生的多轮对话,并提取多轮对话中的问诊数据;Acquire multiple rounds of dialogues generated by the subject to be triaged when they visit a doctor, and extract the consultation data in the multiple rounds of dialogues;
对所述问诊数据进行数据清洗,得到目标问诊数据,其中,所述目标问诊数据包括所述用户的主诉信息;Data cleaning is performed on the consultation data to obtain target consultation data, wherein the target consultation data includes the main complaint information of the user;
对所述目标问诊数据进行意图识别,得到所述目标问诊数据中包含的句对,其中,所述目标问诊数据中包含至少一个句对;performing intention identification on the target medical consultation data to obtain sentence pairs included in the target medical consultation data, wherein the target medical consultation data includes at least one sentence pair;
调用预置目标BERT网络模型对所述句对和所述主诉信息进行特征提取,得到所述句对的句对向量和所述主诉信息的主诉向量;Call the preset target BERT network model to perform feature extraction on the sentence pair and the main complaint information, and obtain the sentence pair vector of the sentence pair and the main complaint vector of the main complaint information;
计算所述主诉向量和所述句对向量之间的欧氏距离,并基于所述欧氏距离确定多轮对话中每轮对话对应的对话表征向量;将每轮对话的对话表征向量输入预置分诊模型进行识别,得到分诊信息。Calculate the Euclidean distance between the main complaint vector and the sentence pair vector, and determine the dialogue representation vector corresponding to each round of dialogue in the multi-round dialogue based on the Euclidean distance; input the dialogue representation vector of each round of dialogue into a preset The triage model is used to identify and obtain triage information.
本申请提供的技术方案中,通过获取待分诊对象在各轮对话中录入的问诊数据并对问诊数据进行数据清洗,得到目标问诊数据;对目标问诊数据进行意图识别,得到目标问诊数据中包含的句对;调用预置目标BERT网络模型对句对和主诉信息进行特征提取,得到句对向量和主诉向量;分别计算主诉向量和句对向量之间的欧氏距离,并基于欧氏距离确定各轮对话对应的对话表征向量;将每轮对话的对话表征向量输入预置分诊模型进行识别,得到分诊信息。本方案通过将主诉信息和多轮对话进行表征,解决了分诊准确率低的技术问题。In the technical solution provided by the present application, the target consultation data is obtained by acquiring the consultation data entered by the object to be triaged in each round of dialogues and cleaning the data; Sentence pairs contained in the interrogation data; call the preset target BERT network model to perform feature extraction on the sentence pairs and main complaint information to obtain sentence pair vectors and main complaint vectors; calculate the Euclidean distance between the main complaint vectors and the sentence pair vectors respectively, and The dialogue representation vector corresponding to each round of dialogue is determined based on the Euclidean distance; the dialogue representation vector of each round of dialogue is input into the preset triage model for identification, and triage information is obtained. This solution solves the technical problem of low triage accuracy by characterizing the chief complaint information and multiple rounds of dialogue.
附图说明Description of drawings
图1为本申请基于对话表征的分诊方法的第一个实施例示意图;1 is a schematic diagram of the first embodiment of the triage method based on dialogue representation of the present application;
图2为本申请基于对话表征的分诊方法的第二个实施例示意图;2 is a schematic diagram of a second embodiment of the triage method based on dialogue representation of the present application;
图3为本申请基于对话表征的分诊方法的第三个实施例示意图;3 is a schematic diagram of a third embodiment of the triage method based on dialogue representation of the present application;
图4为本申请基于对话表征的分诊方法的第四个实施例示意图;FIG. 4 is a schematic diagram of the fourth embodiment of the triage method based on dialogue representation of the present application;
图5为本申请基于对话表征的分诊方法的第五个实施例示意图;FIG. 5 is a schematic diagram of the fifth embodiment of the triage method based on dialogue representation of the present application;
图6为本申请基于对话表征的分诊装置的第一个实施例示意图;FIG. 6 is a schematic diagram of the first embodiment of the triage device based on dialogue representation of the present application;
图7为本申请基于对话表征的分诊装置的第二个实施例示意图;FIG. 7 is a schematic diagram of a second embodiment of the triage device based on dialogue representation of the present application;
图8为本申请基于对话表征的分诊设备的一个实施例示意图。FIG. 8 is a schematic diagram of an embodiment of the triage device based on dialogue representation in the present application.
具体实施方式Detailed ways
本申请实施例提供了一种基于对话表征的分诊方法、装置、设备及存储介质,本申请的技术方案中,首先获取待分诊对象在各轮对话中录入的问诊数据并对问诊数据进行数据清洗,得到目标问诊数据;对目标问诊数据进行意图识别,得到目标问诊数据中包含的句对;调用预置目标BERT网络模型对句对和主诉信息进行特征提取,得到句对向量和主诉向量;分别计算主诉向量和句对向量之间的欧氏距离,并基于欧氏距离确定各轮对话对应的对话表征向量;将每轮对话的对话表征向量输入预置分诊模型进行识别,得到分诊信息。本方案通过将主诉信息和多轮对话进行表征,解决了分诊准确率低的技术问题。The embodiments of the present application provide a method, device, device, and storage medium for triage based on dialogue representation. In the technical solution of the present application, firstly, the consultation data entered by the object to be triaged in each round of dialogue is obtained and the consultation is performed. The data is cleaned to obtain the target consultation data; the intent recognition is performed on the target consultation data to obtain the sentence pairs contained in the target consultation data; the preset target BERT network model is called to perform feature extraction on the sentence pairs and the main complaint information, and the sentence pairs are obtained. pair vector and main complaint vector; calculate the Euclidean distance between the main complaint vector and sentence pair vector respectively, and determine the dialogue representation vector corresponding to each round of dialogue based on the Euclidean distance; input the dialogue representation vector of each round of dialogue into the preset triage model Identify and obtain triage information. This solution solves the technical problem of low triage accuracy by characterizing the chief complaint information and multiple rounds of dialogue.
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”、“第四”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的实施例能够以除了在这里图示或描述的内容以外的顺序实施。此外,术语“包括”或“具有”及其任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "first", "second", "third", "fourth", etc. (if any) in the description and claims of this application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It is to be understood that data so used may be interchanged under appropriate circumstances so that the embodiments described herein can be practiced in sequences other than those illustrated or described herein. Furthermore, the terms "comprising" or "having" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those expressly listed steps or units, but may include other steps or units not expressly listed or inherent to these processes, methods, products or devices.
为便于理解,下面对本申请实施例的具体流程进行描述,请参阅图1,本申请实施例中基于对话表征的分诊方法的第一个实施例包括:For ease of understanding, the following describes the specific process of the embodiment of the present application, referring to FIG. 1 , the first embodiment of the triage method based on the dialogue representation in the embodiment of the present application includes:
101、获取待分诊对象在就诊时产生的多轮对话,并提取多轮对话中的问诊数据;101. Acquire multiple rounds of dialogues generated by the subject to be triaged when visiting a doctor, and extract the consultation data in the multiple rounds of dialogues;
本实施例中,获取待分诊对象在就诊时产生的多轮对话,并提取多轮对话中的问诊数据。其中,待分诊对象可以通过语音的形式向所述对话机器人(医生)下发分诊请求指令。所述对话机器人在接收到待分诊对象的语音时,可以判断其中是否包括预设的关键词,所述关键词包括但不限于“分诊”、“导诊”、“科室”等等词语,若待分诊对象的语音中包括所述关键词,则可以判定该语音即为待分诊对象下发的分诊请求指令。In this embodiment, the multiple rounds of dialogues generated by the object to be triaged when visiting a doctor are acquired, and the consultation data in the multiple rounds of dialogues are extracted. The object to be triaged may issue a triage request instruction to the dialogue robot (doctor) in the form of voice. When the dialogue robot receives the voice of the object to be triaged, it can determine whether it includes preset keywords, and the keywords include but are not limited to words such as "triage", "diagnosis guide", "department" and so on. , if the voice of the subject to be triaged includes the keyword, it can be determined that the voice is a triage request instruction issued by the subject to be triaged.
待分诊对象还可以通过指定的人机交互界面中的实体按键或者虚拟按键向所述对话机器人下发分诊请求指令,例如,所述对话机器人可以包括一个触控屏幕,用于与待分诊对象进行交互,当待分诊对象需要向所述对话机器人下发分诊请求指令,可以点击其中显示的特定按键。所述对话机器人在接收到待分诊对象下发的分诊请求指令之后,可以按照预设的对话流程与所述待分诊对象进行N轮对话,并获取所述待分诊对象在各轮对话中的对话语句。其中,N为正整数,其具体取值可以根据实际情况进行设置,例如,可以将其设置为2、3、5或者其它取值。即所述对话机器人可以与所述待分诊对象进行N轮对话。例如,在第1轮对话中,所述对话机器人可以询问:“您哪里不舒服”,然后获取所述待分诊对象针对该问题所回答的对话语句,在第2轮对话中,所述对话机器人可以询问:“您有哪些主要症状”,然后获取所述待分诊对象针对该问题所回答的对话语句,在第N轮对话中,所述对话机器人可以询问:“您有哪些伴随症状”,然后获取所述待分诊对象针对该问题所回答的对话语句。The object to be triaged can also issue a triage request instruction to the dialogue robot through the physical button or virtual button in the designated human-computer interaction interface. When the object to be triaged needs to issue a triage request instruction to the dialogue robot, the specific button displayed therein can be clicked. After receiving the triage request instruction issued by the object to be triaged, the dialogue robot can carry out N rounds of dialogue with the object to be triaged according to the preset dialogue flow, and obtains information about the number of rounds of the object to be triaged in each round. Conversational statements within a conversation. Among them, N is a positive integer, and its specific value can be set according to the actual situation, for example, it can be set to 2, 3, 5 or other values. That is, the dialogue robot can conduct N rounds of dialogue with the object to be triaged. For example, in the first round of dialogue, the dialogue robot can ask: "Where are you uncomfortable?", and then obtain the dialogue sentence answered by the subject to be triaged in response to the question. In the second round of dialogue, the dialogue The robot can ask: "What main symptoms do you have", and then obtain the dialogue sentence answered by the subject to be triaged for this question, and in the Nth round of dialogue, the dialogue robot can ask: "What accompanying symptoms do you have?" , and then obtain the dialogue sentence answered by the subject to be triaged for the question.
102、对问诊数据进行数据清洗,得到目标问诊数据;102. Perform data cleaning on the consultation data to obtain the target consultation data;
本实施例中,通过待分诊对象与机器人(医生)的多轮交互获取用户问诊数据,其中,所述问诊数据包括所述用户的基础信息和主诉内容。In this embodiment, the user's consultation data is obtained through multiple rounds of interactions between the object to be triaged and the robot (doctor), wherein the consultation data includes the user's basic information and main complaint content.
本申请实施例的执行主体为具有远程就诊功能的服务器端。需要说明的是,所述用户端可以为患者使用的PC端、手机、平板电脑、智能手表、智能手环等智能端,用户通过所述用户端录入问诊数据,其中,所述问诊数据信息可以包括:患者的基础信息和主诉内容。比如,主诉内容可以包括:患病时间(发病时间、持续时间或每次发病的持续时间)、患者症状、患者身份信息、患者基础病症(例如:除当前症状外患者已经患有何种慢性疾病)等。数据清洗(Data cleaning)对数据进行重新审查和校验的过程,目的在于删除重复信息、纠正存在的错误,并提供数据一致性。The execution body of the embodiment of the present application is a server end with a remote diagnosis function. It should be noted that the user terminal may be a smart terminal such as a PC terminal, a mobile phone, a tablet computer, a smart watch, a smart bracelet, etc. used by the patient, and the user enters the consultation data through the user terminal, wherein the consultation data The information can include: the patient's basic information and main complaints. For example, the content of the main complaint may include: time of illness (onset time, duration or duration of each attack), patient symptoms, patient identity information, patient underlying conditions (for example: what chronic disease the patient has suffered in addition to the current symptoms) )Wait. Data cleaning is the process of re-examining and verifying data with the purpose of removing duplicate information, correcting existing errors, and providing data consistency.
本实施例中,数据清洗包括数据脱敏、数据校验和数据转换。其中,数据脱敏用于对源业务数据中的敏感数据进行加密处理。比如,该数据中包括个人的身份证号等,可对该身份证号进行加密。数据校验用于查询源业务数据中是否存在脏数据,并删除该脏数据,以消除脏数据对精算结果的影响。服务器针对各个类型的数据设置了脏数据判定方法,根据预设的判定方法检测是否为脏数据。比如,可设置每个类型的数据的字符长度范围或数值的大小范围等,当某一类型的数据的字符长度不处于预设范围之内,或数值的大小不处于预设的大小范围之内,则判定该数据为脏数据。数据校验是将存在多种不同表述方式的数据统一转换成同一种预设表述方式的过程。In this embodiment, data cleaning includes data desensitization, data verification, and data conversion. Among them, data desensitization is used to encrypt sensitive data in source business data. For example, the data includes an individual's ID card number, etc., and the ID card number can be encrypted. Data verification is used to query whether there is dirty data in the source business data, and delete the dirty data to eliminate the impact of dirty data on actuarial results. The server sets a dirty data determination method for each type of data, and detects whether it is dirty data according to a preset determination method. For example, you can set the character length range or numerical size range of each type of data, etc. When the character length of a certain type of data is not within the preset range, or the size of the numerical value is not within the preset size range , the data is determined to be dirty data. Data verification is the process of uniformly converting data with multiple different representations into the same preset representation.
数据清洗从名字上也看的出就是把“脏”的“洗掉”,指发现并纠正数据文件中可识别的错误的最后一道程序,包括检查数据一致性,处理无效值和缺失值等。因为数据仓库中的数据是面向某一主题的数据的集合,这些数据从多个业务系统中抽取而来而且包含历史数据,这样就避免不了有的数据是错误数据、有的数据相互之间有冲突,这些错误的或有冲突的数据显然是我们不想要的,称为“脏数据”。我们要按照一定的规则把“脏数据”“洗掉”,这就是数据清洗。而数据清洗的任务是过滤那些不符合要求的数据,将过滤的结果交给业务主管部门,确认是否过滤掉还是由业务单位修正之后再进行抽取。不符合要求的数据主要是有不完整的数据、错误的数据、重复的数据三大类。Data cleaning, as the name suggests, is to "wash out" the "dirty", which refers to the last process of finding and correcting identifiable errors in data files, including checking data consistency, dealing with invalid and missing values, etc. Because the data in the data warehouse is a collection of data oriented to a certain topic, these data are extracted from multiple business systems and contain historical data, so it is inevitable that some data are wrong data, and some data are interrelated with each other. Conflicts, these erroneous or conflicting data that we obviously don't want, are called "dirty data". We have to "wash out" the "dirty data" according to certain rules, which is data cleaning. The task of data cleaning is to filter those data that do not meet the requirements, and hand over the filtered results to the business department to confirm whether it is filtered out or corrected by the business unit before extracting. The data that does not meet the requirements are mainly divided into three categories: incomplete data, wrong data, and duplicate data.
103、对目标问诊数据进行意图识别,得到目标问诊数据中包含的句对;103. Perform intent recognition on the target consultation data to obtain sentence pairs included in the target consultation data;
本实施例中,对目标问诊数据进行意图识别,得到目标问诊数据中包含的句对。对目标问诊数据进行训练和分类,构建卷积神经网络,将替换实体后的目标问诊数据作为输入,将分词后的问题,每个词映射为词嵌入,和拼接的实体嵌入与实体位置嵌入一起,作为神经网络的输入,将标注的意图作为分类标签,进行分类问题的训练。In this embodiment, intent recognition is performed on the target consultation data to obtain sentence pairs included in the target consultation data. Train and classify the target consultation data, construct a convolutional neural network, take the target consultation data after replacing the entity as input, map the question after word segmentation, each word to word embedding, and the spliced entity embedding and entity location Embedding together, as the input of the neural network, the annotated intent is used as the classification label to train the classification problem.
其次,根据意图和实体的组合,来配置后续的多轮对话流程,识别出意图和实体之后,针对所获取的值来进行后续的流程配置。这里采用将意图函数化,将实体参数化的处理方式,即将针对某一个意图所进行的后续操作视作一个函数,而将所需要抽取的实体视作这个函数的参数,根据不同的参数来调整函数的返回结果。Secondly, according to the combination of intent and entity, the subsequent multi-round dialogue process is configured. After identifying the intent and entity, the subsequent process configuration is performed according to the obtained value. Here, the processing method of functionalizing the intent and parameterizing the entity is adopted, that is, the subsequent operation for a certain intent is regarded as a function, and the entity to be extracted is regarded as the parameter of this function, which is adjusted according to different parameters. The return result of the function.
对新语句进行意图识别和实体抽取,将结果传递给流程配置引擎进行后续的多轮对话配置。对于识别到的意图,检测其对应的实体参数,并将抽取到的实体填充到对应的参数列表中。根据识别的意图和填充到的参数,触发后续的对话流程。如果必需的实体参数均满足,即可直接进行相应动作,如果必须实体为满足,即触发多轮的引导问答,引导用户对信息进行补全。Perform intent recognition and entity extraction on new sentences, and pass the results to the process configuration engine for subsequent multiple rounds of dialog configuration. For the identified intent, its corresponding entity parameters are detected, and the extracted entities are filled into the corresponding parameter list. Based on the identified intent and the filled parameters, the subsequent dialogue flow is triggered. If the required entity parameters are satisfied, the corresponding action can be directly performed. If the required entity is satisfied, multiple rounds of guided question and answer are triggered to guide the user to complete the information.
104、调用预置目标BERT网络模型对句对和主诉信息进行特征提取,得到句对的句对向量和主诉信息的主诉向量;104. Call the preset target BERT network model to perform feature extraction on the sentence pair and the main complaint information, and obtain the sentence pair vector of the sentence pair and the main complaint vector of the main complaint information;
本实施例中,调用预置目标BERT网络模型对句对和主诉信息进行特征提取,得到句对的句对向量和主诉信息的主诉向量。本实施例中BERT网络模型全称是Pre-training of DeepBidirectional Transformers for Language Understanding。Pre-training表示BERT是一个预训练模型,通过前期的大量语料的无监督训练,为下游任务学习大量的先验的语 言、句法、词义等信息。Bidirectional说明BERT采用的是双向语言模型的方式,能够更好的融合前后文的知识。简而言之,BERT是一个用Transformers作为特征抽取器的深度双向预训练语言理解模型。BERT在预训练过程中,学习到了丰富的语言学方面的信息。症状识别即命名实体识别,其本质属于序列化标注任务。上述语意编码的过程即为将病症信息向量化的过程,具体为:所述预训练模型BERT对所述病症信息中的每一个字符向量化,得到每一个字符的字符向量,以及给每一个字符标记位置向量,得到字符位置向量,将所述每一个字符向量及其对应的字符标记位置向量合并,得到每一个字符的编码向量,将所述每一个字符的编码向量组合得到所述病症编码。In this embodiment, the preset target BERT network model is invoked to perform feature extraction on the sentence pair and the main complaint information, and the sentence pair vector of the sentence pair and the main complaint vector of the main complaint information are obtained. The full name of the BERT network model in this embodiment is Pre-training of DeepBidirectional Transformers for Language Understanding. Pre-training means that BERT is a pre-training model that learns a large amount of prior language, syntax, word meaning and other information for downstream tasks through unsupervised training of a large number of corpora in the early stage. Bidirectional shows that BERT adopts a two-way language model, which can better integrate the knowledge of the context. In short, BERT is a deep bidirectional pretrained language understanding model using Transformers as feature extractors. During the pre-training process, BERT has learned a wealth of linguistic information. Symptom recognition is named entity recognition, and its essence is a serialized labeling task. The above process of semantic encoding is the process of vectorizing disease information, specifically: the pre-training model BERT vectorizes each character in the disease information, obtains the character vector of each character, and gives each character Mark the position vector to obtain a character position vector, combine each character vector and its corresponding character mark position vector to obtain the encoding vector of each character, and combine the encoding vectors of each character to obtain the disease code.
本实施例中,采用图神经网络对目标问诊数据进行表征学习,以得到问诊数据中包含的得到所有句对的句对向量和主诉信息的主诉向量。其中,表征学习是采用计算机学习一个特征的技术的集合,是将数据转换成为能够被机器学习和开发的一种学习形式。In this embodiment, a graph neural network is used to perform representation learning on the target consultation data, so as to obtain sentence pair vectors for obtaining all sentence pairs and a main complaint vector for main complaint information contained in the consultation data. Among them, representation learning is a collection of techniques that use computers to learn a feature, and is to convert data into a form of learning that can be learned and developed by machines.
105、计算主诉向量和句对向量之间的欧氏距离,并基于欧氏距离确定多轮对话中每轮对话对应的对话表征向量;105. Calculate the Euclidean distance between the main complaint vector and the sentence pair vector, and determine the dialogue representation vector corresponding to each round of dialogue in the multi-round dialogue based on the Euclidean distance;
本实施例中,计算主诉向量和句对向量之间的欧氏距离,并基于欧氏距离确定多轮对话中每轮对话对应的对话表征向量。其中,句对又叫问答对,是指医生和患者的对话组织成若干个句对,即一问一答形式。若某个角色连续多次发言,则将连续的发言进行拼接,作为一个整段的发言。比如,每个句对中,医生发言作为上句,患者发言作为下句,形如:<CLS>:【头痛多长时间了,伴有眩晕吗<SEP>一个多月了,没有眩晕。】<SEP>之前表示医生的发言,之后的表示患者的发言。该句对最终的表征取<CLS>的向量表示。度量主诉向量和每个句对向量的欧氏距。In this embodiment, the Euclidean distance between the main complaint vector and the sentence pair vector is calculated, and based on the Euclidean distance, a dialogue representation vector corresponding to each round of dialogue in multiple rounds of dialogue is determined. Among them, a sentence pair is also called a question-and-answer pair, which means that the dialogue between the doctor and the patient is organized into several sentence pairs, that is, a question-and-answer format. If a character speaks several times in a row, the consecutive speeches are spliced together as a whole speech. For example, in each sentence pair, the doctor's speech is the first sentence, and the patient's speech is the next sentence, such as: <CLS>: [How long has the headache been accompanied by dizziness? <SEP> It has been more than a month without dizziness. ] <SEP> The former means the doctor's speech, and the latter means the patient's speech. This sentence takes the vector representation of <CLS> for the final representation. Measure the Euclidean distance between the main complaint vector and each sentence pair vector.
本实施例中,在做分类时常常需要估算不同样本之间的相似性度量(Similarity Measurement),这时通常采用的方法就是计算样本间的“距离”(Distance)。所述“距离”越小,则样本之间就越相似。最常见的两点之间或多点之间的距离表示法,又称之为欧几里得度量。它定义于欧几里得空间中,如x=(x 1,x 2,...,x n)和y=(y 1,y 2,...,y n)之间的距离为: In this embodiment, it is often necessary to estimate the similarity measurement (Similarity Measurement) between different samples during classification, and the method usually adopted in this case is to calculate the "distance" (Distance) between the samples. The smaller the "distance", the more similar the samples are. The most common representation of the distance between two or more points, also known as the Euclidean metric. It is defined in Euclidean space, such as the distance between x=(x 1 , x 2 ,..., x n ) and y=(y 1 , y 2 ,..., y n ) as:
Figure PCTCN2021097183-appb-000001
Figure PCTCN2021097183-appb-000001
其中,两个n维向量a(x 11,x 12,…,x 1n)与b(x 21,x 22,…,x 2n)之间的欧氏距离: where, the Euclidean distance between two n-dimensional vectors a(x 11 , x 12 ,...,x 1n ) and b(x 21 , x 22 ,...,x 2n ):
Figure PCTCN2021097183-appb-000002
Figure PCTCN2021097183-appb-000002
106、将每轮对话的对话表征向量输入预置分诊模型进行识别,得到分诊信息。106. Input the dialogue representation vector of each round of dialogue into a preset triage model for identification, and obtain triage information.
本实施例中,将每轮对话的对话表征向量输入预置分诊模型进行识别,得到分诊信息。其中,分诊模型是用于根据用户的症状自动化为用户确定对应科室的模型。在该预测模型的全连接层采用不同的softmax分类器,将该全连接层的输出结果,输入到该softmax分类器得到该理赔数据集合的预测结果。In this embodiment, the dialogue representation vector of each round of dialogue is input into a preset triage model for identification, and triage information is obtained. The triage model is a model for automatically determining the corresponding department for the user according to the user's symptoms. Different softmax classifiers are used in the fully connected layer of the prediction model, and the output result of the fully connected layer is input into the softmax classifier to obtain the prediction result of the claim settlement data set.
本申请实施例中,通过获取待分诊对象在各轮对话中录入的问诊数据并对问诊数据进行数据清洗,得到目标问诊数据;对目标问诊数据进行意图识别,得到目标问诊数据中包含的句对;调用预置目标BERT网络模型对句对和主诉信息进行特征提取,得到句对向量和主诉向量;分别计算主诉向量和句对向量之间的欧氏距离,并基于欧氏距离确定多轮对话中每轮对话对应的对话表征向量;将每轮对话的对话表征向量输入预置分诊模型进行识别,得到分诊信息。本方案通过将主诉信息和多轮对话进行表征,解决了分诊准确率低的技术问题。In the embodiment of the present application, the target consultation data is obtained by acquiring the consultation data entered by the object to be triaged in each round of dialogues and cleaning the consultation data; Sentence pairs contained in the data; call the preset target BERT network model to perform feature extraction on sentence pairs and main complaint information, and obtain sentence pair vectors and main complaint vectors; The distance is used to determine the dialogue representation vector corresponding to each round of dialogue in multiple rounds of dialogue; the dialogue representation vector of each round of dialogue is input into the preset triage model for identification, and the triage information is obtained. This solution solves the technical problem of low triage accuracy by characterizing the chief complaint information and multiple rounds of dialogue.
请参阅图2,本申请实施例中基于对话表征的分诊方法的第二个实施例包括:Referring to FIG. 2 , the second embodiment of the triage method based on dialogue representation in the embodiment of the present application includes:
201、获取待分诊对象在就诊时产生的多轮对话,并提取多轮对话中的问诊数据;201. Acquire multiple rounds of dialogues generated by the subject to be triaged when visiting a doctor, and extract the consultation data in the multiple rounds of dialogues;
202、获取问诊数据的清洗需求;202. Obtaining the cleaning needs of consultation data;
本实施例中,获取问诊数据的清洗需求。可以理解的是,现实世界的数据往往是多维度的、不完整的、有噪声的以及不一致的,数据清洗的目的就在于填充缺失的值、光滑噪声并识别离群点、纠正数据中的不一致等。In this embodiment, the cleaning requirements of the consultation data are obtained. Understandably, real-world data is often multi-dimensional, incomplete, noisy, and inconsistent. The purpose of data cleaning is to fill in missing values, smooth noise and identify outliers, and correct inconsistencies in the data. Wait.
本实施例中,电子设备在获取到需要进行数据清洗的待清洗数据之后,进一步获取到待清洗数据的清洗需求。通俗的说,清洗需求描述了对待清洗数据进行数据清洗想要达到的清洗效果,比如,原始的待清洗数据含有多个维度的数据,而这些维度之间往往不是独立的,也就是说也许其中之间若干的维度之间存在关联,待执行数据的清洗需求可以是将待清洗数据降维到指定维度。In this embodiment, after acquiring the data to be cleaned that needs to be cleaned, the electronic device further acquires the cleaning requirement of the data to be cleaned. In layman's terms, the cleaning requirement describes the cleaning effect that the data to be cleaned needs to be cleaned. For example, the original data to be cleaned contains data of multiple dimensions, and these dimensions are often not independent, that is to say, maybe one of them There is an association between several dimensions, and the cleaning requirement of the data to be executed may be to reduce the dimension of the data to be cleaned to a specified dimension.
203、根据问诊数据和清洗需求,确定用于对问诊数据进行数据清洗的目标清洗规则;203. Determine the target cleaning rules for data cleaning of the consultation data according to the consultation data and cleaning requirements;
本实施例中,根据问诊数据和清洗需求,确定用于对问诊数据进行数据清洗的目标清洗规则。可以预先整合所有可能的清洗规则,同时收集每个清洗规则对应的待清洗样本数据及其清洗效果;然后,获取能够表征清洗规则的清洗规则特征,以及获取能够表征待清洗样本数据及其清洗效果的联合特征;然后,将各联合特征作为训练输入、将各联合特征对应的清洗规则特征作为目标输出,按照预先设定的训练算法来进行模型训练,以训练得到用于选取何种清洗规则对待清洗数据进行数据清洗的清洗规则分类模型。In this embodiment, a target cleaning rule for performing data cleaning on the consultation data is determined according to the consultation data and cleaning requirements. All possible cleaning rules can be integrated in advance, and the sample data to be cleaned corresponding to each cleaning rule and its cleaning effect can be collected at the same time; then, the cleaning rule features that can characterize the cleaning rule, and the sample data that can characterize the cleaning effect and its cleaning effect are obtained. Then, take each joint feature as training input, take the cleaning rule feature corresponding to each joint feature as target output, and carry out model training according to the preset training algorithm, so as to obtain which cleaning rule to be used for training. Cleaning rule classification model for cleaning data.
由此,电子设备在获取到需要进行数据清洗的待清洗数据,以及获取到待清洗数据的清洗需求之后,即可将待清洗数据和清洗需求输入到清洗规则分类模型,使得清洗规则分类模型输出能够对待清洗数据进行数据清洗且清洗效果满足清洗需求的清洗规则,将该清洗规则作为对待清洗数据进行数据清洗的目标清洗规则。Therefore, after the electronic device obtains the data to be cleaned that needs to be cleaned, and obtains the cleaning requirement of the data to be cleaned, the electronic device can input the data to be cleaned and the cleaning requirement into the cleaning rule classification model, so that the cleaning rule classification model outputs A cleaning rule that can perform data cleaning on the data to be cleaned and the cleaning effect meets the cleaning requirements, and the cleaning rule is used as the target cleaning rule for data cleaning of the data to be cleaned.
204、根据目标清洗规则对问诊数据进行数据清洗,得到目标问诊数据;204. Perform data cleaning on the consultation data according to the target cleaning rule to obtain the target consultation data;
本实施例中,根据目标清洗规则对问诊数据进行数据清洗,得到目标问诊数据。在确定用于对待清洗数据进行数据清洗的目标清洗规则之后,即可根据该目标清洗规则对待清洗数据进行数据清洗,使得对待清洗数据的清洗效果满足前述清洗需求,最终得到所需的数据。In this embodiment, data cleaning is performed on the consultation data according to the target cleaning rule to obtain the target consultation data. After determining the target cleaning rule for cleaning the data to be cleaned, the data to be cleaned can be cleaned according to the target cleaning rule, so that the cleaning effect of the data to be cleaned meets the aforementioned cleaning requirements, and finally the required data is obtained.
本实施例中,首先获取需要进行数据清洗的待清洗数据,以及获取待清洗数据的清洗需求,然后根据获取到的待清洗数据、清洗需求以及预先训练的清洗规则分类模型,确定出用于对待清洗数据进行数据清洗的目标清洗规则,最后根据确定出的目标清洗规则对待清洗数据进行数据清洗,得到符合要求的目标问诊数据。In this embodiment, the data to be cleaned that needs to be cleaned, and the cleaning requirements of the data to be cleaned are obtained first, and then according to the obtained data to be cleaned, the cleaning requirements and the pre-trained cleaning rule classification model, a classification model for the data to be cleaned is determined. The target cleaning rules for data cleaning are performed on the cleaned data, and finally the data to be cleaned is cleaned according to the determined target cleaning rules, and the target consultation data that meets the requirements are obtained.
205、根据预设表征规则获取目标问诊数据中的所有问答句和与问答句对应对象的对象标识;205. Acquire all question and answer sentences in the target consultation data and object identifiers of objects corresponding to the question and answer sentences according to a preset representation rule;
本实施例中,根据预设表征规则获取目标问诊数据中的所有问答句和与问答句对应对象的对象标识。目标问诊数据是指机器人(医生)与病人的线上问诊记录,可以包括医生与病人的多个问答句,即可以包括对应医生或者是病人的问句或者答句。问答句是医生与病人的对话中对应医生或者是病人每一次对话的句子。In this embodiment, all question and answer sentences in the target consultation data and object identifiers of objects corresponding to the question and answer sentences are acquired according to preset characterization rules. The target consultation data refers to the online consultation record between the robot (doctor) and the patient, which may include multiple question and answer sentences between the doctor and the patient, that is, may include the question or answer sentences corresponding to the doctor or the patient. A question and answer sentence is a sentence corresponding to each conversation between the doctor or the patient in the dialogue between the doctor and the patient.
在本实施例中,对象标识是用于区分目标问诊数据中医生以及病人的标识,可以包括医生标识以及病人标识。其中,医生标识可以是指适用于所有目标问诊数据中统一医生标识指示,例如病人标识是指适用于所有目标问诊数据中统一病人标识指示。In this embodiment, the object identifier is an identifier used to distinguish a doctor and a patient in the target consultation data, and may include a doctor identifier and a patient identifier. The doctor identification may refer to the unified doctor identification indication applicable to all target consultation data, for example, the patient identification refers to the unified patient identification indication applicable to all target consultation data.
206、基于各对象标识,对目标问诊数据中的各问答句分别进行意图识别,得到对应问诊数据的意图标识序列;206. Based on each object identifier, perform intention identification on each question and answer sentence in the target medical consultation data, to obtain an intention identification sequence corresponding to the medical consultation data;
本实施例中,基于各对象标识,对目标问诊数据中的各问答句分别进行意图识别,得到对应问诊数据的意图标识序列。意图标识是指标识各问答句的意图的标识,例如,用药询问、挂号询问、用药应答、挂号应答等。在本实施例中,病人问句的意图标识可以通过 P 1~P n表示,病人回答的意图标识通过P A表示,医生问句的意图标识记为D 1~D n,医生回答的意图标识记为D A1~D AnIn this embodiment, based on each object identifier, intention identification is performed on each question and answer sentence in the target consultation data, respectively, to obtain an intention identification sequence corresponding to the consultation data. The intent identifier refers to an identifier that identifies the intent of each question and answer sentence, for example, a medication inquiry, a registered inquiry, a medication response, a registered response, and the like. In this embodiment, the intent identifiers of the patient's question may be represented by P 1 -P n , the intent identifier of the patient's answer is represented by P A , the intent identifier of the doctor's question is denoted as D 1 -D n , and the intent identifier of the doctor's answer is denoted by P 1 -P n . Denoted as D A1 ~ D An .
意图标识序列是指由多个意图标识组成的序列,例如,P 1,D A1,D A1,P 2,P 2,D A2等。在本实施例中,服务器可以根据各问答句对应的对象标识,对各问答句进行意图识别,并生成对应的各意图标识,可以根据多个目标问诊数据,以得到对应各目标问诊数据的各意图标识序列。 The intent identifier sequence refers to a sequence composed of multiple intent identifiers, for example, P 1 , D A1 , D A1 , P 2 , P 2 , D A2 and so on. In this embodiment, the server may perform intention identification on each question and answer sentence according to the object identifier corresponding to each question and answer sentence, and generate each corresponding intent identifier, and may obtain the corresponding target consultation data according to a plurality of target consultation data of each intent identifier sequence.
207、根据意图标识序列,确定对应问句的目标答句意图标识;207. Determine, according to the intent identifier sequence, the intent identifier of the target answer sentence corresponding to the question;
本实施例中,根据意图标识序列,确定对应问句的目标答句意图标识。各问句意图标识对应的各初始答句的答句意图标识的数量,并基于各数量确定对应各问句意图标识对应的目标答句意图标识。进一步,服务器在确定各问句意图标识以及对应的目标答句意图标识后,可以根据问句意图标识以及对应的目标答句意图标识生成对应的目标句对。例如,服务器确定对应问句意图标识P 1对应目标答句意图标识为D A1,则服务器可以生成目标句对为P 1-D A1In this embodiment, the intent identifier of the target answer sentence corresponding to the question is determined according to the intent identifier sequence. Each question sentence intent identifier corresponds to the number of answer sentence intent identifiers of each initial answer sentence, and based on each quantity, a target answer sentence intent identifier corresponding to each question sentence intent identifier is determined. Further, after determining each question sentence intent identifier and the corresponding target answer sentence intent identifier, the server may generate a corresponding target sentence pair according to the question sentence intent identifier and the corresponding target answer sentence intent identifier. For example, if the server determines that the intent identifier of the corresponding question sentence P 1 corresponds to the intent identifier of the target answer sentence as D A1 , the server may generate a pair of target sentences as P 1 -D A1 .
在本实施例中,目标句对也并不仅限于一个问句意图标识以及一个目标答句意图标识构成的二元组合关系,也可以是三元组合关系。In this embodiment, the target sentence pair is not limited to a binary combination relationship composed of a question sentence intent identifier and a target answer sentence intent identifier, but may also be a ternary combination relationship.
208、基于目标答句意图标识,得到目标问诊数据中包含的句对;208. Based on the intent identification of the target answer sentence, obtain sentence pairs included in the target consultation data;
本实施例中,通过获取目标问诊数据,目标问诊数据中包括多个问答句以及对应各问答句的对象标识,基于各对象标识,对目标问诊数据中的各问答句分别进行意图识别,得到对应目标问诊数据的意图标识序列,然后根据多个目标问诊数据对应的意图标识序列,确定意图标识序列中各问句的问句意图标识所对应的多个初始答句的答句识别标识,进一步,从各多个初始答句的答句识别标识中确定对应各问句的目标答句意图标识,并基于各问句意图标识以及对应的目标答句意图标识,生成各目标句对。从而,从而,可以使得目标句对是通过对多个目标问诊数据的问答句的意图识别处理后生成确定的,使得目标句对的生成可以覆盖多个不同形式的问答句,提升目标句对的覆盖率以及准确性。In this embodiment, by acquiring the target consultation data, the target consultation data includes a plurality of question and answer sentences and object identifiers corresponding to the question and answer sentences, and based on the object identifiers, intention recognition is performed on each question and answer sentence in the target consultation data. , obtain the intent identification sequence corresponding to the target inquiry data, and then determine the answer sentences of multiple initial answer sentences corresponding to the question intent identification of each question in the intent identification sequence according to the intent identification sequences corresponding to the multiple target inquiry data Identifying the identifier, further, determining the target answer sentence intent identifier corresponding to each question sentence from the answer sentence identifier identifiers of the multiple initial answer sentences, and generating each target sentence based on each question sentence intent identifier and the corresponding target answer sentence intent identifier right. Therefore, the target sentence pair can be determined after the intention recognition processing of the question and answer sentences of multiple target medical consultation data, so that the generation of the target sentence pair can cover a plurality of different forms of question and answer sentences, and the target sentence pair can be improved. coverage and accuracy.
在其中一个实施例中,基于各对象标识,对目标问诊数据中的各问答句分别进行意图识别,得到对应目标问诊数据的意图标识序列,可以包括:根据各对象标识,确定目标问诊数据中对应各对象的各问答句;对各对象的各问答句分别进行识别,确定各问答句为对应对象的问句或者对应对象的答句;对各对象的问句或者各对象的答句分别进行意图识别,得到对应的意图标识;根据所得到的意图标识,得到对应目标问诊数据的意图标识序列。如前所述,目标问诊数据中可以包括医生与病人的多个问答句,各问答句包括对应的对象标识,如医生标识,或者是病人标识等。In one embodiment, based on the identifiers of each object, the intent recognition is performed on each question and answer sentence in the target consultation data, respectively, to obtain a sequence of intent identifiers corresponding to the target consultation data, which may include: determining the target consultation according to the object identifiers Each question and answer sentence corresponding to each object in the data; each question and answer sentence of each object is identified separately, and each question and answer sentence is determined to be a question sentence of the corresponding object or the answer sentence of the corresponding object; the question sentence of each object or the answer sentence of each object Perform intention identification respectively to obtain the corresponding intention identification; according to the obtained intention identification, obtain the intention identification sequence corresponding to the target consultation data. As mentioned above, the target consultation data may include multiple question and answer sentences between doctors and patients, and each question and answer sentence includes a corresponding object identifier, such as a doctor identifier or a patient identifier.
209、调用预置目标BERT网络模型对句对和主诉信息进行特征提取,得到句对的句对向量和主诉信息的主诉向量;209. Call the preset target BERT network model to perform feature extraction on the sentence pair and the main complaint information, and obtain the sentence pair vector of the sentence pair and the main complaint vector of the main complaint information;
210、计算主诉向量和句对向量之间的欧氏距离,并基于欧氏距离确定多轮对话中每轮对话对应的对话表征向量;210. Calculate the Euclidean distance between the main complaint vector and the sentence pair vector, and determine the dialogue representation vector corresponding to each round of dialogue in the multi-round dialogue based on the Euclidean distance;
211、将每轮对话的对话表征向量输入预置分诊模型进行识别,得到分诊信息。211. Input the dialogue representation vector of each round of dialogue into a preset triage model for identification, and obtain triage information.
本实施例中步骤201、209-211与第一实施例中的步骤101、104-106类似,此处不再赘述。 Steps 201, 209-211 in this embodiment are similar to steps 101, 104-106 in the first embodiment, and are not repeated here.
本申请实施例中,通过获取待分诊对象在各轮对话中录入的问诊数据并对问诊数据进行数据清洗,得到目标问诊数据;对目标问诊数据进行意图识别,得到目标问诊数据中包含的句对;调用预置目标BERT网络模型对句对和主诉信息进行特征提取,得到句对向量和主诉向量;分别计算主诉向量和句对向量之间的欧氏距离,并基于欧氏距离确定多轮对话中每轮对话对应的对话表征向量;将每轮对话的对话表征向量输入预置分诊模型进行识别,得到分诊信息。本方案通过将主诉信息和多轮对话进行表征,解决了分诊准确率低的技术问题。In the embodiment of the present application, the target consultation data is obtained by acquiring the consultation data entered by the object to be triaged in each round of dialogues and cleaning the consultation data; Sentence pairs contained in the data; call the preset target BERT network model to perform feature extraction on sentence pairs and main complaint information, and obtain sentence pair vectors and main complaint vectors; The distance is used to determine the dialogue representation vector corresponding to each round of dialogue in multiple rounds of dialogue; the dialogue representation vector of each round of dialogue is input into the preset triage model for identification, and the triage information is obtained. This solution solves the technical problem of low triage accuracy by characterizing the chief complaint information and multiple rounds of dialogue.
请参阅图3,本申请实施例中基于对话表征的分诊方法的第三个实施例包括:Referring to FIG. 3, the third embodiment of the triage method based on dialogue representation in the embodiment of the present application includes:
301、获取待分诊对象在就诊时产生的多轮对话,并提取多轮对话中的问诊数据;301. Acquire multiple rounds of dialogues generated by the subject to be triaged when visiting a doctor, and extract the consultation data in the multiple rounds of dialogues;
302、对问诊数据进行数据清洗,得到目标问诊数据,其中,目标问诊数据包括所述用户的主诉信息;302. Perform data cleaning on the consultation data to obtain target consultation data, wherein the target consultation data includes the main complaint information of the user;
303、对目标问诊数据进行意图识别,得到目标问诊数据中包含的句对,其中,目标问诊数据中包含至少一个句对;303. Perform intention identification on the target medical consultation data to obtain sentence pairs included in the target medical consultation data, wherein the target medical consultation data includes at least one sentence pair;
304、调用预置目标BERT网络模型对句对和主诉信息进行特征提取,得到句对的句对向量和主诉信息的主诉向量;304. Call the preset target BERT network model to perform feature extraction on the sentence pair and the main complaint information, and obtain the sentence pair vector of the sentence pair and the main complaint vector of the main complaint information;
305、建立预训练任务,调用预置向量化模型将历史用户问诊数据处理为若干个词向量;305. Establish a pre-training task, and call a preset vectorization model to process historical user consultation data into several word vectors;
本实施例中,建立预训练任务,调用预置向量化模型将历史用户问诊数据处理为若干个词向量。其中,预训练任务主要用于执行步骤S305-S306的循环迭代计算。在循环迭代计算之前,需要通过向量化模型,比如word2vec模型等,将症状样本转化为词向量。其中,word2vec模型是一种用于产生词向量的模型。在一示例中,症状数据为{咳嗽:三天;带血丝},经word2vec模型转换后可以得到词向量emb1(咳嗽)、emb2(三天)和emb3(带血丝)。在此处,emb1为第一词向量,emb2和emb3为第二词向量。症状样本指的是用于训练初始BERT网络模型的训练数据,一般为某个地区的历史症状数据。In this embodiment, a pre-training task is established, and a preset vectorization model is invoked to process historical user consultation data into several word vectors. Wherein, the pre-training task is mainly used to perform the loop iterative calculation of steps S305-S306. Before the loop iterative calculation, it is necessary to convert the symptom samples into word vectors through a vectorized model, such as the word2vec model. Among them, the word2vec model is a model for generating word vectors. In an example, the symptom data is {cough: three days; bloodshot}, and word vectors emb1 (cough), emb2 (three days), and emb3 (bloodshot) can be obtained after transformation by the word2vec model. Here, emb1 is the first word vector, and emb2 and emb3 are the second word vectors. Symptom samples refer to the training data used to train the initial BERT network model, generally historical symptom data in a certain area.
306、将若干个词向量输入初始BERT网络模型,获取初始BERT网络模型输出的训练表征向量;306. Input several word vectors into the initial BERT network model, and obtain the training representation vector output by the initial BERT network model;
本实施例中,将若干个词向量输入初始BERT网络模型,获取初始BERT网络模型输出的训练表征向量。在获得词向量后,可以将各个词向量作为输入数据输入初始BERT网络模型,并生成训练表征向量,并计算相应的损失值。具体的,损失值可由损失函数计算获得。该损失函数定义为:In this embodiment, several word vectors are input into the initial BERT network model, and the training representation vector output by the initial BERT network model is obtained. After obtaining the word vector, each word vector can be input into the initial BERT network model as input data, and the training representation vector can be generated, and the corresponding loss value can be calculated. Specifically, the loss value can be obtained by calculating the loss function. The loss function is defined as:
Figure PCTCN2021097183-appb-000003
Figure PCTCN2021097183-appb-000003
其中,L(Vs,sym (n))为第n个症状的损失值;sym (n)表示症状列表中的第n个症状;Vs表示整体的表征向量;为第n个症状在表征向量中的损失项,为其他症状在表征向量中的损失项。通过损失函数可知,出现在表征向量里的症状,其损失值应该尽可能小,反之损失值应尽可能大。 Among them, L(Vs, sym (n) ) is the loss value of the nth symptom; sym (n) represents the nth symptom in the symptom list; Vs represents the overall characterization vector; it is the nth symptom in the characterization vector The loss term of , is the loss term of other symptoms in the representation vector. Through the loss function, it can be known that the symptoms appearing in the representation vector should be as small as possible, otherwise the loss should be as large as possible.
307、根据训练表征向量计算初始BERT网络模型的损失值;307. Calculate the loss value of the initial BERT network model according to the training representation vector;
本实施例中,根据训练表征向量计算初始BERT网络模型的损失值,根据所述训练表征向量计算所述初始BERT网络模型的损失值,所获得的损失值可以用于调整模型参数及判断模型是否收敛。若所述损失值处于预设范围之外,调整所述初始BERT网络模型的模型参数,并重新计算所述症状样本的训练表征向量,以在模型未收敛时,进行迭代计算。In this embodiment, the loss value of the initial BERT network model is calculated according to the training characterization vector, and the loss value of the initial BERT network model is calculated according to the training characterization vector, and the obtained loss value can be used to adjust model parameters and determine whether the model is convergence. If the loss value is outside the preset range, the model parameters of the initial BERT network model are adjusted, and the training representation vector of the symptom sample is recalculated, so as to perform iterative calculation when the model does not converge.
308、根据初始BERT网络模型的损失值,调整初始BERT网络模型的模型参数,得到目标BERT网络模型;308. According to the loss value of the initial BERT network model, adjust the model parameters of the initial BERT network model to obtain the target BERT network model;
本实施例中,将所述若干个词向量输入初始BERT网络模型,获取所述初始BERT网络模型输出的训练表征向量,以执行初始BERT网络模型的训练步骤。根据所述训练表征向量计算所述初始BERT网络模型的损失值,所获得的损失值可以用于调整模型参数及判断模型是否收敛。若所述损失值处于预设范围之外,调整所述初始BERT网络模型的模型参数,并重新计算所述症状样本的训练表征向量,以在模型未收敛时,进行迭代计算。若所述损失值处于预设范围之内,则所述预训练任务训练完毕,训练完毕后的所述初始BERT网络模型即为目标BERT网络模型。In this embodiment, the several word vectors are input into the initial BERT network model, and the training representation vector output by the initial BERT network model is obtained, so as to perform the training step of the initial BERT network model. The loss value of the initial BERT network model is calculated according to the training characterization vector, and the obtained loss value can be used to adjust model parameters and judge whether the model converges. If the loss value is outside the preset range, the model parameters of the initial BERT network model are adjusted, and the training representation vector of the symptom sample is recalculated, so as to perform iterative calculation when the model does not converge. If the loss value is within the preset range, the pre-training task is trained, and the initial BERT network model after the training is completed is the target BERT network model.
309、计算主诉向量和句对向量之间的欧氏距离,并基于欧氏距离确定多轮对话中每 轮对话对应的对话表征向量;309. Calculate the Euclidean distance between the main complaint vector and the sentence pair vector, and determine the dialogue representation vector corresponding to each round of dialogue in the multi-round dialogue based on the Euclidean distance;
310、将每轮对话的对话表征向量输入预置分诊模型进行识别,得到分诊信息。310. Input the dialogue representation vector of each round of dialogue into a preset triage model for identification, and obtain triage information.
本实施例中步骤301-304、309-310与第一实施例中的步骤101-104、105-106类似,此处不再赘述。Steps 301 - 304 and 309 - 310 in this embodiment are similar to steps 101 - 104 and 105 - 106 in the first embodiment, and are not repeated here.
本申请实施例中,通过获取待分诊对象在各轮对话中录入的问诊数据并对问诊数据进行数据清洗,得到目标问诊数据;对目标问诊数据进行意图识别,得到目标问诊数据中包含的句对;调用预置目标BERT网络模型对句对和主诉信息进行特征提取,得到句对向量和主诉向量;分别计算主诉向量和句对向量之间的欧氏距离,并基于欧氏距离确定多轮对话中每轮对话对应的对话表征向量;将每轮对话的对话表征向量输入预置分诊模型进行识别,得到分诊信息。本方案通过将主诉信息和多轮对话进行表征,解决了分诊准确率低的技术问题。In the embodiment of the present application, the target consultation data is obtained by acquiring the consultation data entered by the object to be triaged in each round of dialogues and cleaning the consultation data; Sentence pairs contained in the data; call the preset target BERT network model to perform feature extraction on sentence pairs and main complaint information, and obtain sentence pair vectors and main complaint vectors; The distance is used to determine the dialogue representation vector corresponding to each round of dialogue in multiple rounds of dialogue; the dialogue representation vector of each round of dialogue is input into the preset triage model for identification, and the triage information is obtained. This solution solves the technical problem of low triage accuracy by characterizing the chief complaint information and multiple rounds of dialogue.
请参阅图4,本申请实施例中基于对话表征的分诊方法的第四个实施例包括:Referring to FIG. 4 , the fourth embodiment of the triage method based on dialogue representation in the embodiment of the present application includes:
401、获取待分诊对象在就诊时产生的多轮对话,并提取多轮对话中的问诊数据;401. Acquire multiple rounds of dialogues generated by the subject to be triaged when visiting a doctor, and extract the consultation data in the multiple rounds of dialogues;
402、对问诊数据进行数据清洗,得到目标问诊数据,其中,目标问诊数据包括所述用户的主诉信息;402. Perform data cleaning on the consultation data to obtain target consultation data, wherein the target consultation data includes the main complaint information of the user;
403、对目标问诊数据进行意图识别,得到目标问诊数据中包含的句对,其中,目标问诊数据中包含至少一个句对;403. Perform intent recognition on the target medical consultation data to obtain sentence pairs included in the target medical consultation data, wherein the target medical consultation data includes at least one sentence pair;
404、调用预置目标BERT网络模型对句对和主诉信息进行特征提取,得到句对的句对向量和主诉信息的主诉向量;404. Call the preset target BERT network model to perform feature extraction on the sentence pair and the main complaint information, and obtain the sentence pair vector of the sentence pair and the main complaint vector of the main complaint information;
405、计算主诉向量和每轮对话中每个句对向量两两之间的欧氏距离;405. Calculate the Euclidean distance between the main complaint vector and each sentence pair vector in each round of dialogue;
本实施例中,计算主诉向量和每轮对话中每个句对向量两两之间的欧氏距离。分别计算问诊数据中所有句对与主诉向量两两之间的欧氏距离。In this embodiment, the Euclidean distance between the main complaint vector and each sentence pair vector in each round of dialogue is calculated. The Euclidean distances between all sentence pairs in the consultation data and the main complaint vector are calculated respectively.
本实施例中,欧氏距离是指欧氏距离是一种有效的计算一个样本和一个样本集“重心”的最近距离,或者有效计算两个未知样本集的相似度的方法。它考虑到各种特性之间的联系,可以排除变量之间的相关性的干扰,并且欧氏距离是尺度无关的,即独立于测量尺度。当∑是单位矩阵的时候,欧氏距离即为欧氏距离。综上所述,欧氏距离能够很方便的度量观测样本与已知样本集间的距离,因而很适合用在故障诊断中。In this embodiment, the Euclidean distance means that the Euclidean distance is an effective method for calculating the closest distance between a sample and a "centre of gravity" of a sample set, or for effectively calculating the similarity between two unknown sample sets. It takes into account the connection between various properties, can exclude the interference of the correlation between variables, and the Euclidean distance is scale-independent, that is, independent of the measurement scale. When ∑ is the identity matrix, the Euclidean distance is the Euclidean distance. To sum up, the Euclidean distance can easily measure the distance between the observed sample and the known sample set, so it is very suitable for fault diagnosis.
406、基于欧氏距离,确定每个句对在对应的一轮对话中的权重;406. Determine the weight of each sentence pair in the corresponding round of dialogue based on the Euclidean distance;
本实施例中,基于欧氏距离,确定每个句对在对应的一轮对话中的权重。主诉的表征,基于预训练的词向量完成(向量表示),通过计算各句对的向量和主诉向量的相关性,作为该句对重要性的评估依据。具体的计算方式是:In this embodiment, the weight of each sentence pair in a corresponding round of dialogue is determined based on the Euclidean distance. The representation of the main complaint is completed based on the pre-trained word vector (vector representation), and the correlation between the vector of each sentence pair and the main complaint vector is calculated as the basis for evaluating the importance of the sentence pair. The specific calculation method is:
度量主诉向量和每个句对向量的欧氏距离,也即,计算出每个句对的权重ai。Measure the Euclidean distance between the main complaint vector and each sentence pair vector, that is, calculate the weight ai of each sentence pair.
407、基于权重,对每个句对向量对应的权重进行加权平均,得到多轮对话中每轮对话对应的对话表征向量;407. Based on the weights, perform a weighted average of the weights corresponding to each sentence pair vector to obtain a dialogue representation vector corresponding to each round of dialogues in multiple rounds of dialogues;
本实施例中,基于权重,对每个句对向量对应的权重进行加权平均,得到多轮对话中每轮对话对应的对话表征向量。比如,在一轮对话中,句对(问答语句和答案语句)中答案语句是对问题语句的回答,则答案语句中通常会包含问题语句中的关键词;问题语句与答案语句之间共同关键词的数目越多越长,包含的有效信息越多,则对应的那轮对话重要性越强。比如,句对中答案语句是对问题语句的回答的可能性就越大;由于希望获取的目标问答对具有的是完整意义的问答,因此越长的问题语句能更好地描述一个完整的问题,而越长的答案语句能更好地描述一个完整的回答;若句对中答案语句是对问题语句的回答,则答案语句与问题语句之间主题通常是一致的;若句对中答案语句是对问题语句的回答,则答案语句与问题语句之间在句法上通常也有一定的联系。In this embodiment, based on the weights, the weights corresponding to each sentence pair vector are weighted and averaged to obtain a dialogue representation vector corresponding to each round of dialogues in multiple rounds of dialogues. For example, in a round of dialogue, if the answer sentence in the sentence pair (question and answer sentence and answer sentence) is the answer to the question sentence, the answer sentence usually contains the keywords in the question sentence; the common key between the question sentence and the answer sentence The more and longer the number of words, the more effective information it contains, and the more important the corresponding round of dialogue is. For example, the answer sentence in the sentence pair is more likely to be the answer to the question sentence; since the target question-answer pair expected to be obtained is a complete question and answer, the longer the question sentence can better describe a complete question , and the longer the answer sentence can better describe a complete answer; if the answer sentence in the sentence pair is the answer to the question sentence, the themes between the answer sentence and the question sentence are usually consistent; if the answer sentence in the sentence pair is the answer to the question sentence is the answer to the question sentence, then there is usually a certain syntactic connection between the answer sentence and the question sentence.
本实施例中,考虑到对话过程中患者所说的并非每句话都包含有效信息,因此引入权 重重要性度量模块(以下简称权重模块)评估每轮对话的重要性,对所有对话进行加权表征后进行判别。In this embodiment, considering that not every sentence spoken by the patient during the dialogue contains valid information, a weighted importance measurement module (hereinafter referred to as the weighting module) is introduced to evaluate the importance of each round of dialogue, and weighted representation of all dialogues Then make a judgment.
408、基于各轮对话对应的对话表征向量,确定目标问诊数据中的目标病症信息;408. Determine the target disease information in the target consultation data based on the dialogue representation vector corresponding to each round of dialogue;
本实施例中,基于各轮对话对应的对话表征向量,确定目标问诊数据中的目标病症信息。其中,所述目标病症信息是指待分诊者输入的文字信息或者语音信息,如果待分诊者输入的是语音信息,系统会现将语音信息转换成文字信息。In this embodiment, the target disease information in the target consultation data is determined based on the dialogue representation vector corresponding to each round of dialogue. The target disease information refers to text information or voice information input by the person to be triaged. If the person to be triaged inputs voice information, the system will now convert the voice information into text information.
409、对目标病症信息和各轮对话对应的主诉信息进行编码,得到目标问诊数据的病症实体向量;409. Encode the target disease information and the chief complaint information corresponding to each round of dialogue to obtain the disease entity vector of the target consultation data;
本实施例中,对目标病症信息和各轮对话对应的主诉信息进行编码,得到目标问诊数据的病症实体向量。其中,编码是信息从一种形式或格式转换为另一种形式的过程,也称为计算机编程语言的代码简称编码。用预先规定的方法将文字、数字或其它对象编成数码,或将信息、数据转换成规定的电脉冲信号。编码在电子计算机、电视、遥控和通讯等方面广泛使用。编码是信息从一种形式或格式转换为另一种形式的过程。解码,是编码的逆过程。In this embodiment, the target disease information and the main complaint information corresponding to each round of dialogue are encoded to obtain the disease entity vector of the target consultation data. Among them, coding is the process of converting information from one form or format to another, also known as coding in computer programming languages for short. Digitize characters, numbers or other objects with a predetermined method, or convert information and data into specified electrical pulse signals. Coding is widely used in electronic computers, television, remote control and communication. Encoding is the process of converting information from one form or format to another. Decoding is the reverse process of encoding.
410、将病症实体向量输入预置分诊模型进行预测,得到不同科室的分诊概率;410. Input the disease entity vector into the preset triage model for prediction, and obtain the triage probability of different departments;
本实施例中,将病症实体向量输入预置分诊模型进行预测,得到不同科室的分诊概率。In this embodiment, the disease entity vector is input into the preset triage model for prediction, and the triage probability of different departments is obtained.
本实施例中,在卷积层对拼接向量进行卷积操作,获取卷积关联向量,将卷积关联向量输入输出层,获取预测输出结果。基于预测输出结果与科室标签,计算预测误差损失,根据预测误差损失,更新神经网络模型的参数,在模型收敛时,得到分诊模型。将病症实体向量输入预置分诊模型进行预测,得到不同科室的分诊概率。In this embodiment, the convolution operation is performed on the splicing vector at the convolution layer to obtain the convolution correlation vector, and the convolution correlation vector is input to the output layer to obtain the prediction output result. Based on the prediction output results and department labels, the prediction error loss is calculated, and the parameters of the neural network model are updated according to the prediction error loss. When the model converges, the triage model is obtained. The disease entity vector is input into the preset triage model for prediction, and the triage probability of different departments is obtained.
411、对分诊概率进行排序,得到分诊信息,其中,分诊信息包括预设数量个排序最高的推荐科室和所述推荐科室对应的分诊概率。411. Sort the triage probabilities to obtain triage information, where the triage information includes a preset number of recommended departments with the highest ranking and the triage probabilities corresponding to the recommended departments.
本实施例中,对分诊概率进行排序,得到分诊信息。根据每个不同科室的奋战概率,对各个科室的分诊概率进行排序,返回给患者排序最高的设定个数的推荐科室和对应的分诊概率。优选地,所述分诊模型包括:多个卷积层、多个池化层、全连接层和Softmax层。In this embodiment, the triage probability is sorted to obtain triage information. According to the fighting probability of each different department, the triage probability of each department is sorted, and the recommended department with the highest set number and the corresponding triage probability are returned to the patient. Preferably, the triage model includes: multiple convolution layers, multiple pooling layers, fully connected layers and Softmax layers.
本实施例中步骤401-404与第一实施例中的步骤101-104类似,此处不再赘述。Steps 401-404 in this embodiment are similar to steps 101-104 in the first embodiment, and are not repeated here.
本申请实施例中,通过获取待分诊对象在各轮对话中录入的问诊数据并对问诊数据进行数据清洗,得到目标问诊数据;对目标问诊数据进行意图识别,得到目标问诊数据中包含的句对;调用预置目标BERT网络模型对句对和主诉信息进行特征提取,得到句对向量和主诉向量;分别计算主诉向量和句对向量之间的欧氏距离,并基于欧氏距离确定多轮对话中每轮对话对应的对话表征向量;将每轮对话的对话表征向量输入预置分诊模型进行识别,得到分诊信息。本方案通过将主诉信息和多轮对话进行表征,解决了分诊准确率低的技术问题。In the embodiment of the present application, the target consultation data is obtained by acquiring the consultation data entered by the object to be triaged in each round of dialogues and cleaning the consultation data; Sentence pairs contained in the data; call the preset target BERT network model to perform feature extraction on sentence pairs and main complaint information, and obtain sentence pair vectors and main complaint vectors; The distance is used to determine the dialogue representation vector corresponding to each round of dialogue in multiple rounds of dialogue; the dialogue representation vector of each round of dialogue is input into the preset triage model for identification, and the triage information is obtained. This solution solves the technical problem of low triage accuracy by characterizing the chief complaint information and multiple rounds of dialogue.
请参阅图5,本申请实施例中基于对话表征的分诊方法的第五个实施例包括:Referring to FIG. 5 , the fifth embodiment of the triage method based on dialogue representation in the embodiment of the present application includes:
501、获取待分诊对象在就诊时产生的多轮对话,并提取多轮对话中的问诊数据;501. Acquire multiple rounds of dialogues generated by the subject to be triaged when visiting a doctor, and extract the consultation data in the multiple rounds of dialogues;
502、对问诊数据进行数据清洗,得到目标问诊数据,其中,目标问诊数据包括用户的主诉信息;502. Perform data cleaning on the consultation data to obtain target consultation data, wherein the target consultation data includes the main complaint information of the user;
503、对目标问诊数据进行意图识别,得到目标问诊数据中包含的句对,其中,目标问诊数据中包含至少一个句对;503. Perform intention identification on the target medical consultation data to obtain sentence pairs included in the target medical consultation data, wherein the target medical consultation data includes at least one sentence pair;
504、调用预置目标BERT网络模型对句对和主诉信息进行特征提取,得到句对的句对向量和主诉信息的主诉向量;504. Call the preset target BERT network model to perform feature extraction on the sentence pair and the main complaint information, and obtain the sentence pair vector of the sentence pair and the main complaint vector of the main complaint information;
505、计算主诉向量和句对向量之间的欧氏距离,并基于欧氏距离确定多轮对话中每轮对话对应的对话表征向量;505. Calculate the Euclidean distance between the main complaint vector and the sentence pair vector, and determine the dialogue representation vector corresponding to each round of dialogue in the multi-round dialogue based on the Euclidean distance;
506、从预置数据库中获取历史问诊数据;506. Obtain historical consultation data from a preset database;
本实施例中,从预置数据库中获取历史问诊数据。可以从预置数据库中获取按照预设的对话流程与所述历史患者进行N轮对话,并获取所述历史患者在各轮对话中的对话语句。其中,N为正整数,其具体取值可以根据实际情况进行设置,例如,可以将其设置为2、3、5或者其它取值。即所述对话机器人可以与所述历史患者进行N轮对话。例如,在第1轮对话中,所述对话机器人可以询问:“您哪里不舒服”,然后获取所述历史患者针对该问题所回答的对话语句,在第2轮对话中,所述对话机器人可以询问:“您有哪些主要症状”,然后获取所述历史患者针对该问题所回答的对话语句,在第N轮对话中,所述对话机器人可以询问:“您有哪些伴随症状”,然后获取所述历史患者针对该问题所回答的对话语句。In this embodiment, historical consultation data is obtained from a preset database. The N rounds of dialogue with the historical patient according to the preset dialogue flow can be acquired from a preset database, and the dialogue sentences of the historical patient in each round of dialogue can be acquired. Among them, N is a positive integer, and its specific value can be set according to the actual situation, for example, it can be set to 2, 3, 5 or other values. That is, the dialogue robot can conduct N rounds of dialogue with the historical patient. For example, in the first round of dialogue, the dialogue robot can ask: "Where are you uncomfortable", and then obtain the dialogue sentences answered by the historical patient for this question, and in the second round of dialogue, the dialogue robot can Ask: "What main symptoms do you have", and then obtain the dialogue sentences answered by the historical patient for this question, in the Nth round of dialogue, the dialogue robot can ask: "What accompanying symptoms do you have", and then obtain all the Dialogue sentences answered by the patient in response to the question.
507、通过目标BERT网络模型对历史问诊数据进行表征学习,获取历史问诊数据的第二对话表征向量;507. Perform representation learning on the historical consultation data through the target BERT network model, and obtain a second dialogue representation vector of the historical consultation data;
本实施例中,通过目标BERT网络模型对历史问诊数据进行表征学习,获取历史问诊数据的第二对话表征向量。目标BERT网络模型是经预训练任务训练后获得的。预训练任务为自定义任务,该预训练任务定义为根据当前的表征向量推测该表征向量包含的症状名称及症状属性。预训练任务可以确保目标BERT网络模型能够学习到输出的表征向量包含的信息,也即是,通过预训练任务确定表征向量与症状特征数据之间的关联关系。需要注意的是,在此处,关联关系体现在目标BERT网络模型的模型参数之中。这样,能够准确地将症状名称和症状属性转换成一个整体的向量,即表征向量。生成的表征向量的数量与症状数据中的症状数量相等。也即是,历史问诊数据中有多少个症状,则生成相同数量且对应的表征向量。In this embodiment, the target BERT network model is used to perform representation learning on the historical consultation data to obtain the second dialogue representation vector of the historical consultation data. The target BERT network model is obtained after being trained on the pre-training task. The pre-training task is a custom task, and the pre-training task is defined as inferring the symptom name and symptom attribute contained in the representation vector according to the current representation vector. The pre-training task can ensure that the target BERT network model can learn the information contained in the output representation vector, that is, the relationship between the representation vector and the symptom feature data is determined through the pre-training task. It should be noted that here, the relationship is embodied in the model parameters of the target BERT network model. In this way, symptom names and symptom attributes can be accurately converted into an overall vector, that is, a representation vector. The number of generated representation vectors is equal to the number of symptoms in the symptom data. That is, how many symptoms there are in the historical consultation data, the same number and corresponding representation vectors are generated.
508、获取预设训练病症和与训练病症对应的科室标签,基于训练病症对预置节点集关联向量进行筛选,获取与训练症状对应的目标向量;508. Obtain a preset training symptom and a department label corresponding to the training symptom, screen the preset node set association vector based on the training symptom, and obtain a target vector corresponding to the training symptom;
本实施例中,获取预设训练病症和与训练病症对应的科室标签,基于训练病症对预置节点集关联向量进行筛选,获取与训练症状对应的目标向量。其中,训练症状是指用于进行训练BERT网络模型的症状。科室标签是与训练症状对应的科室,该科室标签为训练标签,例如,若训练症状为皮肤问题,则对应的科室标签为皮肤科。In this embodiment, a preset training symptom and a department label corresponding to the training symptom are obtained, and the preset node set association vector is screened based on the training symptom, and a target vector corresponding to the training symptom is obtained. Among them, the training symptom refers to the symptom used to train the BERT network model. The department label is the department corresponding to the training symptom, and the department label is the training label. For example, if the training symptom is a skin problem, the corresponding department label is dermatology.
目标向量是指与训练症状相对应的向量,例如,训练症状对应的症状为咳嗽,则根据该症状从节点集关联向量中筛选出目标向量。本实施例中,根据训练症状对节点集关联向量进行筛选,以匹配出训练症状对应的目标向量,确保模型训练样本具有对应关系,保证模型训练的可行性。The target vector refers to the vector corresponding to the training symptom. For example, if the symptom corresponding to the training symptom is cough, the target vector is filtered from the association vector of the node set according to the symptom. In this embodiment, the node set association vectors are screened according to the training symptoms to match the target vectors corresponding to the training symptoms, so as to ensure that the model training samples have a corresponding relationship and ensure the feasibility of model training.
509、对第二对话表征向量和目标向量进行映射操作,获取对话嵌入向量和目标嵌入向量;509. Perform a mapping operation on the second dialogue representation vector and the target vector to obtain the dialogue embedding vector and the target embedding vector;
本实施例中,对第二对话表征向量和目标向量进行映射操作,获取对话嵌入向量和目标嵌入向量。在第二对话表征向量对图谱症状向量进行映射操作,获取对话嵌入向量。其中,第一嵌入层是用于对第二对话表征向量进行降维处理的层,以使第二对话表征向量映射为维数较低的对话嵌入向量。In this embodiment, a mapping operation is performed on the second dialogue representation vector and the target vector to obtain the dialogue embedding vector and the target embedding vector. A mapping operation is performed on the graph symptom vector in the second dialogue representation vector to obtain the dialogue embedding vector. The first embedding layer is a layer for performing dimension reduction processing on the second dialogue representation vector, so that the second dialogue representation vector is mapped to a dialogue embedding vector with a lower dimension.
本实施例中,在第二嵌入层对目标向量进行映射操作,获取目标嵌入向量。其中,第二嵌入层是用于对目标向量进行降维处理的层,以使目标向量映射为维数较低的目标嵌入向量。具体地,在第二嵌入层中采用预先设置的映射表对目标向量进行处理,以得到目标嵌入向量,从而减少目标嵌入向量的维数,减低后续的运算难度。In this embodiment, a mapping operation is performed on the target vector in the second embedding layer to obtain the target embedding vector. Among them, the second embedding layer is a layer used to reduce the dimension of the target vector, so that the target vector is mapped to a target embedding vector with a lower dimension. Specifically, in the second embedding layer, a preset mapping table is used to process the target vector to obtain the target embedding vector, thereby reducing the dimension of the target embedding vector and reducing the difficulty of subsequent operations.
510、基于训练症状对对话嵌入向量和目标嵌入向量进行拼接,获取拼接向量;510. Based on the training symptom, splicing the dialogue embedding vector and the target embedding vector to obtain the splicing vector;
本实施例中,基于训练症状对对话嵌入向量和目标嵌入向量进行拼接,获取拼接向量。其中,拼接向量是根据对话嵌入向量和目标嵌入向量得到的向量,以形成具有深层意义的向量。In this embodiment, the dialogue embedding vector and the target embedding vector are spliced based on the training symptom to obtain the splicing vector. Among them, the splicing vector is a vector obtained from the dialogue embedding vector and the target embedding vector to form a vector with deep meaning.
本实施例中,在分诊模型训练过程中充分利用获取信息更为全面的拼接向量,使得获取的分诊模型泛化能力强,鲁棒性高。本实施例中,采用TensorFlow的tf.concat()函数对对话嵌入向量和目标嵌入向量进行拼接,快速得到拼接向量。In this embodiment, the splicing vector with more comprehensive information is fully utilized in the process of triage model training, so that the acquired triage model has strong generalization ability and high robustness. In this embodiment, the tf.concat() function of TensorFlow is used to splicing the dialogue embedding vector and the target embedding vector to quickly obtain the splicing vector.
511、在卷积层对拼接向量进行卷积操作,获取卷积关联向量,将卷积关联向量输入输出层,获取预测输出结果;511. Perform a convolution operation on the splicing vector at the convolution layer to obtain the convolution correlation vector, input the convolution correlation vector into the output layer, and obtain the predicted output result;
本实施例中,在卷积层对拼接向量进行卷积操作,获取卷积关联向量,将卷积关联向量输入输出层,获取预测输出结果。其中,预测输出结果是预测的与训练症状对应的科室结果。In this embodiment, the convolution operation is performed on the splicing vector at the convolution layer to obtain the convolution correlation vector, and the convolution correlation vector is input to the output layer to obtain the prediction output result. Among them, the predicted output result is the predicted department result corresponding to the training symptom.
本实施例中,采用输出层计算训练症状对应的可能的科室的概率,并将概率最大的科室作为预测输出结果,以实现依据模型训练样本得到对应的预测输出结果。In this embodiment, the output layer is used to calculate the probability of possible departments corresponding to the training symptoms, and the department with the highest probability is used as the prediction output result, so as to obtain the corresponding prediction output result according to the model training samples.
512、基于预测输出结果与科室标签,计算预测误差损失,并根据预测误差损失更新目标BERT网络模型的参数直到目标BERT网络模型收敛,获取基于对话表征的分诊模型;512. Calculate the prediction error loss based on the prediction output result and the department label, and update the parameters of the target BERT network model according to the prediction error loss until the target BERT network model converges, and obtain the triage model based on the dialogue representation;
本实施例中,基于预测输出结果与科室标签,计算预测误差损失,并根据预测误差损失更新目标BERT网络模型的参数直到目标BERT网络模型收敛,获取基于对话表征的分诊模型。具体地,对预测误差损失进行求偏导得到梯度值,根据梯度值更新目标BERT网络模型的参数,实现对目标BERT网络模型的调优,当预测误差损失小于预设阈值,则目标BERT网络模型收敛,将目标BERT网络模型确定为分诊模型。In this embodiment, the prediction error loss is calculated based on the prediction output result and the department label, and the parameters of the target BERT network model are updated according to the prediction error loss until the target BERT network model converges to obtain a triage model based on dialogue representation. Specifically, the partial derivative of the prediction error loss is obtained to obtain the gradient value, and the parameters of the target BERT network model are updated according to the gradient value to realize the optimization of the target BERT network model. When the prediction error loss is less than the preset threshold, the target BERT network model Convergence, the target BERT network model is determined as the triage model.
513、将每轮对话的对话表征向量输入预置分诊模型进行识别,得到分诊信息。513. Input the dialogue representation vector of each round of dialogue into a preset triage model for identification, and obtain triage information.
本实施例中步骤501-505、513与第一实施例中的101-105、106类似,此处不再赘述。Steps 501 - 505 and 513 in this embodiment are similar to steps 101 - 105 and 106 in the first embodiment, and are not repeated here.
在本申请实施例中,通过获取待分诊对象在各轮对话中录入的问诊数据并对问诊数据进行数据清洗,得到目标问诊数据;对目标问诊数据进行意图识别,得到目标问诊数据中包含的句对;调用预置目标BERT网络模型对句对和主诉信息进行特征提取,得到句对向量和主诉向量;分别计算主诉向量和句对向量之间的欧氏距离,并基于欧氏距离确定多轮对话中每轮对话对应的对话表征向量;将每轮对话的对话表征向量输入预置分诊模型进行识别,得到分诊信息。本方案通过将主诉信息和多轮对话进行表征,解决了分诊准确率低的技术问题。In the embodiment of the present application, the target consultation data is obtained by acquiring the consultation data entered by the object to be triaged in each round of dialogues and cleaning the consultation data to obtain the target consultation data; The sentence pairs contained in the diagnosis data; call the preset target BERT network model to extract the features of the sentence pairs and the main complaint information, and obtain the sentence pair vector and the main complaint vector; respectively calculate the Euclidean distance between the main complaint vector and the sentence pair vector, and based on the The Euclidean distance determines the dialogue representation vector corresponding to each round of dialogue in multiple rounds of dialogue; the dialogue representation vector of each round of dialogue is input into the preset triage model for identification, and triage information is obtained. This solution solves the technical problem of low triage accuracy by characterizing the chief complaint information and multiple rounds of dialogue.
上面对本申请实施例中基于对话表征的分诊方法进行了描述,下面对本申请实施例中基于对话表征的分诊装置进行描述,请参阅图6,本申请实施例中基于对话表征的分诊装置的第一个实施例包括:The triage method based on the dialogue representation in the embodiment of the present application is described above, and the triage device based on the dialogue representation in the embodiment of the present application is described below. Please refer to FIG. 6 , the triage device based on the dialogue representation in the embodiment of the present application is described The first embodiment includes:
数据提取模块601,用于获取待分诊对象在就诊时产生的多轮对话,并提取多轮对话中的问诊数据;The data extraction module 601 is used for acquiring multiple rounds of dialogues generated by the subject to be triaged when visiting a doctor, and extracting the consultation data in the multiple rounds of dialogues;
数据清洗模块602,用于对所述问诊数据进行数据清洗,得到目标问诊数据,其中,所述目标问诊数据包括所述用户的主诉信息;A data cleaning module 602, configured to perform data cleaning on the consultation data to obtain target consultation data, wherein the target consultation data includes the main complaint information of the user;
意图识别模块603,用于对所述目标问诊数据进行意图识别,得到所述目标问诊数据中包含的句对,其中,所述目标问诊数据中包含至少一个句对; Intention recognition module 603, configured to perform intention recognition on the target consultation data to obtain sentence pairs included in the target consultation data, wherein the target consultation data includes at least one sentence pair;
特征提取模块604,用于调用预置目标BERT网络模型对所述句对和所述主诉信息进行特征提取,得到所述句对的句对向量和所述主诉信息的主诉向量;The feature extraction module 604 is used to call the preset target BERT network model to perform feature extraction on the sentence pair and the main complaint information, and obtain the sentence pair vector of the sentence pair and the main complaint vector of the main complaint information;
第一计算模块605,用于计算所述主诉向量和所述句对向量之间的欧氏距离,并基于所述欧氏距离确定所述各轮对话对应的对话表征向量;The first calculation module 605 is used to calculate the Euclidean distance between the main complaint vector and the sentence pair vector, and determine the dialogue representation vector corresponding to each round of dialogue based on the Euclidean distance;
识别模块606,用于将每轮对话的对话表征向量输入预置分诊模型进行识别,得到分诊信息。The identification module 606 is configured to input the dialogue representation vector of each round of dialogue into a preset triage model for identification, and obtain triage information.
本申请实施例中,通过获取待分诊对象在各轮对话中录入的问诊数据并对问诊数据进行数据清洗,得到目标问诊数据;对目标问诊数据进行意图识别,得到目标问诊数据中包含的句对;调用预置目标BERT网络模型对句对和主诉信息进行特征提取,得到句对向量和主诉向量;分别计算主诉向量和句对向量之间的欧氏距离,并基于欧氏距离确定多轮对 话中每轮对话对应的对话表征向量;将每轮对话的对话表征向量输入预置分诊模型进行识别,得到分诊信息。本方案通过将主诉信息和多轮对话进行表征,解决了分诊准确率低的技术问题。In the embodiment of the present application, the target consultation data is obtained by acquiring the consultation data entered by the object to be triaged in each round of dialogues and cleaning the consultation data; Sentence pairs contained in the data; call the preset target BERT network model to perform feature extraction on sentence pairs and main complaint information, and obtain sentence pair vectors and main complaint vectors; The distance is used to determine the dialogue representation vector corresponding to each round of dialogue in multiple rounds of dialogue; the dialogue representation vector of each round of dialogue is input into the preset triage model for identification, and the triage information is obtained. This solution solves the technical problem of low triage accuracy by characterizing the chief complaint information and multiple rounds of dialogue.
请参阅图7,本申请实施例中基于对话表征的分诊装置的第二个实施例,该基于对话表征的分诊装置具体包括:Please refer to FIG. 7 , the second embodiment of the triage device based on dialogue representation in the embodiment of the present application, the triage device based on dialogue representation specifically includes:
数据提取模块601,用于获取待分诊对象在就诊时产生的多轮对话,并提取多轮对话中的问诊数据;The data extraction module 601 is used for acquiring multiple rounds of dialogues generated by the subject to be triaged when visiting a doctor, and extracting the consultation data in the multiple rounds of dialogues;
数据清洗模块602,用于对所述问诊数据进行数据清洗,得到目标问诊数据,其中,所述目标问诊数据包括所述用户的主诉信息;A data cleaning module 602, configured to perform data cleaning on the consultation data to obtain target consultation data, wherein the target consultation data includes the main complaint information of the user;
意图识别模块603,用于对所述目标问诊数据进行意图识别,得到所述目标问诊数据中包含的句对,其中,所述目标问诊数据中包含至少一个句对; Intention recognition module 603, configured to perform intention recognition on the target consultation data to obtain sentence pairs included in the target consultation data, wherein the target consultation data includes at least one sentence pair;
特征提取模块604,用于调用预置目标BERT网络模型对所述句对和所述主诉信息进行特征提取,得到所述句对的句对向量和所述主诉信息的主诉向量;The feature extraction module 604 is used to call the preset target BERT network model to perform feature extraction on the sentence pair and the main complaint information, and obtain the sentence pair vector of the sentence pair and the main complaint vector of the main complaint information;
第一计算模块605,用于计算所述主诉向量和所述句对向量之间的欧氏距离,并基于所述欧氏距离确定所述各轮对话对应的对话表征向量;The first calculation module 605 is used to calculate the Euclidean distance between the main complaint vector and the sentence pair vector, and determine the dialogue representation vector corresponding to each round of dialogue based on the Euclidean distance;
识别模块606,用于将每轮对话的对话表征向量输入预置分诊模型进行识别,得到分诊信息。The identification module 606 is configured to input the dialogue representation vector of each round of dialogue into a preset triage model for identification, and obtain triage information.
本实施例中,所述意图识别模块603包括:In this embodiment, the intent recognition module 603 includes:
获取单元6031,用于根据预设表征规则获取所述目标问诊数据中的所有问答句和与所述问答句对应对象的对象标识;Obtaining unit 6031, configured to obtain all question and answer sentences in the target consultation data and object identifiers of objects corresponding to the question and answer sentences according to preset characterization rules;
意图识别单元6032,用于基于各所述对象标识,对所述目标问诊数据中的各问答句分别进行意图识别,得到对应所述问诊数据的意图标识序列;an intent identification unit 6032, configured to perform intent identification on each question and answer sentence in the target medical consultation data based on each of the object identifiers, to obtain an intent identification sequence corresponding to the medical consultation data;
确定单元6033,用于根据所述意图标识序列,确定对应所述问句的目标答句意图标识;基于所述目标答句意图标识,得到所述目标问诊数据中包含的句对。The determining unit 6033 is configured to determine, according to the intent identifier sequence, a target answer sentence intent identifier corresponding to the question; and based on the target answer sentence intent identifier, obtain sentence pairs included in the target questioning data.
本实施例中,所述基于对话表征的分诊装置还包括:In this embodiment, the triage device based on dialogue representation further includes:
向量化模块607,用于建立预训练任务,调用预置向量化模型将历史用户问诊数据处理为若干个词向量,其中,所述词向量包括基于所述历史用户问诊数据词向量;The vectorization module 607 is used for establishing a pre-training task, calling a preset vectorization model to process historical user consultation data into several word vectors, wherein the word vectors include word vectors based on the historical user consultation data;
第一获取模块608,用于将所述若干个词向量输入初始BERT网络模型,获取所述初始BERT网络模型输出的训练表征向量;The first acquisition module 608 is used to input the several word vectors into the initial BERT network model, and obtain the training representation vector output by the initial BERT network model;
第二计算模块609,用于根据所述训练表征向量计算所述初始BERT网络模型的损失值;根据所述初始BERT网络模型的损失值,调整所述初始BERT网络模型的模型参数,得到目标BERT网络模型。The second calculation module 609 is configured to calculate the loss value of the initial BERT network model according to the training characterization vector; according to the loss value of the initial BERT network model, adjust the model parameters of the initial BERT network model to obtain the target BERT network model.
本实施例中,所述第一计算模块605具体用于:In this embodiment, the first calculation module 605 is specifically used for:
计算所述主诉向量和每轮对话中每个句对向量两两之间的欧氏距离;Calculate the Euclidean distance between the main complaint vector and each sentence pair vector in each round of dialogue;
基于所述欧氏距离,确定每个所述句对在对应的一轮对话中的权重;Based on the Euclidean distance, determine the weight of each sentence pair in the corresponding round of dialogue;
基于所述权重,对每个所述句对向量对应的权重进行加权平均,得到多轮对话中每轮对话对应的对话表征向量。Based on the weights, the weights corresponding to each sentence pair vector are weighted and averaged to obtain a dialogue representation vector corresponding to each round of dialogues in multiple rounds of dialogues.
本实施例中,所述识别模块606具体用于:In this embodiment, the identifying module 606 is specifically used for:
基于所述各轮对话对应的对话表征向量,确定所述目标问诊数据中的目标病症信息;Determine the target disease information in the target consultation data based on the dialogue representation vector corresponding to each round of dialogue;
对所述目标病症信息和所述各轮对话对应的主诉信息进行编码,得到所述目标问诊数据的病症实体向量;Encoding the target disease information and the main complaint information corresponding to each round of dialogue to obtain the disease entity vector of the target consultation data;
将所述病症实体向量输入预置分诊模型进行预测,得到不同科室的分诊概率;Inputting the disease entity vector into a preset triage model for prediction, and obtaining the triage probability of different departments;
对所述分诊概率进行排序,得到分诊信息,其中,所述分诊信息包括预设数量个排序最高的推荐科室和所述推荐科室对应的分诊概率。Sorting the triage probabilities to obtain triage information, wherein the triage information includes a preset number of recommended departments with the highest ranking and triage probabilities corresponding to the recommended departments.
本实施例中,所述基于对话表征的分诊装置还包括:In this embodiment, the triage device based on dialogue representation further includes:
第二获取模块610,用于从预置数据库中获取历史问诊数据;The second obtaining module 610 is configured to obtain historical consultation data from a preset database;
表征学习模块611,用于通过所述目标BERT网络模型对所述历史问诊数据进行表征学习,获取所述历史问诊数据的第二对话表征向量;A representation learning module 611, configured to perform representation learning on the historical consultation data through the target BERT network model, and obtain a second dialogue representation vector of the historical consultation data;
筛选模块612,用于获取预设训练病症和与所述训练病症对应的科室标签,基于所述训练病症对预置节点集关联向量进行筛选,获取与所述训练症状对应的目标向量;A screening module 612, configured to obtain a preset training symptom and a department label corresponding to the training symptom, screen a preset node set association vector based on the training symptom, and obtain a target vector corresponding to the training symptom;
映射模块613,用于对所述第二对话表征向量和所述目标向量进行映射操作,获取对话嵌入向量和目标嵌入向量;A mapping module 613, configured to perform a mapping operation on the second dialogue representation vector and the target vector to obtain a dialogue embedding vector and a target embedding vector;
拼接模块614,用于基于所述训练症状对所述对话嵌入向量和所述目标嵌入向量进行拼接,获取拼接向量;A splicing module 614, configured to splicing the dialogue embedding vector and the target embedding vector based on the training symptom to obtain a splicing vector;
卷积处理模块615,用于在卷积层对所述拼接向量进行卷积操作,获取卷积关联向量,将所述卷积关联向量输入输出层,获取预测输出结果;The convolution processing module 615 is configured to perform a convolution operation on the splicing vector at the convolution layer, obtain a convolution association vector, input the convolution association vector into the output layer, and obtain a prediction output result;
更新模块616,用于基于所述预测输出结果与所述科室标签,计算预测误差损失,并根据所述预测误差损失更新所述目标BERT网络模型的参数,直到所述目标BERT网络模型收敛,获取基于对话表征的分诊模型。The updating module 616 is configured to calculate the prediction error loss based on the prediction output result and the department label, and update the parameters of the target BERT network model according to the prediction error loss, until the target BERT network model converges, obtain Diagnosis model based on dialogue representation.
本实施例中,所述数据清洗模块602具体用于:In this embodiment, the data cleaning module 602 is specifically used for:
获取所述问诊数据的清洗需求;Obtain the cleaning requirements of the consultation data;
根据所述问诊数据和所述清洗需求,确定用于对所述问诊数据进行数据清洗的目标清洗规则;According to the consultation data and the cleaning requirement, determine a target cleaning rule for performing data cleaning on the consultation data;
根据所述目标清洗规则对所述问诊数据进行数据清洗,得到目标问诊数据。Data cleaning is performed on the consultation data according to the target cleaning rule to obtain target consultation data.
本申请实施例中,通过获取待分诊对象在各轮对话中录入的问诊数据并对问诊数据进行数据清洗,得到目标问诊数据;对目标问诊数据进行意图识别,得到目标问诊数据中包含的句对;调用预置目标BERT网络模型对句对和主诉信息进行特征提取,得到句对向量和主诉向量;分别计算主诉向量和句对向量之间的欧氏距离,并基于欧氏距离确定多轮对话中每轮对话对应的对话表征向量;将每轮对话的对话表征向量输入预置分诊模型进行识别,得到分诊信息。本方案通过将主诉信息和多轮对话进行表征,解决了分诊准确率低的技术问题。In the embodiment of the present application, the target consultation data is obtained by acquiring the consultation data entered by the object to be triaged in each round of dialogues and cleaning the consultation data; Sentence pairs contained in the data; call the preset target BERT network model to perform feature extraction on sentence pairs and main complaint information, and obtain sentence pair vectors and main complaint vectors; The distance is used to determine the dialogue representation vector corresponding to each round of dialogue in multiple rounds of dialogue; the dialogue representation vector of each round of dialogue is input into the preset triage model for identification, and the triage information is obtained. This solution solves the technical problem of low triage accuracy by characterizing the chief complaint information and multiple rounds of dialogue.
上面图6和图7从模块化功能实体的角度对本申请实施例中的基于对话表征的分诊装置进行详细描述,下面从硬件处理的角度对本申请实施例中基于对话表征的分诊设备进行详细描述。6 and 7 above describe in detail the triage device based on dialogue representation in the embodiment of the present application from the perspective of modular functional entities, and the following describes the triage device based on dialogue representation in the embodiment of the present application from the perspective of hardware processing in detail. describe.
图8是本申请实施例提供的一种基于对话表征的分诊设备的结构示意图,该基于对话表征的分诊设备800可因配置或性能不同而产生比较大的差异,可以包括一个或一个以上处理器(central processing units,CPU)810(例如,一个或一个以上处理器)和存储器820,一个或一个以上存储应用程序833或数据832的存储介质830(例如一个或一个以上海量存储设备)。其中,存储器820和存储介质830可以是短暂存储或持久存储。存储在存储介质830的程序可以包括一个或一个以上模块(图示没标出),每个模块可以包括对基于对话表征的分诊设备800中的一系列指令操作。更进一步地,处理器810可以设置为与存储介质830通信,在基于对话表征的分诊设备800上执行存储介质830中的一系列指令操作,以实现上述各方法实施例提供的基于对话表征的分诊方法的步骤。FIG. 8 is a schematic structural diagram of a dialogue representation-based triage device provided by an embodiment of the present application. The dialogue representation-based triage device 800 may vary greatly due to different configurations or performances, and may include one or more than one Central processing units (CPU) 810 (eg, one or more processors) and memory 820, one or more storage media 830 (eg, one or more mass storage devices) that store application programs 833 or data 832. Among them, the memory 820 and the storage medium 830 may be short-term storage or persistent storage. The program stored in the storage medium 830 may include one or more modules (not shown), and each module may include a series of instructions to operate on the dialogue characterization-based triage device 800 . Further, the processor 810 may be configured to communicate with the storage medium 830, and execute a series of instruction operations in the storage medium 830 on the dialogue-characterization-based triage device 800, so as to realize the dialogue-characterization-based diagnosis provided by the above method embodiments. Steps of the triage method.
基于对话表征的分诊设备800还可以包括一个或一个以上电源840,一个或一个以上有线或无线网络接口850,一个或一个以上输入输出接口860,和/或,一个或一个以上操作系统831,例如Windows Serve,Mac OS X,Unix,Linux,FreeBSD等等。本领域技术人员可以理解,图8示出的基于对话表征的分诊设备结构并不构成对本申请提供的基于对话表征的分诊设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Dialog-based triage device 800 may also include one or more power supplies 840, one or more wired or wireless network interfaces 850, one or more input-output interfaces 860, and/or, one or more operating systems 831, For example Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art can understand that the structure of the triage device based on dialogue representation shown in FIG. 8 does not constitute a limitation on the triage device based on dialogue representation provided by the present application, and may include more or less components than those shown in the figure. Either some components are combined, or different component arrangements.
本申请还提供一种计算机可读存储介质,该计算机可读存储介质可以为非易失性计算机可读存储介质,该计算机可读存储介质也可以为易失性计算机可读存储介质,所述计算机可读存储介质中存储有指令,当所述指令在计算机上运行时,使得计算机执行上述基于对话表征的分诊方法的步骤。The present application also provides a computer-readable storage medium. The computer-readable storage medium may be a non-volatile computer-readable storage medium. The computer-readable storage medium may also be a volatile computer-readable storage medium. The computer-readable storage medium stores instructions that, when executed on a computer, cause the computer to perform the steps of the above-mentioned method for triage based on dialogue representation.
本申请所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。The blockchain referred to in this application is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. Blockchain, essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information to verify its Validity of information (anti-counterfeiting) and generation of the next block. The blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.
所述领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system, device and unit described above can refer to the corresponding process in the foregoing method embodiments, which will not be repeated here.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as an independent product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, and the computer software products are stored in a storage medium , including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store program codes .
以上所述,以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。As mentioned above, the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand: The technical solutions recorded in the embodiments are modified, or some technical features thereof are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions in the embodiments of the present application.

Claims (20)

  1. 一种基于对话表征的分诊方法,其中,所述基于对话表征的分诊方法包括:A method for triage based on dialogue representation, wherein the method for triage based on dialogue representation comprises:
    获取待分诊对象在就诊时产生的多轮对话,并提取多轮对话中的问诊数据;Acquire multiple rounds of dialogues generated by the subject to be triaged when they visit a doctor, and extract the consultation data in the multiple rounds of dialogues;
    对所述问诊数据进行数据清洗,得到目标问诊数据,其中,所述目标问诊数据包括所述用户的主诉信息;Data cleaning is performed on the consultation data to obtain target consultation data, wherein the target consultation data includes the main complaint information of the user;
    对所述目标问诊数据进行意图识别,得到所述目标问诊数据中包含的句对,其中,所述目标问诊数据中包含至少一个句对;performing intention identification on the target medical consultation data to obtain sentence pairs included in the target medical consultation data, wherein the target medical consultation data includes at least one sentence pair;
    调用预置目标BERT网络模型对所述句对和所述主诉信息进行特征提取,得到所述句对的句对向量和所述主诉信息的主诉向量;Call the preset target BERT network model to perform feature extraction on the sentence pair and the main complaint information, and obtain the sentence pair vector of the sentence pair and the main complaint vector of the main complaint information;
    计算所述主诉向量和所述句对向量之间的欧氏距离,并基于所述欧氏距离确定多轮对话中每轮对话对应的对话表征向量;Calculate the Euclidean distance between the main complaint vector and the sentence pair vector, and determine the dialogue representation vector corresponding to each round of dialogue in multiple rounds of dialogue based on the Euclidean distance;
    将每轮对话的对话表征向量输入预置分诊模型进行识别,得到分诊信息。The dialogue representation vector of each round of dialogue is input into the preset triage model for identification, and the triage information is obtained.
  2. 根据权利要求1所述的基于对话表征的分诊方法,其中,所述对所述目标问诊数据进行意图识别,得到所述目标问诊数据中包含的句对包括:The method for triage based on dialogue representation according to claim 1, wherein the performing intention identification on the target interrogation data to obtain sentence pairs included in the target interrogation data comprises:
    根据预设表征规则获取所述目标问诊数据中的所有问答句和与所述问答句对应对象的对象标识;Acquiring all question and answer sentences in the target consultation data and object identifiers of objects corresponding to the question and answer sentences according to preset characterization rules;
    基于各所述对象标识,对所述目标问诊数据中的各问答句分别进行意图识别,得到对应所述问诊数据的意图标识序列;Based on each of the object identifiers, intention identification is performed on each question and answer sentence in the target consultation data, to obtain an intention identification sequence corresponding to the consultation data;
    根据所述意图标识序列,确定对应所述问句的目标答句意图标识;According to the sequence of intent identifiers, determine the intent identifier of the target answer corresponding to the question;
    基于所述目标答句意图标识,得到所述目标问诊数据中包含的句对。Based on the intent identification of the target answer sentence, sentence pairs included in the target consultation data are obtained.
  3. 根据权利要求1所述的基于对话表征的分诊方法,其中,在所述调用预置目标BERT网络模型对所述句对和所述主诉信息进行特征提取,得到所述句对的句对向量和所述主诉信息的主诉向量之前,还包括:The triage method based on dialogue representation according to claim 1, wherein, in the call preset target BERT network model, feature extraction is performed on the sentence pair and the main complaint information, and a sentence pair vector of the sentence pair is obtained. And before the chief complaint vector of the chief complaint information, it also includes:
    建立预训练任务,调用预置向量化模型将历史用户问诊数据处理为若干个词向量,其中,所述词向量包括基于所述历史用户问诊数据词向量;Establishing a pre-training task, calling a preset vectorization model to process historical user consultation data into several word vectors, wherein the word vectors include word vectors based on the historical user consultation data;
    将所述若干个词向量输入初始BERT网络模型,获取所述初始BERT网络模型输出的训练表征向量;Input the several word vectors into the initial BERT network model, and obtain the training representation vector output by the initial BERT network model;
    根据所述训练表征向量计算所述初始BERT网络模型的损失值;Calculate the loss value of the initial BERT network model according to the training characterization vector;
    根据所述初始BERT网络模型的损失值,调整所述初始BERT网络模型的模型参数,得到目标BERT网络模型。According to the loss value of the initial BERT network model, the model parameters of the initial BERT network model are adjusted to obtain the target BERT network model.
  4. 根据权利要求1-2中任一项所述的基于对话表征的分诊方法,其中,所述计算所述主诉向量和所述句对向量之间的欧氏距离,并基于所述欧氏距离确定多轮对话中每轮对话对应的对话表征向量包括:The triage method based on dialogue representation according to any one of claims 1-2, wherein the calculation of the Euclidean distance between the main complaint vector and the sentence pair vector is based on the Euclidean distance Determining the dialogue representation vector corresponding to each round of dialogue in multiple rounds of dialogue includes:
    计算所述主诉向量和每轮对话中每个句对向量两两之间的欧氏距离;Calculate the Euclidean distance between the main complaint vector and each sentence pair vector in each round of dialogue;
    基于所述欧氏距离,确定每个所述句对在对应的一轮对话中的权重;Based on the Euclidean distance, determine the weight of each sentence pair in the corresponding round of dialogue;
    基于所述权重,对每个所述句对向量对应的权重进行加权平均,得到多轮对话中每轮对话对应的对话表征向量。Based on the weights, the weights corresponding to each sentence pair vector are weighted and averaged to obtain a dialogue representation vector corresponding to each round of dialogues in multiple rounds of dialogues.
  5. 根据权利要求1所述的基于对话表征的分诊方法,其中,所述将每轮对话的对话表征向量输入预置分诊模型进行识别,得到分诊信息包括:The method for triage based on dialogue representation according to claim 1, wherein the dialogue representation vector of each round of dialogue is input into a preset triage model for identification, and the triage information obtained comprises:
    基于所述各轮对话对应的对话表征向量,确定所述目标问诊数据中的目标病症信息;Determine the target disease information in the target consultation data based on the dialogue representation vector corresponding to each round of dialogue;
    对所述目标病症信息和所述各轮对话对应的主诉信息进行编码,得到所述目标问诊数据的病症实体向量;Encoding the target disease information and the main complaint information corresponding to each round of dialogue to obtain the disease entity vector of the target consultation data;
    将所述病症实体向量输入预置分诊模型进行预测,得到不同科室的分诊概率;Inputting the disease entity vector into a preset triage model for prediction, and obtaining the triage probability of different departments;
    对所述分诊概率进行排序,得到分诊信息,其中,所述分诊信息包括预设数量个排序最高的推荐科室和所述推荐科室对应的分诊概率。Sorting the triage probabilities to obtain triage information, wherein the triage information includes a preset number of recommended departments with the highest ranking and triage probabilities corresponding to the recommended departments.
  6. 根据权利要求5所述的基于对话表征的分诊方法,其中,在所述将每轮对话的对话表征向量输入预置分诊模型进行识别,得到分诊信息之前,还包括:The method for triage based on dialogue representation according to claim 5, wherein, before the dialogue representation vector of each round of dialogue is input into a preset triage model for identification and triage information is obtained, further comprising:
    从预置数据库中获取历史问诊数据;Obtain historical consultation data from a preset database;
    通过所述目标BERT网络模型对所述历史问诊数据进行表征学习,获取所述历史问诊数据的第二对话表征向量;Perform representation learning on the historical consultation data through the target BERT network model, and obtain a second dialogue representation vector of the historical consultation data;
    获取预设训练病症和与所述训练病症对应的科室标签,基于所述训练病症对预置节点集关联向量进行筛选,获取与所述训练症状对应的目标向量;Obtaining a preset training symptom and a department label corresponding to the training symptom, screening a preset node set association vector based on the training symptom, and obtaining a target vector corresponding to the training symptom;
    对所述第二对话表征向量和所述目标向量进行映射操作,获取对话嵌入向量和目标嵌入向量;performing a mapping operation on the second dialogue representation vector and the target vector to obtain a dialogue embedding vector and a target embedding vector;
    基于所述训练症状对所述对话嵌入向量和所述目标嵌入向量进行拼接,获取拼接向量;splicing the dialogue embedding vector and the target embedding vector based on the training symptom to obtain a splicing vector;
    在卷积层对所述拼接向量进行卷积操作,获取卷积关联向量,将所述卷积关联向量输入输出层,获取预测输出结果;Perform a convolution operation on the splicing vector at the convolution layer to obtain a convolution association vector, input the convolution association vector into the output layer, and obtain a predicted output result;
    基于所述预测输出结果与所述科室标签,计算预测误差损失,并根据所述预测误差损失更新所述目标BERT网络模型的参数,直到所述目标BERT网络模型收敛,获取基于对话表征的分诊模型。Calculate the prediction error loss based on the prediction output result and the department label, and update the parameters of the target BERT network model according to the prediction error loss, until the target BERT network model converges, and obtain the triage based on the dialogue representation Model.
  7. 根据权利要求1所述的基于对话表征的分诊方法,其中,所述对所述问诊数据进行数据清洗,得到目标问诊数据包括:The method for triage based on dialogue representation according to claim 1, wherein said performing data cleaning on said interrogation data to obtain target interrogation data comprises:
    获取所述问诊数据的清洗需求;Obtain the cleaning requirements of the consultation data;
    根据所述问诊数据和所述清洗需求,确定用于对所述问诊数据进行数据清洗的目标清洗规则;According to the consultation data and the cleaning requirement, determine a target cleaning rule for performing data cleaning on the consultation data;
    根据所述目标清洗规则对所述问诊数据进行数据清洗,得到目标问诊数据。Data cleaning is performed on the consultation data according to the target cleaning rule to obtain target consultation data.
  8. 一种基于对话表征的分诊设备,其中,所述基于对话表征的分诊设备包括:存储器和至少一个处理器,所述存储器中存储有指令,所述存储器和所述至少一个处理器通过线路互连;A dialogue characterization-based triage device, wherein the dialogue characterization-based triage device comprises: a memory and at least one processor, wherein the memory stores instructions, and the memory and the at least one processor are connected through a circuit interconnection;
    所述至少一个处理器调用所述存储器中的所述指令,以使得所述基于对话表征的分诊设备执行如下所述的基于对话表征的分诊方法的步骤:The at least one processor invokes the instructions in the memory to cause the dialogue-representation-based triage device to perform the steps of the dialogue-representation-based triage method as described below:
    获取待分诊对象在就诊时产生的多轮对话,并提取多轮对话中的问诊数据;Acquire multiple rounds of dialogues generated by the subject to be triaged when they visit a doctor, and extract the consultation data in the multiple rounds of dialogues;
    对所述问诊数据进行数据清洗,得到目标问诊数据,其中,所述目标问诊数据包括所述用户的主诉信息;Data cleaning is performed on the consultation data to obtain target consultation data, wherein the target consultation data includes the main complaint information of the user;
    对所述目标问诊数据进行意图识别,得到所述目标问诊数据中包含的句对,其中,所述目标问诊数据中包含至少一个句对;performing intention identification on the target medical consultation data to obtain sentence pairs included in the target medical consultation data, wherein the target medical consultation data includes at least one sentence pair;
    调用预置目标BERT网络模型对所述句对和所述主诉信息进行特征提取,得到所述句对的句对向量和所述主诉信息的主诉向量;Call the preset target BERT network model to perform feature extraction on the sentence pair and the main complaint information, and obtain the sentence pair vector of the sentence pair and the main complaint vector of the main complaint information;
    计算所述主诉向量和所述句对向量之间的欧氏距离,并基于所述欧氏距离确定多轮对话中每轮对话对应的对话表征向量;Calculate the Euclidean distance between the main complaint vector and the sentence pair vector, and determine the dialogue representation vector corresponding to each round of dialogue in multiple rounds of dialogue based on the Euclidean distance;
    将每轮对话的对话表征向量输入预置分诊模型进行识别,得到分诊信息。The dialogue representation vector of each round of dialogue is input into the preset triage model for identification, and the triage information is obtained.
  9. 根据权利要求8所述的基于对话表征的分诊设备,其中,所基于对话表征的分诊程序被所述处理器执行实现所述对所述目标问诊数据进行意图识别,得到所述目标问诊数据中包含的句对步骤时,还执行以下步骤:The triage device based on the dialogue representation according to claim 8, wherein the triage procedure based on the dialogue representation is executed by the processor to realize the intention recognition of the target inquiry data to obtain the target inquiry When the sentence pair step included in the diagnostic data is executed, the following steps are also performed:
    根据预设表征规则获取所述目标问诊数据中的所有问答句和与所述问答句对应对象的对象标识;Acquiring all question and answer sentences in the target consultation data and object identifiers of objects corresponding to the question and answer sentences according to preset characterization rules;
    基于各所述对象标识,对所述目标问诊数据中的各问答句分别进行意图识别,得到对应所述问诊数据的意图标识序列;Based on each of the object identifiers, intention identification is performed on each question and answer sentence in the target consultation data, to obtain an intention identification sequence corresponding to the consultation data;
    根据所述意图标识序列,确定对应所述问句的目标答句意图标识;According to the sequence of intent identifiers, determine the intent identifier of the target answer corresponding to the question;
    基于所述目标答句意图标识,得到所述目标问诊数据中包含的句对。Based on the intent identification of the target answer sentence, sentence pairs included in the target consultation data are obtained.
  10. 根据权利要求8所述的基于对话表征的分诊设备,其中,所基于对话表征的分诊程序被所述处理器执行实现所述调用预置目标BERT网络模型对所述句对和所述主诉信息进行特征提取,得到所述句对的句对向量和所述主诉信息的主诉向量的步骤之前,还执行以下步骤:The triage device based on dialogue representation according to claim 8, wherein the triage procedure based on dialogue representation is executed by the processor to realize the call preset target BERT network model for the sentence pair and the main complaint Before the step of performing feature extraction on the information to obtain the sentence pair vector of the sentence pair and the main complaint vector of the main complaint information, the following steps are also performed:
    建立预训练任务,调用预置向量化模型将历史用户问诊数据处理为若干个词向量,其中,所述词向量包括基于所述历史用户问诊数据词向量;Establishing a pre-training task, calling a preset vectorization model to process historical user consultation data into several word vectors, wherein the word vectors include word vectors based on the historical user consultation data;
    将所述若干个词向量输入初始BERT网络模型,获取所述初始BERT网络模型输出的训练表征向量;Input the several word vectors into the initial BERT network model, and obtain the training representation vector output by the initial BERT network model;
    根据所述训练表征向量计算所述初始BERT网络模型的损失值;Calculate the loss value of the initial BERT network model according to the training characterization vector;
    根据所述初始BERT网络模型的损失值,调整所述初始BERT网络模型的模型参数,得到目标BERT网络模型。According to the loss value of the initial BERT network model, the model parameters of the initial BERT network model are adjusted to obtain the target BERT network model.
  11. 根据权利要求8-9中任一项所述的基于对话表征的分诊设备,其中,所基于对话表征的分诊程序被所述处理器执行实现所述计算所述主诉向量和所述句对向量之间的欧氏距离,并基于所述欧氏距离确定多轮对话中每轮对话对应的对话表征向量步骤时,还执行以下步骤:The dialogue-representation-based triage device according to any one of claims 8-9, wherein the dialogue-representation-based triage procedure is executed by the processor to realize the calculation of the main complaint vector and the sentence pair Euclidean distance between vectors, and when determining the dialogue representation vector step corresponding to each round of dialogue in multiple rounds of dialogue based on the Euclidean distance, the following steps are also performed:
    计算所述主诉向量和每轮对话中每个句对向量两两之间的欧氏距离;Calculate the Euclidean distance between the main complaint vector and each sentence pair vector in each round of dialogue;
    基于所述欧氏距离,确定每个所述句对在对应的一轮对话中的权重;Based on the Euclidean distance, determine the weight of each sentence pair in the corresponding round of dialogue;
    基于所述权重,对每个所述句对向量对应的权重进行加权平均,得到多轮对话中每轮对话对应的对话表征向量。Based on the weights, the weights corresponding to each sentence pair vector are weighted and averaged to obtain a dialogue representation vector corresponding to each round of dialogues in multiple rounds of dialogues.
  12. 根据权利要求8所述的基于对话表征的分诊设备,其中,所基于对话表征的分诊程序被所述处理器执行实现所述将每轮对话的对话表征向量输入预置分诊模型进行识别,得到分诊信息步骤时,还执行以下步骤:The dialogue representation-based triage device according to claim 8, wherein the dialogue representation-based triage procedure is executed by the processor to realize the input of the dialogue representation vector of each round of dialogue into a preset triage model for identification. , when the triage information step is obtained, the following steps are also performed:
    基于所述各轮对话对应的对话表征向量,确定所述目标问诊数据中的目标病症信息;Determine the target disease information in the target consultation data based on the dialogue representation vector corresponding to each round of dialogue;
    对所述目标病症信息和所述各轮对话对应的主诉信息进行编码,得到所述目标问诊数据的病症实体向量;Encoding the target disease information and the main complaint information corresponding to each round of dialogue to obtain the disease entity vector of the target consultation data;
    将所述病症实体向量输入预置分诊模型进行预测,得到不同科室的分诊概率;Inputting the disease entity vector into a preset triage model for prediction, and obtaining the triage probability of different departments;
    对所述分诊概率进行排序,得到分诊信息,其中,所述分诊信息包括预设数量个排序最高的推荐科室和所述推荐科室对应的分诊概率。Sorting the triage probabilities to obtain triage information, wherein the triage information includes a preset number of recommended departments with the highest ranking and triage probabilities corresponding to the recommended departments.
  13. 根据权利要求12所述的基于对话表征的分诊设备,其中,所基于对话表征的分诊程序被所述处理器执行实现所述将每轮对话的对话表征向量输入预置分诊模型进行识别,得到分诊信息的步骤之前,还执行以下步骤:The dialogue representation-based triage device according to claim 12, wherein the dialogue representation-based triage procedure is executed by the processor to realize the input of the dialogue representation vector of each round of dialogue into a preset triage model for identification. , before the steps to obtain triage information, also perform the following steps:
    从预置数据库中获取历史问诊数据;Obtain historical consultation data from a preset database;
    通过所述目标BERT网络模型对所述历史问诊数据进行表征学习,获取所述历史问诊数据的第二对话表征向量;Perform representation learning on the historical consultation data through the target BERT network model, and obtain a second dialogue representation vector of the historical consultation data;
    获取预设训练病症和与所述训练病症对应的科室标签,基于所述训练病症对预置节点集关联向量进行筛选,获取与所述训练症状对应的目标向量;Obtaining a preset training symptom and a department label corresponding to the training symptom, screening a preset node set association vector based on the training symptom, and obtaining a target vector corresponding to the training symptom;
    对所述第二对话表征向量和所述目标向量进行映射操作,获取对话嵌入向量和目标嵌入向量;performing a mapping operation on the second dialogue representation vector and the target vector to obtain a dialogue embedding vector and a target embedding vector;
    基于所述训练症状对所述对话嵌入向量和所述目标嵌入向量进行拼接,获取拼接向量;splicing the dialogue embedding vector and the target embedding vector based on the training symptom to obtain a splicing vector;
    在卷积层对所述拼接向量进行卷积操作,获取卷积关联向量,将所述卷积关联向量输入输出层,获取预测输出结果;Perform a convolution operation on the splicing vector at the convolution layer to obtain a convolution association vector, input the convolution association vector into the output layer, and obtain a predicted output result;
    基于所述预测输出结果与所述科室标签,计算预测误差损失,并根据所述预测误差损失更新所述目标BERT网络模型的参数,直到所述目标BERT网络模型收敛,获取基于对 话表征的分诊模型。Calculate the prediction error loss based on the prediction output result and the department label, and update the parameters of the target BERT network model according to the prediction error loss, until the target BERT network model converges, and obtain the triage based on the dialogue representation Model.
  14. 一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,其中,所述计算机程序被处理器执行时实现如下所述的基于对话表征的分诊方法的步骤:A computer-readable storage medium on which a computer program is stored, wherein, when the computer program is executed by a processor, the steps of the method for triage based on dialogue characterization as described below are implemented:
    获取待分诊对象在就诊时产生的多轮对话,并提取多轮对话中的问诊数据;Acquire multiple rounds of dialogues generated by the subject to be triaged when they visit a doctor, and extract the consultation data in the multiple rounds of dialogues;
    对所述问诊数据进行数据清洗,得到目标问诊数据,其中,所述目标问诊数据包括所述用户的主诉信息;Data cleaning is performed on the consultation data to obtain target consultation data, wherein the target consultation data includes the main complaint information of the user;
    对所述目标问诊数据进行意图识别,得到所述目标问诊数据中包含的句对,其中,所述目标问诊数据中包含至少一个句对;performing intention identification on the target medical consultation data to obtain sentence pairs included in the target medical consultation data, wherein the target medical consultation data includes at least one sentence pair;
    调用预置目标BERT网络模型对所述句对和所述主诉信息进行特征提取,得到所述句对的句对向量和所述主诉信息的主诉向量;Call the preset target BERT network model to perform feature extraction on the sentence pair and the main complaint information, and obtain the sentence pair vector of the sentence pair and the main complaint vector of the main complaint information;
    计算所述主诉向量和所述句对向量之间的欧氏距离,并基于所述欧氏距离确定多轮对话中每轮对话对应的对话表征向量;Calculate the Euclidean distance between the main complaint vector and the sentence pair vector, and determine the dialogue representation vector corresponding to each round of dialogue in multiple rounds of dialogue based on the Euclidean distance;
    将每轮对话的对话表征向量输入预置分诊模型进行识别,得到分诊信息。The dialogue representation vector of each round of dialogue is input into the preset triage model for identification, and the triage information is obtained.
  15. 根据权利要求14所述的计算机可读存储介质,其中,所述计算机程序被处理器执行所述对所述目标问诊数据进行意图识别,得到所述目标问诊数据中包含的句对的步骤时,还执行如下步骤:The computer-readable storage medium according to claim 14, wherein the computer program is executed by the processor to perform the step of recognizing the intent of the target interview data to obtain sentence pairs included in the target interview data , also perform the following steps:
    根据预设表征规则获取所述目标问诊数据中的所有问答句和与所述问答句对应对象的对象标识;Acquiring all question and answer sentences in the target consultation data and object identifiers of objects corresponding to the question and answer sentences according to preset characterization rules;
    基于各所述对象标识,对所述目标问诊数据中的各问答句分别进行意图识别,得到对应所述问诊数据的意图标识序列;Based on each of the object identifiers, intention identification is performed on each question and answer sentence in the target consultation data, to obtain an intention identification sequence corresponding to the consultation data;
    根据所述意图标识序列,确定对应所述问句的目标答句意图标识;According to the sequence of intent identifiers, determine the intent identifier of the target answer corresponding to the question;
    基于所述目标答句意图标识,得到所述目标问诊数据中包含的句对。Based on the intent identification of the target answer sentence, sentence pairs included in the target consultation data are obtained.
  16. 根据权利要求14所述的计算机可读存储介质,其中,所述计算机程序被处理器执行所述调用预置目标BERT网络模型对所述句对和所述主诉信息进行特征提取,得到所述句对的句对向量和所述主诉信息的主诉向量的步骤之前,还执行以下步骤:The computer-readable storage medium according to claim 14, wherein the computer program is executed by the processor to perform the call preset target BERT network model to perform feature extraction on the sentence pair and the main complaint information to obtain the sentence Before the step of pairing the sentence pair vector and the main complaint vector of the main complaint information, the following steps are also performed:
    建立预训练任务,调用预置向量化模型将历史用户问诊数据处理为若干个词向量,其中,所述词向量包括基于所述历史用户问诊数据词向量;Establishing a pre-training task, calling a preset vectorization model to process historical user consultation data into several word vectors, wherein the word vectors include word vectors based on the historical user consultation data;
    将所述若干个词向量输入初始BERT网络模型,获取所述初始BERT网络模型输出的训练表征向量;Input the several word vectors into the initial BERT network model, and obtain the training representation vector output by the initial BERT network model;
    根据所述训练表征向量计算所述初始BERT网络模型的损失值;Calculate the loss value of the initial BERT network model according to the training characterization vector;
    根据所述初始BERT网络模型的损失值,调整所述初始BERT网络模型的模型参数,得到目标BERT网络模型。According to the loss value of the initial BERT network model, the model parameters of the initial BERT network model are adjusted to obtain the target BERT network model.
  17. 根据权利要求14-15中任一项所述的计算机可读存储介质,其中,所述计算机程序被处理器执行所述计算所述主诉向量和所述句对向量之间的欧氏距离,并基于所述欧氏距离确定多轮对话中每轮对话对应的对话表征向量的步骤时,还执行如下步骤:The computer-readable storage medium of any one of claims 14-15, wherein the computer program is executed by a processor to calculate the Euclidean distance between the main complaint vector and the sentence pair vector, and When determining the dialogue characterization vector corresponding to each round of dialogue in the multi-round dialogue based on the Euclidean distance, the following steps are also performed:
    计算所述主诉向量和每轮对话中每个句对向量两两之间的欧氏距离;Calculate the Euclidean distance between the main complaint vector and each sentence pair vector in each round of dialogue;
    基于所述欧氏距离,确定每个所述句对在对应的一轮对话中的权重;Based on the Euclidean distance, determine the weight of each sentence pair in the corresponding round of dialogue;
    基于所述权重,对每个所述句对向量对应的权重进行加权平均,得到多轮对话中每轮对话对应的对话表征向量。Based on the weights, the weights corresponding to each sentence pair vector are weighted and averaged to obtain a dialogue representation vector corresponding to each round of dialogues in multiple rounds of dialogues.
  18. 根据权利要求14所述的计算机可读存储介质,其中,所述计算机程序被处理器执行所述将每轮对话的对话表征向量输入预置分诊模型进行识别,得到分诊信息的步骤时,还执行如下步骤:The computer-readable storage medium according to claim 14, wherein, when the computer program is executed by the processor of the step of inputting the dialogue representation vector of each round of dialogue into a preset triage model for identification and obtaining triage information, Also perform the following steps:
    基于所述各轮对话对应的对话表征向量,确定所述目标问诊数据中的目标病症信息;Determine the target disease information in the target consultation data based on the dialogue representation vector corresponding to each round of dialogue;
    对所述目标病症信息和所述各轮对话对应的主诉信息进行编码,得到所述目标问诊数据的病症实体向量;Encoding the target disease information and the main complaint information corresponding to each round of dialogue to obtain the disease entity vector of the target consultation data;
    将所述病症实体向量输入预置分诊模型进行预测,得到不同科室的分诊概率;Inputting the disease entity vector into a preset triage model for prediction, and obtaining the triage probability of different departments;
    对所述分诊概率进行排序,得到分诊信息,其中,所述分诊信息包括预设数量个排序最高的推荐科室和所述推荐科室对应的分诊概率。Sorting the triage probabilities to obtain triage information, wherein the triage information includes a preset number of recommended departments with the highest ranking and triage probabilities corresponding to the recommended departments.
  19. 根据权利要求18所述的计算机可读存储介质,其中,所述计算机程序被处理器执行所述将每轮对话的对话表征向量输入预置分诊模型进行识别,得到分诊信息的步骤之前,还执行以下步骤:The computer-readable storage medium according to claim 18, wherein before the computer program is executed by the processor, the step of inputting the dialogue representation vector of each round of dialogue into a preset triage model for identification and obtaining triage information, Also perform the following steps:
    从预置数据库中获取历史问诊数据;Obtain historical consultation data from a preset database;
    通过所述目标BERT网络模型对所述历史问诊数据进行表征学习,获取所述历史问诊数据的第二对话表征向量;Perform representation learning on the historical consultation data through the target BERT network model, and obtain a second dialogue representation vector of the historical consultation data;
    获取预设训练病症和与所述训练病症对应的科室标签,基于所述训练病症对预置节点集关联向量进行筛选,获取与所述训练症状对应的目标向量;Obtaining a preset training symptom and a department label corresponding to the training symptom, screening a preset node set association vector based on the training symptom, and obtaining a target vector corresponding to the training symptom;
    对所述第二对话表征向量和所述目标向量进行映射操作,获取对话嵌入向量和目标嵌入向量;performing a mapping operation on the second dialogue representation vector and the target vector to obtain a dialogue embedding vector and a target embedding vector;
    基于所述训练症状对所述对话嵌入向量和所述目标嵌入向量进行拼接,获取拼接向量;splicing the dialogue embedding vector and the target embedding vector based on the training symptom to obtain a splicing vector;
    在卷积层对所述拼接向量进行卷积操作,获取卷积关联向量,将所述卷积关联向量输入输出层,获取预测输出结果;Perform a convolution operation on the splicing vector at the convolution layer to obtain a convolution association vector, input the convolution association vector into the output layer, and obtain a predicted output result;
    基于所述预测输出结果与所述科室标签,计算预测误差损失,并根据所述预测误差损失更新所述目标BERT网络模型的参数,直到所述目标BERT网络模型收敛,获取基于对话表征的分诊模型。Calculate the prediction error loss based on the prediction output result and the department label, and update the parameters of the target BERT network model according to the prediction error loss, until the target BERT network model converges, and obtain the triage based on the dialogue representation Model.
  20. 一种基于对话表征的分诊装置,其中,所述基于对话表征的分诊装置包括:A triage device based on dialogue representation, wherein the triage device based on dialogue representation comprises:
    第一获取模块,用于获取待分诊对象在就诊时产生的多轮对话,并提取多轮对话中的问诊数据;The first acquisition module is used for acquiring multiple rounds of dialogues generated by the subject to be triaged when visiting a doctor, and extracting the consultation data in the multiple rounds of dialogues;
    数据清洗模块,用于对所述问诊数据进行数据清洗,得到目标问诊数据,其中,所述目标问诊数据包括所述用户的主诉信息;a data cleaning module, configured to perform data cleaning on the consultation data to obtain target consultation data, wherein the target consultation data includes the main complaint information of the user;
    意图识别模块,用于对所述目标问诊数据进行意图识别,得到所述目标问诊数据中包含的句对,其中,所述目标问诊数据中包含至少一个句对;an intention recognition module, configured to perform intention recognition on the target consultation data to obtain sentence pairs included in the target consultation data, wherein the target consultation data includes at least one sentence pair;
    特征提取模块,用于调用预置目标BERT网络模型对所述句对和所述主诉信息进行特征提取,得到所述句对的句对向量和所述主诉信息的主诉向量;The feature extraction module is used to call the preset target BERT network model to perform feature extraction on the sentence pair and the main complaint information, and obtain the sentence pair vector of the sentence pair and the main complaint vector of the main complaint information;
    第一计算模块,用于计算所述主诉向量和所述句对向量之间的欧氏距离,并基于所述欧氏距离确定多轮对话中每轮对话对应的对话表征向量;a first calculation module, used for calculating the Euclidean distance between the main complaint vector and the sentence pair vector, and determining the dialogue representation vector corresponding to each round of dialogue in multiple rounds of dialogues based on the Euclidean distance;
    识别模块,用于将每轮对话的对话表征向量输入预置分诊模型进行识别,得到分诊信息。The identification module is used to input the dialogue representation vector of each round of dialogue into the preset triage model for identification, and obtain triage information.
PCT/CN2021/097183 2021-04-30 2021-05-31 Triage method, apparatus and device based on dialogue representation, and storage medium WO2022227203A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110489044.5 2021-04-30
CN202110489044.5A CN113223735A (en) 2021-04-30 2021-04-30 Triage method, device and equipment based on session representation and storage medium

Publications (1)

Publication Number Publication Date
WO2022227203A1 true WO2022227203A1 (en) 2022-11-03

Family

ID=77091080

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/097183 WO2022227203A1 (en) 2021-04-30 2021-05-31 Triage method, apparatus and device based on dialogue representation, and storage medium

Country Status (2)

Country Link
CN (1) CN113223735A (en)
WO (1) WO2022227203A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116913527A (en) * 2023-09-14 2023-10-20 北京健康有益科技有限公司 Hypertension evaluation method and system based on multi-round dialogue frame
CN117235239A (en) * 2023-11-13 2023-12-15 智慧眼科技股份有限公司 Active dialogue large model construction device, method, equipment and storage medium

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115631852B (en) * 2022-11-02 2024-04-09 北京大学重庆大数据研究院 Certificate type recommendation method and device, electronic equipment and nonvolatile storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109147930A (en) * 2017-06-28 2019-01-04 京东方科技集团股份有限公司 Divide and examines dialogue method, divides and examine conversational device and system
CN110838359A (en) * 2019-10-16 2020-02-25 平安科技(深圳)有限公司 Triage method and device based on conversation robot, storage medium and robot
US20200211709A1 (en) * 2018-12-27 2020-07-02 MedWhat.com Inc. Method and system to provide medical advice to a user in real time based on medical triage conversation
CN111477310A (en) * 2020-03-04 2020-07-31 平安国际智慧城市科技股份有限公司 Triage data processing method and device, computer equipment and storage medium
CN111984763A (en) * 2020-08-28 2020-11-24 海信电子科技(武汉)有限公司 Question answering processing method and intelligent equipment
CN112016295A (en) * 2020-09-04 2020-12-01 平安科技(深圳)有限公司 Symptom data processing method and device, computer equipment and storage medium
CN112035610A (en) * 2020-08-28 2020-12-04 康键信息技术(深圳)有限公司 Medical field question and answer pair generation method and device, computer equipment and medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110197730A (en) * 2019-04-28 2019-09-03 平安科技(深圳)有限公司 A kind of method, apparatus of intelligent diagnosis, electronic equipment and storage medium
CN111159332A (en) * 2019-12-03 2020-05-15 厦门快商通科技股份有限公司 Text multi-intention identification method based on bert
CN111709233B (en) * 2020-05-27 2023-04-18 西安交通大学 Intelligent diagnosis guiding method and system based on multi-attention convolutional neural network
CN112015917A (en) * 2020-09-07 2020-12-01 平安科技(深圳)有限公司 Data processing method and device based on knowledge graph and computer equipment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109147930A (en) * 2017-06-28 2019-01-04 京东方科技集团股份有限公司 Divide and examines dialogue method, divides and examine conversational device and system
US20200211709A1 (en) * 2018-12-27 2020-07-02 MedWhat.com Inc. Method and system to provide medical advice to a user in real time based on medical triage conversation
CN110838359A (en) * 2019-10-16 2020-02-25 平安科技(深圳)有限公司 Triage method and device based on conversation robot, storage medium and robot
CN111477310A (en) * 2020-03-04 2020-07-31 平安国际智慧城市科技股份有限公司 Triage data processing method and device, computer equipment and storage medium
CN111984763A (en) * 2020-08-28 2020-11-24 海信电子科技(武汉)有限公司 Question answering processing method and intelligent equipment
CN112035610A (en) * 2020-08-28 2020-12-04 康键信息技术(深圳)有限公司 Medical field question and answer pair generation method and device, computer equipment and medium
CN112016295A (en) * 2020-09-04 2020-12-01 平安科技(深圳)有限公司 Symptom data processing method and device, computer equipment and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116913527A (en) * 2023-09-14 2023-10-20 北京健康有益科技有限公司 Hypertension evaluation method and system based on multi-round dialogue frame
CN116913527B (en) * 2023-09-14 2023-12-05 北京健康有益科技有限公司 Hypertension evaluation method and system based on multi-round dialogue frame
CN117235239A (en) * 2023-11-13 2023-12-15 智慧眼科技股份有限公司 Active dialogue large model construction device, method, equipment and storage medium
CN117235239B (en) * 2023-11-13 2024-02-20 智慧眼科技股份有限公司 Active dialogue large model construction device, method, equipment and storage medium

Also Published As

Publication number Publication date
CN113223735A (en) 2021-08-06

Similar Documents

Publication Publication Date Title
CN107516110B (en) Medical question-answer semantic clustering method based on integrated convolutional coding
WO2020019686A1 (en) Session interaction method and apparatus
CN110442869B (en) Medical text processing method and device, equipment and storage medium thereof
WO2022227203A1 (en) Triage method, apparatus and device based on dialogue representation, and storage medium
CN112131393B (en) Medical knowledge graph question-answering system construction method based on BERT and similarity algorithm
CN111274365B (en) Intelligent inquiry method and device based on semantic understanding, storage medium and server
CN110675944A (en) Triage method and device, computer equipment and medium
WO2023029506A1 (en) Illness state analysis method and apparatus, electronic device, and storage medium
CN109378066A (en) A kind of control method and control device for realizing disease forecasting based on feature vector
WO2023178971A1 (en) Internet registration method, apparatus and device for seeking medical advice, and storage medium
CN112016295A (en) Symptom data processing method and device, computer equipment and storage medium
US11354599B1 (en) Methods and systems for generating a data structure using graphical models
CN111370102A (en) Department diagnosis guiding method, device and equipment
WO2024001104A1 (en) Image-text data mutual-retrieval method and apparatus, and device and readable storage medium
CN113409907A (en) Intelligent pre-inquiry method and system based on Internet hospital
CN111651579B (en) Information query method, device, computer equipment and storage medium
CN113764112A (en) Online medical question and answer method
CN115274086A (en) Intelligent diagnosis guiding method and system
CN112035627B (en) Automatic question and answer method, device, equipment and storage medium
CN113536784A (en) Text processing method and device, computer equipment and storage medium
CN116719840A (en) Medical information pushing method based on post-medical-record structured processing
CN115964475A (en) Dialogue abstract generation method for medical inquiry
CN111339252B (en) Searching method, searching device and storage medium
CN113761899A (en) Medical text generation method, device, equipment and storage medium
CN115132372A (en) Term processing method, apparatus, electronic device, storage medium, and program product

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21938673

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21938673

Country of ref document: EP

Kind code of ref document: A1