Data labeling method, device, electronic device and computer-readable storage medium

By parsing rich documents to generate annotation interfaces, and generating key-value pairs based on user operations, the problem of low efficiency in annotating rich document data in the existing technology is solved, and efficient annotation of multiple types of data is achieved.

CN113407745BActive Publication Date: 2024-09-20BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110733929.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-30
Publication Date
2024-09-20
Estimated Expiration
2041-06-30

AI Technical Summary

Technical Problem

Existing technology lacks effective methods to annotate data in rich documents for artificial intelligence algorithms to learn.

Method used

By parsing the rich document to be processed, an annotation interface corresponding to the content type is generated, and key-value pairs are generated as data annotation results based on user operations.

Benefits of technology

It realizes efficient annotation of various types of data (text, tables, pictures, etc.) in rich documents, improving the pertinence and efficiency of data annotation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113407745B
    Figure CN113407745B
Patent Text Reader

Abstract

The present disclosure provides a data annotation method, device, electronic device, and computer-readable storage medium, which relate to artificial intelligence fields such as computer vision and natural language processing, wherein the method may include: parsing a rich document to be processed, generating an annotation interface corresponding to the content type included in the rich document according to the parsing result; generating a key-value pair according to the operation performed by the user on the annotation interface, and using the obtained key-value pair as the data annotation result. Applying the scheme described in the present disclosure, it is possible to conveniently and efficiently implement the annotation of various types of data in rich documents, etc.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to data annotation methods, devices, electronic devices, and computer-readable storage media in the fields of computer vision and natural language processing. Background Art

[0002] Rich documents contain abundant data, such as text content, table content, and image content. These rich data are exactly what artificial intelligence algorithms need.

[0003] However, there is currently no good way to annotate the data in rich documents so that artificial intelligence algorithms can learn. Summary of the invention

[0004] The present disclosure provides a data annotation method, device, electronic device, and computer-readable storage medium.

[0005] A data annotation method, comprising:

[0006] Parsing the rich document to be processed, and generating a annotation interface corresponding to the content type included in the rich document according to the parsing result;

[0007] A key-value pair is generated according to the operation performed by the user on the annotation interface, and the obtained key-value pair is used as the data annotation result.

[0008] A data annotation device, comprising: a parsing module and a annotation module;

[0009] The parsing module is used to parse the rich document to be processed and generate a annotation interface corresponding to the content type included in the rich document according to the parsing result;

[0010] The annotation module is used to generate a key-value pair according to the operation performed by the user on the annotation interface, and use the obtained key-value pair as the data annotation result.

[0011] An electronic device, comprising:

[0012] at least one processor; and

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

[0014] The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to perform the method described above.

[0015] A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute the method as described above.

[0016] A computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program implements the method described above.

[0017] One embodiment disclosed above has the following advantages or beneficial effects: a annotation interface can be generated by parsing a rich document, and key-value pairs can be generated based on user operations performed on the annotation interface, thereby conveniently and efficiently implementing annotation of various types of data in the rich document.

[0018] 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 disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0020] Figure 1 A flowchart of an embodiment of the data annotation method disclosed in the present invention;

[0021] Figure 2 A schematic diagram of the text content described in the present disclosure;

[0022] Figure 3 A schematic diagram of the contents of the table described in the present disclosure;

[0023] Figure 4 A schematic diagram of text information in the displayed picture content described in the present disclosure;

[0024] Figure 5 Schematic diagram of the structure of the data annotation device embodiment 500 of the present disclosure;

[0025] Figure 6 A schematic block diagram of an example electronic device 600 that may be used to implement embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0026] 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.

[0027] In addition, it should be understood that the term "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0028] Figure 1 Flow chart of an embodiment of the data annotation method described in the present disclosure. Figure 1 As shown, the following specific implementation methods are included.

[0029] In step 101, the rich document to be processed is parsed, and a marking interface corresponding to the content type included in the rich document is generated according to the parsing result.

[0030] In step 102, a key-value pair is generated according to the operation performed by the user on the annotation interface, and the obtained key-value pair is used as the data annotation result.

[0031] In the scheme described in the above method embodiment, the annotation interface can be generated by parsing the rich document, and key-value pairs can be generated based on the user's operations on the annotation interface, thereby conveniently and efficiently implementing the annotation of various types of data in the rich document.

[0032] The content types included in the rich document may include one or any combination of the following: text content, table content, image content, etc.

[0033] Accordingly, after the rich document is parsed, annotation interfaces corresponding to different content types included in the rich document may be generated according to the parsing results. There is no restriction on how to perform the parsing.

[0034] When the rich document includes text content, a corresponding text annotation interface may be generated, and the text annotation interface includes the text content. When the rich document includes table content, a corresponding table annotation interface may be generated, and the table annotation interface includes the table content. When the rich document includes picture content, a corresponding picture annotation interface may be generated, and the picture annotation interface includes the picture content.

[0035] It can be seen from the above introduction that corresponding annotation interfaces can be generated for different content types, thereby achieving differentiated processing for different content types, making the processing more targeted, etc.

[0036] The following describes how to handle different content types.

[0037] 1) Text content

[0038] As mentioned above, a corresponding text annotation interface can be generated for the text content.

[0039] For the text content displayed in the text annotation interface, the content selected by the user as the key and the corresponding value can be obtained, and a key-value pair is generated according to the obtained content.

[0040] Figure 2 Schematic diagram of the text content described in this disclosure. Figure 2 As shown, "Party A" is the key, and "123 Construction Engineering Co., Ltd." is the value corresponding to "Party A". Similarly, "Party B" is the key, and "ABC Building Materials Sales Co., Ltd." is the value corresponding to "Party B".

[0041] How the user selects the content as the key and the corresponding value can be determined according to actual needs. For example, as a possible implementation method, two buttons can be displayed in the text annotation interface. For the convenience of description, they are called button a and button b respectively. When the user clicks button a, it means that the user will select a key. Accordingly, the content selected by the user from the text content displayed in the text annotation interface can be used as the key. Assuming that the user clicks button b later, it means that the user will select a value. Accordingly, the content selected by the user from the text content displayed in the text annotation interface can be used as the value. Then, a key-value pair can be generated based on the key and value obtained.

[0042] In actual applications, a key may correspond to multiple values, so the above operation of clicking button b and selecting the content as the value can be repeated. Each time it is repeated, a value can be obtained. When the user clicks button a again, it means that a new key-value pair is to be generated and a new key is to be selected.

[0043] The above describes how to generate a key-value pair when both the key and the corresponding value appear in the text content. In some cases, only the value may appear in the text content without the key. In this case, the following processing method can be used.

[0044] For the text content displayed in the text annotation interface, the content selected by the user as the value is obtained, and the key corresponding to the obtained value is determined, and a key-value pair is generated according to the determined key and the obtained value.

[0045] As a possible implementation method, the user can pre-define one or more keys. For example, if a key is defined as "Party A", the user can click the button corresponding to the key, indicating that the value corresponding to the key will be selected. Accordingly, the content selected by the user from the text content displayed in the text annotation interface can be used as the value corresponding to the key, thereby generating a key-value pair.

[0046] From the above introduction, it can be seen that when generating key-value pairs based on the text annotation interface, it can support the situation where both the key and the corresponding value appear in the text content, and it can also support the user to customize the key and select the corresponding value in the text content, that is, it has good applicability to various situations.

[0047] 2) Table content

[0048] A corresponding table annotation interface can be generated for the table content.

[0049] For each cell in the table content displayed on the table annotation interface, the user-set category can be obtained respectively, and the category may include a key and a value. The direction information of the value corresponding to the cell whose category is set by the user as a key can be obtained, and a key-value pair is generated according to the settings made by the user.

[0050] Figure 3 Schematic diagram of the table contents described in this disclosure. Figure 3 As shown, for each cell, its category can be set respectively, and the category can include a key and a value, and can also include other categories, such as Figure 3 As shown in the figure, the category of the light gray cells is key, the category of the white cells is value, the category of the dark gray cells is others (neither key nor value), and the arrow indicates the direction information of the value corresponding to the cell of the key category.

[0051] As a possible implementation method, in the table annotation interface, a button can be displayed at a predetermined position on each cell. After the user clicks any button, the categories available for the user to select can be displayed, such as keys, values, and others. After the user clicks the corresponding category, the category clicked by the user can be used as the category of the cell corresponding to the button. In addition, for each cell, a button for direction selection can be displayed respectively. Similarly, when the user clicks any button, the direction information available for the user to select can be displayed, such as up, down, left, right, etc. After the user clicks the corresponding direction information, the direction information clicked by the user can be used as the direction information of the value corresponding to the cell corresponding to the button (category is key).

[0052] According to the user's operation, a key-value pair may be generated accordingly. In practical applications, a key-value pair may include only one key and one value, one key and multiple values, multiple keys and one value, or multiple keys and multiple values.

[0053] It can be seen that by using the above processing method, users can process each cell separately, which is simple and convenient, thereby improving the efficiency of data labeling and has universal applicability, such as simple one-dimensional tables and complex multi-dimensional tables.

[0054] 3) Image content

[0055] According to the picture content, a corresponding picture annotation interface can be generated.

[0056] For the text information in the image content displayed in the image annotation interface, the content selected by the user as the key and the corresponding value can be obtained, and a key-value pair is generated according to the obtained content.

[0057] Figure 4 Schematic diagram of text information in the picture content displayed in the present disclosure. Figure 4 As shown, for the image content, that is, data in the form of an image, the optical character recognition (OCR) technology can be used to identify the characters and their positions in the image, and the positions of the identified characters can be framed by rectangular frames. Similar to the text annotation interface, two buttons can be displayed in the image annotation interface. The user's click operation on the two buttons respectively indicates that the user will select the key and value. Accordingly, the user can respectively frame the key and value contents, and then generate a key-value pair, such as the key is "import port" and the corresponding value is "** airport", etc.

[0058] Through the above processing, users can directly select keys and values ​​on the image, which is flexible and convenient, thereby improving data labeling efficiency.

[0059] Regardless of which of the above methods is used to obtain the key-value pairs, they can be stored in a predetermined format. There is no restriction on the specific format, such as a data format that is convenient for artificial intelligence algorithms to learn.

[0060] In addition, for any key-value pair, one or all of the following information may be stored: position information and direction information. The position information is the position information of the key and / or value in the key-value pair in the rich document, such as the page or paragraph, and the direction information is the direction information of the value in the key-value pair relative to the key.

[0061] For any key-value pair, if the location information can be obtained, the obtained location information can be stored, otherwise, the location information may not be stored. Similarly, if the direction information can be obtained, the obtained direction information can be stored, otherwise, the direction information may not be stored.

[0062] After the key-value pairs are uniformly stored in the above manner, it is convenient for subsequent management and use.

[0063] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are expressed as a series of action combinations, but those skilled in the art should be aware that the present disclosure is not limited by the described order of actions, because according to the present disclosure, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present disclosure.

[0064] The above is an introduction to the method embodiment. The following is a further explanation of the scheme disclosed in the present invention through an apparatus embodiment.

[0065] Figure 5 FIG. 5 is a schematic diagram of the structure of the data tagging device embodiment 500 of the present disclosure. Figure 5 As shown, it includes: a parsing module 501 and a marking module 502.

[0066] The parsing module 501 is used to parse the rich document to be processed and generate a marking interface corresponding to the content type included in the rich document according to the parsing result.

[0067] The annotation module 502 is used to generate a key-value pair according to the operation performed by the user on the annotation interface, and use the obtained key-value pair as the data annotation result.

[0068] The content types included in the rich document may include one or any combination of the following: text content, table content, image content, etc.

[0069] Correspondingly, after parsing the rich document, the parsing module 501 may generate annotation interfaces corresponding to different content types included in the rich document according to the parsing results.

[0070] Among them, when the rich document includes text content, the parsing module 501 can generate a corresponding text annotation interface, which includes the text content; when the rich document includes table content, it can generate a corresponding table annotation interface, which includes the table content; when the rich document includes picture content, it can generate a corresponding picture annotation interface, which includes the picture content.

[0071] Furthermore, the annotation module 502 may generate a key-value pair according to the operation performed by the user on the annotation interface, and use the obtained key-value pair as the data annotation result.

[0072] For example, the annotation module 502 can obtain the content selected by the user as the key and the corresponding value from the text content displayed in the text annotation interface, and generate a key-value pair based on the obtained content, and / or, obtain the content selected by the user as the value from the text content displayed in the text annotation interface, and determine the key corresponding to the obtained value, and generate a key-value pair based on the determined key and the obtained value.

[0073] For another example, the annotation module 502 can obtain the category set by the user for each cell in the table content displayed on the table annotation interface, where the category includes a key and a value, and obtain the direction information of the value corresponding to the cell whose category is set by the user as a key, and generate a key-value pair according to the settings made by the user.

[0074] For another example, the annotation module 502 may obtain the content selected by the user as a key and a corresponding value from the text information in the image content displayed in the image annotation interface, and generate a key-value pair according to the obtained content.

[0075] Regardless of the key-value pairs obtained by the above methods, the annotation module 502 can store them in a predetermined format. The specific format is not limited, such as a data format that is convenient for artificial intelligence algorithms to learn.

[0076] In addition, for any key-value pair, the annotation module 502 can also store one or all of the following information: position information and direction information. The position information is the position information of the key and / or value in the key-value pair in the rich document, such as the page or paragraph, and the direction information is the direction information of the value in the key-value pair relative to the key.

[0077] For any key-value pair, if the location information can be obtained, the obtained location information can be stored, otherwise, the location information may not be stored. Similarly, if the direction information can be obtained, the obtained direction information can be stored, otherwise, the direction information may not be stored.

[0078] Figure 5 For the specific working process of the device embodiment shown, please refer to the relevant description in the aforementioned method embodiment, which will not be repeated here.

[0079] In summary, by adopting the scheme described in the embodiment of the device disclosed in the present invention, a annotation interface can be generated by parsing the rich document, and key-value pairs can be generated based on the operations performed by the user on the annotation interface, thereby conveniently and efficiently realizing the annotation of various types of data in the rich document.

[0080] The solution disclosed in the present invention can be applied to the field of artificial intelligence, particularly to the fields of computer vision and natural language processing.

[0081] Artificial intelligence is a discipline that studies how to use computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.). It includes both hardware-level technologies 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.

[0082] 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.

[0083] Figure 6 A schematic block diagram of an example electronic device 600 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, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, 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.

[0084] like Figure 6 As shown, the device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

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

[0086] The computing unit 601 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 601 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, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 601 performs the various methods and processes described above, such as the methods described in the present disclosure. For example, in some embodiments, the methods described in the present disclosure may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by the computing unit 601, one or more steps of the method described in the present disclosure may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the method described in the present disclosure in any other appropriate manner (e.g., by means of firmware).

[0087] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can 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.

[0088] 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.

[0089] 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 equipment. 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 equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, 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 portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0090] 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).

[0091] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end 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: a local area network (LAN), a wide area network (WAN), and the Internet.

[0092] 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 virtual private servers (VPS). The server may also be a server of a distributed system, or a server combined with a blockchain. Cloud computing refers to a shared physical or virtual resource pool that is elastically scalable through network access. Resources may include servers, operating systems, networks, software, applications, and storage devices, etc., and a technical system that can deploy and manage resources in an on-demand, self-service manner. Through cloud computing technology, efficient and powerful data processing capabilities can be provided for technical applications such as artificial intelligence and blockchain, and model training.

[0093] 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.

[0094] 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 annotation method, comprising: Parsing the rich document to be processed, and generating a annotation interface corresponding to the content type included in the rich document according to the parsing result; The annotation interface includes: a text annotation interface, a table annotation interface and a picture annotation interface, wherein the picture annotation interface includes each character in the picture recognized by optical character recognition technology and its position; Generate a key-value pair according to the operation performed by the user on the annotation interface, including: for each cell in the table content displayed on the table annotation interface, respectively obtain the category set by the user, the category includes a key and a value, and obtain the direction information of the value corresponding to the cell whose category is set by the user as a key, and generate a key-value pair according to the setting made by the user, wherein for each cell, a button for direction selection is displayed respectively, and in response to determining that the user clicks any button, the direction information available for the user to select is displayed, and the direction information clicked by the user is used as the direction information of the value corresponding to the cell corresponding to the button; for the text information in the picture content displayed in the picture annotation interface, obtain the content selected by the user as the key and the corresponding value, and generate a key-value pair according to the obtained content; and use the obtained key-value pair as the data annotation result.

2. The method according to claim 1, wherein: The generating of the annotation interface corresponding to the content type included in the rich document includes: When the rich document includes text content, generating a corresponding text annotation interface, wherein the text annotation interface includes the text content; When the rich document includes table content, a corresponding table annotation interface is generated, wherein the table annotation interface includes the table content; When the rich document includes picture content, a corresponding picture annotation interface is generated, and the picture annotation interface includes the picture content.

3. The method according to claim 1, wherein: When the annotation interface is a text annotation interface, the key-value pair generated according to the operation performed by the user on the annotation interface includes one or all of the following: For the text content displayed in the text annotation interface, obtain the content selected by the user as the key and the corresponding value, and generate a key-value pair according to the obtained content; For the text content displayed in the text annotation interface, the content selected by the user as a value is obtained, and the key corresponding to the obtained value is determined, and a key-value pair is generated according to the determined key and the obtained value.

4. The method according to any one of claims 1 to 3, further comprising: The obtained key-value pairs are stored in a predetermined format.

5. The method according to claim 4, further comprising: For any key-value pair, store one or all of the following information: location information, direction information; The position information is the position information of the key and / or value in the key-value pair in the rich document, and the direction information is the direction information of the value in the key-value pair relative to the key.

6. A data annotation device, comprising: Parsing module and annotation module; The parsing module is used to parse the rich document to be processed and generate a annotation interface corresponding to the content type included in the rich document according to the parsing result; The annotation interface includes: a text annotation interface, a table annotation interface and a picture annotation interface, wherein the picture annotation interface includes each character in the picture recognized by optical character recognition technology and its position; The annotation module is used to generate a key-value pair according to the operation performed by the user on the annotation interface, including: for each cell in the table content displayed on the table annotation interface, respectively obtaining the category set by the user, the category including a key and a value, and obtaining the direction information of the value corresponding to the cell whose category is set by the user as a key, and generating a key-value pair according to the setting made by the user, wherein for each cell, a button for direction selection is displayed respectively, and in response to determining that the user clicks any button, the direction information available for the user to select is displayed, and the direction information clicked by the user is used as the direction information of the value corresponding to the cell corresponding to the button; for the text information in the picture content displayed in the picture annotation interface, obtaining the content selected by the user as the key and the corresponding value, and generating a key-value pair according to the obtained content; and using the obtained key-value pair as the data annotation result.

7. The device according to claim 6, wherein: When the rich document includes text content, the parsing module generates a corresponding text annotation interface, which includes the text content; when the rich document includes table content, the parsing module generates a corresponding table annotation interface, which includes the table content; when the rich document includes picture content, the parsing module generates a corresponding picture annotation interface, which includes the picture content.

8. The device according to claim 6, wherein: The annotation module obtains the content selected by the user as a key and a corresponding value from the text content displayed in the text annotation interface, and generates a key-value pair according to the obtained content; And / or, the annotation module obtains the content selected by the user as a value from the text content displayed in the text annotation interface, determines the key corresponding to the obtained value, and generates a key-value pair based on the determined key and the obtained value.

9. The device according to any one of claims 6 to 8, wherein: The labeling module is further used to store each key-value pair obtained in a predetermined format.

10. The device according to claim 9, wherein: The annotation module is further used to store one or all of the following information for any key-value pair: position information and direction information; wherein the position information is the position information of the key and / or value in the key-value pair in the rich document, and the direction information is the direction information of the value in the key-value pair relative to the key.

11. An electronic device, comprising: 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.

12. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to make a computer execute the method according to any one of claims 1-5.

13. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 5.