A method for building a knowledge base, an information query method, a device and an apparatus
By establishing a drug knowledge base and related knowledge base, and generating a drug information query knowledge base, it solves the problem that users find it difficult to quickly obtain drug information, realizes rapid and accurate query of drug information, and improves user experience.
Patent Information
- Application Number
- CN202110352335.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-31
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2041-03-31
AI Technical Summary
The prior art is difficult to obtain complete drug information quickly and accurately, which leads to difficulties for users when selecting or using drugs.
By obtaining drug entity records, establishing a drug knowledge base, and determining the relevant knowledge base based on the drug information historical query records, and generating a drug information query knowledge base so that users can conduct quick query.
It realizes rapid and accurate query of drug information, provides the complete and accurate drug information required by users, and improves the user experience.
Smart Images

Figure CN113076301B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, and specifically to a method for building a knowledge base, an information query method, a device and equipment. Background Art
[0002] When patients buy or take medicines, they need to obtain drug information related to disease symptoms and their own physical condition.
[0003] At present, the process of obtaining drug information is relatively complicated, which is not convenient for patients to obtain relevant drug information. In addition, the obtained drug information may not be complete and accurate enough to meet the needs of patients in selecting or using drugs. Therefore, how to obtain complete and accurate drug information more conveniently has become an urgent problem to be solved. Summary of the invention
[0004] In view of this, the embodiments of the present application provide a method for constructing a knowledge base, an information query method, an apparatus and a device, which can establish a query knowledge base for drug information and quickly provide relatively complete and accurate query results based on the query knowledge base, so as to facilitate users to query drug information.
[0005] To solve the above problems, the technical solutions provided in the embodiments of the present application are as follows:
[0006] A method for building a knowledge base, the method comprising:
[0007] Acquire a drug entity record, wherein the drug entity record includes a drug entity and drug entity information of the drug entity, wherein the drug entity information includes at least one drug information field and drug information corresponding to the drug information field;
[0008] Establishing a drug knowledge base based on the drug entity, the drug entity record corresponding to the drug entity, and the association between the two;
[0009] Determine, according to the historical query record of drug information, a related knowledge base associated with the drug knowledge base, wherein the related knowledge base includes a non-drug domain entity associated with the drug entity;
[0010] According to the drug entity information of the drug entity, establishing an association relationship between the drug entity and a non-drug domain entity in the relevant knowledge base;
[0011] A query knowledge base for drug information is generated based on the drug knowledge base, related knowledge bases associated with the drug knowledge base, and associations between drug entities in the drug knowledge base and non-drug domain entities in the related knowledge bases.
[0012] In a possible implementation, establishing a drug knowledge base based on the drug entity, the drug entity record corresponding to the drug entity, and the association between the two includes:
[0013] Determine the association relationship between the drug entities according to the drug information corresponding to the contraindication information field and / or the precaution field in the drug entity information, and the drug information corresponding to the drug ingredient type field;
[0014] The drug entity record is added to a drug knowledge base, and drug entities with associated relationships are associated with drug entities corresponding to each drug entity record in the drug knowledge base.
[0015] In a possible implementation, determining the association relationship between the drug entities according to the drug information corresponding to the contraindication information field and / or the precaution field in the drug entity information, and the drug information corresponding to the drug ingredient type field, includes:
[0016] Reading a contraindication information field and / or a precaution field in the drug entity information of a first drug entity to obtain the contraindication information and / or precautions of the first drug entity; the first drug entity is any one of the drug entities;
[0017] Identifying information related to drug ingredients and association relationships from the contraindication information and / or precaution information of the first drug entity, determining the identified information related to drug ingredients as a target drug ingredient type, and determining the identified information related to the association relationship as a target association relationship type;
[0018] Obtain a drug entity in the drug knowledge base whose drug ingredient type belongs to the target drug ingredient type, establish an association relationship between it and the first drug entity, and set the association relationship type to the target association relationship type.
[0019] In a possible implementation, determining the relevant knowledge base associated with the drug knowledge base according to the drug information history query record includes:
[0020] Perform entity recognition on the historical query records of drug information to obtain non-drug domain entities included in the historical query records of drug information and the types to which the entities belong;
[0021] Determine a related knowledge base associated with the drug knowledge base according to the type of the entity.
[0022] In a possible implementation, the relevant knowledge base includes a symptom knowledge base, a population knowledge base, a food knowledge base, and a sports knowledge base;
[0023] The establishing of the association relationship between the drug entity and the non-drug domain entity in the relevant knowledge base based on the drug entity information of the drug entity includes:
[0024] According to the drug entity information of the drug entity, an association relationship is established between the drug entity and the symptom entity in the symptom knowledge base, the population entity in the population knowledge base, the food entity in the food knowledge base, and the movement entity in the movement knowledge base.
[0025] In a possible implementation, the method includes: reading information corresponding to an indication field in drug entity information of a second drug entity to obtain an indication of the second drug entity; the second drug entity is any one of the drug entities;
[0026] Acquire the symptom entity corresponding to the indication of the second drug entity in the symptom knowledge base, and establish an association relationship between the symptom entity and the second drug entity.
[0027] In a possible implementation, the method includes:
[0028] Reading information corresponding to a contraindication information field and / or a precaution field in the drug entity information of a second drug entity to obtain contraindication information and / or precautions of the second drug entity; the second drug entity is any one of the drug entities;
[0029] Identifying information related to applicable populations from the contraindication information and / or precaution information of the second drug entity;
[0030] Obtain a population entity corresponding to the information related to the applicable population in the population knowledge base, and establish an association relationship between the population entity and the second drug entity.
[0031] In a possible implementation, the method includes:
[0032] Reading information corresponding to a contraindication information field and / or a precaution field in the drug entity information of a second drug entity to obtain contraindication information and / or precautions of the second drug entity; the second drug entity is any one of the drug entities;
[0033] Identifying information related to the food material from the contraindication information and / or precaution information of the second drug entity;
[0034] Obtain the food entity corresponding to the information related to the food in the food knowledge base, and establish an association relationship between the food entity and the second drug entity.
[0035] In a possible implementation, the method includes:
[0036] Reading information corresponding to a contraindication information field and / or a precaution field in the drug entity information of a second drug entity to obtain contraindication information and / or precautions of the second drug entity; the second drug entity is any one of the drug entities;
[0037] identifying sports-related information from the contraindication information and / or precaution information of the second drug entity;
[0038] Obtain a motion entity corresponding to the information related to the motion in the motion knowledge base, and establish an association relationship between the motion entity and the second drug entity.
[0039] An information query method, the method comprising:
[0040] Get the query request for drug information sent by the client;
[0041] Identify at least one of a drug entity or a non-drug domain entity from the query request;
[0042] Determining the query intent according to the query request;
[0043] According to the query intention and at least one of the obtained drug entity or non-drug domain entity, query the query knowledge base to obtain the query result; the query knowledge base is constructed according to the above-mentioned method for constructing a knowledge base;
[0044] The query result is sent to the client.
[0045] In a possible implementation, before querying the query knowledge base according to the query intent and at least one of the obtained drug entity or non-drug domain entity to obtain the query result, the method further includes:
[0046] Get user portrait information;
[0047] The corresponding non-drug field entity is obtained according to the user character portrait information.
[0048] In a possible implementation, querying a query knowledge base according to the query intent and at least one of the obtained drug entity or non-drug domain entity to obtain a query result includes:
[0049] When querying the query knowledge base according to the drug entity, determining the drug information field to be queried corresponding to the drug entity according to the query intention;
[0050] Based on the drug knowledge base included in the query knowledge base, the drug information corresponding to the drug information field to be queried is obtained to obtain a query result.
[0051] In a possible implementation, the method further includes:
[0052] Based on the association relationship between the drug entity in the drug knowledge base included in the query knowledge base and the non-drug domain entity in the related knowledge base, acquiring the non-drug domain entity associated with the drug entity according to the query intent;
[0053] Based on the related knowledge bases included in the query knowledge base, entity information corresponding to the non-drug domain entity associated with the drug entity is obtained and added to the query result.
[0054] In a possible implementation, querying a query knowledge base according to the query intent and at least one of the obtained drug entity or non-drug domain entity to obtain a query result includes:
[0055] When querying the query knowledge base according to the non-drug domain entity, based on the association relationship between the drug entity in the drug knowledge base included in the query knowledge base and the non-drug domain entity in the relevant knowledge base, obtaining the drug entity associated with the non-drug domain entity;
[0056] Determine the drug information field to be queried corresponding to the drug entity according to the query intention;
[0057] Based on the drug knowledge base included in the query knowledge base, the drug information corresponding to the drug information field to be queried is obtained to obtain a query result.
[0058] In a possible implementation, the method further includes:
[0059] Based on the related knowledge bases included in the query knowledge base, entity information corresponding to the non-drug field entity is obtained and added to the query result.
[0060] A device for building a knowledge base, the device comprising:
[0061] A first acquisition unit is used to acquire a drug entity record, wherein the drug entity record includes a drug entity and drug entity information of the drug entity, wherein the drug entity information includes at least one drug information field and drug information corresponding to the drug information field;
[0062] A first establishing unit is used to establish a drug knowledge base based on the drug entity, the drug entity record corresponding to the drug entity, and the association relationship between the two;
[0063] A first determining unit is used to determine a related knowledge base associated with the drug knowledge base according to the drug information history query record, wherein the related knowledge base includes a non-drug domain entity associated with the drug entity;
[0064] A second establishing unit is used to establish an association relationship between the drug entity and a non-drug domain entity in the relevant knowledge base according to the drug entity information of the drug entity;
[0065] A generating unit is used to generate a query knowledge base for drug information based on the drug knowledge base, related knowledge bases associated with the drug knowledge base, and the association relationship between drug entities in the drug knowledge base and non-drug domain entities in the related knowledge bases.
[0066] In a possible implementation manner, the first establishing unit includes:
[0067] A first determining subunit is used to determine the association relationship between the drug entities according to the drug information corresponding to the contraindication information field and / or the precaution field in the drug entity information, and the drug information corresponding to the drug ingredient type field;
[0068] The associating subunit is used to add the drug entity record to the drug knowledge base, and to associate the drug entities with associated relationships with respect to the drug entities corresponding to each drug entity record in the drug knowledge base.
[0069] In a possible implementation manner, the first determining subunit includes:
[0070] A first reading subunit is used to read the contraindication information field and / or the precaution field in the drug entity information of the first drug entity to obtain the contraindication information and / or precautions of the first drug entity; the first drug entity is any one of the drug entities;
[0071] a second determination subunit, configured to identify information related to drug ingredients and association relationships from the contraindication information and / or precaution information of the first drug entity, determine the identified information related to drug ingredients as a target drug ingredient type, and determine the identified information related to the association relationship as a target association relationship type;
[0072] A construction subunit is used to obtain a drug entity in the drug knowledge base whose drug ingredient type belongs to the target drug ingredient type, construct an association relationship between it and the first drug entity, and set the association relationship type to the target association relationship type.
[0073] In a possible implementation, the first determination unit is specifically configured to perform entity recognition on the drug information history query record to obtain the non-drug domain entities and the types of the entities included in the drug information history query record;
[0074] Determine a related knowledge base associated with the drug knowledge base according to the type of the entity.
[0075] In a possible implementation, the relevant knowledge base includes a symptom knowledge base, a population knowledge base, a food knowledge base, and a sports knowledge base;
[0076] The generation unit is specifically used to establish an association relationship between the drug entity and the symptom entity in the symptom knowledge base, the population entity in the population knowledge base, the ingredient entity in the ingredient knowledge base, and the exercise entity in the exercise knowledge base based on the drug entity information of the drug entity.
[0077] In a possible implementation, the generating unit includes:
[0078] A first reading subunit is used to read information corresponding to an indication field in drug entity information of a second drug entity to obtain an indication of the second drug entity; the second drug entity is any one of the drug entities;
[0079] The first construction subunit is used to obtain the symptom entity corresponding to the indication of the second drug entity in the symptom knowledge base, and to construct an association relationship between the symptom entity and the second drug entity.
[0080] In a possible implementation, the generating unit includes:
[0081] A second reading subunit is used to read the information corresponding to the contraindication information field and / or the precaution field in the drug entity information of the second drug entity to obtain the contraindication information and / or precautions of the second drug entity; the second drug entity is any one of the drug entities;
[0082] A first identification subunit is used to identify information related to applicable population from the contraindication information and / or precaution information of the second drug entity;
[0083] The second construction subunit is used to obtain a population entity corresponding to the information related to the applicable population in the population knowledge base, and to construct an association relationship between the population entity and the second drug entity.
[0084] In a possible implementation, the generating unit includes:
[0085] A third reading subunit is used to read the information corresponding to the contraindication information field and / or the precaution field in the drug entity information of the second drug entity to obtain the contraindication information and / or precautions of the second drug entity; the second drug entity is any one of the drug entities;
[0086] A second identification subunit, used to identify information related to ingredients from the contraindication information and / or precaution information of the second drug entity;
[0087] The third construction subunit is used to obtain the food entity corresponding to the information related to the food in the food knowledge base, and to construct an association relationship between the food entity and the second drug entity.
[0088] In a possible implementation, the generating unit includes:
[0089] a fourth reading subunit, configured to read information corresponding to a contraindication information field and / or a precaution field in the drug entity information of a second drug entity, and obtain the contraindication information and / or precautions of the second drug entity; the second drug entity is any one of the drug entities;
[0090] A third identification subunit is used to identify the information related to exercise from the contraindication information and / or precaution information of the second drug entity;
[0091] The fourth construction subunit is used to obtain the motion entity corresponding to the information related to the motion in the motion knowledge base, and to construct an association relationship between the motion entity and the second drug entity.
[0092] An information query device, comprising:
[0093] A second acquisition unit, used to acquire a query request for drug information sent by a client;
[0094] An identification unit, configured to identify at least one of a drug entity or a non-drug domain entity from the query request;
[0095] A second determining unit, configured to determine a query intent according to the query request;
[0096] A query unit, used to query the query knowledge base according to the query intention and at least one of the obtained drug entity or non-drug field entity to obtain a query result; the query knowledge base is constructed according to the above-mentioned device for constructing a knowledge base;
[0097] A sending unit is used to send the query result to the client.
[0098] In a possible implementation manner, the device further includes:
[0099] A third acquisition unit is used to acquire user character portrait information;
[0100] The fourth acquisition unit is used to obtain the corresponding non-drug field entity according to the user character portrait information.
[0101] In a possible implementation, the query unit includes:
[0102] A third determination subunit is used to determine the drug information field to be queried corresponding to the drug entity according to the query intention when querying the query knowledge base according to the drug entity;
[0103] The first acquisition subunit is used to acquire the drug information corresponding to the drug information field to be queried based on the drug knowledge base included in the query knowledge base, and obtain the query result.
[0104] In a possible implementation manner, the device further includes:
[0105] A second acquisition subunit is used to acquire non-drug domain entities associated with the drug entity according to the query intention based on the association relationship between the drug entity in the drug knowledge base included in the query knowledge base and the non-drug domain entities in the relevant knowledge base;
[0106] The third acquisition subunit is used to acquire entity information corresponding to the non-drug field entity associated with the drug entity based on the related knowledge base included in the query knowledge base, and add it into the query result.
[0107] In a possible implementation, the query unit includes:
[0108] A fourth acquisition subunit is used for, when querying the query knowledge base according to the non-drug field entity, acquiring the drug entity associated with the non-drug field entity based on the association relationship between the drug entity in the drug knowledge base included in the query knowledge base and the non-drug field entity in the relevant knowledge base;
[0109] A fourth determination subunit, configured to determine the drug information field to be queried corresponding to the drug entity according to the query intention;
[0110] The fifth acquisition subunit is used to acquire the drug information corresponding to the drug information field to be queried based on the drug knowledge base included in the query knowledge base, and obtain the query result.
[0111] In a possible implementation manner, the device further includes:
[0112] The sixth acquisition subunit is used to acquire entity information corresponding to the non-drug field entity based on the related knowledge base included in the query knowledge base, and add it into the query result.
[0113] A device for building a knowledge base includes a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors. The one or more programs include instructions for performing the following operations:
[0114] Acquire a drug entity record, wherein the drug entity record includes a drug entity and drug entity information of the drug entity, wherein the drug entity information includes at least one drug information field and drug information corresponding to the drug information field;
[0115] Establishing a drug knowledge base based on the drug entity, the drug entity record corresponding to the drug entity, and the association between the two;
[0116] Determine, according to the historical query record of drug information, a related knowledge base associated with the drug knowledge base, wherein the related knowledge base includes a non-drug domain entity associated with the drug entity;
[0117] According to the drug entity information of the drug entity, establishing an association relationship between the drug entity and a non-drug domain entity in the relevant knowledge base;
[0118] A query knowledge base for drug information is generated based on the drug knowledge base, related knowledge bases associated with the drug knowledge base, and associations between drug entities in the drug knowledge base and non-drug domain entities in the related knowledge bases.
[0119] In a possible implementation, establishing a drug knowledge base based on the drug entity, the drug entity record corresponding to the drug entity, and the association between the two includes:
[0120] Determine the association relationship between the drug entities according to the drug information corresponding to the contraindication information field and / or the precautions field in the drug entity information, and the drug information corresponding to the drug ingredient type field;
[0121] The drug entity record is added to a drug knowledge base, and drug entities with associated relationships are associated with drug entities corresponding to each drug entity record in the drug knowledge base.
[0122] In a possible implementation, determining the association relationship between the drug entities according to the drug information corresponding to the contraindication information field and / or the precaution field in the drug entity information, and the drug information corresponding to the drug ingredient type field, includes:
[0123] Reading a contraindication information field and / or a precaution field in the drug entity information of a first drug entity to obtain the contraindication information and / or precautions of the first drug entity; the first drug entity is any one of the drug entities;
[0124] Identifying information related to drug ingredients and association relationships from the contraindication information and / or precaution information of the first drug entity, determining the identified information related to drug ingredients as a target drug ingredient type, and determining the identified information related to the association relationship as a target association relationship type;
[0125] Obtain a drug entity in the drug knowledge base whose drug ingredient type belongs to the target drug ingredient type, establish an association relationship between it and the first drug entity, and set the association relationship type to the target association relationship type.
[0126] In a possible implementation, determining the relevant knowledge base associated with the drug knowledge base according to the drug information history query record includes:
[0127] Perform entity recognition on the historical query records of drug information to obtain non-drug domain entities included in the historical query records of drug information and the types to which the entities belong;
[0128] Determine a related knowledge base associated with the drug knowledge base according to the type of the entity.
[0129] In a possible implementation, the relevant knowledge base includes a symptom knowledge base, a population knowledge base, a food knowledge base, and a sports knowledge base;
[0130] The establishing of the association relationship between the drug entity and the non-drug domain entity in the relevant knowledge base based on the drug entity information of the drug entity includes:
[0131] According to the drug entity information of the drug entity, an association relationship is established between the drug entity and the symptom entity in the symptom knowledge base, the population entity in the population knowledge base, the food entity in the food knowledge base, and the movement entity in the movement knowledge base.
[0132] In a possible implementation manner, the processor is further configured to execute the one or more programs including instructions for performing the following operations:
[0133] Reading information corresponding to the indication field in the drug entity information of the second drug entity to obtain the indication of the second drug entity; the second drug entity is any one of the drug entities;
[0134] Acquire the symptom entity corresponding to the indication of the second drug entity in the symptom knowledge base, and establish an association relationship between the symptom entity and the second drug entity.
[0135] In a possible implementation manner, the processor is further configured to execute the one or more programs including instructions for performing the following operations:
[0136] Reading information corresponding to a contraindication information field and / or a precaution field in the drug entity information of a second drug entity to obtain contraindication information and / or precautions of the second drug entity; the second drug entity is any one of the drug entities;
[0137] Identifying information related to applicable populations from the contraindication information and / or precaution information of the second drug entity;
[0138] Obtain a population entity corresponding to the information related to the applicable population in the population knowledge base, and establish an association relationship between the population entity and the second drug entity.
[0139] In a possible implementation manner, the processor is further configured to execute the one or more programs including instructions for performing the following operations:
[0140] Reading information corresponding to a contraindication information field and / or a precaution field in the drug entity information of a second drug entity to obtain contraindication information and / or precautions of the second drug entity; the second drug entity is any one of the drug entities;
[0141] Identifying information related to the food material from the contraindication information and / or precaution information of the second drug entity;
[0142] Obtain the food entity corresponding to the information related to the food in the food knowledge base, and establish an association relationship between the food entity and the second drug entity.
[0143] In a possible implementation manner, the processor is further configured to execute the one or more programs including instructions for performing the following operations:
[0144] Reading information corresponding to a contraindication information field and / or a precaution field in the drug entity information of a second drug entity to obtain contraindication information and / or precautions of the second drug entity; the second drug entity is any one of the drug entities;
[0145] identifying sports-related information from the contraindication information and / or precaution information of the second drug entity;
[0146] Obtain a motion entity corresponding to the information related to the motion in the motion knowledge base, and establish an association relationship between the motion entity and the second drug entity.
[0147] A device for information query includes a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors. The one or more programs include instructions for performing the following operations:
[0148] Get the query request for drug information sent by the client;
[0149] Identify at least one of a drug entity or a non-drug domain entity from the query request;
[0150] Determining the query intent according to the query request;
[0151] According to the query intention and at least one of the obtained drug entity or non-drug domain entity, query the query knowledge base to obtain the query result; the query knowledge base is constructed according to the above-mentioned device for constructing the knowledge base;
[0152] The query result is sent to the client.
[0153] In a possible implementation manner, the processor is further configured to execute the one or more programs including instructions for performing the following operations:
[0154] Get user portrait information;
[0155] The corresponding non-drug field entity is obtained according to the user character portrait information.
[0156] In a possible implementation, querying a query knowledge base according to the query intent and at least one of the obtained drug entity or non-drug domain entity to obtain a query result includes:
[0157] When querying the query knowledge base according to the drug entity, determining the drug information field to be queried corresponding to the drug entity according to the query intention;
[0158] Based on the drug knowledge base included in the query knowledge base, the drug information corresponding to the drug information field to be queried is obtained to obtain a query result.
[0159] In a possible implementation manner, the processor is further configured to execute the one or more programs including instructions for performing the following operations:
[0160] Based on the association relationship between the drug entity in the drug knowledge base included in the query knowledge base and the non-drug domain entity in the related knowledge base, acquiring the non-drug domain entity associated with the drug entity according to the query intent;
[0161] Based on the related knowledge bases included in the query knowledge base, entity information corresponding to the non-drug domain entity associated with the drug entity is obtained and added to the query result.
[0162] In a possible implementation, querying a query knowledge base according to the query intent and at least one of the obtained drug entity or non-drug domain entity to obtain a query result includes:
[0163] When querying the query knowledge base according to the non-drug domain entity, based on the association relationship between the drug entity in the drug knowledge base included in the query knowledge base and the non-drug domain entity in the relevant knowledge base, obtaining the drug entity associated with the non-drug domain entity;
[0164] Determine the drug information field to be queried corresponding to the drug entity according to the query intention;
[0165] Based on the drug knowledge base included in the query knowledge base, the drug information corresponding to the drug information field to be queried is obtained to obtain a query result.
[0166] In a possible implementation manner, the processor is further configured to execute the one or more programs including instructions for performing the following operations:
[0167] Based on the related knowledge bases included in the query knowledge base, entity information corresponding to the non-drug field entity is obtained and added to the query result.
[0168] A computer-readable medium stores instructions which, when executed by one or more processors, enable a device to execute the above-mentioned method for building a knowledge base or the above-mentioned method for information query.
[0169] It can be seen that the embodiments of the present application have the following beneficial effects:
[0170] The embodiment of the present application provides a method for constructing a knowledge base, an information query method, a device and equipment. Through the drug entity record, a drug knowledge base is first established; then, according to the drug information historical query record, a related knowledge base associated with the drug knowledge base is determined; finally, based on the drug entity information corresponding to the drug entity in the drug knowledge base, the association relationship between the drug entity in the drug knowledge base and the non-drug field entity in the related knowledge base is determined. A query knowledge base for drug information is generated by using the drug knowledge base, the related knowledge base, and the association relationship between the drug entity and the non-drug field entity in the related knowledge base. Based on the query knowledge base, a relatively accurate and complete query of drug information can be performed. By obtaining the query request for drug information sent by the client, the corresponding entity and query intent can be identified from the query request, and the query is performed in the query knowledge base according to the identified entity and query intent to obtain the query result. The established query knowledge base can realize rapid query of drug information, and accurate and comprehensive drug information that meets user needs can be obtained. BRIEF DESCRIPTION OF THE DRAWINGS
[0171] Figure 1 A schematic diagram of a framework of an exemplary application scenario of an information query method provided in an embodiment of the present application;
[0172] Figure 2 A flowchart of a method for building a knowledge base provided in an embodiment of the present application;
[0173] Figure 3 A schematic diagram of the structure of a query knowledge base provided in an embodiment of the present application;
[0174] Figure 4 A flowchart of an information query method provided in an embodiment of the present application;
[0175] Figure 5 A schematic diagram of the structure of a device for building a knowledge base provided in an embodiment of the present application;
[0176] Figure 6 A schematic diagram of the structure of an information query device provided in an embodiment of the present application;
[0177] Figure 7 A schematic diagram of the structure of a device for building a knowledge base provided in an embodiment of the present application;
[0178] Figure 8 A schematic diagram of a structure of an information query device provided in an embodiment of the present application;
[0179] Fig. 9 A schematic diagram of the structure of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0180] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the embodiments of the present application are further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0181] To facilitate understanding of the technical solution provided by this application, the background technology of this application will be described below.
[0182] After studying the traditional methods of obtaining drug information, the inventors found that for common and mild diseases, patients may consider choosing drugs on their own; and for drugs prescribed by doctors, patients may need to understand the relevant precautions for taking the drugs before using them. Users have a need to obtain drug information, and users can usually obtain drug information by searching the Internet, reading the drug instructions, or asking professional doctors and pharmacists. However, the drug information obtained by users through the above methods may not be accurate and comprehensive, and may not meet the required drug information.
[0183] Based on this, the embodiment of the present application provides a method for constructing a knowledge base, an information query method, an apparatus and a device. Through the drug entity record, a drug knowledge base is first established; then, according to the drug information history query record, the related knowledge base associated with the drug knowledge base can be determined; finally, based on the drug entity information corresponding to the drug entity in the drug knowledge base, the association relationship between the drug entity in the drug knowledge base and the non-drug field entity in the related knowledge base is determined. The drug knowledge base, the related knowledge base, and the association relationship between the drug entity and the non-drug field entity in the related knowledge base are used to generate a query knowledge base for drug information.
[0184] The query knowledge base includes: a drug knowledge base, a related knowledge base associated with the drug knowledge base, and the association between drug entities in the drug knowledge base and non-drug domain entities in the related knowledge base. Based on the query knowledge base, a relatively accurate and complete query of drug information can be performed. By obtaining a query request for drug information sent by a client, the corresponding entity and query intent can be identified from the query request, and the query is performed in the query knowledge base based on the identified entity and query intent to obtain the query result. The established query knowledge base can realize a quick query of drug information and obtain accurate drug information that meets user needs.
[0185] In order to facilitate understanding of the knowledge base construction method and information query method provided in the embodiments of the present application, Figure 1 The application scenario of the information query method provided in the embodiment of the present application is described. Figure 1 The schematic diagram of a framework of an exemplary application scenario of an information query method provided in an embodiment of the present application is as follows: The information query method provided in an embodiment of the present application can be applied to the server 20.
[0186] In practical applications, a drug entity record corresponding to a drug entity can be constructed first, wherein the drug entity record includes the drug entity and the drug entity information corresponding to the drug entity. Based on the drug entity, the corresponding drug entity record, and the association between the two, a drug knowledge base is established.
[0187] In addition, when querying drugs, users may also query other factors related to drugs, such as population, symptoms, food ingredients, exercise, etc. Correspondingly, based on the historical query records for drug information, the relevant knowledge base associated with the drug knowledge base can be determined. The relevant knowledge base may include non-drug field entities associated with drug entities (hereinafter referred to as relevant entities), and entity information corresponding to each entity. An association relationship between drug entities in the drug knowledge base and non-drug field entities in the relevant knowledge base is established, and a query knowledge base 30 for drug information can be generated by using the drug knowledge base, the relevant knowledge base, and the association relationship between drug entities and non-drug field entities in the relevant knowledge base.
[0188] The query knowledge base 30 includes: a drug knowledge base, a related knowledge base associated with the drug knowledge base, and an association relationship between drug entities in the drug knowledge base and non-drug domain entities in the related knowledge base. Drug information can be queried through the query knowledge base 30. If a user needs to query certain drug information, a query request for drug information can be sent through the client 10. After obtaining the query request, the server 20 identifies at least one entity and determines its query intent. According to the query intent and the obtained entity, a query is performed in the query knowledge base 30 to obtain the query result. The query result is sent to the client 10 so that the user can view the query result through the client 10 and obtain the required drug information.
[0189] Those skilled in the art will understand that Figure 1 The framework diagram shown is only an example in which the embodiments of the present application can be implemented. The scope of application of the embodiments of the present application is not limited by any aspect of the framework.
[0190] It should be noted that the client 10 can be any user device that is currently available, under development, or developed in the future, and can interact with each other through any form of wired and / or wireless connection (e.g., Wi-Fi, LAN, cellular, coaxial cable, etc.), including but not limited to: smart wearable devices, smart phones, non-smart phones, tablet computers, laptop personal computers, desktop personal computers, minicomputers, mid-range computers, mainframe computers, etc. that are currently available, under development, or developed in the future. The implementation of the present application is not limited in this regard. It should also be noted that the server 20 in the embodiment of the present application can be an example of a device that is currently available, under development, or developed in the future and can perform the above operations. The implementation of the present application is not limited in this regard.
[0191] To facilitate understanding of the technical solution provided in the embodiment of the present application, the method for constructing a knowledge base provided in the embodiment of the present application will be described below with reference to the accompanying drawings.
[0192] See also Figure 2 , which is a flow chart of a method for building a knowledge base provided in an embodiment of the present application, such as Figure 2 As shown, the method may include S201-S204:
[0193] S201: Obtain a drug entity record, where the drug entity record includes a drug entity and drug entity information of the drug entity, and the drug entity information includes at least one drug information field and drug information corresponding to the drug information field.
[0194] The drug entity record includes the drug entity and the drug entity information corresponding to the drug entity. Specifically, the drug entity may be the name of the drug, and the drug entity information may be drug information related to the drug, such as the price, ingredients, properties, indications, specifications, usage and dosage, adverse reactions, contraindications, precautions, etc. of the drug.
[0195] The drug entity information includes at least one drug information field and the drug information corresponding to the drug information field. The drug information field can be used to characterize the type of drug information, for example, it can be the name of the information type corresponding to the drug information, and the drug information is the specific content corresponding to the drug information field. For example, the drug information field is "indications", and the corresponding drug information is "used to relieve symptoms such as fever, headache, sore throat, nasal congestion, sneezing, etc. caused by the common cold or influenza."
[0196] The embodiments of the present application do not limit the specific implementation method of obtaining the drug entity record. It can be obtained through the instructions of each drug, or through books, articles, network query results, etc. related to the drug. The drug instructions have structured fields, and the structured fields in the instructions can be extracted, and the corresponding general fields can be determined as the drug information fields in the drug entity record.
[0197] As an example, the drug information field and the drug information corresponding to the drug information field can be represented as: [Drug information field: drug information], for example: [Indications: otitis media, sinusitis, pharyngitis, tonsil inflammation], [Drug ingredients: β-lactam antibiotics, penicillins].
[0198] S202: Establish a drug knowledge base based on the drug entity, the drug entity record corresponding to the drug entity, and the association between the two.
[0199] Based on the acquired drug entity records, the drug entities and drug entity information in each drug entity record may be determined.
[0200] In addition, the drug knowledge base can also include the associations between various drug entities. For example, the "taboo" association that indicates that drugs cannot be taken at the same time and the "suitable" association that indicates that drugs can be taken together. The connection between various drug entities in the drug knowledge base can be constructed, so as to establish a drug knowledge base based on the drug entity records and the associations between various drug entities. Specifically, the drug knowledge base can be established through technologies such as deep learning and knowledge graphs.
[0201] For drug entity records corresponding to drugs with the same ingredients but different drug names, corresponding drug entities can be established respectively. For example, ibuprofen, ibuprofen sustained-release capsules, ibuprofen sustained-release tablets, and Fenbid are all drugs with ibuprofen as the ingredient. Among them, ibuprofen is the name of a chemical drug and the name of a drug raw material. Ibuprofen sustained-release capsules and ibuprofen sustained-release tablets are the generic names of drugs. Fenbid is the trade name of the drug. In order to facilitate users to obtain more accurate drug information, four drug entities, ibuprofen, ibuprofen sustained-release capsules, ibuprofen sustained-release tablets, and Fenbid, can be established respectively, and these four drug entities have corresponding drug entity information respectively.
[0202] In one possible implementation, an embodiment of the present application provides a specific implementation method for establishing a drug knowledge base based on drug entities, drug entity records corresponding to drug entities, and the association between the two. Please see below.
[0203] S203: Determine, based on the historical query records of drug information, a related knowledge base associated with the drug knowledge base, wherein the related knowledge base includes non-drug domain entities associated with the drug entity.
[0204] Among them, relevant knowledge bases may include symptom knowledge base, population knowledge base, food knowledge base, and exercise knowledge base, etc.
[0205] The use of drugs is also related to other factors, such as symptoms, applicable population, dietary taboos, and exercise taboos. When users query drug information, they can query drug information that meets the conditions through other related factors.
[0206] In order to determine the knowledge base associated with the drug knowledge base from various knowledge bases, the factors associated with the drug can be determined based on the historical query records of drug information, so as to determine the entity in the non-drug field associated with the drug entity, that is, the related entity. And based on the related entities in each related field, the relevant knowledge base corresponding to the field is determined. The historical query record of drug information can specifically be the historical query record of the user for drug information, and the historical query record includes information associated with the drug entity. By analyzing the historical query record of drug information, the factors related to the drug entity can be obtained, and then the relevant knowledge base associated with the drug knowledge base can be determined.
[0207] For example, based on the historical drug information query records such as "What cold medicine can pregnant women take?" and "What antipyretic medicine is specifically for children?", it can be determined that there is an association between a specific population and the medicine, and the population knowledge base associated with the drug knowledge base can be determined accordingly. Similarly, the historical drug information query records can also be "What medicine can relieve headaches?", "Can I take anti-inflammatory medicine after drinking?" and "Can I drive after taking cold medicine?" Correspondingly, it can be determined that the relevant knowledge base also includes a symptom knowledge base, a food knowledge base, and a sports knowledge base.
[0208] In a possible implementation, the embodiment of the present application also provides a specific implementation method for determining a related knowledge base associated with a drug knowledge base based on historical drug information query records, please see below.
[0209] S204: Establishing an association relationship between the drug entity and non-drug domain entities in a related knowledge base based on the drug entity information of the drug entity.
[0210] S205: Generate a query knowledge base for drug information based on the drug knowledge base, the related knowledge bases associated with the drug knowledge base, and the association relationship between drug entities in the drug knowledge base and non-drug domain entities in the related knowledge bases.
[0211] Specifically, association relationships may be established between drug entities and symptom entities in the symptom knowledge base, population entities in the population knowledge base, ingredient entities in the ingredient knowledge base, and exercise entities in the exercise knowledge base.
[0212] After determining the relevant knowledge base, it is necessary to establish an association relationship between the entities in the relevant knowledge base and the drug entity. The drug entity information of the drug entity contains information related to the drug entity, which may contain information related to the drug entity and non-drug domain entities such as symptom entities, population entities, food entities, and exercise entities. Based on the drug entity information, the association relationship between the drug entity and the non-drug domain entities in the relevant knowledge base can be determined and established, and the non-drug domain entities that have an association relationship with the drug entity are the relevant entities.
[0213] Based on the drug knowledge base, the related knowledge base, and the association relationship between the drug entity and the non-drug domain entity in the related knowledge base, a query knowledge base for drug information can be established. The query knowledge base includes: the drug knowledge base, the related knowledge base associated with the drug knowledge base, and the association relationship between the drug entity in the drug knowledge base and the non-drug domain entity in the related knowledge base. According to the entities and association relationships in the query knowledge base, corresponding queries can be performed on drug information.
[0214] Based on the above S201-S205, it can be known that by establishing a query knowledge base including a drug knowledge base, a related knowledge base associated with the drug knowledge base, and a relationship between drug entities in the drug knowledge base and non-drug domain entities in the related knowledge base, a knowledge base integrating drug-related knowledge can be obtained. Thus, users can query more accurate and comprehensive drug-related information based on the query knowledge base of drug information.
[0215] It is understandable that there are relationships between drugs that affect each other. For example, there may be drugs that cannot be used at the same time, or drugs that need to be used together to be effective. When establishing a drug knowledge base, it is also necessary to establish relationships between drug entities.
[0216] The present application embodiment provides a specific implementation method of establishing a drug knowledge base based on a drug entity, a drug entity record corresponding to the drug entity, and an association relationship between the drug entity and the drug entity, including the following two steps A1-A2:
[0217] A1: Determine the association between drug entities based on the drug information corresponding to the contraindication information field and / or precaution field in the drug entity information, and the drug information corresponding to the drug ingredient type field.
[0218] The drug entity information may contain a contraindication information field, and the drug information corresponding to the contraindication information field is contraindication information. The contraindication information contains specific contraindications related to the drug entity. For example, the contraindication information field in the drug entity information of "Ibuprofen Tablets" corresponds to the contraindication information that "People who are allergic to aspirin or other non-steroidal anti-inflammatory drugs may have cross-allergic reactions to this product. This product may also cause bronchospasm in asthmatics who are allergic to aspirin. This product is contraindicated for such patients."
[0219] The drug entity information may have a precautions field, and the drug information corresponding to the precautions field is precautions. The precautions contain matters that require special attention when using the drug entity. For example, the precautions field in the drug entity information of "Ibuprofen Tablets" corresponds to the precautions "1. Use in late pregnant women may prolong the pregnancy period, cause dystocia and prolonged labor. Not suitable for pregnant and lactating women. 2. It has an inhibitory effect on platelet aggregation and can prolong bleeding time, but the bleeding will disappear within 24 hours of stopping the drug, etc."
[0220] At least one of the drug information corresponding to the contraindication information field or the precaution field may contain relevant information of other drug entities associated with the drug entity. Through at least one of the contraindication information or precautions, other drug entities associated with the drug entity can be determined. For example, the precautions in the drug entity information of "Gankang" contain "enhancing the anticoagulant effect of anticoagulants". Based on the precautions, it can be determined that the drug entity corresponding to "Gankang" has an associated relationship with the drug entity corresponding to the anticoagulant.
[0221] The drug entity information may have a drug ingredient type field. The drug information corresponding to the drug ingredient type field is the drug ingredient type, which is used to determine the specific drug ingredient type. Based on the drug ingredient type, the drug entity belonging to the drug ingredient type can be determined.
[0222] According to at least one of the contraindication information or precautions in the drug entity information and the drug ingredient type corresponding to the drug ingredient type field, the drug entities with associated relationships can be determined.
[0223] The embodiment of the present application provides a specific implementation method for determining the association relationship between drug entities based on the drug information corresponding to the contraindication information field and / or the precaution field in the drug entity information, and the drug information corresponding to the drug ingredient type field. Please see below.
[0224] A2: Add drug entity records to the drug knowledge base, and associate drug entities with associated relationships with drug entities corresponding to each drug entity record in the drug knowledge base.
[0225] When establishing a drug knowledge base, drug entity records can be added to the drug knowledge base first, and then drug entities with associated relationships can be associated based on the drug entities corresponding to the drug entity records in the drug knowledge base. Finally, a drug knowledge base including drug entities, drug entity information, and associated relationships between drug entities is obtained.
[0226] Based on the above content, it can be known that the drug entities with associated relationships can be determined through the contraindications and / or precautions in the drug entity information corresponding to the drug entity, as well as the drug ingredient type. Then, a drug knowledge base including the associated relationships between drug entities can be established, so that the information in the drug knowledge base is more complete, and the accuracy and comprehensiveness of the query results obtained by users when querying can be improved.
[0227] Further, the embodiment of the present application provides a specific implementation method of step A1 determining the association relationship between drug entities according to the drug information corresponding to the contraindication information field and / or the precaution field in the drug entity information, and the drug information corresponding to the drug ingredient type field, which specifically includes the following four steps B1-B4:
[0228] B1: Read the contraindication information field and / or precaution field in the drug entity information of the first drug entity to obtain the contraindication information and / or precautions of the first drug entity; the first drug entity is any one of the drug entities.
[0229] Any drug entity in the drug knowledge base is used as the first drug entity, and at least one of the contraindication information field or the precaution field in the drug entity information of the first drug entity is read. The contraindication information of the first drug entity can be obtained according to the contraindication information field. The precaution information of the first drug entity can be obtained according to the precaution field. The contraindication information and the precaution information contain information related to the first drug entity that needs to be paid attention to when using it.
[0230] B2: Identify information related to drug ingredients and association relationships from the contraindication information and / or precaution information of the first drug entity, determine the identified information related to drug ingredients as a target drug ingredient type, and determine the identified information related to the association relationship as a target association relationship type.
[0231] By identifying the contraindication information and / or precaution information of the first drug entity, information related to the drug components and association relationships can be obtained.
[0232] The information related to the drug ingredients is the drug ingredient types involved in the contraindication information and / or precaution information. The identified information related to the drug ingredients is determined as the target drug ingredient type. For example, if the contraindication information of the first drug entity "Amoxicillin Capsules" is "cannot be taken with tetracycline drugs and chloramphenicol drugs at the same time", the corresponding identified information related to the drug ingredients is "tetracycline drugs" and "chloramphenicol drugs", and "tetracycline drugs" and "chloramphenicol drugs" are used as the target drug ingredient types.
[0233] The information related to the association relationship refers to the type of the association relationship between the drug component type involved in the contraindication information and / or the precaution information and the first drug entity. The identified information related to the association relationship is determined as the target association relationship type.
[0234] The association relationship type can specifically be "taboo" or "suitable". "Taboo" means that the first drug entity and the drug entity corresponding to the target drug ingredient type cannot be taken at the same time. "Suitable" means that the first drug entity and the drug entity corresponding to the target drug ingredient type need to be taken at the same time. Taking the above-mentioned contraindication information as an example, the association relationship type between the first drug entity and the drug entities corresponding to "tetracycline drugs" and "chloramphenicol drugs" is "taboo", and "taboo" is used as the target association component type.
[0235] B3: Obtain a drug entity in the drug knowledge base whose drug ingredient type belongs to the target drug ingredient type, establish an association relationship between it and the first drug entity, and set the association relationship type to the target association relationship type.
[0236] Read drug entity information of drug entities other than the first drug entity in the drug knowledge base, obtain the drug ingredient type from the drug entity information, and if the drug ingredient type of a drug entity belongs to the target drug ingredient type, construct an association relationship between the drug entity whose drug ingredient type belongs to the target drug ingredient type and the first drug entity, and set the association relationship type to the target association relationship type.
[0237] For example, the first drug entity is "Amoxicillin Capsules", the corresponding target drug ingredient types are "Tetracyclines" and "Chloramphenicol", and the target association type is "Avoid". The drug ingredient type corresponding to "Thiamphenicol" is "Chloramphenicol", so you can establish an association between "Thiamphenicol" and "Amoxicillin Capsules", and set the association to "Avoid".
[0238] In a possible implementation, the drug entity information of other drug entities in the drug knowledge base can be identified through the recognition model of the drug ingredient type field to obtain the drug ingredient type. The drug ingredient type can also be obtained by searching for keywords or key words corresponding to the pre-set drug ingredient type field.
[0239] In the embodiment of the present application, by determining the target drug component type and the target association type corresponding to the first drug entity, a drug entity belonging to the target drug component type can be associated with the first drug entity, and the association belongs to the target association type. In this way, a relatively complete association relationship between drug entities can be established, thereby improving the comprehensiveness and accuracy of drug information query based on the query knowledge base.
[0240] In a possible implementation, the drug information history query record has an entity, and the relevant knowledge base to be established can be determined by entity recognition of the drug information history query record. The present application embodiment provides a method of S203 to determine the relevant knowledge base associated with the drug knowledge base according to the drug information history query record, including:
[0241] Perform entity recognition on historical drug information query records to obtain the non-drug domain entities and the types to which the entities belong;
[0242] The related knowledge base associated with the drug knowledge base is determined according to the type to which the entity belongs.
[0243] The drug information history query record may contain entities that represent specific meanings. By performing entity recognition on the drug information history query record, the entities and entity types included in the drug information history query record can be obtained. The recognized entity type is used to indicate the type to which the entity belongs. Specifically, the drug information history query record can be subjected to entity recognition through a pre-trained entity recognition model, and the entity type can be a pre-defined type of entity that may appear in the drug information history query record.
[0244] The entity type obtained by identification is an entity type related to the drug entity. According to the obtained entity type, the relevant knowledge base that needs to be associated with the drug knowledge base can be determined from various constructed knowledge bases.
[0245] Based on the above content, it can be known that by determining the relevant knowledge base associated with the drug knowledge base through the historical query records of drug information, the relevant knowledge base can be determined according to the user's query needs to ensure the integrity of the query knowledge base of drug information, so that users can query the required drug information based on the query knowledge base.
[0246] In a possible implementation, the relevant knowledge base may include a symptom knowledge base, a population knowledge base, a food knowledge base, and a sports knowledge base; the present application embodiment further provides a specific implementation method of establishing an association relationship between a drug entity and a non-drug domain entity in the relevant knowledge base according to the drug entity information of the drug entity in S204, including:
[0247] According to the drug entity information of the drug entity, an association relationship is established between the drug entity and the symptom entity in the symptom knowledge base, the population entity in the population knowledge base, the ingredient entity in the ingredient knowledge base, and the exercise entity in the exercise knowledge base.
[0248] Specifically, the above process can be implemented in the following ways:
[0249] In one possible implementation, in order to establish an association relationship between a drug entity and a symptom entity in a symptom knowledge base, information corresponding to the indication field in the drug entity information of the second drug entity can be read to obtain the indication of the second drug entity; the symptom entity corresponding to the indication of the second drug entity in the symptom knowledge base is obtained to construct an association relationship between the symptom entity and the second drug entity; the second drug entity is any one of the drug entities.
[0250] It is understandable that a drug has a corresponding symptom for treatment, that is, the corresponding indication of the drug. The drug entity information of the drug entity includes the indication field of the drug, and the information corresponding to the indication field is the specific content of the indication. Any one of the drug entities is used as the second drug entity, and the information corresponding to the indication field in the drug entity information of the second drug entity is read to obtain the indication of the second drug entity.
[0251] Taking "Gankang" as the second drug entity as an example, the content of the indication corresponding to the indication field in the drug entity information of "Gankang" is "suitable for relieving fever, headache, sore limbs, sneezing, runny nose, nasal congestion, sore throat and other symptoms caused by common cold and influenza". According to the information of the indication corresponding to the indication field, it can be determined that the indication of the second drug entity "Gankang" is fever, headache, sore limbs, sneezing, runny nose, nasal congestion, sore throat and other symptoms caused by common cold and influenza.
[0252] See also Figure 3 As shown in FIG. 1 , this figure is a schematic diagram of the structure of a query knowledge base provided in an embodiment of the present application. The query knowledge base includes a drug knowledge base and a related knowledge base, wherein the related knowledge base is a symptom knowledge base.
[0253] The symptom knowledge base has symptom entities, which may correspond to various symptoms. The symptom entity corresponding to the indication of the second drug entity is determined from the symptom knowledge base, and an association relationship is established between the determined symptom entity and the second drug entity, thereby achieving the establishment of an association relationship between the symptom entity in the symptom knowledge base and the drug entity in the drug knowledge base.
[0254] Taking the above second drug entity "Gankang" as an example, the indications of the second drug entity "Gankang" are fever, headache, limb pain, sneezing, runny nose, nasal congestion, sore throat and other symptoms caused by common cold and influenza. The symptom entities "fever", "headache", "limb pain", "sneezing", "runny nose", "nasal congestion" and "sore throat" in the symptom knowledge base can be associated with the second drug entity "Gankang" respectively.
[0255] In one possible implementation, in order to establish an association relationship between a drug entity and a population entity in a population knowledge base, information corresponding to a contraindication information field and / or a precaution field in the drug entity information of a second drug entity can be read to obtain the contraindication information and / or precautions of the second drug entity; information related to the applicable population can be identified from the contraindication information and / or precautions information of the second drug entity; a population entity corresponding to the information related to the applicable population in the population knowledge base is obtained to construct an association relationship between the population entity and the second drug entity; the second drug entity is any one of the drug entities.
[0256] At least one of the contraindication information field or the precaution field in the drug entity information of the second drug entity is read. The contraindication information of the second drug entity can be obtained according to the information corresponding to the contraindication information field. The precaution information of the second drug entity can be obtained according to the information corresponding to the precaution field. The contraindication information and the precaution information contain information that needs to be noted and is related to the second drug entity.
[0257] The contraindication information and / or precaution information of the second drug entity contains information related to the second drug entity and the applicable population. Entity recognition is performed on the contraindication information and / or precaution information of the second drug entity to obtain the related entities included in the contraindication information and / or precaution information. The related entity may be a population entity.
[0258] For example, taking "ibuprofen tablets" as the second drug entity, the precautions field in the drug entity information of "ibuprofen tablets" contains the precautions information that says "Used in late pregnancy women may prolong the pregnancy period, cause dystocia and prolonged labor. Not suitable for pregnant and lactating women." By performing entity recognition on the precautions information, the population entities of "pregnant women" and "lactating women" corresponding to the second drug entity "ibuprofen tablets" can be obtained.
[0259] See also Figure 3 As shown, the relevant knowledge base may also include a crowd knowledge base. The crowd knowledge base has crowd entities, which may correspond to various types of crowds, such as pregnant women, children, and people with hypertension. The crowd entity may have corresponding crowd entity information, which may be information used to explain the crowd. For example, the crowd entity information corresponding to "children" may be anyone under the age of 18.
[0260] A population entity corresponding to the second drug entity is determined from the population knowledge base, and an association relationship is established between the determined population entity and the second drug entity, thereby achieving the establishment of an association relationship between the population knowledge base and the drug knowledge base.
[0261] Taking the second drug entity "ibuprofen tablets" as an example, the second drug entity "ibuprofen tablets" includes the population entities of "pregnant women" and "lactating women". The population entities "pregnant women" and "lactating women" in the population knowledge base are associated with the second drug entity "ibuprofen tablets" respectively.
[0262] In one possible implementation, in order to establish an association relationship between a drug entity and an ingredient entity in an ingredient knowledge base, information corresponding to a contraindication information field and / or a precaution field in the drug entity information of a second drug entity can be read to obtain the contraindication information and / or precautions of the second drug entity; information related to the ingredient can be identified from the contraindication information and / or precautions information of the second drug entity; an ingredient entity corresponding to the ingredient-related information in the ingredient knowledge base is obtained to construct an association relationship between the ingredient entity and the second drug entity; the second drug entity is any one of the drug entities.
[0263] Similarly, at least one of the contraindication information field or the precautions field in the drug entity information of the second drug entity is read. The contraindication information of the second drug entity can be obtained according to the information corresponding to the contraindication information field. The precautions information of the second drug entity can be obtained according to the information corresponding to the precautions field. The contraindication information and the precautions information contain information that needs to be noted and is related to the second drug entity.
[0264] The contraindication information and / or precaution information of the second drug entity contains information related to the second drug entity and the food material. Entity recognition is performed on the contraindication information and / or precaution information of the second drug entity to obtain the related entities included in the contraindication information and / or precaution information. The related entity may be a food material entity.
[0265] For example, take "999 Ganmao Ling Granules" as the second drug entity, and the taboo information of "999 Ganmao Ling Granules" includes "avoid smoking, drinking, spicy, cold, and greasy food". By performing entity recognition on the taboo information, the food entities of "smoking", "drinking", "spicy", "cold", and "greasy" corresponding to the second drug entity "999 Ganmao Ling Granules" can be obtained.
[0266] See also Figure 3 As shown, the relevant knowledge base may also include a food knowledge base. The food knowledge base has food entities corresponding to various foods. The food entity corresponding to the second drug entity is determined from the food knowledge base, and an association relationship is established between the determined food entity and the second drug entity.
[0267] Taking the second drug entity "999 Ganmao Ling Granules" as an example, the food entities included in the second drug entity "999 Ganmao Ling Granules" are "Cigarettes" and "Wine". Correspondingly, "999 Ganmao Ling Granules" can be associated with the food entities "Cigarettes" and "Wine" in the food knowledge base.
[0268] It should be noted that the ingredient entity may also include an entity that is a general term for a type of food. For example, seafood, greasy, spicy, etc. The ingredient entity may have corresponding ingredient entity information, and the ingredient entity information includes the specific types of things that this type of ingredient includes. For example, the ingredient entity information corresponding to "spicy" includes foods such as peppers, onions, ginger, leeks, garlic, coriander, pepper, and onions. Taking the above-mentioned second drug entity "999 Ganmao Ling Granules" as an example, the ingredient entities included in the second drug entity "999 Ganmao Ling Granules" are "spicy", "raw and cold" and "greasy". Correspondingly, "999 Ganmao Ling Granules" can be associated with "spicy", "raw and cold" and "greasy" in the ingredient knowledge base.
[0269] In one possible implementation, in order to establish an association relationship between a drug entity and a sports entity in a sports knowledge base, information corresponding to a contraindication information field and / or a precaution field in the drug entity information of a second drug entity can be read to obtain the contraindication information and / or precautions of the second drug entity; sports-related information can be identified from the contraindication information and / or precautions information of the second drug entity; the sports entity corresponding to the sports-related information in the sports knowledge base is obtained to construct an association relationship between the sports entity and the second drug entity; the second drug entity is any one of the drug entities.
[0270] Similarly, at least one of the contraindication information field or the precautions field in the drug entity information of the second drug entity is read. The contraindication information of the second drug entity can be obtained according to the information corresponding to the contraindication information field. The precautions information of the second drug entity can be obtained according to the information corresponding to the precautions field. The contraindication information and the precautions information contain information that needs to be noted and is related to the second drug entity.
[0271] The contraindication information and / or precaution information of the second drug entity contains information related to the second drug entity and related to sports. Entity recognition is performed on the contraindication information and / or precaution information of the second drug entity to obtain related entities included in the contraindication information and / or precaution information. The related entity may be a sports entity.
[0272] For example, take "Gankang" as the second drug entity, and the precautions information in the drug entity information of "Gankang" contains "This product may cause symptoms such as drowsiness and sleepiness. Therefore, you should not drive a plane, car, or ship, or engage in high-altitude work, mechanical work, or operate precision instruments during medication." By performing entity recognition on the precautions information of "Gankang", we can obtain the motion entities of "driving", "high-altitude work", "mechanical work", and "operating precision instruments" corresponding to the second drug entity "Gankang".
[0273] See also Figure 3 As shown, the related knowledge base may also include a motion knowledge base. The motion knowledge base has motion entities corresponding to various types of motion. The motion entity corresponding to the second drug entity is determined from the motion knowledge base, and an association relationship is established between the determined motion entity and the second drug entity.
[0274] Taking the second drug entity "Gankang" as an example, "Gankang" includes the motion entities of "driving", "high-altitude work", "mechanical work" and "operating precision instruments". The motion entities "driving", "high-altitude work", "mechanical work" and "operating precision instruments" in the motion knowledge base are associated with "Gankang" respectively.
[0275] Similarly, it should be noted that a motion entity may correspond to a general term for a type of motion. A motion entity may have corresponding motion entity information, and the motion entity information may include the types of motion that the motion entity specifically includes. For example, the motion entity information corresponding to "high-altitude work" includes specific motion types such as edge, hole, climbing, hanging, crossing, etc.
[0276] In the embodiment of the present application, the association relationship between the drug entity in the drug knowledge base and the entities in other related knowledge bases can be established based on the indications and various entities corresponding to the second drug entity. Based on the established association relationship, the generated query knowledge base is more complete, which facilitates users to query drug information through other information related to the drug, and improves the accuracy of the queried drug information.
[0277] Based on the method for building a knowledge base provided in the above embodiment, the embodiment of the present application further provides an information query method. The information query method provided in the embodiment of the present application will be described below in conjunction with the accompanying drawings.
[0278] See also Figure 4 , which is a flow chart of an information query method provided by an embodiment of the present application, such as Figure 4 As shown, the method may include S401-S405:
[0279] S401: Obtaining a query request for drug information sent by a client.
[0280] When querying drug information, the user can trigger a query request for drug information in the client. The client sends the query request to the corresponding server. The server obtains the query request sent by the client.
[0281] The query request includes relevant information provided by the user when querying drug information. The query request may include the content of the user's query question. By analyzing the query request, the information that the user wants to query can be determined.
[0282] S402: Identify at least one of a drug entity or a non-drug domain entity from the query request.
[0283] The drug information query request includes entities related to drug information, which may be drug entities or at least one of non-drug domain entities. Specifically, the non-drug domain entity may include at least one of symptom entities, population entities, food entities, or sports entities.
[0284] By performing entity recognition on the query request, entities related to drug information can be obtained, thereby realizing the query of drug information.
[0285] For example, if the query request is "what medicine to take for fever", entity recognition of the query request can obtain the symptom entity "fever". If the query request is "what does Gankang treat", recognition can obtain the drug entity "Gankang". If the query request is "can children eat watermelon after taking children's cold granules", recognition can obtain the population entity "children", the drug entity "children's cold granules" and the food entity "watermelon". If the query request is "can I take 999 cold granules while driving", recognition can obtain the sport entity "driving" and the drug entity "999 cold granules".
[0286] S403: Determine the query intention according to the query request.
[0287] When users query drug information, they have the intention to query. The query intent is used to reflect the goal of the drug information that the user wants to query, and the specific drug information that the user wants to obtain can be determined based on the query intent. For example, if the query request is "What medicine to take for fever", the corresponding query intent is the name of the drug. If the query request is "Can I take 999 Cold Relief Granules while driving", the corresponding query intent is the precautions for drug use.
[0288] The embodiments of the present application do not limit the implementation method of determining the query intent of a query request. In one possible implementation method, the intent of the query request can be identified by a pre-trained intent recognition model.
[0289] S404: Query the query knowledge base according to the query intent and at least one of the obtained drug entities or non-drug domain entities to obtain query results; the query knowledge base is constructed according to the method for constructing a knowledge base in any of the above embodiments.
[0290] Based on at least one of the entities identified from the query request and the determined query intent, a query is performed using the query knowledge base established in the above embodiment to obtain a corresponding query result, which contains drug information corresponding to the query request.
[0291] Specifically, the identified entities can be used to determine associated entities and related information, and the determined query intent can be used to determine the queried drug information.
[0292] In a specific implementation, an embodiment of the present application provides a specific implementation method for querying a query knowledge base based on the query intent and at least one of the obtained drug entities or non-drug field entities to obtain query results. Please see below.
[0293] S405: Send the query result to the client.
[0294] The query result contains the drug information that the user wants to obtain. The query result is sent to the client so that the client can display the query result.
[0295] In order to improve the user experience, in a possible implementation, the query results can be displayed to the user in an interactive manner in natural language. Specifically, the query results can be converted into the form of natural language through a language model. In addition, the query results can also be converted into the form of natural language through pre-set language rules or reply templates. For example, reply templates for different types of query requests can be pre-set, and the corresponding reply templates can be improved using the determined query results to form query results in natural language. In actual applications, an interface with a pharmacist character image can also be displayed on the client, and the query results are displayed to the user in this interface, so that the query process is closer to the natural language communication process.
[0296] Based on the relevant contents of S401-S405 above, it can be known that by identifying and analyzing the query request for drug information, the entities and query intent included in the query request can be determined. Based on the determined entities and query intent, query results for drug information that better meet the needs of the user can be queried, making the query results more accurate. By using the query knowledge base constructed by the method of any of the above embodiments, it can be ensured that the queried knowledge base is complete, so that users can query and obtain the required drug information, and the obtained drug information is relatively accurate.
[0297] Furthermore, when the user makes a query, the user may make a query for the corresponding drug information based on his or her own situation. In order to make the query result more accurate, the user-related information may be obtained, and the query result may be determined based on the user-related information.
[0298] In a possible implementation, before querying the query knowledge base according to the query intent and at least one of the obtained drug entity or non-drug domain entity to obtain the query result, the method further includes:
[0299] Get user portrait information;
[0300] Obtain the corresponding non-drug field entity based on the user's portrait information.
[0301] At this time, the non-drug domain entity may be a population entity and / or a symptom entity.
[0302] User portrait information is information related to the user, which is used to more accurately determine the user's needs. User portrait information may include the user's gender, age, basic medical history and other related information.
[0303] User portrait information can be personal information pre-registered by the user before using the client to query. For example, gender, age, basic medical history, etc. provided by the user when registering. It can also be personal information of the user obtained through interaction with the user.
[0304] The user character portrait information can be obtained based on the query request. Specifically, for example, when the user character portrait information is needed when querying based on the query request, the user character portrait information is triggered to be obtained. For example, the user's query request is "How to take 999 Ganmao Ling Granules", because the taking rules are different for people of different age groups, in order to provide users with more accurate drug information, the user character portrait information can be obtained, and the accurate taking rules can be determined based on the user character portrait information.
[0305] By performing entity recognition on the acquired user persona information, the population entity and / or symptom entity included in the user persona information can be obtained. For example, the user persona information includes that the user is 65 years old and has a history of hypertension. Correspondingly, the population entity obtained by recognition is "elderly people" and the symptom entity is "hypertension".
[0306] In an embodiment of the present application, the user's character portrait information can be used to determine the population entity and / or symptom entity related to the user, so as to further determine the user's relevant information and thereby determine a more accurate query result.
[0307] Since the user is querying drug information, the query results obtained include information or entities related to drug entities. If a drug entity is identified in the query request, the query result can be obtained based on the drug entity information of the drug entity, or a related entity associated with the drug entity; if a related entity is identified in the query request, the drug entity can be determined based on the related entity to obtain the query result.
[0308] In a possible implementation, the embodiment of the present application provides a method of performing a query on a query knowledge base according to the query intent and at least one of the obtained drug entities or non-drug domain entities in S404 to obtain a query result, including the following two steps C1-C2:
[0309] C1: When querying the query knowledge base based on the drug entity, the drug information field to be queried corresponding to the drug entity is determined according to the query intent.
[0310] C2: Based on the drug knowledge base included in the query knowledge base, obtain the drug information corresponding to the drug information field to be queried to obtain the query result.
[0311] For the query of information related to the drug entity, by querying the query knowledge base, the drug information field to be queried corresponding to the drug entity can be determined based on the determined query intent. The drug information field corresponds to the drug information related to the drug entity, and by reading the drug information corresponding to the drug information field to be queried, the query result corresponding to the query request can be obtained.
[0312] For example, the query request is "What does Gankang treat?", the identified drug entity is "Gankang", and the determined query intent is the drug's indications. The drug information field to be queried corresponding to "Gankang" determined based on the query intent is "Indications". The drug information corresponding to "Indications" of "Gankang" is read from the query knowledge base, and the query result is "Suitable for relieving symptoms such as fever, headache, sore limbs, sneezing, runny nose, nasal congestion, and sore throat caused by common colds and influenza". For another example, the query request is "Can Amoxicillin Capsules be taken with Thiamphenicol?", the identified drug entities are "Amoxicillin Capsules" and "Thiamphenicol", and the determined query intent is the relationship between "Amoxicillin Capsules" and "Thiamphenicol". Based on the determined query intent, the associated entity "Thiamphenicol" of "Amoxicillin Capsules" can be determined. The associated relationship between "Amoxicillin Capsules" and "Thiamphenicol" is read from the query knowledge base as "taboo", and the corresponding query result is "Cannot".
[0313] In one possible implementation, on the basis of steps C1-C2, it is also possible to obtain non-drug field entities associated with the drug entity according to the query intent based on the association relationship between the drug entity in the drug knowledge base included in the query knowledge base and the non-drug field entities in the related knowledge base; based on the related knowledge base included in the query knowledge base, obtain entity information corresponding to the non-drug field entity associated with the drug entity and add it to the query results.
[0314] If a drug entity is identified in the drug information query request, it can also be determined based on the query intent that the user wants to query a non-drug domain entity associated with the drug entity.
[0315] For queries on entities related to drug entities, the query knowledge base can be queried. Based on the association between drug entities in the drug knowledge base included in the query knowledge base and non-drug domain entities in the related knowledge base, the non-drug domain entities associated with the drug entity can be determined according to the determined query intent. The associated non-drug domain entity can be one or more of a symptom entity, a population entity, a food entity, and a sports entity. From the related knowledge base included in the query knowledge base, the entity information corresponding to the non-drug domain entity associated with the drug entity can be obtained and added to the query results.
[0316] For example, if the query request is "Can I drink alcohol after taking cephalosporin?", the identified drug entity is "cephalosporin", the food entity is "alcohol", and the determined query intent is the type of association between "cephalosporin" and "alcohol". Based on the determined query intent, the associated entity "alcohol" of "cephalosporin" can be determined. The association between "cephalosporin" and "alcohol" is read from the query knowledge base as "taboo", and the corresponding query result can be obtained as "cannot".
[0317] In a possible implementation, the embodiment of the present application provides a method of performing a query on a query knowledge base according to the query intent and at least one of the obtained drug entities or non-drug domain entities in S404 to obtain a query result, including the following three steps D1-D3:
[0318] D1: When querying the query knowledge base according to the non-drug domain entity, based on the association relationship between the drug entity in the drug knowledge base included in the query knowledge base and the non-drug domain entity in the related knowledge base, obtain the drug entity associated with the non-drug domain entity.
[0319] D2: Determine the drug information field to be queried corresponding to the drug entity according to the query intent.
[0320] D3: Based on the drug knowledge base included in the query knowledge base, obtain drug information corresponding to the drug information field to be queried to obtain the query result.
[0321] If one or more non-drug domain entities such as symptom entity, population entity, food entity or sports entity are identified in the query request, it can be determined that the user wants to query the drug entity associated with the entity.
[0322] The query knowledge base is queried, and based on the association between the drug entity in the drug knowledge base included in the query knowledge base and the non-drug field entity in the related knowledge base, the drug entity associated with one or more of the identified symptom entity, population entity, food entity or sports entity is obtained according to the determined query intent. Further, the drug information field to be queried corresponding to the drug entity is determined according to the query intent, and the drug information corresponding to the drug information field to be queried is obtained from the drug knowledge base included in the query knowledge base to obtain the query result.
[0323] For example, if the query request is "what medicine to take for a cold and sneezing", the identified symptom entity is "sneezing", and the determined query intent is medicine. From the query knowledge base, the medicine entities "Gankang", "999 Ganmaoling Granules", etc. associated with "sneezing" are determined according to the query intent, and finally the query results are obtained according to the determined medicine entities.
[0324] In a possible implementation, on the basis of steps D1-D3, entity information corresponding to entities in the non-drug field can also be obtained based on the relevant knowledge base included in the query knowledge base and added to the query results.
[0325] If one or more non-drug field entities such as symptom entity, population entity, food entity or sports entity are identified in the query request, the entity information corresponding to the non-drug field entity can also be obtained from the relevant knowledge base included in the query knowledge base and added to the query results.
[0326] In addition, when there are multiple entities obtained, some drug entities can be determined based on partial entities and query intent, and then the remaining entities can be used to determine related drug entities in the partial drug entities to obtain query results.
[0327] For example, if the query request is "What anti-inflammatory drugs can people with penicillin allergy take for tonsillitis", the identified symptom entity is "tonsillitis", the population entity is "penicillin allergy", and the determined query intent is medicine. From the query knowledge base, it can be determined that the drug entities associated with "tonsillitis" are "penicillin anti-inflammatory drugs", "cephalosporin anti-inflammatory drugs", etc. based on the query intent. Based on the population entity being "penicillin allergy", since the association relationship between "penicillin allergy" and "penicillin anti-inflammatory drugs" is "taboo", "penicillin anti-inflammatory drugs" is removed, and finally the associated drug entity is determined to be "cephalosporin anti-inflammatory drugs", etc., to obtain the query result.
[0328] In the embodiment of the present application, the information or entity to be queried is determined based on the different types of entities identified and the query intent, and then the query result is determined. By querying the query knowledge base based on the query intent, the result of the user's query can be determined more accurately to meet the user's query needs.
[0329] Based on the method for constructing a knowledge base provided in the above method embodiment, the embodiment of the present application also provides a device for constructing a knowledge base, which is explained and illustrated below in conjunction with the accompanying drawings.
[0330] See also Figure 5 , which is a schematic diagram of the structure of a device for building a knowledge base provided in an embodiment of the present application. The device for building a knowledge base provided in an embodiment of the present application includes:
[0331] A first acquisition unit 501 is used to acquire a drug entity record, wherein the drug entity record includes a drug entity and drug entity information of the drug entity, wherein the drug entity information includes at least one drug information field and drug information corresponding to the drug information field;
[0332] A first establishing unit 502 is used to establish a drug knowledge base based on the drug entity, the drug entity record corresponding to the drug entity, and the association relationship between the two;
[0333] A first determining unit 503 is used to determine a related knowledge base associated with the drug knowledge base according to the drug information history query record, wherein the related knowledge base includes a non-drug domain entity associated with the drug entity;
[0334] A second establishing unit 504 is used to establish an association relationship between the drug entity and a non-drug domain entity in the relevant knowledge base according to the drug entity information of the drug entity;
[0335] The generating unit 505 is used to generate a query knowledge base for drug information based on the drug knowledge base, the related knowledge base associated with the drug knowledge base, and the association relationship between the drug entity in the drug knowledge base and the non-drug domain entity in the related knowledge base.
[0336] In a possible implementation, the first establishing unit 502 includes:
[0337] A first determining subunit is used to determine the association relationship between the drug entities according to the drug information corresponding to the contraindication information field and / or the precaution field in the drug entity information, and the drug information corresponding to the drug ingredient type field;
[0338] The associating subunit is used to add the drug entity record to the drug knowledge base, and to associate the drug entities with associated relationships with respect to the drug entities corresponding to each drug entity record in the drug knowledge base.
[0339] In a possible implementation manner, the first determining subunit includes:
[0340] A first reading subunit is used to read the contraindication information field and / or the precaution field in the drug entity information of the first drug entity to obtain the contraindication information and / or precautions of the first drug entity; the first drug entity is any one of the drug entities;
[0341] a second determination subunit, configured to identify information related to drug ingredients and association relationships from the contraindication information and / or precaution information of the first drug entity, determine the identified information related to drug ingredients as a target drug ingredient type, and determine the identified information related to the association relationship as a target association relationship type;
[0342] A construction subunit is used to obtain a drug entity in the drug knowledge base whose drug ingredient type belongs to the target drug ingredient type, construct an association relationship between it and the first drug entity, and set the association relationship type to the target association relationship type.
[0343] In a possible implementation, the first determination unit 503 is specifically configured to perform entity recognition on the drug information history query record to obtain the non-drug domain entities and the types of the entities included in the drug information history query record;
[0344] Determine a related knowledge base associated with the drug knowledge base according to the type of the entity.
[0345] In a possible implementation, the relevant knowledge base includes a symptom knowledge base, a population knowledge base, a food knowledge base, and a sports knowledge base;
[0346] The generating unit 505 is specifically used to establish an association relationship between the drug entity and the symptom entity in the symptom knowledge base, the population entity in the population knowledge base, the ingredient entity in the ingredient knowledge base, and the exercise entity in the exercise knowledge base based on the drug entity information of the drug entity.
[0347] In a possible implementation, the generating unit 505 includes:
[0348] A first reading subunit is used to read information corresponding to an indication field in drug entity information of a second drug entity to obtain an indication of the second drug entity; the second drug entity is any one of the drug entities;
[0349] The first construction subunit is used to obtain the symptom entity corresponding to the indication of the second drug entity in the symptom knowledge base, and to construct an association relationship between the symptom entity and the second drug entity.
[0350] In a possible implementation, the generating unit 505 includes:
[0351] A second reading subunit is used to read the information corresponding to the contraindication information field and / or the precaution field in the drug entity information of the second drug entity to obtain the contraindication information and / or precautions of the second drug entity; the second drug entity is any one of the drug entities;
[0352] A first identification subunit is used to identify information related to applicable population from the contraindication information and / or precaution information of the second drug entity;
[0353] The second construction subunit is used to obtain a population entity corresponding to the information related to the applicable population in the population knowledge base, and to construct an association relationship between the population entity and the second drug entity.
[0354] In a possible implementation, the generating unit 505 includes:
[0355] A third reading subunit is used to read the information corresponding to the contraindication information field and / or the precaution field in the drug entity information of the second drug entity to obtain the contraindication information and / or precautions of the second drug entity; the second drug entity is any one of the drug entities;
[0356] A second identification subunit, used to identify information related to ingredients from the contraindication information and / or precaution information of the second drug entity;
[0357] The third construction subunit is used to obtain the food entity corresponding to the information related to the food in the food knowledge base, and to construct an association relationship between the food entity and the second drug entity.
[0358] In a possible implementation, the generating unit 505 includes:
[0359] a fourth reading subunit, configured to read information corresponding to a contraindication information field and / or a precaution field in the drug entity information of a second drug entity, and obtain the contraindication information and / or precautions of the second drug entity; the second drug entity is any one of the drug entities;
[0360] A third identification subunit is used to identify the information related to exercise from the contraindication information and / or precaution information of the second drug entity;
[0361] The fourth construction subunit is used to obtain the motion entity corresponding to the information related to the motion in the motion knowledge base, and to construct an association relationship between the motion entity and the second drug entity.
[0362] Based on the information query method provided by the above method embodiment, the embodiment of the present application also provides an information query device, which is explained and illustrated below in conjunction with the accompanying drawings.
[0363] See also Figure 6 , which is a schematic diagram of the structure of an information query device provided in an embodiment of the present application. The information query device provided in an embodiment of the present application includes:
[0364] The second acquisition unit 601 is used to acquire a query request for drug information sent by a client;
[0365] An identification unit 602, configured to identify at least one of a drug entity or a non-drug domain entity from the query request;
[0366] A second determining unit 603, configured to determine a query intent according to the query request;
[0367] A query unit 604 is used to query a query knowledge base according to the query intention and at least one of the obtained drug entity or non-drug domain entity to obtain a query result; the query knowledge base is constructed according to the device for constructing a knowledge base described in any of the above embodiments;
[0368] The sending unit 605 is used to send the query result to the client.
[0369] In a possible implementation manner, the device further includes:
[0370] A third acquisition unit is used to acquire user character portrait information;
[0371] The fourth acquisition unit is used to obtain the corresponding non-drug field entity according to the user character portrait information.
[0372] In a possible implementation, the query unit 604 includes:
[0373] A third determination subunit is used to determine the drug information field to be queried corresponding to the drug entity according to the query intention when querying the query knowledge base according to the drug entity;
[0374] The first acquisition subunit is used to acquire the drug information corresponding to the drug information field to be queried based on the drug knowledge base included in the query knowledge base, and obtain the query result.
[0375] In a possible implementation manner, the device further includes:
[0376] A second acquisition subunit is used to acquire non-drug domain entities associated with the drug entity according to the query intention based on the association relationship between the drug entity in the drug knowledge base included in the query knowledge base and the non-drug domain entities in the relevant knowledge base;
[0377] The third acquisition subunit is used to acquire entity information corresponding to the non-drug field entity associated with the drug entity based on the related knowledge base included in the query knowledge base, and add it into the query result.
[0378] In a possible implementation, the query unit 604 includes:
[0379] A fourth acquisition subunit is used for, when querying the query knowledge base according to the non-drug field entity, acquiring the drug entity associated with the non-drug field entity based on the association relationship between the drug entity in the drug knowledge base included in the query knowledge base and the non-drug field entity in the relevant knowledge base;
[0380] A fourth determination subunit, configured to determine the drug information field to be queried corresponding to the drug entity according to the query intention;
[0381] The fifth acquisition subunit is used to acquire the drug information corresponding to the drug information field to be queried based on the drug knowledge base included in the query knowledge base, and obtain the query result.
[0382] In a possible implementation manner, the device further includes:
[0383] The sixth acquisition subunit is used to acquire entity information corresponding to the non-drug field entity based on the related knowledge base included in the query knowledge base, and add it into the query result.
[0384] Figure 7 A block diagram of a device 1200 for building a knowledge base is shown. For example, the device 1200 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0385] Reference Figure 7 , device 1200 may include one or more of the following components: a processing component 1202 , a memory 1204 , a power component 1206 , a multimedia component 1208 , an audio component 1210 , an input / output (I / O) interface 1212 , a sensor component 1214 , and a communication component 1216 .
[0386] The processing component 1202 generally controls the overall operation of the device 1200, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 1202 may include one or more processors 1220 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 1202 may include one or more modules to facilitate the interaction between the processing component 1202 and other components. For example, the processing component 1202 may include a multimedia module to facilitate the interaction between the multimedia component 1208 and the processing component 1202.
[0387] The memory 1204 is configured to store various types of data to support operations on the device 1200. Examples of such data include instructions for any application or method operating on the device 1200, contact data, phone book data, messages, pictures, videos, etc. The memory 1204 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0388] The power supply component 1206 provides power to the various components of the device 1200. The power supply component 1206 can include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 1200.
[0389] The multimedia component 1208 includes a screen that provides an output interface between the device 1200 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1208 includes a front camera and / or a rear camera. When the device 1200 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0390] The audio component 1210 is configured to output and / or input audio signals. For example, the audio component 1210 includes a microphone (MIC), and when the device 1200 is in an operation mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 1204 or sent via the communication component 1216. In some embodiments, the audio component 1210 also includes a speaker for outputting audio signals.
[0391] The I / O interface provides an interface between the processing component 1202 and the peripheral interface module, which may be a keyboard, a click wheel, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0392] The sensor assembly 1214 includes one or more sensors for providing various aspects of status assessment for the device 1200. For example, the sensor assembly 1214 can detect the open / closed state of the device 1200, the relative positioning of components, such as the display and keypad of the device 1200, and the sensor assembly 1214 can also detect the position change of the device 1200 or a component of the device 1200, the presence or absence of user contact with the device 1200, the orientation or acceleration / deceleration of the device 1200, and the temperature change of the device 1200. The sensor assembly 1214 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 1214 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1214 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0393] The communication component 1216 is configured to facilitate wired or wireless communication between the device 1200 and other devices. The device 1200 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 1216 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1216 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0394] In an exemplary embodiment, the device 1200 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the following methods:
[0395] Acquire a drug entity record, wherein the drug entity record includes a drug entity and drug entity information of the drug entity, wherein the drug entity information includes at least one drug information field and drug information corresponding to the drug information field;
[0396] Establishing a drug knowledge base based on the drug entity, the drug entity record corresponding to the drug entity, and the association between the two;
[0397] Determine, according to the historical query record of drug information, a related knowledge base associated with the drug knowledge base, wherein the related knowledge base includes a non-drug domain entity associated with the drug entity;
[0398] According to the drug entity information of the drug entity, establishing an association relationship between the drug entity and a non-drug domain entity in the relevant knowledge base;
[0399] A query knowledge base for drug information is generated based on the drug knowledge base, related knowledge bases associated with the drug knowledge base, and associations between drug entities in the drug knowledge base and non-drug domain entities in the related knowledge bases.
[0400] In a possible implementation, establishing a drug knowledge base based on the drug entity, the drug entity record corresponding to the drug entity, and the association between the two includes:
[0401] Determine the association relationship between the drug entities according to the drug information corresponding to the contraindication information field and / or the precaution field in the drug entity information, and the drug information corresponding to the drug ingredient type field;
[0402] The drug entity record is added to a drug knowledge base, and drug entities with associated relationships are associated with drug entities corresponding to each drug entity record in the drug knowledge base.
[0403] In a possible implementation, determining the association relationship between the drug entities according to the drug information corresponding to the contraindication information field and / or the precaution field in the drug entity information, and the drug information corresponding to the drug ingredient type field, includes:
[0404] Reading a contraindication information field and / or a precaution field in the drug entity information of a first drug entity to obtain the contraindication information and / or precautions of the first drug entity; the first drug entity is any one of the drug entities;
[0405] Identifying information related to drug ingredients and association relationships from the contraindication information and / or precaution information of the first drug entity, determining the identified information related to drug ingredients as a target drug ingredient type, and determining the identified information related to the association relationship as a target association relationship type;
[0406] Obtain a drug entity in the drug knowledge base whose drug ingredient type belongs to the target drug ingredient type, establish an association relationship between it and the first drug entity, and set the association relationship type to the target association relationship type.
[0407] In a possible implementation, determining the relevant knowledge base associated with the drug knowledge base according to the drug information history query record includes:
[0408] Perform entity recognition on the historical query records of drug information to obtain non-drug domain entities included in the historical query records of drug information and the types to which the entities belong;
[0409] Determine a related knowledge base associated with the drug knowledge base according to the type of the entity.
[0410] In a possible implementation, the relevant knowledge base includes a symptom knowledge base, a population knowledge base, a food knowledge base, and a sports knowledge base;
[0411] The establishing of the association relationship between the drug entity and the non-drug domain entity in the relevant knowledge base based on the drug entity information of the drug entity includes:
[0412] According to the drug entity information of the drug entity, an association relationship is established between the drug entity and the symptom entity in the symptom knowledge base, the population entity in the population knowledge base, the food entity in the food knowledge base, and the movement entity in the movement knowledge base.
[0413] In a possible implementation, the method includes: reading information corresponding to an indication field in drug entity information of a second drug entity to obtain an indication of the second drug entity; the second drug entity is any one of the drug entities;
[0414] Acquire the symptom entity corresponding to the indication of the second drug entity in the symptom knowledge base, and establish an association relationship between the symptom entity and the second drug entity.
[0415] In a possible implementation, the method includes:
[0416] Reading information corresponding to a contraindication information field and / or a precaution field in the drug entity information of a second drug entity to obtain contraindication information and / or precautions of the second drug entity; the second drug entity is any one of the drug entities;
[0417] Identifying information related to applicable populations from the contraindication information and / or precaution information of the second drug entity;
[0418] Obtain a population entity corresponding to the information related to the applicable population in the population knowledge base, and establish an association relationship between the population entity and the second drug entity.
[0419] In a possible implementation, the method includes:
[0420] Reading information corresponding to a contraindication information field and / or a precaution field in the drug entity information of a second drug entity to obtain contraindication information and / or precautions of the second drug entity; the second drug entity is any one of the drug entities;
[0421] Identifying information related to the food material from the contraindication information and / or precaution information of the second drug entity;
[0422] Obtain the food entity corresponding to the information related to the food in the food knowledge base, and establish an association relationship between the food entity and the second drug entity.
[0423] In a possible implementation, the method includes:
[0424] Reading information corresponding to a contraindication information field and / or a precaution field in the drug entity information of a second drug entity to obtain contraindication information and / or precautions of the second drug entity; the second drug entity is any one of the drug entities;
[0425] identifying sports-related information from the contraindication information and / or precaution information of the second drug entity;
[0426] Obtain a motion entity corresponding to the information related to the motion in the motion knowledge base, and establish an association relationship between the motion entity and the second drug entity.
[0427] Figure 8 A block diagram of an information query device 1300 is shown. For example, the device 1300 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0428] Reference Figure 8 Device 1300 may include one or more of the following components: a processing component 1302 , a memory 1304 , a power component 1306 , a multimedia component 1308 , an audio component 1310 , an input / output (I / O) interface 1313 , a sensor component 1314 , and a communication component 1316 .
[0429] The processing component 1302 generally controls the overall operation of the device 1300, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 1302 may include one or more processors 1320 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 1302 may include one or more modules to facilitate the interaction between the processing component 1302 and other components. For example, the processing component 1302 may include a multimedia module to facilitate the interaction between the multimedia component 1308 and the processing component 1302.
[0430] The memory 1304 is configured to store various types of data to support operations on the device 1300. Examples of such data include instructions for any application or method operating on the device 1300, contact data, phone book data, messages, pictures, videos, etc. The memory 1304 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0431] The power supply component 1306 provides power to the various components of the device 1300. The power supply component 1306 can include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 1300.
[0432] The multimedia component 1308 includes a screen that provides an output interface between the device 1300 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1308 includes a front camera and / or a rear camera. When the device 1300 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0433] The audio component 1310 is configured to output and / or input audio signals. For example, the audio component 1310 includes a microphone (MIC), and when the device 1300 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 1304 or sent via the communication component 1316. In some embodiments, the audio component 1310 also includes a speaker for outputting audio signals.
[0434] The I / O interface provides an interface between the processing component 1302 and the peripheral interface module, which may be a keyboard, a click wheel, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0435] The sensor assembly 1314 includes one or more sensors for providing various aspects of status assessment for the device 1300. For example, the sensor assembly 1314 can detect the open / closed state of the device 1300, the relative positioning of components, such as the display and keypad of the device 1300, the sensor assembly 1314 can also detect the position change of the device 1300 or a component of the device 1300, the presence or absence of user contact with the device 1300, the orientation or acceleration / deceleration of the device 1300, and the temperature change of the device 1300. The sensor assembly 1314 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 1314 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1314 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0436] The communication component 1316 is configured to facilitate wired or wireless communication between the device 1300 and other devices. The device 1300 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 1316 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1316 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0437] In an exemplary embodiment, the device 1300 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the following methods:
[0438] Get the query request for drug information sent by the client;
[0439] Identify at least one of a drug entity or a non-drug domain entity from the query request;
[0440] Determining the query intent according to the query request;
[0441] According to the query intent and at least one of the obtained drug entity or non-drug domain entity, query the query knowledge base to obtain the query result; the query knowledge base is constructed according to the method for constructing a knowledge base described in any of the above embodiments;
[0442] The query result is sent to the client.
[0443] In a possible implementation, before querying the query knowledge base according to the query intent and at least one of the obtained drug entity or non-drug domain entity to obtain the query result, the method further includes:
[0444] Get user portrait information;
[0445] The corresponding non-drug field entity is obtained according to the user character portrait information.
[0446] In a possible implementation, querying a query knowledge base according to the query intent and at least one of the obtained drug entity or non-drug domain entity to obtain a query result includes:
[0447] When querying the query knowledge base according to the drug entity, determining the drug information field to be queried corresponding to the drug entity according to the query intention;
[0448] Based on the drug knowledge base included in the query knowledge base, the drug information corresponding to the drug information field to be queried is obtained to obtain a query result.
[0449] In a possible implementation, the method further includes:
[0450] Based on the association relationship between the drug entity in the drug knowledge base included in the query knowledge base and the non-drug domain entity in the related knowledge base, acquiring the non-drug domain entity associated with the drug entity according to the query intent;
[0451] Based on the related knowledge bases included in the query knowledge base, entity information corresponding to the non-drug domain entity associated with the drug entity is obtained and added to the query result.
[0452] In a possible implementation, querying a query knowledge base according to the query intent and at least one of the obtained drug entity or non-drug domain entity to obtain a query result includes:
[0453] When querying the query knowledge base according to the non-drug domain entity, based on the association relationship between the drug entity in the drug knowledge base included in the query knowledge base and the non-drug domain entity in the relevant knowledge base, obtaining the drug entity associated with the non-drug domain entity;
[0454] Determine the drug information field to be queried corresponding to the drug entity according to the query intention;
[0455] Based on the drug knowledge base included in the query knowledge base, the drug information corresponding to the drug information field to be queried is obtained to obtain a query result.
[0456] In a possible implementation, the method further includes:
[0457] Based on the related knowledge bases included in the query knowledge base, entity information corresponding to the non-drug field entity is obtained and added to the query result.
[0458] Fig. 914 is a schematic diagram of the structure of the server in an embodiment of the present invention. The server 1400 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 1422 (for example, one or more processors) and memory 1432, and one or more storage media 1430 (for example, one or more mass storage devices) storing application programs 1442 or data 1444. Among them, the memory 1432 and the storage medium 1430 can be short-term storage or permanent storage. The program stored in the storage medium 1430 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processing unit 1422 can be configured to communicate with the storage medium 1430, and execute a series of instruction operations in the storage medium 1430 on the server 1400 for executing the above-mentioned method for building a knowledge base or information query method.
[0459] The server 1400 may also include one or more power supplies 1426, one or more wired or wireless network interfaces 1450, one or more input and output interfaces 1456, one or more keyboards 1456, and / or, one or more operating systems 1441, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0460] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. For the system or device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0461] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0462] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0463] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0464] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for constructing a knowledge base, characterized in that: The method comprises: Obtaining a drug entity record, wherein the drug entity record includes a drug entity and drug entity information of the drug entity, wherein the drug entity information includes at least one drug information field and drug information corresponding to the drug information field, wherein the drug information field is used to represent a type corresponding to the drug information, and the drug information is specific content corresponding to the drug information field corresponding to the drug information; Based on the drug entity, the drug entity record corresponding to the drug entity, and the association between the two, a drug knowledge base is established, which includes: determining the association between the drug entities according to the drug information corresponding to the contraindication information field and / or the precaution field in the drug entity information, and the drug information corresponding to the drug ingredient type field; adding the drug entity record to the drug knowledge base, and associating the drug entities with the association relationship with respect to the drug entities corresponding to each drug entity record in the drug knowledge base; Perform entity recognition on the historical query records of drug information to obtain non-drug domain entities included in the historical query records of drug information and the types to which the entities belong; Determine a related knowledge base associated with the drug knowledge base according to the type of the entity, wherein the related knowledge base includes non-drug domain entities associated with the drug entity, and the related knowledge base includes a symptom knowledge base, a population knowledge base, a food knowledge base, and a sports knowledge base; According to the drug entity information of the drug entity, establishing an association relationship between the drug entity and the symptom entity in the symptom knowledge base, the population entity in the population knowledge base, the food entity in the food knowledge base, and the exercise entity in the exercise knowledge base; Generate a query knowledge base for drug information based on the association relationship between the drug entity and the symptom entity in the symptom knowledge base, the crowd entity in the crowd knowledge base, the food entity in the food knowledge base, and the exercise entity in the exercise knowledge base; The second drug entity is any one of the drug entities, and the manner of constructing the association relationship between the symptom entity and the second drug entity includes: Reading information corresponding to the indication field in the drug entity information of the second drug entity to obtain the indication of the second drug entity; Acquire a symptom entity corresponding to the indication of the second drug entity in the symptom knowledge base, and establish an association relationship between the symptom entity and the second drug entity; The method of constructing the association relationship between the population entity and the second drug entity includes: Reading information corresponding to the contraindication information field and / or the precautions field in the drug entity information of the second drug entity to obtain the contraindication information and / or precautions of the second drug entity; Identifying information related to applicable populations from the contraindication information and / or precaution information of the second drug entity; Obtaining a population entity corresponding to the information related to the applicable population in the population knowledge base, and establishing an association relationship between the population entity and the second drug entity; The method of establishing the association relationship between the food entity and the second drug entity includes: Reading information corresponding to the contraindication information field and / or the precautions field in the drug entity information of the second drug entity to obtain the contraindication information and / or precautions of the second drug entity; Identifying information related to the food material from the contraindication information and / or precaution information of the second drug entity; Acquire the food entity corresponding to the information related to the food in the food knowledge base, and establish an association relationship between the food entity and the second drug entity; The method of establishing the association relationship between the motion entity and the second drug entity includes: Reading information corresponding to the contraindication information field and / or the precautions field in the drug entity information of the second drug entity to obtain the contraindication information and / or precautions of the second drug entity; identifying sports-related information from the contraindication information and / or precaution information of the second drug entity; Obtain a motion entity corresponding to the information related to the motion in the motion knowledge base, and establish an association relationship between the motion entity and the second drug entity.
2. The method according to claim 1, characterized in that The determining the association relationship between the drug entities according to the drug information corresponding to the contraindication information field and / or the precaution field in the drug entity information, and the drug information corresponding to the drug ingredient type field, includes: Reading a contraindication information field and / or a precaution field in the drug entity information of a first drug entity to obtain the contraindication information and / or precautions of the first drug entity; the first drug entity is any one of the drug entities; Identifying information related to drug ingredients and association relationships from the contraindication information and / or precaution information of the first drug entity, determining the identified information related to drug ingredients as a target drug ingredient type, and determining the identified information related to the association relationship as a target association relationship type; Obtain a drug entity in the drug knowledge base whose drug ingredient type belongs to the target drug ingredient type, establish an association relationship between it and the first drug entity, and set the association relationship type to the target association relationship type.
3. An information query method, characterized in that: The method comprises: Get the query request for drug information sent by the client; Identify at least one of a drug entity or a non-drug domain entity from the query request; Determining the query intent according to the query request; According to the query intent and at least one of the obtained drug entity or non-drug domain entity, query the query knowledge base to obtain the query result; the query knowledge base is constructed by the method for constructing a knowledge base according to claim 1 or 2; The query result is sent to the client.
4. The method according to claim 3, characterized in that: Before querying the query knowledge base according to the query intent and at least one of the obtained drug entity or non-drug domain entity to obtain the query result, the method further includes: Get user portrait information; The corresponding non-drug field entity is obtained according to the user character portrait information.
5. The method according to claim 3 or 4, characterized in that: The querying of the query knowledge base according to the query intent and at least one of the obtained drug entity or non-drug domain entity to obtain the query result includes: When querying the query knowledge base according to the drug entity, determining the drug information field to be queried corresponding to the drug entity according to the query intention; Based on the drug knowledge base included in the query knowledge base, the drug information corresponding to the drug information field to be queried is obtained to obtain a query result.
6. The method according to claim 5, characterized in that The method further comprises: Based on the association relationship between the drug entity in the drug knowledge base included in the query knowledge base and the non-drug domain entity in the related knowledge base, acquiring the non-drug domain entity associated with the drug entity according to the query intent; Based on the related knowledge bases included in the query knowledge base, entity information corresponding to the non-drug domain entity associated with the drug entity is obtained and added to the query result.
7. The method according to claim 3 or 4, characterized in that: The querying of the query knowledge base according to the query intent and at least one of the obtained drug entity or non-drug domain entity to obtain the query result includes: When querying the query knowledge base according to the non-drug domain entity, based on the association relationship between the drug entity in the drug knowledge base included in the query knowledge base and the non-drug domain entity in the relevant knowledge base, obtaining the drug entity associated with the non-drug domain entity; Determine the drug information field to be queried corresponding to the drug entity according to the query intention; Based on the drug knowledge base included in the query knowledge base, the drug information corresponding to the drug information field to be queried is obtained to obtain a query result.
8. The method according to claim 7, characterized in that The method further comprises: Based on the related knowledge bases included in the query knowledge base, entity information corresponding to the non-drug field entity is obtained and added to the query result.
9. A device for constructing a knowledge base, characterized in that: The device comprises: A first acquisition unit is used to acquire a drug entity record, wherein the drug entity record includes a drug entity and drug entity information of the drug entity, wherein the drug entity information includes at least one drug information field and drug information corresponding to the drug information field, wherein the drug information field is used to represent a type corresponding to the drug information, and the drug information is specific content corresponding to the drug information field corresponding to the drug information; A first establishing unit is used to establish a drug knowledge base based on the drug entity, the drug entity record corresponding to the drug entity, and the association relationship between the two; A first determination unit is used to perform entity recognition on the drug information history query record to obtain the non-drug field entity and the type of entity included in the drug information history query record; determine the relevant knowledge base associated with the drug knowledge base according to the type of the entity, the relevant knowledge base includes the non-drug field entity associated with the drug entity, and the relevant knowledge base includes a symptom knowledge base, a population knowledge base, a food knowledge base, and a sports knowledge base; A second establishing unit is used to establish, according to the drug entity information of the drug entity, an association relationship between the drug entity and a symptom entity in the symptom knowledge base, a population entity in the population knowledge base, an ingredient entity in the ingredient knowledge base, and a movement entity in the movement knowledge base; A generating unit, configured to generate a query knowledge base for drug information based on the association relationship between the drug entity and the symptom entity in the symptom knowledge base, the crowd entity in the crowd knowledge base, the food entity in the food knowledge base, and the exercise entity in the exercise knowledge base; The second drug entity is any one of the drug entities, and the manner of constructing the association relationship between the symptom entity and the second drug entity includes: Reading information corresponding to the indication field in the drug entity information of the second drug entity to obtain the indication of the second drug entity; Acquire a symptom entity corresponding to the indication of the second drug entity in the symptom knowledge base, and establish an association relationship between the symptom entity and the second drug entity; The method of constructing the association relationship between the population entity and the second drug entity includes: Reading information corresponding to the contraindication information field and / or the precautions field in the drug entity information of the second drug entity to obtain the contraindication information and / or precautions of the second drug entity; Identifying information related to applicable populations from the contraindication information and / or precaution information of the second drug entity; Obtaining a population entity corresponding to the information related to the applicable population in the population knowledge base, and establishing an association relationship between the population entity and the second drug entity; The method of establishing the association relationship between the food entity and the second drug entity includes: Reading information corresponding to the contraindication information field and / or the precautions field in the drug entity information of the second drug entity to obtain the contraindication information and / or precautions of the second drug entity; Identifying information related to the food material from the contraindication information and / or precaution information of the second drug entity; Acquire the food entity corresponding to the information related to the food in the food knowledge base, and establish an association relationship between the food entity and the second drug entity; The method of establishing the association relationship between the motion entity and the second drug entity includes: Reading information corresponding to the contraindication information field and / or the precautions field in the drug entity information of the second drug entity to obtain the contraindication information and / or precautions of the second drug entity; identifying sports-related information from the contraindication information and / or precaution information of the second drug entity; Acquire a motion entity corresponding to the information related to the motion in the motion knowledge base, and establish an association relationship between the motion entity and the second drug entity; Wherein, the first establishing unit includes: A first determining subunit is used to determine the association relationship between the drug entities according to the drug information corresponding to the contraindication information field and / or the precaution field in the drug entity information, and the drug information corresponding to the drug ingredient type field; The associating subunit is used to add the drug entity record to the drug knowledge base, and to associate the drug entities with associated relationships with respect to the drug entities corresponding to each drug entity record in the drug knowledge base.
10. The device according to claim 9, characterized in that The first determining subunit includes: A first reading subunit is used to read the contraindication information field and / or the precaution field in the drug entity information of the first drug entity to obtain the contraindication information and / or precautions of the first drug entity; the first drug entity is any one of the drug entities; a second determination subunit, configured to identify information related to drug ingredients and association relationships from the contraindication information and / or precaution information of the first drug entity, determine the identified information related to drug ingredients as a target drug ingredient type, and determine the identified information related to the association relationship as a target association relationship type; A construction subunit is used to obtain a drug entity in the drug knowledge base whose drug ingredient type belongs to the target drug ingredient type, construct an association relationship between it and the first drug entity, and set the association relationship type to the target association relationship type.
11. An information query device, characterized in that: The device comprises: A second acquisition unit, used to acquire a query request for drug information sent by a client; An identification unit, configured to identify at least one of a drug entity or a non-drug domain entity from the query request; A second determining unit, configured to determine a query intent according to the query request; A query unit, used to query the query knowledge base according to the query intention and at least one of the obtained drug entity or non-drug field entity to obtain a query result; the query knowledge base is constructed by the device for constructing a knowledge base according to claim 1 or 2; A sending unit is used to send the query result to the client.
12. The device according to claim 11, characterized in that The device also includes: A third acquisition unit is used to acquire user character portrait information; The fourth acquisition unit is used to obtain the corresponding non-drug field entity according to the user character portrait information.
13. The device according to claim 11 or 12, characterized in that The query unit comprises: A third determination subunit is used to determine the drug information field to be queried corresponding to the drug entity according to the query intention when querying the query knowledge base according to the drug entity; The first acquisition subunit is used to acquire the drug information corresponding to the drug information field to be queried based on the drug knowledge base included in the query knowledge base, and obtain the query result.
14. The device according to claim 13, characterized in that The device also includes: A second acquisition subunit is used to acquire non-drug domain entities associated with the drug entity according to the query intention based on the association relationship between the drug entity in the drug knowledge base included in the query knowledge base and the non-drug domain entities in the relevant knowledge base; The third acquisition subunit is used to acquire entity information corresponding to the non-drug field entity associated with the drug entity based on the related knowledge base included in the query knowledge base, and add it into the query result.
15. The device according to claim 11 or 12, characterized in that The query unit comprises: A fourth acquisition subunit is used for, when querying the query knowledge base according to the non-drug field entity, acquiring the drug entity associated with the non-drug field entity based on the association relationship between the drug entity in the drug knowledge base included in the query knowledge base and the non-drug field entity in the relevant knowledge base; A fourth determination subunit, configured to determine the drug information field to be queried corresponding to the drug entity according to the query intention; The fifth acquisition subunit is used to acquire the drug information corresponding to the drug information field to be queried based on the drug knowledge base included in the query knowledge base, and obtain the query result.
16. The device according to claim 15, characterized in that The device also includes: The sixth acquisition subunit is used to acquire entity information corresponding to the non-drug field entity based on the related knowledge base included in the query knowledge base, and add it into the query result.
17. A device for building a knowledge base, characterized in that: The device comprises a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors. The one or more programs include the method for constructing a knowledge base as claimed in claim 1 or 2.
18. A device for information query, characterized in that: It comprises a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors to perform the information query method as described in any one of claims 3-8.
19. A computer-readable medium having instructions stored thereon, which, when executed by one or more processors, causes the device to execute the method for constructing a knowledge base as described in claim 1 or 2, or execute the information query method as described in any one of claims 3-8.
Citation Information
Patent Citations
Medicine recommendation method and equipment
CN110289068A
Drug knowledge graph construction method and system
CN111221979A