Double-language report numerical value checking method and device, equipment and storage medium
By using a double-pointer verification method based on positive and reverse order in a bilingual report, the accuracy and inefficiency of numerical verification in a multilingual environment are solved, and the consistency verification of numerical data is achieved.
Patent Information
- Application Number
- CN202411582353.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-07
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2044-11-07
AI Technical Summary
The prior art is difficult to effectively check numerical data in bilingual reports in multilingual environments, resulting in inaccuracy and inefficiency.
A two-language report numerical verification method is used to obtain and parse the first and second language texts of the target report, extract numerical data, and use a two-pointer verification method based on positive and reverse order to check the corrected numerical data.
Automatic numerical verification of two-language reports has been realized, which improves the accuracy and efficiency of the verification and ensures the consistency of numerical data.
Smart Images

Figure CN119558299A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present specification relate to the field of computer technology, and in particular to a method, device, equipment and storage medium for verifying numerical values of a bilingual report. Background Art
[0002] As the core element of a report, the accuracy of numerical data is crucial to the credibility of the report. In this context, ensuring the consistency of reports in different language versions, especially the consistency of numerical data, is particularly urgent and critical. Although the existing numerical verification methods have reached a high level of maturity in a single language environment, when dealing with multi-language reports that need to be disclosed by international companies, especially in situations involving bilingual versions, the existing verification methods often cannot meet the needs of consistency verification and show obvious limitations. At present, the numerical verification of bilingual reports is mainly carried out manually, but this method is inefficient and inaccurate.
[0003] In view of this, there is an urgent need for a numerical verification method for bilingual reports that can realize intelligent verification of numerical content in bilingual reports, improve the accuracy and efficiency of numerical verification of bilingual reports, and thus ensure the consistency of numerical values in bilingual reports. Summary of the invention
[0004] In view of the above-mentioned problems in the prior art, the purpose of the embodiments of this specification is to provide a method, device, equipment and storage medium for checking numerical values in a bilingual report, so as to realize intelligent checking of numerical contents in a bilingual report and improve the accuracy and efficiency of checking numerical values in a bilingual report.
[0005] In order to solve the above technical problems, the specific technical solutions of the embodiments of this specification are as follows:
[0006] On the one hand, an embodiment of the present specification provides a method for verifying a bilingual report value, the method comprising:
[0007] Obtaining the first-language and second-language texts of the target report;
[0008] Parsing the first language text and the second language text to obtain numerical data of the first language text and the second language text;
[0009] The corrected first language numerical data and second language numerical data are checked by using a double pointer checking method based on positive and reverse order to obtain a checking result.
[0010] Furthermore, the parsing of the first language text and the second language text to obtain numerical data of the first language text and the second language text includes:
[0011] Dividing the first language text and the second language text into a plurality of chapter blocks according to the chapters;
[0012] Respectively obtain text data in each of the chapter blocks in the first language text and the second language text, and obtain a first language text data list and a second language text data list for each chapter block;
[0013] The numerical data in the first language text data list and the second language text data list are extracted to obtain the first language numerical data list and the second language numerical data list of each chapter block.
[0014] Furthermore, the obtaining of text data in each of the chapter blocks in the first language text and the second language text respectively includes:
[0015] Perform text detection on each of the chapter blocks in the first language text and the second language text to obtain all text blocks and corresponding initial text lines in each of the chapter blocks;
[0016] Obtaining the bounding boxes of all text blocks in each of the chapter blocks, and determining the coordinates of each text block according to the bounding boxes;
[0017] According to the preset text line construction rules and the initial text lines, the text lines corresponding to all the text blocks in each of the chapter blocks are re-determined to obtain the final text lines corresponding to all the text blocks in each of the chapter blocks;
[0018] According to the coordinates of the text blocks, the text blocks belonging to the same text line are sorted in a z-shape to obtain a text block list of each text line;
[0019] Performing text recognition on the text blocks in the text block list of each text line to obtain text data of each text line;
[0020] The text data of each text line in each chapter block are aggregated to obtain the text data in each of the chapter blocks.
[0021] Furthermore, the re-determining of the text lines corresponding to all the text blocks in each of the chapter blocks according to the preset text line construction rules and the initial text lines includes:
[0022] Calculate the vertical difference between the first text block and the remaining text blocks in each initial text line according to the coordinates;
[0023] Determining whether the longitudinal difference is less than a preset threshold;
[0024] If yes, the text blocks whose vertical difference is less than a preset threshold are determined as the same text line;
[0025] If not, the vertical difference between the text block having a vertical difference greater than a preset threshold and the first text block in the two adjacent upper and lower lines of its initial text line is calculated, and the text line corresponding to the text block is determined according to the vertical difference.
[0026] Furthermore, before the double pointer checking method based on the forward and reverse order is used to check the corrected first language numerical data and the second language numerical data, the method further includes:
[0027] The numerical data of the first language text and the second language text are corrected respectively using a pre-constructed rule correction library to obtain corrected first language numerical data and second language numerical data.
[0028] Furthermore, the rule correction library includes a number of regular expressions and corresponding standard formats;
[0029] The method of using a pre-built rule correction library to correct the numerical data of the first language text and the second language text respectively includes:
[0030] Using the regular expression to match the numerical data of each text line in the first language text and the second language text one by one;
[0031] If the match is successful, the corresponding numerical data is corrected according to the standard format corresponding to the matching regular expression to obtain the corrected numerical data.
[0032] Furthermore, the double pointer checking method based on the forward and reverse order is used to check the corrected first language numerical data and the second language numerical data, including:
[0033] Sort the corrected first language numerical data and second language numerical data in ascending order according to the number of text lines to obtain a positive sequence array of the first language numerical data and the second language numerical data;
[0034] sorting the corrected first language numerical data and second language numerical data in descending order according to the number of text lines respectively, to obtain a reverse order array of the first language numerical data and the second language numerical data;
[0035] Using a double pointer checking method to check the positive sequence array and the reverse sequence array of the first language numerical data and the second language numerical data, to obtain a positive sequence checking result and a reverse sequence checking result;
[0036] A logical operation is performed on the positive order verification result and the reverse order verification result to obtain a verification result.
[0037] Furthermore, the double-pointer checking method is used to check the positive-sequence arrays of the first language numerical data and the second language numerical data, including:
[0038] Initializing a first pointer and a second pointer in the positive sequence arrays of the first language numerical data and the second language numerical data, respectively, the first pointer and the second pointer pointing to initial positions of the first language numerical data array and the second language numerical data array, respectively;
[0039] Get the text line corresponding to the numerical data in each chapter block;
[0040] Using the first pointer and the second pointer, respectively traverse the text lines in each chapter block of the first language numerical data array and the second language numerical data array in the order of text lines;
[0041] If the numerical data corresponding to a certain text line of the first language numerical data array and the second language numerical data array are inconsistent, determining whether the number of text lines of the first language numerical data and the number of text lines of the second language numerical data are the same;
[0042] If not, the numerical data array corresponding to the pointer with the larger number of text lines is used to traverse the numerical data array according to the preset maximum number of lines to move downward, and the numerical data obtained after the traversal is compared with another numerical data array to obtain a comparison result.
[0043] Furthermore, the method further comprises:
[0044] Screening the comparison results for discrepancies between the first language text and the second language text;
[0045] Determine the position of the difference result in the first language text and the second language text, and highlight the position to obtain the marked first language text and the second language text;
[0046] The annotated first language text and second language text are sent to a terminal corresponding to the business personnel.
[0047] On the other hand, the embodiment of this specification provides a dual-language report value verification device, the device comprising:
[0048] An acquisition module, used for acquiring a first language text and a second language text of a target report;
[0049] A parsing module, used for parsing the first language text and the second language text to obtain numerical data of the first language text and the second language text;
[0050] The checking module is used to check the corrected first language numerical data and second language numerical data by using a double pointer checking method based on positive and reverse order to obtain a checking result.
[0051] On the other hand, an embodiment of the present specification further provides a computer device, including a memory, a processor, and a computer program stored in the memory, wherein when the computer program is executed by the processor, the instructions of any one of the above methods are executed.
[0052] On the other hand, an embodiment of the present specification further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor of a computer device, the computer program executes instructions of any one of the above-described methods.
[0053] On the other hand, the embodiments of this specification further provide a computer program product, which, when executed by a processor of a computer device, executes instructions of any one of the above methods.
[0054] By adopting the above-mentioned technical scheme, a bilingual report numerical verification method provided in the embodiment of this specification obtains corresponding numerical data by parsing the first language text and the second language text of the target report, and verifies the corrected first language numerical data and the second language numerical data using a double pointer verification method based on forward and reverse order to obtain a verification result. The method can automatically perform numerical verification on the bilingual report, thereby improving the efficiency and accuracy of numerical verification.
[0055] The above description is only an overview of the technical solutions of some embodiments of this specification. In order to more clearly understand the technical means of some embodiments of this specification, they can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the embodiments of this specification more obvious and easy to understand, the following specifically cites the preferred embodiments and describes them in detail in conjunction with the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the embodiments of this specification 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 some embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0057] Figure 1 A schematic flow chart of a method for checking numerical values of a bilingual report in some embodiments of this specification is shown;
[0058] Figure 2 A schematic diagram showing a process of parsing the first language text and the second language text in some embodiments of this specification;
[0059] Figure 3A schematic diagram showing a flow chart of obtaining text data in each of the chapter blocks in the first language text and the second language text in some embodiments of the present specification;
[0060] Figure 4 A schematic diagram of a process for re-determining text lines corresponding to all text blocks in each of the chapter blocks in some embodiments of the present specification is shown;
[0061] Figure 5 A schematic diagram showing a flow chart of correcting the numerical data of the first language text and the second language text in some embodiments of this specification;
[0062] Figure 6 A schematic diagram of a process of checking the positive sequence array of the first language numerical data and the second language numerical data by using a double pointer checking method in some embodiments of the present specification is shown;
[0063] Figure 7 A schematic diagram of a process of checking corrected first language numerical data and second language numerical data using a double pointer checking method based on forward and reverse order in some embodiments of the present specification is shown;
[0064] Figure 8 Another schematic flow chart of a method for checking numerical values of a bilingual report in some embodiments of this specification is shown;
[0065] Fig. 9 A schematic diagram showing numerical data reported in Chinese and English in some embodiments of this specification;
[0066] Fig.10 Another schematic diagram showing numerical data reported in Chinese and English in some embodiments of this specification;
[0067] Fig.11 A schematic diagram showing reverse sorting of Chinese and English reported numerical data in some embodiments of this specification;
[0068] Fig.12 A schematic diagram of the module structure of a dual-language report value verification device in some embodiments of this specification is shown;
[0069] Fig.13 A schematic diagram of the structure of a computer device in this specification is shown.
[0070] Description of the accompanying symbols:
[0071] 1201. Get module;
[0072] 1202. Parsing module;
[0073] 1203, verification module;
[0074] 1302. Computer equipment;
[0075] 1304. Processor;
[0076] 1306. Memory;
[0077] 1308, driving mechanism;
[0078] 1310, input / output module;
[0079] 1312. Input devices;
[0080] 1314. Output device;
[0081] 1316. Presentation equipment;
[0082] 1318. Graphical user interface;
[0083] 1320, network interface;
[0084] 1322, communication link;
[0085] 1324. Communication bus. DETAILED DESCRIPTION
[0086] The following will be combined with the drawings in the embodiments of this specification to clearly and completely describe the technical solutions in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this specification.
[0087] In order to solve the above problems, the embodiments of this specification provide a method for verifying numerical values of a bilingual report. Figure 1 It is a flow chart of a method for checking the numerical values of a bilingual report provided in an embodiment of this specification. This specification provides method operation steps as described in the embodiment or flow chart, but may include more or fewer operation steps based on conventional or non-creative labor. The order of steps listed in the embodiment is only one way of executing the order of many steps and does not represent the only execution order. When the system or device product is executed in practice, it can be executed in the order of the method shown in the embodiment or the accompanying drawings or in parallel.
[0088] It should be noted that the terms "first", "second", etc. in this specification and claims 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 interchanged where appropriate, so that the embodiments of this specification described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, device, product or equipment that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0089] Reference Figure 1 As shown, the embodiment of this specification provides a method for checking numerical values of a bilingual report, the method comprising:
[0090] S101: Obtaining a first language text and a second language text of a target report;
[0091] S102: parsing the first language text and the second language text to obtain numerical data of the first language text and the second language text;
[0092] S103: Using a double pointer checking method based on forward and reverse order to check the corrected first language numerical data and second language numerical data, to obtain a checking result.
[0093] By adopting the above-mentioned technical scheme, a bilingual report numerical verification method provided in the embodiment of this specification obtains corresponding numerical data by parsing the first language text and the second language text of the target report, and verifies the corrected first language numerical data and the second language numerical data using a double pointer verification method based on forward and reverse order to obtain a verification result. The method can automatically perform numerical verification on the bilingual report, thereby improving the efficiency and accuracy of numerical verification.
[0094] In step S101, the target report may be a report containing numerical values, such as a financial report, an academic research report, or a survey report, and the bilingual report may be in two different languages, such as numerical value verification in Chinese and English, numerical value verification in Chinese and Japanese, or numerical value verification in English and Japanese. In the embodiment of this specification, the numerical value verification method provided in this specification is described in detail by taking the numerical value verification of Chinese and English financial reports as an example.
[0095] In some embodiments of this specification, refer to Figure 2 , the parsing of the first language text and the second language text to obtain numerical data of the first language text and the second language text includes:
[0096] S201: Divide the first language text and the second language text into a plurality of chapter blocks according to chapters.
[0097] It can be understood that in order to avoid the problem of inaccurate correspondence between the Chinese and English financial report contents due to the length of the report text, the report text needs to be segmented by chapters, so that even if a large comparison error occurs in a certain chapter block due to some unexpected special cases, the overall error will be controlled within the chapter block and will not affect the results of subsequent chapters. The acquisition of chapter information is divided into the following three situations:
[0098] 1) If the chapter information can be obtained directly from the original report, the original Chinese and English reports are divided into chapters and stored in the computer cache;
[0099] 2) If the chapter information cannot be directly obtained from the original report structure, but the original report has a table of contents page, the contents of the table of contents page are parsed, and the page numbers of each chapter are obtained based on the information in the table of contents page. The original Chinese and English reports are segmented by page numbers and stored in the computer cache;
[0100] 3) If the chapter information cannot be directly obtained from the original report structure and the original report does not have a table of contents page, the original report will not be segmented and the full text will be stored in the computer cache. In the subsequent comparison, the numerical comparison of Chinese and English financial reports will be carried out in units of chapter blocks. Therefore, by accurately segmenting the full text of the report according to chapters, the correspondence between Chinese and English content can be accurately located in each independent chapter, reducing the cumulative error in the numerical comparison process.
[0101] S202: Acquire text data in each of the chapter blocks in the first language text and the second language text respectively, and obtain a first language text data list and a second language text data list for each chapter block.
[0102] S203: extracting numerical data from the first language text data list and the second language text data list to obtain a first language numerical data list and a second language numerical data list for each chapter block.
[0103] After dividing the Chinese and English financial reports into chapter blocks, it is necessary to obtain the text data in each chapter block in the Chinese and English reports respectively, extract the numerical data from the text data, and obtain the numerical data list in each chapter block in the Chinese and English financial reports respectively.
[0104] In some embodiments of this specification, in step S202, refer to Figure 3 , the obtaining of text data in each of the chapter blocks in the first language text and the second language text respectively comprises:
[0105] S301: Perform text detection on each of the chapter blocks in the first language text and the second language text to obtain all text blocks and corresponding initial text lines in each of the chapter blocks.
[0106] S302: Obtain the bounding boxes of all text blocks in each of the chapter blocks, and determine the coordinates of each text block according to the bounding boxes.
[0107] S303: redetermine the text lines corresponding to all the text blocks in each of the chapter blocks according to the preset text line construction rules and the initial text lines, and obtain the final text lines corresponding to all the text blocks in each of the chapter blocks.
[0108] S304: Sort the text blocks belonging to the same text line in a Z-shape according to the coordinates of the text blocks to obtain a text block list of each text line.
[0109] S305: Perform text recognition on the text blocks in the text block list of each text line to obtain text data of each text line.
[0110] S306: Summarize the text data of each text line in each chapter block to obtain the text data in each chapter block.
[0111] Specifically, in step S301, any open source text detection method can be used to perform text detection on each chapter block in the Chinese and English reports, such as the bbox method in the camelot library, so as to obtain all text blocks and corresponding initial text lines in each chapter block. In order to more accurately obtain the text line information of each text block and avoid the problems of text line errors and some special line break formats, it is necessary to redetermine the text line corresponding to each text block according to the pre-set text line construction rules. Figure 4 As shown, in some embodiments of the present specification, the text lines corresponding to all text blocks in each of the chapter blocks are re-determined according to the preset text line construction rules and the initial text lines, including:
[0112] S401: Calculate the vertical difference between the first text block and the remaining text blocks in each initial text line according to the coordinates.
[0113] S402: Determine whether the longitudinal difference is less than a preset threshold.
[0114] S403: If yes, the text blocks whose vertical difference is less than a preset threshold are determined as the same text line.
[0115] S404: If not, calculate the vertical difference between the text block having a vertical difference greater than a preset threshold and the first text block in the two adjacent upper and lower lines of its initial text line, and determine the text line corresponding to the text block according to the vertical difference.
[0116] It can be understood that the coordinates of each text block can be determined according to its bounding box. Specifically, for a certain text block, the coordinates of the lower left corner (x0, y0) and the upper right corner (x1, y1) of the bounding box of the text block are obtained respectively, thereby obtaining the coordinates of the text block as Similarly, the coordinates of each text block can be determined according to the above method. For each initial text line, the vertical difference between the remaining text blocks and the first text block in the initial text line is calculated according to the coordinates of each text block. If the vertical difference is less than a preset threshold, it can be considered that the two text blocks belong to the same text line. If the vertical difference is less than the preset threshold, it indicates that they do not belong to the same text line. In order to determine the text line of the text block, the vertical difference of the first text block in the upper and lower lines adjacent to the text block and its initial text line is calculated, and the text line corresponding to the first text block whose vertical difference is less than the preset threshold is used as the final text line of the text block. In other embodiments, if the text line cannot be determined using the above method, a new text line is constructed for the text block, and the remaining initial text lines are incremented in sequence.
[0117] In step S304, after determining the text line corresponding to each text block, the text blocks belonging to the same text line are sorted in a z-shape to obtain a text block list for each text line, wherein the z-shape sorting is sorting in order from top to bottom and from left to right. After determining the text block list for each text line, any open source text recognition method can be used to perform text recognition on each text block to obtain text data for each text line of each chapter block. The text data TextLine: [Text1, Text2, ..., TextN] of each line is added to the array TextLineList: [TextLine1, TextLine2, ..., TextLineN] in order, and saved to the computer cache. Since the embodiments of this specification mainly involve checking the numerical content in the Chinese and English reports, it is necessary to perform numerical filtering on the row data extracted above: using regular expressions and other methods, filter out all numerical data in the row data, and store them in a new array NumLine: [Num1, Num2, ..., NumN], and save them to the computer cache. Repeat this operation until all rows of data in each chapter of the full text of the Chinese and English reports are filtered, and finally the filtered NumLine is added to the data NumLineList: [NumLine1, NumLine2, ..., NumLineN] in sequence and saved to the computer cache.
[0118] In some embodiments of the present specification, before verifying the corrected first language numerical data and second language numerical data using the double pointer verification method based on the forward and reverse order, the method further includes:
[0119] The numerical data of the first language text and the second language text are corrected respectively using a pre-constructed rule correction library to obtain corrected first language numerical data and second language numerical data.
[0120] It can be understood that there are certain differences in the writing style between Chinese and English reports in the description of some specific numerical values, especially in the expression of date, time, amount, etc. Taking the Chinese date "July 1, 2020" as an example, its corresponding English writing is "July 1, 2020" (American style) or "1st July, 2020" (British style). Due to the above-mentioned differences in writing style, it is necessary to summarize the rules of the corresponding differences based on the difference characteristics of the Chinese and English writing in the report to be checked, and use the set of all rules as the rule correction library for this type of report. Before checking, use the pre-built rule correction library to realize the mapping of the difference descriptions between Chinese and English, and eliminate the inconsistency of checking caused by the difference in writing style. Since the rules involved in different types of reports may be different, if necessary, they need to be manually maintained and modified before checking.
[0121] In some embodiments of this specification, the rule correction library includes several regular expressions and corresponding standard formats. Figure 5 As shown, the method of using the pre-built rule correction library to correct the numerical data of the first language text and the second language text respectively includes:
[0122] S501: using the regular expression to match the numerical data of each text line in the first language text and the second language text one by one;
[0123] S502: If the match is successful, the corresponding numerical data is corrected according to the standard format corresponding to the matching regular expression to obtain corrected numerical data.
[0124] It can be understood that the constructed rule correction library is a collection of regular expressions sorted according to the characteristics of the differences between Chinese and English, such as {CN: {standard_text_1: regexp_1, standard_text_2: regexp_2,...}, EN: {standard_text_1: regexp_1, standard_text_2: regexp_1,...}}. When performing row comparison, it is necessary to traverse the rule correction library to perform regular matching on the row data. If a regular expression in the rule correction library can be matched, the value at that location will be rewritten according to the standard writing method corresponding to the expression. For example, if the English text "1st July, 2024" hits a regular expression, it will be rewritten into the standard text "20240701" corresponding to the expression; similarly, if it matches the Chinese July 1, 2024, it will also be rewritten into "20240701". In the above way, the mapping of the difference descriptions between Chinese and English can be realized, and the comparison differences caused by description problems can be eliminated.
[0125] After the above operations, the numerical comparison of Chinese and English financial reports can be performed. Ideally, the number of text lines containing numerical values in each chapter block of Chinese and English reports is consistent. Therefore, when checking the numerical values, you only need to extract the corresponding text line data for numerical comparison. However, in most cases, due to the format differences between Chinese and English reports, there may be differences in the text line data extracted above, resulting in inconsistencies in the number of lines containing numerical values in each chapter of Chinese and English reports. To solve this problem, this manual proposes a double-pointer-based line value comparison method, referring to Figure 6 As shown, the double-pointer checking method is used to check the positive sequence arrays of the first language numerical data and the second language numerical data, including:
[0126] S601: Initializing a first pointer and a second pointer in a positive sequence array of first language numerical data and a positive sequence array of second language numerical data, respectively, wherein the first pointer and the second pointer point to initial positions of the first language numerical data array and the second language numerical data array, respectively;
[0127] S602: Obtain the text line corresponding to the numerical data in each chapter block;
[0128] S603: using the first pointer and the second pointer to traverse the text lines in each chapter block of the first language numerical data array and the second language numerical data array in order of text lines;
[0129] S604: If the numerical data corresponding to a certain text line of the first language numerical data array and the second language numerical data array are inconsistent, determining whether the number of text lines of the first language numerical data and the number of text lines of the second language numerical data are the same;
[0130] S605: If not, then use the pointer corresponding to the numerical data array with a larger number of text lines to traverse the numerical data array according to a preset maximum number of lines to move downward, and compare the numerical data obtained after the traversal with another numerical data array to obtain a comparison result.
[0131] It can be understood that a pointer uses an address to directly point to a value stored in another place in the computer memory. Pointers provide efficient data access and operation methods, and simplify the implementation of data structures, so that data in the memory can be directly accessed and operated through addresses. In the embodiments of this specification, dual pointers are used to traverse data in Chinese and English numerical data arrays respectively, wherein the first pointer is used to traverse data in order in the Chinese numerical data array, and the second pointer is used to traverse data in the English numerical data array from top to bottom between rows and from left to right within a row. Before checking, the first pointer and the second pointer are pointed to the initial positions of the corresponding numerical data arrays, respectively. Fig. 9 As shown, the first pointer and the second pointer point to the first line line1 of the corresponding report respectively. Fig. 9 It can be seen that the number of text lines in the Chinese report and the English report is inconsistent. The number of lines in the English report is larger than that in the Chinese report. The data in the dotted box may be misplaced due to factors such as typesetting and line breaks. The first pointer and the second pointer are used to traverse from line1 respectively, and the numerical data arrays of line1 in the Chinese and English reports are obtained respectively. After comparison, it can be seen that the Chinese and English numerical data of line1 are consistent. Continue to traverse in order. When traversing to line3, it can be seen that cn_line3: [12661, 493, 12168]; en_line3:
[12661] . In order to eliminate the problem of inconsistent numerical verification caused by line break or typesetting due to misplaced line order, the second pointer continues to traverse downward to obtain en_line4: [493, 12168]. It can be seen that cn_line3: [12661, 493, 12168] = (en_line3 + en_line4): [12661, 493, 12168]. At this time, the position of the second pointer is en_line4, and the position of the first pointer is en_line3. In this embodiment, the second pointer can be checked with the numerical value of the Chinese report by traversing one line downward, while in other embodiments, the second pointer may not be able to be checked with the numerical value of the Chinese report even after traversing one line downward, so it is necessary to continue to traverse downward until the preset maximum number of rows to move downward is reached. Preferably, the maximum number of rows to move downward is set to 3 in this specification. If the numerical array obtained by the second pointer traversing 3 lines downward still cannot be checked with the Chinese array, it indicates that there is an inconsistency.
[0132] It can be seen from the above embodiments that Fig. 9In this case, although the number of lines in the original text changes due to line breaks, the original order of the data is not changed, and the double pointer algorithm can still be compared normally. Fig.10 In the case of the English version of the report, the layout is misplaced, which causes the number of lines to change and the order of the data to change. When using double pointers for traversal, we get cn_line3:[8473,10155]; en_line3:
[10155] , en_line4:
[8473] . At this time, cn_line3:[8473,10155]≠(en_line3+en_line4):[10155,8473]. It can be seen that the double pointer algorithm will not be able to match the values in the box in order, which will cause a large number of misjudgment results. Therefore, in order to solve the above problem, the embodiment of this specification adds a new process of comparing the row data in positive and reverse order to reduce misjudgment. Figure 7 As shown, the double pointer checking method based on positive and reverse order is used to check the corrected first language numerical data and second language numerical data, including:
[0133] S701: sorting the corrected first language numerical data and second language numerical data in ascending order according to the number of text lines respectively, to obtain a positive sequence array of the first language numerical data and the second language numerical data;
[0134] S702: sorting the corrected first language numerical data and second language numerical data in descending order according to the number of text lines, respectively, to obtain a reverse order array of the first language numerical data and the second language numerical data;
[0135] S703: Using a double pointer checking method, checking the positive order array and the reverse order array of the first language numerical data and the second language numerical data to obtain a positive order checking result and a reverse order checking result;
[0136] S704: Performing a logical operation on the positive order verification result and the reverse order verification result to obtain a verification result.
[0137] Specifically, Fig.10 The Chinese and English numerical data in are sorted in reverse order according to the number of text lines, such as Fig.11As shown, the above double-pointer-based verification method is used to perform numerical verification on the reversed Chinese and English numerical data, and traverses from line1 after the reverse order. When traversing to line11, cn_line11: [8473, 10155], en_line11:
[8473] , en_line12:
[10155] can be obtained. It can be seen that cn_line11: [8473, 10155] = (en_line11 + en_line12): [8473, 10155], which is consistent with the actual situation. In this embodiment, the positive sequence result is inconsistent with the verification, and the reverse sequence result is consistent with the verification. The actual situation is consistent with the verification. Therefore, in order to be consistent with the actual situation, the positive sequence result and the reverse sequence result are logically operated to obtain the final verification result. The logical operation is a logical AND operation, that is, when the verification is consistent, it is represented by 0, and when the verification is inconsistent, it is represented by 1. After the logical AND operation, the final result is 0, that is, the verification is consistent. In this way, by performing a logical AND operation, the final verification result is inconsistent only when both the positive order result and the reverse order result are inconsistent, thereby avoiding misjudgment caused by factors such as typesetting and line breaks, thereby improving the accuracy of Chinese and English numerical verification. In other embodiments, logical calculations, such as logical OR operations, can also be selected according to actual needs.
[0138] In some embodiments of this specification, refer to Figure 8 As shown, the bilingual report value verification method also includes:
[0139] S801: screening the difference results between the first language text and the second language text in the verification results;
[0140] S802: Determine the position of the difference result in the first language text and the second language text, and highlight the position to obtain the marked first language text and the second language text;
[0141] S803: Send the annotated first language text and second language text to a terminal corresponding to the business personnel.
[0142] It can be understood that when there is an inconsistency in the verification of Chinese and English values, the inconsistent results will be highlighted at the corresponding position of the original Chinese and English reports, and the corresponding page number in the Chinese and English reports will be noted so that users can quickly identify and correct them.
[0143] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. And the acquisition, storage, use, and processing of data in the technical solutions described in the embodiments of this application are in compliance with relevant regulations.
[0144] Based on the above-mentioned method for checking the numerical value of a bilingual report, an embodiment of this specification also provides a corresponding device for checking the numerical value of a bilingual report. The device may include a system (including a distributed system), software (application), module, component, server, client, etc. using the method described in the embodiment of this specification and a device in combination with necessary implementation hardware. Based on the same innovative concept, the device in one or more embodiments provided in the embodiment of this specification is as described in the following embodiments. Since the implementation scheme and method for solving the problem of the device are similar, the implementation of the specific device in the embodiment of this specification can refer to the implementation of the aforementioned method, and the repetitions will not be repeated. As used below, the term "unit" or "module" can implement a combination of software and / or hardware for a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0145] Specifically, Fig.12 This is a schematic diagram of the module structure of an embodiment of a dual-language report value verification device provided in the embodiment of this specification, referring to Fig.12 As shown, a dual-language report value verification device provided in an embodiment of this specification includes:
[0146] An acquisition module 1201 is used to acquire a first language text and a second language text of a target report;
[0147] A parsing module 1202, configured to parse the first language text and the second language text to obtain numerical data of the first language text and the second language text;
[0148] The checking module 1203 is used to check the corrected first language numerical data and second language numerical data by using a double pointer checking method based on forward and reverse order to obtain a checking result.
[0149] The beneficial effects obtained by the device provided in the embodiments of this specification are consistent with the beneficial effects obtained by the above method and will not be repeated here.
[0150] Reference Fig.13As shown, based on the above-mentioned method for checking the numerical value of a dual-language report, a computer device 1302 is also provided in an embodiment of the present specification, wherein the above-mentioned method runs on the computer device 1302. The computer device 1302 may include one or more processors 1304, such as one or more central processing units (CPUs), and each processing unit may implement one or more hardware threads. The computer device 1302 may also include any memory 1306, which is used to store any kind of information such as code, settings, data, etc. Non-limiting, for example, the memory 1306 may include any one or more combinations of the following: any type of RAM, any type of ROM, flash memory device, hard disk, optical disk, etc. More generally, any memory may use any technology to store information. Further, any memory may provide volatile or non-volatile retention of information. Further, any memory may represent a fixed or removable component of the computer device 1302. In one case, when the processor 1304 executes an associated instruction stored in any memory or a combination of memories, the computer device 1302 may perform any operation of the associated instruction. The computer device 1302 also includes one or more drive mechanisms 1308 for interacting with any storage, such as a hard disk drive mechanism, an optical disk drive mechanism, etc.
[0151] The computer device 1302 may also include an input / output module 1310 (I / O) for receiving various inputs (via input devices 1312) and for providing various outputs (via output devices 1314). A specific output mechanism may include a presentation device 1316 and an associated graphical user interface (GUI) 1318. In other embodiments, the input / output module 1310 (I / O), input device 1312, and output device 1314 may not be included, and the computer device 1302 may be used as a computer device in a network. The computer device 1302 may also include one or more network interfaces 1320 for exchanging data with other devices via one or more communication links 1322. One or more communication buses 1324 couple the components described above together.
[0152] The communication link 1322 may be implemented in any manner, for example, through a local area network, a wide area network (e.g., the Internet), a point-to-point connection, etc., or any combination thereof. The communication link 1322 may include any combination of hardwired links, wireless links, routers, gateway functions, name servers, etc., governed by any protocol or combination of protocols.
[0153] Corresponding to Figures 1 to 8 In addition to the method shown, an embodiment of the specification also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above method are executed.
[0154] The embodiment of the present specification also provides a computer-readable instruction, wherein when the processor executes the instruction, the program therein causes the processor to execute the following Figures 1 to 8 The method shown.
[0155] The embodiments of the present specification also provide a computer program product, including at least one instruction or at least one program, wherein the at least one instruction or the at least one program is loaded and executed by a processor to implement the following Figures 1 to 8 The method shown.
[0156] It should be understood that in the various embodiments of this specification, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this specification.
[0157] It should also be understood that in the embodiments of this specification, the term "and / or" is only a description of the association relationship of the associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this specification generally indicates that the associated objects before and after are in an "or" relationship.
[0158] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in this specification can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this specification.
[0159] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0160] In the several embodiments provided in this specification, 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. In addition, 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, or it can be an electrical, mechanical or other form of connection.
[0161] 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 embodiments of this specification.
[0162] In addition, each functional unit in each embodiment of this specification 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 integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0163] 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 this specification 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, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of this specification. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0164] Specific embodiments are used in this specification to illustrate the principles and implementation methods of this specification. The description of the above embodiments is only used to help understand the methods and core ideas of this specification. At the same time, for those skilled in the art, according to the ideas of this specification, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on this specification.
Claims
1. A method for checking numerical values of a bilingual report, characterized in that: The method comprises: Obtaining the first-language and second-language texts of the target report; Parsing the first language text and the second language text to obtain numerical data of the first language text and the second language text; The corrected first language numerical data and second language numerical data are checked by using a double pointer checking method based on positive and reverse order to obtain a checking result.
2. The method according to claim 1, characterized in that The parsing of the first language text and the second language text to obtain numerical data of the first language text and the second language text includes: Dividing the first language text and the second language text into a plurality of chapter blocks according to the chapters; Respectively obtain text data in each of the chapter blocks in the first language text and the second language text, and obtain a first language text data list and a second language text data list for each chapter block; The numerical data in the first language text data list and the second language text data list are extracted to obtain the first language numerical data list and the second language numerical data list of each chapter block.
3. The method according to claim 2, characterized in that The step of respectively acquiring text data in each of the chapter blocks in the first language text and the second language text comprises: Perform text detection on each of the chapter blocks in the first language text and the second language text to obtain all text blocks and corresponding initial text lines in each of the chapter blocks; Obtaining the bounding boxes of all text blocks in each of the chapter blocks, and determining the coordinates of each text block according to the bounding boxes; According to the preset text line construction rules and the initial text lines, the text lines corresponding to all the text blocks in each of the chapter blocks are re-determined to obtain the final text lines corresponding to all the text blocks in each of the chapter blocks; According to the coordinates of the text blocks, the text blocks belonging to the same text line are sorted in a z-shape to obtain a text block list of each text line; Performing text recognition on the text blocks in the text block list of each text line to obtain text data of each text line; The text data of each text line in each chapter block are aggregated to obtain the text data in each of the chapter blocks.
4. The method according to claim 3, characterized in that: The step of re-determining text lines corresponding to all text blocks in each of the chapter blocks according to the preset text line construction rules and the initial text lines includes: Calculate the vertical difference between the first text block and the remaining text blocks in each initial text line according to the coordinates; Determining whether the longitudinal difference is less than a preset threshold; If yes, the text blocks whose vertical difference is less than a preset threshold are determined as the same text line; If not, the vertical difference between the text block having a vertical difference greater than a preset threshold and the first text block in the two adjacent upper and lower lines of its initial text line is calculated, and the text line corresponding to the text block is determined according to the vertical difference.
5. The method according to claim 1, characterized in that Before the double pointer checking method based on the forward and reverse order is used to check the corrected first language numerical data and the second language numerical data, the method further includes: The numerical data of the first language text and the second language text are corrected respectively using a pre-constructed rule correction library to obtain corrected first language numerical data and second language numerical data.
6. The method according to claim 5, characterized in that The rule correction library includes a number of regular expressions and corresponding standard formats; The method of using a pre-built rule correction library to correct the numerical data of the first language text and the second language text respectively includes: Using the regular expression to match the numerical data of each text line in the first language text and the second language text one by one; If the match is successful, the corresponding numerical data is corrected according to the standard format corresponding to the matching regular expression to obtain the corrected numerical data.
7. The method according to claim 1, characterized in that The method of using the double pointer checking method based on the forward and reverse order to check the corrected first language numerical data and the second language numerical data includes: Sort the corrected first language numerical data and second language numerical data in ascending order according to the number of text lines to obtain a positive sequence array of the first language numerical data and the second language numerical data; sorting the corrected first language numerical data and second language numerical data in descending order according to the number of text lines respectively, to obtain a reverse order array of the first language numerical data and the second language numerical data; Using a double pointer checking method to check the positive sequence array and the reverse sequence array of the first language numerical data and the second language numerical data, to obtain a positive sequence checking result and a reverse sequence checking result; A logical operation is performed on the positive order verification result and the reverse order verification result to obtain a verification result.
8. The method according to claim 7, characterized in that Using a double pointer checking method to check the positive sequence array of the first language numerical data and the second language numerical data includes: Initializing a first pointer and a second pointer in the positive sequence arrays of the first language numerical data and the second language numerical data, respectively, the first pointer and the second pointer pointing to initial positions of the first language numerical data array and the second language numerical data array, respectively; Get the text line corresponding to the numerical data in each chapter block; Using the first pointer and the second pointer, respectively traverse the text lines in each chapter block of the first language numerical data array and the second language numerical data array in the order of text lines; If the numerical data corresponding to a certain text line of the first language numerical data array and the second language numerical data array are inconsistent, determining whether the number of text lines of the first language numerical data and the number of text lines of the second language numerical data are the same; If not, the numerical data array corresponding to the pointer with the larger number of text lines is used to traverse the numerical data array according to the preset maximum number of lines to move downward, and the numerical data obtained after the traversal is compared with another numerical data array to obtain a comparison result.
9. The method according to claim 1, characterized in that: The method further comprises: Screening the comparison results for discrepancies between the first language text and the second language text; Determine the position of the difference result in the first language text and the second language text, and highlight the position to obtain the marked first language text and the second language text; The annotated first language text and second language text are sent to a terminal corresponding to the business personnel.
10. A dual-language report value verification device, characterized in that: The device comprises: An acquisition module, used for acquiring a first language text and a second language text of a target report; A parsing module, used for parsing the first language text and the second language text to obtain numerical data of the first language text and the second language text; The checking module is used to check the corrected first language numerical data and second language numerical data by using a double pointer checking method based on forward and reverse order to obtain a checking result.
11. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 9 is implemented.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.
13. A computer program product, characterized in that The method comprises at least one instruction or at least one program, wherein the at least one instruction or the at least one program is loaded and executed by a processor to implement the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Error correction module and method in software translation system
CN101950286A
Engineered bacteria for production and release of therapeutics
CN107709558A
Quantifier error correction method and system for translated text in translation
CN111191440A
Text translation model training method, text translation method and related device
CN114595702A
Train running state data processing method and device and electronic equipment
CN115230775A