Search

CN-122021551-A - Form labeling method, form labeling device, electronic equipment, medium and program product

CN122021551ACN 122021551 ACN122021551 ACN 122021551ACN-122021551-A

Abstract

The embodiment of the application discloses a form labeling method, a form labeling device, electronic equipment, a medium and a program product. The method comprises the steps of obtaining marking line information of a target table area, determining cell boundary boxes of cells in the target table area according to the marking line information, encoding the cells based on the cell boundary boxes to obtain row and column encoding information of the cells, and generating a structured marking result corresponding to the target table area according to the row and column encoding information and the marking line information, wherein the structured marking result comprises structured position data of the cells and structured table data of the target table area. The embodiment of the application can improve the efficiency and accuracy of the form labeling.

Inventors

  • LIU SANJUN
  • QU ZHICAI
  • Ding shunyi
  • HAN XIAO
  • MEI JIANGYUAN

Assignees

  • 美的集团(上海)有限公司
  • 美的集团股份有限公司

Dates

Publication Date
20260512
Application Date
20260120

Claims (14)

  1. 1. A form labeling method, comprising: acquiring marking line information of a target table area; determining cell boundary boxes of cells in the target table area according to the marking line information; Coding each cell based on the cell boundary box to obtain row and column coding information of each cell; And generating a structured marking result corresponding to the target table area according to the row and column coding information and the marking line information, wherein the structured marking result comprises structured position data of each cell and structured table data of the target table area.
  2. 2. The method of claim 1, wherein the obtaining the annotation line information for the target table region comprises: Acquiring a target table area; Performing type recognition on the target table area to obtain the table type of the target table area; Displaying the target table area under the condition that the table type is a wireless table; And responding to the scribing operation of the user for the target table area, and acquiring the marking line information determined by the user for the target table area.
  3. 3. The method of claim 2, wherein the obtaining the annotation line information for the target table region further comprises: When the form type is a wired form, displaying the target form area, and taking a form line contained in the target form area as an initial marking line; Responding to the correction operation aiming at the target table area, and acquiring correction parameters corresponding to the correction operation; And determining the marking line information of the target table area based on the correction parameters and the initial marking line.
  4. 4. The method of claim 1, wherein the annotation line information comprises a cross line and a column line, wherein the determining a cell bounding box for each cell in the target table region based on the annotation line information comprises: determining a plurality of intersection point position positions of a plurality of intersection points based on a transverse line and a column line in the marking line information; Based on the longitudinal coordinates and the transverse coordinates of each intersection point position in the target table area, sequencing the plurality of intersection points to obtain an intersection point row sequence and an intersection point column sequence; and selecting the combination of any two adjacent row intersection points and any two adjacent column intersection points from the intersection point row sequence and the intersection point column sequence, and constructing a corresponding cell boundary frame to obtain the cell boundary frame of each cell in the target table area.
  5. 5. The method of claim 1, wherein the encoding the cells based on the cell bounding box to obtain the column and row encoded information for the cells comprises: Determining a row number corresponding to the cell according to the longitudinal position sequence of the cell boundary box in the target table area; Determining a column number corresponding to the cell according to the transverse position sequence of the cell boundary box in the target table area; and combining the row numbers and the column numbers corresponding to the cells to form row and column coding information of the cells.
  6. 6. The method of claim 1, wherein the annotation line information comprises cross-row lines and cross-column lines, and the generating the structured annotation result corresponding to the target table region according to the row-column coding information and the annotation line information comprises: determining a cell cross-row merging range according to the intersection relationship between the cross-row lines in the marking line information and the cell boundary boxes; determining a cell cross-column merging range according to the intersection relationship between the cross-column line in the marking line information and the cell boundary box; Determining row merging parameters and column merging parameters corresponding to each cell based on the cell cross-row merging range and the cell cross-column merging range; Taking the row and column coding information, the row merging parameters and the column merging parameters of each cell as structured position data of each cell; And generating structured form data of the target form area according to the row and column coding information and the structured position data of each cell, and obtaining a structured labeling result corresponding to the target form area.
  7. 7. The method of claim 6, wherein generating structured form data for the target form area from the row and column encoding information and the structured location data for each cell comprises: cell sorting is carried out according to the row and column coding information of each cell, and the arrangement sequence of each cell in the target table area is determined; Constructing a table row structure and a table column structure of the target table area based on the structured position data of each cell; and generating the structured table data of the target table area according to the table row structure and the table column structure.
  8. 8. The method of claim 1, wherein the structured labelling result further comprises an association between structured location data of the cells and cell content of the cells; The generating a structured labeling result corresponding to the target table area according to the row and column coding information and the labeling line information comprises the following steps: extracting cell contents in the corresponding cells according to the cell boundary boxes; And carrying out data association on the structured position data of each cell and the cell content to obtain an association relationship between the structured position data of each cell and the cell content so as to generate a structured labeling result corresponding to the target table area.
  9. 9. The method of claim 8, wherein the method further comprises: sorting the cells according to the row and column coding information of the cells, and determining the cell sequence of the cells in the target table area; Rendering and generating a table structure of a target table area based on the structured table data of the target table area; And filling the cell content of each cell into the associated cell based on the association relation between the structured position data of each cell and the cell content of each cell so as to generate a target table marking result of the target table area.
  10. 10. The method of claim 9, wherein the method further comprises: Displaying the labeling result of the target form; In response to detecting a content modification operation for the target form annotation result, acquiring content modification information and determining a corresponding target cell; highlighting the target cell in the target table labeling result based on the structured position data corresponding to the target cell; and updating the content modification information into the cell content corresponding to the target cell, and generating an updated target table marking result.
  11. 11. A form marking device, comprising: the first acquisition module is used for acquiring the marking line information of the target table area; The determining module is used for determining cell boundary boxes of all cells in the target table area according to the marking line information; The coding module is used for coding each cell based on the cell boundary box to obtain row and column coding information of each cell; The generation module is used for generating a structured marking result corresponding to the target table area according to the row and column coding information and the marking line information, wherein the structured marking result comprises structured position data of each cell and structured table data of the target table area.
  12. 12. An electronic device is characterized by comprising a processor and a memory; the processor is connected with the memory; The memory is used for storing executable program codes; The processor runs a program corresponding to executable program code stored in the memory by reading the executable program code for performing the method according to any one of claims 1-10.
  13. 13. A computer storage medium storing a plurality of instructions adapted to be loaded by a processor and to perform the method steps of any of claims 1-10.
  14. 14. A computer program product comprising instructions which, when run on a computer or a processor, cause the computer or the processor to perform the method steps of any of claims 1-10.

Description

Form labeling method, form labeling device, electronic equipment, medium and program product Technical Field The present application relates to the field of table data identification technologies, and in particular, to a table labeling method, a device, an electronic apparatus, a medium, and a program product. Background Optical character recognition (Optical Character Recognition, OCR) is a technology for converting printed or handwritten text into machine-readable text, which has been widely used in document digitizing, information extraction, automated form and ticket processing, assisted reading, and text translation and editing. In the application process, the table in the document often carries a large amount of structured information, which is an important object for information extraction. Therefore, how to perform efficient and high-quality structured labeling on table data is one of the key problems in the field of table identification and understanding. However, in the existing form data labeling mode, form cells are generally used as target detection frames to be labeled one by one, labeling rules are complex, and overall labeling efficiency and accuracy are low. Disclosure of Invention The embodiment of the application provides a form labeling method, a form labeling device, electronic equipment, a medium and a program product, which can improve the efficiency and the accuracy of form labeling. The technical scheme is as follows: in a first aspect, an embodiment of the present application provides a form labeling method, including: acquiring marking line information of a target table area; determining a cell boundary box of each cell in the target table area according to the marking line information; Coding each cell based on the cell boundary frame to obtain row and column coding information of each cell; And generating a structured marking result corresponding to the target table area according to the row and column coding information and the marking line information, wherein the structured marking result comprises structured position data of each cell and structured table data of the target table area. In one possible implementation manner, the obtaining the label line information of the target table area includes: Acquiring a target table area; performing type recognition on the target table area to obtain the table type of the target table area; displaying the target table area under the condition that the table type is a wireless table; And responding to the scribing operation of the user for the target table area, and acquiring the marking line information determined by the user for the target table area. In one possible implementation manner, the obtaining the label line information of the target table area further includes: When the form type is a wired form, displaying the target form area, and taking a form line contained in the target form area as an initial marking line; responding to the correction operation aiming at the target table area, and acquiring a correction parameter corresponding to the correction operation; And determining the marking line information of the target table area based on the correction parameter and the initial marking line. In one possible implementation, the marking line information includes a horizontal line and a column line, and the determining the cell bounding box of each cell in the target table area according to the marking line information includes: Determining a plurality of intersection point position positions of a plurality of intersection points based on a horizontal line and a column line in the marking line information; Ordering the plurality of intersection points based on the longitudinal coordinates and the transverse coordinates of the positions of the intersection points in the target table area to obtain an intersection point row sequence and an intersection point column sequence; And selecting a combination of any two adjacent row intersection points and any two adjacent column intersection points from the intersection point row sequence and the intersection point column sequence, and constructing a corresponding cell boundary frame to obtain the cell boundary frame of each cell in the target table area. In one possible implementation manner, the encoding the cells based on the cell bounding box to obtain the column and row encoding information of the cells includes: sequentially determining the row numbers corresponding to the cells according to the longitudinal positions of the cell boundary boxes in the target table area; Sequentially determining column numbers corresponding to the cells according to the transverse positions of the cell boundary boxes in the target table area; and combining the row numbers and the column numbers corresponding to the cells to form row and column coding information of the cells. In one possible implementation manner, the marking line information includes a cross line and a cross column line, and t