Data processing method and device, electronic device and storage medium

Through structured storage and loading of the text information and tags of the original document at the same layer, the target tags are constructed and reproduced, which solves the problems of poor readability and low accuracy of existing annotation methods and improves the efficiency and accuracy of annotation.

CN118172448BActive Publication Date: 2024-09-13CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410581667.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-11
Publication Date
2024-09-13
Estimated Expiration
2044-05-11

AI Technical Summary

Technical Problem

Existing text annotation methods have problems with poor readability, low annotation efficiency, and low accuracy in the field of artificial intelligence, leading to erroneous training results.

Method used

By structurally storing and loading the text information of the original document and the reproduced tags in the same layer, a tag to be reproduced that is consistent with the target tag is constructed, and its position in the original document is determined based on the identification information, and the tag is reproduced to achieve annotation. .

Benefits of technology

It improves the restoration degree and annotation accuracy of documents and reproduced tags, reduces annotation error rate, and improves annotation efficiency and loading speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118172448B
    Figure CN118172448B
Patent Text Reader

Abstract

The present disclosure discloses a data processing method and device, an electronic device and a storage medium, which can identify the text information and the reproduced labels of the original document, store the text information and the reproduced labels in a structured manner, and obtain structured text information and structured reproduced labels; load the structured text information and the reproduced labels at the same layer to obtain a document to be annotated, construct a label to be reproduced that is consistent with the first attribute information of the target label, and add the label to be reproduced to a label list; read each label to be reproduced in the label list, and determine the target start and end positions of the label to be reproduced in the original document according to the identification information of the label to be reproduced and the reproduced labels; reproduce the label to be reproduced according to the target start and end positions, the selected text segment, the label type and the background color, and obtain the target document. The present disclosure improves the restoration degree of the original document annotation, improves the annotation accuracy, reduces the error rate, and improves the loading speed and annotation efficiency of the document and the reproduced labels.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing technology, and in particular to a data processing method and device, an electronic device, and a storage medium. Background Art

[0002] In the field of artificial intelligence, in order to improve the accuracy of model recognition, it is usually necessary to train the model using annotated text content, so the higher the accuracy and restoration of the annotation of the text content, the better.

[0003] There are two main commonly used annotation methods: pure text rendering and annotation, and double-layer rendering and annotation. The pure text rendering and annotation method first extracts pure text information, discards pictures, tables, and special text styles, etc.; then selects the corresponding text on the pure text document, generates an area box with a background color, covers the text position, and sets a certain transparency so that the text can be seen and the label is obtained. However, since this method extracts text from the document and only retains the text part, it is impossible to identify whether the text comes from the table and the position of the text in the table. Therefore, this annotation method has low restoration, poor readability, and is not conducive to manual verification.

[0004] The double-layer rendering and labeling method uses the bottom layer to load the original document, completely retaining the text, pictures, and document layout style of the original document. The top layer is covered with a transparent canvas, and the text is selected on the canvas to draw a box with a background color, thereby achieving a visual selection effect of the text and obtaining a label. Due to the use of double-layer rendering, the relative position of the bottom layer and the top layer is prone to deviation, and the document indentation, spacing, font size, etc. of the bottom layer cannot be accurately mapped to the canvas. The box drawn on the top layer may not accurately cover the text on the bottom layer, and may be offset left or right, or up or down, with a high error rate and low accuracy.

[0005] Therefore, the existing labeling methods not only have poor readability and low labeling efficiency, but also very low accuracy. The labeling is prone to deviation, which can easily lead to errors in subsequent training results. Summary of the invention

[0006] The present disclosure provides a data processing method and device, an electronic device and a storage medium. The main purpose is to solve the problem that the existing annotation method not only has poor readability and low annotation efficiency, but also has low accuracy and is prone to annotation deviation, which easily leads to errors in subsequent training results.

[0007] According to a first aspect of the present disclosure, a data processing method is provided, the method being applied in a computer, comprising:

[0008] Identify the text information and reproduced tags of the original document, and store the identified text information and reproduced tags in a structured manner to obtain structured text information and structured reproduced tags;

[0009] Loading the structured text information and the reproduced label in the same layer to obtain a document to be annotated, wherein the document to be annotated is used to annotate the text information to obtain a target label;

[0010] Constructing a tag to be reproduced that is consistent with the first attribute information of the target tag, and adding the tag to be reproduced to the tag list, wherein the first attribute information and / or the second attribute information of the tag to be reproduced includes at least one of the selected text segment, the first and last positions of the selected text segment, the tag type, and the background color; the second attribute information also includes identification information of the tag to be reproduced;

[0011] Read each tag to be reproduced in the tag list, and determine the target start and end positions of the tag to be reproduced in the original document according to the identification information of the tag to be reproduced and the reproduced tags;

[0012] The tag to be reproduced is reproduced according to the target start and end positions, the selected text segment, the tag type and the background color to obtain a target document.

[0013] Optionally, the identifying the text information and the reproduced tags of the original document, and storing the identified text information and the reproduced tags in a structured manner to obtain the structured text information and the structured reproduced tags includes:

[0014] Identify the text information of the original document to obtain the paging information and the reproduced label of the original document, wherein the paging information includes the paging number of each paging;

[0015] According to the paging number, the content of each paging of the original document is identified to obtain corresponding picture information, table information and text information;

[0016] The reproduced labels, paging information, image information, table information and text information are stored in a structured manner and returned to the front-end page in the form of an interface.

[0017] Optionally, the constructing the tag to be reproduced that is consistent with the first attribute information of the target tag includes:

[0018] According to the first attribute information, setting the label type and background color in the second attribute information of the label to be reproduced;

[0019] Generate identification information of the tag to be reproduced according to the selected text segment in the first attribute information; the identification information is used to construct a mapping relationship between the identification information and the tag type, background color, selected text segment, and the first and last positions of the selected text segment of the tag to be reproduced;

[0020] Based on the mapping relationship between the identification information and the label type, background color, selected text segment, and the beginning and end positions of the selected text segment of the label to be reproduced, the second attribute information of the label to be reproduced is determined to obtain the label to be reproduced.

[0021] Optionally, the generating the identification information of the to-be-reproduced label according to the selected text segment in the first attribute information includes:

[0022] Determining whether the selected text segment is a single-line marked text segment;

[0023] If it is determined that the selected text segment is a text segment with a single line annotation, generating identification information of the to-be-reproduced label corresponding to the selected text segment;

[0024] If it is determined that the selected text segment is not a single-line marked text segment, splitting the selected text segment into a plurality of single-line marked sub-text segments;

[0025] Identification information of the to-be-reproduced labels corresponding to the sub-text segments annotated in the single line is generated respectively.

[0026] Optionally, determining the target first and last positions of the tag to be reproduced in the original document according to the identification information of the tag to be reproduced and the reproduced tag includes:

[0027] Determine a parent node corresponding to the tag to be reproduced according to the identification information of the tag to be reproduced;

[0028] When it is determined that there is no duplicated label in the parent node, obtaining the first character of the parent node;

[0029] The target first and last positions of the tag to be reproduced in the original document are determined according to the first character position of the parent node and the first and last positions of the selected text.

[0030] Optionally, after determining the parent node corresponding to the to-be-reproduced label according to the identification information of the to-be-reproduced label, the method further includes:

[0031] When it is determined that at least one already-reproduced label exists in the parent node, obtaining the last character position of the previous already-reproduced label of the label to be reproduced according to the identification information of the label to be reproduced;

[0032] The target first and last positions of the tag to be reproduced in the original document are determined according to the last character position of the previous reproduced tag of the tag to be reproduced and the first and last positions of the selected text.

[0033] Optionally, the tag to be reproduced is reproduced according to the target head and tail positions, the selected text segment, the tag type and the background color, including:

[0034] According to the target first and last positions of the tag to be reproduced in the original document, searching for the text segment corresponding to the target first and last positions in the original document;

[0035] Adding the tag type and background color corresponding to the tag to be reproduced to the text segments corresponding to the target first and last positions in the original document;

[0036] The selected text segment corresponding to the tag to be reproduced is used to replace the text segment corresponding to the target first and last positions in the original document to obtain the target document.

[0037] According to a second aspect of the present disclosure, there is provided a data processing device, comprising:

[0038] A recognition unit, used to recognize text information of the original document and the reproduced label;

[0039] A storage unit, used for storing the identified text information and the reproduced labels in a structured manner to obtain structured text information and structured reproduced labels;

[0040] A loading unit, used to load the structured text information and the reproduced label in the same layer to obtain a document to be annotated, and the document to be annotated is used to annotate the text information to obtain a target label;

[0041] A construction unit, configured to construct a tag to be reproduced that is consistent with the first attribute information of the target tag;

[0042] an adding unit, configured to add the tag to be reproduced into a tag list, wherein the first attribute information and / or the second attribute information of the tag to be reproduced includes at least one of a selected text segment, the first and last positions of the selected text segment, a tag type, and a background color; and the second attribute information also includes identification information of the tag to be reproduced;

[0043] A reading unit, used for reading each tag to be reproduced in the tag list;

[0044] A determination unit, configured to determine the target start and end positions of the tag to be reproduced in the original document according to the identification information of the tag to be reproduced and the reproduced tag;

[0045] The reproduction unit is used to reproduce the tag to be reproduced according to the target head and tail positions, the selected text segment, the tag type and the background color to obtain the target document.

[0046] In one embodiment provided by the present disclosure, the identification unit includes:

[0047] A first recognition module is used to recognize the text information of the original document to obtain the paging information and the reproduced label of the original document, wherein the paging information includes the paging number of each page;

[0048] A second recognition module is used to recognize the content of each page of the original document according to the page number, and obtain corresponding picture information, table information and text information;

[0049] The storage module is used to store the reproduced labels, paging information, image information, table information and text information in a structured manner, and return them to the front-end page in the form of an interface.

[0050] In one embodiment provided by the present disclosure, the building block comprises:

[0051] A setting module, used for setting the label type and background color in the second attribute information of the label to be reproduced according to the first attribute information;

[0052] A generating module, configured to generate identification information of the tag to be reproduced according to the selected text segment in the first attribute information; the identification information is used to construct a mapping relationship between the identification information and the tag type, background color, selected text segment, and the first and last positions of the selected text segment of the tag to be reproduced;

[0053] The first determination module is used to determine the second attribute information of the label to be reproduced based on the mapping relationship between the identification information and the label type, background color, selected text segment, and the first and last positions of the selected text segment of the label to be reproduced, so as to obtain the label to be reproduced.

[0054] In one embodiment provided by the present disclosure, the generating module is further used for:

[0055] Determining whether the selected text segment is a single-line marked text segment;

[0056] If it is determined that the selected text segment is a text segment with a single line annotation, generating identification information of the to-be-reproduced label corresponding to the selected text segment;

[0057] If it is determined that the selected text segment is not a single-line marked text segment, splitting the selected text segment into a plurality of single-line marked sub-text segments;

[0058] Identification information of the to-be-reproduced labels corresponding to the sub-text segments annotated in the single line is generated respectively.

[0059] In one embodiment provided by the present disclosure, the determining unit includes:

[0060] A second determination module, configured to determine a parent node corresponding to the to-be-reproduced label according to the identification information of the to-be-reproduced label;

[0061] A first acquisition module, configured to acquire the first character of the parent node when it is determined that no duplicated label exists in the parent node;

[0062] The third determination module is used to determine the target first and last positions of the tag to be reproduced in the original document according to the first word position of the parent node and the first and last positions of the selected text.

[0063] In one embodiment provided by the present disclosure, the third determination module is further used to:

[0064] After determining the parent node corresponding to the tag to be reproduced according to the identification information of the tag to be reproduced, if it is determined that at least one reproduced tag exists in the parent node, obtaining the last character position of the previous reproduced tag of the tag to be reproduced according to the identification information of the tag to be reproduced;

[0065] The target first and last positions of the tag to be reproduced in the original document are determined according to the last character position of the previous reproduced tag of the tag to be reproduced and the first and last positions of the selected text.

[0066] In one embodiment provided by the present disclosure, the reproduction unit includes:

[0067] A search module, used for searching for text segments corresponding to the target start and end positions of the tag to be reproduced in the original document according to the target start and end positions of the tag to be reproduced in the original document;

[0068] An adding module, used for adding a tag type and a background color corresponding to the tag to be reproduced to the text segment corresponding to the target first and last positions in the original document;

[0069] The replacement module is used to replace the text segments corresponding to the target start and end positions in the original document with the selected text segments corresponding to the tag to be reproduced, so as to obtain the target document.

[0070] According to a third aspect of the present disclosure, there is provided an electronic device, including:

[0071] at least one processor; and

[0072] a memory communicatively connected to the at least one processor; wherein,

[0073] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method described in the first aspect.

[0074] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method described in the first aspect.

[0075] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the method as described in the first aspect above.

[0076] The data processing method and device, electronic device and storage medium provided by the present disclosure identify text information and reproduced tags of an original document, and store the identified text information and reproduced tags in a structured manner to obtain structured text information and structured reproduced tags; load the structured text information and reproduced tags in the same layer to obtain a document to be annotated, and the document to be annotated is used to annotate the text information to obtain a target tag; construct a label to be reproduced that is consistent with the first attribute information of the target tag, and add the label to be reproduced to a label list, wherein the first attribute information and / or the second attribute information of the label to be reproduced includes at least one of a selected text segment, the head and tail positions of the selected text segment, the label type and the background color; the second attribute information also includes the identification information of the label to be reproduced; read each label to be reproduced in the label list, and determine the target head and tail positions of the label to be reproduced in the original document according to the identification information of the label to be reproduced and the reproduced label; reproduce the label to be reproduced according to the target head and tail positions, the selected text segment, the label type and the background color to obtain the target document. Compared with the related art, the present invention retains the format of the text information of the original document in a structured storage manner, and then annotates the loaded document to be annotated, thereby improving the restoration degree of the original document and the reproduced labels, and making it more readable; and adopts a method of loading structured text information and reproduced labels at the same layer, which greatly improves the accuracy of annotation, the annotation error rate is extremely low, and the document and reproduced labels are loaded quickly, which reduces waiting time and improves annotation efficiency.

[0077] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0078] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0079] Figure 1 A flowchart of a data processing method provided by an embodiment of the present disclosure;

[0080] Figure 2 A flowchart of another data processing method provided by an embodiment of the present disclosure;

[0081] Figure 3 A flowchart of a method for loading text information provided by an embodiment of the present disclosure;

[0082] Figure 4 A schematic diagram of a target tag to be excluded provided in an embodiment of the present disclosure;

[0083] Figure 5 A schematic diagram of a process for constructing a tag to be reproduced provided in an embodiment of the present disclosure;

[0084] Figure 6 A schematic diagram of another process for constructing a label to be reproduced provided in an embodiment of the present disclosure;

[0085] Figure 7 A schematic diagram of a reproduction process of a tag to be reproduced provided in an embodiment of the present disclosure;

[0086] Figure 8 A schematic diagram of the structure of a data processing device provided in an embodiment of the present disclosure;

[0087] Fig. 9 A schematic diagram of the structure of another data processing device provided by an embodiment of the present disclosure;

[0088] Fig.10 A schematic block diagram of an exemplary electronic device 500 provided for an embodiment of the present disclosure. DETAILED DESCRIPTION

[0089] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0090] The data processing method and apparatus, electronic device, and storage medium according to the embodiments of the present disclosure are described below with reference to the accompanying drawings.

[0091] Figure 1A flow chart of a data processing method provided in an embodiment of the present disclosure is provided. The method is applied in a computer. The detection method can be executed by a control device or equipment with information prompts. The device or equipment can be configured in a server, a processor or a main control chip.

[0092] like Figure 1 As shown, the method comprises the following steps:

[0093] Step 101, identifying the text information and reproduced tags of the original document, and storing the identified text information and reproduced tags in a structured manner to obtain structured text information and structured reproduced tags.

[0094] In one embodiment provided by the present disclosure, the text information includes paging, pictures, tables and text formats in the original document. The structured storage of the identified text information and reproduced tags refers to storing the text information and reproduced tags in the form of structured data. The structured data is also called row data, which refers to data that can be represented and stored using a relational database and is presented in a two-dimensional form. The characteristics of structured data are: data is in rows, a row of data represents the information of an entity, and the attributes of each row of data are the same. The reproduced tags refer to tags that have been reproduced in the original document.

[0095] Step 102, the structured text information and the reproduced label are loaded in the same layer to obtain a document to be annotated, and the document to be annotated is used to annotate the text information to obtain a target label.

[0096] In order to annotate the original document, it is necessary to load the structured text information and the reproduced tags at the same level to obtain the document to be annotated. The same-level loading means that the original document and the reproduced tags are loaded at the same level, and both loadings are derived from the structured text information and structured reproduced tags of the original document.

[0097] Step 103, construct a tag to be reproduced that is consistent with the first attribute information of the target tag, and add the tag to be reproduced to the tag list, wherein the first attribute information and / or the second attribute information of the tag to be reproduced includes at least one of the selected text segment, the first and last positions of the selected text segment, the tag type and the background color; the second attribute information also includes the identification information of the tag to be reproduced.

[0098] In one embodiment provided by the present disclosure, the target tag is a tag obtained by a user or other operator marking a text segment on the document to be marked, and the tag to be reproduced refers to a tag generated for replacing the original document according to the text information marked by the target tag after obtaining the target tag. Therefore, the tag to be reproduced includes the selected text segment, identification information, the head and tail positions of the selected text segment, the tag type and the background color. Among them, the selected text segment refers to the text segment selected by the user in the document to be marked. Since the document to be marked is restored from the original document, the content of the text segment selected in the document to be marked should be consistent with the content of the text segment at the same position in the original document. The identification information refers to the unique identification of the tag to be reproduced, and one tag to be reproduced corresponds to unique identification information. The head and tail positions of the selected text segment refer to the first word position (the position of the first word) and the last word position (the position of the last word) of the selected text segment, as well as the head and tail offset (the length from the first word to the last word in the text segment). The position of the selected text segment in the original document can be found by the beginning and end positions of the selected text segment. The label type and background color refer to the colors set to distinguish different types of labels, and one type of label corresponds to one background color.

[0099] Step 104, reading each tag to be reproduced in the tag list, and determining the target beginning and end positions of the tag to be reproduced in the original document according to the identification information of the tag to be reproduced and the reproduced tags.

[0100] In order to determine the target starting and ending positions of the to-be-reproduced tag in the original document, so as to facilitate the reproduction of the to-be-reproduced tag, it is necessary to read each to-be-reproduced tag in the tag list, obtain the identification information of each to-be-reproduced tag and the reproduced tag, and calculate the target starting and ending positions of each to-be-reproduced tag in the original document in turn.

[0101] Step 105, according to the target start and end positions, the selected text segment, the tag type and the background color, the tag to be reproduced is reproduced to obtain a target document.

[0102] After determining the target head and tail positions of the label to be reproduced, the label type and background color of the label to be reproduced are obtained to reproduce the label to obtain the corresponding reproduced label, and then the reproduced label is loaded on the same layer, thereby achieving synchronous labeling and improving labeling efficiency.

[0103] The data processing method provided by the present disclosure identifies text information and reproduced tags of an original document, and stores the identified text information and reproduced tags in a structured manner to obtain structured text information and structured reproduced tags; loads the structured text information and reproduced tags in the same layer to obtain a document to be annotated, and the document to be annotated is used to annotate the text information to obtain a target tag; constructs a label to be reproduced that is consistent with the first attribute information of the target tag, and adds the label to be reproduced to a label list, wherein the first attribute information and / or the second attribute information of the label to be reproduced includes at least one of a selected text segment, the head and tail positions of the selected text segment, the label type, and the background color; the second attribute information also includes the identification information of the label to be reproduced; reads each label to be reproduced in the label list, and determines the target head and tail positions of the label to be reproduced in the original document according to the identification information of the label to be reproduced and the reproduced label; reproduces the label to be reproduced according to the target head and tail positions, the selected text segment, the label type, and the background color to obtain the target document. Compared with the related art, the present invention retains the format of the text information of the original document in a structured storage manner, and then annotates the loaded document to be annotated, thereby improving the restoration degree of the original document and the reproduced labels, and making it more readable; and adopts a method of loading structured text information and reproduced labels at the same layer, which greatly improves the accuracy of annotation, the annotation error rate is extremely low, and the document and reproduced labels are loaded quickly, which reduces waiting time and improves annotation efficiency.

[0104] In order to better understand the process of the above steps 101 to 105, the present disclosure provides a flowchart of another data processing method. Figure 2 As shown, the reproduction 24 of the label to be reproduced corresponds to the above steps 104 and 105, the recognition and preservation 21 of the text information corresponds to the above step 101, the same-layer loading 22 corresponds to the above step 102, and the construction of the label to be reproduced corresponds to the above step 103. After the reproduction 24 process of any label to be reproduced is completed, return to the same-layer loading 22, that is, the reproduced label is loaded on the same layer, and then the file to be annotated and the label to be reproduced are continued to be annotated according to the process of steps 103, 104 and 105.

[0105] In one embodiment provided by the present disclosure, in order to solve the problem of low annotation restoration and poor readability, the present disclosure adopts a method of retaining the format of the original document, fully restoring the paging, pictures, tables, and text formats in the original document, and then annotating on the restored document. The specific method includes: first, the original document is identified to obtain paging information, the paging information includes a paging number, and then the content of each page is identified according to the paging number, and the pictures, tables and text formats of each page are distinguished and saved separately. For example, with the upper left corner position of the page as the reference position coordinate, for the picture, the position coordinates of the picture relative to the reference position in the page, and the width and height of the picture are identified and saved; for the text, the position coordinates of the text, the position of the first word of the text segment in the document (or the position of the first word in the document in the document, which is not limited in the specific embodiment of the present application), the text size, text color, line height, indentation and other information are identified and saved; for the table, in addition to identifying and saving the position coordinates of the table, it is also necessary to identify the text size in each cell of the table, the position of the first word of the text segment in the table, the color of the text segment and other information, as well as the relevant information of the merged cells. The recognized text information is then saved in the form of structured data and returned to the front-end page in the form of an interface as a data source for annotation.

[0106] As an achievable method for the above step 102, in order to further explain the method for loading the document to be annotated, please refer to Figure 3 , Figure 3 A flowchart of a method for loading text information provided by the present invention.

[0107] like Figure 3 As shown, the specific method includes: setting the width and height of the page and the paging according to the paging information. Since the structured text information contains an array, each object in the array corresponds to a line of text or a picture or a table, it is necessary to make a judgment based on the attribute value in the object. Figure 3 For example, if the attribute of the object is text, the text element span is used, and the page break and paragraph number are combined into identification information as the unique identifier of the span. The indentation, text size, line height, and font color are set to the style attributes of the span, and then rendered by the browser. Among them, the span is a kind of inline element used to combine documents so that they can be formatted using styles. Span is usually used to isolate part of the text or part of the document, so as to set a separate style for the isolated content. The span itself has no attributes and no fixed format expression. When a style is applied to it, it will produce visual changes. Please continue to refer to Figure 3If the attribute of the object is a picture, since pictures generally do not involve annotations, you only need to set the width and height of the picture and load it through the browser. Please continue to refer to Figure 3 If the attribute of the object is a table, firstly, the position, width and height of the table need to be set, and then the cells are merged according to the relevant information of the merged cells in the structured text information, and finally the text in the cells is rendered.

[0108] Through the above embodiment, the original document format can be completely retained, avoiding the problem of being unable to identify whether the text comes from the table due to the extraction of text information of the original document, improving the restoration degree of the original document and the reproduced label, and solving the problems of low restoration degree and poor readability of the existing annotation method.

[0109] In some embodiments, before constructing a tag to be reproduced that is consistent with the first attribute information of the target tag, the target tag needs to be checked to exclude the following Figure 4 The ambiguous or wrong target labels shown in the figure can prevent errors during training. Figure 4 As shown, the first situation that needs to be excluded is the target label that crosses the cells of the table, the second situation that needs to be excluded is the situation where there is an intersection between two labels, and the third situation that needs to be excluded is the situation where there is an inclusion relationship between the two labels, such as one label is included in another label, etc. In order to prevent errors, the corresponding to-be-reproduced labels are not constructed for the above-mentioned ambiguous target labels.

[0110] It should be noted that the above three situations provided in the embodiments of the present disclosure are not limitations on the situations of target tags that need to be excluded. The target tags that need to be excluded can be set differently according to different needs, and the specific embodiments of the present application do not limit them.

[0111] Through the method provided in the above embodiment, erroneous or ambiguous target labels can be eliminated before the reproduction of the labels to be reproduced, thereby improving the accuracy of labeling and preventing errors in the process of training the model.

[0112] In order to further illustrate the construction of a to-be-reproduced label that is consistent with the first attribute information of the target label, an embodiment of the present disclosure provides a flow chart of constructing a to-be-reproduced label.

[0113] like Figure 5 As shown, the method comprises the following steps:

[0114] Step 301: according to the first attribute information, set the label type and background color in the second attribute information of the label to be reproduced.

[0115] In some embodiments, the background color is used to distinguish between tags of different tag types to be reproduced, and one tag type corresponds to one background color. When converting the target tag to a tag to be reproduced, different background colors corresponding to different tag types should be set first to determine the type.

[0116] Step 302, generating identification information of the label to be reproduced according to the selected text segment in the first attribute information; the identification information is used to construct a mapping relationship between the identification information and the label type, background color, selected text segment, and the beginning and end positions of the selected text segment of the label to be reproduced.

[0117] In the embodiment provided in the present disclosure, the determination as to whether the target tag is a single-line tag includes single-line annotations and multi-line annotations; if the target tag is determined to be a single-line annotation, the identification information of the target tag is set; if the target tag is determined to be a multi-line annotation, the target tag is split into multiple single-line sub-tags, and corresponding identification information is set for each of the split single-line sub-tags; each of the split single-line sub-tags is added to the sub-tag list divided by row corresponding to the target tag.

[0118] Step 303: determine the second attribute information of the label to be reproduced based on the mapping relationship between the identification information and the label type, background color, selected text segment, and the first and last positions of the selected text segment of the label to be reproduced, and obtain the label to be reproduced.

[0119] After generating the identification information of the tag to be reproduced, it is necessary to determine the first and last positions of the target tag in the following four different situations. The specific situations and corresponding determination methods include:

[0120] The first case: when it is determined that the target tag is a single-line tag, or when it is determined that the target tag is a multi-line tag and the subtag is the first line of the target tag before splitting, it is determined whether there is a forward tag before the target tag or subtag, and the forward tag is the previous tag of the target tag in the document to be annotated. If it is determined that the forward tag exists, the last word position of the forward tag is determined as the first word position of the target tag or subtag, and the sum of the first word position of the target tag or subtag and the head and tail offsets of the preset tag or subtag is determined as the last word position of the target tag or subtag, and the head and tail positions of the target tag or subtag are obtained.

[0121] The second case: if it is determined that there is no forward label, the first word position of the parent node of the target label or sub-label is used as the first word position of the target label or sub-label, and the sum of the first word position of the target label or sub-label and the first and last offsets of the target label or sub-label is determined as the last word position of the preset label or sub-label, and the first and last positions of the target label or sub-label are obtained, and the parent node is the previous node of the node corresponding to the target label or sub-label;

[0122] The third case: when it is determined that the target label is a multi-line label and the sub-label is the middle line of the target label before splitting, the first character position of the node corresponding to the sub-label is determined as the first character position of the sub-label, and the first character position of the next node after the sub-label is determined as the last character position of the sub-label, to obtain the first and last positions of the sub-label.

[0123] The fourth case: when it is determined that the target label is a multi-line label and the sub-label is the last line of the target label before splitting, the first character position of the node corresponding to the sub-label is determined as the first character position of the sub-label, and the sum of the first character position of the sub-label and the first and last offsets of the sub-label is determined as the last character position of the sub-label, so as to obtain the first and last positions of the sub-label.

[0124] In order to further understand the method for constructing the above-mentioned label to be reproduced, the embodiment of the present disclosure provides another flow chart of constructing the label to be reproduced, such as Figure 6 The specific steps are as follows:

[0125] 1) Set the label category and background color. Labels of different categories have different colors and meanings.

[0126] 2) Determine whether the target label is a single-line label. If it is a single-line label, set the corresponding identification information; if it is a multi-line label, jump to step 5).

[0127] 3) Determine whether the target tag has a forward tag. If so, obtain the end position E of the forward tag. ind If not, get the first character position of the parent node T ind , as the first word position of the target label.

[0128] 4) Based on the first character position of the target tag, add the first and last offsets of the target tag to obtain the first and last positions of the target tag, and jump to step 9).

[0129] 5) Split the target label into rows to obtain multiple single-row sub-labels, and set corresponding identification information for each single-row sub-label.

[0130] 6) Determine which row of the original target label the split single-row sub-label is in. If it is the first row, jump to step 3). If it is the last row, jump to step 8). If it is the middle row, continue to step 7).

[0131] 7) The entire current node corresponding to the target label is used as the label, and the first character position of the target label is obtained according to the current node, and the last character position of the target label is obtained according to the immediately following node.

[0132] 8) The first character position of the target label is obtained according to the current node, and the first and last offsets of the target label are added to obtain the last character position of the target label.

[0133] 9) Get the label to be reproduced, including identification information, first and last positions, label type and background color.

[0134] The above steps involve the identification generation method and the calculation of the first and last positions of the target label, which are specifically described as follows:

[0135] The identification information of the label in step 2) is denoted as L id , then its generation method is:

[0136] L id =N id -L ind -Ran = P id -Pr id -T o -L ind -Ran(1)

[0137] Lid=Td o -L ind -Ran(2)

[0138] The “-” in (1) and (2) is a connector, N id is the unique identifier of the text segment, P id is the paging number, Pr id is the paragraph number, T ind is the first word position of the paragraph text; Td in (2) id Is the unique identifier of the cell in the table, Td ind The first word position of the text in the table cell. The first word position of the text here is relative to the whole text. ind is the order of tags in the preset list of multiple types of tags, and Ran is a random number generated according to the current time.

[0139] In steps 3) and 4), the forward reference position of the tag is recorded as B ind , the label starts at P s , the end position is P e , the label start offset is So , the label end offset is E o ,but:

[0140] (P s , P e )= (B ind + S o , B ind + E o ), where B ind = E ind or T ind (3)

[0141] In step 7):

[0142] (P s , P e ) = (T ind , T of the next node ind -1 )(4)

[0143] In step 8):

[0144] (P s , P e ) = (T ind , T ind + E o )(5)

[0145] As a refinement of the above step 104, the target first and last positions of the tag to be reproduced in the original document are determined according to the identification information of the tag to be reproduced and the reproduced tag; the core idea is the reverse process of the above process of constructing the tag to be reproduced. The specific implementation method is as follows Figure 7 As shown, the specific steps include:

[0146] (1) Read each tag to be reproduced in the tag list, where the tag to be reproduced includes identification information, first and last positions, tag type and background color, and a sub-tag list divided by rows corresponding to the tag to be reproduced.

[0147] (2) Determine the parent node based on the identification information of the label to be reproduced;

[0148] (3) Determine whether there is a recurring tag in the parent node. If so, go to step (4); if not, go to step (8);

[0149] (4) Determine whether there is a recurring tag in the parent node. If yes, go to step (5); if not, go to step (8);

[0150] (5) Get all the recurring tags in the parent node;

[0151] (6) Determine whether the tag to be reproduced is the first tag in a row. If so, jump to step (7); if not, jump to step (9);

[0152] (7) Obtain the first recurring label, thereby obtaining the immediately preceding plain text node of the first recurring label, and then obtain the parent node of the immediately preceding node;

[0153] (8) Obtain the first character position of the parent node, obtain the first and last offsets according to the first and last positions of the label to be reproduced and the first character position of the parent node, and go to step (10);

[0154] (9) Obtain the reproduced label immediately preceding the label to be reproduced, obtain the end position of the reproduced label, and obtain the head and tail offsets according to the head and tail positions of the label to be reproduced and the end position of the reproduced label;

[0155] (10) Based on the start and end offsets, obtain the text segment selected by the tag to be reproduced, add the background color style of the tag to be reproduced, and replace the original text node with the new tag node.

[0156] The above steps involve the calculation of the parent node and the head and tail offsets of the label to be reproduced. The specific description is as follows:

[0157] Corresponding to the parent node identifier in step (2), it can be seen from formula (1) that the first 3 bits of the tag identifier information to be reproduced are the parent node identifier.

[0158] For the head and tail offsets in steps (8) and (9), we can get from formula (6):

[0159] (S o , E o )= (P s -B ind , P e -B ind ), where B ind = E ind or T ind (6)

[0160] Through the above-mentioned annotation method and the reproduction process of the labels to be reproduced, the key information of the labels to be reproduced and the reproduction of the labels to be reproduced in the original document are achieved. The corresponding process and specific algorithm are disclosed, which greatly improves the accuracy of annotation.

[0161] In actual applications, since the same-layer loading of the original document and the reproduced tags in the disclosed embodiment involves related algorithm positioning and rendering processes, if the entire document is loaded at one time, it will inevitably take a long time. In order to solve the above problem, this solution adopts a continuous loading method to reduce the time consumption of page rendering.

[0162] The specific implementation method is that when the page is opened, the interface is called first to obtain the full amount of reproduced tag data, the full annotation list, and the document data of the first two pages, and then render them. When the document is pulled down, the interface call for the next two pages of document data is triggered, and the page and the annotations in the page are rendered until the page is fully loaded or the user switches to another document. In this way, the page can be quickly rendered in batches, reducing user waiting time and improving user experience.

[0163] In summary, the embodiments of the present disclosure can achieve the following effects:

[0164] 1. Through structured storage, the original document format is completely retained, avoiding the problem of being unable to identify whether the text comes from the table due to extracting the original document text information, improving the restoration degree of the original document and the reproduced labels, and solving the problems of low restoration degree and poor readability of the existing annotation methods.

[0165] 2. Eliminate erroneous or ambiguous target labels before reproducing the labels to be reproduced, improve the accuracy of annotations, and prevent errors in the process of training models.

[0166] 3. Through the annotation method and the reproduction process of the labels to be reproduced, the key information of the labels to be reproduced and the reproduction of the labels to be reproduced in the original document are achieved. The corresponding process and specific algorithm are made public, which greatly improves the accuracy of annotation.

[0167] Corresponding to the above data processing method, the present invention also provides a data processing device. Since the device embodiment of the present invention corresponds to the above method embodiment, details not disclosed in the device embodiment can be referred to the above method embodiment, and will not be repeated in the present invention.

[0168] Figure 8 A structural diagram of a data processing device provided in an embodiment of the present disclosure is shown in FIG. Figure 8 As shown, it includes: an identification unit 41, a storage unit 42, a loading unit 43, a construction unit 44, an adding unit 45, a reading unit 46, a calculation unit 47 and a reproduction unit 48.

[0169] The recognition unit 41 is used to recognize the text information of the original document and the reproduced label;

[0170] The storage unit 42 is used to store the identified text information and the reproduced labels in a structured manner to obtain structured text information and structured reproduced labels;

[0171] A loading unit 43 is used to load the structured text information and the reproduced label in the same layer to obtain a document to be annotated, and the document to be annotated is used to annotate the text information to obtain a target label;

[0172] A construction unit 44, configured to construct a tag to be reproduced that is consistent with the first attribute information of the target tag;

[0173] The adding unit 45 is used to add the tag to be reproduced into the tag list, wherein the first attribute information and / or the second attribute information of the tag to be reproduced includes at least one of the selected text segment, the first and last positions of the selected text segment, the tag type and the background color; the second attribute information also includes the identification information of the tag to be reproduced;

[0174] A reading unit 46, configured to read each tag to be reproduced in the tag list;

[0175] A determination unit 47, configured to determine the target first and last positions of the tag to be reproduced in the original document according to the identification information of the tag to be reproduced and the position of the reproduced tag;

[0176] The reproducing unit 48 is used to reproduce the tag to be reproduced according to the target start and end positions, the selected text segment, the tag type and the background color to obtain a target document.

[0177] The data processing device provided by the present disclosure identifies the text information and the reproduced label of the original document, and stores the identified text information and the reproduced label in a structured manner to obtain structured text information and structured reproduced labels; loads the structured text information and the reproduced label in the same layer to obtain a document to be annotated, and the document to be annotated is used to annotate the text information to obtain a target label; constructs a label to be reproduced that is consistent with the first attribute information of the target label, and adds the label to be reproduced to a label list, wherein the first attribute information and / or the second attribute information of the label to be reproduced includes at least one of a selected text segment, the head and tail positions of the selected text segment, the label type and the background color; the second attribute information also includes the identification information of the label to be reproduced; reads each label to be reproduced in the label list, and determines the target head and tail positions of the label to be reproduced in the original document according to the identification information of the label to be reproduced and the reproduced label; reproduces the label to be reproduced according to the target head and tail positions, the selected text segment, the label type and the background color to obtain the target document. Compared with the related art, the present invention retains the format of the text information of the original document in a structured storage manner, and then annotates the loaded document to be annotated, thereby improving the restoration degree of the original document and the reproduced labels, and making it more readable; and adopts a method of loading structured text information and reproduced labels at the same layer, which greatly improves the accuracy of annotation, the annotation error rate is extremely low, and the document and reproduced labels are loaded quickly, which reduces waiting time and improves annotation efficiency.

[0178] Furthermore, in a possible implementation of this embodiment, as Fig. 9 As shown, the identification unit 41 includes:

[0179] A first recognition module 411 is used to recognize the text information of the original document to obtain the paging information and the reproduced label of the original document, wherein the paging information includes the paging number of each page;

[0180] The second recognition module 412 is used to recognize the content of each page of the original document according to the page number, and obtain corresponding picture information, table information and text information;

[0181] The storage module 413 is used to store the reproduced tags, paging information, image information, table information and text information in a structured manner, and return them to the front-end page in the form of an interface.

[0182] Furthermore, in a possible implementation of this embodiment, as Fig. 9 As shown, the construction unit 44 includes:

[0183] A setting module 441, configured to set a label type and a background color in the second attribute information of the label to be reproduced according to the first attribute information;

[0184] A generating module 442 is used to generate identification information of the tag to be reproduced according to the selected text segment in the first attribute information; the identification information is used to construct a mapping relationship between the identification information and the tag type, background color, selected text segment, and the first and last positions of the selected text segment of the tag to be reproduced;

[0185] The first determination module 443 is used to determine the second attribute information of the label to be reproduced based on the mapping relationship between the identification information and the label type, background color, selected text segment, and the first and last positions of the selected text segment of the label to be reproduced, so as to obtain the label to be reproduced.

[0186] Furthermore, in a possible implementation of this embodiment, as Fig. 9 As shown, the generating module 442 is also used for:

[0187] Determining whether the selected text segment is a single-line marked text segment;

[0188] If it is determined that the selected text segment is a text segment with a single line annotation, generating identification information of the to-be-reproduced label corresponding to the selected text segment;

[0189] If it is determined that the selected text segment is not a single-line marked text segment, splitting the selected text segment into a plurality of single-line marked sub-text segments;

[0190] Identification information of the to-be-reproduced labels corresponding to the sub-text segments annotated in the single line is generated respectively.

[0191] Furthermore, in a possible implementation of this embodiment, as Fig. 9 As shown, the determining unit 47 includes:

[0192] A second determining module 471 is used to determine the parent node corresponding to the to-be-reproduced label according to the identification information of the to-be-reproduced label;

[0193] A first acquisition module 472, configured to acquire the first character of the parent node when it is determined that there is no duplicated label in the parent node;

[0194] The third determination module 473 is used to determine the target first and last positions of the tag to be reproduced in the original document according to the first character position of the parent node and the first and last positions of the selected text.

[0195] In one embodiment provided by the present disclosure, the third determination module 473 is further configured to:

[0196] After determining the parent node corresponding to the tag to be reproduced according to the identification information of the tag to be reproduced, if it is determined that at least one reproduced tag exists in the parent node, obtaining the last character position of the previous reproduced tag of the tag to be reproduced according to the identification information of the tag to be reproduced;

[0197] The target first and last positions of the tag to be reproduced in the original document are determined according to the last character position of the previous reproduced tag of the tag to be reproduced and the first and last positions of the selected text.

[0198] Furthermore, in a possible implementation of this embodiment, as Fig. 9 As shown, the reproducing unit 48 includes:

[0199] A search module 481 is used to search for text segments corresponding to the target start and end positions of the tag to be reproduced in the original document according to the target start and end positions of the tag to be reproduced in the original document;

[0200] An adding module 482 is used to add a tag type and a background color corresponding to the tag to be reproduced to the text segment corresponding to the target first and last positions in the original document;

[0201] The replacement module 483 is used to replace the text segments corresponding to the target start and end positions in the original document with the selected text segments corresponding to the tag to be reproduced, so as to obtain the target document.

[0202] It should be noted that the above explanation of the method embodiment is also applicable to the device of this embodiment, and the principle is the same, which is not limited in this embodiment.

[0203] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0204] Fig.10 A schematic block diagram of an example electronic device 500 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0205] like Fig.10 As shown, the device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a ROM (Read-Only Memory) 502 or a computer program loaded from a storage unit 508 to a RAM (Random Access Memory) 503. In the RAM 503, various programs and data required for the operation of the device 500 can also be stored. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An I / O (Input / Output) interface 505 is also connected to the bus 504.

[0206] A number of components in the device 500 are connected to the I / O interface 505, including: an input unit 506, such as a keyboard, a mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a disk, an optical disk, etc.; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0207] The computing unit 501 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a CPU (Central Processing Unit), a GPU (Graphic Processing Units), various dedicated AI (Artificial Intelligence) computing chips, various computing units running machine learning model algorithms, a DSP (Digital Signal Processor), and any appropriate processor, controller, microcontroller, etc. The computing unit 501 performs the various methods and processes described above, such as a data processing method. For example, in some embodiments, the data processing method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps of the method described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to execute the aforementioned data processing method in any other appropriate manner (for example, by means of firmware).

[0208] Various embodiments of the systems and techniques described above herein may be implemented in digital electronic circuit systems, integrated circuit systems, FPGAs (Field Programmable Gate Arrays), ASICs (Application-Specific Integrated Circuits), ASSPs (Application Specific Standard Products), SOCs (System On Chips), CPLDs (Complex Programmable Logic Devices), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs that may be executed and / or interpreted on a programmable system including at least one programmable processor that may be a dedicated or general-purpose programmable processor that may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0209] The program code for implementing the method 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, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0210] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or apparatus. A 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, device, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include an electrical connection based on one or more wires, a portable computer disk, a hard disk, RAM, ROM, EPROM (Electrically Programmable Read-Only-Memory) or flash memory, optical fiber, CD-ROM (Compact Disc Read-Only Memory), optical storage device, magnetic storage device, or any suitable combination of the foregoing.

[0211] To provide interaction with a user, the systems and techniques described herein 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 the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the 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 can be received in any form (including acoustic input, voice input, or tactile input).

[0212] The systems and techniques described herein may be implemented in a computing system that includes a backend component (e.g., as a data server), or a computing system that includes a middleware component (e.g., an application server), or a computing system that includes a frontend component (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: LAN (Local Area Network), WAN (Wide Area Network), the Internet, and blockchain networks.

[0213] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.

[0214] It should be noted that artificial intelligence is a discipline that studies how computers can simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.), and includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, as well as machine learning / deep learning, big data processing technology, knowledge graph technology, and other major directions.

[0215] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0216] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A data processing method, characterized in that: include: Identify the text information and reproduced tags of the original document, and store the identified text information and reproduced tags in a structured manner to obtain structured text information and structured reproduced tags; Loading the structured text information and the reproduced label in the same layer to obtain a document to be annotated, wherein the document to be annotated is used to annotate the text information to obtain a target label; Constructing a tag to be reproduced that is consistent with the first attribute information of the target tag, and adding the tag to be reproduced to the tag list, wherein the first attribute information and / or the second attribute information of the tag to be reproduced includes at least one of the selected text segment, the first and last positions of the selected text segment, the tag type, and the background color; the second attribute information also includes identification information of the tag to be reproduced; Read each tag to be reproduced in the tag list, and determine the target start and end positions of the tag to be reproduced in the original document according to the identification information of the tag to be reproduced and the reproduced tags; According to the target start and end positions, the selected text segment, the tag type and the background color, the tag to be reproduced is reproduced to obtain a target document; The step of constructing a tag to be reproduced that is consistent with the first attribute information of the target tag includes: According to the first attribute information, setting the label type and background color in the second attribute information of the label to be reproduced; Generate identification information of the tag to be reproduced according to the selected text segment in the first attribute information; the identification information is used to construct a mapping relationship between the identification information and the tag type, background color, selected text segment, and the first and last positions of the selected text segment of the tag to be reproduced; Determine the second attribute information of the label to be reproduced based on the mapping relationship between the identification information and the label type, background color, selected text segment, and the first and last positions of the selected text segment of the label to be reproduced, and obtain the label to be reproduced; The step of reproducing the tag to be reproduced according to the target head and tail positions, the selected text segment, the tag type and the background color includes: According to the target first and last positions of the tag to be reproduced in the original document, searching for the text segment corresponding to the target first and last positions in the original document; Adding the tag type and background color corresponding to the tag to be reproduced to the text segments corresponding to the target first and last positions in the original document; The selected text segment corresponding to the tag to be reproduced is used to replace the text segment corresponding to the target first and last positions in the original document to obtain the target document.

2. The method according to claim 1, characterized in that The identifying of the text information and the reproduced tags of the original document, and the structured storage of the identified text information and the reproduced tags to obtain structured text information and structured reproduced tags includes: Identify the text information of the original document to obtain the paging information and the reproduced label of the original document, wherein the paging information includes the paging number of each paging; According to the paging number, the content of each paging of the original document is identified to obtain corresponding picture information, table information and text information; The reproduced labels, paging information, image information, table information and text information are stored in a structured manner and returned to the front-end page in the form of an interface.

3. The method according to claim 1, characterized in that The step of generating the identification information of the tag to be reproduced according to the selected text segment in the first attribute information includes: Determining whether the selected text segment is a single-line marked text segment; If it is determined that the selected text segment is a text segment with a single line annotation, generating identification information of the to-be-reproduced label corresponding to the selected text segment; If it is determined that the selected text segment is not a single-line marked text segment, splitting the selected text segment into a plurality of single-line marked sub-text segments; Identification information of the to-be-reproduced labels corresponding to the sub-text segments annotated in the single line is generated respectively.

4. The method according to claim 1, characterized in that: The step of determining the target first and last positions of the tag to be reproduced in the original document according to the identification information of the tag to be reproduced and the reproduced tag includes: Determine the parent node corresponding to the tag to be reproduced according to the identification information of the tag to be reproduced; When it is determined that there is no duplicated label in the parent node, obtaining the first character of the parent node; The target first and last positions of the tag to be reproduced in the original document are determined according to the first character position of the parent node and the first and last positions of the selected text.

5. The method according to claim 4, characterized in that After determining the parent node corresponding to the tag to be reproduced according to the identification information of the tag to be reproduced, the method further includes: When it is determined that at least one already-reproduced label exists in the parent node, obtaining the last character position of the previous already-reproduced label of the label to be reproduced according to the identification information of the label to be reproduced; The target first and last positions of the tag to be reproduced in the original document are determined according to the last character position of the previous reproduced tag of the tag to be reproduced and the first and last positions of the selected text.

6. A data processing device, characterized in that: include: A recognition unit, used to recognize text information of the original document and the reproduced label; A storage unit, used for storing the identified text information and the reproduced labels in a structured manner to obtain structured text information and structured reproduced labels; A loading unit, used to load the structured text information and the reproduced label in the same layer to obtain a document to be annotated, and the document to be annotated is used to annotate the text information to obtain a target label; A construction unit, configured to construct a tag to be reproduced that is consistent with the first attribute information of the target tag; an adding unit, configured to add the tag to be reproduced into a tag list, wherein the first attribute information and / or the second attribute information of the tag to be reproduced includes at least one of a selected text segment, the first and last positions of the selected text segment, a tag type, and a background color; and the second attribute information also includes identification information of the tag to be reproduced; A reading unit, used for reading each tag to be reproduced in the tag list; A determination unit, configured to determine the target start and end positions of the tag to be reproduced in the original document according to the identification information of the tag to be reproduced and the reproduced tag; A reproduction unit, used to reproduce the tag to be reproduced according to the target head and tail positions, the selected text segment, the tag type and the background color to obtain a target document; Wherein, the construction unit comprises: A setting module, used for setting the label type and background color in the second attribute information of the label to be reproduced according to the first attribute information; A generating module, configured to generate identification information of the tag to be reproduced according to the selected text segment in the first attribute information; the identification information is used to construct a mapping relationship between the identification information and the tag type, background color, selected text segment, and the first and last positions of the selected text segment of the tag to be reproduced; A first determination module is used to determine the second attribute information of the label to be reproduced based on the mapping relationship between the identification information and the label type, background color, selected text segment, and the first and last positions of the selected text segment of the label to be reproduced, so as to obtain the label to be reproduced; The reproducing unit comprises: A search module, used for searching for text segments corresponding to the target start and end positions of the tag to be reproduced in the original document according to the target start and end positions of the tag to be reproduced in the original document; An adding module, used for adding a tag type and a background color corresponding to the tag to be reproduced to the text segment corresponding to the target first and last positions in the original document; The replacement module is used to replace the text fragments corresponding to the target start and end positions in the original document with the selected text fragments corresponding to the tag to be reproduced, so as to obtain the target document.

7. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 5.

8. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 5.