WO2023029512A1 - Knowledge graph-based medical question answering method and apparatus, device and medium - Google Patents

Knowledge graph-based medical question answering method and apparatus, device and medium Download PDF

Info

Publication number
WO2023029512A1
WO2023029512A1 PCT/CN2022/087817 CN2022087817W WO2023029512A1 WO 2023029512 A1 WO2023029512 A1 WO 2023029512A1 CN 2022087817 W CN2022087817 W CN 2022087817W WO 2023029512 A1 WO2023029512 A1 WO 2023029512A1
Authority
WO
WIPO (PCT)
Prior art keywords
entity
user query
relationship
entities
original
Prior art date
Application number
PCT/CN2022/087817
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 WO2023029512A1 publication Critical patent/WO2023029512A1/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
    • G16H50/00ICT specially adapted for medical diagnosis, medical simulation or medical data mining; ICT specially adapted for detecting, monitoring or modelling epidemics or pandemics
    • G16H50/20ICT specially adapted for medical diagnosis, medical simulation or medical data mining; ICT specially adapted for detecting, monitoring or modelling epidemics or pandemics for computer-aided diagnosis, e.g. based on medical expert systems
    • 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/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • 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
    • 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/3346Query execution using probabilistic model
    • 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/35Clustering; Classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2415Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on parametric or probabilistic models, e.g. based on likelihood ratio or false acceptance rate versus a false rejection rate
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • G06F40/216Parsing using statistical methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • G06F40/295Named entity recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/047Probabilistic or stochastic networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/048Activation functions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Definitions

  • the present application relates to the technical field of artificial intelligence, and in particular to a method, device, electronic device and computer-readable storage medium for answering medical questions based on knowledge graphs.
  • Medical intelligent question and answer refers to the automatic search, processing, and processing of the user's medical questions to obtain answers that can answer the user's questions.
  • This application provides a method for answering medical questions based on knowledge graphs, including:
  • a pre-built medical knowledge map is obtained, and an answer corresponding to the original user query statement is indexed in the medical knowledge map according to the scene category.
  • the present application also provides a medical question answering device based on a knowledge graph, the device comprising:
  • the entity relationship extraction module is used to obtain the original user query statement, and use the preset entity relationship joint extraction model to perform entity relationship extraction on the original user query statement to obtain the entity and the relationship between the entities;
  • An intent recognition module configured to input the original user query sentence into a preset intent recognition model for intent recognition, and obtain an intent recognition result
  • a scene classification module configured to classify the scene of the original user query statement according to the entity, the relationship between the entities and the intention recognition result, and obtain the scene category corresponding to the original user query statement;
  • An answer indexing module configured to obtain a pre-built medical knowledge map, and index the answer corresponding to the original user query statement in the medical knowledge map according to the scene category.
  • the present application also provides an electronic device, the electronic device comprising:
  • the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor, so that the at least one processor can perform the following knowledge map-based medical treatment Question answer method:
  • a pre-built medical knowledge map is obtained, and an answer corresponding to the original user query statement is indexed in the medical knowledge map according to the scene category.
  • the present application also provides a computer-readable storage medium, at least one computer program is stored in the computer-readable storage medium, and the at least one computer program is executed by a processor in an electronic device to realize the following knowledge graph-based Methods of answering medical questions:
  • a pre-built medical knowledge map is obtained, and an answer corresponding to the original user query statement is indexed in the medical knowledge map according to the scene category.
  • FIG. 1 is a schematic flow diagram of a method for answering medical questions based on knowledge graphs provided by an embodiment of the present application
  • FIG. 2 is a functional block diagram of a medical question answering device based on a knowledge map provided by an embodiment of the present application
  • FIG. 3 is a schematic structural diagram of an electronic device implementing the knowledge graph-based medical question answering method provided by an embodiment of the present application.
  • An embodiment of the present application provides a method for answering medical questions based on a knowledge graph.
  • the execution subject of the knowledge graph-based medical question answering method includes but is not limited to at least one of electronic devices such as a server and a terminal that can be configured to execute the method provided by the embodiment of the present application.
  • the knowledge graph-based medical question answering method can be executed by software or hardware installed on a terminal device or a server device, and the software can be a block chain platform.
  • the server includes, but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like.
  • the server may be an independent server, or may provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery network (ContentDeliveryNetwork, CDN), and cloud servers for basic cloud computing services such as big data and artificial intelligence platforms.
  • cloud services such as cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery network (ContentDeliveryNetwork, CDN), and cloud servers for basic cloud computing services such as big data and artificial intelligence platforms.
  • FIG. 1 it is a schematic flowchart of a method for answering medical questions based on a knowledge map provided by an embodiment of the present application.
  • the medical question answering method based on the knowledge map includes:
  • the original user query sentence is a query sentence that the patient wants to inquire about medical problems.
  • the original user query sentence is: "upper respiratory tract infection”, “difference between upper respiratory tract infection and cold” or " Can I take roxithromycin for upper respiratory tract infection?"
  • the multiple entities are input into the relationship extraction module in the entity-relationship joint extraction model to obtain the relationship between the entities.
  • the entity-relationship joint extraction model includes a shared coding layer, an entity recognition module and a relationship extraction module, wherein the shared coding layer is an Embedding layer, and the Bert model can be used as the shared coding layer, that is, the Bert model As the Embedding layer, the entity recognition module is composed of Bi-LSTM and CRF layer, and the relationship extraction module is composed of fully connected layer and Sigmoid function.
  • performing encoding processing on the original user query sentence can enhance the feature representation capability of the original user query sentence.
  • the input of the original coded data into the entity recognition module in the entity-relationship joint extraction model is carried out for entity recognition, and one or more entities are obtained, including:
  • the initial text sequence is marked according to the transition probability and the emission probability to obtain one or more entities.
  • the entity recognition module is composed of a Bi-LSTM and a CRF layer, wherein the Bi-LSTM (LongShort-TermMemory, bidirectional long-short-term memory network) is a time cyclic neural network, including: an input gate, a forgetting gate and the output gate.
  • Bi-LSTM LongShort-TermMemory, bidirectional long-short-term memory network
  • the calculation method of the state value includes:
  • the calculation method of the activation value includes:
  • f t represents the activation value
  • w f represents the activation factor of the forget gate
  • x t represents the original coded data input at time t
  • b f represents the weight of the cell unit in the forget gate
  • the calculation method of the status update value includes:
  • c t represents the state update value
  • h t-1 represents the peak value of the original encoded data at the time of input gate t-1
  • the calculating the initial text sequence corresponding to the state update value using the output gate includes: calculating the initial text sequence using the following formula:
  • o t represents the initial text sequence
  • tan h represents the activation function of the output gate
  • ct represents the state update value
  • the multiple entities are input into the relationship extraction module in the entity-relationship joint extraction model to obtain the relationship between entities, and the original coded data, the preset label and the relative position of the tail entity
  • the information is spliced and passed to the fully connected layer, and the probability of the starting position of the tail entity is calculated through the Sigmoid function, and finally the (head entity, relationship, tail entity) entity-relationship triplet is obtained through parsing.
  • the input of the original user query sentence into a preset intent recognition model for intent recognition, and obtaining the intent recognition result include:
  • the classification result is marked with a preset intent recognition label to obtain an intent recognition result.
  • the intent recognition model may be a Text-CNN deep learning model.
  • the intent recognition model consists of four parts: an input layer, a convolutional layer, a pooling layer and a fully connected layer.
  • the input layer needs to input a fixed-length text sequence, and the vectorization processing can use word vector tools such as word2vec, fastText or Glove, and can also use the Bert model for processing.
  • the convolution layer generally includes a plurality of convolution kernels of different sizes, and the convolution kernel only performs one-dimensional sliding, that is, the width of the convolution kernel is equal to the dimension of the vector.
  • the pooling layer uses Max-pool, which not only reduces the parameters of the intent recognition model, but also ensures that the input of a fixed-length fully connected layer is obtained from the output of the variable-length convolution layer.
  • the role of the fully connected layer is a classifier.
  • the original Text-CNN model uses a fully connected network with only one hidden layer, which is equivalent to inputting the features extracted by the convolution and pooling layers into an LR classifier for classification. .
  • the intention recognition result is mainly divided into intention and non-intent.
  • the recognized intention may be multiple intention types such as complications, related symptoms, recommended medicines, and whether it is possible or not.
  • performing scene classification on the original user query statement according to the entity, the relationship between the entities, and the intent recognition result, to obtain the scene category corresponding to the original user query statement including:
  • the scene category corresponding to the original user query statement in which the relationship between the entities is related and the intention recognition result is intention is classified as the third scene.
  • the original user query sentence "upper respiratory tract infection” belongs to a single or multiple entities and has no relationship and no intention, so it is classified as the first scene, and the original user query sentence "difference between upper respiratory tract infection and cold” has no relationship and intention, so it is classified as the second scene, and the original user query sentence "can I take roxithromycin for upper respiratory tract infection” is related and intentional, so it is classified as the third scene.
  • the method of acquiring a pre-built medical knowledge graph further includes:
  • a plurality of triplets are constructed according to the entity information and the correlation relationship, and a medical knowledge map is obtained by using the multiple triplets.
  • the medical-related data includes a large amount of medical-related data, such as common disease names, corresponding disease symptoms, medicines for treatment, disease cases, related examinations and medication instructions, etc. Structuring the medical-related data means defining the medical-related data to obtain structured data.
  • the medical-related data includes upper respiratory tract infection, cold, diabetes, roxithromycin, etc.
  • upper respiratory tract infection, cold and diabetes are defined as diseases
  • roxithromycin is defined as medicine.
  • the entity information includes but is not limited to medical entities, medical attribute entities, etc., common medical entities, such as diseases, symptoms, medicines, treatments, inspections, etc., common medical attributes, such as overview, etiology, disease, Medical treatment, treatment, medication instructions, drug efficacy, etc.
  • the relevant information includes common complications, typical symptoms, departments visited, recommended medicines, and related examinations.
  • multiple triples are constructed according to the entity information and the correlation relationship, and the medical knowledge map is obtained by using the multiple triples.
  • the symptom of a cold is a runny nose
  • You can take roxithromycin for upper respiratory tract infection, expressed as "upper respiratory tract infection + drug roxithromycin" in triplets.
  • the medical knowledge map is constructed based on the medical related data, which can intuitively reflect the correlation between multiple entities in the medical knowledge map, and improve the efficiency of further analysis using the medical knowledge map .
  • Using the medical knowledge map as the underlying data support for medical information retrieval can not only rely on the huge relational network of the medical knowledge map to retrieve more extensive and accurate medical information, but also effectively associate various related information to make the search results more comprehensive. .
  • the answer corresponding to the original user query statement is indexed in the medical knowledge graph according to the scene category.
  • the returned situations are as follows: in the first scene, the user enters "upper respiratory tract infection”, retrieves all entities and entity attributes within the relationship corresponding to all current entities, and sorts them by entity category Distinguish, such as including complications, symptoms, medicines, questions and answers, cases, video articles, etc.
  • the user enters "difference between upper respiratory tract infection and cold", and a comparison of the same attributes of the upper "respiratory tract infection” and "cold” entities is retrieved.
  • the entity relationship is extracted from the original user query statement by using the preset entity relationship joint extraction model to obtain the entity and the relationship between the entities.
  • the entity relationship reflects semantic information
  • the original user query statement is input into the preset Intent recognition is carried out in the intent recognition model, and the intent recognition result is obtained, the user’s intention is determined, and the accuracy of subsequent question answering is improved.
  • the original user query is classified according to the entity, the relationship between entities, and the intent recognition result.
  • the scenario category indexes the answers corresponding to the original user query statements in the medical knowledge graph.
  • the medical knowledge in the medical knowledge graph is highly relevant, and indexing according to the scenario category can more accurately extract the corresponding answers to the medical questions. Answer. Therefore, the method for answering medical questions based on the knowledge map proposed in this application can solve the problem of low accuracy in answering medical questions.
  • FIG. 2 it is a functional block diagram of a medical question answering device based on a knowledge map provided by an embodiment of the present application.
  • the medical question answering device 100 based on the knowledge graph described in this application can be installed in an electronic device.
  • the knowledge map-based medical question answering device 100 may include an entity relationship extraction module 101 , an intent recognition module 102 , a scene classification module 103 and an answer indexing module 104 .
  • the module described in this application can also be called a unit, which refers to a series of computer program segments that can be executed by the processor of the electronic device and can complete fixed functions, and are stored in the memory of the electronic device.
  • each module/unit is as follows:
  • the entity relationship extraction module 101 is configured to obtain an original user query statement, and use a preset entity relationship joint extraction model to perform entity relationship extraction on the original user query statement to obtain entities and relationships between entities;
  • the intent recognition module 102 is configured to input the original user query sentence into a preset intent recognition model for intent recognition, and obtain an intent recognition result;
  • the scene classification module 103 is configured to classify the scene of the original user query statement according to the entity, the relationship between the entities and the intention recognition result, and obtain the scene category corresponding to the original user query statement;
  • the answer indexing module 104 is configured to obtain a pre-built medical knowledge map, and index the answer corresponding to the original user query statement in the medical knowledge map according to the scene category.
  • each module of the knowledge graph-based medical question answering device 100 is as follows:
  • Step 1 Obtain the original user query statement, and use the preset entity-relationship joint extraction model to perform entity-relationship extraction on the original user query statement to obtain entities and relationships between entities.
  • the original user query sentence is a query sentence that the patient wants to inquire about medical problems.
  • the original user query sentence is: "upper respiratory tract infection”, “difference between upper respiratory tract infection and cold” or " Can I take roxithromycin for upper respiratory tract infection?"
  • using the preset entity-relationship joint extraction model to perform entity-relationship extraction on the original user query statement to obtain entities and relationships between entities includes:
  • the multiple entities are input into the relationship extraction module in the entity-relationship joint extraction model to obtain the relationship between the entities.
  • the entity-relationship joint extraction model includes a shared coding layer, an entity recognition module and a relationship extraction module, wherein the shared coding layer is an Embedding layer, and the Bert model can be used as the shared coding layer, that is, the Bert model As the Embedding layer, the entity recognition module is composed of Bi-LSTM and CRF layer, and the relationship extraction module is composed of fully connected layer and Sigmoid function.
  • performing encoding processing on the original user query sentence can enhance the feature representation capability of the original user query sentence.
  • the input of the original coded data into the entity recognition module in the entity-relationship joint extraction model is carried out for entity recognition, and one or more entities are obtained, including:
  • the initial text sequence is marked according to the transition probability and the emission probability to obtain one or more entities.
  • the entity recognition module is composed of a Bi-LSTM and a CRF layer, wherein the Bi-LSTM (LongShort-TermMemory, bidirectional long-short-term memory network) is a time cyclic neural network, including: an input gate, a forgetting gate and the output gate.
  • Bi-LSTM LongShort-TermMemory, bidirectional long-short-term memory network
  • the calculation method of the state value includes:
  • the calculation method of the activation value includes:
  • f t represents the activation value
  • w f represents the activation factor of the forget gate
  • x t represents the original coded data input at time t
  • b f represents the weight of the cell unit in the forget gate
  • the calculation method of the status update value includes:
  • c t represents the state update value
  • h t-1 represents the peak value of the original encoded data at the time of input gate t-1
  • the calculating the initial text sequence corresponding to the state update value using the output gate includes: calculating the initial text sequence using the following formula:
  • o t represents the initial text sequence
  • tan h represents the activation function of the output gate
  • ct represents the state update value
  • the multiple entities are input into the relationship extraction module in the entity-relationship joint extraction model to obtain the relationship between entities, and the original coded data, the preset label and the relative position of the tail entity
  • the information is spliced and passed to the fully connected layer, and the probability of the starting position of the tail entity is calculated through the Sigmoid function, and finally the (head entity, relationship, tail entity) entity-relationship triplet is obtained through parsing.
  • Step 2 Input the original user query sentence into a preset intent recognition model for intent recognition, and obtain an intent recognition result.
  • the input of the original user query sentence into a preset intent recognition model for intent recognition, and obtaining the intent recognition result include:
  • the classification result is marked with a preset intent recognition label to obtain an intent recognition result.
  • the intent recognition model may be a Text-CNN deep learning model.
  • the intent recognition model consists of four parts: an input layer, a convolutional layer, a pooling layer and a fully connected layer.
  • the input layer needs to input a fixed-length text sequence, and the vectorization processing can use word vector tools such as word2vec, fastText or Glove, and can also use the Bert model for processing.
  • the convolution layer generally includes a plurality of convolution kernels of different sizes, and the convolution kernel only performs one-dimensional sliding, that is, the width of the convolution kernel is equal to the dimension of the vector.
  • the pooling layer uses Max-pool, which not only reduces the parameters of the intent recognition model, but also ensures that the input of a fixed-length fully connected layer is obtained from the output of the variable-length convolution layer.
  • the function of the fully connected layer is a classifier.
  • the original Text-CNN model uses a fully connected network with only one hidden layer, which is equivalent to inputting the features extracted by the convolution and pooling layers into an LR classifier for classification. .
  • the intention recognition result is mainly divided into intention and non-intent.
  • the recognized intention may be multiple intention types such as complications, related symptoms, recommended medicines, and whether it is possible or not.
  • Step 3 Perform scene classification on the original user query statement according to the entity, the relationship between the entities, and the intent recognition result, to obtain the scene category corresponding to the original user query statement.
  • performing scene classification on the original user query statement according to the entity, the relationship between the entities, and the intent recognition result, to obtain the scene category corresponding to the original user query statement including:
  • the scene category corresponding to the original user query statement in which the relationship between the entities is related and the intention recognition result is intention is classified as the third scene.
  • the original user query sentence "upper respiratory tract infection” belongs to a single or multiple entities and has no relationship and no intention, so it is classified as the first scene, and the original user query sentence "difference between upper respiratory tract infection and cold” has no relationship and intention, so it is classified as the second scene, and the original user query sentence "can I take roxithromycin for upper respiratory tract infection” is related and intentional, so it is classified as the third scene.
  • Step 4 Obtain a pre-built medical knowledge map, and index the answer corresponding to the original user query statement in the medical knowledge map according to the scene category.
  • the method of acquiring a pre-built medical knowledge graph further includes:
  • a plurality of triplets are constructed according to the entity information and the correlation relationship, and a medical knowledge map is obtained by using the multiple triplets.
  • the medical-related data includes a large amount of medical-related data, such as common disease names, corresponding disease symptoms, medicines for treatment, disease cases, related examinations and medication instructions, etc. Structuring the medical-related data means defining the medical-related data to obtain structured data.
  • the medical-related data includes upper respiratory tract infection, cold, diabetes, roxithromycin, etc.
  • upper respiratory tract infection, cold and diabetes are defined as diseases
  • roxithromycin is defined as medicine.
  • the entity information includes but is not limited to medical entities, medical attribute entities, etc., common medical entities, such as diseases, symptoms, medicines, treatments, inspections, etc., common medical attributes, such as overview, etiology, disease, Medical treatment, treatment, medication instructions, drug efficacy, etc.
  • the relevant information includes common complications, typical symptoms, departments visited, recommended medicines, and related examinations.
  • multiple triples are constructed according to the entity information and the correlation relationship, and the medical knowledge map is obtained by using the multiple triples.
  • the symptom of a cold is a runny nose
  • You can take roxithromycin for upper respiratory tract infection, expressed as "upper respiratory tract infection + drug roxithromycin" in triplets.
  • the medical knowledge map is constructed based on the medical related data, which can intuitively reflect the correlation between multiple entities in the medical knowledge map, and improve the efficiency of further analysis using the medical knowledge map .
  • Using the medical knowledge map as the underlying data support for medical information retrieval can not only rely on the huge relational network of the medical knowledge map to retrieve more extensive and accurate medical information, but also effectively associate various related information to make the search results more comprehensive. .
  • the answer corresponding to the original user query statement is indexed in the medical knowledge graph according to the scene category.
  • the returned situations are as follows: in the first scene, the user enters "upper respiratory tract infection”, retrieves all entities and entity attributes within the relationship corresponding to all current entities, and sorts them by entity category Distinguish, such as including complications, symptoms, medicines, questions and answers, cases, video articles, etc.
  • the user enters "difference between upper respiratory tract infection and cold", and a comparison of the same attributes of the upper "respiratory tract infection” and "cold” entities is retrieved.
  • the entity relationship is extracted from the original user query statement by using the preset entity relationship joint extraction model to obtain the entity and the relationship between the entities.
  • the entity relationship reflects semantic information
  • the original user query statement is input into the preset Intent recognition is carried out in the intent recognition model, and the intent recognition result is obtained, the user’s intention is determined, and the accuracy of subsequent question answering is improved.
  • the original user query is classified according to the entity, the relationship between entities, and the intent recognition result.
  • the scenario category indexes the answers corresponding to the original user query statements in the medical knowledge graph.
  • the medical knowledge in the medical knowledge graph is highly relevant, and indexing according to the scenario category can more accurately extract the corresponding answers to the medical questions. Answer. Therefore, the medical question answering device based on the knowledge map proposed in this application can solve the problem of low accuracy in answering medical questions.
  • FIG. 3 it is a schematic structural diagram of an electronic device implementing a knowledge graph-based medical question answering method provided by an embodiment of the present application.
  • the electronic device 1 may include a processor 10, a memory 11, a communication bus 12, and a communication interface 13, and may also include a computer program stored in the memory 11 and operable on the processor 10, such as a knowledge map based medical question answering program.
  • the processor 10 may be composed of integrated circuits in some embodiments, for example, may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits with the same function or different functions packaged, including one or Combinations of multiple central processing units (Central Processing unit, CPU), microprocessors, digital processing chips, graphics processors and various control chips, etc.
  • the processor 10 is the control core (ControlUnit) of the electronic device, and utilizes various interfaces and lines to connect the various parts of the entire electronic device, by running or executing programs or modules stored in the memory 11 (for example, executing based on medical question answering program of knowledge graph, etc.), and call the data stored in the memory 11 to execute various functions of the electronic device and process data.
  • ControlUnit the control core
  • the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card type memory (for example: SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. , the computer-readable storage medium may be non-volatile or volatile.
  • the storage 11 may be an internal storage unit of the electronic device in some embodiments, such as a mobile hard disk of the electronic device.
  • the memory 11 may also be an external storage device of the electronic device in other embodiments, such as a plug-in mobile hard disk equipped on the electronic device, a smart memory card (SmartMediaCard, SMC), a secure digital (SecureDigital, SD) card, Flash card (FlashCard), etc.
  • the memory 11 may also include both an internal storage unit of the electronic device and an external storage device.
  • the memory 11 can not only be used to store application software and various data installed in electronic devices, such as codes of medical question answering programs based on knowledge graphs, but can also be used to temporarily store data that has been output or will be output.
  • the communication bus 12 may be a peripheral component interconnect standard (PCI for short) bus or an extended industry standard architecture (EISA for short) bus or the like.
  • PCI peripheral component interconnect standard
  • EISA extended industry standard architecture
  • the bus can be divided into address bus, data bus, control bus and so on.
  • the bus is configured to realize connection and communication between the memory 11 and at least one processor 10 and the like.
  • the communication interface 13 is used for communication between the electronic device and other devices, including a network interface and a user interface.
  • the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which are generally used to establish a communication connection between the electronic device and other electronic devices.
  • the user interface may be a display (Display) or an input unit (such as a keyboard (Keyboard)).
  • the user interface may also be a standard wired interface or a wireless interface.
  • the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode, Organic Light Emitting Diode) touch device, and the like.
  • the display may also be properly referred to as a display screen or a display unit, and is used for displaying information processed in the electronic device and for displaying a visualized user interface.
  • FIG. 3 only shows an electronic device with components. Those skilled in the art can understand that the structure shown in FIG. 3 does not constitute a limitation to the electronic device 1, and may include fewer or more components, or combinations of certain components, or different arrangements of components.
  • the electronic device may also include a power supply (such as a battery) for supplying power to various components.
  • the power supply may be logically connected to the at least one processor 10 through a power management device, so that Realize functions such as charge management, discharge management, and power consumption management.
  • the power supply may also include one or more DC or AC power supplies, recharging devices, power failure detection circuits, power converters or inverters, power status indicators and other arbitrary components.
  • the electronic device may also include various sensors, a Bluetooth module, a Wi-Fi module, etc., which will not be described in detail here.
  • the medical question answering program based on the knowledge map stored in the memory 11 of the electronic device 1 is a combination of multiple instructions, and when running in the processor 10, it can realize:
  • a pre-built medical knowledge map is obtained, and an answer corresponding to the original user query statement is indexed in the medical knowledge map according to the scene category.
  • the integrated modules/units of the electronic device 1 are realized in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium.
  • the computer-readable storage medium may be volatile or non-volatile.
  • the computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a removable hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM, Read-Only Memory) ).
  • the present application also provides a computer-readable storage medium, the readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, it can realize:
  • a pre-built medical knowledge map is obtained, and an answer corresponding to the original user query statement is indexed in the medical knowledge map according to the scene category.
  • modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional module in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware, or in the form of hardware plus software function modules.
  • Blockchain essentially a decentralized database, is a series of data blocks associated with each other using cryptographic methods. Each data block contains a batch of network transaction information, which is used 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.
  • AI artificial intelligence
  • the embodiments of the present application may acquire and process relevant data based on artificial intelligence technology.
  • artificial intelligence is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Artificial Intelligence (AREA)
  • Health & Medical Sciences (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Mathematical Physics (AREA)
  • Biomedical Technology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Biophysics (AREA)
  • Molecular Biology (AREA)
  • Probability & Statistics with Applications (AREA)
  • Computing Systems (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Medical Informatics (AREA)
  • Public Health (AREA)
  • Human Computer Interaction (AREA)
  • Pathology (AREA)
  • Epidemiology (AREA)
  • Primary Health Care (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present application relates to technology of artificial intelligence, and discloses a knowledge graph-based medical question answering method, comprising: performing entity relationship extraction on an original user query statement by using a preset entity relationship joint extraction model so as to obtain a relationship between entities; inputting the original user query statement into a preset intention recognition model for intention recognition to obtain an intention recognition result; performing scene classification on the original user query statement according to the relationship between entities and the intention recognition result to obtain a scene category corresponding to the original user query statement; and according to the scene category, indexing an answer corresponding to the original user query statement from a pre-constructed medical knowledge graph. In addition, the present application further relates to blockchain technology. The intention recognition result can be stored in a node of a blockchain. The present application also provides a knowledge graph-based medical question answering apparatus, an electronic device, and a storage medium. The present application can improve the accuracy of medical question answering.

Description

基于知识图谱的医疗问题解答方法、装置、设备及介质Method, device, equipment and medium for answering medical questions based on knowledge graph
本申请要求于2021年08月30日提交中国专利局、申请号为202111004877.4,发明名称为“基于知识图谱的医疗问题解答方法、装置、设备及介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application submitted to the China Patent Office on August 30, 2021, with the application number 202111004877.4, and the title of the invention is "Medical Question Answering Method, Device, Equipment and Medium Based on Knowledge Graph", the entire content of which Incorporated in this application by reference.
技术领域technical field
本申请涉及人工智能技术领域,尤其涉及一种基于知识图谱的医疗问题解答方法、装置、电子设备及计算机可读存储介质。The present application relates to the technical field of artificial intelligence, and in particular to a method, device, electronic device and computer-readable storage medium for answering medical questions based on knowledge graphs.
背景技术Background technique
互联网的快速发展,极大的降低了用户访问互联网的门槛,随之出现了大量的医疗相关的搜索需求。针对这些搜索需求,衍生出了医疗智能问答服务。医疗智能问答是指根据用户的医疗提问,自动的搜索、加工、处理后得到能回答用户提问的答案。The rapid development of the Internet has greatly reduced the threshold for users to access the Internet, and a large number of medical-related search needs have emerged. In response to these search needs, medical intelligent question-and-answer services have been derived. Medical intelligent question and answer refers to the automatic search, processing, and processing of the user's medical questions to obtain answers that can answer the user's questions.
发明人意识到,现有的对医疗问题进行解答的方法通常是基于用户搜索的单个实体信息,而对于多个实体或者带有特定意图的搜索查询语句,无法给出有效且精准的检索结果。The inventor realized that the existing methods for answering medical questions are usually based on the information of a single entity searched by the user, but cannot provide effective and accurate retrieval results for multiple entities or search queries with specific intentions.
发明内容Contents of the invention
本申请提供的一种基于知识图谱的医疗问题解答方法,包括:This application provides a method for answering medical questions based on knowledge graphs, including:
获取原始用户查询语句,利用预设的实体关系联合抽取模型对所述原始用户查询语句进行实体关系抽取,得到实体及实体之间的关系;Obtain the original user query statement, and use the preset entity-relationship joint extraction model to perform entity-relationship extraction on the original user query statement to obtain entities and relationships between entities;
将所述原始用户查询语句输入至预设的意图识别模型中进行意图识别,得到意图识别结果;inputting the original user query sentence into a preset intent recognition model to perform intent recognition, and obtain an intent recognition result;
根据所述实体、所述实体之间的关系以及所述意图识别结果对所述原始用户查询语句进行场景分类,得到所述原始用户查询语句对应的场景类别;performing scene classification on the original user query statement according to the entity, the relationship between the entities, and the intent recognition result, to obtain the scene category corresponding to the original user query statement;
获取预构建的医疗知识图谱,根据所述场景类别在所述医疗知识图谱中索引出所述原始用户查询语句对应的答案。A pre-built medical knowledge map is obtained, and an answer corresponding to the original user query statement is indexed in the medical knowledge map according to the scene category.
本申请还提供一种基于知识图谱的医疗问题解答装置,所述装置包括:The present application also provides a medical question answering device based on a knowledge graph, the device comprising:
实体关系抽取模块,用于获取原始用户查询语句,利用预设的实体关系联合抽取模型对所述原始用户查询语句进行实体关系抽取,得到实体及实体之间的关系;The entity relationship extraction module is used to obtain the original user query statement, and use the preset entity relationship joint extraction model to perform entity relationship extraction on the original user query statement to obtain the entity and the relationship between the entities;
意图识别模块,用于将所述原始用户查询语句输入至预设的意图识别模型中进行意图识别,得到意图识别结果;An intent recognition module, configured to input the original user query sentence into a preset intent recognition model for intent recognition, and obtain an intent recognition result;
场景分类模块,用于根据所述实体、所述实体之间的关系以及所述意图识别结果对所述原始用户查询语句进行场景分类,得到所述原始用户查询语句对应的场景类别;A scene classification module, configured to classify the scene of the original user query statement according to the entity, the relationship between the entities and the intention recognition result, and obtain the scene category corresponding to the original user query statement;
答案索引模块,用于获取预构建的医疗知识图谱,根据所述场景类别在所述医疗知识图谱中索引出所述原始用户查询语句对应的答案。An answer indexing module, configured to obtain a pre-built medical knowledge map, and index the answer corresponding to the original user query statement in the medical knowledge map according to the scene category.
本申请还提供一种电子设备,所述电子设备包括:The present application also provides an electronic device, the electronic device comprising:
至少一个处理器;以及,at least one processor; and,
与所述至少一个处理器通信连接的存储器;其中,a memory communicatively coupled to the at least one processor; wherein,
所述存储器存储有可被所述至少一个处理器执行的计算机程序,所述计算机程序被所述至少一个处理器执行,以使所述至少一个处理器能够执行如下所述的基于知识图谱的医疗问题解答方法:The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor, so that the at least one processor can perform the following knowledge map-based medical treatment Question answer method:
获取原始用户查询语句,利用预设的实体关系联合抽取模型对所述原始用户查询语句 进行实体关系抽取,得到实体及实体之间的关系;Obtain the original user query statement, utilize the preset entity relationship joint extraction model to carry out entity relationship extraction to the original user query statement, and obtain the relationship between entities and entities;
将所述原始用户查询语句输入至预设的意图识别模型中进行意图识别,得到意图识别结果;inputting the original user query sentence into a preset intent recognition model to perform intent recognition, and obtain an intent recognition result;
根据所述实体、所述实体之间的关系以及所述意图识别结果对所述原始用户查询语句进行场景分类,得到所述原始用户查询语句对应的场景类别;performing scene classification on the original user query statement according to the entity, the relationship between the entities, and the intent recognition result, to obtain the scene category corresponding to the original user query statement;
获取预构建的医疗知识图谱,根据所述场景类别在所述医疗知识图谱中索引出所述原始用户查询语句对应的答案。A pre-built medical knowledge map is obtained, and an answer corresponding to the original user query statement is indexed in the medical knowledge map according to the scene category.
本申请还提供一种计算机可读存储介质,所述计算机可读存储介质中存储有至少一个计算机程序,所述至少一个计算机程序被电子设备中的处理器执行以实现如下所述的基于知识图谱的医疗问题解答方法:The present application also provides a computer-readable storage medium, at least one computer program is stored in the computer-readable storage medium, and the at least one computer program is executed by a processor in an electronic device to realize the following knowledge graph-based Methods of answering medical questions:
获取原始用户查询语句,利用预设的实体关系联合抽取模型对所述原始用户查询语句进行实体关系抽取,得到实体及实体之间的关系;Obtain the original user query statement, and use the preset entity-relationship joint extraction model to perform entity-relationship extraction on the original user query statement to obtain entities and relationships between entities;
将所述原始用户查询语句输入至预设的意图识别模型中进行意图识别,得到意图识别结果;inputting the original user query sentence into a preset intent recognition model to perform intent recognition, and obtain an intent recognition result;
根据所述实体、所述实体之间的关系以及所述意图识别结果对所述原始用户查询语句进行场景分类,得到所述原始用户查询语句对应的场景类别;performing scene classification on the original user query statement according to the entity, the relationship between the entities, and the intent recognition result, to obtain the scene category corresponding to the original user query statement;
获取预构建的医疗知识图谱,根据所述场景类别在所述医疗知识图谱中索引出所述原始用户查询语句对应的答案。A pre-built medical knowledge map is obtained, and an answer corresponding to the original user query statement is indexed in the medical knowledge map according to the scene category.
附图说明Description of drawings
图1为本申请一实施例提供的基于知识图谱的医疗问题解答方法的流程示意图;FIG. 1 is a schematic flow diagram of a method for answering medical questions based on knowledge graphs provided by an embodiment of the present application;
图2为本申请一实施例提供的基于知识图谱的医疗问题解答装置的功能模块图;FIG. 2 is a functional block diagram of a medical question answering device based on a knowledge map provided by an embodiment of the present application;
图3为本申请一实施例提供的实现所述基于知识图谱的医疗问题解答方法的电子设备的结构示意图。FIG. 3 is a schematic structural diagram of an electronic device implementing the knowledge graph-based medical question answering method provided by an embodiment of the present application.
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization, functional features and advantages of the present application will be further described in conjunction with the embodiments and with reference to the accompanying drawings.
具体实施方式Detailed ways
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。It should be understood that the specific embodiments described here are only used to explain the present application, and are not intended to limit the present application.
本申请实施例提供一种基于知识图谱的医疗问题解答方法。所述基于知识图谱的医疗问题解答方法的执行主体包括但不限于服务端、终端等能够被配置为执行本申请实施例提供的该方法的电子设备中的至少一种。换言之,所述基于知识图谱的医疗问题解答方法可以由安装在终端设备或服务端设备的软件或硬件来执行,所述软件可以是区块链平台。所述服务端包括但不限于:单台服务器、服务器集群、云端服务器或云端服务器集群等。所述服务器可以是独立的服务器,也可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、内容分发网络(ContentDeliveryNetwork,CDN)、以及大数据和人工智能平台等基础云计算服务的云服务器。An embodiment of the present application provides a method for answering medical questions based on a knowledge graph. The execution subject of the knowledge graph-based medical question answering method includes but is not limited to at least one of electronic devices such as a server and a terminal that can be configured to execute the method provided by the embodiment of the present application. In other words, the knowledge graph-based medical question answering method can be executed by software or hardware installed on a terminal device or a server device, and the software can be a block chain platform. The server includes, but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like. The server may be an independent server, or may provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery network (ContentDeliveryNetwork, CDN), and cloud servers for basic cloud computing services such as big data and artificial intelligence platforms.
参照图1所示,为本申请一实施例提供的基于知识图谱的医疗问题解答方法的流程示意图。在本实施例中,所述基于知识图谱的医疗问题解答方法包括:Referring to FIG. 1 , it is a schematic flowchart of a method for answering medical questions based on a knowledge map provided by an embodiment of the present application. In this embodiment, the medical question answering method based on the knowledge map includes:
S1、获取原始用户查询语句,利用预设的实体关系联合抽取模型对所述原始用户查询语句进行实体关系抽取,得到实体及实体之间的关系。S1. Obtain an original user query statement, and use a preset entity-relationship joint extraction model to perform entity relationship extraction on the original user query statement to obtain entities and relationships between entities.
本申请实施例中,所述原始用户查询语句为患者想要查询医疗问题的询问语句,例如,所述原始用户查询语句为:“上呼吸道感染”、“上呼吸道感染和感冒的区别”或者“上呼吸道感染可以吃罗红霉素吗”。In the embodiment of the present application, the original user query sentence is a query sentence that the patient wants to inquire about medical problems. For example, the original user query sentence is: "upper respiratory tract infection", "difference between upper respiratory tract infection and cold" or " Can I take roxithromycin for upper respiratory tract infection?"
具体地,所述利用预设的实体关系联合抽取模型对所述原始用户查询语句进行实体关 系抽取,得到实体及实体之间的关系,包括:Specifically, using the preset entity-relationship joint extraction model to perform entity-relationship extraction on the original user query statement to obtain entities and relationships between entities, including:
利用所述实体关系联合抽取模型中的共享编码层对所述原始用户查询语句进行编码处理,得到原始编码数据;encoding the original user query statement by using the shared encoding layer in the joint entity-relationship extraction model to obtain original encoded data;
将所述原始编码数据输入至所述实体关系联合抽取模型中的实体识别模块中进行实体识别,得到一个或者多个实体;Inputting the original coded data into the entity recognition module in the entity-relationship joint extraction model for entity recognition to obtain one or more entities;
将所述多个实体输入至所述实体关系联合抽取模型中的关系抽取模块中,得到实体之间的关系。The multiple entities are input into the relationship extraction module in the entity-relationship joint extraction model to obtain the relationship between the entities.
详细地,所述实体关系联合抽取模型中包含共享编码层、实体识别模块和关系抽取模块,其中,所述共享编码层为Embedding层,可以利用Bert模型作为所述共享编码层,即利用Bert模型作为Embedding层,所述实体识别模块由Bi-LSTM和CRF层构成,所述关系抽取模块由全连接层和Sigmoid函数构成。In detail, the entity-relationship joint extraction model includes a shared coding layer, an entity recognition module and a relationship extraction module, wherein the shared coding layer is an Embedding layer, and the Bert model can be used as the shared coding layer, that is, the Bert model As the Embedding layer, the entity recognition module is composed of Bi-LSTM and CRF layer, and the relationship extraction module is composed of fully connected layer and Sigmoid function.
其中,对所述原始用户查询语句进行编码处理,可以增强所述原始用户查询语句的特征表征能力。Wherein, performing encoding processing on the original user query sentence can enhance the feature representation capability of the original user query sentence.
进一步地,所述将所述原始编码数据输入至所述实体关系联合抽取模型中的实体识别模块中进行实体识别,得到一个或者多个实体,包括:Further, the input of the original coded data into the entity recognition module in the entity-relationship joint extraction model is carried out for entity recognition, and one or more entities are obtained, including:
通过所述实体识别模块中的输入门计算所述原始编码数据的状态值;calculating the state value of the original coded data through an input gate in the entity recognition module;
利用所述实体识别模块中的遗忘门计算所述原始编码数据的激活值;calculating the activation value of the original coded data by using the forget gate in the entity recognition module;
根据所述状态值和所述激活值计算所述原始编码数据的状态更新值;calculating a state update value of the original encoded data according to the state value and the activation value;
利用所述输出门计算所述状态更新值对应的初始文本序列;using the output gate to calculate an initial text sequence corresponding to the state update value;
将所述初始文本序列输入至全连接层中计算得到对应的发射概率,并采用CRF层计算预设标签对应的转移概率;Input the initial text sequence into the fully connected layer to calculate the corresponding emission probability, and use the CRF layer to calculate the transition probability corresponding to the preset label;
根据所述转移概率和所述发射概率对所述初始文本序列进行标记,得到一个或者多个实体。The initial text sequence is marked according to the transition probability and the emission probability to obtain one or more entities.
详细地,所述实体识别模块由Bi-LSTM和CRF层构成,其中,所述Bi-LSTM(LongShort-TermMemory,双向长短期记忆网络)是一种时间循环神经网络,包括:输入门、遗忘门以及输出门。In detail, the entity recognition module is composed of a Bi-LSTM and a CRF layer, wherein the Bi-LSTM (LongShort-TermMemory, bidirectional long-short-term memory network) is a time cyclic neural network, including: an input gate, a forgetting gate and the output gate.
一可选实施例中,所述状态值的计算方法包括:In an optional embodiment, the calculation method of the state value includes:
Figure PCTCN2022087817-appb-000001
Figure PCTCN2022087817-appb-000001
其中,i t表示状态值,
Figure PCTCN2022087817-appb-000002
表示输入门中细胞单元的偏置,w i表示输入门的激活因子,h t-1表示原始编码数据在输入门t-1时刻的峰值,x t表示在t时刻的原始编码数据,b i表示输入门中细胞单元的权重。
Among them, it represents the state value,
Figure PCTCN2022087817-appb-000002
Represents the bias of the cell unit in the input gate, w i represents the activation factor of the input gate, h t-1 represents the peak value of the original encoded data at the time t-1 of the input gate, x t represents the original encoded data at time t, b i Indicates the weight of the cell unit in the input gate.
一可选实施例中,所述激活值的计算方法包括:In an optional embodiment, the calculation method of the activation value includes:
Figure PCTCN2022087817-appb-000003
Figure PCTCN2022087817-appb-000003
其中,f t表示激活值,
Figure PCTCN2022087817-appb-000004
表示遗忘门中细胞单元的偏置,w f表示遗忘门的激活因子,
Figure PCTCN2022087817-appb-000005
表示原始编码数据在所述遗忘门t-1时刻的峰值,x t表示在t时刻输入的原始编码数据,b f表示遗忘门中细胞单元的权重。
where f t represents the activation value,
Figure PCTCN2022087817-appb-000004
Represents the bias of the cell unit in the forget gate, w f represents the activation factor of the forget gate,
Figure PCTCN2022087817-appb-000005
represents the peak value of the original coded data at time t-1 of the forget gate, x t represents the original coded data input at time t, and b f represents the weight of the cell unit in the forget gate.
一可选实施例中,所述状态更新值的计算方法包括:In an optional embodiment, the calculation method of the status update value includes:
Figure PCTCN2022087817-appb-000006
Figure PCTCN2022087817-appb-000006
其中,c t表示状态更新值,h t-1表示原始编码数据在输入门t-1时刻的峰值,
Figure PCTCN2022087817-appb-000007
表示原始编码数据在遗忘门t-1时刻的峰值。
Among them, c t represents the state update value, h t-1 represents the peak value of the original encoded data at the time of input gate t-1,
Figure PCTCN2022087817-appb-000007
Indicates the peak value of the original encoded data at the moment of forgetting gate t-1.
一可选实施例中,所述利用输出门计算状态更新值对应的初始文本序列包括:利用如下公式计算初始文本序列:In an optional embodiment, the calculating the initial text sequence corresponding to the state update value using the output gate includes: calculating the initial text sequence using the following formula:
o t=tan h(c t) o t =tan h(c t )
其中,o t表示初始文本序列,tan h表示输出门的激活函数,c t表示状态更新值。 Among them, o t represents the initial text sequence, tan h represents the activation function of the output gate, and ct represents the state update value.
具体地,将所述多个实体输入至所述实体关系联合抽取模型中的关系抽取模块中,得到实体之间的关系,将所述原始编码数据、所述预设标签以及尾实体的相对位置信息进行拼接并传入全连接层,通过Sigmoid函数计算尾实体的起始位置的概率,最终通过解析得到(头实体,关系,尾实体)实体关系三元组。Specifically, the multiple entities are input into the relationship extraction module in the entity-relationship joint extraction model to obtain the relationship between entities, and the original coded data, the preset label and the relative position of the tail entity The information is spliced and passed to the fully connected layer, and the probability of the starting position of the tail entity is calculated through the Sigmoid function, and finally the (head entity, relationship, tail entity) entity-relationship triplet is obtained through parsing.
S2、将所述原始用户查询语句输入至预设的意图识别模型中进行意图识别,得到意图识别结果。S2. Input the original user query sentence into a preset intent recognition model to perform intent recognition, and obtain an intent recognition result.
本申请实施例中,所述将所述原始用户查询语句输入至预设的意图识别模型中进行意图识别,得到意图识别结果,包括:In the embodiment of the present application, the input of the original user query sentence into a preset intent recognition model for intent recognition, and obtaining the intent recognition result include:
利用所述意图识别模型的输入层对所述原始用户查询语句进行向量化处理,得到用户查询向量;Using the input layer of the intent recognition model to vectorize the original user query statement to obtain a user query vector;
利用所述意图识别模型的卷积层对所述用户查询向量进行卷积处理,得到卷积数据集;Using the convolution layer of the intention recognition model to perform convolution processing on the user query vector to obtain a convolution data set;
将所述卷积数据集输入至所述意图识别模型中的池化层及全连接层中,得到分类结果;Inputting the convolution data set into the pooling layer and the fully connected layer in the intent recognition model to obtain classification results;
利用预设的意图识别标签对所述分类结果进行标记,得到意图识别结果。The classification result is marked with a preset intent recognition label to obtain an intent recognition result.
其中,在本方案中,所述意图识别模型可以为Text-CNN深度学习模型。Wherein, in this solution, the intent recognition model may be a Text-CNN deep learning model.
详细地,所述意图识别模型由四个部分构成:输入层、卷积层、池化层和全连接层。所述输入层需要输入一个定长的文本序列,所述向量化处理可以采用word2vec、fastText或者Glove等词向量工具,也可以利用Bert模型进行处理。所述卷积层一般包含多个不同尺寸的的卷积核,卷积核只进行一维的滑动,即卷积核的宽度与向量的维度等宽。所述池化层使用了Max-pool,不仅减少所述意图识别模型的参数,又保证了在不定长的卷积层的输出上获得一个定长的全连接层的输入。所述全连接层的作用就是分类器,原始的Text-CNN模型使用了只有一层隐藏层的全连接网络,相当于把卷积与池化层提取的特征输入到一个LR分类器中进行分类。In detail, the intent recognition model consists of four parts: an input layer, a convolutional layer, a pooling layer and a fully connected layer. The input layer needs to input a fixed-length text sequence, and the vectorization processing can use word vector tools such as word2vec, fastText or Glove, and can also use the Bert model for processing. The convolution layer generally includes a plurality of convolution kernels of different sizes, and the convolution kernel only performs one-dimensional sliding, that is, the width of the convolution kernel is equal to the dimension of the vector. The pooling layer uses Max-pool, which not only reduces the parameters of the intent recognition model, but also ensures that the input of a fixed-length fully connected layer is obtained from the output of the variable-length convolution layer. The role of the fully connected layer is a classifier. The original Text-CNN model uses a fully connected network with only one hidden layer, which is equivalent to inputting the features extracted by the convolution and pooling layers into an LR classifier for classification. .
例如,所述意图识别结果主要分为有意图和无意图,当所述意图识别结果为有意图时,识别的意图可以为并发症、相关症状、推荐药品、是否可以等多个意图类型。For example, the intention recognition result is mainly divided into intention and non-intent. When the intention recognition result is intention, the recognized intention may be multiple intention types such as complications, related symptoms, recommended medicines, and whether it is possible or not.
S3、根据所述实体、所述实体之间的关系以及所述意图识别结果对所述原始用户查询语句进行场景分类,得到所述原始用户查询语句对应的场景类别。S3. Perform scene classification on the original user query statement according to the entity, the relationship between the entities, and the intent recognition result, to obtain the scene category corresponding to the original user query statement.
本申请实施例中,由于所述原始用户查询语句中可能识别出一个实体或者多个实体,实体和实体之间可能存在关系或者存在特定意图,根据所述实体及实体之间的关系以及所述意图识别结果对所述原始用户查询语句进行场景分类。In the embodiment of the present application, since one entity or multiple entities may be identified in the original user query statement, there may be a relationship or a specific intention between entities, according to the entity and the relationship between entities and the The intent recognition result performs scene classification on the original user query statement.
具体地,所述根据所述实体、所述实体之间的关系以及所述意图识别结果对所述原始用户查询语句进行场景分类,得到所述原始用户查询语句对应的场景类别,包括:Specifically, performing scene classification on the original user query statement according to the entity, the relationship between the entities, and the intent recognition result, to obtain the scene category corresponding to the original user query statement, including:
将所述实体之间的关系为无关系且所述意图识别结果为无意图的原始用户查询语句对应的场景类别归为第一场景;Classifying the scene category corresponding to the original user query statement in which the relationship between the entities is no relationship and the intention recognition result is no intention as the first scene;
将所述实体之间的关系为无关系且所述意图识别结果为有意图的原始用户查询语句对应的场景类别归为第二场景;Classifying the scene category corresponding to the original user query statement in which the relationship between the entities is non-relationship and the intention recognition result is intentional as the second scene;
将所述实体之间的关系为有关系且所述意图识别结果为有意图的原始用户查询语句对应的场景类别归为第三场景。The scene category corresponding to the original user query statement in which the relationship between the entities is related and the intention recognition result is intention is classified as the third scene.
例如,所述原始用户查询语句“上呼吸道感染”属于单个或多个实体无关系且无意图,因此将其归为第一场景,所述原始用户查询语句“上呼吸道感染和感冒的区别”无关系且有意图,因此将其归为第二场景,所述原始用户查询语句“上呼吸道感染可以吃罗红霉素吗”有关系且有意图,因此将其归为第三场景。For example, the original user query sentence "upper respiratory tract infection" belongs to a single or multiple entities and has no relationship and no intention, so it is classified as the first scene, and the original user query sentence "difference between upper respiratory tract infection and cold" has no relationship and intention, so it is classified as the second scene, and the original user query sentence "can I take roxithromycin for upper respiratory tract infection" is related and intentional, so it is classified as the third scene.
详细地,根据所述实体、实体之间的关系以及所述意图识别结果对所述原始用户查询 语句进行场景分类,更关注于用户的语义信息,包括所述原始用户查询语句中的实体和实体之间的关系及检索意图。In detail, perform scene classification on the original user query statement according to the entity, the relationship between entities, and the intent recognition result, and pay more attention to the semantic information of the user, including the entity and entity in the original user query statement relationship and retrieval intent.
S4、获取预构建的医疗知识图谱,根据所述场景类别在所述医疗知识图谱中索引出所述原始用户查询语句对应的答案。S4. Obtain a pre-built medical knowledge graph, and index the answer corresponding to the original user query statement in the medical knowledge graph according to the scene category.
本申请实施例中,所述获取预构建的医疗知识图谱,所述方法还包括:In the embodiment of the present application, the method of acquiring a pre-built medical knowledge graph further includes:
获取医疗相关数据,对所述医疗相关数据进行结构化处理,得到结构化数据;Obtaining medical related data, performing structured processing on the medical related data, to obtain structured data;
对所述结构化数据进行实体抽取得到实体信息,对所述结构化数据进行关系抽取得到相关关系;performing entity extraction on the structured data to obtain entity information, and performing relationship extraction on the structured data to obtain related relationships;
根据所述实体信息和所述相关关系构建得到多个三元组,并利用所述多个三元组得到医疗知识图谱。A plurality of triplets are constructed according to the entity information and the correlation relationship, and a medical knowledge map is obtained by using the multiple triplets.
详细地,所述医疗相关数据包含医疗相关的大量数据,例如,常见的疾病名称、对应的疾病症状、治疗的药品、疾病的案例、相关检查和用药说明等。对所述医疗相关数据进行结构化处理即对所述医疗相关数据进行定义,得到结构化数据。In detail, the medical-related data includes a large amount of medical-related data, such as common disease names, corresponding disease symptoms, medicines for treatment, disease cases, related examinations and medication instructions, etc. Structuring the medical-related data means defining the medical-related data to obtain structured data.
例如,所述医疗相关数据中包含上呼吸道感染、感冒、糖尿病、罗红霉素等,将上呼吸道感染、感冒和糖尿病定义为疾病,将罗红霉素定义为药品。For example, the medical-related data includes upper respiratory tract infection, cold, diabetes, roxithromycin, etc., upper respiratory tract infection, cold and diabetes are defined as diseases, and roxithromycin is defined as medicine.
具体地,所述实体信息包括但不限于医疗实体、医疗属性实体等,常见的医疗实体,如疾病、症状、药品、治疗手段、检查检验等,常见的医学属性,如概述、病因、病症、就医、治疗、用药说明、药品功效等。所述相关信息如常见并发症、典型症状、就诊科室、推荐药品、相关检查等。Specifically, the entity information includes but is not limited to medical entities, medical attribute entities, etc., common medical entities, such as diseases, symptoms, medicines, treatments, inspections, etc., common medical attributes, such as overview, etiology, disease, Medical treatment, treatment, medication instructions, drug efficacy, etc. The relevant information includes common complications, typical symptoms, departments visited, recommended medicines, and related examinations.
进一步地,本申请实施例中,根据所述实体信息和所述相关关系构建得到多个三元组,并利用所述多个三元组得到医疗知识图谱。所述三元组为“实体+关系=实体”的信息表现形式,例如:感冒的症状是流鼻涕,用三元组表示为“感冒+症状=流鼻涕”。上呼吸道感染可以吃罗红霉素,用三元组表示为“上呼吸道感染+药品=罗红霉素”。Further, in the embodiment of the present application, multiple triples are constructed according to the entity information and the correlation relationship, and the medical knowledge map is obtained by using the multiple triples. The triplet is an information representation form of "entity+relationship=entity". For example, the symptom of a cold is a runny nose, and the triplet is expressed as "cold+symptom=runny nose". You can take roxithromycin for upper respiratory tract infection, expressed as "upper respiratory tract infection + drug = roxithromycin" in triplets.
本申请实施例中,根据所述医疗相关数据构建医疗知识图谱,可直观地反映出所述医疗知识图谱中多个实体之间的相关关系,提高了利用所述医疗知识图谱进行进一步分析的效率。将医疗知识图谱作为医疗信息检索的底层数据支撑,不仅可以依赖医疗知识图谱庞大的关系网络检索到更广泛更精准的医疗信息,而且可以将各类相关信息进行有效关联,使得检索结果更为全面。In the embodiment of the present application, the medical knowledge map is constructed based on the medical related data, which can intuitively reflect the correlation between multiple entities in the medical knowledge map, and improve the efficiency of further analysis using the medical knowledge map . Using the medical knowledge map as the underlying data support for medical information retrieval can not only rely on the huge relational network of the medical knowledge map to retrieve more extensive and accurate medical information, but also effectively associate various related information to make the search results more comprehensive. .
具体地,根据所述场景类别在所述医疗知识图谱中索引出所述原始用户查询语句对应的答案。针对所述原始用户查询语句的三种情况,返回情况分别为:在第一场景下用户输入“上呼吸道感染”,检索出当前所有实体对应的关系以内的所有实体及实体属性,并按实体类别区分,如包括并发症、症状、药品、问答、案例、视频文章等。在第二场景下用户输入“上呼吸道感染和感冒的区别”,检索出上“呼吸道感染”和“感冒”实体相同属性的对比。在第一场景下用户输入“上呼吸道感染可以吃罗红霉素吗”,在所述医疗知识图谱中查询疾病“上呼吸道感染”和药品“罗红霉素”之间的关系,并给出“上呼吸道感染”的推荐药品。Specifically, the answer corresponding to the original user query statement is indexed in the medical knowledge graph according to the scene category. For the three situations of the original user query statement, the returned situations are as follows: in the first scene, the user enters "upper respiratory tract infection", retrieves all entities and entity attributes within the relationship corresponding to all current entities, and sorts them by entity category Distinguish, such as including complications, symptoms, medicines, questions and answers, cases, video articles, etc. In the second scenario, the user enters "difference between upper respiratory tract infection and cold", and a comparison of the same attributes of the upper "respiratory tract infection" and "cold" entities is retrieved. In the first scene, the user enters "Can I take roxithromycin for upper respiratory tract infection", and queries the relationship between the disease "upper respiratory tract infection" and the drug "roxithromycin" in the medical knowledge map, and gives Recommended medicines for "Upper Respiratory Tract Infections".
本申请实施例通过利用预设的实体关系联合抽取模型对原始用户查询语句进行实体关系抽取,得到实体及实体之间的关系,实体关系更体现出语义信息,将原始用户查询语句输入至预设的意图识别模型中进行意图识别,得到意图识别结果,确定了用户的意图,提高后续问题解答的精确度,根据实体、实体之间的关系以及意图识别结果对原始用户查询语句进行场景分类,根据场景类别在医疗知识图谱中索引出所述原始用户查询语句对应的答案,所述医疗知识图谱中医疗知识的关联性较强,且根据场景类别进行索引,可以更准确的提取出医疗问题对应的答案。因此本申请提出的基于知识图谱的医疗问题解答方法可以解决进行医疗问题解答时的准确度较低的问题。In the embodiment of the present application, the entity relationship is extracted from the original user query statement by using the preset entity relationship joint extraction model to obtain the entity and the relationship between the entities. The entity relationship reflects semantic information, and the original user query statement is input into the preset Intent recognition is carried out in the intent recognition model, and the intent recognition result is obtained, the user’s intention is determined, and the accuracy of subsequent question answering is improved. The original user query is classified according to the entity, the relationship between entities, and the intent recognition result. The scenario category indexes the answers corresponding to the original user query statements in the medical knowledge graph. The medical knowledge in the medical knowledge graph is highly relevant, and indexing according to the scenario category can more accurately extract the corresponding answers to the medical questions. Answer. Therefore, the method for answering medical questions based on the knowledge map proposed in this application can solve the problem of low accuracy in answering medical questions.
如图2所示,是本申请一实施例提供的基于知识图谱的医疗问题解答装置的功能模块图。As shown in FIG. 2 , it is a functional block diagram of a medical question answering device based on a knowledge map provided by an embodiment of the present application.
本申请所述基于知识图谱的医疗问题解答装置100可以安装于电子设备中。根据实现的功能,所述基于知识图谱的医疗问题解答装置100可以包括实体关系抽取模块101、意图识别模块102、场景分类模块103及答案索引模块104。本申请所述模块也可以称之为单元,是指一种能够被电子设备处理器所执行,并且能够完成固定功能的一系列计算机程序段,其存储在电子设备的存储器中。The medical question answering device 100 based on the knowledge graph described in this application can be installed in an electronic device. According to the realized functions, the knowledge map-based medical question answering device 100 may include an entity relationship extraction module 101 , an intent recognition module 102 , a scene classification module 103 and an answer indexing module 104 . The module described in this application can also be called a unit, which refers to a series of computer program segments that can be executed by the processor of the electronic device and can complete fixed functions, and are stored in the memory of the electronic device.
在本实施例中,关于各模块/单元的功能如下:In this embodiment, the functions of each module/unit are as follows:
所述实体关系抽取模块101,用于获取原始用户查询语句,利用预设的实体关系联合抽取模型对所述原始用户查询语句进行实体关系抽取,得到实体及实体之间的关系;The entity relationship extraction module 101 is configured to obtain an original user query statement, and use a preset entity relationship joint extraction model to perform entity relationship extraction on the original user query statement to obtain entities and relationships between entities;
所述意图识别模块102,用于将所述原始用户查询语句输入至预设的意图识别模型中进行意图识别,得到意图识别结果;The intent recognition module 102 is configured to input the original user query sentence into a preset intent recognition model for intent recognition, and obtain an intent recognition result;
所述场景分类模块103,用于根据所述实体、所述实体之间的关系以及所述意图识别结果对所述原始用户查询语句进行场景分类,得到所述原始用户查询语句对应的场景类别;The scene classification module 103 is configured to classify the scene of the original user query statement according to the entity, the relationship between the entities and the intention recognition result, and obtain the scene category corresponding to the original user query statement;
所述答案索引模块104,用于获取预构建的医疗知识图谱,根据所述场景类别在所述医疗知识图谱中索引出所述原始用户查询语句对应的答案。The answer indexing module 104 is configured to obtain a pre-built medical knowledge map, and index the answer corresponding to the original user query statement in the medical knowledge map according to the scene category.
详细地,所述基于知识图谱的医疗问题解答装置100各模块的具体实施方式如下:In detail, the specific implementation of each module of the knowledge graph-based medical question answering device 100 is as follows:
步骤一、获取原始用户查询语句,利用预设的实体关系联合抽取模型对所述原始用户查询语句进行实体关系抽取,得到实体及实体之间的关系。Step 1: Obtain the original user query statement, and use the preset entity-relationship joint extraction model to perform entity-relationship extraction on the original user query statement to obtain entities and relationships between entities.
本申请实施例中,所述原始用户查询语句为患者想要查询医疗问题的询问语句,例如,所述原始用户查询语句为:“上呼吸道感染”、“上呼吸道感染和感冒的区别”或者“上呼吸道感染可以吃罗红霉素吗”。In the embodiment of the present application, the original user query sentence is a query sentence that the patient wants to inquire about medical problems. For example, the original user query sentence is: "upper respiratory tract infection", "difference between upper respiratory tract infection and cold" or " Can I take roxithromycin for upper respiratory tract infection?"
具体地,所述利用预设的实体关系联合抽取模型对所述原始用户查询语句进行实体关系抽取,得到实体及实体之间的关系,包括:Specifically, using the preset entity-relationship joint extraction model to perform entity-relationship extraction on the original user query statement to obtain entities and relationships between entities includes:
利用所述实体关系联合抽取模型中的共享编码层对所述原始用户查询语句进行编码处理,得到原始编码数据;encoding the original user query statement by using the shared encoding layer in the joint entity-relationship extraction model to obtain original encoded data;
将所述原始编码数据输入至所述实体关系联合抽取模型中的实体识别模块中进行实体识别,得到一个或者多个实体;Inputting the original coded data into the entity recognition module in the entity-relationship joint extraction model for entity recognition to obtain one or more entities;
将所述多个实体输入至所述实体关系联合抽取模型中的关系抽取模块中,得到实体之间的关系。The multiple entities are input into the relationship extraction module in the entity-relationship joint extraction model to obtain the relationship between the entities.
详细地,所述实体关系联合抽取模型中包含共享编码层、实体识别模块和关系抽取模块,其中,所述共享编码层为Embedding层,可以利用Bert模型作为所述共享编码层,即利用Bert模型作为Embedding层,所述实体识别模块由Bi-LSTM和CRF层构成,所述关系抽取模块由全连接层和Sigmoid函数构成。In detail, the entity-relationship joint extraction model includes a shared coding layer, an entity recognition module and a relationship extraction module, wherein the shared coding layer is an Embedding layer, and the Bert model can be used as the shared coding layer, that is, the Bert model As the Embedding layer, the entity recognition module is composed of Bi-LSTM and CRF layer, and the relationship extraction module is composed of fully connected layer and Sigmoid function.
其中,对所述原始用户查询语句进行编码处理,可以增强所述原始用户查询语句的特征表征能力。Wherein, performing encoding processing on the original user query sentence can enhance the feature representation capability of the original user query sentence.
进一步地,所述将所述原始编码数据输入至所述实体关系联合抽取模型中的实体识别模块中进行实体识别,得到一个或者多个实体,包括:Further, the input of the original coded data into the entity recognition module in the entity-relationship joint extraction model is carried out for entity recognition, and one or more entities are obtained, including:
通过所述实体识别模块中的输入门计算所述原始编码数据的状态值;calculating the state value of the original coded data through an input gate in the entity recognition module;
利用所述实体识别模块中的遗忘门计算所述原始编码数据的激活值;calculating the activation value of the original coded data by using the forget gate in the entity recognition module;
根据所述状态值和所述激活值计算所述原始编码数据的状态更新值;calculating a state update value of the original encoded data according to the state value and the activation value;
利用所述输出门计算所述状态更新值对应的初始文本序列;using the output gate to calculate an initial text sequence corresponding to the state update value;
将所述初始文本序列输入至全连接层中计算得到对应的发射概率,并采用CRF层计算预设标签对应的转移概率;Input the initial text sequence into the fully connected layer to calculate the corresponding emission probability, and use the CRF layer to calculate the transition probability corresponding to the preset label;
根据所述转移概率和所述发射概率对所述初始文本序列进行标记,得到一个或者多个实体。The initial text sequence is marked according to the transition probability and the emission probability to obtain one or more entities.
详细地,所述实体识别模块由Bi-LSTM和CRF层构成,其中,所述Bi-LSTM(LongShort-TermMemory,双向长短期记忆网络)是一种时间循环神经网络,包括:输入门、遗忘门以及输出门。In detail, the entity recognition module is composed of a Bi-LSTM and a CRF layer, wherein the Bi-LSTM (LongShort-TermMemory, bidirectional long-short-term memory network) is a time cyclic neural network, including: an input gate, a forgetting gate and the output gate.
一可选实施例中,所述状态值的计算方法包括:In an optional embodiment, the calculation method of the state value includes:
Figure PCTCN2022087817-appb-000008
Figure PCTCN2022087817-appb-000008
其中,i t表示状态值,
Figure PCTCN2022087817-appb-000009
表示输入门中细胞单元的偏置,w i表示输入门的激活因子,h t-1表示原始编码数据在输入门t-1时刻的峰值,x t表示在t时刻的原始编码数据,b i表示输入门中细胞单元的权重。
Among them, it represents the state value,
Figure PCTCN2022087817-appb-000009
Represents the bias of the cell unit in the input gate, w i represents the activation factor of the input gate, h t-1 represents the peak value of the original encoded data at the time t-1 of the input gate, x t represents the original encoded data at time t, b i Indicates the weight of the cell unit in the input gate.
一可选实施例中,所述激活值的计算方法包括:In an optional embodiment, the calculation method of the activation value includes:
Figure PCTCN2022087817-appb-000010
Figure PCTCN2022087817-appb-000010
其中,f t表示激活值,
Figure PCTCN2022087817-appb-000011
表示遗忘门中细胞单元的偏置,w f表示遗忘门的激活因子,
Figure PCTCN2022087817-appb-000012
表示原始编码数据在所述遗忘门t-1时刻的峰值,x t表示在t时刻输入的原始编码数据,b f表示遗忘门中细胞单元的权重。
where f t represents the activation value,
Figure PCTCN2022087817-appb-000011
Represents the bias of the cell unit in the forget gate, w f represents the activation factor of the forget gate,
Figure PCTCN2022087817-appb-000012
represents the peak value of the original coded data at time t-1 of the forget gate, x t represents the original coded data input at time t, and b f represents the weight of the cell unit in the forget gate.
一可选实施例中,所述状态更新值的计算方法包括:In an optional embodiment, the calculation method of the status update value includes:
Figure PCTCN2022087817-appb-000013
Figure PCTCN2022087817-appb-000013
其中,c t表示状态更新值,h t-1表示原始编码数据在输入门t-1时刻的峰值,
Figure PCTCN2022087817-appb-000014
表示原始编码数据在遗忘门t-1时刻的峰值。
Among them, c t represents the state update value, h t-1 represents the peak value of the original encoded data at the time of input gate t-1,
Figure PCTCN2022087817-appb-000014
Indicates the peak value of the original encoded data at the moment of forgetting gate t-1.
一可选实施例中,所述利用输出门计算状态更新值对应的初始文本序列包括:利用如下公式计算初始文本序列:In an optional embodiment, the calculating the initial text sequence corresponding to the state update value using the output gate includes: calculating the initial text sequence using the following formula:
o t=tan h(c t) o t =tan h(c t )
其中,o t表示初始文本序列,tan h表示输出门的激活函数,c t表示状态更新值。 Among them, o t represents the initial text sequence, tan h represents the activation function of the output gate, and ct represents the state update value.
具体地,将所述多个实体输入至所述实体关系联合抽取模型中的关系抽取模块中,得到实体之间的关系,将所述原始编码数据、所述预设标签以及尾实体的相对位置信息进行拼接并传入全连接层,通过Sigmoid函数计算尾实体的起始位置的概率,最终通过解析得到(头实体,关系,尾实体)实体关系三元组。Specifically, the multiple entities are input into the relationship extraction module in the entity-relationship joint extraction model to obtain the relationship between entities, and the original coded data, the preset label and the relative position of the tail entity The information is spliced and passed to the fully connected layer, and the probability of the starting position of the tail entity is calculated through the Sigmoid function, and finally the (head entity, relationship, tail entity) entity-relationship triplet is obtained through parsing.
步骤二、将所述原始用户查询语句输入至预设的意图识别模型中进行意图识别,得到意图识别结果。Step 2: Input the original user query sentence into a preset intent recognition model for intent recognition, and obtain an intent recognition result.
本申请实施例中,所述将所述原始用户查询语句输入至预设的意图识别模型中进行意图识别,得到意图识别结果,包括:In the embodiment of the present application, the input of the original user query sentence into a preset intent recognition model for intent recognition, and obtaining the intent recognition result include:
利用所述意图识别模型的输入层对所述原始用户查询语句进行向量化处理,得到用户查询向量;Using the input layer of the intent recognition model to vectorize the original user query statement to obtain a user query vector;
利用所述意图识别模型的卷积层对所述用户查询向量进行卷积处理,得到卷积数据集;Using the convolution layer of the intention recognition model to perform convolution processing on the user query vector to obtain a convolution data set;
将所述卷积数据集输入至所述意图识别模型中的池化层及全连接层中,得到分类结果;Inputting the convolution data set into the pooling layer and the fully connected layer in the intent recognition model to obtain classification results;
利用预设的意图识别标签对所述分类结果进行标记,得到意图识别结果。The classification result is marked with a preset intent recognition label to obtain an intent recognition result.
其中,在本方案中,所述意图识别模型可以为Text-CNN深度学习模型。Wherein, in this solution, the intent recognition model may be a Text-CNN deep learning model.
详细地,所述意图识别模型由四个部分构成:输入层、卷积层、池化层和全连接层。所述输入层需要输入一个定长的文本序列,所述向量化处理可以采用word2vec、fastText或者Glove等词向量工具,也可以利用Bert模型进行处理。所述卷积层一般包含多个不同 尺寸的的卷积核,卷积核只进行一维的滑动,即卷积核的宽度与向量的维度等宽。所述池化层使用了Max-pool,不仅减少所述意图识别模型的参数,又保证了在不定长的卷积层的输出上获得一个定长的全连接层的输入。所述全连接层的作用就是分类器,原始的Text-CNN模型使用了只有一层隐藏层的全连接网络,相当于把卷积与池化层提取的特征输入到一个LR分类器中进行分类。In detail, the intent recognition model consists of four parts: an input layer, a convolutional layer, a pooling layer and a fully connected layer. The input layer needs to input a fixed-length text sequence, and the vectorization processing can use word vector tools such as word2vec, fastText or Glove, and can also use the Bert model for processing. The convolution layer generally includes a plurality of convolution kernels of different sizes, and the convolution kernel only performs one-dimensional sliding, that is, the width of the convolution kernel is equal to the dimension of the vector. The pooling layer uses Max-pool, which not only reduces the parameters of the intent recognition model, but also ensures that the input of a fixed-length fully connected layer is obtained from the output of the variable-length convolution layer. The function of the fully connected layer is a classifier. The original Text-CNN model uses a fully connected network with only one hidden layer, which is equivalent to inputting the features extracted by the convolution and pooling layers into an LR classifier for classification. .
例如,所述意图识别结果主要分为有意图和无意图,当所述意图识别结果为有意图时,识别的意图可以为并发症、相关症状、推荐药品、是否可以等多个意图类型。For example, the intention recognition result is mainly divided into intention and non-intent. When the intention recognition result is intention, the recognized intention may be multiple intention types such as complications, related symptoms, recommended medicines, and whether it is possible or not.
步骤三、根据所述实体、所述实体之间的关系以及所述意图识别结果对所述原始用户查询语句进行场景分类,得到所述原始用户查询语句对应的场景类别。Step 3: Perform scene classification on the original user query statement according to the entity, the relationship between the entities, and the intent recognition result, to obtain the scene category corresponding to the original user query statement.
本申请实施例中,由于所述原始用户查询语句中可能识别出一个实体或者多个实体,实体和实体之间可能存在关系或者存在特定意图,根据所述实体及实体之间的关系以及所述意图识别结果对所述原始用户查询语句进行场景分类。In the embodiment of the present application, since one entity or multiple entities may be identified in the original user query statement, there may be a relationship or a specific intention between entities, according to the entity and the relationship between entities and the The intent recognition result performs scene classification on the original user query statement.
具体地,所述根据所述实体、所述实体之间的关系以及所述意图识别结果对所述原始用户查询语句进行场景分类,得到所述原始用户查询语句对应的场景类别,包括:Specifically, performing scene classification on the original user query statement according to the entity, the relationship between the entities, and the intent recognition result, to obtain the scene category corresponding to the original user query statement, including:
将所述实体之间的关系为无关系且所述意图识别结果为无意图的原始用户查询语句对应的场景类别归为第一场景;Classifying the scene category corresponding to the original user query statement in which the relationship between the entities is no relationship and the intention recognition result is no intention as the first scene;
将所述实体之间的关系为无关系且所述意图识别结果为有意图的原始用户查询语句对应的场景类别归为第二场景;Classifying the scene category corresponding to the original user query statement in which the relationship between the entities is non-relationship and the intention recognition result is intentional as the second scene;
将所述实体之间的关系为有关系且所述意图识别结果为有意图的原始用户查询语句对应的场景类别归为第三场景。The scene category corresponding to the original user query statement in which the relationship between the entities is related and the intention recognition result is intention is classified as the third scene.
例如,所述原始用户查询语句“上呼吸道感染”属于单个或多个实体无关系且无意图,因此将其归为第一场景,所述原始用户查询语句“上呼吸道感染和感冒的区别”无关系且有意图,因此将其归为第二场景,所述原始用户查询语句“上呼吸道感染可以吃罗红霉素吗”有关系且有意图,因此将其归为第三场景。For example, the original user query sentence "upper respiratory tract infection" belongs to a single or multiple entities and has no relationship and no intention, so it is classified as the first scene, and the original user query sentence "difference between upper respiratory tract infection and cold" has no relationship and intention, so it is classified as the second scene, and the original user query sentence "can I take roxithromycin for upper respiratory tract infection" is related and intentional, so it is classified as the third scene.
详细地,根据所述实体、实体之间的关系以及所述意图识别结果对所述原始用户查询语句进行场景分类,更关注于用户的语义信息,包括所述原始用户查询语句中的实体和实体之间的关系及检索意图。In detail, perform scene classification on the original user query statement according to the entity, the relationship between entities, and the intent recognition result, and pay more attention to the semantic information of the user, including the entity and entity in the original user query statement relationship and retrieval intent.
步骤四、获取预构建的医疗知识图谱,根据所述场景类别在所述医疗知识图谱中索引出所述原始用户查询语句对应的答案。Step 4: Obtain a pre-built medical knowledge map, and index the answer corresponding to the original user query statement in the medical knowledge map according to the scene category.
本申请实施例中,所述获取预构建的医疗知识图谱,所述方法还包括:In the embodiment of the present application, the method of acquiring a pre-built medical knowledge graph further includes:
获取医疗相关数据,对所述医疗相关数据进行结构化处理,得到结构化数据;Obtaining medical related data, performing structured processing on the medical related data, to obtain structured data;
对所述结构化数据进行实体抽取得到实体信息,对所述结构化数据进行关系抽取得到相关关系;performing entity extraction on the structured data to obtain entity information, and performing relationship extraction on the structured data to obtain related relationships;
根据所述实体信息和所述相关关系构建得到多个三元组,并利用所述多个三元组得到医疗知识图谱。A plurality of triplets are constructed according to the entity information and the correlation relationship, and a medical knowledge map is obtained by using the multiple triplets.
详细地,所述医疗相关数据包含医疗相关的大量数据,例如,常见的疾病名称、对应的疾病症状、治疗的药品、疾病的案例、相关检查和用药说明等。对所述医疗相关数据进行结构化处理即对所述医疗相关数据进行定义,得到结构化数据。In detail, the medical-related data includes a large amount of medical-related data, such as common disease names, corresponding disease symptoms, medicines for treatment, disease cases, related examinations and medication instructions, etc. Structuring the medical-related data means defining the medical-related data to obtain structured data.
例如,所述医疗相关数据中包含上呼吸道感染、感冒、糖尿病、罗红霉素等,将上呼吸道感染、感冒和糖尿病定义为疾病,将罗红霉素定义为药品。For example, the medical-related data includes upper respiratory tract infection, cold, diabetes, roxithromycin, etc., upper respiratory tract infection, cold and diabetes are defined as diseases, and roxithromycin is defined as medicine.
具体地,所述实体信息包括但不限于医疗实体、医疗属性实体等,常见的医疗实体,如疾病、症状、药品、治疗手段、检查检验等,常见的医学属性,如概述、病因、病症、就医、治疗、用药说明、药品功效等。所述相关信息如常见并发症、典型症状、就诊科室、推荐药品、相关检查等。Specifically, the entity information includes but is not limited to medical entities, medical attribute entities, etc., common medical entities, such as diseases, symptoms, medicines, treatments, inspections, etc., common medical attributes, such as overview, etiology, disease, Medical treatment, treatment, medication instructions, drug efficacy, etc. The relevant information includes common complications, typical symptoms, departments visited, recommended medicines, and related examinations.
进一步地,本申请实施例中,根据所述实体信息和所述相关关系构建得到多个三元组, 并利用所述多个三元组得到医疗知识图谱。所述三元组为“实体+关系=实体”的信息表现形式,例如:感冒的症状是流鼻涕,用三元组表示为“感冒+症状=流鼻涕”。上呼吸道感染可以吃罗红霉素,用三元组表示为“上呼吸道感染+药品=罗红霉素”。Further, in the embodiment of the present application, multiple triples are constructed according to the entity information and the correlation relationship, and the medical knowledge map is obtained by using the multiple triples. The triplet is an information representation form of "entity+relationship=entity". For example, the symptom of a cold is a runny nose, and the triplet is expressed as "cold+symptom=runny nose". You can take roxithromycin for upper respiratory tract infection, expressed as "upper respiratory tract infection + drug = roxithromycin" in triplets.
本申请实施例中,根据所述医疗相关数据构建医疗知识图谱,可直观地反映出所述医疗知识图谱中多个实体之间的相关关系,提高了利用所述医疗知识图谱进行进一步分析的效率。将医疗知识图谱作为医疗信息检索的底层数据支撑,不仅可以依赖医疗知识图谱庞大的关系网络检索到更广泛更精准的医疗信息,而且可以将各类相关信息进行有效关联,使得检索结果更为全面。In the embodiment of the present application, the medical knowledge map is constructed based on the medical related data, which can intuitively reflect the correlation between multiple entities in the medical knowledge map, and improve the efficiency of further analysis using the medical knowledge map . Using the medical knowledge map as the underlying data support for medical information retrieval can not only rely on the huge relational network of the medical knowledge map to retrieve more extensive and accurate medical information, but also effectively associate various related information to make the search results more comprehensive. .
具体地,根据所述场景类别在所述医疗知识图谱中索引出所述原始用户查询语句对应的答案。针对所述原始用户查询语句的三种情况,返回情况分别为:在第一场景下用户输入“上呼吸道感染”,检索出当前所有实体对应的关系以内的所有实体及实体属性,并按实体类别区分,如包括并发症、症状、药品、问答、案例、视频文章等。在第二场景下用户输入“上呼吸道感染和感冒的区别”,检索出上“呼吸道感染”和“感冒”实体相同属性的对比。在第一场景下用户输入“上呼吸道感染可以吃罗红霉素吗”,在所述医疗知识图谱中查询疾病“上呼吸道感染”和药品“罗红霉素”之间的关系,并给出“上呼吸道感染”的推荐药品。Specifically, the answer corresponding to the original user query statement is indexed in the medical knowledge graph according to the scene category. For the three situations of the original user query statement, the returned situations are as follows: in the first scene, the user enters "upper respiratory tract infection", retrieves all entities and entity attributes within the relationship corresponding to all current entities, and sorts them by entity category Distinguish, such as including complications, symptoms, medicines, questions and answers, cases, video articles, etc. In the second scenario, the user enters "difference between upper respiratory tract infection and cold", and a comparison of the same attributes of the upper "respiratory tract infection" and "cold" entities is retrieved. In the first scene, the user enters "Can I take roxithromycin for upper respiratory tract infection", and queries the relationship between the disease "upper respiratory tract infection" and the drug "roxithromycin" in the medical knowledge map, and gives Recommended medicines for "Upper Respiratory Tract Infections".
本申请实施例通过利用预设的实体关系联合抽取模型对原始用户查询语句进行实体关系抽取,得到实体及实体之间的关系,实体关系更体现出语义信息,将原始用户查询语句输入至预设的意图识别模型中进行意图识别,得到意图识别结果,确定了用户的意图,提高后续问题解答的精确度,根据实体、实体之间的关系以及意图识别结果对原始用户查询语句进行场景分类,根据场景类别在医疗知识图谱中索引出所述原始用户查询语句对应的答案,所述医疗知识图谱中医疗知识的关联性较强,且根据场景类别进行索引,可以更准确的提取出医疗问题对应的答案。因此本申请提出的基于知识图谱的医疗问题解答装置可以解决进行医疗问题解答时的准确度较低的问题。In the embodiment of the present application, the entity relationship is extracted from the original user query statement by using the preset entity relationship joint extraction model to obtain the entity and the relationship between the entities. The entity relationship reflects semantic information, and the original user query statement is input into the preset Intent recognition is carried out in the intent recognition model, and the intent recognition result is obtained, the user’s intention is determined, and the accuracy of subsequent question answering is improved. The original user query is classified according to the entity, the relationship between entities, and the intent recognition result. The scenario category indexes the answers corresponding to the original user query statements in the medical knowledge graph. The medical knowledge in the medical knowledge graph is highly relevant, and indexing according to the scenario category can more accurately extract the corresponding answers to the medical questions. Answer. Therefore, the medical question answering device based on the knowledge map proposed in this application can solve the problem of low accuracy in answering medical questions.
如图3所示,是本申请一实施例提供的实现基于知识图谱的医疗问题解答方法的电子设备的结构示意图。As shown in FIG. 3 , it is a schematic structural diagram of an electronic device implementing a knowledge graph-based medical question answering method provided by an embodiment of the present application.
所述电子设备1可以包括处理器10、存储器11、通信总线12以及通信接口13,还可以包括存储在所述存储器11中并可在所述处理器10上运行的计算机程序,如基于知识图谱的医疗问题解答程序。The electronic device 1 may include a processor 10, a memory 11, a communication bus 12, and a communication interface 13, and may also include a computer program stored in the memory 11 and operable on the processor 10, such as a knowledge map based medical question answering program.
其中,所述处理器10在一些实施例中可以由集成电路组成,例如可以由单个封装的集成电路所组成,也可以是由多个相同功能或不同功能封装的集成电路所组成,包括一个或者多个中央处理器(CentralProcessingunit,CPU)、微处理器、数字处理芯片、图形处理器及各种控制芯片的组合等。所述处理器10是所述电子设备的控制核心(ControlUnit),利用各种接口和线路连接整个电子设备的各个部件,通过运行或执行存储在所述存储器11内的程序或者模块(例如执行基于知识图谱的医疗问题解答程序等),以及调用存储在所述存储器11内的数据,以执行电子设备的各种功能和处理数据。Wherein, the processor 10 may be composed of integrated circuits in some embodiments, for example, may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits with the same function or different functions packaged, including one or Combinations of multiple central processing units (Central Processing unit, CPU), microprocessors, digital processing chips, graphics processors and various control chips, etc. The processor 10 is the control core (ControlUnit) of the electronic device, and utilizes various interfaces and lines to connect the various parts of the entire electronic device, by running or executing programs or modules stored in the memory 11 (for example, executing based on medical question answering program of knowledge graph, etc.), and call the data stored in the memory 11 to execute various functions of the electronic device and process data.
所述存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、移动硬盘、多媒体卡、卡型存储器(例如:SD或DX存储器等)、磁性存储器、磁盘、光盘等,所述计算机可读存储介质可以是非易失性的,也可以是易失性的。所述存储器11在一些实施例中可以是电子设备的内部存储单元,例如该电子设备的移动硬盘。所述存储器11在另一些实施例中也可以是电子设备的外部存储设备,例如电子设备上配备的插接式移动硬盘、智能存储卡(SmartMediaCard,SMC)、安全数字(SecureDigital,SD)卡、闪存卡(FlashCard)等。进一步地,所述存储器11还可以既包括电子设备的内部存储单元也包括外部存储设备。所述存储器11不仅可以用于存储安装于电子设备的应用软件及各类数 据,例如基于知识图谱的医疗问题解答程序的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。The memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card type memory (for example: SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. , the computer-readable storage medium may be non-volatile or volatile. The storage 11 may be an internal storage unit of the electronic device in some embodiments, such as a mobile hard disk of the electronic device. The memory 11 may also be an external storage device of the electronic device in other embodiments, such as a plug-in mobile hard disk equipped on the electronic device, a smart memory card (SmartMediaCard, SMC), a secure digital (SecureDigital, SD) card, Flash card (FlashCard), etc. Further, the memory 11 may also include both an internal storage unit of the electronic device and an external storage device. The memory 11 can not only be used to store application software and various data installed in electronic devices, such as codes of medical question answering programs based on knowledge graphs, but can also be used to temporarily store data that has been output or will be output.
所述通信总线12可以是外设部件互连标准(peripheralcomponentinterconnect,简称PCI)总线或扩展工业标准结构(extendedindustrystandardarchitecture,简称EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。所述总线被设置为实现所述存储器11以及至少一个处理器10等之间的连接通信。The communication bus 12 may be a peripheral component interconnect standard (PCI for short) bus or an extended industry standard architecture (EISA for short) bus or the like. The bus can be divided into address bus, data bus, control bus and so on. The bus is configured to realize connection and communication between the memory 11 and at least one processor 10 and the like.
所述通信接口13用于上述电子设备与其他设备之间的通信,包括网络接口和用户接口。可选地,所述网络接口可以包括有线接口和/或无线接口(如WI-FI接口、蓝牙接口等),通常用于在该电子设备与其他电子设备之间建立通信连接。所述用户接口可以是显示器(Display)、输入单元(比如键盘(Keyboard)),可选地,用户接口还可以是标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(OrganicLight-EmittingDiode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在电子设备中处理的信息以及用于显示可视化的用户界面。The communication interface 13 is used for communication between the electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which are generally used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a display (Display) or an input unit (such as a keyboard (Keyboard)). Optionally, the user interface may also be a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode, Organic Light Emitting Diode) touch device, and the like. Wherein, the display may also be properly referred to as a display screen or a display unit, and is used for displaying information processed in the electronic device and for displaying a visualized user interface.
图3仅示出了具有部件的电子设备,本领域技术人员可以理解的是,图3示出的结构并不构成对所述电子设备1的限定,可以包括比图示更少或者更多的部件,或者组合某些部件,或者不同的部件布置。FIG. 3 only shows an electronic device with components. Those skilled in the art can understand that the structure shown in FIG. 3 does not constitute a limitation to the electronic device 1, and may include fewer or more components, or combinations of certain components, or different arrangements of components.
例如,尽管未示出,所述电子设备还可以包括给各个部件供电的电源(比如电池),优选地,电源可以通过电源管理装置与所述至少一个处理器10逻辑相连,从而通过电源管理装置实现充电管理、放电管理、以及功耗管理等功能。电源还可以包括一个或一个以上的直流或交流电源、再充电装置、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。所述电子设备还可以包括多种传感器、蓝牙模块、Wi-Fi模块等,在此不再赘述。For example, although not shown, the electronic device may also include a power supply (such as a battery) for supplying power to various components. Preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so that Realize functions such as charge management, discharge management, and power consumption management. The power supply may also include one or more DC or AC power supplies, recharging devices, power failure detection circuits, power converters or inverters, power status indicators and other arbitrary components. The electronic device may also include various sensors, a Bluetooth module, a Wi-Fi module, etc., which will not be described in detail here.
应该了解,所述实施例仅为说明之用,在专利申请范围上并不受此结构的限制。It should be understood that the embodiments are only for illustration, and are not limited by the structure in terms of the scope of the patent application.
所述电子设备1中的所述存储器11存储的基于知识图谱的医疗问题解答程序是多个指令的组合,在所述处理器10中运行时,可以实现:The medical question answering program based on the knowledge map stored in the memory 11 of the electronic device 1 is a combination of multiple instructions, and when running in the processor 10, it can realize:
获取原始用户查询语句,利用预设的实体关系联合抽取模型对所述原始用户查询语句进行实体关系抽取,得到实体及实体之间的关系;Obtain the original user query statement, and use the preset entity-relationship joint extraction model to perform entity-relationship extraction on the original user query statement to obtain entities and relationships between entities;
将所述原始用户查询语句输入至预设的意图识别模型中进行意图识别,得到意图识别结果;inputting the original user query sentence into a preset intent recognition model to perform intent recognition, and obtain an intent recognition result;
根据所述实体、所述实体之间的关系以及所述意图识别结果对所述原始用户查询语句进行场景分类,得到所述原始用户查询语句对应的场景类别;performing scene classification on the original user query statement according to the entity, the relationship between the entities, and the intent recognition result, to obtain the scene category corresponding to the original user query statement;
获取预构建的医疗知识图谱,根据所述场景类别在所述医疗知识图谱中索引出所述原始用户查询语句对应的答案。A pre-built medical knowledge map is obtained, and an answer corresponding to the original user query statement is indexed in the medical knowledge map according to the scene category.
具体地,所述处理器10对上述指令的具体实现方法可参考附图对应实施例中相关步骤的描述,在此不赘述。Specifically, for the specific implementation method of the above instructions by the processor 10, reference may be made to the description of relevant steps in the corresponding embodiments in the drawings, and details are not repeated here.
进一步地,所述电子设备1集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读存储介质中。所述计算机可读存储介质可以是易失性的,也可以是非易失性的。例如,所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-OnlyMemory)。Further, if the integrated modules/units of the electronic device 1 are realized in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. The computer-readable storage medium may be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a removable hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM, Read-Only Memory) ).
本申请还提供一种计算机可读存储介质,所述可读存储介质存储有计算机程序,所述计算机程序在被电子设备的处理器所执行时,可以实现:The present application also provides a computer-readable storage medium, the readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, it can realize:
获取原始用户查询语句,利用预设的实体关系联合抽取模型对所述原始用户查询语句进行实体关系抽取,得到实体及实体之间的关系;Obtain the original user query statement, and use the preset entity-relationship joint extraction model to perform entity-relationship extraction on the original user query statement to obtain entities and relationships between entities;
将所述原始用户查询语句输入至预设的意图识别模型中进行意图识别,得到意图识别结果;inputting the original user query sentence into a preset intent recognition model to perform intent recognition, and obtain an intent recognition result;
根据所述实体、所述实体之间的关系以及所述意图识别结果对所述原始用户查询语句进行场景分类,得到所述原始用户查询语句对应的场景类别;performing scene classification on the original user query statement according to the entity, the relationship between the entities, and the intent recognition result, to obtain the scene category corresponding to the original user query statement;
获取预构建的医疗知识图谱,根据所述场景类别在所述医疗知识图谱中索引出所述原始用户查询语句对应的答案。A pre-built medical knowledge map is obtained, and an answer corresponding to the original user query statement is indexed in the medical knowledge map according to the scene category.
在本申请所提供的几个实施例中,应该理解到,所揭露的设备,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In the several embodiments provided in this application, it should be understood that the disclosed devices, devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能模块的形式实现。In addition, each functional module in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware, or in the form of hardware plus software function modules.
对于本领域技术人员而言,显然本申请不限于上述示范性实施例的细节,而且在不背离本申请的精神或基本特征的情况下,能够以其他的具体形式实现本申请。It will be apparent to those skilled in the art that the present application is not limited to the details of the exemplary embodiments described above, but that the present application can be implemented in other specific forms without departing from the spirit or essential characteristics of the present application.
因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本申请的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本申请内。不应将权利要求中的任何附关联图标记视为限制所涉及的权利要求。Therefore, the embodiments should be regarded as exemplary and not restrictive in all points of view, and the scope of the application is defined by the appended claims rather than the foregoing description, and it is intended that the scope of the present application be defined by the appended claims rather than by the foregoing description. All changes within the meaning and range of equivalents of the elements are embraced in this application. Any reference sign in a claim should not be construed as limiting the claim concerned.
本申请所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(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 (Blockchain), essentially a decentralized database, is a series of data blocks associated with each other using cryptographic methods. Each data block contains a batch of network transaction information, which is used 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.
本申请实施例可以基于人工智能技术对相关的数据进行获取和处理。其中,人工智能(ArtificialIntelligence,AI)是利用数字计算机或者数字计算机控制的机器模拟、延伸和扩展人的智能,感知环境、获取知识并使用知识获得最佳结果的理论、方法、技术及应用系统。The embodiments of the present application may acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
此外,显然“包括”一词不排除其他单元或步骤,单数不排除复数。系统权利要求中陈述的多个单元或装置也可以由一个单元或装置通过软件或者硬件来实现。第一、第二等词语用来表示名称,而并不表示任何特定的顺序。In addition, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or devices stated in the system claims may also be realized by one unit or device through software or hardware. The terms first, second, etc. are used to denote names and do not imply any particular order.
最后应说明的是,以上实施例仅用以说明本申请的技术方案而非限制,尽管参照较佳实施例对本申请进行了详细说明,本领域的普通技术人员应当理解,可以对本申请的技术方案进行修改或等同替换,而不脱离本申请技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application without limitation. Although the present application has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present application can be Make modifications or equivalent replacements without departing from the spirit and scope of the technical solutions of the present application.

Claims (20)

  1. 一种基于知识图谱的医疗问题解答方法,其中,所述方法包括:A method for answering medical questions based on a knowledge map, wherein the method includes:
    获取原始用户查询语句,利用预设的实体关系联合抽取模型对所述原始用户查询语句进行实体关系抽取,得到实体及实体之间的关系;Obtain the original user query statement, and use the preset entity-relationship joint extraction model to perform entity-relationship extraction on the original user query statement to obtain entities and relationships between entities;
    将所述原始用户查询语句输入至预设的意图识别模型中进行意图识别,得到意图识别结果;inputting the original user query sentence into a preset intent recognition model to perform intent recognition, and obtain an intent recognition result;
    根据所述实体、所述实体之间的关系以及所述意图识别结果对所述原始用户查询语句进行场景分类,得到所述原始用户查询语句对应的场景类别;performing scene classification on the original user query statement according to the entity, the relationship between the entities, and the intent recognition result, to obtain the scene category corresponding to the original user query statement;
    获取预构建的医疗知识图谱,根据所述场景类别在所述医疗知识图谱中索引出所述原始用户查询语句对应的答案。A pre-built medical knowledge map is obtained, and an answer corresponding to the original user query statement is indexed in the medical knowledge map according to the scene category.
  2. 如权利要求1所述的基于知识图谱的医疗问题解答方法,其中,所述利用预设的实体关系联合抽取模型对所述原始用户查询语句进行实体关系抽取,得到实体及实体之间的关系,包括:The method for answering medical questions based on knowledge graphs according to claim 1, wherein said entity relationship extraction is performed on said original user query statement using a preset entity relationship joint extraction model to obtain entities and relationships between entities, include:
    利用所述实体关系联合抽取模型中的共享编码层对所述原始用户查询语句进行编码处理,得到原始编码数据;encoding the original user query statement by using the shared encoding layer in the joint entity-relationship extraction model to obtain original encoded data;
    将所述原始编码数据输入至所述实体关系联合抽取模型中的实体识别模块中进行实体识别,得到一个或者多个实体;Inputting the original coded data into the entity recognition module in the entity-relationship joint extraction model for entity recognition to obtain one or more entities;
    将所述多个实体输入至所述实体关系联合抽取模型中的关系抽取模块中,得到实体之间的关系。The multiple entities are input into the relationship extraction module in the entity-relationship joint extraction model to obtain the relationship between the entities.
  3. 如权利要求2所述的基于知识图谱的医疗问题解答方法,其中,所述将所述原始编码数据输入至所述实体关系联合抽取模型中的实体识别模块中进行实体识别,得到一个或者多个实体,包括:The method for answering medical questions based on knowledge graphs according to claim 2, wherein the input of the original coded data into the entity recognition module in the entity-relationship joint extraction model is carried out for entity recognition, and one or more entities, including:
    通过所述实体识别模块中的输入门计算所述原始编码数据的状态值;calculating the state value of the original coded data through an input gate in the entity recognition module;
    利用所述实体识别模块中的遗忘门计算所述原始编码数据的激活值;calculating the activation value of the original coded data by using the forget gate in the entity recognition module;
    根据所述状态值和所述激活值计算所述原始编码数据的状态更新值;calculating a state update value of the original encoded data according to the state value and the activation value;
    利用所述输出门计算所述状态更新值对应的初始文本序列;using the output gate to calculate an initial text sequence corresponding to the state update value;
    将所述初始文本序列输入至全连接层中计算得到对应的发射概率,并采用CRF层计算预设标签对应的转移概率;Input the initial text sequence into the fully connected layer to calculate the corresponding emission probability, and use the CRF layer to calculate the transition probability corresponding to the preset label;
    根据所述转移概率和所述发射概率对所述初始文本序列进行标记,得到一个或者多个实体。The initial text sequence is marked according to the transition probability and the emission probability to obtain one or more entities.
  4. 如权利要求3所述的基于知识图谱的医疗问题解答方法,其中,所述通过所述实体识别模块中的输入门计算所述原始编码数据的状态值,包括:The medical question answering method based on knowledge graph as claimed in claim 3, wherein said calculating the state value of said original encoded data through said input gate in said entity recognition module comprises:
    利用如下计算公式计算所述原始编码数据的状态值:The state value of the original coded data is calculated by using the following calculation formula:
    Figure PCTCN2022087817-appb-100001
    Figure PCTCN2022087817-appb-100001
    其中,i t表示状态值,
    Figure PCTCN2022087817-appb-100002
    表示输入门中细胞单元的偏置,w i表示输入门的激活因子,h t-1表示原始编码数据在输入门t-1时刻的峰值,x t表示在t时刻的原始编码数据,b i表示输入门中细胞单元的权重。
    Among them, it represents the state value,
    Figure PCTCN2022087817-appb-100002
    Indicates the bias of the cell unit in the input gate, w i indicates the activation factor of the input gate, h t-1 indicates the peak value of the original encoded data at the time t-1 of the input gate, x t indicates the original encoded data at the time t, b i Indicates the weight of the cell unit in the input gate.
  5. 如权利要求1所述的基于知识图谱的医疗问题解答方法,其中,所述将所述原始用户查询语句输入至预设的意图识别模型中进行意图识别,得到意图识别结果,包括:The method for answering medical questions based on knowledge graphs according to claim 1, wherein said inputting said original user query sentence into a preset intent recognition model for intent recognition to obtain an intent recognition result includes:
    利用所述意图识别模型的输入层对所述原始用户查询语句进行向量化处理,得到用户查询向量;Using the input layer of the intent recognition model to vectorize the original user query statement to obtain a user query vector;
    利用所述意图识别模型的卷积层对所述用户查询向量进行卷积处理,得到卷积数据集;Using the convolution layer of the intention recognition model to perform convolution processing on the user query vector to obtain a convolution data set;
    将所述卷积数据集输入至所述意图识别模型中的池化层及全连接层中,得到分类结 果;The convolution data set is input into the pooling layer and the fully connected layer in the intention recognition model to obtain classification results;
    利用预设的意图识别标签对所述分类结果进行标记,得到意图识别结果。The classification result is marked with a preset intent recognition label to obtain an intent recognition result.
  6. 如权利要求1所述的基于知识图谱的医疗问题解答方法,其中,所述获取预构建的医疗知识图谱,包括:The method for answering medical questions based on a knowledge graph according to claim 1, wherein said obtaining a pre-built medical knowledge graph comprises:
    获取医疗相关数据,对所述医疗相关数据进行结构化处理,得到结构化数据;Obtaining medical related data, performing structured processing on the medical related data, to obtain structured data;
    对所述结构化数据进行实体抽取得到实体信息,对所述结构化数据进行关系抽取得到相关关系;performing entity extraction on the structured data to obtain entity information, and performing relationship extraction on the structured data to obtain related relationships;
    根据所述实体信息和所述相关关系构建得到多个三元组,并利用所述多个三元组得到医疗知识图谱。A plurality of triplets are constructed according to the entity information and the correlation relationship, and a medical knowledge map is obtained by using the multiple triplets.
  7. 如权利要求1所述的基于知识图谱的医疗问题解答方法,其中,所述根据所述实体、所述实体之间的关系以及所述意图识别结果对所述原始用户查询语句进行场景分类,得到所述原始用户查询语句对应的场景类别,包括:The method for answering medical questions based on knowledge graphs according to claim 1, wherein said original user query statement is classified according to the scene according to the entity, the relationship between the entities, and the intent recognition result, to obtain The scene category corresponding to the original user query statement includes:
    将所述实体之间的关系为无关系且所述意图识别结果为无意图的原始用户查询语句对应的场景类别归为第一场景;Classifying the scene category corresponding to the original user query statement in which the relationship between the entities is no relationship and the intention recognition result is no intention as the first scene;
    将所述实体之间的关系为无关系且所述意图识别结果为有意图的原始用户查询语句对应的场景类别归为第二场景;Classifying the scene category corresponding to the original user query statement in which the relationship between the entities is non-relationship and the intention recognition result is intentional as the second scene;
    将所述实体之间的关系为有关系且所述意图识别结果为有意图的原始用户查询语句对应的场景类别归为第三场景。The scene category corresponding to the original user query statement in which the relationship between the entities is related and the intention recognition result is intention is classified as the third scene.
  8. 一种基于知识图谱的医疗问题解答装置,其中,所述装置包括:A device for answering medical questions based on a knowledge map, wherein the device includes:
    实体关系抽取模块,用于获取原始用户查询语句,利用预设的实体关系联合抽取模型对所述原始用户查询语句进行实体关系抽取,得到实体及实体之间的关系;The entity relationship extraction module is used to obtain the original user query statement, and use the preset entity relationship joint extraction model to perform entity relationship extraction on the original user query statement to obtain the entity and the relationship between the entities;
    意图识别模块,用于将所述原始用户查询语句输入至预设的意图识别模型中进行意图识别,得到意图识别结果;An intent recognition module, configured to input the original user query sentence into a preset intent recognition model for intent recognition, and obtain an intent recognition result;
    场景分类模块,用于根据所述实体、所述实体之间的关系以及所述意图识别结果对所述原始用户查询语句进行场景分类,得到所述原始用户查询语句对应的场景类别;A scene classification module, configured to classify the scene of the original user query statement according to the entity, the relationship between the entities and the intention recognition result, and obtain the scene category corresponding to the original user query statement;
    答案索引模块,用于获取预构建的医疗知识图谱,根据所述场景类别在所述医疗知识图谱中索引出所述原始用户查询语句对应的答案。An answer indexing module, configured to obtain a pre-built medical knowledge map, and index the answer corresponding to the original user query statement in the medical knowledge map according to the scene category.
  9. 一种电子设备,其中,所述电子设备包括:An electronic device, wherein the electronic device includes:
    至少一个处理器;以及,at least one processor; and,
    与所述至少一个处理器通信连接的存储器;其中,a memory communicatively coupled to the at least one processor; wherein,
    所述存储器存储有可被所述至少一个处理器执行的计算机程序,所述计算机程序被所述至少一个处理器执行,以使所述至少一个处理器能够执行如下所述的基于知识图谱的医疗问题解答方法:The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor, so that the at least one processor can perform the following knowledge map-based medical treatment Question answer method:
    获取原始用户查询语句,利用预设的实体关系联合抽取模型对所述原始用户查询语句进行实体关系抽取,得到实体及实体之间的关系;Obtain the original user query statement, and use the preset entity-relationship joint extraction model to perform entity-relationship extraction on the original user query statement to obtain entities and relationships between entities;
    将所述原始用户查询语句输入至预设的意图识别模型中进行意图识别,得到意图识别结果;inputting the original user query sentence into a preset intent recognition model to perform intent recognition, and obtain an intent recognition result;
    根据所述实体、所述实体之间的关系以及所述意图识别结果对所述原始用户查询语句进行场景分类,得到所述原始用户查询语句对应的场景类别;performing scene classification on the original user query statement according to the entity, the relationship between the entities, and the intent recognition result, to obtain the scene category corresponding to the original user query statement;
    获取预构建的医疗知识图谱,根据所述场景类别在所述医疗知识图谱中索引出所述原始用户查询语句对应的答案。A pre-built medical knowledge map is obtained, and an answer corresponding to the original user query statement is indexed in the medical knowledge map according to the scene category.
  10. 如权利要求9所述的电子设备,其中,所述利用预设的实体关系联合抽取模型对所述原始用户查询语句进行实体关系抽取,得到实体及实体之间的关系,包括:The electronic device according to claim 9, wherein said entity relationship extraction is performed on said original user query statement by using a preset entity relationship joint extraction model to obtain entities and relationships between entities, including:
    利用所述实体关系联合抽取模型中的共享编码层对所述原始用户查询语句进行编码处理,得到原始编码数据;encoding the original user query statement by using the shared encoding layer in the joint entity-relationship extraction model to obtain original encoded data;
    将所述原始编码数据输入至所述实体关系联合抽取模型中的实体识别模块中进行实体识别,得到一个或者多个实体;Inputting the original coded data into the entity recognition module in the entity-relationship joint extraction model for entity recognition to obtain one or more entities;
    将所述多个实体输入至所述实体关系联合抽取模型中的关系抽取模块中,得到实体之间的关系。The multiple entities are input into the relationship extraction module in the entity-relationship joint extraction model to obtain the relationship between the entities.
  11. 如权利要求10所述的电子设备,其中,所述将所述原始编码数据输入至所述实体关系联合抽取模型中的实体识别模块中进行实体识别,得到一个或者多个实体,包括:The electronic device according to claim 10, wherein said inputting the original coded data into the entity recognition module in the entity-relationship joint extraction model for entity recognition to obtain one or more entities comprises:
    通过所述实体识别模块中的输入门计算所述原始编码数据的状态值;calculating the state value of the original coded data through an input gate in the entity recognition module;
    利用所述实体识别模块中的遗忘门计算所述原始编码数据的激活值;calculating the activation value of the original coded data by using the forget gate in the entity recognition module;
    根据所述状态值和所述激活值计算所述原始编码数据的状态更新值;calculating a state update value of the original encoded data according to the state value and the activation value;
    利用所述输出门计算所述状态更新值对应的初始文本序列;using the output gate to calculate an initial text sequence corresponding to the state update value;
    将所述初始文本序列输入至全连接层中计算得到对应的发射概率,并采用CRF层计算预设标签对应的转移概率;Input the initial text sequence into the fully connected layer to calculate the corresponding emission probability, and use the CRF layer to calculate the transition probability corresponding to the preset label;
    根据所述转移概率和所述发射概率对所述初始文本序列进行标记,得到一个或者多个实体。The initial text sequence is marked according to the transition probability and the emission probability to obtain one or more entities.
  12. 如权利要求11所述的电子设备,其中,所述通过所述实体识别模块中的输入门计算所述原始编码数据的状态值,包括:The electronic device according to claim 11, wherein said calculating the state value of said original coded data through said input gate in said entity recognition module comprises:
    利用如下计算公式计算所述原始编码数据的状态值:The state value of the original coded data is calculated by using the following calculation formula:
    Figure PCTCN2022087817-appb-100003
    Figure PCTCN2022087817-appb-100003
    其中,i t表示状态值,
    Figure PCTCN2022087817-appb-100004
    表示输入门中细胞单元的偏置,w i表示输入门的激活因子,h t-1表示原始编码数据在输入门t-1时刻的峰值,x t表示在t时刻的原始编码数据,b i表示输入门中细胞单元的权重。
    Among them, it represents the state value,
    Figure PCTCN2022087817-appb-100004
    Indicates the bias of the cell unit in the input gate, w i indicates the activation factor of the input gate, h t-1 indicates the peak value of the original encoded data at the time t-1 of the input gate, x t indicates the original encoded data at the time t, b i Indicates the weight of the cell unit in the input gate.
  13. 如权利要求9所述的电子设备,其中,所述将所述原始用户查询语句输入至预设的意图识别模型中进行意图识别,得到意图识别结果,包括:The electronic device according to claim 9, wherein said inputting said original user query sentence into a preset intention recognition model to perform intention recognition, and obtaining an intention recognition result comprises:
    利用所述意图识别模型的输入层对所述原始用户查询语句进行向量化处理,得到用户查询向量;Using the input layer of the intent recognition model to vectorize the original user query statement to obtain a user query vector;
    利用所述意图识别模型的卷积层对所述用户查询向量进行卷积处理,得到卷积数据集;Using the convolution layer of the intent recognition model to perform convolution processing on the user query vector to obtain a convolution data set;
    将所述卷积数据集输入至所述意图识别模型中的池化层及全连接层中,得到分类结果;Inputting the convolution data set into the pooling layer and the fully connected layer in the intent recognition model to obtain classification results;
    利用预设的意图识别标签对所述分类结果进行标记,得到意图识别结果。The classification result is marked with a preset intent recognition label to obtain an intent recognition result.
  14. 如权利要求9所述的电子设备,其中,所述获取预构建的医疗知识图谱,包括:The electronic device according to claim 9, wherein said acquiring a pre-built medical knowledge graph comprises:
    获取医疗相关数据,对所述医疗相关数据进行结构化处理,得到结构化数据;Obtaining medical related data, performing structured processing on the medical related data, to obtain structured data;
    对所述结构化数据进行实体抽取得到实体信息,对所述结构化数据进行关系抽取得到相关关系;performing entity extraction on the structured data to obtain entity information, and performing relationship extraction on the structured data to obtain related relationships;
    根据所述实体信息和所述相关关系构建得到多个三元组,并利用所述多个三元组得到医疗知识图谱。A plurality of triplets are constructed according to the entity information and the correlation relationship, and a medical knowledge map is obtained by using the multiple triplets.
  15. 一种计算机可读存储介质,存储有计算机程序,其中,所述计算机程序被处理器执行时实现如下所述的基于知识图谱的医疗问题解答方法:A computer-readable storage medium, storing a computer program, wherein, when the computer program is executed by a processor, the following method for answering medical questions based on a knowledge map is realized:
    获取原始用户查询语句,利用预设的实体关系联合抽取模型对所述原始用户查询语句进行实体关系抽取,得到实体及实体之间的关系;Obtain the original user query statement, and use the preset entity-relationship joint extraction model to perform entity-relationship extraction on the original user query statement to obtain entities and relationships between entities;
    将所述原始用户查询语句输入至预设的意图识别模型中进行意图识别,得到意图识别结果;inputting the original user query sentence into a preset intent recognition model to perform intent recognition, and obtain an intent recognition result;
    根据所述实体、所述实体之间的关系以及所述意图识别结果对所述原始用户查询语句进行场景分类,得到所述原始用户查询语句对应的场景类别;performing scene classification on the original user query statement according to the entity, the relationship between the entities, and the intent recognition result, to obtain the scene category corresponding to the original user query statement;
    获取预构建的医疗知识图谱,根据所述场景类别在所述医疗知识图谱中索引出所述原 始用户查询语句对应的答案。Obtain a pre-built medical knowledge map, and index the answer corresponding to the original user query statement in the medical knowledge map according to the scene category.
  16. 如权利要求15所述的计算机可读存储介质,其中,所述利用预设的实体关系联合抽取模型对所述原始用户查询语句进行实体关系抽取,得到实体及实体之间的关系,包括:The computer-readable storage medium according to claim 15, wherein said entity relationship extraction is performed on the original user query statement using a preset entity relationship joint extraction model to obtain entities and relationships between entities, comprising:
    利用所述实体关系联合抽取模型中的共享编码层对所述原始用户查询语句进行编码处理,得到原始编码数据;encoding the original user query statement by using the shared encoding layer in the joint entity-relationship extraction model to obtain original encoded data;
    将所述原始编码数据输入至所述实体关系联合抽取模型中的实体识别模块中进行实体识别,得到一个或者多个实体;Inputting the original coded data into the entity recognition module in the entity-relationship joint extraction model for entity recognition to obtain one or more entities;
    将所述多个实体输入至所述实体关系联合抽取模型中的关系抽取模块中,得到实体之间的关系。The multiple entities are input into the relationship extraction module in the entity-relationship joint extraction model to obtain the relationship between the entities.
  17. 如权利要求16所述的计算机可读存储介质,其中,所述将所述原始编码数据输入至所述实体关系联合抽取模型中的实体识别模块中进行实体识别,得到一个或者多个实体,包括:The computer-readable storage medium according to claim 16, wherein said inputting said original encoded data into an entity recognition module in said entity-relationship joint extraction model for entity recognition, and obtaining one or more entities, including :
    通过所述实体识别模块中的输入门计算所述原始编码数据的状态值;calculating the state value of the original coded data through an input gate in the entity recognition module;
    利用所述实体识别模块中的遗忘门计算所述原始编码数据的激活值;calculating the activation value of the original coded data by using the forget gate in the entity recognition module;
    根据所述状态值和所述激活值计算所述原始编码数据的状态更新值;calculating a state update value of the original encoded data according to the state value and the activation value;
    利用所述输出门计算所述状态更新值对应的初始文本序列;using the output gate to calculate an initial text sequence corresponding to the state update value;
    将所述初始文本序列输入至全连接层中计算得到对应的发射概率,并采用CRF层计算预设标签对应的转移概率;Input the initial text sequence into the fully connected layer to calculate the corresponding emission probability, and use the CRF layer to calculate the transition probability corresponding to the preset label;
    根据所述转移概率和所述发射概率对所述初始文本序列进行标记,得到一个或者多个实体。The initial text sequence is marked according to the transition probability and the emission probability to obtain one or more entities.
  18. 如权利要求17所述的计算机可读存储介质,其中,所述通过所述实体识别模块中的输入门计算所述原始编码数据的状态值,包括:The computer-readable storage medium according to claim 17, wherein the calculating the state value of the original encoded data through the input gate in the entity recognition module comprises:
    利用如下计算公式计算所述原始编码数据的状态值:The state value of the original coded data is calculated by using the following calculation formula:
    Figure PCTCN2022087817-appb-100005
    Figure PCTCN2022087817-appb-100005
    其中,i t表示状态值,
    Figure PCTCN2022087817-appb-100006
    表示输入门中细胞单元的偏置,w i表示输入门的激活因子,h t-1表示原始编码数据在输入门t-1时刻的峰值,x t表示在t时刻的原始编码数据,b i表示输入门中细胞单元的权重。
    Among them, it represents the state value,
    Figure PCTCN2022087817-appb-100006
    Indicates the bias of the cell unit in the input gate, w i indicates the activation factor of the input gate, h t-1 indicates the peak value of the original encoded data at the time t-1 of the input gate, x t indicates the original encoded data at the time t, b i Indicates the weight of the cell unit in the input gate.
  19. 如权利要求15所述的计算机可读存储介质,其中,所述将所述原始用户查询语句输入至预设的意图识别模型中进行意图识别,得到意图识别结果,包括:The computer-readable storage medium according to claim 15, wherein said inputting said original user query sentence into a preset intent recognition model for intent recognition, and obtaining an intent recognition result comprises:
    利用所述意图识别模型的输入层对所述原始用户查询语句进行向量化处理,得到用户查询向量;Using the input layer of the intent recognition model to vectorize the original user query statement to obtain a user query vector;
    利用所述意图识别模型的卷积层对所述用户查询向量进行卷积处理,得到卷积数据集;Using the convolution layer of the intention recognition model to perform convolution processing on the user query vector to obtain a convolution data set;
    将所述卷积数据集输入至所述意图识别模型中的池化层及全连接层中,得到分类结果;Inputting the convolution data set into the pooling layer and the fully connected layer in the intent recognition model to obtain classification results;
    利用预设的意图识别标签对所述分类结果进行标记,得到意图识别结果。The classification result is marked with a preset intent recognition label to obtain an intent recognition result.
  20. 如权利要求15所述的计算机可读存储介质,其中,所述获取预构建的医疗知识图谱,包括:The computer-readable storage medium according to claim 15, wherein said acquiring a pre-built medical knowledge graph comprises:
    获取医疗相关数据,对所述医疗相关数据进行结构化处理,得到结构化数据;Obtaining medical related data, performing structured processing on the medical related data, to obtain structured data;
    对所述结构化数据进行实体抽取得到实体信息,对所述结构化数据进行关系抽取得到相关关系;performing entity extraction on the structured data to obtain entity information, and performing relationship extraction on the structured data to obtain related relationships;
    根据所述实体信息和所述相关关系构建得到多个三元组,并利用所述多个三元组得到医疗知识图谱。A plurality of triplets are constructed according to the entity information and the correlation relationship, and a medical knowledge map is obtained by using the multiple triplets.
PCT/CN2022/087817 2021-08-30 2022-04-20 Knowledge graph-based medical question answering method and apparatus, device and medium WO2023029512A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111004877.4A CN113707303A (en) 2021-08-30 2021-08-30 Method, device, equipment and medium for solving medical problems based on knowledge graph
CN202111004877.4 2021-08-30

Publications (1)

Publication Number Publication Date
WO2023029512A1 true WO2023029512A1 (en) 2023-03-09

Family

ID=78656887

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/087817 WO2023029512A1 (en) 2021-08-30 2022-04-20 Knowledge graph-based medical question answering method and apparatus, device and medium

Country Status (2)

Country Link
CN (1) CN113707303A (en)
WO (1) WO2023029512A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116166764A (en) * 2023-04-21 2023-05-26 北京捷泰云际信息技术有限公司 Method for constructing place name address engine, address query method, device and engine
CN116662522A (en) * 2023-07-28 2023-08-29 阿里巴巴达摩院(杭州)科技有限公司 Question answer recommendation method, storage medium and electronic equipment
CN116821310A (en) * 2023-08-28 2023-09-29 北京智谱华章科技有限公司 Enterprise knowledge base question-answering system based on large model and knowledge graph

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113707303A (en) * 2021-08-30 2021-11-26 康键信息技术(深圳)有限公司 Method, device, equipment and medium for solving medical problems based on knowledge graph
CN115062628A (en) * 2022-06-15 2022-09-16 北京信息科技大学 Automatic simulation method for doctor-patient communication conversation based on knowledge graph
CN116257610B (en) * 2023-01-11 2023-12-08 长河信息股份有限公司 Intelligent question-answering method, device, equipment and medium based on industry knowledge graph
CN117520508B (en) * 2023-11-20 2024-05-28 广州方舟信息科技有限公司 Medical dialogue answer generation method, device, electronic equipment and storage medium
CN117909487A (en) * 2024-03-20 2024-04-19 北方健康医疗大数据科技有限公司 Medical question-answering service method, system, device and medium for old people

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110176315A (en) * 2019-06-05 2019-08-27 京东方科技集团股份有限公司 Medical answering method and system, electronic equipment, computer-readable medium
CN110929016A (en) * 2019-12-10 2020-03-27 北京爱医生智慧医疗科技有限公司 Intelligent question and answer method and device based on knowledge graph
CN111708874A (en) * 2020-08-24 2020-09-25 湖南大学 Man-machine interaction question-answering method and system based on intelligent complex intention recognition
CN112035635A (en) * 2020-08-28 2020-12-04 康键信息技术(深圳)有限公司 Medical field intention recognition method, device, equipment and storage medium
CN112269875A (en) * 2020-10-23 2021-01-26 中国平安人寿保险股份有限公司 Text classification method and device, electronic equipment and storage medium
CN112487202A (en) * 2020-11-27 2021-03-12 厦门理工学院 Chinese medical named entity recognition method and device fusing knowledge map and BERT
US20210216576A1 (en) * 2020-01-14 2021-07-15 RELX Inc. Systems and methods for providing answers to a query
CN113707303A (en) * 2021-08-30 2021-11-26 康键信息技术(深圳)有限公司 Method, device, equipment and medium for solving medical problems based on knowledge graph

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108427722A (en) * 2018-02-09 2018-08-21 卫盈联信息技术(深圳)有限公司 intelligent interactive method, electronic device and storage medium
CN110619050B (en) * 2018-06-20 2023-05-09 华为技术有限公司 Intention recognition method and device
CN110019844A (en) * 2019-02-20 2019-07-16 众安信息技术服务有限公司 A kind of insurance industry knowledge mapping question answering system construction method and device
CN111949758A (en) * 2019-05-16 2020-11-17 北大医疗信息技术有限公司 Medical question and answer recommendation method, recommendation system and computer readable storage medium
CN110413790B (en) * 2019-08-02 2020-04-28 上海云绅智能科技有限公司 Scene classification method and device
CN112650840A (en) * 2020-12-04 2021-04-13 天津泰凡科技有限公司 Intelligent medical question-answering processing method and system based on knowledge graph reasoning

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110176315A (en) * 2019-06-05 2019-08-27 京东方科技集团股份有限公司 Medical answering method and system, electronic equipment, computer-readable medium
CN110929016A (en) * 2019-12-10 2020-03-27 北京爱医生智慧医疗科技有限公司 Intelligent question and answer method and device based on knowledge graph
US20210216576A1 (en) * 2020-01-14 2021-07-15 RELX Inc. Systems and methods for providing answers to a query
CN111708874A (en) * 2020-08-24 2020-09-25 湖南大学 Man-machine interaction question-answering method and system based on intelligent complex intention recognition
CN112035635A (en) * 2020-08-28 2020-12-04 康键信息技术(深圳)有限公司 Medical field intention recognition method, device, equipment and storage medium
CN112269875A (en) * 2020-10-23 2021-01-26 中国平安人寿保险股份有限公司 Text classification method and device, electronic equipment and storage medium
CN112487202A (en) * 2020-11-27 2021-03-12 厦门理工学院 Chinese medical named entity recognition method and device fusing knowledge map and BERT
CN113707303A (en) * 2021-08-30 2021-11-26 康键信息技术(深圳)有限公司 Method, device, equipment and medium for solving medical problems based on knowledge graph

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116166764A (en) * 2023-04-21 2023-05-26 北京捷泰云际信息技术有限公司 Method for constructing place name address engine, address query method, device and engine
CN116662522A (en) * 2023-07-28 2023-08-29 阿里巴巴达摩院(杭州)科技有限公司 Question answer recommendation method, storage medium and electronic equipment
CN116662522B (en) * 2023-07-28 2023-12-12 阿里巴巴达摩院(杭州)科技有限公司 Question answer recommendation method, storage medium and electronic equipment
CN116821310A (en) * 2023-08-28 2023-09-29 北京智谱华章科技有限公司 Enterprise knowledge base question-answering system based on large model and knowledge graph
CN116821310B (en) * 2023-08-28 2023-12-08 北京智谱华章科技有限公司 Enterprise knowledge base question-answering system based on large model and knowledge graph

Also Published As

Publication number Publication date
CN113707303A (en) 2021-11-26

Similar Documents

Publication Publication Date Title
WO2023029512A1 (en) Knowledge graph-based medical question answering method and apparatus, device and medium
CN113707297B (en) Medical data processing method, device, equipment and storage medium
WO2022141861A1 (en) Emotion classification method and apparatus, electronic device, and storage medium
CN106682060B (en) Modeling, extracting, and localizing from structured knowledge of images
WO2020237856A1 (en) Smart question and answer method and apparatus based on knowledge graph, and computer storage medium
Diallo An effective method of large scale ontology matching
CN110189831B (en) Medical record knowledge graph construction method and system based on dynamic graph sequence
US20210034919A1 (en) Method and apparatus for establishing image set for image recognition, network device, and storage medium
US8341173B2 (en) Method and system for database-based semantic query answering
WO2021151271A1 (en) Method and apparatus for textual question answering based on named entities, and device and storage medium
US10565351B2 (en) Analysis and rule generation of medical documents
WO2018201772A1 (en) Method and system for inferring potential disease from medical text, and readable storage medium
US20210350915A1 (en) Universal physician ranking system based on an integrative model of physician expertise
US10521433B2 (en) Domain specific language to query medical data
WO2022222942A1 (en) Method and apparatus for generating question and answer record, electronic device, and storage medium
WO2022160454A1 (en) Medical literature retrieval method and apparatus, electronic device, and storage medium
US11461680B2 (en) Identifying attributes in unstructured data files using a machine-learning model
CN110413751B (en) Medicine searching method, device, terminal equipment and storage medium
WO2023029511A1 (en) Intelligent inspection method and apparatus for online medical prescription medication, and device and storage medium
CN116257610B (en) Intelligent question-answering method, device, equipment and medium based on industry knowledge graph
CN113111162A (en) Department recommendation method and device, electronic equipment and storage medium
WO2023178978A1 (en) Prescription review method and apparatus based on artificial intelligence, and device and medium
CN113793696A (en) Similarity-based method, system, terminal and readable storage medium for predicting occurrence frequency of side effects of new drug
CN116821373A (en) Map-based prompt recommendation method, device, equipment and medium
WO2022227171A1 (en) Method and apparatus for extracting key information, electronic device, and medium

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: 22862658

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE