CN115906785A - Table labeling method, device, equipment and storage medium - Google Patents
Table labeling method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN115906785A CN115906785A CN202211327071.3A CN202211327071A CN115906785A CN 115906785 A CN115906785 A CN 115906785A CN 202211327071 A CN202211327071 A CN 202211327071A CN 115906785 A CN115906785 A CN 115906785A
- Authority
- CN
- China
- Prior art keywords
- target
- cell
- attribute information
- information
- detail
- 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.)
- Pending
Links
- 238000002372 labelling Methods 0.000 title claims abstract description 103
- 238000000034 method Methods 0.000 claims description 40
- 238000004590 computer program Methods 0.000 claims description 11
- 238000000605 extraction Methods 0.000 abstract description 11
- 238000012015 optical character recognition Methods 0.000 abstract description 4
- 238000013473 artificial intelligence Methods 0.000 abstract description 3
- 238000013135 deep learning Methods 0.000 abstract description 3
- 238000010586 diagram Methods 0.000 description 12
- 238000012549 training Methods 0.000 description 10
- 238000004891 communication Methods 0.000 description 8
- 230000001960 triggered effect Effects 0.000 description 7
- 238000012795 verification Methods 0.000 description 7
- 230000008569 process Effects 0.000 description 6
- 238000012545 processing Methods 0.000 description 6
- 235000019483 Peanut oil Nutrition 0.000 description 5
- 239000000312 peanut oil Substances 0.000 description 5
- 241000758789 Juglans Species 0.000 description 3
- 235000009496 Juglans regia Nutrition 0.000 description 3
- 238000013075 data extraction Methods 0.000 description 3
- 238000013136 deep learning model Methods 0.000 description 3
- 238000005553 drilling Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 235000020234 walnut Nutrition 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 239000003086 colorant Substances 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000004069 differentiation Effects 0.000 description 1
- 238000006073 displacement reaction Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/30—Computing systems specially adapted for manufacturing
Landscapes
- Image Analysis (AREA)
Abstract
The disclosure provides a table labeling method, a table labeling device, table labeling equipment and a storage medium, and relates to the technical field of artificial intelligence, in particular to the technical fields of deep learning, table extraction, OCR (optical character recognition) and the like. The table labeling method comprises the following steps: acquiring a table to be marked, wherein the table comprises a target cell, and the target cell comprises a cell in which key value pair data to be extracted are located; determining a target label corresponding to the target cell, wherein the target label is used for adding target labeling information to the target cell; based on the target label, adding target labeling information to the target cell, wherein the target labeling information comprises: first attribute information and second attribute information, the first attribute information being used to identify a key in the key-value pair data, the second attribute information being used to identify a value in the key-value pair data. The present disclosure may provide a general table labeling scheme for table extraction.
Description
Technical Field
The present disclosure relates to the field of artificial intelligence technologies, and in particular, to the technical fields of deep learning, table extraction, optical Character Recognition (OCR), and the like, and in particular, to a table labeling method, apparatus, device, and storage medium.
Background
In order to extract data in the table, data extraction may be performed based on a rule, for example, a rule that data in a cell whose row header is a and column header is B (both a and B are preset contents) is extracted, and data in a cell whose row header is a and column header is B is extracted based on the rule. However, the method of extracting data based on the rule can only process the table with a fixed format, for example, the rule based on the row header and the column header needs the content of the row header and the column header of the table to be fixed.
With the development of deep learning technology, a deep learning model can be adopted to extract data of the table. The deep learning model is adopted to extract data of the table, so that the problem that the application range is limited due to the fact that data extraction is carried out based on rules can be solved.
The deep learning model can be obtained by training a labeled table serving as a sample, and therefore the problem of how to label the table needs to be solved.
Disclosure of Invention
The disclosure provides a table labeling method, a table labeling device, a table labeling equipment and a storage medium.
According to an aspect of the present disclosure, there is provided a table labeling method, including: acquiring a table to be marked, wherein the table comprises a target cell, and the target cell comprises a cell in which key value pair data to be extracted are located; determining a target label corresponding to the target cell, wherein the target label is used for adding target labeling information to the corresponding target cell; based on the target label, adding target labeling information to the target cell, wherein the target labeling information comprises: first attribute information and second attribute information, the first attribute information being used to identify a key in the key-value pair data, the second attribute information being used to identify a value in the key-value pair data.
According to another aspect of the present disclosure, there is provided a table labeling apparatus including: the system comprises an acquisition module, a marking module and a marking module, wherein the acquisition module is used for acquiring a table to be marked, the table comprises target cells, and the target cells comprise cells in which key value pair data to be extracted are located; the determining module is used for determining a target label corresponding to the target cell, and the target label is used for adding target labeling information to the corresponding target cell; a labeling module, configured to add target labeling information to the target cell based on the target label, where the target labeling information includes: first attribute information and second attribute information, the first attribute information being used to identify a key in the key-value pair data, the second attribute information being used to identify a value in the key-value pair data.
According to another aspect of the present disclosure, there is provided an electronic device including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of the above aspects.
According to another aspect of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method according to any one of the above aspects.
According to another aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of the above aspects.
According to the technical scheme of the disclosure, a general table labeling scheme aiming at table extraction can be provided.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is a schematic diagram according to a first embodiment of the present disclosure;
FIG. 2 is a schematic diagram of a form to be labeled according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of an application scenario to which embodiments of the present disclosure are applicable;
FIG. 4 is a schematic illustration of an interface of a tagging tool provided in accordance with an embodiment of the disclosure;
FIG. 5 is a schematic diagram according to a second embodiment of the present disclosure;
FIG. 6 is a schematic diagram of an annotated result provided in accordance with an embodiment of the present disclosure;
FIG. 7 is a schematic illustration of another annotation result provided in accordance with an embodiment of the present disclosure;
FIG. 8 is a schematic illustration of another annotated result provided in accordance with an embodiment of the present disclosure;
FIG. 9 is a schematic illustration of another annotated result provided in accordance with an embodiment of the present disclosure;
FIG. 10 is a schematic diagram according to a third embodiment of the present disclosure;
FIG. 11 is a schematic diagram of an electronic device for implementing a table labeling method according to an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of embodiments of the present disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram according to a first embodiment of the present disclosure, which provides a table labeling method, including:
And 102, determining a target label corresponding to the target cell, wherein the target label is used for adding target labeling information to the corresponding target cell.
103, adding target labeling information to the target cell based on the target label, wherein the target labeling information comprises: first attribute information and second attribute information, the first attribute information being used to identify a key in the key-value pair data, the second attribute information being used to identify a value in the key-value pair data.
Wherein the basic cells in the table that hold data are cells.
The table cells can be divided into header cells and detail cells, the header cells are the cells where the header is located, and the header can also be called a title, which is a general name of a category of contents. The detail cell is a cell in which the specific content is located.
For example, as in the table shown in fig. 2, the cells in the first row are header cells and the other cells are detail cells.
For tables, the data to be extracted is typically key-value pair (key-value) data, which includes pairs of keys and values. For example, as shown in fig. 2, wherein < item name, peanut oil > constitutes one pair of key-value pair data, < item name, apple > constitutes another pair of key-value pair data, and < item name, walnut > constitutes another pair of key-value pair data.
The target cells include the cell in which the key-value pair data to be extracted is located, e.g., assuming that key-value pair data within the second column of the table shown in fig. 2 is to be extracted, then four cells of the second column are the target cells.
The key value pair data to be extracted can be one type or multiple types according to actual requirements. For example, the category of key-value pair data to be extracted is the category "item name"; alternatively, the categories of key-value pair data to be extracted may include: the "item name" category and the "remaining inventory" category. Accordingly, the target cells may be one or more groups, for example, the target cell corresponding to "item name" is the cell of the second column, and the target cell corresponding to "remaining inventory amount" is the cell of the fourth column.
And labeling each group of target cells by adopting corresponding labels. Wherein different target labels can be adopted for different groups of target cells.
For example, N (N is a positive integer) labels may be preset, each label corresponds to one category, and each label adds labeling information to the target cell of the corresponding category. Specifically, for example, the labels include a first label and a second label (which are different), and the labeling information may be added to the target cells in the second column by using the first label, and the labeling information may be added to the target cells in the fourth column by using the second label.
Since the table may include other cells besides the target cell, that is, cells that do not need to be extracted, for differentiation, the label information of the target cell may be referred to as target label information, and the label of the target cell may be referred to as a target label. The label information of other cells can be called other label information (or auxiliary label information), and the label of other cells can be called other label (or auxiliary label).
For other cells, a uniform label (e.g., other labels) may be used for labeling, for example, for the cell in the first column and the cell in the third column of table 2, other labels may be used for labeling.
Because the key-value pair data includes a key and a value, in order to extract the key-value pair data accurately, when labeling, a labeled key and a labeled value need to be distinguished, and for this reason, the target labeling information includes: first attribute information and second attribute information, the first attribute information being used to identify a key in the key-value pair data, the second attribute information being used to identify a value in the key-value pair data.
In this embodiment, target labeling information is added to a target cell in a table based on a target tag, where the target labeling information includes: the method comprises the steps that first attribute information and second attribute information are obtained, the first attribute information is used for identifying keys in key value pair data to be extracted, the second attribute information is used for identifying values in the key value pair data, the keys and the values can be distinguished through target marking information, accurate marking data can be provided for model training, and then table extraction can be carried out based on a model, so that a universal table marking scheme aiming at the table extraction can be provided.
For better understanding of the embodiments of the present disclosure, an application scenario to which the embodiments of the present disclosure are applicable is described below.
As shown in fig. 3, a user (e.g., a annotator) can use an annotation tool 301 to annotate a table to be annotated on a user terminal, so as to obtain an annotated table. The labeled table comprises data of the table and labeled data of the table, and the data can be converted into data in a specific format, such as data in a JSON format, so that the data can be used as training data to perform model training to obtain a model for table extraction. And then the data extraction can be carried out on the table to be extracted by adopting the model. The user terminal may be a Personal Computer (Personal Computer), a notebook Computer, a mobile device (such as a mobile phone), and the like, and the marking tool 301 is software disposed on the user terminal.
As shown in FIG. 4, the interface of the annotation tool can include an annotation interface 401 and a configuration interface 402. The marking interface 401 may display a table to be marked and marking information, and the marking tool may mark the table to be marked based on an operation of a user. At least one label preset by the user can be displayed in the configuration interface 402, for example, the annotation tool can provide a create button, the user creates the label through the create button, and the created label can be displayed in the configuration interface. When creating a tag, the user may perform operations such as naming the created tag, as shown in fig. 4, assuming that three tags are created, the names being "item name", "remaining stock amount", and "other", respectively. It will be appreciated that the name of the tag is customized, and may be the same as or different from the header of the table, e.g., the corresponding "item name" may also be named "item name", etc.
Each tag may be in an expanded state or a closed state, and in the expanded state, fields included in the tag may be displayed. As shown in fig. 4, the label "item name" is in an unfolded state as an example.
The fields included in each tag may be fixed, i.e., the tagging tool may default to the fields included in the tag, as shown in fig. 4, and each tag may include three fields, which may be referred to as a first field (denoted by K), a second field (denoted by V), and a direction field, respectively.
The cell in which the key-value pair data to be extracted is located may be referred to as a target cell, and the label corresponding to the target cell may be referred to as a target label. The target labels corresponding to different groups of target cells are different. For example, the "item name" and the "remaining stock quantity" are two target tags, and correspond to a set of target cells, respectively.
Cells other than the target cell may be referred to as other cells, and may share a unified label for other cells, which may be named "other" labels in fig. 4.
Target labeling information can be added to the target cell by using the target label, and other labeling information can be added to other cells by using other labels.
The target cell comprises a header cell and a detail cell, and for the data to be extracted as key-value pair data, the header cell records the key of the key-value pair data, and the detail cell records the value of the key-value pair data.
The detail cells may further include a target detail cell that meets a preset condition, where the preset condition is, for example, the last detail cell, and the last detail cell is a detail cell farthest from the position of the header cell, for example, if the target cell is a column cell, and the header is located at the uppermost row, the last detail cell is a detail cell in the last row in the column. As for the second column of fig. 2, the cell in which the "walnut" is located is the target detail cell.
The target tag includes: a first field and a second field, the first field being used for adding the first attribute information, the second field being used for adding the second attribute information;
adding target labeling information to the target cell based on the target label, including:
adding the first attribute information to the table head cell based on the first field;
and adding the second attribute information for the target detail cell based on the second field.
Taking the example of adding the target labeling information to the corresponding target cell by using the label of the 'article name', for the table head cell, that is, the cell where the 'article name' in the table is located, the first field (K) may be triggered to be in the activated state first, if the frame corresponding to the K field is clicked, the first field (K) may be triggered to be in the activated state, and then the table head cell is selected (if the table head cell is clicked or the table head cell is selected in a frame), so that the labeling information corresponding to the K, that is, the first attribute information may be added to the table head cell.
For the target detail cell, for example, the last detail cell, the second field (V) may be triggered to be in the activated state, for example, the box corresponding to the V field is clicked to trigger the second field (V) to be in the activated state, and then the target detail cell is selected (for example, clicking to select or frame to select), so that the label information corresponding to V, that is, the second attribute information, may be added to the target detail cell.
In addition, if the detail cells further include other detail cells except for the target detail cell, for example, for the second column of fig. 2, the cell in which "peanut oil" and "apple" are located is the other detail cell, the direction field of the target label may be used to add the direction information to the cell. Clicking on a box like the direction field triggers it to be activated and then manually or automatically adding direction information, which may be indicated by a direction arrow, for example.
For the target cell, it may also include a mixed cell, which refers to a cell that records both a key and a value. For the mixed cells, the mixed cells can be marked with first attribute information and second attribute information as a whole; or the mixed cell is partitioned into a first area where the key is located and a second area where the value is located, the first area is labeled with the first attribute information, and the second area is labeled with the second attribute information.
In combination with the application scenario, the present disclosure further provides a table labeling method.
Fig. 5 is a schematic diagram according to a second embodiment of the present disclosure, which provides a table labeling method, including:
and step 501, obtaining a table to be labeled.
The table to be labeled comprises a target cell, and the target cell is a cell where key value pair data to be extracted are located.
In addition, in this embodiment, the table further includes: other cells than the target cell.
For example, referring to fig. 6, assuming that the target cells are two groups, two cells in the second column and two cells in the fourth column, respectively, the cells in the first and third columns are the other cells.
Steps 502-503 may be performed for the target cell, and step 504 may be performed for the other cells.
Here, referring to fig. 4, it is assumed that three tags are preset, and for the target cell in the second column, the target tag thereof is a tag corresponding to "item name", and for the target cell in the fourth column, the target tag thereof is a tag corresponding to "remaining stock amount".
For example, when the user needs to label the target cells in the second column, the label corresponding to the "article name" may be expanded, and the labeling tool may determine the label corresponding to the user expansion instruction as the target label.
When configuring the target tag, in addition to configuring the name of the target tag, the display attribute of the target tag may be configured, and different display attributes may be provided for different target tags. The display attributes include, for example, colors, lines, and the like.
As the target label is used for adding the target labeling information, the target labeling information corresponding to different target labels may have different display attributes, and as shown in fig. 6, lines corresponding to the target labeling information corresponding to the target cell in the second column and lines corresponding to the target labeling information corresponding to the target cell in the fourth column are represented by different thicknesses.
The target cells comprise a header cell and a detail cell, taking the target cell in the second column as an example, the cell in which the 'article name' is positioned is the header cell, and the cell in which the peanut oil is positioned is the detail cell.
Further, the detail cells may include target detail cells satisfying a preset condition.
The preset condition may be that each detail cell is set as a target detail cell. Or,
the preset condition may be the last detail cell, and the last detail cell refers to the detail cell farthest from the head cell in the target cell. Taking the target cell as a column cell for example, and the head cell is located in the first row, the target detail cell is the detail cell in the last row in the column.
When the first attribute information and the second attribute information are added, the first attribute information may be added to the header cell and the second attribute information may be added to the target detail cell. The first attribute information and the second attribute information may have different display attributes, as shown in fig. 6, in which the first attribute information and the second attribute information are respectively represented by different line shapes.
When adding the label information, the label may be used for adding.
Specifically, the target tag includes: a first field and a second field, wherein the first field is used for adding the first attribute information, and the second field is used for adding the second attribute information;
adding target labeling information to the target cells based on the target labels, wherein the target labeling information comprises:
adding the first attribute information to the table head cell based on the first field;
and adding the second attribute information to the target detail cell based on the second field.
In this embodiment, the target tag includes a first field and a second field, and may add first attribute information to the header cell based on the first field and add second attribute information to the target detail cell based on the second field.
Corresponding to the same table head cell, one or more detail cells may be provided, and the detail cells include target detail cells satisfying a preset condition. Detail cells other than the target detail cell may be referred to as other detail cells.
As shown in fig. 7, it is assumed that the cell in the second column is a target cell, the cell in which the "article name" is located is a table cell, the cell in which the "walnut" is located is a target detail cell, the cell in which the "peanut oil" is located and the cell in which the "apple" is located are other detail cells.
Since the same header cell may be associated with one or more detail cells, direction information may be added to improve generalization.
Accordingly, the target tag further comprises: a direction field for adding direction information for characterizing a direction of the target detail cell relative to the header cell; the detail cell further includes: the detail cells other than the target detail cell are positioned between the head cell and the target detail cell; adding target labeling information to the target cells based on the target labels, and further comprising: and adding the direction information on the other detail cells based on the direction field.
In addition, if there is only one detail cell corresponding to the same header cell, the direction information may be added to the detail cell or between two label frames (a frame corresponding to the first attribute information and a frame corresponding to the second attribute information). For example, the direction information (not shown in the figure) is added on the cell corresponding to the "peanut oil" in fig. 6.
If there are a plurality of the detail cells, that is, if there are other detail cells in addition to the target detail cell, as shown in fig. 7, direction information may be added to the other detail cells.
As shown in fig. 7, in addition to adding the first attribute information to the head cell and adding the second attribute information to the target detail cell, direction information may be added to other detail cells, and the direction information in fig. 7 is indicated by a downward arrow.
When adding the first attribute information to the header cell, it may be that the first field is triggered to be in an activated state, and when the first field is in the activated state, the first attribute information is added to the header cell in response to a selected instruction for the header cell.
When adding the second attribute information to the target detail cell, it may be that the second field is triggered to be in an activated state, and when the second field is in the activated state, the second attribute information is added to the target detail cell in response to a selected instruction for the target detail cell.
Taking the example of adding the first attribute information to the header cell where the "article name" is located, after the user clicks the frame corresponding to the first field (K field) in the target tag of the "article name", the first field of the target tag is in an activated state, at this time, after the user reselects (e.g., selects or clicks) the header cell where the "article name" is located in the table, the marking tool adds the first attribute information to the header cell, as shown in fig. 7, the first attribute information is represented by a solid frame, for example. The manner of adding the second attribute information for the target detail cell is similar and will not be described in detail.
In addition, the header cells may have a nesting condition, and for the nested header cells, each header cell needs to add corresponding first attribute information. For example, referring to fig. 8, the table cell in which the "drilling parameter" is located, and the table cell in which the "weight on bit" is located, the table cell in which the "rotation speed" is located, and the table cell in which the "displacement" is located are nested, and in this case, the first attribute information represented by a solid line frame as shown in fig. 8 needs to be added for each table cell.
In addition, the same detail cell may correspond to multiple table head cells, and if the cell in which "80" is located in fig. 8 corresponds to the cell in which "weight on bit" is located and the cell in which "drilling parameter" is located, the detail cell needs to be labeled multiple times, that is, the detail cell in which "80" is located may be labeled with the second attribute information twice, one time is corresponding to the first attribute information of the cell in which "weight on bit" is located, and the other time is corresponding to the first attribute information of the cell in which "drilling parameter" is located.
When adding the direction information based on the direction field, the direction field in the trigger target tag may be in an activated state, and when the direction field is in the activated state, the direction arrow described above is added. The direction field is activated, for example, by receiving a click command from the user for the box corresponding to the direction field. Adding a directional arrow may be manually added, for example, a user may draw a directional arrow on the form after clicking on a box of the directional field. Alternatively, the direction arrow may be automatically generated, for example, after the user clicks on the box of the direction field, the marking tool automatically generates the direction arrow according to the position of the head cell and the position of the target detail cell.
In this embodiment, direction information is added based on the direction field, other detail cells can be labeled, and compared with a method of labeling second attribute information for each detail cell, adding direction information can reduce workload and improve labeling efficiency.
For the target cell, in addition to the header cell and the detail cell, a mixed cell may be included, the mixed cell being a cell that records both a key and a value, and the cell of the last row shown in fig. 9 being a mixed cell.
For a mixed cell, the mixed cell comprising a first region and a second region, the first region having keys in the key-value pair data recorded therein, and the second region having values in the key-value pair data recorded therein; correspondingly, adding target labeling information to the target cell based on the target label comprises: taking the whole mixed cell as a header cell, and adding the first attribute information to the mixed cell based on the first field of the target label; taking the whole mixed cell as a detail cell, and adding the second attribute information to the mixed cell based on the second field of the target label; or, based on the first field, adding the first attribute information to the first region of the mixed cell, and adding the second attribute information to the second region of the mixed cell.
That is, the mixed cells may be denoted as a whole by K (first attribute information) and by V (second attribute information), and the direction information at this time may be denoted by any direction information, such as any one of downward, upward, leftward, and rightward. This way of labeling may be applied to situations where key-value pair data within a mixed cell does not need to be extracted.
Or the mixed cells can be split and respectively marked as K and V, and the direction at the moment is marked based on the actual directions of the K and the V. For example, in fig. 9, "total sum of money (capitalization)" is denoted as the first attribute information, and "sanwan (inclusive of tax)" is denoted as the second attribute information, and in this case, if direction information is further denoted, it may be denoted to the right (not shown). The labeling mode can be suitable for the condition that key value pair data in the mixed cells need to be extracted.
In this embodiment, for a mixed cell, the mixed cell may be labeled as first attribute information and labeled as second attribute information as a whole; or the mixed cells can be partitioned, the partitioned areas are marked as the first attribute information and the second attribute information, the mixed cells can be marked according to actual needs, and the marking flexibility is improved.
And aiming at other cells, other unified labels can be adopted to add other unified labeling information.
For example, as shown in fig. 6, the cell in the first column and the cell in the third column are other cells, and the corresponding other label information is the same and different from the target label information.
In this embodiment, unified marking is carried out for other cells based on other labels, because other cells all are the cell that need not extract to need not distinguish, can reduce marking work load based on unified marking, improve marking efficiency.
Wherein, steps 502-503 and step 504 have no timing restriction.
After the target cell and other cells are labeled, verification can be performed, that is, the following steps can be performed:
The method comprises the steps of checking each cell, checking whether each cell has label information or not, indicating that a preset condition is met if the cell has the label information, and otherwise, not meeting the preset condition. Having annotation information may include: the corresponding cells are labeled with first attribute information, second attribute information, direction information, or other labeling information. In addition, the corresponding direction information needs to exist for the second attribute information.
The verification process may be triggered and executed based on a user, for example, a verification button exists in the marking tool, and a verification process may be triggered after the user clicks the verification button; or, the user may automatically trigger the verification process after completing the labeling, for example, after the user clicks a label completion button or clicks an upload label data button, the labeling tool may automatically trigger the verification process.
That is, if the labeling information of all cells in the table satisfies the preset condition, the table having the labeling information is regarded as the labeled table.
In addition, the marked table may be converted into a standard format based on a preset rule, for example, data converted into a JSON format may be used as training data to train a table extraction model, and then the table extraction model is used to extract data of the table to be extracted.
And 507, displaying prompt information, wherein the prompt information is used for prompting the cells which do not meet the preset conditions.
The user can correct the cells which do not meet the preset conditions based on the prompt information until the labeling information of all the cells meets the preset conditions.
In this embodiment, the accuracy of the labeling result can be ensured by verifying the labeled table.
Fig. 10 is a schematic diagram of a table labeling apparatus according to a third embodiment of the present disclosure, where the apparatus 1000 includes: an acquisition module 1001, a determination module 1002, and an annotation module 1003.
The obtaining module 1001 is configured to obtain a table to be labeled, where the table includes a target cell, and the target cell includes a cell where key-value pair data to be extracted is located; the determining module 1002 is configured to determine a target label corresponding to the target cell, where the target label is used to add target labeling information to the corresponding target cell; the labeling module 1003 is configured to add target labeling information to the target cell based on the target label, where the target labeling information includes: first attribute information and second attribute information, the first attribute information being used to identify a key in the key-value pair data, the second attribute information being used to identify a value in the key-value pair data.
In this embodiment, target labeling information is added to a target cell in a table based on a target tag, where the target labeling information includes: the method comprises the steps that first attribute information and second attribute information are obtained, the first attribute information is used for identifying keys in key value pair data to be extracted, the second attribute information is used for identifying values in the key value pair data, the keys and the values can be distinguished through target marking information, accurate marking data can be provided for model training, and then table extraction can be carried out based on a model, so that a universal table marking scheme aiming at the table extraction can be provided.
In some embodiments, the target cell comprises: the table head unit cell records the key in the key value pair data, the detail unit cell records the value in the key value pair data, and the detail unit cell comprises a target detail unit cell meeting preset conditions; the target tag includes: a first field and a second field, wherein the first field is used for adding the first attribute information, and the second field is used for adding the second attribute information; the labeling module 1003 is further configured to: adding the first attribute information to the table head cell based on the first field; and adding the second attribute information for the target detail cell based on the second field.
In this embodiment, the target tag includes a first field and a second field, and may add first attribute information to the header cell based on the first field and add second attribute information to the target detail cell based on the second field.
In some embodiments, the target tag further comprises: a direction field for adding direction information for characterizing a direction of the target detail cell relative to the header cell; the detail cell further includes: (ii) other detail cells outside of the target detail cell, and the other detail cells are located between the header cell and the target detail cell; the labeling module 1003 is further configured to: and adding the direction information on the other detail cells based on the direction field.
In this embodiment, direction information is added based on the direction field, other detail cells can be labeled, and compared with a method of labeling second attribute information for each detail cell, adding direction information can reduce workload and improve labeling efficiency.
In some embodiments, the target cell further comprises: a mixed cell comprising a first region and a second region, the first region having keys in the key-value pair data recorded therein and the second region having values in the key-value pair data recorded therein; the labeling module 1003 is further configured to: taking the whole mixed cell as a header cell, and adding the first attribute information to the mixed cell based on the first field of the target label; taking the whole mixed cell as a detail cell, and adding the second attribute information to the mixed cell based on the second field of the target label; or, based on the first field, adding the first attribute information to the first region of the mixed cell, and adding the second attribute information to the second region of the mixed cell.
In this embodiment, for a mixed cell, the mixed cell may be labeled as first attribute information and labeled as second attribute information as a whole; or the mixed cells can be partitioned, the partitioned areas are marked as the first attribute information and the second attribute information, the mixed cells can be marked according to actual needs, and the marking flexibility is improved.
In some embodiments, the table further comprises: cells other than the target cell; the labeling module 1003 is further configured to: and based on the other labels, adding other unified labeling information for the other cells.
In this embodiment, unified marking is carried out for other cells based on other labels, because other cells all are the cell that need not extract to need not distinguish, can reduce marking work load based on unified marking, improve marking efficiency.
In some embodiments, the apparatus 1000 further comprises: and the checking module is used for obtaining the marked table if the marking information of all the cells in the table meets the preset condition.
In this embodiment, the accuracy of the labeling result can be ensured by verifying the labeled table.
It is to be understood that in the disclosed embodiments, the same or similar elements in different embodiments may be referenced.
It is to be understood that "first", "second", and the like in the embodiments of the present disclosure are used for distinction only, and do not indicate the degree of importance, the order of timing, and the like.
In the technical scheme of the disclosure, the collection, storage, use, processing, transmission, provision, disclosure and other processing of the personal information of the related user are all in accordance with the regulations of related laws and regulations and do not violate the good customs of the public order.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
FIG. 10 illustrates a schematic block diagram of an example electronic device 1000 that can be used to implement embodiments of the present disclosure. The electronic device 1000 is intended to represent various forms of digital computers, such as laptops, desktops, workstations, servers, blade servers, mainframes, and other appropriate computers. The electronic device 1000 may also represent various forms of mobile apparatuses, such as personal digital assistants, cellular telephones, smart phones, wearable devices, and other similar computing apparatuses. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not intended to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 10, the electronic device 1000 includes a computing unit 1001 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 1002 or a computer program loaded from a storage unit 1008 into a Random Access Memory (RAM) 1003. In the RAM 1003, various programs and data necessary for the operation of the electronic apparatus 1000 can also be stored. The calculation unit 1001, the ROM 1002, and the RAM 1003 are connected to each other by a bus 1004. An input/output (I/O) interface 1005 is also connected to bus 1004.
A number of components in the electronic device 1000 are connected to the I/O interface 1005, including: an input unit 1006 such as a keyboard, a mouse, and the like; an output unit 1007 such as various types of displays, speakers, and the like; a storage unit 1008 such as a magnetic disk, optical disk, or the like; and a communication unit 1009 such as a network card, a modem, a wireless communication transceiver, or the like. The communication unit 1009 allows the electronic device 1000 to exchange information/data with other devices through a computer network such as the internet and/or various telecommunication networks.
Computing unit 1001 may be a variety of general and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 1001 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The calculation unit 1001 performs the respective methods and processes described above, such as a table structure recognition method or a model training method. For example, in some embodiments, the table structure recognition method or the model training method may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 1008. In some embodiments, part or all of the computer program may be loaded and/or installed onto electronic device 1000 via ROM 1002 and/or communications unit 1009. When the computer program is loaded into RAM 1003 and executed by computing unit 1001, one or more steps of the table structure recognition method or the model training method described above may be performed. Alternatively, in other embodiments, the computing unit 1001 may be configured to perform the table structure recognition method or the model training method in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), complex Programmable Logic Devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable retrieval device, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The Server may be a cloud Server, also called a cloud computing Server or a cloud host, and is a host product in a cloud computing service system, so as to solve the defects of high management difficulty and weak service extensibility in a traditional physical host and VPS service ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server incorporating a blockchain.
It should be understood that various forms of the flows shown above, reordering, adding or deleting steps, may be used. For example, the steps described in the present disclosure may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.
Claims (15)
1. A method of table labeling comprising:
acquiring a table to be marked, wherein the table comprises a target cell, and the target cell comprises a cell in which key value pair data to be extracted are located;
determining a target label corresponding to the target cell, wherein the target label is used for adding target labeling information to the target cell;
based on the target label, adding target labeling information to the target cell, wherein the target labeling information comprises: first attribute information and second attribute information, the first attribute information being used to identify a key in the key-value pair data, the second attribute information being used to identify a value in the key-value pair data.
2. The method of claim 1, wherein,
the target cell includes: the table head unit cell records keys in the key value pair data, the detail unit cell records values in the key value pair data, and the detail unit cell comprises a target detail unit cell meeting preset conditions;
the target tag includes: a first field and a second field, the first field being used for adding the first attribute information, the second field being used for adding the second attribute information;
adding target labeling information to the target cell based on the target label, including:
adding the first attribute information to the table head cell based on the first field;
and adding the second attribute information for the target detail cell based on the second field.
3. The method of claim 2, wherein,
the target tag further comprises: a direction field for adding direction information for characterizing a direction of the target detail cell relative to the header cell;
the detail cell further includes: the detail cells other than the target detail cell are positioned between the head cell and the target detail cell;
adding target labeling information to the target cell based on the target label, further comprising: and adding the direction information on the other detail cells based on the direction field.
4. The method of claim 2, wherein,
the target cell further comprises: a mixed cell comprising a first region and a second region, the first region having keys in the key-value pair data recorded therein, and the second region having values in the key-value pair data recorded therein;
adding target labeling information to the target cells based on the target labels, wherein the target labeling information comprises:
taking the whole mixed cell as a header cell, and adding the first attribute information to the mixed cell based on the first field of the target label; taking the whole mixed cell as a detail cell, and adding the second attribute information to the mixed cell based on the second field of the target label; or,
adding the first attribute information for the first region of the mixed cell and adding the second attribute information for the second region of the mixed cell based on the first field.
5. The method of any one of claims 1-4,
the table further includes: other cells than the target cell;
the method further comprises the following steps:
and based on the other labels, adding other unified labeling information for the other cells.
6. The method of claim 5, further comprising:
and if the labeling information of all the cells in the table meets the preset condition, obtaining the labeled table.
7. A form labeling apparatus comprising:
the system comprises an acquisition module, a marking module and a marking module, wherein the acquisition module is used for acquiring a table to be marked, the table comprises target cells, and the target cells comprise cells in which key value pair data to be extracted are located;
the determining module is used for determining a target label corresponding to the target cell, and the target label is used for adding target labeling information to the corresponding target cell;
a labeling module, configured to add target labeling information to the target cell based on the target label, where the target labeling information includes: first attribute information and second attribute information, the first attribute information being used to identify a key in the key-value pair data, the second attribute information being used to identify a value in the key-value pair data.
8. The apparatus of claim 7, wherein,
the target cell includes: the table head unit cell records keys in the key value pair data, the detail unit cell records values in the key value pair data, and the detail unit cell comprises a target detail unit cell meeting preset conditions;
the target tag includes: a first field and a second field, the first field being used for adding the first attribute information, the second field being used for adding the second attribute information;
the tagging module is further to:
adding the first attribute information to the table head cell based on the first field;
and adding the second attribute information for the target detail cell based on the second field.
9. The method of claim 8, wherein,
the target tag further comprises: a direction field for adding direction information for characterizing a direction of the target detail cell relative to the header cell;
the detail cell further includes: the detail cells other than the target detail cell are positioned between the head cell and the target detail cell;
the labeling module is further configured to:
and adding the direction information on the other detail cells based on the direction field.
10. The apparatus of claim 8, wherein,
the target cell further comprises: a mixed cell comprising a first region and a second region, the first region having keys in the key-value pair data recorded therein, and the second region having values in the key-value pair data recorded therein;
the tagging module is further to:
taking the whole mixed cell as a header cell, and adding the first attribute information to the mixed cell based on the first field of the target label; taking the whole mixed cell as a detail cell, and adding the second attribute information to the mixed cell based on the second field of the target label; or,
based on the first field, adding the first attribute information to the first region of the mixed cell and adding the second attribute information to the second region of the mixed cell.
11. The apparatus of any one of claims 7-10,
the table further includes: other cells than the target cell;
the labeling module is further configured to:
and based on the other labels, adding other unified labeling information for the other cells.
12. The apparatus of claim 11, further comprising:
and the checking module is used for obtaining the marked table if the marking information of all the cells in the table meets the preset condition.
13. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.
14. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-6.
15. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211327071.3A CN115906785A (en) | 2022-10-25 | 2022-10-25 | Table labeling method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211327071.3A CN115906785A (en) | 2022-10-25 | 2022-10-25 | Table labeling method, device, equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115906785A true CN115906785A (en) | 2023-04-04 |
Family
ID=86473540
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211327071.3A Pending CN115906785A (en) | 2022-10-25 | 2022-10-25 | Table labeling method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115906785A (en) |
-
2022
- 2022-10-25 CN CN202211327071.3A patent/CN115906785A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9824269B2 (en) | Enhanced interpretation of character arrangements | |
EP4040401A1 (en) | Image processing method and apparatus, device and storage medium | |
CN112579727B (en) | Document content extraction method and device, electronic equipment and storage medium | |
US20220121668A1 (en) | Method for recommending document, electronic device and storage medium | |
US20190065259A1 (en) | Service request based application feature activation | |
CN113836877B (en) | Text labeling method, device, equipment and storage medium | |
CN113657395A (en) | Text recognition method, and training method and device of visual feature extraction model | |
CN112989235A (en) | Knowledge base-based internal link construction method, device, equipment and storage medium | |
CN113836314A (en) | Knowledge graph construction method, device, equipment and storage medium | |
CN114218951B (en) | Entity recognition model training method, entity recognition method and device | |
CN113360685A (en) | Method, device, equipment and medium for processing note content | |
CN112784588B (en) | Method, device, equipment and storage medium for labeling text | |
CN118093965A (en) | Information processing method, device, equipment and storage medium | |
CN113836316A (en) | Processing method, training method, device, equipment and medium for ternary group data | |
CN113377924A (en) | Data processing method, device, equipment and storage medium | |
CN116401410B (en) | Method, device, storage medium and equipment for accessing map data to multi-scene graph database | |
CN108073678A (en) | Applied to document analyzing and processing method, system and the device in big data analysis | |
CN114239562B (en) | Method, device and equipment for identifying program code blocks in document | |
CN115906785A (en) | Table labeling method, device, equipment and storage medium | |
CN114417862A (en) | Text matching method, and training method and device of text matching model | |
CN107908724A (en) | A kind of data model matching process, device, equipment and storage medium | |
CN105446711B (en) | Obtain the method and device of the contextual information for software development task | |
CN111159234A (en) | Method and device for comparing reports | |
CN113343636B (en) | Method and device for setting marking line width, electronic equipment and storage medium | |
CN115203599B (en) | Information recommendation method, device, equipment and storage medium |
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 |