Medicine specification information automatic input method, computer device, medium and product
By correcting the images of drug instructions and extracting text information, and using the drug instructions knowledge graph template to identify unit information and organize key fields, the problems of low efficiency and error-prone entry of drug instructions information are solved, and efficient and accurate automatic entry and structured management are achieved.
Patent Information
- Application Number
- CN202510810349.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-17
- Publication Date
- 2025-09-23
AI Technical Summary
In the existing technology, the entry of drug insert information is inefficient, error-prone, and costly. Manual entry is time-consuming and labor-intensive, resulting in inaccurate information and affecting the accuracy and efficiency of the medical management system.
By correcting and numbering the drug insert pictures, extracting text information, identifying preset drug-related words and numbering them in sequence, using the drug insert knowledge graph template to identify unit information, extracting key fields and organizing them into target format data, it can finally be automatically filled into the system page.
It has greatly improved the efficiency and accuracy of drug insert information entry, reduced labor costs, enhanced data consistency and structured management, facilitated system docking and sharing, and provided an efficient and reliable solution for the improvement of medical information management systems.
Smart Images

Figure CN120688443A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of text processing technology, and in particular to a method, computer device, medium, and product for automatically entering drug insert information. Background Art
[0002] In the process of building and improving medical information management systems, the system entry of detailed information on drug inserts plays a crucial role. Inserts contain a vast amount of textual content, including ingredients, indications, usage and dosage, adverse reactions, and more. This information is crucial for medical professionals to accurately prescribe medications, for drug regulators to effectively oversee medications, and for patients to safely use medications.
[0003] Currently, drug insert information entry systems primarily rely on manual input. This requires staff to enter the insert information word for word, which is extremely time-consuming and labor-intensive, resulting in very low efficiency. Furthermore, manual operations are prone to typos and data entry errors, leading to inaccurate drug information in the system, which in turn negatively impacts subsequent medical decision-making and drug management. Furthermore, manual entry is labor-intensive and costly, especially when processing large volumes of inserts. These drawbacks are particularly pronounced. Summary of the Invention
[0004] In view of this, the embodiments of the present disclosure provide a method, computer device, medium, and product for automatically entering drug insert information, which can solve the problems of manual input of drug insert information in a medical information management system, such as being time-consuming and labor-intensive, inefficient, prone to errors leading to inaccurate information, and having a large workload and high costs.
[0005] In a first aspect, an embodiment of the present disclosure provides a method for automatically entering drug instructions information, comprising: All uploaded drug insert pictures are corrected and numbered in the order in which they are uploaded; Extract the text information of each numbered image after correction; Identify the preset drug-related words in each of the text information, and perform number correction according to the preset order of all the preset drug-related words to obtain a sorted concatenated text; According to the unit structure of the preset drug instructions knowledge graph template, each unit information is identified from the spliced text; each unit information includes one or more pictures; Extracting key fields from each of the unit information, and arranging the key fields in each of the unit information into target format data; Based on the target format data corresponding to all the unit information, the drug instructions input box corresponding to the system page is automatically filled.
[0006] Optionally, all uploaded drug insert images are corrected and numbered in the order in which they were uploaded, including: Each uploaded drug instruction sheet image is subjected to edge detection using an edge detection algorithm to determine the document edge of each image; Calculating the straight line angle of the document edge, fitting the straight line using the least squares method, and obtaining the tilt angle of the document corresponding to each image; Using a feature point matching algorithm to identify feature points of the document corresponding to each image, and determining distortion information of the document corresponding to each image, the distortion information including the degree of distortion and the direction of distortion; According to the tilt angle and the distortion information, the document is rotated and perspective transformed to obtain a corrected image, and the corrected images are numbered in the order of uploading.
[0007] Optionally, extracting text information of each numbered image corresponding to the corrected image includes: Training multiple selected OCR engines based on a historical drug package insert image training set, and selecting the OCR engine with the best training results as the target engine; the OCR engines include Tesseract, Baidu OCR, or Alibaba Cloud OCR; Performing a first preprocessing on each corrected image to obtain a first state image; the first preprocessing includes grayscale, binarization, or noise reduction; removing background information from the first-state image to obtain a second-state image; If the second-state image does not have uneven lighting or blurred text, the second-state image is recorded as the target image; When the second-state image has uneven lighting or blurred text, the second-state image is processed using a histogram equalization method or an adaptive threshold method, and the second-state image processed using an image super-resolution technology is processed to improve image clarity to obtain a target image; The target engine extracts text information from each target image.
[0008] Optionally, the identifying of preset drug-related words in each text message and performing number correction according to a preset order of all the preset drug-related words to obtain a sorted concatenated text includes: Identify words related to the drug name, ingredients, efficacy, dosage, adverse reactions, and contraindications, and form a preset drug-related word list; Traversing each of the text information based on the preset drug-associated word list, and identifying the preset drug-associated word in each of the text information using a string matching algorithm; According to the preset order of all the preset drug-related words identified, the pictures containing these associated words are numbered and corrected; All the text information is spliced together according to the corrected numbering sequence to obtain a sorted spliced text.
[0009] Optionally, identifying each unit information from the concatenated text according to the unit structure of the preset drug instructions knowledge graph template includes: Determine a drug insert knowledge graph template, wherein the drug insert knowledge graph template includes a drug name unit, an ingredient unit, an efficacy and indication unit, a usage and dosage unit, an adverse reaction unit, and a contraindication unit; The concatenated text is traversed, and each unit information is identified according to the drug instructions knowledge graph template using natural language processing technology, and the identified unit information is classified into the corresponding node of the drug instructions knowledge graph template.
[0010] Optionally, extracting key fields from each unit information and arranging the key fields in each unit information into target format data includes: Determine a field database corresponding to a key field based on all the unit information; extracting key fields from each unit information according to the field database and the type of the unit information; The key fields extracted from each of the unit information are sorted in the form of preset target format data to form structured data.
[0011] Optionally, the automatic filling of the drug instructions input box corresponding to the system page based on the target format data corresponding to all the unit information includes: Constructing a mapping relationship; the mapping relationship is used to map the key field names of the unit information to the field names of the drug instructions form required by the system page one by one; According to the mapping relationship, the structured data corresponding to each unit information is determined, and the data field value corresponding to the structured data is automatically filled into the form input box of the drug instructions.
[0012] In a second aspect, the present disclosure also provides a system for automatically entering drug instructions information, including: The correction processing module is used to correct all uploaded drug insert pictures and number them according to the order of upload; A text information extraction module is used to extract the text information of each numbered image after correction; a splicing module, configured to identify the preset drug-related words in each of the text messages, and perform number correction according to the preset order of all the preset drug-related words to obtain a sorted spliced text; A unit information recognition module is used to identify each unit information from the spliced text according to the unit structure of the preset drug instructions knowledge graph template; each unit information includes one or more pictures; A key field extraction module, configured to extract key fields from each of the unit information and organize the key fields in each of the unit information into target format data; The automatic filling module is used to automatically fill in the drug instructions input box corresponding to the system page based on the target format data corresponding to all the unit information.
[0013] In a third aspect, the embodiments of the present disclosure further provide a computer device that adopts the following technical solution: The computer device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any of the above-mentioned methods for automatically entering drug instructions information.
[0014] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable a computer to execute any of the above-mentioned methods for automatically entering drug instructions information.
[0015] In a fifth aspect, an embodiment of the present disclosure further provides a computer program product, comprising a computer program / instruction, which implements the steps of any of the above methods when executed by a processor.
[0016] The method for automatically entering drug instructions information disclosed in the present application corrects all uploaded drug instructions images and numbers them in the order of upload, then extracts the text information of each numbered image after the correction; identifies the preset drug-related words in each text information, and corrects the numbers according to the preset order of all preset drug-related words to obtain a sorted spliced text; identifies each unit information from the spliced text according to the unit structure of the preset drug instructions knowledge graph template; extracts the key fields in each unit information, and organizes the key fields in each unit information into target format data; and automatically fills the drug instructions input box corresponding to the system page based on the target format data corresponding to all unit information. By correcting the numbers of uploaded images, extracting text information, identifying associated words and correcting the numbers, identifying unit information according to the knowledge graph template, extracting key fields and organizing them into target format data, the system page input box can be automatically filled, effectively solving the problems of low efficiency, easy errors and high costs of manual data entry in existing technologies. It not only greatly improves data entry efficiency and reduces manpower and error correction costs, but also enhances data accuracy and consistency. At the same time, it realizes structured information management, facilitates system docking and sharing, and provides an efficient and reliable solution for the construction and improvement of medical information management systems.
[0017] The above description is only an overview of the technical solution of the present disclosure. In order to more clearly understand the technical means of the present disclosure, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present disclosure more obvious and easy to understand, the following specifically cites preferred embodiments and describes them in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0019] Figure 1 A flowchart of the method for automatically entering drug instructions information provided in an embodiment of the present disclosure.
[0020] Figure 2 A flowchart of a method for extracting text information from each numbered image after correction provided by an embodiment of the present disclosure.
[0021] Figure 3 A flowchart of a method for obtaining spliced text provided in an embodiment of the present disclosure.
[0022] Figure 4 A schematic diagram of the structure of a computer device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0023] The embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
[0024] It should be clear that the following embodiments of the present disclosure are described through specific concrete examples, and those skilled in the art can easily understand other advantages and effects of the present disclosure from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all the embodiments. The present disclosure can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present disclosure. It should be noted that the following embodiments and features in the embodiments can be combined with each other in the absence of conflict. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present disclosure.
[0025] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein can be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on this disclosure, it should be understood by those skilled in the art that an aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects described herein can be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein can be used to implement this device and / or practice this method.
[0026] It should also be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present disclosure. The illustrations only show components related to the present disclosure and are not drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component can be changed at will, and the component layout type may also be more complicated.
[0027] Additionally, in the following description, specific details are provided to provide a thorough understanding of the examples. However, one skilled in the art will appreciate that the aspects described can be practiced without these specific details.
[0028] Reference Figure 1 This application discloses a method for automatically entering drug instructions information, comprising: S100: All uploaded drug insert pictures are corrected and numbered in the order of upload.
[0029] Correction processing can improve the accuracy of subsequent text extraction, and numbering facilitates subsequent image management and positioning, ensuring that the order and correspondence of images will not be confused during the processing process.
[0030] In actual scenarios, pictures of drug instructions may be tilted or deformed due to shooting angle, paper placement, etc. If these problems are handled manually, additional time and effort will be required for adjustment. Automatic correction processing can quickly adjust the picture to the correct angle and format, saving time for manual adjustment and improving the starting efficiency of the overall data entry process; numbering pictures in the order of upload provides a clear index for subsequent steps. Whether it is extracting text information, identifying unit information or organizing data, each picture can be accurately located and processed according to the number, avoiding information confusion, making the entire process more orderly, and improving the manageability of the work.
[0031] S200, extracting text information of each numbered image after correction.
[0032] Manual data entry requires reading the text on the image word by word and entering it into the system, which is extremely slow. By automatically extracting text information, the text in the image can be quickly converted into editable text, greatly reducing the time it takes to obtain information. For example, for a long drug instruction sheet, manual data entry may take hours or even days, while automatic extraction can be completed in minutes. During the manual data entry process, due to visual fatigue and lack of concentration, problems such as omissions and errors are prone to occur. Automatic text information extraction is based on mature image recognition technology and can more accurately identify the text in the image, effectively reducing data errors caused by human factors and improving the accuracy of information.
[0033] S300: Identify the preset drug-related words in each text message, and perform number correction according to the preset order of all the preset drug-related words to obtain a sorted concatenated text.
[0034] By identifying associated words and adjusting numbers, the contents of drug instructions scattered in different pictures can be organized in a reasonable logical order to form a coherent text, which is convenient for subsequent unit information identification.
[0035] S400, according to the unit structure of the preset drug instructions knowledge graph template, identify each unit information from the spliced text; each unit information includes one or more pictures.
[0036] The knowledge graph template provides a clear framework for text analysis, which can structure the spliced text and classify different information into corresponding units, making it easier to process and analyze each unit separately.
[0037] Compared with manually searching and dividing information of different units in a large amount of text, automatic recognition based on knowledge graph templates can quickly locate the content of each unit, greatly improving the efficiency of information extraction and reducing the complexity of manual operations.
[0038] S500: extract key fields from each unit information, and organize the key fields in each unit information into target format data.
[0039] Extracting key fields can further refine and structure unit information, making it easier to store and use it later. Organizing it into target format data gives the data a unified structure, making it easier to connect and interact with front-end forms.
[0040] S600: Automatically fill in the drug instructions input box corresponding to the system page based on the target format data corresponding to all unit information.
[0041] This step can realize the automatic entry of drug insert information, greatly improving the efficiency and accuracy of data entry, and reducing the workload and possible errors of manual entry.
[0042] The method for automatically entering drug instructions information disclosed in the present application corrects all uploaded drug instructions images and numbers them in the order of upload, then extracts the text information of each numbered image after the correction; identifies the preset drug-related words in each text information, and corrects the numbers according to the preset order of all preset drug-related words to obtain a sorted spliced text; identifies each unit information from the spliced text according to the unit structure of the preset drug instructions knowledge graph template; extracts the key fields in each unit information, and organizes the key fields in each unit information into target format data; and automatically fills the drug instructions input box corresponding to the system page based on the target format data corresponding to all unit information. By correcting the numbers of uploaded images, extracting text information, identifying associated words and correcting the numbers, identifying unit information according to the knowledge graph template, extracting key fields and organizing them into target format data, the system page input box can be automatically filled, effectively solving the problems of low efficiency, easy errors and high costs of manual data entry in existing technologies. It not only greatly improves data entry efficiency and reduces manpower and error correction costs, but also enhances data accuracy and consistency. At the same time, it realizes structured information management, facilitates system docking and sharing, and provides an efficient and reliable solution for the construction and improvement of medical information management systems.
[0043] The method of S100, "correcting all uploaded drug insert pictures and numbering them in the order of upload," specifically includes: S110 , edge detection is performed on each uploaded drug instruction sheet image using an edge detection algorithm to determine the document edge of each image.
[0044] Specifically, the uploaded drug instruction sheet image can be grayscaled first, converting the color image into a grayscale image to reduce the amount of computation. The grayscale image can then be Gaussian-filtered to remove noise. Next, the image edges can be detected using the dual-threshold method of the Canny algorithm. Appropriate high and low thresholds are set, and pixels meeting the high threshold are marked as edge pixels. Pixels connected to edge pixels and meeting the low threshold are also marked as edge pixels. Through this series of operations, the edge contour of the document in the image is determined. Edge detection is the foundation of subsequent correction processing. Accurately determining the document edge provides critical boundary information for the subsequent calculation of tilt angles and distortion information. Only by clearly defining the document edge can the posture and shape of the document be analyzed more accurately.
[0045] S120 , calculating the straight line angle of the document edge, fitting the straight line using the least squares method, and obtaining the tilt angle of the document corresponding to each image.
[0046] After determining the document's edge, methods such as the Hough transform can be used to detect the straight lines along the edge. The Hough transform converts edge pixels in the image into a parameter space and identifies the straight line by finding the peak in the parameter space. The detected straight line is then fitted using the least squares method. The principle of the least squares method is to minimize the sum of the squared distances from all edge points to the fitted line, thereby obtaining the line that best represents the document's edge. By calculating the angle between this fitted line and the horizontal, the document's tilt angle can be determined. For example, if the angle between the fitted line and the horizontal is 15 degrees, then the document's tilt angle is 15 degrees. Least squares straight line fitting can reduce the influence of noise and imprecise edge points in edge detection, resulting in a more accurate straight line representation. The calculated tilt angle is a key parameter for rotation correction, ensuring that the document is correctly positioned horizontally or vertically during subsequent processing.
[0047] S130 , using a feature point matching algorithm to identify feature points of the document corresponding to each image, and determining distortion information of the document corresponding to each image, where the distortion information includes a distortion degree and a distortion direction.
[0048] Among them, the feature point matching algorithm is preferably SIFT. Specifically, feature points are first extracted from the image. The SIFT algorithm searches for key points in the image at different scales and calculates the feature descriptors of these key points. These feature descriptors are invariant to rotation, scale, and illumination. Then, by matching the relationship between feature points at different positions, the distortion of the document is analyzed. For example, if the distance and angle between the feature points corresponding to two edges that should be parallel in the image are found to have changed, it can be determined that the document is distorted. By calculating the relative position and angle changes between the feature points, the degree and direction of distortion are determined. The feature point matching algorithm can accurately capture the local features of the document, thereby identifying the distortion of the document. In actual situations, images of drug instructions may be distorted due to shooting angles, paper deformation, and other reasons. Determining the distortion information can provide a basis for subsequent perspective transformations, making the corrected document more consistent with its true shape.
[0049] S140 , rotating and perspective transforming the document according to the tilt angle and distortion information to obtain a corrected image, and numbering the corrected images according to the order in which they were uploaded.
[0050] Specifically, the image is rotated according to the tilt angle calculated previously. Preferably, an image rotation algorithm is used to rotate the image around the center point by a corresponding angle so that the document is in a horizontal or vertical state. Based on the distortion information, the image is perspective-transformed using a perspective transformation matrix. The perspective transformation can convert the distorted document image into a normal rectangular shape. By specifying four corresponding points before and after the transformation, the perspective transformation matrix is calculated, and then the matrix is applied to the entire image for transformation. After the rotation and perspective transformation are completed, the corrected images are numbered starting from 1 in the order in which the images were uploaded. Rotation and perspective transformation can correct tilted and distorted document images to a normal shape, improving the quality and readability of the images. Numbering them in the order of upload facilitates subsequent management and processing of the images, ensuring that each image can be accurately referenced and processed in subsequent steps.
[0051] According to the method disclosed in S110-S140, after the correction processing, the text on the image is more regular, the edges are clear, and the posture is correct, which reduces the impact of tilt and distortion on OCR recognition and greatly improves the accuracy of subsequent text extraction; all images are uniformly corrected and numbered, making the subsequent data processing process more standardized and orderly, and the differences in posture and shape between different images are eliminated, which facilitates batch processing and analysis of images in subsequent steps; for users who upload images, the system can automatically correct the images without the need for manual adjustment by the user, saving the user's time and energy and improving the user experience.
[0052] Reference Figure 2The method for extracting text information from each numbered image after correction processing specifically includes: S210 , training the selected multiple OCR engines based on the historical drug package insert image training set, and using the OCR engine with the best training result as the target engine.
[0053] Among them, OCR engines include Tesseract, Baidu OCR or Alibaba Cloud OCR; the historical drug instructions image training set includes drug instructions covering different fonts, font sizes, colors, and layouts.
[0054] Specifically, each engine is trained using images from the training set. Evaluation metrics, such as text recognition accuracy and recall, are set for each engine's training results. By comparing the evaluation results of each engine on the training set, the engine with the highest accuracy is selected as the target engine. Different OCR engines may perform differently when processing specific image types. By training and evaluating multiple engines and selecting the engine that is most suitable for drug package insert image recognition, the accuracy and reliability of text recognition can be improved.
[0055] S220: Perform a first preprocessing on each corrected image to obtain a first state image.
[0056] The first preprocessing includes grayscale, binarization or noise reduction processing.
[0057] Specifically, grayscale conversion refers to converting the corrected color image into a grayscale image. Grayscale conversion can reduce the amount of data and reduce the complexity of subsequent processing.
[0058] Binarization involves converting grayscale images into two categories, typically black and white. Global thresholding methods, such as the Otsu algorithm, can be used to automatically determine an appropriate threshold, setting pixels with grayscale values greater than the threshold to white and pixels with grayscale values less than the threshold to black. Binarization can make text and background more distinct, facilitating subsequent text segmentation and recognition.
[0059] Noise reduction processing can use methods such as median filtering and Gaussian filtering to remove noise in the image. Noise reduction processing can remove interference information in the image, improve the clarity of the text, and help improve the accuracy of subsequent recognition.
[0060] S230: Remove background information from the first-state image to obtain a second-state image.
[0061] Specifically, you can use image segmentation algorithms, such as color-based and edge-based segmentation, or morphological operations, such as dilation and erosion, to remove small background areas. Removing background information focuses attention on the text, reducing background interference on text recognition. Clean text areas can improve the OCR engine's recognition accuracy and prevent background noise and patterns from affecting text segmentation and recognition.
[0062] S240: If the second-state image does not have uneven illumination or blurred text, the second-state image is recorded as the target image.
[0063] S250, when the second state image has uneven illumination or blurred text, the second state image is processed using a histogram equalization method or an adaptive threshold method, and the second state image processed using image super-resolution technology is processed to obtain a target image.
[0064] Uneven lighting and blurred text are common issues that affect OCR recognition accuracy. The above processing methods can improve image quality, enhance text clarity and contrast, and enable the OCR engine to recognize text more accurately.
[0065] S260, extracting text information from each target image based on the target engine.
[0066] Using a trained and screened target engine, combined with the image preprocessing and optimization in the previous steps, can maximize the accuracy and reliability of text extraction, providing high-quality text data for subsequent drug instructions information processing.
[0067] The method disclosed in S210-S260 can effectively reduce the impact of various factors on text recognition and improve the accuracy of OCR recognition by training and screening the OCR engine and performing multi-step preprocessing and optimization on the images. Different processing methods are used for images of different quality, which can adapt to various complex drug instruction pictures, including uneven lighting, blurred text, etc., to ensure that the system can work normally in various scenarios. For pictures of better quality, unnecessary processing steps are avoided. For pictures of poorer quality, the image quality is improved through effective processing methods, thereby improving the overall data processing efficiency.
[0068] Furthermore, the OCR recognition results of the image corresponding to each number can be fully post-processed: remove unnecessary spaces, line breaks, etc.; establish a professional pharmaceutical terminology dictionary to proofread and correct professional terms in the recognition results; introduce natural language processing technology to perform semantic understanding and context association analysis on the recognition results, check and correct logical errors to ensure the accuracy of the extracted text information.
[0069] Reference Figure 3 Regarding the method of S300 "identifying the preset drug-related words in each text message, and performing number correction according to the preset order of all the preset drug-related words to obtain a sorted spliced text", that is, the method of obtaining the spliced text specifically includes: S310, determining words related to the drug name, ingredients, efficacy, usage and dosage, adverse reactions, and contraindications, and forming a preset drug-related word list.
[0070] The preset drug-related word list provides clear goals and standards for subsequent text information recognition. With this list, when processing a large amount of drug instructions text information, key information can be accurately and quickly located to avoid missing important drug-related content.
[0071] Specifically, for drug names, relevant vocabulary includes generic names, trade names, chemical names and other related words, such as "aspirin", "ibuprofen sustained-release capsules", etc.
[0072] For ingredients, relevant words include "ingredient", "main ingredient", "active ingredient", "excipient", as well as specific chemical names such as "acetaminophen", "starch", etc.
[0073] For efficacy and indications, relevant vocabulary includes "efficacy", "main indications", "functional indications", "indications", "treatment", etc., as well as specific names of diseases, such as "cold and fever", "headache", "joint pain", etc.
[0074] For usage and dosage, relevant vocabulary includes "usage", "dosage", "method of use", "dosage", "route of administration", etc., as well as specific usage descriptions such as "oral", "three times a day", "two tablets at a time", etc.
[0075] For adverse reactions, relevant words include "adverse reaction", "side effect", "adverse event", etc., as well as specific adverse reaction symptoms such as "nausea", "vomiting", "rash", etc.
[0076] For taboos, relevant words include "taboo", "prohibited", "use with caution", etc., as well as specific taboo situations, such as "prohibited for pregnant women" and "prohibited for people with allergies".
[0077] S320: traverse each text message based on the preset drug-related word list, and use a string matching algorithm to identify the preset drug-related words in each text message.
[0078] For each piece of text extracted in the previous steps, words are sequentially selected from the preset list of drug-related terms and searched within the text. A simple string matching algorithm, such as a brute-force matching algorithm, can be used to compare the associated terms with the character strings within the text, character by character. For example, if the associated term is "aspirin," the text is searched for the presence of that string. If a matching associated term is found, it is marked. Using a string matching algorithm, preset drug-related terms can be automatically identified within large amounts of text, significantly improving information extraction efficiency, reducing manual search workload, and ensuring accurate and consistent recognition.
[0079] S330: According to the preset order of all the preset drug-related words identified, the pictures containing these associated words are numbered and corrected.
[0080] Assuming that the preset order of associated words is drug name, ingredients, efficacy and indications, usage and dosage, adverse reactions, and contraindications, when different associated words are identified in the text information, the image numbers containing these associated words are adjusted according to this preset order. For example, "aspirin" (drug name) was identified in the text with the original image number 3, and "antipyretic and analgesic" (efficacy and indications) was identified in the text with the image number 5. According to the preset order, image number 3 is regarded as being in the front and image number 5 is in the back. Such adjustments are made to the image numbers of all images containing associated words to ensure that the image numbers are consistent with the preset order of the associated words. The number correction allows the images and text information to be arranged in the logical order of the drug information, so that when the text is subsequently spliced together, it can be ensured that the spliced text information has a reasonable structure and order, which conforms to people's reading habits of drug instructions information and facilitates subsequent information use and analysis.
[0081] S340: splice all text information according to the corrected numbering sequence to obtain a sorted spliced text.
[0082] The spliced text information is arranged in the logical order of drug information, forming a complete and orderly drug instruction manual text, which makes subsequent viewing, analysis and use of drug information more convenient. Whether it is used for medical research, drug management or patient inquiries, the required drug information can be obtained quickly and accurately.
[0083] The method of S400, "identifying each unit information from the concatenated text according to the unit composition of the preset drug instructions knowledge graph template," specifically includes: S410, determining a drug insert knowledge graph template, which includes a drug name unit, an ingredient unit, an efficacy unit, a usage and dosage unit, an adverse reaction unit, and a contraindication unit.
[0084] The standardized knowledge graph template provides a clear framework and guidance for subsequent information extraction and knowledge graph construction. It unifies the organization of drug insert information, so that the information of different drug inserts can be processed and presented in a standardized and consistent manner, facilitating knowledge sharing and communication. The determination of the template helps to reduce the complexity of information processing and divides the complex information of the drug insert into several clear units, making the subsequent information identification and classification work more targeted and efficient, and reducing the uncertainty in the processing process.
[0085] S420, traverse the concatenated text, use natural language processing technology to identify each unit information according to the drug instructions knowledge graph template, and classify the identified unit information into the corresponding node of the drug instructions knowledge graph template.
[0086] Specifically including: 1) Headline positioning: first look for the location of the headlines such as "Drug Name", "Ingredients", "Effects and Indications", "Usage and Dosage", "Adverse Reactions", and "Contraindications" in the text. These headlines usually mark the beginning of a unit of information; 2) Information extraction: Starting from the headline, extract relevant information backward until the next headline or the end of the text is encountered. For example, after finding the "Ingredients" headline, extract the specific description of the ingredients until the "Effects and Indications" headline is encountered; 3) Multi-page information integration: Since a unit of information may be distributed on multiple pictures, the relevant information on these pictures needs to be integrated. For example, if the "Ingredients" unit information is distributed on three pages of pictures, the first page has the headline "Ingredients", and the last two pages are specific ingredient descriptions, then the information on these three pages will be merged into a complete "Ingredients" unit information.
[0087] The application of natural language processing technology makes it possible to automatically identify and classify information from spliced text, greatly improving the efficiency of information processing and reducing the workload of manual labeling and classification; accurately classifying information into the corresponding nodes of the knowledge graph template helps to build a complete and accurate drug instructions knowledge graph. Such a knowledge graph can clearly display the various attributes and relationships of drugs, facilitate subsequent knowledge query, reasoning and analysis, and provide a strong knowledge foundation for decision support and research in the medical field.
[0088] The method of S500 of "extracting key fields from each unit information and arranging the key fields in each unit information into target format data" specifically includes: S510: Determine the field database corresponding to the key field according to all unit information.
[0089] In the field database, when the unit information is the name of the drug, the key fields in the unit information include one or more of the generic name of the drug, the trade name of the drug, and the chemical name of the drug; when the unit information is the ingredient, the key fields in the unit information include one or more of the active ingredient, excipients, and ingredient content; when the unit information is the efficacy and indication, the key fields in the unit information include one or more of the treatment disease, treatment symptoms, and mechanism of action; when the unit information is the usage and dosage, the key fields in the unit information include one or more of the route of administration, frequency of use, single dose, and course of treatment; when the unit information is the adverse reaction, the key fields in the unit information include one or more of the reaction symptoms, reaction frequency, and severity; when the unit information is the contraindication, the key fields in the unit information include the contraindication population and / or contraindication situation.
[0090] The field database provides a clear reference for the subsequent extraction of key fields. With this database, when processing the unit information of different drug instructions, it is possible to accurately identify the possible key fields and avoid missing important information. Different drug instructions may have differences in expression, but through a unified field database, various expression information can be summarized under the corresponding key fields, which is convenient for subsequent data analysis and utilization.
[0091] S520: Extract key fields from each unit information according to the field database and the type of the unit information.
[0092] S530: The key fields extracted from each unit information are sorted according to a preset target format data to form structured data.
[0093] For example, when the unit information is a drug name, the target format data can be organized into a dictionary form, such as {"generic name": "acetaminophen", "trade name": "Tylenol", "chemical name": "N-(4-hydroxyphenyl)acetamide"}.
[0094] When the unit information is an ingredient, for example, the target format data is: {"active ingredient": ["Amoxicillin"],"excipient": ["starch", "dextrin"], "ingredient content": [{"Amoxicillin": "0.25g"}]}.
[0095] When the unit information is efficacy and indication, for example, the target format data is: {"Treatment disease": ["Cold", "Pneumonia"], "Treatment symptoms": ["Fever", "Cough"], "Mechanism of action": "Inhibit bacterial cell wall synthesis"}.
[0096] When the unit information is usage and dosage, for example, the target format data is: {"route of administration": "oral", "frequency of use": "three times a day", "single dose": "2 tablets", "course of treatment": "7 days"}.
[0097] When the unit information is an adverse reaction, for example, the target format data is: {"Reaction symptoms": ["Nausea", "Vomiting", "Rash"], "Reaction frequency": ["Common", "Occasional", "Rare"], "Severity": ["Mild", "Moderate", "Severe"]}.
[0098] When the unit information is contraindication, for example, the target format data is: {"contraindication groups": ["pregnant women", "breastfeeding women"], "contraindication conditions": ["contraindication for those allergic to penicillin", "contraindication for those with severe liver and kidney dysfunction"]}).
[0099] Structured data is easy to store and manage. Whether stored in a file system or a database, structured data can be saved in an orderly and standardized manner, facilitating subsequent data maintenance and updates.
[0100] Furthermore, it can be organized into formats such as JSON and CSV so that the data has a unified format and structure, which is convenient for storage in the database and also facilitates subsequent data analysis, query and sharing.
[0101] The method for S600 of "automatically filling in the drug instructions input box corresponding to the system page based on the target format data corresponding to all unit information" includes: S610, constructing a mapping relationship; the mapping relationship is used to map the key field names of the unit information with the field names of the drug instructions form required by the system page one by one.
[0102] S620: Determine the structured data corresponding to each unit of information based on the mapping relationship, and automatically fill the data field value corresponding to the structured data into the form input box of the drug instructions.
[0103] Specifically, after the system receives the JSON format data returned by the large model, it automatically parses the data and fills the corresponding information into the corresponding input box according to the field definition of the input box on the system page to complete the automatic entry of the drug instructions information.
[0104] The entire S600 process automates the entire process, from extracting drug insert information to filling in system form entries. This reduces manual intervention, improves the speed and efficiency of drug information entry, and enables faster processing and application of drug information within the system. By establishing mapping relationships and automatically filling in the entries, drug insert information is ensured to be accurately and consistently entered into the system. This helps improve the quality of drug information within the system, providing a reliable data foundation for subsequent drug management, query, and analysis, and enhancing the performance and reliability of the entire drug management system.
[0105] On the other hand, the present application discloses a system for automatically entering drug insert information, which is used to execute the method for automatically entering drug insert information. The system comprises: The correction processing module is used to correct all uploaded drug insert pictures and number them according to the order of upload; A text information extraction module is used to extract the text information of each numbered image after correction; A splicing module is used to identify the preset drug-related words in each text message and perform number correction according to the preset order of all the preset drug-related words to obtain a sorted spliced text; The unit information recognition module is used to identify each unit information from the spliced text according to the unit structure of the preset drug instructions knowledge graph template; each unit information includes one or more pictures; The key field extraction module is used to extract the key fields in each unit information and organize the key fields in each unit information into target format data; The automatic filling module is used to automatically fill in the drug instructions input box corresponding to the system page based on the target format data corresponding to all unit information.
[0106] A computer device according to an embodiment of the present disclosure includes a memory and a processor. The memory is used to store non-transitory computer-readable instructions. Specifically, the memory may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), a hard disk, flash memory, etc.
[0107] The processor can be a central processing unit (CPU) or other form of processing unit with data processing capabilities and / or instruction execution capabilities, and can control other components in the computer device to perform desired functions. In one embodiment of the present disclosure, the processor is used to execute the computer-readable instructions stored in the memory, causing the computer device to perform all or part of the steps of the method for automatically entering drug insert information in each embodiment of the present disclosure.
[0108] Those skilled in the art should understand that in order to solve the technical problem of how to obtain a good user experience, this embodiment may also include well-known structures such as a communication bus and an interface, and these well-known structures should also be included in the scope of protection of this disclosure.
[0109] like Figure 4 The present invention provides a schematic diagram of the structure of a computer device according to an embodiment of the present invention. Figure 4 The computer device shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0110] like Figure 4 As shown, a computer device may include a processor (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes based on programs stored in a read-only memory (ROM) or programs loaded from a storage device into a random access memory (RAM). The RAM also stores various programs and data required for the operation of the computer device. The processor, ROM, and RAM are connected to each other via a bus. An input / output (I / O) interface is also connected to the bus.
[0111] Typically, the following devices can be connected to the I / O interface: input devices such as sensors or visual information acquisition devices; output devices such as display screens; storage devices such as tapes and hard disks; and communication devices. The communication device can allow the computer device to communicate with other devices (such as edge computing devices) wirelessly or by wire to exchange data. Figure 4 A computer device having various devices is shown, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.
[0112] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through a communication device, or installed from a storage device, or installed from a ROM. When the computer program is executed by the processor, all or part of the steps of the method for automatically entering drug instructions information of the embodiment of the present disclosure are executed.
[0113] For detailed description of this embodiment, please refer to the corresponding description in the aforementioned embodiments, which will not be repeated here.
[0114] According to an embodiment of the present disclosure, a computer-readable storage medium stores non-transitory computer-readable instructions. When the non-transitory computer-readable instructions are executed by a processor, all or part of the steps of the method for automatically entering drug insert information in each embodiment of the present disclosure are executed.
[0115] The above-mentioned computer-readable storage media include, but are not limited to, optical storage media (e.g., CD-ROMs and DVDs), magneto-optical storage media (e.g., MOs), magnetic storage media (e.g., magnetic tapes or mobile hard disks), media with built-in rewritable non-volatile memory (e.g., memory cards), and media with built-in ROM (e.g., ROM cartridges).
[0116] For detailed description of this embodiment, please refer to the corresponding description in the aforementioned embodiments, which will not be repeated here.
[0117] The basic principles of the present disclosure have been described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, and effects mentioned in this disclosure are merely illustrative and not restrictive, and should not be construed as necessarily possessed by each embodiment of the present disclosure. Furthermore, the specific details disclosed above are provided for illustrative purposes and to facilitate understanding, rather than as limitations. These details do not limit the present disclosure to necessarily being implemented using these specific details.
[0118] In the present disclosure, relational terms such as first and second, etc. are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. The block diagrams of the devices, devices, equipment, and systems involved in the present disclosure are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As will be appreciated by those skilled in the art, these devices, devices, equipment, and systems can be connected, arranged, or configured in any manner. Words such as "including," "comprising," "having," and the like are open-ended words, meaning "including but not limited to," and can be used interchangeably therewith. The words "or" and "and" used herein refer to the words "and / or" and can be used interchangeably therewith, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to," and can be used interchangeably therewith.
[0119] Additionally, as used herein, "or" used in a list of items beginning with "at least one" indicates a separate list, so that, for example, a list of "at least one of A, B, or C" means A or B or C, or AB or AC or BC, or ABC (i.e., A and B and C). Furthermore, the word "exemplary" does not mean that the example described is preferred or better than other examples.
[0120] It should also be noted that in the system and method of the present disclosure, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present disclosure.
[0121] Various changes, substitutions, and modifications may be made to the technology described herein without departing from the teachings defined by the appended claims. Moreover, the scope of the claims of this disclosure is not limited to the specific aspects of the processes, machines, manufactures, compositions of things, means, methods, and actions described above. Currently existing or later developed processes, machines, manufactures, compositions of things, means, methods, or actions that perform substantially the same function or achieve substantially the same results as the corresponding aspects described herein may be utilized. Accordingly, the appended claims include within their scope such processes, machines, manufactures, compositions of things, means, methods, or actions.
[0122] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but rather to be accorded the widest scope consistent with the principles and novel features disclosed herein.
[0123] The above description has been provided for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although a number of example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations thereof.
Claims
1. A method for automatically entering drug instructions information, characterized in that: include: All uploaded drug insert pictures are corrected and numbered in the order in which they are uploaded; Extract the text information of each numbered image after correction; Identify the preset drug-related words in each of the text information, and perform number correction according to the preset order of all the preset drug-related words to obtain a sorted concatenated text; According to the unit structure of the preset drug instructions knowledge graph template, each unit information is identified from the spliced text; each unit information includes one or more pictures; Extracting key fields from each of the unit information, and arranging the key fields in each of the unit information into target format data; Based on the target format data corresponding to all the unit information, the drug instructions input box corresponding to the system page is automatically filled.
2. The method for automatically entering drug instructions information according to claim 1, characterized in that: All uploaded drug insert images are corrected and numbered in the order of upload, including: Each uploaded drug instruction sheet image is subjected to edge detection using an edge detection algorithm to determine the document edge of each image; Calculating the straight line angle of the document edge, fitting the straight line using the least squares method, and obtaining the tilt angle of the document corresponding to each image; Using a feature point matching algorithm to identify feature points of the document corresponding to each image, and determining distortion information of the document corresponding to each image, the distortion information including the degree of distortion and the direction of distortion; According to the tilt angle and the distortion information, the document is rotated and perspective transformed to obtain a corrected image, and the corrected images are numbered in the order of uploading.
3. The method for automatically entering drug instructions information according to claim 1, characterized in that: The extraction and correction of text information corresponding to each numbered picture includes: Training multiple selected OCR engines based on a historical drug package insert image training set, and selecting the OCR engine with the best training results as the target engine; the OCR engines include Tesseract, Baidu OCR, or Alibaba Cloud OCR; Performing a first preprocessing on each corrected image to obtain a first state image; the first preprocessing includes grayscale, binarization, or noise reduction; removing background information from the first-state image to obtain a second-state image; If the second-state image does not have uneven lighting or blurred text, the second-state image is recorded as the target image; When the second-state image has uneven lighting or blurred text, the second-state image is processed using a histogram equalization method or an adaptive threshold method, and the second-state image processed using an image super-resolution technology is processed to improve image clarity to obtain a target image; The target engine extracts text information from each target image.
4. The method for automatically entering drug instructions information according to claim 1, characterized in that: The step of identifying the preset drug-related words in each text message and performing number correction according to the preset order of all the preset drug-related words to obtain a sorted concatenated text includes: Identify words related to the drug name, ingredients, efficacy, dosage, adverse reactions, and contraindications, and form a preset drug-related word list; Traversing each of the text information based on the preset drug-associated word list, and identifying the preset drug-associated word in each of the text information using a string matching algorithm; According to the preset order of all the preset drug-related words identified, the pictures containing these associated words are numbered and corrected; All the text information is spliced together according to the corrected numbering sequence to obtain a sorted spliced text.
5. The method for automatically entering drug instructions information according to claim 4, characterized in that: The unit structure of the preset drug instructions knowledge graph template is used to identify each unit information from the spliced text, including: Determine a drug insert knowledge graph template, wherein the drug insert knowledge graph template includes a drug name unit, an ingredient unit, an efficacy and indication unit, a usage and dosage unit, an adverse reaction unit, and a contraindication unit; The concatenated text is traversed, and each unit information is identified according to the drug instructions knowledge graph template using natural language processing technology, and the identified unit information is classified into the corresponding node of the drug instructions knowledge graph template.
6. The method for automatically entering drug instructions information according to claim 1, characterized in that: The extracting key fields from each of the unit information and arranging the key fields in each of the unit information into target format data includes: Determine a field database corresponding to a key field based on all the unit information; extracting key fields from each unit information according to the field database and the type of the unit information; The key fields extracted from each of the unit information are sorted in the form of preset target format data to form structured data.
7. The method for automatically entering drug instructions information according to claim 6, characterized in that: The automatic filling of the drug instructions input box corresponding to the system page based on the target format data corresponding to all the unit information includes: Constructing a mapping relationship; the mapping relationship is used to map the key field names of the unit information to the field names of the drug instructions form required by the system page one by one; According to the mapping relationship, the structured data corresponding to each unit information is determined, and the data field value corresponding to the structured data is automatically filled into the form input box of the drug instructions.
8. A computer device, characterized in that: The computer device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for automatically entering drug instructions information according to any one of claims 1 to 7.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, which are used to enable a computer to execute the method for automatically entering drug instructions information according to any one of claims 1 to 7.
10. A computer program product comprising computer instructions, characterized in that When the computer instructions are executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.