[go: up one dir, main page]

CN113469005B - Bank receipt identification method, related device and storage medium - Google Patents

Bank receipt identification method, related device and storage medium Download PDF

Info

Publication number
CN113469005B
CN113469005B CN202110706242.2A CN202110706242A CN113469005B CN 113469005 B CN113469005 B CN 113469005B CN 202110706242 A CN202110706242 A CN 202110706242A CN 113469005 B CN113469005 B CN 113469005B
Authority
CN
China
Prior art keywords
text
payment
distance
receipt
field information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110706242.2A
Other languages
Chinese (zh)
Other versions
CN113469005A (en
Inventor
吕海峰
宁可
胡志成
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Kingdee Software China Co Ltd
Original Assignee
Kingdee Software China Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Kingdee Software China Co Ltd filed Critical Kingdee Software China Co Ltd
Priority to CN202110706242.2A priority Critical patent/CN113469005B/en
Publication of CN113469005A publication Critical patent/CN113469005A/en
Application granted granted Critical
Publication of CN113469005B publication Critical patent/CN113469005B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/31Indexing; Data structures therefor; Storage structures
    • G06F16/316Indexing structures

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Character Input (AREA)

Abstract

本申请实施例公开了一种银行回单的识别方法,用于提高银行回单的识别效率。本申请实施例方法包括:获取待识别的银行回单图像;对银行回单图像进行识别,得到N个文本块,每个文本块包括对应的文本内容、索引和位置信息;根据N个文本块的索引和位置信息,对N个文本块进行拼接,得到目标文本块;采用自然语言处理技术对目标文本块进行识别,得到固定字段信息和收付款字段信息,并确定收付款字段信息的收付款方向。通过上述方式,在识别银行回单图像的过程中,不需要针对各个不同的银行回单格式进行定制识别模板,该识别方法可以适用于各种不同的银行回单格式,提高了银行回单的识别效率。

The embodiment of the present application discloses a bank receipt recognition method for improving the recognition efficiency of bank receipts. The embodiment of the present application method includes: obtaining a bank receipt image to be recognized; recognizing the bank receipt image to obtain N text blocks, each text block including corresponding text content, index and position information; splicing the N text blocks according to the index and position information of the N text blocks to obtain a target text block; using natural language processing technology to recognize the target text block to obtain fixed field information and payment field information, and determining the payment direction of the payment field information. Through the above method, in the process of recognizing the bank receipt image, there is no need to customize the recognition template for each different bank receipt format. The recognition method can be applied to various different bank receipt formats, thereby improving the recognition efficiency of the bank receipt.

Description

一种银行回单的识别方法、相关装置及存储介质A bank receipt identification method, related device and storage medium

技术领域Technical Field

本申请涉及计算机技术领域,尤其涉及一种银行回单的识别方法、相关装置及存储介质。The present application relates to the field of computer technology, and in particular to a bank receipt recognition method, related devices and storage media.

背景技术Background Art

银行回单是企业编制记账凭证的原始依据,企业在收付款时都会有相应的回单作为证明。回单的内容主要包括日期、编号、户名、账号、币种以及金额等详细信息,每一笔均有回单记录。因此在企业的资金管理中会处理大量的银行回单。The bank receipt is the original basis for the company to prepare accounting vouchers. The company will have a corresponding receipt as proof when receiving or paying. The content of the receipt mainly includes detailed information such as date, number, account name, account number, currency and amount. Each transaction is recorded in the receipt. Therefore, a large number of bank receipts will be processed in the company's fund management.

近年来,随着移动设备的快速更新迭代,以及移动互联网的快速发展,使得OCR有更为广泛的应用场景,如银行回单扫描文件的文字识别。其可以在银行回单等应用场景中,实现上传图片自动识别银行回单的日期、账号等关键信息,方便企业出纳人员进行回单信息核对及录入,提高工作效率。In recent years, with the rapid update and iteration of mobile devices and the rapid development of mobile Internet, OCR has a wider range of application scenarios, such as text recognition of scanned bank receipts. In application scenarios such as bank receipts, it can automatically recognize key information such as the date and account number of the bank receipt by uploading pictures, making it convenient for corporate cashiers to check and enter receipt information and improve work efficiency.

传统的银行回单OCR识别方法往往依赖于识别的对象的特点,需要进行银行回单个性化的模板定制。但是不同银行的回单格式不统一,并且即便同一个银行也会存在回单格式不统一的问题,这就需要定制大量的银行回单模板。因此,每种不同类型的银行回单,都需要采用对应的定制模板,才能够进行识别文本信息,识别效率较低。Traditional bank receipt OCR recognition methods often rely on the characteristics of the object to be recognized, and require customized templates for bank receipts. However, the receipt formats of different banks are not uniform, and even the same bank may have inconsistent receipt formats, which requires the customization of a large number of bank receipt templates. Therefore, each different type of bank receipt requires a corresponding customized template to recognize text information, and the recognition efficiency is low.

发明内容Summary of the invention

有鉴于此,本申请提供一种银行回单的识别方法,用于提高银行回单的识别效率。In view of this, the present application provides a bank receipt recognition method for improving the recognition efficiency of bank receipts.

本申请一方面提供一种银行回单的识别方法,包括:On one hand, the present application provides a method for identifying a bank receipt, comprising:

获取待识别的银行回单图像;Obtain the bank receipt image to be identified;

对所述银行回单图像进行识别,得到N个文本块,每个所述文本块包括对应的文本内容、索引和位置信息;Recognize the bank receipt image to obtain N text blocks, each of which includes corresponding text content, index and position information;

根据所述N个文本块的索引和位置信息,对所述N个文本块进行拼接,得到目标文本块;splicing the N text blocks according to the indexes and position information of the N text blocks to obtain a target text block;

采用自然语言处理技术对所述目标文本块进行识别,得到固定字段信息和收付款字段信息,并确定所述收付款字段信息的收付款方向。The target text block is identified by using natural language processing technology to obtain fixed field information and payment field information, and the payment direction of the payment field information is determined.

在一种可能的实现方式中,所述确定所述收付款字段信息的收付款方向之后,所述方法还包括:In a possible implementation, after determining the payment direction of the payment field information, the method further includes:

获取所述收付款字段信息中,待识别收付款方向的字段信息;Obtaining the field information of the payment direction to be identified in the payment field information;

获取所述待识别收付款方向的字段信息对应的目标位置信息;Obtaining target location information corresponding to the field information of the payment direction to be identified;

获取所述收付款字段信息中,已识别收付款方向的字段信息;Obtaining the field information of the payment and receipt field information, in which the payment and receipt direction has been identified;

获取所述已识别收付款方向的字段信息中,收款方向对应的第一位置信息和付款方向对应的第二位置信息;Obtaining, in the field information of the identified payment and receipt directions, first position information corresponding to the payment direction and second position information corresponding to the payment direction;

对所述目标位置信息、第一位置信息和第二位置信息进行处理,得到所述待识别收付款方向的字段信息对应的收付款方向。The target location information, the first location information, and the second location information are processed to obtain the payment direction corresponding to the field information of the payment direction to be identified.

在一种可能的实现方式中,所述对所述目标位置信息、第一位置信息和第二位置信息进行处理,得到所述目标文本对应的收付款方向包括:In a possible implementation, the processing of the target location information, the first location information, and the second location information to obtain the payment direction corresponding to the target text includes:

计算所述目标位置信息与第一位置信息之间的最小距离,得到第一距离;Calculating the minimum distance between the target location information and the first location information to obtain a first distance;

计算所述目标位置信息与第二位置信息之间的最小距离,得到第二距离;Calculating the minimum distance between the target location information and the second location information to obtain a second distance;

比较所述第一距离和所述第二距离的大小;comparing the first distance and the second distance;

若所述第一距离小于所述第二距离,则确定所述第一距离为目标距离;If the first distance is less than the second distance, determining the first distance as the target distance;

判断所述目标距离是否小于预设阈值;Determine whether the target distance is less than a preset threshold;

若是,则确定所述目标文本属于收款方向;If so, determining that the target text belongs to the collection direction;

若所述第二距离小于所述第一距离,则确定所述第二距离为所述目标距离;If the second distance is smaller than the first distance, determining the second distance as the target distance;

判断所述目标距离是否小于所述预设阈值;Determining whether the target distance is less than the preset threshold;

若是,则确定所述目标文本属于付款方向。If so, it is determined that the target text belongs to the payment direction.

在一种可能的实现方式中,所述确定所述收付款字段信息的收付款方向之后,所述方法还包括:In a possible implementation, after determining the payment direction of the payment field information, the method further includes:

获取所述收付款字段信息中,未识别出收付款方向的字段信息,得到目标文本;Obtaining the field information of the payment and receipt field information, in which the payment and receipt direction is not identified, to obtain the target text;

获取目标文本的目标位置信息;Obtain target position information of target text;

获取所述收付款字段信息的收付款方向中,收款方向对应的第一位置信息和付款方向对应的第二位置信息;Obtaining the first position information corresponding to the payment direction and the second position information corresponding to the payment direction in the payment direction of the payment field information;

对所述目标位置信息、第一位置信息和第二位置信息进行处理,得到所述目标文本对应的收付款方向。The target location information, the first location information and the second location information are processed to obtain the payment direction corresponding to the target text.

在一种可能的实现方式中,所述根据所述N个文本块的索引和位置信息,对所述N个文本块进行拼接包括:In a possible implementation, the step of splicing the N text blocks according to the indexes and position information of the N text blocks includes:

获取所述N个文本块中左索引值为负数的文本块,得到M个第一文本块;Obtain text blocks with negative left index values from the N text blocks to obtain M first text blocks;

确定所述第一文本块中右索引值不为负数的文本块为当前文本块;Determine a text block whose right index value is not a negative number in the first text block as the current text block;

1)判断第二文本块的左索引值与所述当前文本块的当前索引值是否相同,并且,所述第二文本块的当前索引值是否与所述当前文本块的右索引值是否相同,其中,所述第二文本块为所述N个文本块中,除了所述M个第一文本块之外的其他文本块;1) determining whether a left index value of a second text block is the same as a current index value of the current text block, and whether the current index value of the second text block is the same as a right index value of the current text block, wherein the second text block is a text block other than the M first text blocks among the N text blocks;

2)若是,则确定所述第二文本块为新的当前文本块,并重新执行步骤1)至步骤2);2) If yes, determine that the second text block is the new current text block, and re-execute steps 1) to 2);

将步骤1)中的当前文本块与步骤2)中新的当前文本块进行拼接,得到第三文本块;The current text block in step 1) is concatenated with the new current text block in step 2) to obtain a third text block;

获取第四文本块,所述第四文本块为所述N个文本块中,除了所述第三文本块之外的其他文本块;Acquire a fourth text block, where the fourth text block is a text block other than the third text block among the N text blocks;

根据所述第四文本块的位置信息,将所述第四文本块与所述第三文本块进行拼接,得到目标文本块。According to the position information of the fourth text block, the fourth text block is spliced with the third text block to obtain a target text block.

本申请另一方面提供一种银行回单识别装置,包括:On the other hand, the present application provides a bank receipt recognition device, comprising:

获取单元,用于获取待识别的银行回单图像;An acquisition unit, used for acquiring a bank receipt image to be identified;

识别单元,用于对所述银行回单图像进行识别,得到N个文本块,每个所述文本块包括对应的文本内容、索引和位置信息;A recognition unit, used for recognizing the bank receipt image to obtain N text blocks, each of which includes corresponding text content, index and position information;

拼接单元,用于根据所述N个文本块的索引和位置信息,对所述N个文本块进行拼接,得到目标文本块;A splicing unit, used for splicing the N text blocks according to the indexes and position information of the N text blocks to obtain a target text block;

所述识别单元,还用于采用自然语言处理技术对所述目标文本块进行识别,得到固定字段信息和收付款字段信息,并确定所述收付款字段信息的收付款方向。The recognition unit is further used to recognize the target text block using natural language processing technology to obtain fixed field information and payment field information, and determine the payment direction of the payment field information.

在一种可能的实现方式中,所述银行回单识别装置还包括处理单元;In a possible implementation, the bank receipt recognition device further includes a processing unit;

所述获取单元,还用于获取所述收付款字段信息中,待识别收付款方向的字段信息;The acquisition unit is further used to acquire the field information of the payment direction to be identified in the payment field information;

所述获取单元,还用于获取所述待识别收付款方向的字段信息对应的目标位置信息;The acquisition unit is further used to acquire the target location information corresponding to the field information of the to-be-identified payment and receipt direction;

所述获取单元,还用于获取所述收付款字段信息中,已识别收付款方向的字段信息;The acquisition unit is further used to acquire the field information of the payment and receipt field information, which has identified the payment and receipt direction;

所述获取单元,还用于获取所述已识别收付款方向的字段信息中,收款方向对应的第一位置信息和付款方向对应的第二位置信息;The acquisition unit is further used to acquire, in the field information of the identified payment and receipt directions, first position information corresponding to the payment direction and second position information corresponding to the payment direction;

所述处理单元,用于对所述目标位置信息、第一位置信息和第二位置信息进行处理,得到所述待识别收付款方向的字段信息对应的收付款方向。The processing unit is used to process the target location information, the first location information and the second location information to obtain the payment direction corresponding to the field information of the payment direction to be identified.

在一种可能的实现方式中,所述处理单元具体用于:In a possible implementation manner, the processing unit is specifically configured to:

计算所述目标位置信息与第一位置信息之间的最小距离,得到第一距离;Calculating the minimum distance between the target location information and the first location information to obtain a first distance;

计算所述目标位置信息与第二位置信息之间的最小距离,得到第二距离;Calculating the minimum distance between the target location information and the second location information to obtain a second distance;

比较所述第一距离和所述第二距离的大小;comparing the first distance and the second distance;

若所述第一距离小于所述第二距离,则确定所述第一距离为目标距离;If the first distance is less than the second distance, determining the first distance as the target distance;

判断所述目标距离是否小于预设阈值;Determine whether the target distance is less than a preset threshold;

若是,则确定所述待识别收付款方向的字段信息属于收款方向;If yes, it is determined that the field information of the to-be-identified payment and receipt direction belongs to the payment receipt direction;

若所述第二距离小于所述第一距离,则确定所述第二距离为所述目标距离;If the second distance is smaller than the first distance, determining the second distance as the target distance;

判断所述目标距离是否小于所述预设阈值;Determining whether the target distance is less than the preset threshold;

若是,则确定所述待识别收付款方向的字段信息属于付款方向。If so, it is determined that the field information of the payment direction to be identified belongs to the payment direction.

本申请另一方面提供一种计算机设备,包括:存储器、处理器以及总线系统;所述存储器用于存储程序代码;所述处理器用于根据所述程序代码中的指令执行上述任一方面所述的银行回单的识别方法。On the other hand, the present application provides a computer device, including: a memory, a processor and a bus system; the memory is used to store program code; the processor is used to execute the bank receipt identification method described in any of the above aspects according to the instructions in the program code.

本申请另一方面提供一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述任一方面所述的银行回单的识别方法。On the other hand, the present application provides a computer-readable storage medium, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes the bank receipt recognition method described in any of the above aspects.

根据本申请的另一方面,提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行上述任一方面所述的银行回单的识别方法。According to another aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the bank receipt recognition method described in any one of the above aspects.

从以上技术方案可以看出,本申请实施例具有以下优点:获取待识别的银行回单图像;对银行回单图像进行识别,得到N个文本块,每个文本块包括对应的文本内容、索引和位置信息;根据N个文本块的索引和位置信息,对N个文本块进行拼接,得到目标文本块;采用自然语言处理技术对目标文本块进行识别,得到固定字段信息和收付款字段信息,并确定收付款字段信息的收付款方向。通过上述方式,在识别银行回单图像的过程中,不需要针对各个不同的银行回单格式进行定制识别模板,该识别方法可以适用于各种不同的银行回单格式,提高了银行回单的识别效率。It can be seen from the above technical scheme that the embodiment of the present application has the following advantages: obtaining a bank receipt image to be identified; identifying the bank receipt image to obtain N text blocks, each text block including corresponding text content, index and location information; splicing the N text blocks according to the index and location information of the N text blocks to obtain a target text block; using natural language processing technology to identify the target text block, obtaining fixed field information and payment field information, and determining the payment direction of the payment field information. In the above manner, in the process of identifying the bank receipt image, there is no need to customize the recognition template for each different bank receipt format. The recognition method can be applied to various different bank receipt formats, thereby improving the recognition efficiency of the bank receipt.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

图1为本申请实施例提供的一种银行回单的识别方法的流程图;FIG1 is a flow chart of a bank receipt recognition method provided in an embodiment of the present application;

图2为本申请实施例中对银行回单图像进行识别,得到N个文本块的流程图;FIG2 is a flow chart of recognizing a bank receipt image to obtain N text blocks in an embodiment of the present application;

图3为本申请实施例中对N个文本块进行拼接,得到目标文本块的流程示意图FIG. 3 is a schematic diagram of a process of splicing N text blocks to obtain a target text block in an embodiment of the present application.

图4为本申请实施例中一种银行回单图像的示例图;FIG4 is an example diagram of a bank receipt image in an embodiment of the present application;

图5A为本申请实施例中一种文本块的示意图;FIG5A is a schematic diagram of a text block in an embodiment of the present application;

图5B为本申请实施例中另一种文本块的示意图;FIG5B is a schematic diagram of another text block in an embodiment of the present application;

图6A为本申请实施例中DATA1部分数据块处理过程的示意图;FIG6A is a schematic diagram of a processing process of a portion of a data block DATA1 in an embodiment of the present application;

图6B为本申请实施例中DATA2部分数据块处理过程的示意图;FIG6B is a schematic diagram of a processing process of a portion of data blocks DATA2 in an embodiment of the present application;

图7为本申请实施例中一种存在待识别收付款方向的字段信息的场景示意图;FIG. 7 is a schematic diagram of a scenario in which field information of a payment direction to be identified exists in an embodiment of the present application;

图8为本申请实施例提供的一种银行回单识别装置的结构示意图;FIG8 is a schematic diagram of the structure of a bank receipt recognition device provided in an embodiment of the present application;

图9为本申请实施例中计算机设备的一个结构示意图。FIG. 9 is a schematic diagram of the structure of a computer device in an embodiment of the present application.

具体实施方式DETAILED DESCRIPTION

本申请实施例提供了一种银行回单的识别方法,用于提高银行回单的识别效率。The embodiment of the present application provides a bank receipt recognition method for improving the recognition efficiency of bank receipts.

本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”、“第四”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本申请的实施例例如能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“对应于”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein, for example. In addition, the terms "including" and "corresponding to" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

本申请提出了一种访问控制方法,请参阅图1,图1为本申请实施例提供的一种银行回单的识别方法的流程图,本申请实施例包括以下步骤:The present application proposes an access control method. Please refer to FIG1 , which is a flow chart of a bank receipt recognition method provided by an embodiment of the present application. The embodiment of the present application includes the following steps:

101、获取待识别的银行回单图像;101. Obtain a bank receipt image to be identified;

本申请实施例中,并不限定银行回单的具体格式,可以针对各个不同格式银行回单,获取对应的银行回单图像,执行本申请所提供的银行回单的识别方法。In the embodiments of the present application, the specific format of the bank receipt is not limited. For each bank receipt in a different format, the corresponding bank receipt image can be obtained and the bank receipt recognition method provided in the present application can be executed.

可选的,在获取待识别的银行回单图像后,为了便于进行后续的识别流程,可以对银行回单图像进行预处理,例如对银行回单图像的分辨率及光照饱和度进行优化。Optionally, after obtaining the bank receipt image to be identified, in order to facilitate the subsequent identification process, the bank receipt image may be preprocessed, for example, the resolution and light saturation of the bank receipt image may be optimized.

102、对银行回单图像进行识别,得到N个文本块,每个文本块包括对应的文本内容、索引和位置信息;102. Recognize the bank receipt image to obtain N text blocks, each of which includes corresponding text content, index and position information;

由步骤101所获取的银行回单图像,包括了银行回单的完整图像信息。由于该银行回单图像所包括的文本信息较多,因此,需要对银行回单图像进行识别,拆分得到N个文本块,其中,每个文本块包括了对应的文本内容、索引和位置信息,每个文本块的索引表示了原始银行回单图像中,该文本块与其他文本块的相对位置,每个文本块的位置信息则表示了该文本块在原始银行回单图像中的绝对位置。The bank receipt image obtained by step 101 includes the complete image information of the bank receipt. Since the bank receipt image includes a lot of text information, it is necessary to identify the bank receipt image and split it into N text blocks, wherein each text block includes corresponding text content, index and position information, the index of each text block indicates the relative position of the text block to other text blocks in the original bank receipt image, and the position information of each text block indicates the absolute position of the text block in the original bank receipt image.

为了便于理解,请参阅图2,图2为本申请实施例中对银行回单图像进行识别,得到N个文本块的流程图,如图2所示,对银行回单图像进行识别,得到N个文本块的流程具体可以包括:For ease of understanding, please refer to FIG. 2 , which is a flow chart of recognizing a bank receipt image to obtain N text blocks in an embodiment of the present application. As shown in FIG. 2 , the process of recognizing a bank receipt image to obtain N text blocks may specifically include:

A1、识别银行回单图像的方向;A1. Identify the direction of the bank receipt image;

对于获取的银行回单往往含有如下情况:拍照随意、背景复杂、文本背景干扰、一张图像含有多张银行回单或回单不完整等情况。可以对银行回单图像进行分割,并将所分割出来的银行回单图像进行识别方向。具体的,可以利用卷积网络模型识别分割后图像的方向,若识别银行回单图像的方向分别为0°、90°、180°或270°时,则识别结果分别为0,1,2,3。若识别结果为0,则确定银行回单图像的方向为正,如果其方向不为正,则旋转校正图像。The acquired bank receipts often contain the following situations: random photography, complex background, text background interference, multiple bank receipts in one image or incomplete receipts. The bank receipt image can be segmented, and the segmented bank receipt image can be identified in direction. Specifically, the convolutional network model can be used to identify the direction of the segmented image. If the direction of the bank receipt image is 0°, 90°, 180° or 270°, the recognition results are 0, 1, 2, and 3 respectively. If the recognition result is 0, the direction of the bank receipt image is determined to be positive. If its direction is not positive, the image is rotated and corrected.

A2、检测银行回单图像中的单行文本图像;A2. Detecting a single line of text in a bank receipt image;

将银行回单图像中的彩色图像变换为灰度图像,然后进行灰度归一化。将图像长宽配置为32的倍数。检测网络采用resnet50作为主干网络,为了得到像素的分类,可以进行四次UpSample,得到输出的图像尺寸为原始图像尺寸的1/2。为了避免相邻行的文本图像粘连,预测输出三个分支,分别预测文本分支,文本边界分支及文本中心分支,通过这三个分支提取文本外接矩形框。将外接矩形框进行仿射变换即可分割出N个单行文本图像,其中N为大于或等于1的整数。The color image in the bank receipt image is transformed into a grayscale image, and then the grayscale is normalized. The image length and width are configured as multiples of 32. The detection network uses resnet50 as the backbone network. In order to obtain the classification of pixels, four UpSamples can be performed to obtain an output image size of 1/2 of the original image size. In order to avoid the adhesion of text images in adjacent rows, three branches are predicted and output, namely the text branch, the text boundary branch and the text center branch. The text enclosed rectangular frame is extracted through these three branches. The enclosed rectangular frame can be affine transformed to segment N single-line text images, where N is an integer greater than or equal to 1.

A3、对单行文本图像进行识别;A3. Recognize single-line text images;

使用resnet50+bilstm+ctc网络结构算法,将切割好的N个单行文本图像的高度配置为32宽度以等比例缩放,然后输入识别网络得到识别结果,得到N个文本内容。Using the resnet50+bilstm+ctc network structure algorithm, the height of the cut N single-line text images is configured to 32 and the width is scaled proportionally, and then input into the recognition network to obtain the recognition results and obtain N text contents.

将每个文本内容按顺序画在原始图像系统尺寸的0图上标记为图像M,文本内容填充像素值为该文本内容的顺序号。文本的左索引为,计算该文本内容的斜率及文本高度,向左侧延伸文本高度的T倍,得到文本框B。在图像M中提取坐标为文本内容B的像素值,统计其中像素值个数最大的像素值即为其索引值。最后输出单行文本图像对应的文本内容、索引和位置信息,即为本申请中的文本块。Draw each text content in sequence on the original image system size 0 map marked as image M, and the text content fill pixel value is the sequence number of the text content. The left index of the text is, calculate the slope of the text content and the text height, extend the text height to the left by T times, and get the text box B. Extract the pixel value of the text content B in the image M, and count the pixel value with the largest number of pixel values as its index value. Finally, output the text content, index and position information corresponding to the single-line text image, which is the text block in this application.

具体的,该银行回单图像经过上述识别流程,可以生成由如下数据结构组成的列表DATA=[item_1,item_2,…,item_n]。其中,该列表DATA则包括了N个文本块,每个文本块可以用item_i表示。索引idx从0开始,其中item_i格式为:Specifically, after the above recognition process, the bank receipt image can generate a list DATA=[item_1, item_2,…, item_n] consisting of the following data structure. The list DATA includes N text blocks, each of which can be represented by item_i. The index idx starts from 0, and the format of item_i is:

下面对item_i结构中的各个字段进行解释:The following is an explanation of the various fields in the item_i structure:

text:识别的文本内容text: the recognized text content

up_idx:item_i数据块的上边数据块对应的索引;up_idx: the index corresponding to the upper data block of item_i data block;

down_idx:item_i数据块下边数据块对应的索引;down_idx: the index of the data block below item_i data block;

left_idx:item_i数据块左边数据块对应的索引;left_idx: the index corresponding to the data block to the left of item_i data block;

right_idx:item_i数据块右边数据块对应的索引;right_idx: the index of the data block to the right of item_i data block;

current_idx:item_i数据块当前索引;current_idx: current index of item_i data block;

point:item_i数据块所在位置信息。point: The location information of item_i data block.

当up_idx、down_idx、left_idx或right_idx索引值为负数时,说明距离间隔超过指定的阈值,比如某个item数据块结构中的left_idx为负数时,说明该数据块左边没有对应的数据块或者间隔太大,不需要进行连接。When the up_idx, down_idx, left_idx or right_idx index value is negative, it means that the distance interval exceeds the specified threshold. For example, when the left_idx in an item data block structure is negative, it means that there is no corresponding data block on the left of the data block or the interval is too large, and no connection is required.

103、根据N个文本块的索引和位置信息,对N个文本块进行拼接,得到目标文本块;103. According to the index and position information of the N text blocks, the N text blocks are spliced to obtain a target text block;

在掌握了每个文本块的索引和位置信息之后,即可以根据每个文本块的索引和位置信息,对所有的N个文本块进行进行拼接,得到目标文本块。After the index and position information of each text block is known, all N text blocks can be spliced according to the index and position information of each text block to obtain the target text block.

例如,现有文本块A为“付款”、文本块B为“1234567890123456(银行卡号)”以及文本块C为“账号”。则可以根据上述各个文本块的索引和位置信息,对文本块A、B和C进行拼接,得到拼接后的目标文本块为“付款账号1234567890123456”。For example, the existing text block A is "payment", the text block B is "1234567890123456 (bank card number)", and the text block C is "account number". Then, according to the index and position information of each of the above text blocks, the text blocks A, B and C can be spliced to obtain the target text block after splicing, which is "payment account number 1234567890123456".

为了便于理解,请参阅图3,图3为本申请实施例中对N个文本块进行拼接,得到目标文本块的流程示意图,如图3所示,具体包括如下步骤:For ease of understanding, please refer to FIG. 3 , which is a schematic diagram of a process of splicing N text blocks to obtain a target text block in an embodiment of the present application. As shown in FIG. 3 , the process specifically includes the following steps:

1031、根据DATA列表中的数据块,筛选出left_idx为负数的数据块列表DATA1,并且对DATA1按DATA的顺序进行排序。分别设置一个文本信息列表text_list和一个位置信息列表point_list。1031. According to the data blocks in the DATA list, filter out the data block list DATA1 whose left_idx is a negative number, and sort DATA1 according to the order of DATA. Set a text information list text_list and a position information list point_list respectively.

1032、循坏处理DATA1列表中的每一个数据块;1032. Cycle through each data block in the DATA1 list;

具体的,循坏处理DATA1列表中的每一个数据块包括如下步骤:Specifically, cyclically processing each data block in the DATA1 list includes the following steps:

(a)假设当前数据块为item,记录item当前索引current_idx、文本内容text及位置信息point。(a) Assume that the current data block is item, record the item’s current index current_idx, text content text, and location information point.

(b)循环处理步骤(b1)至(b3):(b) Cyclic treatment steps (b1) to (b3):

(b1)条件判断:若item的right_idx不为负数,且right_idx索引的数据块item_1中的left_idx与item的current_idx相同,item_1中current_idx与item的right_idx相等,跳转(b2),否则跳转(b3);(b1) Conditional judgment: If the right_idx of item is not negative, and the left_idx in the data block item_1 indexed by right_idx is the same as the current_idx of item, and the current_idx in item_1 is equal to the right_idx of item, jump to (b2), otherwise jump to (b3);

(b2):记录item_1当前索引current_idx、文本内容text及位置信息point;并设置item_1为当前数据块item,即item=item_1;继续(b)循环;(b2): Record the current index current_idx, text content text and location information point of item_1; and set item_1 as the current data block item, that is, item = item_1; continue with the (b) loop;

(b3)退出(b)循环。(b3) Exit (b) loop.

(c):将(a)和(b)步骤所记录的各个item的文本内容text进行拼接,形成一个完整的字符串text_c,并设置text_c对应的位置信息为(a)步骤记录的位置信息point为point_c。(c): Concatenate the text content text of each item recorded in steps (a) and (b) to form a complete string text_c, and set the position information corresponding to text_c to the position information point recorded in step (a) as point_c.

(d)将字符串text_c添加到text_list,位置信息point_c添加到point_list。(d) Add the character string text_c to text_list and the position information point_c to point_list.

1033、筛选出没有经过处理的数据块DATA2,即DATA列表减去步骤(2)中已经记录的各个数据块所得剩下的数据块,并按DATA索引进行排序。1033. Filter out the unprocessed data blocks DATA2, that is, the remaining data blocks obtained by subtracting the data blocks recorded in step (2) from the DATA list, and sort them by DATA index.

1034、循环处理DATA2列表中的每一个数据块;1034. Loop through each data block in the DATA2 list;

假设当前数据块为item,记录item当前索引current_idx、文本内容text及位置信息point。将文本内容text添加到text_list,位置信息point添加到point_list。Assume that the current data block is item, record the current index current_idx, text content text and location information point of item. Add the text content text to text_list and the location information point to point_list.

1035、对文本信息列表text_list进行拼接;1035. Connect the text information list text_list;

构造拼接格式S,以文本信息列表text_list中某个文本信息的索引index和某个特殊字符T,形成拼接格式T_index_T。对文本信息列表text_list按拼接格式S进行拼接,形成一个完整银行回单文本信息字符串text_global,即为本申请中的目标文本块。Construct a splicing format S, using the index index of a text information in the text information list text_list and a special character T to form a splicing format T_index_T. Splice the text information list text_list according to the splicing format S to form a complete bank receipt text information string text_global, which is the target text block in this application.

示例性的,请参阅图4,图4为本申请实施例中一种银行回单图像的示例图。在对该银行回单图像进行识别,得到如图5A和5B所示的N个文本块之后,将各个文本块执行如图6A所示的DATA1部分数据块处理过程以及图6B所示的DATA2部分数据块处理过程,根据DATA1和DATA2处理的结果进行拼接,可知text_list=[‘付款账号3602xxxxxxxxxxxxxxx’,‘人’],point_list=[[144.0,124.0],[148.0,140.0]]。构造拼接格式:例如T为$,则一个索引在12~16之间的DATA数据块的文本信息字符串text_global为“$0$付款账号3602xxxxxxxxxxxxxxx$1$人”,即为该银行回单图像对应的目标文本块。For example, please refer to FIG. 4, which is an example diagram of a bank receipt image in an embodiment of the present application. After the bank receipt image is recognized and N text blocks are obtained as shown in FIGS. 5A and 5B, each text block is subjected to the DATA1 partial data block processing process as shown in FIG. 6A and the DATA2 partial data block processing process as shown in FIG. 6B, and spliced according to the processing results of DATA1 and DATA2. It can be seen that text_list = [‘payment account 3602xxxxxxxxxxxxxxx’, ‘person’], point_list = [[144.0, 124.0], [148.0, 140.0]]. Construct the splicing format: For example, if T is $, then the text information string text_global of a DATA data block with an index between 12 and 16 is “$0$payment account 3602xxxxxxxxxxxxxxx$1$person”, which is the target text block corresponding to the bank receipt image.

104、采用自然语言处理技术对目标文本块进行识别,得到固定字段信息和收付款字段信息,并确定收付款字段信息的收付款方向;104. Use natural language processing technology to identify the target text block, obtain fixed field information and payment field information, and determine the payment direction of the payment field information;

经过步骤103拼接得到目标文本块之后,可以通过自然语言处理(NLP,naturallanguage processing)技术对该目标文本块进行识别,固定字段信息和收付款字段信息,并确定收付款字段信息的收付款方向。其中,对于银行回单来说,至少都需要包括收款方信息和付款方信息,如银行账号、户名和开户行等信息,这类信息是需要明确属于收款方或者付款方的,即为本申请中的收付款字段信息。而对于银行回单中的回单编号和交易日期等本身就不存在收付款方向的信息,即为本申请中的固定字段信息。在经过步骤104识别出收付款字段信息之后,也可以确定出收付款字段信息相应的收付款方向,从而确定银行账号、户名和开户行等信息分别哪些是属于收款方,哪些属于付款方。After the target text block is obtained by splicing in step 103, the target text block can be identified by natural language processing (NLP) technology, fixed field information and payment field information, and the payment direction of the payment field information can be determined. Among them, for the bank receipt, at least the payee information and the payee information are required, such as bank account number, account name and bank opening information. This type of information needs to be clearly identified as belonging to the payee or payer, which is the payment field information in this application. For the receipt number and transaction date in the bank receipt, there is no information about the payment direction, which is the fixed field information in this application. After the payment field information is identified in step 104, the payment direction corresponding to the payment field information can also be determined, so as to determine which of the bank account number, account name and bank opening information belongs to the payee and which belongs to the payee.

具体的,本申请实施例中,可以采用正则表达式,对目标文本块进行识别,得到字段信息和字段信息对应的收付款方向。具体的,需要先针对银行回单的各个内容预先设计相应的正则表达式,例如,识别账号的正则表达式的形式可以包括但不限于:付款账号(\d{1,})。以目标文本块其字段信息为“付款账号1234567890123456”为例,则确定该目标文本块满足匹配该识别账号的正则表达式,则可以得到相应的识别结果,该信息属于收付款信息,即得到字段信息为“付款账号1234567890123456”,以及收付款方向为付款方向。Specifically, in an embodiment of the present application, a regular expression can be used to identify the target text block to obtain field information and the payment direction corresponding to the field information. Specifically, it is necessary to pre-design corresponding regular expressions for each content of the bank receipt. For example, the form of the regular expression for identifying the account number may include but is not limited to: payment account number (\d{1,}). Taking the target text block whose field information is "payment account number 1234567890123456" as an example, it is determined that the target text block satisfies the regular expression matching the identification account number, and the corresponding recognition result can be obtained. The information belongs to the payment information, that is, the field information obtained is "payment account number 1234567890123456", and the payment direction is the payment direction.

在实际应用中,经过步骤104识别得到固定字段信息、收付款字段信息和收付款字段信息对应的收付款方向之后,可以对这些信息进行输出反馈,或者录入到银行回单数据库,提高银行回单的管理效率。In actual applications, after step 104 identifies the fixed field information, the payment and receipt field information, and the payment and receipt direction corresponding to the payment and receipt field information, this information can be output as feedback or entered into the bank receipt database to improve the management efficiency of the bank receipt.

应理解,除了上述示例所给出的通过正则表达式对目标文本块进行识别之外,在实际应用中,还可以使用其他NLP技术对目标文本块进行识别,具体此处不做限定。It should be understood that in addition to the above example of identifying the target text block by using regular expressions, in actual applications, other NLP technologies can also be used to identify the target text block, which is not specifically limited here.

本申请实施例中,获取待识别的银行回单图像;对银行回单图像进行识别,得到N个文本块,每个文本块包括对应的文本内容、索引和位置信息;根据N个文本块的索引和位置信息,对N个文本块进行拼接,得到目标文本块;采用自然语言处理技术对目标文本块进行识别,得到固定字段信息和收付款字段信息,并确定收付款字段信息的收付款方向。通过上述方式,在识别银行回单图像的过程中,不需要针对各个不同的银行回单格式进行定制识别模板,该识别方法可以适用于各种不同的银行回单格式,提高了银行回单的识别效率。In an embodiment of the present application, a bank receipt image to be identified is obtained; the bank receipt image is identified to obtain N text blocks, each of which includes corresponding text content, index and location information; the N text blocks are spliced according to the index and location information of the N text blocks to obtain a target text block; the target text block is identified using natural language processing technology to obtain fixed field information and payment field information, and the payment direction of the payment field information is determined. In the above manner, in the process of identifying a bank receipt image, there is no need to customize the recognition template for each different bank receipt format. The recognition method can be applied to various bank receipt formats, thereby improving the recognition efficiency of bank receipts.

进一步的,在实际应用中,对于银行账号、户名和开户行等信息,有些情况下,由于不同银行回单的格式差异的问题,会导致无法匹配到具体收付款方向。示例性的,为了便于理解,请参阅图7,图7为本申请实施例中一种存在待识别收付款方向的字段信息的场景示意图,如图7所示,目标文本块可以匹配上户名或开户行的正则表达式,但由于在“户名”701和“开户行”702处,并未出现收付款信息的相关字样,例如“付款户名”或“付款开户行”,因此不能确定是收款还是付款方向,本申请中,对于这种在经过步骤104之后,无法识别收付款方向的银行账号、户名和开户行信息,定义为“待识别收付款方向的字段信息”,而对于银行回单中的回单编号和交易日期等本身就不存在收付款方向的信息(即固定字段信息),则不属于本申请中的“待识别收付款方向的字段信息”。Further, in actual applications, for information such as bank account number, account name and bank opening bank, in some cases, due to the format differences of different bank receipts, it is impossible to match the specific payment direction. For example, for ease of understanding, please refer to Figure 7, which is a schematic diagram of a scenario in which field information of the payment direction to be identified exists in the embodiment of the present application. As shown in Figure 7, the target text block can match the regular expression of the account name or bank opening bank, but since the relevant words of the payment information, such as "payment account name" or "payment bank opening bank", do not appear at "account name" 701 and "bank opening bank" 702, it is not possible to determine whether it is the payment direction or the payment direction. In this application, the bank account number, account name and bank opening bank information that cannot identify the payment direction after step 104 are defined as "field information of the payment direction to be identified", and the receipt number and transaction date in the bank receipt itself do not have the information of the payment direction (i.e., fixed field information), and do not belong to the "field information of the payment direction to be identified" in this application.

针对上述存在待识别收付款方向的字段信息的问题,本申请中,在确定收付款字段信息的收付款方向之后,还可以In view of the above problem that there is field information of the payment direction to be identified, in this application, after determining the payment direction of the payment field information, it is also possible to

获取所述收付款字段信息中,待识别收付款方向的字段信息;Obtaining the field information of the payment direction to be identified in the payment field information;

获取所述待识别收付款方向的字段信息对应的目标位置信息;Obtaining target location information corresponding to the field information of the payment direction to be identified;

获取所述收付款字段信息中,已识别收付款方向的字段信息;Obtaining the field information of the payment and receipt field information, in which the payment and receipt direction has been identified;

获取所述已识别收付款方向的字段信息中,收款方向对应的第一位置信息和付款方向对应的第二位置信息;Obtaining, in the field information of the identified payment and receipt directions, first position information corresponding to the payment direction and second position information corresponding to the payment direction;

对所述目标位置信息、第一位置信息和第二位置信息进行处理,得到所述待识别收付款方向的字段信息对应的收付款方向。The target location information, the first location information, and the second location information are processed to obtain the payment direction corresponding to the field information of the payment direction to be identified.

本实施例中,先获取收付款字段信息中,待识别收付款方向的字段信息,得到目标文本,并获取目标文本的位置信息,即目标位置信息。然而一般来说,即便当前收付款字段信息中存在无法确定出收付款方向的字段信息,但经过步骤104之后,也一定会存在部分已识别出收付款方向的字段信息,如图7所示的“付款方向”703和“收款方向”704。因此,还需要从步骤104中已识别出的收付款方向信息中,获取收款方向(例如“收款方向”704)对应的第一位置信息和付款方向(例如“付款方向”703)对应的第二位置信息。然后对目标位置信息、第一位置信息和第二位置信息进行处理,即可以得到待识别收付款方向的字段信息对应的收付款方向。In this embodiment, the field information of the payment direction to be identified in the payment field information is first obtained to obtain the target text, and the position information of the target text, that is, the target position information, is obtained. However, generally speaking, even if there is field information in the current payment field information that cannot determine the payment direction, after step 104, there must be some field information that has identified the payment direction, such as "payment direction" 703 and "receipt direction" 704 as shown in Figure 7. Therefore, it is also necessary to obtain the first position information corresponding to the payment direction (for example, "receipt direction" 704) and the second position information corresponding to the payment direction (for example, "payment direction" 703) from the payment direction information identified in step 104. Then, the target position information, the first position information, and the second position information are processed to obtain the payment direction corresponding to the field information of the payment direction to be identified.

本申请中,对目标位置信息、第一位置信息和第二位置信息进行处理,得到目标文本对应的收付款方向,具体可以包括如下步骤:In the present application, the target location information, the first location information, and the second location information are processed to obtain the payment direction corresponding to the target text, which may specifically include the following steps:

计算目标位置信息与第一位置信息之间的最小距离,得到第一距离;Calculate the minimum distance between the target position information and the first position information to obtain a first distance;

计算目标位置信息与第二位置信息之间的最小距离,得到第二距离;Calculating the minimum distance between the target position information and the second position information to obtain a second distance;

比较第一距离和第二距离的大小;Compare the first distance and the second distance;

若第一距离小于第二距离,则说明目标位置信息与第一位置信息的关联程度较高,即目标文本与收款方向的关联程度较高,即可以确定第一距离为目标距离;If the first distance is smaller than the second distance, it means that the target location information is highly correlated with the first location information, that is, the target text is highly correlated with the payment direction, and the first distance can be determined as the target distance;

判断目标距离是否小于预设阈值;Determine whether the target distance is less than a preset threshold;

若是,则确定待识别收付款方向的字段信息属于收款方向;If so, it is determined that the field information of the payment direction to be identified belongs to the payment direction;

若第二距离小于第一距离,则说明目标位置信息与第二位置信息的关联程度较高,即目标文本与付款方向的关联程度较高,即可以确定第二距离为目标距离;If the second distance is smaller than the first distance, it means that the target position information is highly correlated with the second position information, that is, the target text is highly correlated with the payment direction, and the second distance can be determined as the target distance;

判断目标距离是否小于预设阈值;Determine whether the target distance is less than a preset threshold;

若是,则确定待识别收付款方向的字段信息属于付款方向。If so, it is determined that the field information of the payment direction to be identified belongs to the payment direction.

具体的,为了提高识别待识别收付款方向的字段信息的收付款方向的准确度,示例性的,本申请实施例中,下面以分别计算第一位置信息、第二位置信息与目标位置信息之间的最小欧式距离,分别得到第一距离和第二距离为例,进行阐述。应理解,在实际应用中,在可以使用其他的计算距离的方式,具体此处不做限定。Specifically, in order to improve the accuracy of identifying the payment direction of the field information of the payment direction to be identified, illustratively, in the embodiment of the present application, the following takes the calculation of the minimum Euclidean distance between the first location information, the second location information and the target location information, and the first distance and the second distance are obtained as an example for explanation. It should be understood that in actual applications, other distance calculation methods can be used, which are not specifically limited here.

假设收款方向的位置信息为:第一位置信息=[[x1,y1],[x2,y2],…],付款方向的位置信息为:第二位置信息=[[a1,b1],[a2,b2],…],而目标文本对应的位置信息为:目标位置信息=[x,y]。具体判断收付款方向的步骤为:Assume that the location information of the receiving direction is: first location information = [[x1, y1], [x2, y2], ...], the location information of the payment direction is: second location information = [[a1, b1], [a2, b2], ...], and the location information corresponding to the target text is: target location information = [x, y]. The specific steps to determine the direction of receiving and paying are:

分别计算目标位置信息[x,y]与第一位置信息[[x1,y1],[x2,y2],…]中的每一个位置坐标的欧式距离,计算出其中的最短距离(第一距离)。The Euclidean distance between the target position information [x, y] and each position coordinate in the first position information [[x1, y1], [x2, y2], ...] is calculated respectively, and the shortest distance (first distance) therebetween is calculated.

分别计算目标位置信息[x,y]与第二位置信息[[a1,b1],[a2,b2],…]中的每一个位置坐标的欧式距离,计算出其中的最短距离(第二距离)。The Euclidean distance between the target position information [x, y] and each position coordinate in the second position information [[a1, b1], [a2, b2], ...] is calculated respectively, and the shortest distance (second distance) therebetween is calculated.

选择第一距离和第二距离中较小者为目标距离。The smaller of the first distance and the second distance is selected as the target distance.

若目标距离小于预设阈值,则可以判断户名的方向为收款方向还是付款方向。If the target distance is less than a preset threshold, it can be determined whether the direction of the account name is a receiving direction or a paying direction.

本实施例中,当存在待识别收付款方向的字段信息时,还可以结合该字段信息的位置信息进行辅助判断,从而识别出具体的收付款方向,提升了方案的准确性。In this embodiment, when there is field information of the payment direction to be identified, auxiliary judgment can be performed in combination with the position information of the field information, so as to identify the specific payment direction, thereby improving the accuracy of the solution.

进一步的,经过识别,得到固定字段信息和收付款字段信息之后,还可以对固定字段信息和收付款字段信息做进一步的后处理。例如:根据银行回单各个字段的特性进行有选择的去停用词处理,比如标点符号或空格等;对字段信息进行纠错处理,比如开户银行等字段信息。OCR识别得到的文本可能会出现中文识别错误情况,为了降低识别错误概率,可以采用文本相似度算法、编辑距离或长度差处理。Furthermore, after obtaining the fixed field information and the payment field information through identification, further post-processing can be performed on the fixed field information and the payment field information. For example: selectively remove stop words according to the characteristics of each field of the bank receipt, such as punctuation marks or spaces; perform error correction on field information, such as field information such as the bank account. The text obtained by OCR recognition may have Chinese recognition errors. In order to reduce the probability of recognition errors, text similarity algorithms, edit distance or length difference processing can be used.

示例性的,已知给定正确开户银行列表List包含以下开户银行:Exemplarily, it is known that a given correct account opening bank list List includes the following account opening banks:

“工行维多利亚广场支行”"ICBC Victoria Plaza Branch"

“中国工商银行体育西路支行”"Industrial and Commercial Bank of China Tiyuxi Road Branch"

“招商银行高新支行”"China Merchants Bank Gaoxin Branch"

待纠错字段值内容text为“工行雍多莉产场支行”。The text value of the field to be corrected is "ICBC Yongduoli Production Plant Branch".

具体纠错流程如下:The specific error correction process is as follows:

(a)若待纠错的字段值内容text在已知给定的正确开户银行列表List中,返回该字段值内容;否则跳转(b);(a) If the field value text to be corrected is in the given correct account opening bank list List, return the field value content; otherwise jump to (b);

(b)对待纠错字段值内容text,通过词汇倒排索引得到N个候选文本后,利用文本相似度方法计算与text最相似的k个候选文本,其中k<N。文本相似度计算方法可以是TFIDF、BM25算法以及elasticsearch检索中的一种。(b) For the error correction field value text, after obtaining N candidate texts through the vocabulary inverted index, the k candidate texts most similar to the text are calculated using the text similarity method, where k < N. The text similarity calculation method can be one of TFIDF, BM25 algorithm and elasticsearch retrieval.

(c)筛选出待纠错文本text和k个候选文本的公共字符序列text1;对k个候选文本中找出包含text1中(全部字符或者t个字符,t越大则出现误纠错的概率就越低)的候选文本列表n,n<k。若n为空,则返回待纠错字段值内容text,否则跳转(d)。(c) Filter out the common character sequence text1 of the text to be corrected and the k candidate texts; find the candidate text list n that contains (all characters or t characters in text1, the larger t is, the lower the probability of miscorrection) in the k candidate texts, n<k. If n is empty, return the content of the field value text to be corrected, otherwise jump to (d).

(d)分别计算待纠错字段值内容text与n个候选文本的编辑距离相似度,得到一个包含n个编辑距离相似度列表。其中,编辑距离,即Levenshtein距离,是一种计算两个字符串间的差异程度的度量。可以认为编辑距离就是从一个字符串修改到另一个字符串时,其中编辑单个字符所需要的最少次数。一般通过替换、插入、删除等操作。数学上,定义两个字符串A和B间的编辑距离为levA,B(a,b),其中a,b分别为A和B的长度,(d) Calculate the edit distance similarity between the content text of the field value to be corrected and the n candidate texts respectively, and obtain a list of n edit distance similarities. The edit distance, also known as the Levenshtein distance, is a measure of the degree of difference between two strings. The edit distance can be considered as the minimum number of times a single character is edited when modifying from one string to another. Generally, it is done through operations such as replacement, insertion, and deletion. Mathematically, the edit distance between two strings A and B is defined as lev A,B (a,b), where a and b are the lengths of A and B respectively.

编辑距离相似度:simliarity=1-levA,B(a,b)/max(a,b)Edit distance similarity: simliarity = 1-lev A, B (a, b) / max (a, b)

比如:A=“工行雍多莉产场支行”,B=“工行维多利亚广场支行”。则A和B的编辑距离计算如下:For example: A = "ICBC Yongduoli Branch", B = "ICBC Victoria Square Branch". The edit distance between A and B is calculated as follows:

替换:工行维(雍->维)Replacement: ICBC Wei (Yong->Wei)

替换:工行维多利(莉->利)Replacement: ICBC Victoria (Li->Li)

插入:工行维多利亚(_->亚)Insert: ICBC Victoria (_-> Asia)

替换:工行维多利亚广(产->广)Replacement: ICBC Victoria Guang (Industry->Guang)

因此,从A修改为B只需要4次编辑操作,故编辑距离为4.其相似度为:1-4/max(9,10)=0.6。Therefore, it only takes 4 editing operations to change from A to B, so the edit distance is 4. The similarity is: 1-4/max(9,10)=0.6.

从包含n个编辑距离相似度列表中选择最大相似度p,若p大于预设的阈值,则从n个候选文本中选择最大相似度p对应索引的候选文本作为纠错后的文本内容进行替换;否则不替换。The maximum similarity p is selected from a list of n edit distance similarities. If p is greater than a preset threshold, the candidate text with the index corresponding to the maximum similarity p is selected from the n candidate texts as the text content after error correction to be replaced; otherwise, no replacement is performed.

本实施例中,对于所得到的字段信息,还可以进一步进行纠错处理,提高了方案实现的准确性。In this embodiment, the obtained field information may be further subjected to error correction processing, thereby improving the accuracy of the solution implementation.

为了更好的实施本申请实施例的上述方案,下面还提供用于实施上述方案的相关装置。请参阅图8,图8为本申请实施例提供的一种银行回单识别装置的结构示意图,银行回单识别装置包括:In order to better implement the above solution of the embodiment of the present application, the following also provides related devices for implementing the above solution. Please refer to Figure 8, which is a structural schematic diagram of a bank receipt recognition device provided in the embodiment of the present application, and the bank receipt recognition device includes:

获取单元801,用于获取待识别的银行回单图像;An acquisition unit 801 is used to acquire a bank receipt image to be identified;

识别单元802,用于对所述银行回单图像进行识别,得到N个文本块,每个所述文本块包括对应的文本内容、索引和位置信息;The recognition unit 802 is used to recognize the bank receipt image to obtain N text blocks, each of which includes corresponding text content, index and position information;

拼接单元803,用于根据所述N个文本块的索引和位置信息,对所述N个文本块进行拼接,得到目标文本块;A splicing unit 803 is used to splice the N text blocks according to the indexes and position information of the N text blocks to obtain a target text block;

所述识别单元802,还用于采用自然语言处理技术对所述目标文本块进行识别,得到固定字段信息和收付款字段信息,并确定收付款字段信息的收付款方向。The recognition unit 802 is further used to recognize the target text block using natural language processing technology to obtain fixed field information and payment field information, and determine the payment direction of the payment field information.

可选地,在上述图8所对应的实施例的基础上,所述银行回单识别装置还包括处理单元804;Optionally, based on the embodiment corresponding to FIG. 8 , the bank receipt recognition device further includes a processing unit 804;

所述获取单元801,还用于获取所述收付款字段信息中,待识别收付款方向的字段信息;The acquisition unit 801 is further used to acquire the field information of the payment direction to be identified in the payment field information;

所述获取单元801,还用于获取所述待识别收付款方向的字段信息对应的目标位置信息;The acquisition unit 801 is further used to acquire the target location information corresponding to the field information of the to-be-identified payment and receipt direction;

所述获取单元801,还用于获取所述收付款字段信息中,已识别收付款方向的字段信息;The acquisition unit 801 is further used to acquire the field information of the payment direction identified in the payment field information;

所述获取单元801,还用于获取所述已识别收付款方向的字段信息中,收款方向对应的第一位置信息和付款方向对应的第二位置信息;The acquisition unit 801 is further configured to acquire, in the field information of the identified payment and receipt directions, first position information corresponding to the payment direction and second position information corresponding to the payment direction;

所述处理单元804,用于对所述目标位置信息、第一位置信息和第二位置信息进行处理,得到所述待识别收付款方向的字段信息对应的收付款方向。The processing unit 804 is used to process the target location information, the first location information, and the second location information to obtain the payment direction corresponding to the field information of the payment direction to be identified.

可选地,在上述图8所对应的实施例的基础上,所述处理单元804具体用于:Optionally, based on the embodiment corresponding to FIG. 8 , the processing unit 804 is specifically configured to:

计算所述目标位置信息与第一位置信息之间的最小距离,得到第一距离;Calculating the minimum distance between the target location information and the first location information to obtain a first distance;

计算所述目标位置信息与第二位置信息之间的最小距离,得到第二距离;Calculating the minimum distance between the target location information and the second location information to obtain a second distance;

比较所述第一距离和所述第二距离的大小;comparing the first distance and the second distance;

若所述第一距离小于所述第二距离,则确定所述第一距离为目标距离;If the first distance is less than the second distance, determining the first distance as the target distance;

判断所述目标距离是否小于预设阈值;Determine whether the target distance is less than a preset threshold;

若是,则确定所述待识别收付款方向的字段信息属于收款方向;If yes, it is determined that the field information of the to-be-identified payment and receipt direction belongs to the payment receipt direction;

若所述第二距离小于所述第一距离,则确定所述第二距离为所述目标距离;If the second distance is smaller than the first distance, determining the second distance as the target distance;

判断所述目标距离是否小于所述预设阈值;Determining whether the target distance is less than the preset threshold;

若是,则确定所述待识别收付款方向的字段信息属于付款方向。If so, it is determined that the field information of the payment direction to be identified belongs to the payment direction.

本实施例中,银行回单识别装置可以执行前述图1至图6B中任一项所示实施例的操作,具体此处不再赘述。In this embodiment, the bank receipt recognition device can perform the operation of any one of the embodiments shown in Figures 1 to 6B above, and the details will not be repeated here.

本申请实施例还提供了一种计算机设备,用于执行图1至图6B对应的实施例中任一项所示实施例的操作。请参阅图9,图9为本申请实施例中计算机设备900的一个结构示意图。如图所示,该计算机设备900可因配置或性能不同而产生比较大的差异,可以包括一个或一个以上中央处理器(central processing units,CPU)922(例如,一个或一个以上处理器)和存储器932,一个或一个以上存储应用程序942或数据944的存储介质930(例如一个或一个以上海量存储设备)。其中,存储器932和存储介质930可以是短暂存储或持久存储。存储在存储介质930的程序可以包括一个或一个以上模块(图示没标出),每个模块可以包括对计算机设备中的一系列指令操作。更进一步地,中央处理器922可以设置为与存储介质930通信,在计算机设备900上执行存储介质930中的一系列指令操作。The embodiment of the present application also provides a computer device for performing the operation of any of the embodiments shown in the embodiments corresponding to Figures 1 to 6B. Please refer to Figure 9, which is a structural schematic diagram of a computer device 900 in the embodiment of the present application. As shown in the figure, the computer device 900 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 922 (for example, one or more processors) and a memory 932, and one or more storage media 930 (for example, one or more mass storage devices) storing application programs 942 or data 944. Among them, the memory 932 and the storage medium 930 can be short-term storage or permanent storage. The program stored in the storage medium 930 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the computer device. Furthermore, the central processor 922 can be configured to communicate with the storage medium 930 to execute a series of instruction operations in the storage medium 930 on the computer device 900.

计算机设备900还可以包括一个或一个以上电源926,一个或一个以上有线或无线网络接口950,一个或一个以上输入输出接口958,和/或,一个或一个以上操作系统941,例如Windows ServerTM,Mac OS XTM,UnixTM,LinuxTM,FreeBSDTM等等。The computer device 900 may also include one or more power supplies 926, one or more wired or wireless network interfaces 950, one or more input and output interfaces 958, and/or one or more operating systems 941, such as Windows Server , Mac OS X , Unix , Linux , FreeBSD , etc.

上述实施例中所执行的步骤可以基于该图9所示的计算机设备的结构。The steps executed in the above embodiment may be based on the structure of the computer device shown in FIG. 9 .

本申请实施例中还提供一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,当其在计算机上运行时,使得计算机执行如前述各个实施例描述的方法。A computer-readable storage medium is also provided in an embodiment of the present application. The computer-readable storage medium stores a computer program, which, when executed on a computer, enables the computer to execute the methods described in the aforementioned embodiments.

本申请实施例中还提供一种包括程序的计算机程序产品,当其在计算机上运行时,使得计算机执行前述各个实施例描述的方法。所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。The present application also provides a computer program product including a program, which, when executed on a computer, enables the computer to execute the methods described in the above embodiments. Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working processes of the above-described systems, devices, and units can refer to the corresponding processes in the above-described method embodiments, and will not be repeated here.

在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,互动视频的管理装置,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, an interactive video management device, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

以上所述,以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (7)

1.一种银行回单的识别方法,其特征在于,包括:1. A method for identifying a bank receipt, comprising: 获取待识别的银行回单图像;Obtain the bank receipt image to be identified; 对所述银行回单图像进行识别,得到N个文本块,每个所述文本块包括对应的文本内容、索引和位置信息;Recognize the bank receipt image to obtain N text blocks, each of which includes corresponding text content, index and position information; 根据所述N个文本块的索引和位置信息,对所述N个文本块进行拼接,得到目标文本块;splicing the N text blocks according to the indexes and position information of the N text blocks to obtain a target text block; 采用自然语言处理技术对所述目标文本块进行识别,得到固定字段信息和收付款字段信息,并确定所述收付款字段信息的收付款方向;Using natural language processing technology to identify the target text block, obtain fixed field information and payment field information, and determine the payment direction of the payment field information; 获取所述收付款字段信息中,待识别收付款方向的字段信息;Obtaining the field information of the payment direction to be identified in the payment field information; 获取所述待识别收付款方向的字段信息对应的目标位置信息;Obtaining target location information corresponding to the field information of the payment direction to be identified; 获取所述收付款字段信息中,已识别收付款方向的字段信息;Obtaining the field information of the payment and receipt field information, in which the payment and receipt direction has been identified; 获取所述已识别收付款方向的字段信息中,收款方向对应的第一位置信息和付款方向对应的第二位置信息;Obtaining, in the field information of the identified payment and receipt directions, first position information corresponding to the payment direction and second position information corresponding to the payment direction; 计算所述目标位置信息与第一位置信息之间的最小距离,得到第一距离;Calculating the minimum distance between the target location information and the first location information to obtain a first distance; 计算所述目标位置信息与第二位置信息之间的最小距离,得到第二距离;Calculating the minimum distance between the target location information and the second location information to obtain a second distance; 比较所述第一距离和所述第二距离的大小;comparing the first distance and the second distance; 若所述第一距离小于所述第二距离,则确定所述第一距离为目标距离;If the first distance is less than the second distance, determining the first distance as the target distance; 判断所述目标距离是否小于预设阈值;Determine whether the target distance is less than a preset threshold; 若是,则确定所述待识别收付款方向的字段信息属于收款方向;If yes, it is determined that the field information of the to-be-identified payment and receipt direction belongs to the payment receipt direction; 若所述第二距离小于所述第一距离,则确定所述第二距离为所述目标距离;If the second distance is smaller than the first distance, determining the second distance as the target distance; 判断所述目标距离是否小于所述预设阈值;Determining whether the target distance is less than the preset threshold; 若是,则确定所述待识别收付款方向的字段信息属于付款方向。If so, it is determined that the field information of the payment direction to be identified belongs to the payment direction. 2.根据权利要求1所述的方法,其特征在于,对所述银行回单图像进行识别,得到N个文本块包括:2. The method according to claim 1, characterized in that the bank receipt image is recognized to obtain N text blocks including: 将所述银行回单图像分割为N个单行文本图像;Segmenting the bank receipt image into N single-line text images; 采用图像识别网络将所述N个单行文本图像进行识别,得到N个文本内容;Using an image recognition network to recognize the N single-line text images to obtain N text contents; 根据每个所述文本内容在所述银行回单图像上的位置信息,确定每个所述文本块对应的索引和位置信息,得到所述N个文本内容对应的索引和位置信息;According to the position information of each text content on the bank receipt image, determine the index and position information corresponding to each text block, and obtain the index and position information corresponding to the N text contents; 输出所述N个文本内容和所述N个文本内容对应的索引和位置信息,得到N个文本块。The N text contents and indexes and position information corresponding to the N text contents are output to obtain N text blocks. 3.根据权利要求1所述的方法,其特征在于,所述根据所述N个文本块的索引和位置信息,对所述N个文本块进行拼接包括:3. The method according to claim 1, wherein the step of splicing the N text blocks according to the index and position information of the N text blocks comprises: 获取所述N个文本块中左索引值为负数的文本块,得到M个第一文本块;Obtain text blocks with negative left index values from the N text blocks to obtain M first text blocks; 确定所述第一文本块中右索引值不为负数的文本块为当前文本块;Determine a text block whose right index value is not a negative number in the first text block as the current text block; 1)判断第二文本块的左索引值与所述当前文本块的当前索引值是否相同,并且,所述第二文本块的当前索引值是否与所述当前文本块的右索引值是否相同,其中,所述第二文本块为所述N个文本块中,除了所述M个第一文本块之外的其他文本块;1) determining whether a left index value of a second text block is the same as a current index value of the current text block, and whether the current index value of the second text block is the same as a right index value of the current text block, wherein the second text block is a text block other than the M first text blocks among the N text blocks; 2)若是,则确定所述第二文本块为新的当前文本块,并重新执行步骤1)至步骤2);2) If yes, determine that the second text block is the new current text block, and re-execute steps 1) to 2); 将步骤1)中的当前文本块与步骤2)中新的当前文本块进行拼接,得到第三文本块;The current text block in step 1) is concatenated with the new current text block in step 2) to obtain a third text block; 获取第四文本块,所述第四文本块为所述N个文本块中,除了所述第三文本块之外的其他文本块;Acquire a fourth text block, where the fourth text block is a text block other than the third text block among the N text blocks; 根据所述第四文本块的位置信息,将所述第四文本块与所述第三文本块进行拼接,得到目标文本块。According to the position information of the fourth text block, the fourth text block is spliced with the third text block to obtain a target text block. 4.一种银行回单识别装置,其特征在于,包括:4. A bank receipt recognition device, comprising: 获取单元,用于获取待识别的银行回单图像;An acquisition unit, used for acquiring a bank receipt image to be identified; 识别单元,用于对所述银行回单图像进行识别,得到N个文本块,每个所述文本块包括对应的文本内容、索引和位置信息;A recognition unit, used for recognizing the bank receipt image to obtain N text blocks, each of which includes corresponding text content, index and position information; 拼接单元,用于根据所述N个文本块的索引和位置信息,对所述N个文本块进行拼接,得到目标文本块;A splicing unit, used for splicing the N text blocks according to the indexes and position information of the N text blocks to obtain a target text block; 所述识别单元,还用于采用自然语言处理技术对所述目标文本块进行识别,得到固定字段信息和收付款字段信息,并确定所述收付款字段信息的收付款方向;The recognition unit is further used to recognize the target text block using natural language processing technology to obtain fixed field information and payment field information, and determine the payment direction of the payment field information; 所述获取单元,还用于获取所述收付款字段信息中,待识别收付款方向的字段信息;The acquisition unit is further used to acquire the field information of the payment direction to be identified in the payment field information; 所述获取单元,还用于获取所述待识别收付款方向的字段信息对应的目标位置信息;The acquisition unit is further used to acquire the target location information corresponding to the field information of the to-be-identified payment and receipt direction; 所述获取单元,还用于获取所述收付款字段信息中,已识别收付款方向的字段信息;The acquisition unit is further used to acquire the field information of the payment and receipt field information, which has identified the payment and receipt direction; 所述获取单元,还用于获取所述已识别收付款方向的字段信息中,收款方向对应的第一位置信息和付款方向对应的第二位置信息;The acquisition unit is further used to acquire, in the field information of the identified payment and receipt directions, first position information corresponding to the payment direction and second position information corresponding to the payment direction; 处理单元,用于计算所述目标位置信息与第一位置信息之间的最小距离,得到第一距离;A processing unit, configured to calculate a minimum distance between the target location information and the first location information to obtain a first distance; 所述处理单元,还用于计算所述目标位置信息与第二位置信息之间的最小距离,得到第二距离;The processing unit is further used to calculate the minimum distance between the target position information and the second position information to obtain the second distance; 所述处理单元,还用于比较所述第一距离和所述第二距离的大小;The processing unit is further configured to compare the first distance with the second distance; 所述处理单元,还用于当所述第一距离小于所述第二距离时,确定所述第一距离为目标距离;The processing unit is further configured to determine that the first distance is a target distance when the first distance is smaller than the second distance; 所述处理单元,还用于判断所述目标距离是否小于预设阈值;The processing unit is further used to determine whether the target distance is less than a preset threshold; 若是,所述处理单元,还用于确定所述待识别收付款方向的字段信息属于收款方向;If yes, the processing unit is further used to determine that the field information of the to-be-identified payment and receipt direction belongs to the payment receipt direction; 所述处理单元,还用于当所述第二距离小于所述第一距离时,确定所述第二距离为所述目标距离;The processing unit is further configured to determine that the second distance is the target distance when the second distance is smaller than the first distance; 所述处理单元,还用于判断所述目标距离是否小于所述预设阈值;The processing unit is further configured to determine whether the target distance is less than the preset threshold; 若是,所述处理单元,还用于确定所述待识别收付款方向的字段信息属于付款方向。If so, the processing unit is further used to determine that the field information of the to-be-identified payment and receipt direction belongs to the payment direction. 5.一种计算机设备,其特征在于,所述计算机设备包括处理器以及存储器:5. A computer device, characterized in that the computer device comprises a processor and a memory: 所述存储器用于存储程序代码;所述处理器用于根据所述程序代码中的指令执行权利要求1至3中任一项所述的银行回单的识别方法。The memory is used to store program codes; the processor is used to execute the bank receipt identification method described in any one of claims 1 to 3 according to the instructions in the program codes. 6.一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述权利要求1至3中任一项所述的银行回单的识别方法。6. A computer-readable storage medium, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, the computer executes the bank receipt recognition method described in any one of claims 1 to 3. 7.一种包括程序的计算机程序产品,当其在计算机上运行时,使得计算机执行前述权利要求1至3中任一项所述的方法。7. A computer program product comprising a program which, when executed on a computer, causes the computer to execute the method according to any one of the preceding claims 1 to 3.
CN202110706242.2A 2021-06-24 2021-06-24 Bank receipt identification method, related device and storage medium Active CN113469005B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110706242.2A CN113469005B (en) 2021-06-24 2021-06-24 Bank receipt identification method, related device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110706242.2A CN113469005B (en) 2021-06-24 2021-06-24 Bank receipt identification method, related device and storage medium

Publications (2)

Publication Number Publication Date
CN113469005A CN113469005A (en) 2021-10-01
CN113469005B true CN113469005B (en) 2024-10-29

Family

ID=77872790

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110706242.2A Active CN113469005B (en) 2021-06-24 2021-06-24 Bank receipt identification method, related device and storage medium

Country Status (1)

Country Link
CN (1) CN113469005B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114091876A (en) * 2021-11-12 2022-02-25 深圳前海环融联易信息科技服务有限公司 Method and tool for automatically checking and cutting converted bank receipt
CN113938481A (en) * 2021-11-12 2022-01-14 中国建设银行股份有限公司 Receipt processing method, processing device, electronic device and readable storage medium
CN114419640B (en) * 2022-02-25 2023-08-11 北京百度网讯科技有限公司 Text processing method, device, electronic equipment and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112784720A (en) * 2021-01-13 2021-05-11 浙江诺诺网络科技有限公司 Key information extraction method, device, equipment and medium based on bank receipt

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105528604B (en) * 2016-01-31 2018-12-11 华南理工大学 A kind of bill automatic identification and processing system based on OCR
CN107038567A (en) * 2016-09-20 2017-08-11 阿里巴巴集团控股有限公司 The acquisition methods and device of the information of destination object, the information of paying party
CN108345880B (en) * 2018-01-26 2021-07-27 金蝶软件(中国)有限公司 Invoice identification method and device, computer equipment and storage medium
CN108416279B (en) * 2018-02-26 2022-04-19 北京阿博茨科技有限公司 Table analysis method and device in document image
CN110956739A (en) * 2019-05-09 2020-04-03 杭州睿琪软件有限公司 Bill identification method and device
CN110942061A (en) * 2019-10-24 2020-03-31 泰康保险集团股份有限公司 Character recognition method, device, equipment and computer readable medium
CN111914835A (en) * 2020-07-04 2020-11-10 中信银行股份有限公司 Bill element extraction method and device, electronic equipment and readable storage medium
CN111967387B (en) * 2020-08-17 2023-05-26 北京市商汤科技开发有限公司 Form recognition method, form recognition device, form recognition equipment and computer-readable storage medium
CN111931687B (en) * 2020-08-26 2022-03-15 珠海大横琴科技发展有限公司 Bill identification method and device
CN112800848A (en) * 2020-12-31 2021-05-14 中电金信软件有限公司 Structured extraction method, device and equipment of information after bill identification

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112784720A (en) * 2021-01-13 2021-05-11 浙江诺诺网络科技有限公司 Key information extraction method, device, equipment and medium based on bank receipt

Also Published As

Publication number Publication date
CN113469005A (en) 2021-10-01

Similar Documents

Publication Publication Date Title
US11514698B2 (en) Intelligent extraction of information from a document
CN113469005B (en) Bank receipt identification method, related device and storage medium
CN112036145B (en) Financial statement recognition method, device, computer equipment and readable storage medium
JP2957375B2 (en) Data processing system and method for correcting character recognition errors in digital images of document format
CN112699775B (en) Certificate identification method, device, equipment and storage medium based on deep learning
US7970213B1 (en) Method and system for improving the recognition of text in an image
CN112036273A (en) Image identification method and device
US12118813B2 (en) Continuous learning for document processing and analysis
CN113963147B (en) A key information extraction method and system based on semantic segmentation
CN110516664A (en) Bill identification method and device, electronic equipment and storage medium
US20250029415A1 (en) Continuous learning for document processing and analysis
CN112464927B (en) Information extraction method, device and system
CN111401099A (en) Text recognition method, device and storage medium
CN116912847A (en) Medical text recognition method and device, computer equipment and storage medium
CN113568965A (en) A method, device, electronic device and storage medium for extracting structured information
CN114998920A (en) Supply chain financial file management method and system based on NLP semantic recognition
CN119002930A (en) Code processing method, model end and storage medium integrating multiple search modes
CN117373042A (en) Card image structuring processing method and device
CN118093689A (en) Multi-mode document analysis and structuring processing system based on RPA
CN111368066A (en) Method, device and computer readable storage medium for acquiring dialogue abstract
CN110688998A (en) Bill identification method and device
CN117195319A (en) Verification method and device for electronic part of file, electronic equipment and medium
CN115294593A (en) Image information extraction method and device, computer equipment and storage medium
CN118569206A (en) Document analysis method and device and electronic equipment
CN115147847A (en) Method, device, storage medium and computer equipment for determining text recognition result

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant