Search

CN-117390162-B - Medicine knowledge question-answering method, device, storage medium and equipment

CN117390162BCN 117390162 BCN117390162 BCN 117390162BCN-117390162-B

Abstract

The application discloses a medicine knowledge question and answer method, a device, a storage medium and equipment, wherein the method comprises the steps of firstly decomposing a target medicine question text to obtain N target sub-question texts, extracting medicine entities from the N target sub-question texts, then splicing the N target sub-question texts in pairs to obtain each medicine entity and each target sub-question pair, carrying out intention classification on the first intention classification result of each medicine entity and each target sub-question pair to obtain a first intention classification result of each medicine entity, carrying out intention classification on the target sub-questions in each medicine entity and the target sub-question pair by using preset medicine rules to obtain a second intention classification result of each medicine entity, combining the second intention classification result with the first intention classification result to obtain an intention classification result of each medicine entity, carrying out knowledge retrieval by using a medicine instruction and/or a preset medicine knowledge base, and inputting the retrieved knowledge combination prompt instruction into a preset large language model to obtain more accurate answer content which is output by the model and aims at the target medicine question text.

Inventors

  • DU QIANYUN
  • HU GUOPING
  • WANG JUNWEN
  • HU JIAXUE
  • ZHAO JINGHE
  • HE ZHIYANG
  • LU XIAOLIANG
  • WANG SHIJIN
  • WEI SI
  • LIU CONG

Assignees

  • 讯飞医疗科技股份有限公司

Dates

Publication Date
20260505
Application Date
20231023

Claims (8)

  1. 1. A method of medication knowledge question answering, comprising: The method comprises the steps of obtaining target medicine question texts to be replied, decomposing the target medicine question texts to obtain N target sub-question texts, extracting pharmaceutical entities from the N target sub-question texts to obtain pharmaceutical entities in the N target sub-question texts, wherein N is a positive integer greater than 0, and the pharmaceutical entities comprise pharmaceutical entities, disease entities and symptom entities; Splicing the pharmaceutical entities and the N target sub-questions in pairs to obtain each pharmaceutical entity and target sub-question pair, and carrying out intention classification on each pharmaceutical entity and target sub-question pair to obtain a first intention classification result of each pharmaceutical entity; Carrying out intention classification on target sub-questions in the pair of each pharmaceutical entity and the target sub-questions by using a preset pharmaceutical rule to obtain a second intention classification result of each pharmaceutical entity; according to the intention classification result of each pharmaceutical entity, carrying out knowledge retrieval by using a pharmaceutical specification and/or a preset pharmaceutical knowledge base, and inputting the retrieved knowledge in combination with a prompt instruction prompt into a preset large language model to obtain the reply content of the text aiming at the target pharmaceutical problem output by the large language model; the method for classifying intention of the target sub-problem in the pair of each pharmaceutical entity and the target sub-problem by using the preset pharmaceutical rule, to obtain a second intention classification result of each pharmaceutical entity, includes: Extracting patient information entities from the N target sub-problem texts to obtain patient information entities in the N target sub-problem texts, and constructing a patient portrait by utilizing the patient information entities and pharmaceutical entities; Analyzing and physically comparing the patient portraits by utilizing reasoning logic which is constructed in advance according to doctor experience and combining a medicine knowledge base to obtain a conclusion whether each medicine should be used or not; and determining the content of the knowledge recommendation for the judged corresponding medicine according to the conclusion of whether each medicine should be used or not, and taking the recommended knowledge content as a second intention classification result of the corresponding medicine entity.
  2. 2. The method of claim 1, wherein decomposing the target medication question text to obtain N target sub-question texts comprises: Decomposing the target medicine problem text by utilizing a preset large language model in combination with a sub-problem splitting prompt instruction prompt to obtain N target sub-problem texts; the large language model is obtained by training language rules and modes through an autoregressive generation mode by utilizing a large-scale language data set.
  3. 3. The method according to claim 2, wherein the performing knowledge retrieval using a drug specification and/or a preset drug knowledge base according to the intent classification result of each of the pharmaceutical entities comprises: performing entity alignment and entity disambiguation on each pharmaceutical entity by using a pharmaceutical specification and/or a preset pharmaceutical knowledge base to obtain corresponding medicine universal names, disease standard words and symptom standard words; And inquiring unstructured knowledge, semi-structured knowledge and structured knowledge in a drug instruction book and/or a preset drug knowledge base according to the intention classification result of each pharmaceutical entity, and taking the unstructured knowledge, the semi-structured knowledge and the structured knowledge as search results.
  4. 4. A method according to claim 3, wherein said querying unstructured knowledge, semi-structured knowledge and structured knowledge in the drug specifications and/or a preset drug knowledge base according to the intended classification result of each of said pharmaceutical entities comprises, as search results: according to the intention classification result of the drug entity, inquiring unstructured knowledge in the drug instruction book as a retrieval result; and/or inquiring the structured knowledge in a preset medicine knowledge base as a retrieval result according to the intention classification result of the disease entity; and/or, according to the intention classification result of each pharmaceutical entity, inquiring unstructured knowledge in a preset pharmaceutical knowledge base based on sparse representation, and taking the unstructured knowledge as a retrieval result.
  5. 5. The method according to any one of claims 1-4, wherein when knowledge is retrieved using a drug specification and/or a preset drug knowledge base according to the intended classification result of each of the pharmaceutical entities, the method further comprises, when knowledge is not retrieved: And carrying out knowledge searching through a preset network search engine, and positioning knowledge contents in the search results by utilizing the large language model.
  6. 6. A medication knowledge question-answering apparatus, comprising: The system comprises an acquisition unit, a pharmaceutical entity extraction unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring target medicine question texts to be replied, decomposing the target medicine question texts to obtain N target sub-question texts, extracting pharmaceutical entities from the N target sub-question texts to obtain pharmaceutical entities in the N target sub-question texts, wherein N is a positive integer greater than 0, and the pharmaceutical entities comprise pharmaceutical entities, disease entities and symptom entities; the first classification unit is used for splicing the pharmaceutical entities and the N target sub-questions in pairs to obtain each pharmaceutical entity and target sub-question pair, and carrying out intention classification on each pharmaceutical entity and target sub-question pair to obtain a first intention classification result of each pharmaceutical entity; The second classification unit is used for carrying out intention classification on target sub-questions in the pair of each pharmaceutical entity and the target sub-questions by utilizing a preset pharmaceutical rule to obtain a second intention classification result of each pharmaceutical entity; the retrieval unit is used for carrying out knowledge retrieval by utilizing a drug instruction book and/or a preset drug knowledge base according to the intention classification result of each pharmaceutical entity, and inputting the retrieved knowledge into a preset large language model in combination with a prompt instruction prompt to obtain the reply content which is output by the large language model and aims at the target drug problem text; the second classification unit includes: The extraction subunit is used for extracting the patient information entities from the N target sub-problem texts to obtain the patient information entities in the N target sub-problem texts, and constructing a patient portrait by utilizing the patient information entities and the pharmaceutical entities; The comparison subunit is used for analyzing and physically comparing the patient portraits by utilizing reasoning logic which is built in advance according to the experience of doctors and combining a medicine knowledge base to obtain a conclusion whether each medicine should be used; And the determining subunit is used for determining the content for recommending the knowledge for the judged corresponding medicine according to the conclusion of whether each medicine should be used or not, and taking the recommended knowledge content as a second intention classification result of the corresponding medicine entity.
  7. 7. The medicine knowledge question-answering device is characterized by comprising a processor, a memory and a system bus; the processor and the memory are connected through the system bus; The memory is for storing one or more programs, the one or more programs comprising instructions, which when executed by the processor, cause the processor to perform the method of any of claims 1-5.
  8. 8. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein instructions, which when run on a terminal device, cause the terminal device to perform the method of any of claims 1-5.

Description

Medicine knowledge question-answering method, device, storage medium and equipment Technical Field The present application relates to the field of natural language processing technologies, and in particular, to a method, an apparatus, a storage medium, and a device for a medicine knowledge question-answering. Background With the rapid development of information technologies such as artificial intelligence and the Internet of things, application scenes of human-computer interaction are wider and wider. Various intelligent interaction software and devices appear in life and work of people, such as chat generation pre-training converters (CHAT GENERATIVE PRE-trained Transformer, chatGPT for short), intelligent sound boxes, intelligent televisions and the like, and can provide intelligent interaction functions of numerous application scenes such as information inquiry, knowledge question answering and the like for people so as to assist users to complete various behavior intentions. At present, consultation for problems related to medicines of intelligent interaction software or equipment (such as intelligent sound boxes, intelligent televisions and the like) input by users often requires giving corresponding medication basis, otherwise, the given reply is difficult to have confidence. Therefore, a reasonable medication plug-in is required to be introduced to provide key knowledge information for the reply of the medication problem and provide a reference basis for a conclusion, but the conventional large-model medication knowledge question-answering plug-in scheme generally processes knowledge content in a manner of slicing and searching a knowledge document, and the problems of incomplete knowledge segments or knowledge undersegmentation and the like possibly exist, so that the quality of knowledge content cannot be ensured, the reply accuracy of the medication knowledge problem is reduced, and the interactive experience of a user is further reduced. Disclosure of Invention The embodiment of the application mainly aims to provide a medicine knowledge question-answering method, a device, a storage medium and equipment, which can improve the answer accuracy of medicine-related questions input by a user into intelligent interaction software or equipment, and further improve the interaction experience of the user. The embodiment of the application provides a multi-drug knowledge question-answering method, which comprises the following steps: The method comprises the steps of obtaining target medicine question text to be replied, decomposing the target medicine question text to obtain N target sub-question texts, extracting pharmaceutical entities from the N target sub-question texts to obtain pharmaceutical entities in the N target sub-question texts, wherein N is a positive integer greater than 0; Splicing the pharmaceutical entities and the N target sub-questions in pairs to obtain each pharmaceutical entity and target sub-question pair, and carrying out intention classification on each pharmaceutical entity and target sub-question pair to obtain a first intention classification result of each pharmaceutical entity; Carrying out intention classification on target sub-questions in the pair of each pharmaceutical entity and the target sub-questions by using a preset pharmaceutical rule to obtain a second intention classification result of each pharmaceutical entity; According to the intention classification result of each pharmaceutical entity, carrying out knowledge retrieval by using a pharmaceutical specification and/or a preset pharmaceutical knowledge base, and inputting the retrieved knowledge in combination with a prompt instruction prompt into a preset large language model to obtain the reply content of the target pharmaceutical question text output by the large language model. In a possible implementation manner, the decomposing the target drug question text to obtain N target sub-question texts includes: Decomposing the target medicine problem text by utilizing a preset large language model in combination with a sub-problem splitting prompt instruction prompt to obtain N target sub-problem texts; the large language model is obtained by training language rules and modes through an autoregressive generation mode by utilizing a large-scale language data set. In one possible implementation, the pharmaceutical entities include pharmaceutical entities, disease entities, and symptom entities. In a possible implementation manner, the performing, by using a preset pharmaceutical rule, the intention classification on the target sub-problem in the pair of each pharmaceutical entity and the target sub-problem to obtain a second intention classification result of each pharmaceutical entity includes: Extracting patient information entities from the N target sub-problem texts to obtain patient information entities in the N target sub-problem texts, and constructing a patient portrait by utilizing the patient informati