A sorting method and device, electronic equipment and storage medium
By constructing an inverted index library and a sorting algorithm, relevant prescriptions are recalled based on patient diagnostic information, solving the problem of low accuracy in drug recommendation in existing technologies and achieving more efficient drug recommendation.
Patent Information
- Application Number
- CN202210816315.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-12
- Publication Date
- 2026-02-17
- Estimated Expiration
- 2042-07-12
AI Technical Summary
In existing technologies, doctors are unable to effectively retrieve recommended medications from prescription databases, resulting in low accuracy in medication recommendations.
By constructing an inverted index library, relevant prescriptions can be queried based on patients' diagnostic information, and recall prescriptions can be sorted using relevance scores and similarity scores, thereby improving the accuracy of drug recommendations.
This improved the accuracy of drug recommendation ranking, ensured that recalled prescriptions were highly relevant to patient diagnostic information, and enhanced the accuracy of drug recommendations.
Smart Images

Figure CN115374192B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a sorting method, apparatus, electronic device, and computer-readable storage medium. Background Technology
[0002] With the development of internet technology, search engines have become increasingly powerful. Retrieval is an important part of the search process, which involves retrieving information related to the search content from massive amounts of data based on the user's input.
[0003] In related technologies, after a doctor diagnoses a patient, they need to prescribe medication based on their experience. Without information from other doctors' prescriptions as an aid, it is impossible to retrieve the recommended medication from the prescription database to the patient, thus reducing the accuracy of medication recommendations.
[0004] Therefore, how to recall recommended medications in prescriptions to improve the accuracy of medication recommendations is a technical problem that needs to be solved. Summary of the Invention
[0005] This invention provides a sorting method, apparatus, electronic device, and computer-readable storage medium to at least solve the problem in related technologies where the inability to retrieve recommended medications from prescriptions for patient users from a prescription database leads to low sorting efficiency and reduced accuracy of medication recommendations. The technical solution of this invention is as follows:
[0006] According to a first aspect of the present invention, a sorting method is provided, comprising:
[0007] In response to user information entered on the prescription form interface, obtain the user's diagnostic information on the prescription form interface;
[0008] Identify multiple prescriptions associated with the diagnostic information;
[0009] The multiple prescriptions are processed separately to obtain prescriptions with the same content after processing, and the prescriptions with the same content are used as recall prescriptions;
[0010] Determine the relevance score or similarity score of the recalled prescriptions;
[0011] The recalled prescriptions were sorted according to their relevance or similarity scores.
[0012] Returns the sorted results.
[0013] Optionally, determining the multiple prescriptions associated with the diagnostic information includes:
[0014] Based on the diagnostic information, a pre-built inverted index is queried to obtain multiple prescriptions associated with the diagnostic information. The inverted index is constructed based on key fields in multiple sample prescription data.
[0015] Optionally, an inverted index can be pre-built by following these steps:
[0016] Obtain elements of key fields from the data of multiple sample prescriptions. The key fields include at least: age field, diagnosis field, and drug indication field, wherein the age field, diagnosis field, and drug indication field are all arrays.
[0017] Construct a first diagnostic inverted index A1 using each element in the diagnostic array; or construct a second diagnostic inverted index A2 using each word of each element in the diagnostic array; and
[0018] Identify all indications for each drug on each sample prescription;
[0019] Extract the same indications for the drug;
[0020] A first inverted index B1 is constructed for each identical extracted indication, and a second inverted index B2 is constructed for each word in each indication; wherein, the indications mainly include diseases or symptoms;
[0021] An inverted age index is constructed from the ages in multiple sample prescriptions according to key-value pairs, where the key is age and the value is an array, and each element of the array corresponds to a prescription.
[0022] Optionally, the step of processing the multiple prescriptions separately to obtain prescriptions containing the same content after processing, and using the prescriptions with the same content as recall prescriptions, includes:
[0023] The diagnostic field of each of the plurality of prescriptions is divided into an array;
[0024] Each element in each of the split arrays is used as a diagnostic;
[0025] The multiple descriptions of each diagnosis are normalized into a standard diagnostic description;
[0026] The first inverted index is searched using each standard diagnostic description or each description of each diagnosis, or the second inverted index is searched using each word appearing in each standard diagnostic description or each word appearing in each description of each diagnosis. The first prescription is obtained by taking the union of the results of each search.
[0027] If the number of first prescriptions found is less than a preset threshold, then the first indication inverted index library is searched using each standard diagnostic description or each description of each diagnosis, or the second indication inverted index library is searched using each word appearing in each standard diagnostic description or each word appearing in each description of each diagnosis.
[0028] The second prescription is obtained by taking the union of the results found each time with the first prescription, and the second prescription is used as the recall prescription.
[0029] Optionally, the step of processing the multiple prescriptions separately to obtain prescriptions containing the same content after processing, and using the prescriptions with the same content as recall prescriptions, further includes:
[0030] If the number of first prescriptions found is higher than a preset threshold or the number of second prescriptions found is higher than a preset threshold, then the user's age group is searched using an inverted age index to obtain the third prescription found.
[0031] Based on the first prescription or the second prescription, a prescription with the same content as the third prescription is determined, and the prescription with the same content is used as the recall prescription.
[0032] Optionally, the step of processing the multiple prescriptions separately to obtain prescriptions containing the same content after processing, and using the prescriptions with the same content as recall prescriptions, further includes:
[0033] If the number of prescriptions found is lower than the preset threshold, then the diagnosis for which the number of prescriptions found is lower than the preset threshold is obtained, and the user's diagnosis is added to the drug indication field corresponding to the diagnosis to supplement the knowledge graph.
[0034] Optionally, determining the relevance score of the recalled prescription includes:
[0035] Based on the user's diagnostic information in the recalled prescription, a preset prescription diagnostic score database is searched to obtain the TF / IDF value or BM25 value corresponding to the diagnostic information. The TF / IDF value or BM25 value is used as the relevance score between the user's diagnosis and the prescription. When there are multiple diagnoses, the relevance scores of multiple diagnoses are accumulated.
[0036] Optionally, a prescription diagnostic score database can be pre-built by following these steps:
[0037] Obtain multiple sample prescriptions, wherein the multiple sample prescriptions include at least the sample prescriptions for constructing an inverted index library;
[0038] Determine the TF / IDF value or BM25 value for the diagnosis of each prescription in the plurality of sample prescriptions;
[0039] The TF / IDF value or BM25 value of each prescription diagnosis is used as the correlation score between each diagnosis and the corresponding prescription in the prescription diagnosis score database.
[0040] Optionally, determining the similarity score of the recalled prescriptions includes:
[0041] Based on the user's diagnosis in the recall prescription, a preset diagnosis similarity dictionary is searched to obtain the similarity score corresponding to the similar diagnosis.
[0042] Optionally, a diagnostic similarity dictionary can be pre-built following these steps:
[0043] Acquire medical text data;
[0044] A word vector matrix was trained using a deep learning model based on the aforementioned medical text data.
[0045] Enumerate all diagnostic samples and find the corresponding word vector for each character in the diagnostic sample from the word vector matrix;
[0046] The word vectors of each found character are summed to obtain the word vector of the diagnosis.
[0047] Calculate the similarity score between all pairs of diagnoses based on word vectors;
[0048] Identify all diagnoses whose similarity scores are greater than a similarity threshold;
[0049] For all diagnoses with similarity scores greater than the similarity threshold, construct a diagnostic similarity dictionary with their corresponding similarity scores.
[0050] Optionally, sorting the recalled prescriptions according to relevance score or similarity score includes:
[0051] The recalled prescriptions are sorted according to the relevance scores; or
[0052] Based on similar diagnoses, the inverted index of the first diagnosis is searched one by one to obtain the corresponding prescription, and the obtained prescriptions are sorted according to the similarity score.
[0053] According to a second aspect of the present invention, a sorting apparatus is provided, comprising:
[0054] The first acquisition module is used to acquire the user's diagnostic information on the prescription form interface in response to the user information entered on the prescription form interface.
[0055] A first determining module is used to determine multiple prescriptions associated with the diagnostic information;
[0056] The processing module is used to process the multiple prescriptions separately to obtain prescriptions with the same content after processing, and to use the prescriptions with the same content as recall prescriptions.
[0057] The second determining module is used to determine the relevance score or similarity score of the recalled prescription;
[0058] The sorting module is used to sort the recalled prescriptions according to relevance score or similarity score;
[0059] The return module is used to return the sorting result of the sorting module.
[0060] Optionally, the second determining module is specifically used to query a pre-established inverted index library based on the diagnostic information to obtain multiple prescriptions associated with the diagnostic information, wherein the inverted index library is an inverted index library constructed based on key fields in multiple sample prescription data.
[0061] Optionally, the method further includes: a first building module, configured to pre-build an inverted index library according to the following steps:
[0062] The element acquisition module is used to acquire elements of key fields in the data of multiple sample prescriptions. The key fields include at least: age field, diagnosis field, and drug indication field, wherein the age field, diagnosis field, and drug indication field are all arrays.
[0063] A first construction module is configured to construct a first diagnostic inverted index using each element in the diagnostic array; or to construct a second diagnostic inverted index using each word of each element in the diagnostic array; and
[0064] The indication determination module is used to determine all indications for each drug on each sample prescription;
[0065] An extraction module is used to extract the same indications for the drug;
[0066] The second construction module is used to construct a first inverted index for each extracted identical indication and a second inverted index for each word in each indication; wherein, the indications mainly include diseases or symptoms;
[0067] The third construction module is used to construct an inverted age index based on key-value pairs from the ages in multiple sample prescriptions, where the key is age and the value is an array, and each element of the array corresponds to a prescription.
[0068] Optionally, the processing module includes:
[0069] A segmentation module is used to segment the diagnostic field of each of the plurality of prescriptions into an array;
[0070] The diagnostic determination module is used to treat each element in each of the split arrays as a diagnosis.
[0071] The normalization module is used to normalize the multiple descriptions of each diagnosis into a standard diagnostic description;
[0072] The first search module is used to search the first inverted index library by using each standard diagnostic description or each description of each diagnosis, or to search the second inverted index library by using each word that appears in each standard diagnostic description or each word that appears in each description of each diagnosis. The first prescription is obtained by taking the union of the results of each search.
[0073] The second search module is used to search the inverted index library of the first indication by using each standard diagnostic description or each description of each diagnosis when the number of first prescriptions found by the first search module is less than a preset threshold, or to search the inverted index library of the second indication by using each word that appears in each standard diagnostic description or each word that appears in each description of each diagnosis.
[0074] The first recall prescription determination module is used to obtain the second prescription by taking the union of the results found by the second search module and the first prescription, and the second prescription is used as the recall prescription.
[0075] Optionally, the processing module further includes:
[0076] The third search module is used to search the age inverted index according to the user's age group to obtain the third search prescription when the number of the first prescriptions found by the first search module is higher than a preset threshold or the number of the second prescriptions is higher than a preset threshold.
[0077] The second recall prescription determination module is used to determine, based on the first prescription or the second prescription, a prescription with the same content as the third prescription, and to use the prescription with the same content as the recall prescription.
[0078] Optionally, the processing module further includes:
[0079] The second acquisition module is used to acquire a diagnosis that the number of prescriptions found by the first search module is lower than the preset threshold when the number of prescriptions found is lower than the preset threshold.
[0080] An add module is used to add the user's diagnosis obtained by the second acquisition module to the drug indication field corresponding to the diagnosis, so as to supplement the knowledge graph.
[0081] Optionally, the second determining module includes:
[0082] The third search module is used to search a preset prescription diagnosis score database based on the user's diagnosis information in the recalled prescription, and obtain the TF / IDF value or BM25 value corresponding to the diagnosis information.
[0083] The relevance score determination module is used to use the TF / IDF value or BM25 value found by the third search module as the relevance score of the user's diagnosis and prescription. When there are multiple diagnoses, the scores of multiple diagnoses are accumulated.
[0084] Optionally, a second establishment module is also included for pre-establishing a prescription diagnostic score database according to the following steps:
[0085] A sample prescription acquisition module is used to acquire multiple sample prescriptions, wherein the multiple sample prescriptions include at least the sample prescriptions for constructing an inverted index library;
[0086] The sample diagnostic value determination module is used to determine the TF / IDF value or BM25 value of each prescription diagnosis in the plurality of sample prescriptions;
[0087] The correlation score determination module is used to use the determined TF / IDF value or BM25 value of each prescription diagnosis as the correlation score between each diagnosis and the corresponding prescription in the prescription diagnosis score database.
[0088] Optionally, the second determining module is specifically used to search a preset diagnostic similarity dictionary based on the user's diagnosis in the recalled prescription, and obtain the similarity score corresponding to the similar diagnosis.
[0089] Optionally, a third building module is also included, for pre-building a diagnostic similarity dictionary according to the following steps:
[0090] The text acquisition module is used to acquire medical text data;
[0091] The training module is used to train a word vector matrix based on the medical text data using a deep learning model;
[0092] The enumeration module is used to enumerate all diagnostic samples;
[0093] The vector lookup module is used to find the corresponding word vector for each character in the enumerated diagnostic samples from the word vector matrix;
[0094] The vector accumulation module is used to accumulate the word vectors of each found character to obtain the word vector of the diagnosis;
[0095] The similarity calculation module is used to calculate the pairwise similarity scores between all diagnoses based on word vectors;
[0096] A diagnosis determination module is used to determine all diagnoses whose similarity scores are greater than a similarity threshold.
[0097] The fourth construction module is used to construct a diagnostic similarity dictionary by combining all diagnoses with similarity scores greater than the similarity threshold with their corresponding similarity scores.
[0098] Optionally, the sorting module includes:
[0099] A first sorting module is used to sort the recalled prescriptions according to the relevance score; and / or
[0100] The second sorting module is used to search the inverted index of the first diagnosis one by one based on similar diagnoses, obtain the corresponding prescriptions, and sort the obtained prescriptions according to the similarity score.
[0101] Optionally, an electronic device is also provided, comprising:
[0102] processor;
[0103] Memory used to store the processor's executable instructions;
[0104] The processor is configured to execute the instructions to implement the sorting method described above.
[0105] Optionally, a computer-readable storage medium is also provided, which, when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, enables the electronic device to perform the sorting method as described above.
[0106] Optionally, a computer program product is also provided, including a computer program or instructions that, when executed by a processor, implement the sorting method as described above.
[0107] The technical solutions provided by the embodiments of the present invention bring at least the following beneficial effects:
[0108] In this embodiment of the invention, in response to user information input on the prescription form interface, the diagnostic information of the user on the prescription form interface is obtained; multiple prescriptions associated with the diagnostic information are identified; the multiple prescriptions are processed to obtain prescriptions containing the same content after processing, and these prescriptions with the same content are used as recall prescriptions; the relevance score or similarity score of the recalled prescriptions is determined; the recalled prescriptions are sorted according to the relevance score or similarity score; and the sorting result is returned. In other words, in this embodiment of the invention, based on the patient's diagnostic information, multiple prescriptions with a high degree of relevance to the diagnostic information can be found, and these prescriptions can be processed to obtain prescriptions with the same content, which are then used as recall prescriptions. The recalled prescriptions are then sorted according to their relevance score or similarity score, and the sorting result is returned, thereby improving the accuracy of the sorting.
[0109] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit the invention. Attached Figure Description
[0110] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention, but do not constitute an undue limitation of the invention.
[0111] Figure 1 This is a flowchart of a sorting method provided in an embodiment of the present invention.
[0112] Figure 2 This is a schematic diagram illustrating an application example of a prescription form provided in an embodiment of the present invention.
[0113] Figure 3 This is an application diagram illustrating the display of recommended medications on a prescription, provided by an embodiment of the present invention.
[0114] Figure 4 This is a block diagram of a sorting device provided in an embodiment of the present invention.
[0115] Figure 5 This is a block diagram of the first establishment module provided in an embodiment of the present invention.
[0116] Figure 6 This is a block diagram of the processing module provided in an embodiment of the present invention.
[0117] Figure 7 This is a block diagram of the second determining module provided in an embodiment of the present invention.
[0118] Figure 8 This is a block diagram of an electronic device provided in an embodiment of the present invention.
[0119] Figure 9This is a block diagram of a device for prescription recommendation provided in an embodiment of the present invention. Detailed Implementation
[0120] To enable those skilled in the art to better understand the technical solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings.
[0121] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this invention. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the invention as detailed in the appended claims.
[0122] In recent years, significant progress has been made in research on technologies based on artificial intelligence, such as computer vision, deep learning, machine learning, image processing, and image recognition. Artificial intelligence (AI) is an emerging science and technology that studies and develops theories, methods, technologies, and application systems to simulate and extend human intelligence. AI is a comprehensive discipline involving numerous technologies, including chips, big data, cloud computing, the Internet of Things, distributed storage, deep learning, machine learning, and neural networks. Computer vision, as an important branch of AI, specifically enables machines to recognize the world. Computer vision technologies typically include face recognition, liveness detection, fingerprint recognition and anti-counterfeiting verification, biometric recognition, face detection, pedestrian detection, object detection, image processing, image recognition, image semantic understanding, image retrieval, text recognition, video processing, video content recognition, behavior recognition, 3D reconstruction, virtual reality, augmented reality, simultaneous localization and mapping (SLAM), computational photography, and robot navigation and localization. With the research and advancement of artificial intelligence technology, this technology has been applied in numerous fields, such as security, urban management, traffic management, building management, park management, facial recognition access control, facial recognition attendance, logistics management, warehouse management, robotics, intelligent marketing, computational photography, mobile imaging, cloud services, smart homes, wearable devices, autonomous driving, autonomous driving, smart healthcare, facial payment, facial unlocking, fingerprint unlocking, identity verification, smart screens, smart TVs, cameras, mobile internet, live streaming, beautification, makeup, medical aesthetics, and intelligent temperature measurement.
[0123] Recommendation systems are generally divided into two stages: recall and fine ranking. Recall involves retrieving recommendable content from the database, which can be seen as a coarse ranking. There are various recall methods. This invention applies recall technology to the scenario of prescription recommendation.
[0124] The recall results can be directly fed back to the prescription form interface for doctors' reference, or used as input for the fine sorting module to perform precise re-sorting. This embodiment of the invention involves the prescription recall stage.
[0125] Figure 1 This is a flowchart of a sorting method provided in an embodiment of the present invention, such as... Figure 1 As shown, the sorting method includes the following steps:
[0126] Step 101: In response to the user information entered on the prescription form interface, obtain the user's diagnosis information on the prescription form interface.
[0127] Step 102: Identify multiple prescriptions associated with the diagnostic information.
[0128] Step 103: Process the multiple prescriptions separately to obtain prescriptions with the same content after processing, and use the prescriptions with the same content as recall prescriptions.
[0129] Step 104: Determine the relevance score or similarity score of the recalled prescription.
[0130] Step 105: Sort the recalled prescriptions according to their relevance score or similarity score.
[0131] Step 106: Return the sorting results.
[0132] The sorting method described in this invention can be applied to terminals, servers, etc., without limitation. The terminal implementation device can be an electronic device such as a smartphone, laptop, or tablet computer, without limitation.
[0133] The following is combined with Figure 1 The specific implementation steps of a sorting method provided in the embodiments of the present invention will be described in detail.
[0134] In step 101, in response to the user information entered on the prescription form interface, the diagnostic information of the user on the prescription form interface is obtained.
[0135] In this step, after the doctor examines the patient, they need to issue a prescription through a terminal (such as a computer). This requires inputting patient information into the prescription interface, including contraindications and drug allergies. The terminal then detects this information and retrieves the patient's diagnostic information from the prescription interface.
[0136] In this embodiment, the user's diagnostic information (i.e., patient diagnostic information) can be a diagnostic phrase or each word appearing in the diagnosis. It should be noted that if it is a diagnostic phrase, the inverted index constructed from the phrase needs to be retrieved subsequently; if each word appearing in the diagnosis is used to retrieve the inverted index constructed from the words, the scores are ultimately summed.
[0137] In step 102, multiple prescriptions associated with the diagnostic information are identified.
[0138] Specifically, in this step, a pre-established inverted index can be searched based on the diagnostic information to obtain multiple prescriptions associated with the diagnostic information. The inverted index is constructed based on multiple key elements of sample prescription data. The search aims to find multiple prescriptions highly similar to the patient's information. The prescriptions may include a diagnosis and a drug name, located in corresponding fields. They may also include: patient name, age, gender, department, method of administration, usage, dosage, specifications, total prescription volume, frequency of use, medical insurance card number, and cost category. This embodiment does not impose limitations.
[0139] This inverted index library may include a first diagnostic inverted index A1 constructed based on each element in the diagnostic array, and may also include a second diagnostic inverted index A2 constructed based on each word of each element in the diagnostic array, a first indication inverted index B1, a second indication inverted index B2, and so on. In practical applications, it is not limited to this.
[0140] The inverted index, originating from the practical application of finding records based on attribute values, is implemented by Lucene. Each entry in this index table includes an attribute value and the address of the record containing that attribute value. Because the attribute value determines the record's location, not the record itself, it's called an inverted index. A file with an inverted index is called an inverted index file, or simply an inverted file. An inverted index typically represents a keyword, followed by its frequency (number of occurrences), location (which article or webpage it appears in, and related information such as date and author), essentially creating an index for hundreds of billions of webpages on the internet. Whatever you're looking for can be found directly using this index, saving search time and improving efficiency by avoiding page-by-page searches.
[0141] The inverted index library can be pre-built according to the following steps: Obtain elements of key fields from the data of multiple sample prescriptions, where the key fields include at least: age, diagnosis, and drug indication, wherein the age, diagnosis, and drug indication fields are all arrays; construct a first diagnostic inverted index A1 using each element in the diagnosis array; or construct a second diagnostic inverted index A2 using each word of each element in the diagnosis array; determine all indications for each drug on each sample prescription; extract the common indications of the drugs; construct a first indication inverted index B1 and a second indication inverted index B2 according to each extracted common indication; wherein the indications mainly include diseases or symptoms; construct an age inverted index by key-value pairs from the ages in multiple sample prescriptions, where the key is age and the value is an array, and each element of the array corresponds to a prescription.
[0142] In other words, an inverted index is constructed based on prescription data obtained from the prescription database. Typically, age, diagnosis, drug name, and drug indications on a prescription each have their own inverted index. Based on this, this embodiment performs the following two special processing steps:
[0143] First, the diagnosis field is an array, requiring the construction of inverted indexes using two methods: one is to construct inverted index A1 using each element of the array, and the other is to construct inverted index A2 using each word of each element in the array. Second, a prescription may contain multiple medications, each with multiple indications. Therefore, the intersection (shared content) of the medication indications is taken. For each indication within the intersection, a corresponding inverted index B1 is constructed, along with an inverted index B2 constructed for each word within that indication. In this embodiment, indications can be diseases or symptoms, similar to the data structure of the diagnosis. The age inverted index is a dictionary structure where the key is age and the value is an array, with each element of the array representing a prescription.
[0144] The prescription database in this embodiment may include traditional Chinese medicine prescriptions, as well as prescriptions for Western medicine and proprietary Chinese medicines, and these prescriptions will be used as sample prescriptions. Prescriptions can be manually edited or obtained from hospitals or online consultations. A prescription generally includes at least the patient's name, age, gender, department, diagnosis, drug name, method of administration, usage, dosage, specifications, total prescription volume, frequency of use, medical insurance card number, and cost category. The prescription provided in this embodiment at least includes the diagnosis and drug name fields. However, to improve recommendation effectiveness, the prescription may also include at least one of the following: patient name, age, gender, department, method of administration, usage, dosage, specifications, total prescription volume, frequency of use, medical insurance card number, and cost category. The diagnosis field includes the patient's disease symptoms, which may be multiple, so it is an array structure. Each element of the data structure is a standard diagnosis name (generally a diagnosis in the ICD-10 standard), and the diagnosis is generally a disease or symptom.
[0145] In step 103, the multiple prescriptions are processed to obtain prescriptions with the same content after processing, and the prescriptions with the same content are used as recall prescriptions.
[0146] Specifically, the diagnostic field of each of the multiple prescriptions is divided into arrays; each element in each array is taken as a diagnosis; the description of each diagnosis is normalized into a standard diagnostic description; a first inverted index is searched using each standard diagnostic description or each description of each diagnosis, or a second inverted index is searched using each word appearing in each standard diagnostic description or each word appearing in each description of each diagnosis; the union of the results found each time is used to obtain the first prescription found; if the number of first prescriptions found is lower than a preset threshold, a first indication inverted index is searched using each standard diagnostic description or each description of each diagnosis, or a second indication inverted index is searched using each word appearing in each standard diagnostic description or each word appearing in each description of each diagnosis; the union of the results found each time and the first prescription is used to obtain the second prescription found, and the second prescription is used as the recall prescription.
[0147] Optionally, in another embodiment, based on the above embodiment, the step of processing the multiple prescriptions separately to obtain prescriptions with the same content after processing, and using the prescriptions with the same content as recall prescriptions, may further include: if the number of first prescriptions found is higher than a preset threshold or the number of second prescriptions is higher than a preset threshold, then searching the age inverted index according to the user's age group to obtain the third prescription found; based on the first prescription or the second prescription, determining prescriptions with the same content as the third prescription, and using the prescriptions with the same content as recall prescriptions.
[0148] Specifically, the inverted index is searched based on the user's age group. For example, if a user is 10 years old, and the age groups are divided into 0-7 years, 7-14 years, 14-20 years, 20-50 years, 50-70 years, and over 70 years, then the inverted index will retrieve prescriptions for users aged 7, 8, 9, 10, 11, 12, and 13. The age group divisions are based on a pre-designed rule.
[0149] In other words, in this embodiment, the inverted index database constructed above can be retrieved using patient diagnoses. The purpose is to retrieve prescriptions that are highly relevant to the patient's diagnostic information. To this end, this embodiment performs two steps on patient diagnoses (in this embodiment, patient diagnoses can be referred to as queries, etc.). The first step is to divide the diagnostic field into an array (each patient may have multiple diagnoses), with each element of the array being a diagnosis. The second step is to normalize each diagnosis, because for the same disease, there are multiple different descriptions of diagnoses. This embodiment needs to normalize (i.e., modify) the multiple descriptions of the same diagnosis into a standard diagnostic description. For example, multiple diagnostic descriptions such as "nasal foreign body," "nasal foreign body," and "nasal cavity foreign body" are unified into a standard diagnostic description: "nasal cavity foreign body," etc. Then, each diagnosis is used to retrieve the first diagnostic inverted index database A1 and the first indication inverted index database B1. If the number of prescriptions retrieved is higher than a preset threshold, prescriptions are retrieved again according to age. If the number of retrieved prescriptions is lower than a preset threshold, the retrieved diagnosis record is stored, and all diagnoses with a number of prescriptions lower than the preset threshold are retrieved. The user's diagnosis is then added to the drug indication field corresponding to each diagnosis to supplement the knowledge graph. Then, each character appearing in the patient's diagnosis forms a character set to retrieve the diagnosis's first inverted index A1 and the first indication inverted index B1.
[0150] Specifically, drug indication data from the drug knowledge graph is used to expand the indications of drugs in the prescription. That is, an indication field is added to each drug based on the existing prescription fields. The type of the indication field is an array, and each element of the array is the disease or symptom that the drug treats.
[0151] It should be noted that the two search methods and the search results are independent of each other.
[0152] Optionally, the process of recalling prescriptions by age continues as follows: In this embodiment, patient age is segmented, for example: 0-3 years old, 4-7 years old, 7-14 years old, 14-40 years old, 40-65 years old, and over 65 years old, etc. If a patient is 10 years old, they fall into the 7-14 age segment. Recall only prescriptions within this age segment. (Each prescription in the prescription database has an age field). Then, the intersection of age-recalled prescriptions and diagnosis-recalled prescriptions is taken (intersection means identical content).
[0153] Typically, the department information in the prescription will also be used. If the patient is a child, i.e. under 14 years old, then in addition to meeting the age condition above, an additional condition is to recall only prescriptions under the pediatric department. If the patient is an adult, then in addition to meeting the age condition above, an additional condition is to remove the recalled prescriptions under the pediatric department.
[0154] Optionally, in another embodiment, if the number of prescriptions found is lower than the preset threshold, then the diagnosis of the number of prescriptions found being lower than the preset threshold is obtained, and the user's diagnosis is added to the drug indication field corresponding to the diagnosis to supplement the knowledge graph.
[0155] In other words, in this embodiment, when the number of retrieved prescriptions is lower than the preset threshold, the diagnosis for which the number of retrieved prescriptions is lower than the preset threshold is obtained. A medical professional then supplements the drug knowledge graph based on the patient information (e.g., adding the patient's diagnosis to the corresponding drug indication field). Then, the drug indication field in the prescriptions is expanded again, and the prescriptions are retrieved again. This retrieval in this embodiment is not real-time, but rather used the next time the diagnosis is retrieved.
[0156] In step 104, the relevance score or similarity score of the recalled prescription is determined.
[0157] This step involves two methods of determination. One method is to determine the relevance score of the recalled prescriptions, specifically including:
[0158] Based on the user's diagnostic information in the recalled prescription, a preset prescription diagnostic score database is searched to obtain the TF / IDF value or BM25 value corresponding to the prescription diagnosis. The TF / IDF value or BM25 value is used as the relevance score between the user's diagnosis and the prescription. When there are multiple diagnoses, the relevance scores of multiple diagnoses are accumulated.
[0159] In other words, for recalled documents, the patient's diagnostic information is used to find the TF / IDF value or BM25 value in the prescription diagnosis score database, and this value is used as the relevance score between the patient's diagnosis and the prescription, and then sorted. When a patient has multiple diagnoses, the scores of the multiple diagnoses are summed together as the relevance score.
[0160] In this embodiment, the recalled prescriptions are scored based on their relevance, and then sorted in descending order of score. Alternatively, the sorted recalled prescriptions are returned to the fine-ranking module for fine-ranking, and fine-ranked prescriptions are recommended. The fine-ranking process performed by the fine-ranking module is well-known to those skilled in the art and will not be described in detail here.
[0161] In this embodiment, a prescription diagnosis score database can be pre-established according to the following steps: obtaining multiple sample prescriptions, the multiple sample prescriptions including at least sample prescriptions for constructing an inverted index database; determining the TF / IDF value or BM25 value of each prescription diagnosis in the multiple sample prescriptions; and using the determined TF / IDF value or BM25 value of each prescription diagnosis as the correlation score between each diagnosis and the corresponding prescription in the prescription diagnosis score database.
[0162] In this embodiment, prescription diagnosis refers to the intersection of diagnosis and / or drug indication in the diagnosis field of the prescription. The prescription diagnosis score database can use both of these parts of data at the same time, or it can use only one part of the data.
[0163] In other words, in this embodiment, when constructing the inverted index, all prescriptions are used as sample prescriptions, and the TF / IDF value or BM25 value of each prescription diagnosis is calculated. When there are multiple diagnoses, there are also multiple calculated TF / IDF values or BM25 values. Then, the TF / IDF value or BM25 value corresponding to the diagnosis is saved to the prescription diagnosis score database. The rows of the prescription diagnosis score database are all the diagnosis names, and the columns are each prescription in the prescription database. The prescription diagnosis score database stores the TF / IDF value or BM25 value of each diagnosis under that prescription.
[0164] Another approach is to determine the similarity score of the recalled prescriptions, specifically including:
[0165] Based on the user's diagnosis in the recall prescription, a preset diagnosis similarity dictionary H is searched to obtain the similarity score e corresponding to the similar diagnosis.
[0166] In other words, in this embodiment, for each diagnosis of a patient user, similar diagnoses and their corresponding similarity scores e can be found in the diagnostic similarity dictionary H. Then, the prescription is obtained by searching the inverted index A1 of the first diagnosis for each similar diagnosis.
[0167] Optionally, in another embodiment, a diagnostic similarity dictionary H can be pre-established according to the following steps: acquiring medical text data; training a word vector matrix G using a deep learning model based on the medical text data; enumerating all diagnostic samples and finding the corresponding word vector for each character in the diagnostic sample from the word vector matrix G; accumulating the word vectors of each found character to obtain the word vector of the diagnosis; calculating the similarity score between all pairs of diagnoses based on the word vectors; determining all diagnoses whose similarity score is greater than a similarity threshold; and constructing a diagnostic similarity dictionary H with all diagnoses whose similarity score is greater than the similarity threshold and their corresponding similarity scores.
[0168] In other words, firstly, a word vector matrix G is trained using medical text data and a deep learning model. Then, all possible diagnoses are enumerated, and the corresponding word vector for each character in the diagnosis is found in the word vector matrix G. The word vectors of all characters are summed to obtain the word vector of the diagnosis. Finally, the similarity between all pairs of diagnoses is calculated. The calculated similarity scores are compared with a set similarity threshold. For each diagnosis, if the calculated similarity score is greater than the similarity threshold, all diagnoses with similarity scores greater than the threshold are collected, and a diagnosis similarity dictionary H is constructed. The keys of the diagnosis similarity dictionary H are diagnoses, and the values are arrays, where each element of the array is a diagnosis and a similarity score e.
[0169] In step 105, the recalled prescriptions are sorted according to their relevance score or similarity score.
[0170] In this embodiment, the recalled prescriptions can be sorted according to the relevance score; or, based on the similar diagnoses, the inverted index A1 of the first diagnosis can be searched one by one to obtain the corresponding prescriptions, and the obtained prescriptions can be sorted according to the similarity score e. The sorting in this embodiment can be understood as a coarse sorting.
[0171] In this embodiment, the TF / IDF value or BM25 value can be used as the relevance score between the patient's diagnosis and the prescription, and the prescriptions can be sorted according to their relevance. When a patient has multiple diagnoses, the relevance scores of the multiple diagnoses are summed together. Furthermore, the sorted prescriptions can be entered into a fine sorting module for further fine sorting.
[0172] Of course, for each patient's diagnosis, we can also look up the diagnosis similarity dictionary H to obtain the similar diagnosis and the similarity score e corresponding to the similar diagnosis; then, we can use the similar diagnosis to look up the first diagnosis inverted index A1 one by one to obtain the prescription, and sort the obtained prescriptions according to the similarity score e. Furthermore, we can also put the grouped prescriptions into the fine sorting module for fine sorting.
[0173] In step 106, the sorting results are returned.
[0174] In this embodiment, the sorting results can be directly fed back to the prescription form interface for the doctor's reference; of course, the sorting results can also be input into the fine sorting module for fine sorting, and then the fine sorting results can be fed back to the prescription form interface for the doctor's reference.
[0175] Optionally, in another embodiment, based on the above embodiments, at least the first two sorted prescriptions can be recommended, or at least the first two prescriptions can be recommended on the prescription form interface after fine sorting of the sorted recalled prescriptions.
[0176] In this embodiment of the invention, in response to user information input on the prescription form interface, the diagnostic information of the user on the prescription form interface is obtained; multiple prescriptions associated with the diagnostic information are identified; the multiple prescriptions are processed to obtain prescriptions containing the same content after processing, and these prescriptions with the same content are used as recall prescriptions; the relevance score or similarity score of the recalled prescriptions is determined; the recalled prescriptions are sorted according to the relevance score or similarity score; and the sorting result is fed back. In other words, in this embodiment of the invention, based on the patient's diagnostic information, multiple prescriptions with a high degree of relevance to the diagnostic information can be found, and these multiple prescriptions can be processed to obtain prescriptions with the same content, which are then used as recall prescriptions. The recalled prescriptions are then sorted according to their relevance score or similarity score, improving the efficiency of sorting and the accuracy of prescription recommendations.
[0177] Furthermore, this embodiment of the invention utilizes methods for constructing an inverted index and calculating similarity to apply the recommendation system to the new scenario of prescription recommendation. In this scenario, the methods for constructing the inverted index and the retrieval method provided in this embodiment require special processing of diagnostic data and drug indications, and offline calculation of the relevance score or similarity score of all diagnoses and each prescription, and prescription recommendation is made based on the relevance score or similarity score, thereby improving the accuracy of prescription recommendation.
[0178] Please also see Figure 2 This is a schematic diagram illustrating an application example of a prescription form provided by an embodiment of the present invention. Suppose this embodiment obtains three prescriptions: two from respiratory medicine and one from orthopedics. These can be sequentially numbered 1, 2, and 3. This embodiment uses prescription 3 as an example. Typically, prescription 3 obtained by the terminal is in JSON format, specifically represented by the following code segment:
[0179]
[0180] Afterwards, the terminal constructs an inverted index based on the three prescriptions. The construction process is detailed above and will not be repeated here. The status of the constructed inverted index is shown in Table 1, which displays three tables, each corresponding to one of the three inverted index tables.
[0181] Table 1
[0182]
[0183] Finally, when a doctor needs to prescribe medication after diagnosing a patient, the doctor enters the prescription interface (or page), such as... Figure 3 As shown, Figure 3This is an application illustration of displaying recommended medications on a prescription form, provided by an embodiment of the present invention. When the doctor fills in the patient's user information on the prescription form (which may include ID number, contraindications, and of course, name, gender, allergy history, clinical diagnosis, etc.), it is as follows... Figure 3 The patient's information is filled in the part marked with box 31. The recommended drug information will appear in the part marked with box 32 on the lower left of the prescription (or other locations on the prescription, which is not limited in this embodiment). This drug information is recommended after sorting or fine sorting the recalled prescriptions. This embodiment takes the recommendation of drugs from two recalled prescriptions as examples.
[0184] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that this disclosure is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the present invention.
[0185] Figure 4 This is a block diagram of a sorting device provided in an embodiment of the present invention. (Refer to...) Figure 4 The device includes: a first acquisition module 401, a first determination module 402, a processing module 403, a second determination module 404, a sorting module 405, and a recommendation module 406, wherein...
[0186] The first acquisition module 401 is used to acquire the user's diagnostic information on the prescription form interface in response to the user information entered on the prescription form interface.
[0187] The first determining module 402 is used to determine multiple prescriptions associated with the diagnostic information;
[0188] The processing module 403 is used to process the multiple prescriptions separately to obtain prescriptions with the same content after processing, and to use the prescriptions with the same content as recall prescriptions.
[0189] The second determining module 404 is used to determine the relevance score or similarity score of the recalled prescription;
[0190] The sorting module 405 is used to sort the recalled prescriptions according to relevance score or similarity score;
[0191] The return module 406 is used to return the sorting result of the sorting module;
[0192] Specifically, at least the first two prescriptions from the sorting results can be displayed on the prescription form interface, or the sorted recall prescriptions can be finely sorted and at least the first two prescriptions can be recommended to the prescription form interface.
[0193] Optionally, in another embodiment, based on the above embodiment, the second determining module 404 is specifically used to query a pre-established inverted index library according to the diagnostic information to obtain multiple prescriptions associated with the diagnostic information, wherein the inverted index library is an inverted index library constructed based on key fields in multiple sample prescription data.
[0194] Optionally, in another embodiment, based on the above embodiments, the device further includes: a first establishment module 500, the structural block diagram of which is shown below. Figure 5 As shown, the first building module 500 is used to pre-build an inverted index library according to the following steps: specifically including: an element acquisition module 501, a first building module 502, an indication determination module 503, an extraction module 504, a second building module 505, and a third building module 506, wherein,
[0195] The element acquisition module 501 is used to acquire elements of key fields in the data of multiple sample prescriptions. The key fields include at least: age field, diagnosis field, and drug indication field, wherein the age field, diagnosis field, and drug indication field are all arrays.
[0196] The first construction module 502 is configured to construct a first diagnostic inverted index A1 using each element in the diagnostic array; or to construct a second diagnostic inverted index A2 using each word of each element in the diagnostic array; and
[0197] Indication determination module 503 is used to determine all indications for each drug on each sample prescription;
[0198] Extraction module 504 is used to extract the same indications for the drug;
[0199] The second construction module 505 is used to construct a first inverted index B1 for each extracted identical indication and a second inverted index B2 for each word in each indication; wherein, the indications mainly include diseases or symptoms;
[0200] The third construction module 506 is used to construct an age inverted index by key-value pairs from the ages in multiple sample prescriptions, wherein the key is age, the value is an array, and each element of the array corresponds to a prescription.
[0201] Optionally, in another embodiment, based on the above embodiment, the processing module 403 includes: a segmentation module 601, a diagnosis determination module 602, a normalization module 603, a first search module 604, a second search module 605, and a first recall prescription determination module 606, the structural block diagram of which is shown below. Figure 6 As shown, where,
[0202] The segmentation module 601 is used to segment the diagnostic field of each of the plurality of prescriptions into an array;
[0203] The diagnostic determination module 602 is used to treat each element in each of the segmented arrays as a diagnosis.
[0204] Normalization module 603 is used to normalize the multiple descriptions of each diagnosis into a standard diagnostic description;
[0205] The first search module 604 is used to search the first inverted index library of each standard diagnosis description or each description of each diagnosis separately, or to search the second inverted index library separately using each word that appears in each standard diagnosis description or each word that appears in each description of each diagnosis separately, and to obtain the first prescription by taking the union of the results of each search;
[0206] The second search module 605 is used to search the first indication inverted index library by using each standard diagnostic description or each description of each diagnosis when the number of first prescriptions found by the first search module 604 is lower than a preset threshold, or to search the second indication inverted index library by using each word appearing in each standard diagnostic description or each word appearing in each description of each diagnosis.
[0207] The first recall prescription determination module 606 is used to obtain the second prescription by taking the union of the results found by the second search module 605 each time and the first prescription, and the second prescription is used as the recall prescription.
[0208] Optionally, in another embodiment, based on the above embodiments, the processing module further includes: a third search module and a second recall prescription determination module, wherein,
[0209] The third search module is used to search the age inverted index according to the user's age group to obtain the third search prescription when the number of the first prescriptions found by the first search module is higher than a preset threshold or the number of the second prescriptions is higher than a preset threshold.
[0210] The second recall prescription determination module is used to determine a prescription with the same content as the third prescription based on the first prescription or the second prescription, and to use the prescription with the same content as the recall prescription.
[0211] Optionally, in another embodiment, based on the above embodiment, the processing module 403 further includes: a second acquisition module and an addition module, wherein,
[0212] The second acquisition module is used to acquire a diagnosis that the number of prescriptions found is lower than the preset threshold when the number of prescriptions found by the first search module 604 is lower than the preset threshold.
[0213] An add module is used to add the user's diagnosis obtained by the second acquisition module to the drug indication field corresponding to the diagnosis, so as to supplement the knowledge graph.
[0214] Optionally, in another embodiment, based on the above embodiment, the second determining module 404 includes: a third search module 701 and a relevance score determining module 702, the structural block diagram of which is shown below. Figure 7 As shown, where,
[0215] The third search module 701 is used to search a preset prescription diagnosis score database based on the user's diagnosis information in the recalled prescription, and obtain the TF / IDF value or BM25 value corresponding to the diagnosis information.
[0216] The relevance score determination module 702 is used to take the TF / IDF value or BM25 value found by the third search module 701 as the relevance score of the user's diagnosis and prescription. When there are multiple diagnoses, the scores of multiple diagnoses are accumulated.
[0217] Optionally, in another embodiment, based on the above embodiments, the apparatus further includes a second establishment module for pre-establishing a prescription diagnostic score database according to the following steps: including: a sample prescription acquisition module, a sample diagnostic value determination module, and a correlation score determination module, wherein,
[0218] A sample prescription acquisition module is used to acquire multiple sample prescriptions, wherein the multiple sample prescriptions include at least the sample prescriptions for constructing an inverted index library;
[0219] The sample diagnostic value determination module is used to determine the TF / IDF value or BM25 value of each prescription diagnosis in the plurality of sample prescriptions;
[0220] The correlation score determination module is used to use the determined TF / IDF value or BM25 value of each prescription diagnosis as the correlation score between each diagnosis and the corresponding prescription in the prescription diagnosis score database.
[0221] Optionally, in another embodiment, based on the above embodiment, the second determining module is specifically used to search a preset diagnostic similarity dictionary H according to the user's diagnosis in the recall prescription, and obtain the similarity score e corresponding to the similar diagnosis.
[0222] Optionally, in another embodiment, based on the above embodiments, the apparatus further includes a third building module, used to pre-build a diagnostic similarity dictionary H according to the following steps: including: a text acquisition module, a training module, an enumeration module, a vector lookup module, a vector accumulation module, a similarity calculation module, a diagnostic determination module, and a fourth construction module, wherein...
[0223] The text acquisition module is used to acquire medical text data;
[0224] The training module is used to train the word vector matrix G based on the medical text data using a deep learning model;
[0225] The enumeration module is used to enumerate all diagnostic samples;
[0226] The vector lookup module is used to find the corresponding word vector from the word vector matrix G for each character in the enumerated diagnostic samples;
[0227] The vector accumulation module is used to accumulate the word vectors of each found character to obtain the word vector of the diagnosis;
[0228] The similarity calculation module is used to calculate the pairwise similarity scores between all diagnoses based on word vectors;
[0229] A diagnosis determination module is used to determine all diagnoses whose similarity scores are greater than a similarity threshold.
[0230] The fourth construction module is used to construct a diagnostic similarity dictionary H by combining all diagnoses with similarity scores greater than the similarity threshold with their corresponding similarity scores.
[0231] Optionally, in another embodiment, based on the above embodiments, the sorting module includes: a first sorting module and a second sorting module, wherein,
[0232] A first sorting module is used to sort the recalled prescriptions according to the relevance score; and / or
[0233] The second sorting module is used to search the inverted index A1 of the first diagnosis one by one according to the similar diagnoses, obtain the corresponding prescriptions, and sort the obtained prescriptions according to the similarity score e.
[0234] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0235] Optionally, embodiments of the present invention also provide an electronic device, comprising:
[0236] processor;
[0237] Memory used to store the processor's executable instructions;
[0238] The processor is configured to execute the instructions to implement the sorting method described above.
[0239] Optionally, embodiments of the present invention also provide a computer-readable storage medium, wherein when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is able to perform the sorting method described above. Optionally, the computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0240] Optionally, embodiments of the present invention also provide a computer program product, including a computer program or instructions, which, when executed by a processor, implement the sorting method as described above.
[0241] Figure 8 This is a block diagram of an electronic device 800 provided in an embodiment of the present invention. For example, the electronic device 800 can be a mobile terminal or a server; in this embodiment, a mobile terminal is used as an example for explanation. For example, the electronic device 800 can be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.
[0242] Reference Figure 8 The electronic device 800 may include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input / output (I / O) interface 812, a sensor component 814, and a communication component 816.
[0243] Processing component 802 typically controls the overall operation of electronic device 800, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the methods described above. Furthermore, processing component 802 may include one or more modules to facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.
[0244] Memory 804 is configured to store various types of data to support the operation of device 800. Examples of this data include instructions for any application or method operating on electronic device 800, contact data, phonebook data, messages, pictures, videos, etc. Memory 804 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 storage, flash memory, magnetic disk, or optical disk.
[0245] Power supply component 806 provides power to various components of electronic device 800. Power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 800.
[0246] Multimedia component 808 includes a screen that provides an output interface between the electronic device 800 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 touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 808 includes a front-facing camera and / or a rear-facing camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0247] Audio component 810 is configured to output and / or input audio signals. For example, audio component 810 includes a microphone (MIC) configured to receive external audio signals when electronic device 800 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 804 or transmitted via communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
[0248] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0249] Sensor assembly 814 includes one or more sensors for providing state assessments of various aspects of electronic device 800. For example, sensor assembly 814 may detect the on / off state of device 800, the relative positioning of components such as the display and keypad of electronic device 800, changes in position of electronic device 800 or a component of electronic device 800, the presence or absence of user contact with electronic device 800, orientation or acceleration / deceleration of electronic device 800, and temperature changes of electronic device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 814 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.
[0250] Communication component 816 is configured to facilitate wired or wireless communication between electronic device 800 and other devices. Electronic device 800 can access wireless networks based on communication standards, such as WiFi, carrier networks (such as 2G, 3G, 4G, or 5G), or combinations thereof. In one exemplary embodiment, communication component 816 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 816 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0251] In an embodiment, the electronic device 800 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 sorting method described above.
[0252] In this embodiment, a computer-readable storage medium is also provided, such as a memory 804 including instructions that can be executed by a processor 820 of an electronic device 800 to perform the sorting method described above. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, or optical data storage device, etc.
[0253] In one embodiment, a computer program product is also provided, which, when executed by the processor 820 of the electronic device 800, causes the electronic device 800 to perform the sorting method described above.
[0254] Figure 9 This is a block diagram of a prescription recommendation device 900 provided in an embodiment of the present invention. For example, device 900 may be provided as a server. (See also...) Figure 9 The apparatus 900 includes a processing component 922, which further includes one or more processors, and memory resources represented by memory 932 for storing instructions, such as application programs, that can be executed by the processing component 922. The application programs stored in memory 932 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 922 is configured to execute instructions to perform the methods described above.
[0255] The device 900 may also include a power supply component 926 configured to perform power management of the device 900, a wired or wireless network interface 950 configured to connect the device 900 to a network, and an input / output (I / O) interface 958. The device 900 can operate on an operating system stored in memory 932, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, or similar.
[0256] The user information (including but not limited to user device information, user personal information, etc.) and related data involved in this invention are all information authorized by the user or by the parties.
[0257] Other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of the invention are indicated by the following claims.
[0258] It should be understood that the present invention is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.
Claims
1. A ranking method characterized in that, The method comprises the following steps: obtaining diagnosis information of a user on a prescription interface in response to user information input on the prescription interface; determining a plurality of prescriptions associated with the diagnosis information; processing the plurality of prescriptions respectively to obtain prescriptions with the same content after processing, and taking the prescriptions with the same content as recall prescriptions; the processing of the plurality of prescriptions respectively to obtain prescriptions with the same content after processing, and taking the prescriptions with the same content as recall prescriptions comprises: segmenting a diagnosis field of each of the plurality of prescriptions into an array; each element in each segmented array is taken as a diagnosis; normalizing a plurality of descriptions of each diagnosis into a standard diagnosis description; using each standard diagnosis description or each description of each diagnosis to search a first diagnosis inverted index library respectively, or using each word in each standard diagnosis description or each description of each diagnosis to search a second inverted index library respectively, and taking the union set of the results of each search to obtain the first prescriptions found; if the number of the first prescriptions found is less than a preset threshold, using each standard diagnosis description or each description of each diagnosis to search a first indication inverted index library respectively, or using each word in each standard diagnosis description or each description of each diagnosis to search a second indication inverted index library respectively; based on the results of each search and the first prescriptions, taking the union set to obtain the second prescriptions found, and taking the second prescriptions as recall prescriptions; determining a relevance score or a similarity score of the recall prescriptions; sorting the recall prescriptions according to the relevance score or the similarity score, and returning the sorting result.
2. The ranking method of claim 1, wherein, The determination of the plurality of prescriptions associated with the diagnosis information comprises: querying a pre-established inverted index library according to the diagnosis information to obtain a plurality of prescriptions associated with the diagnosis information, wherein the inverted index library is an inverted index library constructed according to key fields in a plurality of sample prescription data.
3. The ranking method of claim 2, wherein, The pre-established inverted index library is constructed according to the following steps: obtaining elements of key fields in a plurality of sample prescription data, wherein the key fields at least include an age field, a diagnosis field and a drug indication field, and the age field, the diagnosis field and the drug indication field are all arrays; constructing a first diagnosis inverted index using each element in the diagnosis array, or constructing a second diagnosis inverted index using each word in each element in the diagnosis array; and determining all indications of each drug in each sample prescription; extracting the same indications of the drug; constructing a first indication inverted index according to each extracted same indication, and constructing a second indication inverted index according to each word in each indication, wherein the indications include diseases or symptoms; constructing an age inverted index according to the age in the plurality of sample prescriptions in a key-value pair, wherein the key is the age, and the value is an array, and each element of the age array corresponds to a prescription.
4. The ranking method of claim 1, wherein, The processing of the plurality of prescriptions respectively to obtain prescriptions with the same content after processing, and taking the prescriptions with the same content as recall prescriptions further comprises: If the number of the found first prescriptions is higher than the preset threshold or the number of the found second prescriptions is higher than the preset threshold, an age inverted index is searched according to an age range of the user to obtain a third prescription found; Based on the first prescription or the second prescription, a same-content prescription is determined from the third prescription, and the same-content prescription is taken as a recall prescription.
5. The ranking method of claim 1 or 4, wherein, The processing of the multiple prescriptions respectively to obtain the same-content prescriptions and taking the same-content prescriptions as the recall prescriptions further include: If the number of the found prescriptions is lower than the preset threshold, a diagnosis whose number is lower than the preset threshold is obtained, and the diagnosis information of the user is added to a drug indication field corresponding to the diagnosis to supplement a knowledge graph.
6. The ranking method of claim 1 or 4, wherein, The determination of the relevance score of the recall prescription includes: According to the diagnosis information of the user in the recall prescription, a preset prescription diagnosis score database is searched to obtain a TF / IDF value or a BM25 value corresponding to the diagnosis information, and the TF / IDF value or the BM25 value is taken as a relevance score of the diagnosis and the prescription of the user, wherein when there are multiple diagnoses, the relevance scores of the multiple diagnoses are accumulated.
7. The ranking method of claim 6, wherein, The prescription diagnosis score database is pre-established according to the following steps: A plurality of sample prescriptions are obtained, and the plurality of sample prescriptions at least include sample prescriptions for constructing an inverted index library; A TF / IDF value or a BM25 value of each prescription diagnosis in the plurality of sample prescriptions is determined; The determined TF / IDF value or BM25 value of each prescription diagnosis is taken as a relevance score of each diagnosis and a corresponding prescription in a prescription diagnosis score database.
8. The ranking method of claim 1 or 4, wherein, The determination of the similarity score of the recall prescription includes: According to the diagnosis of the user in the recall prescription, a preset diagnosis similarity dictionary is searched to obtain a similarity score corresponding to a similar diagnosis.
9. The ranking method of claim 8, wherein, The diagnosis similarity dictionary is pre-established according to the following steps: Medical text data is obtained; A word vector matrix is trained based on the medical text data by using a deep learning model; All diagnosis samples are enumerated, and each word in the diagnosis sample is searched from the word vector matrix to find a corresponding word vector; The word vectors of the found words are accumulated to obtain a word vector of the diagnosis; Similarity scores between all diagnoses are calculated based on the word vectors; All diagnoses whose similarity scores are greater than a similarity threshold are determined; The diagnoses whose similarity scores are greater than the similarity threshold and the corresponding similarity scores are used to construct a diagnosis similarity dictionary.
10. The ranking method of claim 9, wherein, The sorting of the recall prescriptions according to the relevance scores or the similarity scores includes: The recall prescriptions are sorted according to the relevance scores; or Similar diagnoses are searched one by one from a first diagnosis inverted index to obtain corresponding prescriptions, and the obtained prescriptions are sorted according to the similarity scores.
11. A sequencing device, characterized in that, The method further includes: A first obtaining module is configured to obtain diagnosis information of a user in response to user information input on a prescription interface; A first determining module is configured to determine a plurality of prescriptions associated with the diagnosis information. a processing module, configured to process the multiple prescriptions respectively to obtain prescriptions with same content after processing, and take the prescriptions with same content as recall prescriptions; the processing module comprises: a segmentation module, configured to segment a diagnosis field of each of the multiple prescriptions into an array; a diagnosis determination module, configured to take each element in each of the segmented arrays as a diagnosis; a normalization module, configured to normalize multiple descriptions of each diagnosis into a standard diagnosis description; a first search module, configured to search a first diagnosis inverted index library by using each standard diagnosis description or each description of each diagnosis, or search a second inverted index library by using each word in each standard diagnosis description or each word in each description of each diagnosis, and take a union set of results obtained each time to obtain searched first prescriptions; a second search module, configured to search a first indication inverted index library by using each standard diagnosis description or each description of each diagnosis, or search a second indication inverted index library by using each word in each standard diagnosis description or each word in each description of each diagnosis, when a number of the first prescriptions searched by the first search module is lower than a preset threshold; a first recall prescription determination module, configured to take a union set of results obtained each time by the second search module and the first prescriptions to obtain searched second prescriptions, and take the second prescriptions as recall prescriptions; a second determination module, configured to determine a relevance score or a similarity score of the recall prescriptions; a sorting module, configured to sort the recall prescriptions according to the relevance score or the similarity score; a return module, configured to return a sorting result sorted by the sorting module.
12. An electronic device, comprising: comprises: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the sorting method according to any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that, When the instructions in the computer readable storage medium are executed by the processor of the electronic device, the electronic device can perform the sorting method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Traditional Chinese medicine prescription recommendation sorting method based on data matching
CN111599486A