Methods, devices, equipment, and storage media for connecting drifting text of medical invoices
By performing uppercase digit text detection and splicing on medical invoices, and constructing anchor box objects and docking boxes, the problem of poor recognition accuracy caused by the positional drift of printed digits in medical invoices was solved, and accurate recognition and splicing of uppercase digits was achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- PING AN TECH (SHENZHEN) CO LTD
- Filing Date
- 2023-06-28
- Publication Date
- 2026-05-26
AI Technical Summary
Existing technologies suffer from poor recognition accuracy when recognizing capitalized numbers on medical invoices, especially older or regionally specific invoices, due to the drift in the position of the printed numbers. In particular, optical character recognition cannot automatically recognize them as complete text blocks.
By performing uppercase numeric text detection on medical invoices, anchor box objects and target boxes are constructed. A target search box is constructed using a preset retrieval strategy, and the objects are sorted and concatenated according to their type and coordinate information to identify and concatenate uppercase numeric values.
It improves the accuracy of recognizing and matching printed and digital numbers in medical invoices, ensuring the complete splicing of uppercase numbers.
Smart Images

Figure CN116844178B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of data processing and digital healthcare technology, and in particular to a method, apparatus, device, and computer-readable storage medium for connecting uppercase numbers on medical invoices in scenarios such as data auditing, management, and warehousing of medical invoices. Background Technology
[0002] With the development of the information age, some medical invoice data requires a series of operations such as identification, verification, and data entry to retain the data and achieve the digital development of institutions. Currently, the formats of the amount section on various medical invoices differ from those on VAT invoices, especially some older medical invoices or those from certain regions, which have highly templated formats. The printed amount provides the unit in words, and the printer prints the specific uppercase numbers in the corresponding positions. However, due to potential shifts in the printing position, optical character recognition (OCR) may not be able to automatically recognize it as a complete text block.
[0003] A common solution is to draw a horizontal straight line that passes through as many text boxes as possible, thus distributing the text boxes to the corresponding lines. However, this method is not very robust and performs poorly when there are many text boxes in the same line. It can result in the line tilting and distributing text boxes from different lines to the same line. Moreover, the effect is even worse when the printed text is shifting. Summary of the Invention
[0004] This invention provides a method, apparatus, device, and storage medium for matching uppercase numbers on medical invoices. Its main purpose is to improve the accuracy of matching printed and digital numbers on invoices during the recognition process of various medical invoices.
[0005] To achieve the above objectives, this invention provides a method for connecting uppercase numbers on medical invoices, comprising:
[0006] Perform uppercase numeric text detection on pre-built medical invoices to obtain a collection of text box objects;
[0007] According to the preset retrieval strategy, the set of text box objects is grouped into anchor box objects and boxes to be matched, and each target search box of the medical invoice is constructed based on the anchor box objects and the boxes to be matched.
[0008] Identify the object type of the anchor box object in each of the target search boxes;
[0009] When the object type of the anchor box object in the target search box is a first-level anchor box, a second text search is performed on the target search box to obtain the candidate combined text boxes;
[0010] When the object type of the anchor box object in the target search box is a second-level anchor box, text retrieval is performed on the target search box to obtain candidate text boxes;
[0011] Based on the coordinate information of the candidate text boxes and the candidate text boxes, the candidate text boxes and the candidate text boxes are sorted and concatenated to obtain the uppercase number concatenation result.
[0012] Optionally, the step of grouping the text box object set into anchor box objects and target search boxes according to a preset retrieval strategy, and constructing each target search box for the medical invoice based on the anchor box objects and the target search boxes, includes:
[0013] According to the preset retrieval strategy, text box objects belonging to the preset numeric unit type in the text box object set are set as anchor box objects, and text box objects belonging to the preset uppercase numeric type are set as docking box objects.
[0014] Select the anchor box object that matches the preset relative position template in the search strategy and the box object to be docked to form a primary target search box;
[0015] Identify the object type of the anchor box object in the primary target search box, retrieve the box size configuration table in the search strategy according to the object type to obtain box size parameter information, and expand the primary target search box according to the box size parameter information to obtain the target search box.
[0016] Optionally, the object type for identifying the anchor box object in the primary target search box includes:
[0017] Retrieve the text content from the anchor box object;
[0018] Based on the retrieval strategy, determine whether the text content is a preset first-level numerical unit;
[0019] When the text content is a first-level number unit, the object type of the anchor box object is determined to be a first-level anchor box;
[0020] When the text content is not a first-level number unit, the object type of the anchor box object is determined to be a second-level anchor box.
[0021] Optionally, the units of the first-level anchor boxes in the number unit type include ten thousand, yuan, jiao and fen, the units of the second-level anchor boxes include thousand, hundred and ten, and the uppercase number type includes uppercase numbers from zero to nine.
[0022] Optionally, before proceeding with the preset retrieval strategy, the method further includes:
[0023] Based on the number of repetitions, the number unit that appears once in the medical invoice is set as the first-level number unit, and the number unit that appears multiple times in the medical invoice is set as the second-level number unit, thus obtaining the first strategy;
[0024] Configure a first extended parameter for the frame size of the two units, ten thousand and yuan, in the digital units, and configure a second extended parameter for the frame size of the other units besides the ten thousand and yuan units to obtain a frame size configuration table;
[0025] Construct a relative position template based on the reading rules of the object to be docked to the left of the anchor point object;
[0026] A retrieval strategy is constructed using the first strategy, the frame size configuration table, and the relative position template.
[0027] To address the aforementioned problems, the present invention also provides a device for connecting uppercase numbers on medical invoices, the device comprising:
[0028] The uppercase numeric text detection module is used to perform uppercase numeric text detection on pre-built medical invoices and obtain a collection of text box objects;
[0029] Anchor point and docking box recognition module is used to group the set of text box objects into anchor point box objects and docking box objects according to a preset retrieval strategy, and to construct each target search box of the medical invoice according to the anchor point box objects and docking box objects.
[0030] The scattered text number recognition module is used to identify the object type of the anchor box object in each of the target search boxes, and when the object type of the anchor box object in the target search box is a first-level anchor box, to perform a second text retrieval on the target search box to obtain a candidate combined text box, and when the object type of the anchor box object in the target search box is a second-level anchor box, to perform a text retrieval on the target search box to obtain a candidate text box.
[0031] The uppercase number concatenation module is used to sort and concatenate each of the candidate combined text boxes and each of the candidate text boxes according to the coordinate information of the candidate combined text boxes and the candidate text boxes, so as to obtain the uppercase number concatenation result.
[0032] Optionally, the step of grouping the text box object set into anchor box objects and target search boxes according to a preset retrieval strategy, and constructing each target search box for the medical invoice based on the anchor box objects and the target search boxes, includes:
[0033] According to the preset retrieval strategy, text box objects belonging to the preset numeric unit type in the text box object set are set as anchor box objects, and text box objects belonging to the preset uppercase numeric type are set as docking box objects.
[0034] Select the anchor box object that matches the preset relative position template in the search strategy and the box object to be docked to form a primary target search box;
[0035] Identify the object type of the anchor box object in the primary target search box, retrieve the box size configuration table in the search strategy according to the object type to obtain box size parameter information, and expand the primary target search box according to the box size parameter information to obtain the target search box.
[0036] Optionally, the object type for identifying the anchor box object in the primary target search box includes:
[0037] Retrieve the text content from the anchor box object;
[0038] Based on the retrieval strategy, determine whether the text content is a preset first-level numerical unit;
[0039] When the text content is a first-level number unit, the object type of the anchor box object is determined to be a first-level anchor box;
[0040] When the text content is not a first-level number unit, the object type of the anchor box object is determined to be a second-level anchor box.
[0041] To address the above problems, the present invention also provides an electronic device, the electronic device comprising:
[0042] At least one processor; and,
[0043] A memory communicatively connected to the at least one processor; wherein,
[0044] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the above-described method for connecting uppercase numbers to medical invoices.
[0045] To address the aforementioned problems, the present invention also provides a computer-readable storage medium storing at least one computer program, which is executed by a processor in an electronic device to implement the above-described method for connecting uppercase numbers on medical invoices.
[0046] This invention first performs document detection on the uppercase digits in medical invoices to obtain a set of text box objects, where each text box object contains coordinate position information and its own text content. Then, it classifies each text box object according to a preset detection strategy to obtain anchor box objects and matching box objects. The anchor box objects refer to numerical units such as ten thousand, thousand, and hundred, while the matching box objects are uppercase digits from zero to nine. Then, a target search box is constructed according to the object type of the anchor box object and its positional relationship with adjacent matching box objects. The target text box can effectively identify fragmented numerical text, obtaining various candidate text boxes or candidate combination text boxes, which are then concatenated according to coordinate relationships to obtain the uppercase digit concatenation result. Therefore, this invention provides a method, device, equipment, and storage medium for matching uppercase digits on medical invoices, which can improve the accuracy of matching printed and digital digits in various medical invoice recognition processes. Attached Figure Description
[0047] Figure 1 This is a flowchart illustrating a method for connecting uppercase numbers on medical invoices according to an embodiment of the present invention.
[0048] Figure 2 This is a detailed flowchart illustrating one step of a method for connecting uppercase numbers on medical invoices according to an embodiment of the present invention.
[0049] Figure 3 This is a detailed flowchart illustrating one step of a method for connecting uppercase numbers on medical invoices according to an embodiment of the present invention.
[0050] Figure 4 This is a functional block diagram of a medical invoice-based uppercase number docking device provided in an embodiment of the present invention;
[0051] Figure 5 This is a schematic diagram of the structure of an electronic device that implements the method for connecting uppercase numbers based on medical invoices, according to an embodiment of the present invention.
[0052] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0053] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0054] This application provides a method for connecting uppercase numbers based on medical invoices. In this application, the executing entity of the method for connecting uppercase numbers based on medical invoices includes, but is not limited to, at least one of the following electronic devices that can be configured to execute the method provided in this application: a server, a terminal, etc. In other words, the method for connecting uppercase numbers based on medical invoices can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes, but is not limited to, a single server, a server cluster, a cloud server, or a cloud server cluster. The server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0055] Reference Figure 1 The diagram shown is a flowchart illustrating a method for connecting uppercase numbers on medical invoices according to an embodiment of the present invention. In this embodiment, the method includes steps S1 to S6:
[0056] S1. Perform uppercase numeric text detection on the pre-built medical invoice to obtain a collection of text box objects.
[0057] This invention first performs full-text detection on the medical invoice based on uppercase numbers to obtain multiple text objects, each of which contains location coordinate information and text content information. This invention can find the position in the medical invoice used to fill in the amount through a single location clustering, delete the scattered numbers in other parts, and select the remaining numerical text to obtain a set of text box objects.
[0058] S2. According to the preset retrieval strategy, the set of text box objects is grouped into anchor box objects and boxes to be matched, and each target search box of the medical invoice is constructed according to the anchor box objects and the boxes to be matched.
[0059] In this embodiment of the invention, if it is desired to append each uppercase digit to its corresponding numerical unit, then the numerical units such as ten thousand, thousand, hundred, ten, yuan, jiao, and fen in the medical invoice can be used as anchor points to construct anchor point boxes, and the uppercase digits such as zero, one, two, ..., nine can be used as boxes to be connected. Then, a target search box can be constructed based on the object type of the anchor point box object or the positional relationship of adjacent boxes to be connected.
[0060] In detail, in this embodiment of the invention, the operation of S2 includes steps S21 to S23:
[0061] S21. According to the preset retrieval strategy, set the text box objects belonging to the preset number unit type in the text box object set as anchor box objects, and set the text box objects belonging to the preset uppercase number type as docking box objects.
[0062] S22. Select the anchor box objects that conform to the preset relative position template in the search strategy and the box objects to be docked to form a primary target search box;
[0063] S23. Identify the object type of the anchor box object in the primary target search box, retrieve the box size configuration table in the search strategy according to the object type, obtain the box size parameter information, and expand the primary target search box according to the box size parameter information to obtain the target search box.
[0064] In this embodiment of the invention, the retrieval strategy is a method for identifying fragmented digital text and then concatenating it according to coordinates. It includes a first strategy, a frame size configuration table, and a relative position template. The first strategy refers to a method for further dividing numerical units based on their frequency of occurrence. The frame size configuration table is a configuration table for configuring the frame size of each anchor point. The relative position template is a reading rule for reading from left to right.
[0065] Specifically, in this embodiment of the invention, identifying the object type of the anchor box object in the primary target search box includes: obtaining the text content in the anchor box object; determining whether the text content is a preset first-level numerical unit according to the retrieval strategy; when the text content is the first-level numerical unit, determining that the object type of the anchor box object is a first-level anchor box; when the text content is not the first-level numerical unit, determining that the object type of the anchor box object is a second-level anchor box.
[0066] Furthermore, the method for constructing a retrieval strategy in this embodiment of the invention includes steps S201 to S204:
[0067] S201. Based on the number of repetitions, set the number unit that appears once in the medical invoice as the first-level number unit, and set the number unit that appears multiple times in the medical invoice as the second-level number unit, thus obtaining the first strategy;
[0068] S202. Configure the frame size first extension parameter for the two units of ten thousand and yuan in the digital units, and configure the frame size second extension parameter for the other units of the digital units other than the two units of ten thousand and yuan, to obtain the frame size configuration table;
[0069] S203. Based on the reading rules of the object to be docked to the left of the anchor point object, construct a relative position template;
[0070] S204. Construct a retrieval strategy using the first strategy, the frame size configuration table, and the relative position template.
[0071] In this embodiment of the invention, the units for the RMB amount in words on the medical invoice are ten thousand, thousand, hundred, ten, yuan, jiao, and fen. Among them, thousand, hundred, and ten may appear once or twice. In order to better locate these three units, the present invention divides the above units into two levels: the first level units are ten thousand, yuan, jiao, and fen, and the second level units are thousand, hundred, and ten.
[0072] Then, when locating the primary unit and searching for the text box within the target box corresponding to the primary unit, this invention, according to the box size configuration table, makes the template target search box corresponding to "ten thousand" and "yuan" larger, covering the subsequent "thousand" and its digits. This allows for the identification of anchor points with fixed positions such as "ten thousand" and "yuan" while also identifying anchor points with uncertain positions such as "thousand," increasing the correlation between preceding and following anchor points and ensuring the accuracy of the subsequent splicing process.
[0073] Furthermore, according to the reading rules, this embodiment of the invention also constructs a template of the relative position of the object to be docked to the left of the anchor point object, which facilitates the selection of the left side of each anchor point object to find the corresponding uppercase number.
[0074] S3. Identify the object type of the anchor box object in each of the target search boxes.
[0075] In this embodiment of the invention, since the target search box will have different size ranges due to the different object types of the anchor box objects, it is necessary to classify and identify it before retrieving text content.
[0076] When the object type of the anchor box object in the target search box is a first-level anchor box, S4, perform a second text search on the target search box to obtain candidate combined text boxes.
[0077] In this embodiment of the invention, the primary anchor box includes ten thousand, yuan, jiao, and fen. According to the box size configuration table, the primary anchor box should be larger to cover thousands and related numbers. For example, taking the ten thousand anchor box as an example, the target search box includes the ten thousand anchor box object, the one-to-be-matched box object, the seven-character text box, and the thousand-character text box. Therefore, after retrieving the ten thousand anchor box object and the one-to-be-matched box object, a secondary search is required. The seven-character text box and the thousand-character text box are used as the match object and anchor box object, respectively, to search for text content, ultimately forming a candidate combination text box for ten thousand seven thousand.
[0078] When the object type of the anchor box object in the target search box is a secondary anchor box, S5, perform text retrieval on the target search box to obtain candidate text boxes.
[0079] In an embodiment of the present invention, when the object type is a secondary anchor box, and the anchor box object is a numerical unit such as thousand, hundred, and ten, text search can be directly performed to obtain candidate text boxes such as zero hundred and twenty.
[0080] S6. According to the coordinate information of the candidate combined text boxes and the candidate text boxes, sort and splice each of the candidate combined text boxes and each of the candidate text boxes to obtain a capitalized number splicing result.
[0081] In an embodiment of the present invention, each candidate combined text box of seventeen thousand is spliced with each candidate text box of seven thousand, zero hundred, and twenty from left to right according to the coordinates to obtain a capitalized number splicing result of "zero ten seventeen thousand zero hundred twenty-eight yuan eighty-eight cents".
[0082] In addition, in an embodiment of the present invention, it is also possible to sort according to the left-right order of the text box coordinates, and take the upper left coordinate of the leftmost text box object and the lower right coordinate of the rightmost text box object as the spliced large text box, which is used as the recognizable area for subsequent verification and recognition.
[0083] In an embodiment of the present invention, the present invention first performs document detection on the capitalized numbers in the medical invoice to obtain a set of text box objects, where each text box object includes coordinate position information and its own text content; then classifies each text box object through a preset detection strategy to obtain anchor box objects and to-be-docked box objects, where the anchor box object refers to numerical units such as ten thousand, thousand, and hundred, and the to-be-docked box object is the capitalized number from zero to nine; then constructs a target search box according to the object type of the anchor box object and the positional relationship with the adjacent to-be-docked box objects; among them, the target text box can well recognize fragmented digital texts, obtain each candidate text box or candidate combined text box, and then splice according to the coordinate relationship to obtain a capitalized number splicing result. Therefore, a method for docking capitalized numbers based on medical invoices provided by an embodiment of the present invention can improve the accuracy of recognizing and docking printed and typed numbers in invoices during the recognition of various medical invoices.
[0084] As Figure 4 shown, it is a functional module diagram of a device for docking capitalized numbers based on medical invoices provided by an embodiment of the present invention.
[0085] The uppercase digit matching device 100 based on medical invoices described in this invention can be installed in an electronic device. Depending on the functions implemented, the uppercase digit matching device 100 may include an uppercase digit text detection module 101, an anchor point and matching box recognition module 102, a scattered text digit recognition module 103, and an uppercase digit splicing module 104. The module described in this invention can also be called a unit, referring to a series of computer program segments that can be executed by the processor of an electronic device and perform a fixed function, stored in the memory of the electronic device.
[0086] In this embodiment, the functions of each module / unit are as follows:
[0087] The uppercase numeric text detection module 101 is used to perform uppercase numeric text detection on the pre-constructed medical invoice to obtain a set of text box objects;
[0088] The anchor point and docking box recognition module 102 is used to group the text box object set into anchor point box objects and docking box objects according to a preset retrieval strategy, and construct each target search box of the medical invoice according to the anchor point box objects and docking box objects.
[0089] The scattered text number recognition module 103 is used to identify the object type of the anchor box object in each of the target search boxes, and when the object type of the anchor box object in the target search box is a first-level anchor box, to perform a second text retrieval on the target search box to obtain a candidate combined text box, and when the object type of the anchor box object in the target search box is a second-level anchor box, to perform a text retrieval on the target search box to obtain a candidate text box.
[0090] The uppercase number splicing module 104 is used to sort and splice each of the candidate combined text boxes and each of the candidate text boxes according to the coordinate information of the candidate combined text boxes and the candidate text boxes, so as to obtain the uppercase number splicing result.
[0091] In detail, the modules in the uppercase number docking device 100 based on medical invoices described in this application embodiment adopt the same approach as described above when in use. Figures 1 to 3 The method described above uses the same technical means as the method for connecting uppercase numbers on medical invoices and can produce the same technical effect, so it will not be repeated here.
[0092] like Figure 5 The diagram shown is a structural schematic of an electronic device 1 that implements a method for connecting uppercase numbers based on medical invoices, according to an embodiment of the present invention.
[0093] The electronic device 1 may include a processor 10, a memory 11, a communication bus 12, and a communication interface 13. It may also include a computer program stored in the memory 11 and capable of running on the processor 10, such as a program for connecting uppercase numbers based on medical invoices.
[0094] In some embodiments, the processor 10 may be composed of integrated circuits, such as a single packaged integrated circuit or multiple integrated circuits with the same or different functions, including combinations of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. The processor 10 is the control unit of the electronic device 1, connecting various components of the electronic device through various interfaces and lines. It executes programs or modules stored in the memory 11 (e.g., executing a program for interfacing with uppercase numbers on medical invoices) and calls data stored in the memory 11 to perform various functions and process data within the electronic device.
[0095] The memory 11 includes at least one type of readable storage medium, including flash memory, portable hard drive, multimedia card, card-type memory (e.g., SD or DX memory), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 11 can be an internal storage unit of an electronic device, such as a portable hard drive. In other embodiments, the memory 11 can be an external storage device of the electronic device, such as a plug-in portable hard drive, Smart Media Card (SMC), Secure Digital (SD) card, Flash Card, etc. Furthermore, the memory 11 can include both internal and external storage units of the electronic device. The memory 11 can be used not only to store application software and various types of data installed on the electronic device, such as code for a medical invoice-based uppercase number interface program, but also to temporarily store data that has been output or will be output.
[0096] The communication bus 12 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be divided into an address bus, a data bus, a control bus, etc. The bus is configured to enable communication between the memory 11 and at least one processor 10, etc.
[0097] The communication interface 13 is used for communication between the electronic device 1 and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a Wi-Fi interface, Bluetooth interface, etc.), typically used to establish communication connections between the electronic device and other electronic devices. The user interface may be a display, an input unit (such as a keyboard), or, optionally, a standard wired or wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen, etc. The display may also be appropriately referred to as a screen or display unit, used to display information processed in the electronic device and to display a visual user interface.
[0098] Figure 5 Only electronic devices with components are shown; it will be understood by those skilled in the art that... Figure 5 The structure shown does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown, or combine certain components, or have different component arrangements.
[0099] For example, although not shown, the electronic device 1 may also include a power supply (such as a battery) to power various components. Preferably, the power supply can be logically connected to the at least one processor 10 through a power management device, thereby enabling functions such as charging management, discharging management, and power consumption management. The power supply may also include one or more DC or AC power supplies, recharging devices, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The electronic device 1 may also include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be described in detail here.
[0100] It should be understood that the embodiments described are for illustrative purposes only and are not limited to this structure in the scope of the patent application.
[0101] The memory 11 in the electronic device 1 stores a program for handling uppercase numbers based on medical invoices. This program is a combination of multiple instructions, which, when run in the processor 10, can achieve the following:
[0102] Perform uppercase numeric text detection on pre-built medical invoices to obtain a collection of text box objects;
[0103] According to the preset retrieval strategy, the set of text box objects is grouped into anchor box objects and boxes to be matched, and each target search box of the medical invoice is constructed based on the anchor box objects and the boxes to be matched.
[0104] Identify the object type of the anchor box object in each of the target search boxes;
[0105] When the object type of the anchor box object in the target search box is a first-level anchor box, a second text search is performed on the target search box to obtain the candidate combined text boxes;
[0106] When the object type of the anchor box object in the target search box is a second-level anchor box, text retrieval is performed on the target search box to obtain candidate text boxes;
[0107] Based on the coordinate information of the candidate text boxes and the candidate text boxes, the candidate text boxes and the candidate text boxes are sorted and concatenated to obtain the uppercase number concatenation result.
[0108] Specifically, the specific implementation method of the processor 10 for the above instructions can be referred to the description of the relevant steps in the corresponding embodiment of the accompanying drawings, and will not be repeated here.
[0109] Furthermore, if the modules / units integrated in the electronic device 1 are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, or a read-only memory (ROM).
[0110] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor of an electronic device, can perform the following:
[0111] Perform uppercase numeric text detection on pre-built medical invoices to obtain a collection of text box objects;
[0112] According to the preset retrieval strategy, the set of text box objects is grouped into anchor box objects and boxes to be matched, and each target search box of the medical invoice is constructed based on the anchor box objects and the boxes to be matched.
[0113] Identify the object type of the anchor box object in each of the target search boxes;
[0114] When the object type of the anchor box object in the target search box is a first-level anchor box, a second text search is performed on the target search box to obtain the candidate combined text boxes;
[0115] When the object type of the anchor box object in the target search box is a second-level anchor box, text retrieval is performed on the target search box to obtain candidate text boxes;
[0116] Based on the coordinate information of the candidate text boxes and the candidate text boxes, the candidate text boxes and the candidate text boxes are sorted and concatenated to obtain the uppercase number concatenation result.
[0117] In the several embodiments provided by this invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and other division methods may be used in actual implementation.
[0118] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0119] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional modules.
[0120] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0121] Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be embraced within the invention. No appended diagram markings in the claims should be construed as limiting the scope of the claims.
[0122] The blockchain referred to in this invention is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Essentially, a blockchain is a decentralized database, a chain of data blocks linked together using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block. A blockchain can include an underlying blockchain platform, a platform product service layer, and an application service layer.
[0123] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.
[0124] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in a system claim may also be implemented by a single unit or device through software or hardware. The terms "first," "second," etc., are used to indicate names and do not indicate any specific order.
[0125] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.
Claims
1. A method for connecting uppercase numbers on medical invoices, characterized in that, The method includes: Perform uppercase numeric text detection on pre-built medical invoices to obtain a collection of text box objects; The first strategy is to set the number unit that appears once in the medical invoice as the first-level number unit and the number unit that appears multiple times in the medical invoice as the second-level number unit. A first extended parameter for the frame size is configured for the units of ten thousand and yuan in the digital units, and a second extended parameter for the frame size is configured for the other units of the digital units excluding the units of ten thousand and yuan, to obtain a frame size configuration table, wherein the first extended parameter for the frame size is greater than the second extended parameter for the frame size; Construct a relative position template based on the pre-defined reading rules for the left side of the anchor point box object of the object to be docked; A retrieval strategy is constructed using the first strategy, the box size configuration table, and the relative position template. Based on the retrieval strategy, the set of text box objects is grouped into anchor box objects and boxes to be matched. Based on the anchor box objects and the boxes to be matched, each target search box of the medical invoice is constructed. Identify the object type of the anchor box object in each of the target search boxes; When the object type of the anchor box object in the target search box is a first-level anchor box, a second text search is performed on the target search box to obtain the candidate combined text boxes; When the object type of the anchor box object in the target search box is a second-level anchor box, text retrieval is performed on the target search box to obtain candidate text boxes; Based on the coordinate information of the candidate text boxes and the candidate text boxes, the candidate text boxes and the candidate text boxes are sorted and concatenated to obtain the uppercase number concatenation result.
2. The method for connecting uppercase numbers on medical invoices as described in claim 1, characterized in that, According to a preset retrieval strategy, the set of text box objects is grouped into anchor box objects and target search boxes, and based on the anchor box objects and the target search boxes, various target search boxes for the medical invoice are constructed, including: According to the preset retrieval strategy, text box objects belonging to the preset numeric unit type in the text box object set are set as anchor box objects, and text box objects belonging to the preset uppercase numeric type are set as docking box objects. Select the anchor box object that matches the preset relative position template in the search strategy and the box object to be docked to form a primary target search box; Identify the object type of the anchor box object in the primary target search box, retrieve the box size configuration table in the search strategy according to the object type to obtain box size parameter information, and expand the primary target search box according to the box size parameter information to obtain the target search box.
3. The method for connecting uppercase numbers on medical invoices as described in claim 2, characterized in that, The object type for identifying the anchor box object in the primary target search box includes: Retrieve the text content from the anchor box object; Based on the retrieval strategy, determine whether the text content is a preset first-level numerical unit; When the text content is a first-level number unit, the object type of the anchor box object is determined to be a first-level anchor box; When the text content is not a first-level number unit, the object type of the anchor box object is determined to be a second-level anchor box.
4. The method for connecting uppercase numbers on medical invoices as described in any one of claims 1 to 3, characterized in that, The units in the first-level anchor boxes of the digital unit type include ten thousand, yuan, jiao and fen; the units in the second-level anchor boxes include thousand, hundred and ten; and the uppercase number type includes uppercase numbers from zero to nine.
5. A device for connecting uppercase numbers on medical invoices, characterized in that, The device includes: The uppercase numeric text detection module is used to perform uppercase numeric text detection on pre-built medical invoices and obtain a collection of text box objects; An anchor point and target box recognition module is used to set the numerical unit appearing once in the medical invoice as a first-level numerical unit and the numerical unit appearing multiple times in the medical invoice as a second-level numerical unit, thus obtaining a first strategy; configure a first expansion parameter for the box size of the units of ten thousand and yuan, and configure a second expansion parameter for the box size of the other numerical units besides the units of ten thousand and yuan, thus obtaining a box size configuration table, wherein the first expansion parameter for the box size is greater than the second expansion parameter for the box size; construct a relative position template according to a preset reading rule for the target box object to the left of the anchor point box object; construct a retrieval strategy using the first strategy, the box size configuration table, and the relative position template, wherein the first expansion parameter for the box size is greater than the second expansion parameter for the box size; group the set of text box objects into anchor point box objects and target box objects according to the retrieval strategy; and construct each target search box of the medical invoice according to the anchor point box objects and the target box objects. The scattered text number recognition module is used to identify the object type of the anchor box object in each of the target search boxes, and when the object type of the anchor box object in the target search box is a first-level anchor box, to perform a second text retrieval on the target search box to obtain a candidate combined text box, and when the object type of the anchor box object in the target search box is a second-level anchor box, to perform a text retrieval on the target search box to obtain a candidate text box. The uppercase number concatenation module is used to sort and concatenate each of the candidate combined text boxes and each of the candidate text boxes according to the coordinate information of the candidate combined text boxes and the candidate text boxes, so as to obtain the uppercase number concatenation result.
6. The uppercase number docking device based on medical invoices as described in claim 5, characterized in that, According to a preset retrieval strategy, the set of text box objects is grouped into anchor box objects and target search boxes, and based on the anchor box objects and the target search boxes, various target search boxes for the medical invoice are constructed, including: According to the preset retrieval strategy, text box objects belonging to the preset numeric unit type in the text box object set are set as anchor box objects, and text box objects belonging to the preset uppercase numeric type are set as docking box objects. Select the anchor box object that matches the preset relative position template in the search strategy and the box object to be docked to form a primary target search box; Identify the object type of the anchor box object in the primary target search box, retrieve the box size configuration table in the search strategy according to the object type to obtain box size parameter information, and expand the primary target search box according to the box size parameter information to obtain the target search box.
7. The uppercase number docking device based on medical invoices as described in claim 6, characterized in that, The object type for identifying the anchor box object in the primary target search box includes: Retrieve the text content from the anchor box object; Based on the retrieval strategy, determine whether the text content is a preset first-level numerical unit; When the text content is a first-level number unit, the object type of the anchor box object is determined to be a first-level anchor box; When the text content is not a first-level number unit, the object type of the anchor box object is determined to be a second-level anchor box.
8. An electronic device, characterized in that, The electronic device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that is executed by the at least one processor to enable the at least one processor to perform the uppercase number matching method for medical invoices as described in any one of claims 1 to 4.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the method for connecting uppercase numbers based on medical invoices as described in any one of claims 1 to 4.